Bug#378243: grub-reboot even with `default saved' has problems, bad update of default

Vaclav Ovsik vaclav.ovsik at i.cz
Fri Jul 13 12:03:36 UTC 2007


Package: grub
Version: 0.97-27
Followup-For: Bug #378243

Hi,
I experiment with grub-reboot and found thing, that is already reported
here. Configuration of default entry in menu.lst must be set do `saved'.
I found another problem with the saving of defult entry, probably in
grub loader itself (no grub-reboot). The whole log follows, but
a shortened chart this:
To short typing I wrote the value from /boot/grub/default as
/boot/grub/default=value.

1.
    /boot/grub/default=0
    grub-reboot 1 (no real reboot)
    /boot/grub/default=0:1
    reboot

2.
    grub loaded entry 1
    /boot/grub/default=0:1
    reboot

3.
    grub loaded entry 0
    /boot/grub/default=0:1
    reboot

4.
    grub loaded entry 0
    /boot/grub/default=0:1
    grub-reboot 1 (no real reboot)
    /boot/grub/default=1:1
    reboot

5.
    grub loaded entry 1
    /boot/grub/default=1:1
    reboot

6.
    grub loaded entry 1
    /boot/grub/default=1	# followed by '\0' and several '\n'

There must be some other place, where grub saves, that next reboot is
`once only'. In round 2 and 3 grub loaded correctly entries 1 and
0 afterwards. Entry in /boot/grub/default was not updated back to
0 anymore. This is a problem on next usage of grub-reboot!
It's all very strange :-).



Script started on Fri Jul 13 12:34:43 2007
lin:~# update-grub 
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found Xen hypervisor 3.0.3-1-i386-pae,  kernel: /vmlinuz-2.6.18-4-xen-686
Found kernel: /vmlinuz-2.6.18-4-686
Updating /boot/grub/menu.lst ... done

lin:~# cat /boot/grub/menu.lst
# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default         saved

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout         5

# Pretty colours
color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title         Windows 95/98/NT/2000
# root          (hd0,0)
# makeactive
# chainloader   +1
#
# title         Linux
# root          (hd0,1)
# kernel        /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/mapper/vg-root ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(single-user) single
# altoptions=(single-user mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## ## End Default Options ##

title           Xen 3.0.3-1-i386-pae / Debian GNU/Linux, kernel 2.6.18-4-xen-686
root            (hd0,0)
kernel          /xen-3.0.3-1-i386-pae.gz
module          /vmlinuz-2.6.18-4-xen-686 root=/dev/mapper/vg-root ro console=tty0
module          /initrd.img-2.6.18-4-xen-686
savedefault

title           Debian GNU/Linux, kernel 2.6.18-4-686
root            (hd0,0)
kernel          /vmlinuz-2.6.18-4-686 root=/dev/mapper/vg-root ro 
initrd          /initrd.img-2.6.18-4-686
savedefault

title           Debian GNU/Linux, kernel 2.6.18-4-686 (single-user mode)
root            (hd0,0)
kernel          /vmlinuz-2.6.18-4-686 root=/dev/mapper/vg-root ro single
initrd          /initrd.img-2.6.18-4-686
savedefault

### END DEBIAN AUTOMAGIC KERNELS LIST
lin:~# grub-set-default 0
Searching for GRUB installation directory ... found: /boot/grub
lin:~# cat /boot/grub/default 
0
#
#
#
#
#
#
#
#
#
#
# WARNING: If you want to edit this file directly, do not remove any line
# from this file, including this warning. Using `grub-set-default\' is
# strongly recommended.
lin:~# grub-reboot 1
Searching for GRUB installation directory ... found: /boot/grub
Probing devices to guess BIOS drives. This may take a long time.


    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

       [ Minimal BASH-like line editing is supported.   For
         the   first   word,  TAB  lists  possible  command
         completions.  Anywhere else TAB lists the possible
         completions of a device/filename. ]
grub> savedefault --once --default=1
grub> quit

