Bug#393079: grub: "default saved" is broken by the new patch

Teodor mteodor at gmail.com
Wed Apr 2 20:25:47 UTC 2008


package grub
reopen 393079
found 393079 0.97-32
found 393079 0.97-35
stop

Followup-For: Bug #39307
Package: grub
Version: 0.97-35

Another two options were introduced in /boot/grub/menu.lst that affect
'update-grub':
## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=true

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=true

Given that I have "default saved" any execution of update-grub fails with:
piti:~# 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 ...
expr: non-numeric argument

I've executed the script with debug and found this:
piti:~# bash -ex /usr/sbin/update-grub
[..]
+ use_grub_set_default=false
+ test true = true
++ sed -ne 's/^[[:blank:]]*default[[:blank:]]*\(.*\).*/\1/p' /boot/grub/menu.lst
+ defaultEntryNumber=saved
+ '[' saved = saved ']'
++ sed q /boot/grub/default
+ defaultEntryNumber=default
+ use_grub_set_default=true
+ test -n default
++ expr default + 1
expr: non-numeric argument
+ defaultEntryNumberPlusOne=
piti:~#

This is the line from the script that fails:
defaultEntryNumberPlusOne=$(expr $defaultEntryNumber \+ 1);

Obviously it fails because $defaultEntryNumber is 'saved', not an integer.

PS: grub does not depend or recommend 'bash' but the script starts with:
#!/bin/bash
I recommend to remove the "bashism" and replace the interpreter to
/bin/sh because for "lenny" this is a release goal.

Thanks


-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.22-3-amd64 (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 grub depends on:
ii  grub-common              1.96+20080228-1 GRand Unified Bootloader, version

grub recommends no packages.

-- no debconf information





More information about the Pkg-grub-devel mailing list