Bug#268141: update-grub wrongly reads default kernel version

Michal Čihař Michal Čihař , 268141@bugs.debian.org
Wed, 25 Aug 2004 01:25:04 +0200


This is a multi-part MIME message sent by reportbug.

--===============1824181221==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Package: grub
Version: 0.95+cvs20040624-8
Severity: normal
Tags: patch

update-grub script wrongly reads default kernel version, attached patch
fixes it.

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.9-rc1-raptor
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8

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

-- no debconf information

--===============1824181221==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="update-grub.patch"

--- /sbin/update-grub	2004-08-14 20:28:54.000000000 +0200
+++ /tmp/update-grub	2004-08-25 01:21:40.000000000 +0200
@@ -704,9 +704,9 @@
 
 	echo "Found kernel: $kernel"
 
-	if [ "$kernelVersion" = "vmlinuz" ]; then
-		if [ -L "/boot/$kernelVersion" ]; then
-			kernelVersion=`readlink -f "/boot/$kernelVersion"`
+	if [ "$kernelVersion" = "" ]; then
+		if [ -L "/boot/$kernelName" ]; then
+			kernelVersion=`readlink -f "/boot/$kernelName"`
 			kernelVersion=$(echo $kernelVersion | sed -e 's/.*vmlinuz-//')
 			kernelVersion="$kernelVersion Default"
 		else

--===============1824181221==--