Package: kexec-tools
Version: 1:2.0.7-3
Severity: important

Dear Maintainer,

When USE_GRUB_CONFIG is true, and GRUB is set as

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true

the init script kexec-load tries to parse the selected kernel in GRUB menu and
calculate
the address from it. But the code doesn't seem to handle the case when the
saved kernel
is something like:

$ cat /boot/grub/grubenv
# GRUB Environment Block
saved_entry=gnulinux-simple-aecbc534-4764-4560-90c1-b02edc56ea23
################################################################
which is the case for stock Debian kernel.

in get_grub_kernel() function, [ "$default" = '${saved_entry}' ] evaluates to
true, so

default=$(sed -ne 's/^saved_entry=//p' /boot/grub/grubenv)

is run, and default is set to "gnulinux-simple-
aecbc534-4764-4560-90c1-b02edc56ea23"
when fed to "start_offset=$((default + 1))", it fails as:

/etc/init.d/kexec-load: 48: /etc/init.d/kexec-load: Illegal number: gnulinux-
simple-aecbc534-4764-4560-90c1-b02edc56ea23

I'm not sure if it's the right string but the parsing code is wrong, or the
string is
totaly wrong.

I'm attaching the grub.cfg.






-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing'), (2, 'unstable')
Architecture: i386 (x86_64)
Foreign Architectures: amd64

Kernel: Linux 3.14.19-lts (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages kexec-tools depends on:
ii  debconf [debconf-2.0]  1.5.53
ii  libc6                  2.19-11

kexec-tools recommends no packages.

kexec-tools suggests no packages.

-- Configuration Files:
/etc/init.d/kexec-load changed [not included]

-- debconf-show failed
#
# 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='hd0,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  
aecbc534-4764-4560-90c1-b02edc56ea23
else
  search --no-floppy --fs-uuid --set=root aecbc534-4764-4560-90c1-b02edc56ea23
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=-1
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-aecbc534-4764-4560-90c1-b02edc56ea23' {
        savedefault
        load_video
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,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  
aecbc534-4764-4560-90c1-b02edc56ea23
        else
          search --no-floppy --fs-uuid --set=root 
aecbc534-4764-4560-90c1-b02edc56ea23
        fi
        echo    'Loading Linux 3.16-2-486 ...'
        linux   /boot/vmlinuz-3.16-2-486 
root=UUID=aecbc534-4764-4560-90c1-b02edc56ea23 ro  quiet
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-3.16-2-486
}
submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 
'gnulinux-advanced-aecbc534-4764-4560-90c1-b02edc56ea23' {
        menuentry 'Debian GNU/Linux, with Linux 3.16-2-486' --class debian 
--class gnu-linux --class gnu --class os $menuentry_id_option 
'gnulinux-3.16-2-486-advanced-aecbc534-4764-4560-90c1-b02edc56ea23' {
        savedefault
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,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  
aecbc534-4764-4560-90c1-b02edc56ea23
                else
                  search --no-floppy --fs-uuid --set=root 
aecbc534-4764-4560-90c1-b02edc56ea23
                fi
                echo    'Loading Linux 3.16-2-486 ...'
                linux   /boot/vmlinuz-3.16-2-486 
root=UUID=aecbc534-4764-4560-90c1-b02edc56ea23 ro  quiet
                echo    'Loading initial ramdisk ...'
                initrd  /boot/initrd.img-3.16-2-486
        }
        menuentry 'Debian GNU/Linux, with Linux 3.16-2-486 (recovery mode)' 
--class debian --class gnu-linux --class gnu --class os $menuentry_id_option 
'gnulinux-3.16-2-486-recovery-aecbc534-4764-4560-90c1-b02edc56ea23' {
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,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  
aecbc534-4764-4560-90c1-b02edc56ea23
                else
                  search --no-floppy --fs-uuid --set=root 
aecbc534-4764-4560-90c1-b02edc56ea23
                fi
                echo    'Loading Linux 3.16-2-486 ...'
                linux   /boot/vmlinuz-3.16-2-486 
root=UUID=aecbc534-4764-4560-90c1-b02edc56ea23 ro single 
                echo    'Loading initial ramdisk ...'
                initrd  /boot/initrd.img-3.16-2-486
        }
        menuentry 'Debian GNU/Linux, with Linux 3.14-2-486' --class debian 
--class gnu-linux --class gnu --class os $menuentry_id_option 
'gnulinux-3.14-2-486-advanced-aecbc534-4764-4560-90c1-b02edc56ea23' {
        savedefault
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,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  
aecbc534-4764-4560-90c1-b02edc56ea23
                else
                  search --no-floppy --fs-uuid --set=root 
aecbc534-4764-4560-90c1-b02edc56ea23
                fi
                echo    'Loading Linux 3.14-2-486 ...'
                linux   /boot/vmlinuz-3.14-2-486 
root=UUID=aecbc534-4764-4560-90c1-b02edc56ea23 ro  quiet
                echo    'Loading initial ramdisk ...'
                initrd  /boot/initrd.img-3.14-2-486
        }
        menuentry 'Debian GNU/Linux, with Linux 3.14-2-486 (recovery mode)' 
--class debian --class gnu-linux --class gnu --class os $menuentry_id_option 
'gnulinux-3.14-2-486-recovery-aecbc534-4764-4560-90c1-b02edc56ea23' {
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,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  
aecbc534-4764-4560-90c1-b02edc56ea23
                else
                  search --no-floppy --fs-uuid --set=root 
aecbc534-4764-4560-90c1-b02edc56ea23
                fi
                echo    'Loading Linux 3.14-2-486 ...'
                linux   /boot/vmlinuz-3.14-2-486 
root=UUID=aecbc534-4764-4560-90c1-b02edc56ea23 ro single 
                echo    'Loading initial ramdisk ...'
                initrd  /boot/initrd.img-3.14-2-486
        }
}

### 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 ###
# GRUB Environment Block
saved_entry=gnulinux-simple-aecbc534-4764-4560-90c1-b02edc56ea23
######################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################

Reply via email to