* Support booting into another GRUB boot entry via ‘grub-reboot’.

This requires grub.conf to honour the saved_entry GRUB environment
  variable.

svn path=/nixos/trunk/; revision=27807
This commit is contained in:
Eelco Dolstra 2011-07-17 11:42:44 +00:00
parent c971f2b1ac
commit 63e9ece771

View File

@ -59,8 +59,27 @@ GRUBEND
cp -f @grub@/share/grub/unicode.pf2 /boot/grub/unicode.pf2
cat > "$1" <<EOF
# Automatically generated. DO NOT EDIT THIS FILE!
set default=@default@
set timeout=@timeout@
if [ -s \$prefix/grubenv ]; then
load_env
fi
# grub-reboot sets a one-time saved entry, which we process here and
# then delete.
if [ "\${saved_entry}" ]; then
# The next line *has* to look exactly like this, otherwise KDM's
# reboot feature won't work properly with GRUB 2.
set default="\${saved_entry}"
set saved_entry=
set prev_saved_entry=
save_env saved_entry
save_env prev_saved_entry
set timeout=1
else
set default=@default@
set timeout=@timeout@
fi
if loadfont $bootRoot/grub/unicode.pf2; then
set gfxmode=640x480
insmod gfxterm