ok i know, many people would say "old!"
anyway here there is a quick recipe to remotely safe upgrade a kernel and reboot to (try to) use it:
The recipe:
First, build your new or updated kernel, and place the image in it's final destination (/boot/$kernel_new_ver/ in this recipe):
root@thunder linux # make && make modules_install root@thunder linux # cp System.map /boot/$kernel_new_ver/ root@thunder linux # cp arch/$arch/boot/bzImage /boot/$kernel_new_ver/
Now, edit grub's configuration file and add or edit statements to get the following (note that commands in bold are critical for this feature to work):
[..snip..] default saved fallback 1 [..snip..] # new kernel title Gentoo ($kernel_new_ver) kernel /boot/$kernel_new_ver/bzImage root=/dev/sda1 vga=0x314 panic=5 savedefault fallback [..snip..] # old_known_to_work kernel title Gentoo ($kernel_old_ver) kernel /boot/$kernel_old_ver/bzImage root=/dev/sda1 vga=0x314 panic=5 savedefault [..snip..]
Finally issue the command:
root@thunder linux # grub-set-default 0
to tell which kernel grub should try to fire up at boot.
How it works:
At next system startup grub will try to boot $kernel_new_ver and will increase the set-default counter value (counter + 1), so in case of problems during the boot (eg: kernel panic due the lack of the main disk controller driver), the system will reboot automatically in 5 seconds thanks to the panic=5 statement.
Then at next boot the set-default counter value (now incremented by 1) will tell grub to boot the well known to work $kernel_old_ver, and voila' you are safe!