Bug#854013: grub-common: GRUB_DEFAULT=saved/GRUB_SAVEDEFAULT=true does not save default in usable way
Jameson Graef Rollins
jrollins at finestructure.net
Fri Feb 3 01:31:42 UTC 2017
Package: grub-common
Version: 2.02~beta3-3
Severity: normal
Grub on this machine has been configured to boot into the previously selected entry:
GRUB_DEFAULT=saved
GRUB_SAVEDDEFAULT=true
However, grub is not booting into the saved entry. The entry being
selected is the fourth entry in the first submenu, i.e.:
submenu 'Advanced options for Debian GNU/Linux'
menuentry 'Debian GNU/Linux, with Linux 3.2.0-rts-amd64'
What is being stored in the grubenv is:
controls at eve:~ 0$ grub-editenv list
saved_entry=4
controls at eve:~ 0$
It appears that '4' is not a valid number to map to the correct
menuentry, so grub is therefore falling back to first menuentry.
If GRUB_DEFAULT is set to:
GRUB_DEFAULT='Advanced options for Debian GNU/Linux>Debian GNU/Linux, with Linux 3.2.0-rts-amd64'
Then it does boot correctly.
Thanks for maintaining.
jamie.
-- Package-specific info:
*********************** BEGIN /proc/mounts
/dev/sda1 / ext4 rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered 0 0
*********************** END /proc/mounts
*********************** BEGIN /boot/grub/device.map
(hd0) /dev/disk/by-id/usb-_USB_FLASH_DRIVE_1981160802E3-0:0
(hd1) /dev/disk/by-id/ata-Hitachi_HUA722010CLA330_JPW9K0N13RUV4L
*********************** END /boot/grub/device.map
*********************** BEGIN /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="${saved_entry}"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd1,msdos1' 225dc4b7-fd01-4d1c-8312-b28b03a58281
else
search --no-floppy --fs-uuid --set=root 225dc4b7-fd01-4d1c-8312-b28b03a58281
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=1280x1024
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=30
else
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=5
fi
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-225dc4b7-fd01-4d1c-8312-b28b03a58281' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd1,msdos1' 225dc4b7-fd01-4d1c-8312-b28b03a58281
else
search --no-floppy --fs-uuid --set=root 225dc4b7-fd01-4d1c-8312-b28b03a58281
fi
echo 'Loading Linux 3.16.0-4-amd64 ...'
linux /boot/vmlinuz-3.16.0-4-amd64 root=UUID=225dc4b7-fd01-4d1c-8312-b28b03a58281 ro quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.16.0-4-amd64
}
submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-225dc4b7-fd01-4d1c-8312-b28b03a58281' {
menuentry 'Debian GNU/Linux, with Linux 3.16.0-4-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-4-amd64-advanced-225dc4b7-fd01-4d1c-8312-b28b03a58281' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd1,msdos1' 225dc4b7-fd01-4d1c-8312-b28b03a58281
else
search --no-floppy --fs-uuid --set=root 225dc4b7-fd01-4d1c-8312-b28b03a58281
fi
echo 'Loading Linux 3.16.0-4-amd64 ...'
linux /boot/vmlinuz-3.16.0-4-amd64 root=UUID=225dc4b7-fd01-4d1c-8312-b28b03a58281 ro quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.16.0-4-amd64
}
menuentry 'Debian GNU/Linux, with Linux 3.16.0-4-amd64 (sysvinit)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-4-amd64-init-sysvinit-225dc4b7-fd01-4d1c-8312-b28b03a58281' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd1,msdos1' 225dc4b7-fd01-4d1c-8312-b28b03a58281
else
search --no-floppy --fs-uuid --set=root 225dc4b7-fd01-4d1c-8312-b28b03a58281
fi
echo 'Loading Linux 3.16.0-4-amd64 ...'
linux /boot/vmlinuz-3.16.0-4-amd64 root=UUID=225dc4b7-fd01-4d1c-8312-b28b03a58281 ro quiet init=/lib/sysvinit/init
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.16.0-4-amd64
}
menuentry 'Debian GNU/Linux, with Linux 3.16.0-4-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-4-amd64-recovery-225dc4b7-fd01-4d1c-8312-b28b03a58281' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd1,msdos1' 225dc4b7-fd01-4d1c-8312-b28b03a58281
else
search --no-floppy --fs-uuid --set=root 225dc4b7-fd01-4d1c-8312-b28b03a58281
fi
echo 'Loading Linux 3.16.0-4-amd64 ...'
linux /boot/vmlinuz-3.16.0-4-amd64 root=UUID=225dc4b7-fd01-4d1c-8312-b28b03a58281 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.16.0-4-amd64
}
menuentry 'Debian GNU/Linux, with Linux 3.2.0-rts-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.2.0-rts-amd64-advanced-225dc4b7-fd01-4d1c-8312-b28b03a58281' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd1,msdos1' 225dc4b7-fd01-4d1c-8312-b28b03a58281
else
search --no-floppy --fs-uuid --set=root 225dc4b7-fd01-4d1c-8312-b28b03a58281
fi
echo 'Loading Linux 3.2.0-rts-amd64 ...'
linux /boot/vmlinuz-3.2.0-rts-amd64 root=UUID=225dc4b7-fd01-4d1c-8312-b28b03a58281 ro quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.2.0-rts-amd64
}
menuentry 'Debian GNU/Linux, with Linux 3.2.0-rts-amd64 (sysvinit)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.2.0-rts-amd64-init-sysvinit-225dc4b7-fd01-4d1c-8312-b28b03a58281' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd1,msdos1' 225dc4b7-fd01-4d1c-8312-b28b03a58281
else
search --no-floppy --fs-uuid --set=root 225dc4b7-fd01-4d1c-8312-b28b03a58281
fi
echo 'Loading Linux 3.2.0-rts-amd64 ...'
linux /boot/vmlinuz-3.2.0-rts-amd64 root=UUID=225dc4b7-fd01-4d1c-8312-b28b03a58281 ro quiet init=/lib/sysvinit/init
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.2.0-rts-amd64
}
menuentry 'Debian GNU/Linux, with Linux 3.2.0-rts-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.2.0-rts-amd64-recovery-225dc4b7-fd01-4d1c-8312-b28b03a58281' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd1,msdos1' 225dc4b7-fd01-4d1c-8312-b28b03a58281
else
search --no-floppy --fs-uuid --set=root 225dc4b7-fd01-4d1c-8312-b28b03a58281
fi
echo 'Loading Linux 3.2.0-rts-amd64 ...'
linux /boot/vmlinuz-3.2.0-rts-amd64 root=UUID=225dc4b7-fd01-4d1c-8312-b28b03a58281 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.2.0-rts-amd64
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
*********************** END /boot/grub/grub.cfg
*********************** BEGIN /proc/mdstat
cat: /proc/mdstat: No such file or directory
*********************** END /proc/mdstat
*********************** BEGIN LVM
*********************** END LVM
*********************** BEGIN /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root 9 Feb 2 15:46 ata-ATAPI_iHAS124_E_3524665_2H7410510687 -> ../../sr0
lrwxrwxrwx 1 root root 9 Feb 2 15:46 ata-Hitachi_HUA722010CLA330_JPW9K0N13RUV4L -> ../../sda
lrwxrwxrwx 1 root root 10 Feb 2 15:46 ata-Hitachi_HUA722010CLA330_JPW9K0N13RUV4L-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Feb 2 15:46 ata-Hitachi_HUA722010CLA330_JPW9K0N13RUV4L-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Feb 2 15:46 ata-Hitachi_HUA722010CLA330_JPW9K0N13RUV4L-part5 -> ../../sda5
lrwxrwxrwx 1 root root 9 Feb 2 15:46 wwn-0x5000cca39cf4a7b0 -> ../../sda
lrwxrwxrwx 1 root root 10 Feb 2 15:46 wwn-0x5000cca39cf4a7b0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Feb 2 15:46 wwn-0x5000cca39cf4a7b0-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Feb 2 15:46 wwn-0x5000cca39cf4a7b0-part5 -> ../../sda5
*********************** END /dev/disk/by-id
*********************** BEGIN /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 Feb 2 15:46 225dc4b7-fd01-4d1c-8312-b28b03a58281 -> ../../sda1
lrwxrwxrwx 1 root root 10 Feb 2 15:46 acf19331-c0ee-4ca2-8d6c-5b7c8f5fa8a3 -> ../../sda5
*********************** END /dev/disk/by-uuid
-- System Information:
Debian Release: 8.7
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable'), (101, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 3.2.0-rts-amd64 (SMP w/10 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages grub-common depends on:
ii gettext-base 0.19.3-2
ii libc6 2.19-18+deb8u7
ii libdevmapper1.02.1 2:1.02.90-2.2+deb8u1
ii libfreetype6 2.5.2-3+deb8u1
ii libfuse2 2.9.3-15+deb8u2
ii liblzma5 5.1.1alpha+20120614-2+b3
Versions of packages grub-common recommends:
ii os-prober 1.65
Versions of packages grub-common suggests:
ii console-setup 1.123
pn desktop-base <none>
pn grub-emu <none>
pn multiboot-doc <none>
pn xorriso <none>
-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20170202/0782f5f8/attachment-0001.sig>
More information about the Pkg-grub-devel
mailing list