Bug#309446: update-grub: kernel list is bad if files matching dpkg-* exist in cwd

Mark Hindess Mark Hindess <debian@beanz.uklinux.net>, 309446@bugs.debian.org
Tue, 17 May 2005 10:43:52 +0100


Package: grub
Version: 0.95+cvs20040624-17
Severity: normal


If you execute update-grub in a directory with multiple files matching
"dpkg-*" then it generates an invalid list of kernels.  The problem
is caused by this line:

  for kern in $(/bin/ls -1vr /boot/vmlinuz-* | grep -v dpkg-*) ; do

For instance on a machine with dpkg-dev installed, if you execute
update-grub in /var/lib/dpkg/info then 'grep -v dpkg-*' expands to:

  grep -v dpkg-dev.conffiles dpkg-dev.list

which effectively adds each line of dpkg-dev.list to the kernel list.

I'm not sure exactly what the "grep -v" is trying to prevent but
a possible solution would be to quote the pattern.

Regards,
 Mark.

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing'), (50, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.11.6-dark1
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages grub depends on:
ii  libc6                       2.3.2.ds1-21 GNU C Library: Shared libraries an
ii  libncurses5                 5.4-4        Shared libraries for terminal hand

-- no debconf information