LWN.net Logo

Re: why is gurb-menu hidden as default?

Re: why is gurb-menu hidden as default?

Posted Feb 9, 2012 12:06 UTC (Thu) by elanthis (guest, #6227)
Parent article: Re: why is gurb-menu hidden as default?

Somebody's listening, at least.


(Log in to post comments)

Re: why is gurb-menu hidden as default?

Posted Feb 9, 2012 14:19 UTC (Thu) by akumria (subscriber, #7773) [Link]

How would you know that the boot into the new kernel failed?

Isn't this a halting problem?

Re: why is gurb-menu hidden as default?

Posted Feb 9, 2012 14:35 UTC (Thu) by pbonzini (subscriber, #60935) [Link]

Write a 1 in the boot record before boot starts, and write a 0 in the boot record after boot succeeds. It requires cooperation somewhere, of course.

Re: why is gurb-menu hidden as default?

Posted Feb 10, 2012 10:58 UTC (Fri) by dgm (subscriber, #49227) [Link]

This all could be done by grub, just need to add a tool to mark a boot as successful at the end of the boot process. The coperation needed is adding that tool invocation to the end of that process.

Re: why is gurb-menu hidden as default?

Posted Feb 10, 2012 12:49 UTC (Fri) by khim (subscriber, #9252) [Link]

In fact this is how I've done it on servers ten years ago: by default GRUB will boot "rescue kernel" (which is bumped manually) and each successful boot will mark "latest and greatest" kernel as the one to boot "just one more time".

P.S. Actually I lied: I've used not "rescue kernel" but the whole separate "rescue distribution" on a separate partition. This meant that even serious screwups in the upgrade process were only able to bring server down if they somehow managed to kill grub itself (the whole machinery lived on separate partition not related to /boot in both systems).

Re: why is gurb-menu hidden as default?

Posted Feb 9, 2012 14:57 UTC (Thu) by vadim (guest, #35271) [Link]

Rough idea:

Designate an area in /boot for status logging. Have it contain an indication of how far the kernel got into booting. Then once the kernel starts init, leave the rest to userspace.

Have GRUB read that. If the last logged state is in the middle of a boot, then it never completed, and GRUB does whatever is deemed appropiate, like booting the previous kernel, or a known safe kernel with a rescue initrd.

If it's possible to determine the reset time of the system, it might be even possible to distinguish between the kernel getting stuck, and the user pushing the reset button.

One bit of state would suffice (1 = was still booting, 0 = boot complete), but a bit more data would be useful for troubleshooting. Then GRUB could display the result to report to the distribution, which would have an easier time figuring out what went wrong, could provide a better FAQ, and so on.

Re: why is gurb-menu hidden as default?

Posted Feb 9, 2012 17:23 UTC (Thu) by cwillu (subscriber, #67268) [Link]

If your desktop hasn't booted after an hour, something is broken even if it would have booted eventually. Fsck complicates this a bit, but not fatally.

Re: why is gurb-menu hidden as default?

Posted Feb 9, 2012 18:45 UTC (Thu) by jldugger (subscriber, #57576) [Link]

There is nothing computationally complicated about booting, so a simple watchdog timer would suffice.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds