update-grub generates wrong automagic entries if the name of the kernel contains a "+"

Bug #13998 reported by Debian Bug Importer
6
Affects Status Importance Assigned to Milestone
grub (Debian)
Fix Released
Unknown
grub (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Automatically imported from Debian bug report #299528 http://bugs.debian.org/299528

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Automatically imported from Debian bug report #299528 http://bugs.debian.org/299528

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <email address hidden>
Date: Mon, 14 Mar 2005 19:38:35 +0100
From: Manfred Heubach <email address hidden>
To: Debian Bug Tracking System <email address hidden>
Subject: update-grub generates wrong automagic entries if the name of the kernel
 contains a "+"

Package: grub
Version: 0.95+cvs20040624-15
Severity: critical
Justification: breaks the whole system

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

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

-- no debconf information

Further information:
====================

in /boot I have a kernel image named vmlinuz-2.4.27+acl+ctx
update grub generates this line in menu.lst:

kernel /vmlinuz-2.4.27+acl+ctx +acl+ctx

but it should be

kernel /vmlinuz-2.4.27+acl+ctx root=dev/hda5 ro acpi=force

kernel versions without a "+" in the name work well.

Revision history for this message
Matt Zimmerman (mdz) wrote :

Stock kernels don't contain '+', downgrading

Revision history for this message
In , Mike O'Connor (stew) wrote : patch

299528 tags +patch

It looks like -15 introduced a "fix" to the code that searched for $kopt
variables. This patch improves that fix and fixes this bug by replacing
+ with _ when looking for $kopt variables.

--- /sbin/update-grub 2005-02-17 18:20:22.000000000 -0500
+++ /tmp/update-grub 2005-03-19 10:56:15.000000000 -0500
@@ -529,7 +529,7 @@
        kernel_version=$1

        version=$(echo $kernel_version | sed 's/^[^0-9]*//')
- version=$(echo $kernel_version | sed 's/[.-]/_/g')
+ version=$(echo $version | sed 's/[-\+\.]/_/g')
        if [ -n "$version" ] ; then
                while [ -n "$version" ] ; do
                        currentOpt="$(eval "echo \$kopt_$version")"

Revision history for this message
In , Mike O'Connor (stew) wrote : 299528

tags 299528 +patch

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <email address hidden>
Date: Sat, 19 Mar 2005 11:02:34 -0500
From: Mike O'Connor <email address hidden>
To: <email address hidden>
Subject: patch

299528 tags +patch

It looks like -15 introduced a "fix" to the code that searched for $kopt
variables. This patch improves that fix and fixes this bug by replacing
+ with _ when looking for $kopt variables.

--- /sbin/update-grub 2005-02-17 18:20:22.000000000 -0500
+++ /tmp/update-grub 2005-03-19 10:56:15.000000000 -0500
@@ -529,7 +529,7 @@
        kernel_version=$1

        version=$(echo $kernel_version | sed 's/^[^0-9]*//')
- version=$(echo $kernel_version | sed 's/[.-]/_/g')
+ version=$(echo $version | sed 's/[-\+\.]/_/g')
        if [ -n "$version" ] ; then
                while [ -n "$version" ] ; do
                        currentOpt="$(eval "echo \$kopt_$version")"

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <email address hidden>
Date: Sat, 19 Mar 2005 11:45:19 -0500
From: Mike O'Connor <email address hidden>
To: <email address hidden>
Subject: 299528

tags 299528 +patch

Revision history for this message
In , Jason Thomas (jason-debian) wrote : Bug#299528: fixed in grub 0.95+cvs20040624-16

Source: grub
Source-Version: 0.95+cvs20040624-16

We believe that the bug you reported is fixed in the latest version of
grub, which is due to be installed in the Debian FTP archive:

grub-disk_0.95+cvs20040624-16_all.deb
  to pool/main/g/grub/grub-disk_0.95+cvs20040624-16_all.deb
grub-doc_0.95+cvs20040624-16_all.deb
  to pool/main/g/grub/grub-doc_0.95+cvs20040624-16_all.deb
grub_0.95+cvs20040624-16.diff.gz
  to pool/main/g/grub/grub_0.95+cvs20040624-16.diff.gz
grub_0.95+cvs20040624-16.dsc
  to pool/main/g/grub/grub_0.95+cvs20040624-16.dsc
grub_0.95+cvs20040624-16_i386.deb
  to pool/main/g/grub/grub_0.95+cvs20040624-16_i386.deb

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to <email address hidden>,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Jason Thomas <email address hidden> (supplier of updated grub package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing <email address hidden>)

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

Format: 1.7
Date: Sun, 20 Mar 2005 10:25:41 +1100
Source: grub
Binary: grub-disk grub grub-doc
Architecture: source i386 all
Version: 0.95+cvs20040624-16
Distribution: unstable
Urgency: low
Maintainer: Grub Maintainers <email address hidden>
Changed-By: Jason Thomas <email address hidden>
Description:
 grub - GRand Unified Bootloader
 grub-disk - GRUB bootable disk image
 grub-doc - Documentation for GRand Unified Bootloader
Closes: 278529 283072 284731 291733 296724 299528
Changes:
 grub (0.95+cvs20040624-16) unstable; urgency=low
 .
   * update-grub: fix kopt parsing to handle + signs in kernel versions
     (closes: #299528)
   * update-grub: fix variable parsing in get_kernel_opt function.
     (closes: #296724)
   * update-grub: don't add savedefault entry to memtest86 entries.
     (closes: #291733)
   * update-grub: fixed spelling mistake
     (closes: #283072)
   * update-grub: remove temp files
     (closes: #284731)
   * grub-floppy: fixed shell expansion
     finally a nice patch from "Clement 'nodens' Hermann"
     (closes: #278529)
Files:
 b16f3d68402c199c3b508904f41d7606 888 admin optional grub_0.95+cvs20040624-16.dsc
 1e45e160b11bebf0690168c74f744f26 58356 admin optional grub_0.95+cvs20040624-16.diff.gz
 651192b75e87f0814d07aa94d113df32 358842 admin optional grub_0.95+cvs20040624-16_i386.deb
 03e13d8d4d653f8b6af921e205069a4d 228152 admin optional grub-disk_0.95+cvs20040624-16_all.deb
 ba32b67ec88fe263ddbdcb4a02ed3a87 259724 doc optional grub-doc_0.95+cvs20040624-16_all.deb

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

iD8DBQFCPLWf7cYwRJJSiL4RAtjqAJ0dqm28ecErex03XLom0b2RCTM2NQCg8avc
o1MQ0SyDML12chnURUzQm1k=
=er29
-----END PGP SIGNATURE-----

Revision history for this message
Debian Bug Importer (debzilla) wrote :
Download full text (3.1 KiB)

Message-Id: <email address hidden>
Date: Sat, 19 Mar 2005 18:47:08 -0500
From: Jason Thomas <email address hidden>
To: <email address hidden>
Subject: Bug#299528: fixed in grub 0.95+cvs20040624-16

Source: grub
Source-Version: 0.95+cvs20040624-16

We believe that the bug you reported is fixed in the latest version of
grub, which is due to be installed in the Debian FTP archive:

grub-disk_0.95+cvs20040624-16_all.deb
  to pool/main/g/grub/grub-disk_0.95+cvs20040624-16_all.deb
grub-doc_0.95+cvs20040624-16_all.deb
  to pool/main/g/grub/grub-doc_0.95+cvs20040624-16_all.deb
grub_0.95+cvs20040624-16.diff.gz
  to pool/main/g/grub/grub_0.95+cvs20040624-16.diff.gz
grub_0.95+cvs20040624-16.dsc
  to pool/main/g/grub/grub_0.95+cvs20040624-16.dsc
grub_0.95+cvs20040624-16_i386.deb
  to pool/main/g/grub/grub_0.95+cvs20040624-16_i386.deb

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to <email address hidden>,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Jason Thomas <email address hidden> (supplier of updated grub package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing <email address hidden>)

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

Format: 1.7
Date: Sun, 20 Mar 2005 10:25:41 +1100
Source: grub
Binary: grub-disk grub grub-doc
Architecture: source i386 all
Version: 0.95+cvs20040624-16
Distribution: unstable
Urgency: low
Maintainer: Grub Maintainers <email address hidden>
Changed-By: Jason Thomas <email address hidden>
Description:
 grub - GRand Unified Bootloader
 grub-disk - GRUB bootable disk image
 grub-doc - Documentation for GRand Unified Bootloader
Closes: 278529 283072 284731 291733 296724 299528
Changes:
 grub (0.95+cvs20040624-16) unstable; urgency=low
 .
   * update-grub: fix kopt parsing to handle + signs in kernel versions
     (closes: #299528)
   * update-grub: fix variable parsing in get_kernel_opt function.
     (closes: #296724)
   * update-grub: don't add savedefault entry to memtest86 entries.
     (closes: #291733)
   * update-grub: fixed spelling mistake
     (closes: #283072)
   * update-grub: remove temp files
     (closes: #284731)
   * grub-floppy: fixed shell expansion
     finally a nice patch from "Clement 'nodens' Hermann"
     (closes: #278529)
Files:
 b16f3d68402c199c3b508904f41d7606 888 admin optional grub_0.95+cvs20040624-16.dsc
 1e45e160b11bebf0690168c74f744f26 58356 admin optional grub_0.95+cvs20040624-16.diff.gz
 651192b75e87f0814d07aa94d113df32 358842 admin optional grub_0.95+cvs20040624-16_i386.deb
 03e13d8d4d653f8b6af921e205069a4d 228152 admin optional grub-disk_0.95+cvs20040624-16_all.deb
 ba32b67ec88fe263ddbdcb4a02ed3a87 259724 doc optional grub-doc_0.95+cvs20040624-16_all.deb

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

iD8DBQFCPLWf7cYwRJJSiL4RAtjqAJ0dqm28ecErex03XLom0b2RCTM2NQCg8avc
o1MQ0SyDML12chnURUzQm1k=
=er29
-----END PGP SIGNATU...

Read more...

Revision history for this message
Tollef Fog Heen (tfheen) wrote :

We have a newer version than where this was fixed; closing.

Changed in grub:
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.