Bug#230136: grub: update-grub wrongly detects version for default and previous kernels

Michal Cihar Michal Cihar <michal@cihar.com>, 230136@bugs.debian.org
Wed, 28 Jan 2004 10:58:16 +0100


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

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

Package: grub
Version: 0.93+cvs20031021-8
Severity: important
Tags: patch sid

Version of default and previous kernels is badly detected which leads to
wrong options passed to 2.6 kernel in my case. Attached patch fixes the 
update-grub script.

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux quirk.cic 2.6.0-nijel2 #1 Sat Dec 27 12:57:32 CET 2003 i686
Locale: LANG=C, LC_CTYPE=cs_CZ

Versions of packages grub depends on:
ii  libc6                     2.3.2.ds1-11   GNU C Library: Shared libraries an
ii  libncurses5               5.3.20030719-5 Shared libraries for terminal hand

-- no debconf information


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

--- /sbin/update-grub.orig	2004-01-28 10:47:08.000000000 +0100
+++ /sbin/update-grub	2004-01-28 10:53:25.000000000 +0100
@@ -692,18 +692,18 @@
 
 	echo "Found kernel: $kernel"
 
-	if [ "$kernelVersion" = "vmlinuz" ]; then
-		if [ -L "/boot/$kernelVersion" ]; then
-			kernelVersion=`readlink -f "/boot/$kernelVersion"`
+	if [ "$kernelName" = "vmlinuz" ]; then
+		if [ -L "/boot/$kernelName" ]; then
+			kernelVersion=`readlink -f "/boot/$kernelName"`
 			kernelVersion=$(echo $kernelVersion | sed -e 's/.*vmlinuz-//')
 			kernelVersion="$kernelVersion Default"
 		else
 			kernelVersion="Default"
 		fi
 	fi
-	if [ "$kernelVersion" = "vmlinuz.old" ]; then
-		if [ -L "/boot/$kernelVersion" ]; then
-			kernelVersion=`readlink -f "/boot/$kernelVersion"`
+	if [ "$kernelName" = "vmlinuz.old" ]; then
+		if [ -L "/boot/$kernelName" ]; then
+			kernelVersion=`readlink -f "/boot/$kernelName"`
 			kernelVersion=$(echo $kernelVersion | sed -e 's/.*vmlinuz-//')
 			kernelVersion="$kernelVersion Previous"
 		else

--===============1419876796==--