Bug#346127: update-grub fails with dash if there are no kopt_

Michal Čihař michal at cihar.com
Thu Jan 5 21:11:17 UTC 2006


Package: grub
Version: 0.97-2
Severity: normal
Tags: patch

Hi

as stated it subject update-grub fails to run with dash as /bin/sh if
there is no line like kopt_ in menu.lst. This is caused by passing empty
string to eval, attached patch fixes it.

-- 
    Michal Čihař | http://cihar.com

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/dash
Kernel: Linux 2.6.15-raptor
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages grub depends on:
ii  libc6                         2.3.5-11   GNU C Library: Shared libraries an
ii  libncurses5                   5.5-1      Shared libraries for terminal hand

grub recommends no packages.

-- no debconf information
-------------- next part --------------
--- /tmp/update-grub	2006-01-05 22:02:50.826639000 +0100
+++ /sbin/update-grub	2006-01-05 21:02:07.744658500 +0100
@@ -635,7 +635,8 @@
 test -z "$(GetMenuOpt "kopt" "")" && kopt_2_6="root=$root_device_2_6 ro"
 
 # Extract options for specific kernels
-eval $(ExtractMenuOpts "\(kopt_[a-zA-Z0-9_]\+\)")
+opts="$(ExtractMenuOpts "\(kopt_[a-zA-Z0-9_]\+\)")"
+test -z "$opts" || eval "$opts"
 CustomKopts=$(GetMenuOpts "\(kopt_[a-zA-Z0-9_]\+\)")
 
 # Extract the grub root


More information about the Pkg-grub-devel mailing list