I want to upgrade kernel remotely. I wrote fallback configuration for grub, example "fallback 1". I call grub-set-default 0 to set default new kernel. I add new line to grub item: "savedefault fallback". Is it possible make so, if root device fails, initrd will reboot computer. And it boots not new, but fallback kernel. Reproducible: Always Steps to Reproduce: 1. add menu item with root=/dev/not/exists and savedefault fallback 2. reboot computer 3. Actual Results: boot new item and prompts shell or root I Expected Results: I want just reboot with fallback configuration.
Feel free to submit a patch for that. The machine *should* reboot on a kernel panic after 180 seconds, which is the kernel default. If it doesn't, then we might need to poke the kernel to do it. Also, you can change the value on the kernel command line. panic=10 changes the timeout to 10 seconds. There's really no need for genkernel itself to do anything. I'm not really sure how to get grub to boot an alternate entry, so that's kinda out of the scope of genkernel.
Machine reboots at kernel panic. Here is not kernel panic, here is prompt of root device or shell. My grub config (it woks fine, I run grub-set-default and reboot): default saved fallback 1 timeout 5 # Genkernel generated entry, see GRUB documentation for details title=Gentoo Linux (2.6.20-gentoo-r1.1) root (hd0,0) kernel /kernel-genkernel-x86_64-2.6.20-gentoo-r1.1 root=/dev/ram0 init=/linuxrc real_root=/dev/cluster/system dolvm2 initrd /initramfs-genkernel-x86_64-2.6.20-gentoo-r1.1 savedefault fallback # Genkernel generated entry, see GRUB documentation for details title=Gentoo Linux (2.6.20-gentoo.1) root (hd0,0) kernel /kernel-genkernel-x86_64-2.6.20-gentoo.1 root=/dev/ram0 init=/linuxrc real_root=/dev/cluster/system dolvm2 initrd /initramfs-genkernel-x86_64-2.6.20-gentoo.1