On 12-07-19 08:07 AM, Michael Biebl wrote: > > It seems it actually does both: during thaw and boot. This is from > save-kernel-for-hibernate.conf: > > # make sure any previous hibernate grub menu item is cleared out > grub-mkconfig >/boot/grub/grub.cfg > > I assume this was done in case of a failed thaw?
Indeed. I had a failed thaw just yesterday in fact. That's one reason we do have to update grub in the boot path, unfortunately. Now, granted, it could be a little smarter and only run that if a resume-from-hibernate entry is found in the grub file, then it only slows down boots from failed thaws, which should hopefully be next to never -- although my failed thaw yesterday proves it's not never at all. > Right, but 20_linux_xen is shipped and maintained by the grub maintainers. Well, I don't really care one way or the other who ships and maintains it. I'm not entirely optimistic about them accepting it since it depends on how pm-utils does it's kernel stashing and needs to maintain parity with that. I suppose we could have both pm-utils and grub look in an /etc/default file about where kernels are stashed, etc. But yeah, if the grub maintainers accept that functionality, I have no problem with it being in grub. > While we are talking about grub, there is something which has been > bugging me for quite a while: > Consider you have different operating systems or multiple kernels > installed on your machine. After a hibernate, grub should not show the > full menu which lets you select an alternative kernel / system, but > immediately load the kernel which as used for hibernation. Yes, indeed. I actually tried to add a new top-level menu in my own grub when I was experimenting with all of this, so that the top level showed only the "resume from hibernate" option plus one other option "Boot a new kernel" which was a sub-menu that was just the usual top-level menu of your various kernels and other operating systems. Multiple levels of sub-menus didn't seem to work though, despite the grub folks saying they should, IIRC. > If you have a shared partition between different systems and you boot > into the wrong one, i.e. not the one which was used for hibernation, you > risk data loss otherwise Do you mean one root filesystem that is used by multiple grub entries for example? And you hibernate while booted on that shared root but then boot a new/fresh system on it after hibernating on it? I could see how that could be a problem. So then perhaps after a hibernate there is no "boot other system" option at all and the only option is to resume? In such a case, I guess we don't even need a menu. Grub should just boot the hibernation kernel without any pause or menu. > So if we are going to mangle the grub entries anyway, maybe we can fix > this issue while at it. OK. Cheers, b.
signature.asc
Description: OpenPGP digital signature