Bug#297000: update-grub loops when it sees an unexpected/nonexistent kernel version

Matthias Urlichs Matthias Urlichs <smurf@smurf.noris.de>, 297000@bugs.debian.org
Sat, 26 Feb 2005 10:08:14 +0100


Package: grub
Severity: important
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Repeat by "echo test >/boot/vmlinuz" and running update-grub.

Seen on Ubuntu, but it seems to apply to the Debian version too.

- --- debian/changelog.orig	2005-02-26 10:01:40 +0100
+++ debian/changelog	2005-02-26 09:59:22 +0100
@@ -1,3 +1,9 @@
+grub (0.95+cvs20040624-14ubuntu2) hoary; urgency=low
+
+  * A kernel named /boot/vmlinuz caused update-grub to loop infinitely.
+
+ -- Matthias Urlichs <smurf@debian.org>  Sat, 26 Feb 2005 09:58:20 +0100
+
 grub (0.95+cvs20040624-14ubuntu1) hoary; urgency=low
 
   * Resynchronise with Debian.
- --- debian/update-grub.orig	2005-02-26 10:01:19 +0100
+++ debian/update-grub	2005-02-26 10:01:24 +0100
@@ -542,7 +542,13 @@
 			if [ -n "$currentOpt" ] ; then
 				break
 			fi
+
+			oldversion="$version"
 			version=$(echo $version | sed 's/_\?[0-9]*$//')
+			if [ "$version" = "$oldversion" ] ; then
+				# Break infinite loop, if the version isn't what we expect
+				break
+			fi
 		done
 	fi
 

- -- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (730, 'testing'), (620, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.11-rc3-1.19
Locale: LANG=en_US.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFCIDx+8+hUANcKr/kRApInAJwI0tGNqZTKlPD6juhEdGua+pgqSwCdHJcX
etBgin5zRpX7iDfPmqFSPA4=
=7RNh
-----END PGP SIGNATURE-----