Do you want to reboot now? [y/N] 
lin:~# cat /boot/grub/default 
0:1
#
#
#
#
#
#
#
#
#
#
# WARNING: If you want to edit this file directly, do not remove any line
# from this file, including this warning. Using `grub-set-default\' is
# strongly recommended.
lin:~# reboot
lin:~# 
Script done on Fri Jul 13 12:36:19 2007
Script started on Fri Jul 13 12:43:58 2007
lin:~# 
lin:~# 
lin:~# 
lin:~# 
lin:~# uname -a
Linux lin 2.6.18-4-686 #1 SMP Wed May 9 23:03:12 UTC 2007 i686 GNU/Linux
lin:~# cat /boot/grub/default 
0:1
#
#
#
#
#
#
#
#
#
#
# WARNING: If you want to edit this file directly, do not remove any line
# from this file, including this warning. Using `grub-set-default\' is
# strongly recommended.
lin:~# reboot
lin:~# 
lin:~# 
lin:~# 
lin:~# 
Script done on Fri Jul 13 12:44:44 2007
Script started on Fri Jul 13 12:47:19 2007
lin:~# 
lin:~# 
lin:~# 
lin:~# uname -a
Linux lin 2.6.18-4-xen-686 #1 SMP Thu May 10 03:24:35 UTC 2007 i686 GNU/Linux
lin:~# cat /boot/grub/default 
0:1
#
#
#
#
#
#
#
#
#
#
# WARNING: If you want to edit this file directly, do not remove any line
# from this file, including this warning. Using `grub-set-default\' is
# strongly recommended.
lin:~# reboot
lin:~# 
lin:~# 
Script done on Fri Jul 13 12:47:57 2007
Script started on Fri Jul 13 12:50:38 2007
lin:~# 
lin:~# 
lin:~# 
lin:~# uname -a
Linux lin 2.6.18-4-xen-686 #1 SMP Thu May 10 03:24:35 UTC 2007 i686 GNU/Linux
lin:~# cat /boot/grub/default 
0:1
#
#
#
#
#
#
#
#
#
#
# WARNING: If you want to edit this file directly, do not remove any line
# from this file, including this warning. Using `grub-set-default\' is
# strongly recommended.
lin:~# 
lin:~# grub-reboot 1
Searching for GRUB installation directory ... found: /boot/grub
Probing devices to guess BIOS drives. This may take a long time.


    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

       [ Minimal BASH-like line editing is supported.   For
         the   first   word,  TAB  lists  possible  command
         completions.  Anywhere else TAB lists the possible
         completions of a device/filename. ]
grub> savedefault --once --default=1
grub> quit

Do you want to reboot now? [y/N] 
lin:~# cat /boot/grub/default 
1:1
#
#
#
#
#
#
#
#
#
#
# WARNING: If you want to edit this file directly, do not remove any line
# from this file, including this warning. Using `grub-set-default\' is
# strongly recommended.
lin:~# reboot
lin:~# 
lin:~# 
Script done on Fri Jul 13 12:51:39 2007
Script started on Fri Jul 13 12:53:59 2007
lin:~# 
lin:~# 
lin:~# 
lin:~# 
lin:~# uname -a
Linux lin 2.6.18-4-686 #1 SMP Wed May 9 23:03:12 UTC 2007 i686 GNU/Linux
lin:~# cat /boot/grub/default 
1:1
#
#
#
#
#
#
#
#
#
#
# WARNING: If you want to edit this file directly, do not remove any line
# from this file, including this warning. Using `grub-set-default\' is
# strongly recommended.
lin:~# reboot
lin:~# 
lin:~# 
lin:~# 
lin:~# 
lin:~# 
Script done on Fri Jul 13 12:54:36 2007
Script started on Fri Jul 13 13:03:48 2007
lin:~# 
lin:~# 
lin:~# 
lin:~# 
lin:~# uname -a
Linux lin 2.6.18-4-686 #1 SMP Wed May 9 23:03:12 UTC 2007 i686 GNU/Linux
lin:~# cat /boot/grub/default 
1







#
#
#
#
#
#
#
# WARNING: If you want to edit this file directly, do not remove any line
# from this file, including this warning. Using `grub-set-default\' is
# strongly recommended.
lin:~# 
lin:~# 
lin:~# 
lin:~# 
lin:~# grub-set-default 0
Searching for GRUB installation directory ... found: /boot/grub
lin:~# cat /boot/grub/default 
0
#
#
#
#
#
#
#
#
#
#
# WARNING: If you want to edit this file directly, do not remove any line
# from this file, including this warning. Using `grub-set-default\' is
# strongly recommended.
lin:~# reboot
lin:~# 
lin:~# 
Script done on Fri Jul 13 13:04:38 2007
Script started on Fri Jul 13 13:12:31 2007
lin:~# 
lin:~# 
lin:~# uname -a
Linux lin 2.6.18-4-xen-686 #1 SMP Thu May 10 03:24:35 UTC 2007 i686 GNU/Linux
lin:~# cat /boot/grub/default 
0
#
#
#
#
#
#
#
#
#
#
# WARNING: If you want to edit this file directly, do not remove any line
# from this file, including this warning. Using `grub-set-default\' is
# strongly recommended.
lin:~# 
Script done on Fri Jul 13 13:12:41 2007


-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-xen-686
Locale: LANG=C, LC_CTYPE=cs_CZ.ISO-8859-2 (charmap=ISO-8859-2)

Versions of packages grub depends on:
ii  libc6                       2.3.6.ds1-13 GNU C Library: Shared libraries
ii  libncurses5                 5.5-5        Shared libraries for terminal hand

grub recommends no packages.

-- no debconf information




More information about the Pkg-grub-devel mailing list