Bug 89958 - new-kernel-pkg sets incorrect root= in grub.conf file
new-kernel-pkg sets incorrect root= in grub.conf file
Product: Red Hat Linux
Classification: Retired
Component: mkinitrd (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2003-04-30 07:14 EDT by Need Real Name
Modified: 2007-04-18 12:53 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-05-05 12:33:23 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2003-04-30 07:14:59 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003

Description of problem:
Installing a new kernel in Redhat 9 calls new-kernel-pkg to update
the /boot/grub/grub.conf file. The root= value computed by new-kernel-pkg is
incorrect and the kernel line installed in grub.conf has an invalid argument
(The correct value should be root=/dev/hda2 in my case)

This is acceptable with 2.4 kernels, but a 2.5.65 kernel will refuse to boot,
with an 'invalid root device' message.

The reason is a bad parse of /etc/fstab: the correct value is computed in a
wrong variable.
The bug may also create incorrect lilo.conf files

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.Take a Redhat 9.0 with grub and /etc/fstab starting with LABEL=/ /    
2.Compile and install a new kernel
3. inspect /etc/grub.conf

Actual Results:     kernel /boot/vmlinuz-2.4.20-9 ro root=LABEL=/

Expected Results:     kernel /boot/vmlinuz-2.4.20-9 ro root=/dev/hda2

Additional info:

The following patch corrects the bug
--- /sbin/new-kernel-pkg.DIST   2003-02-18 18:41:17.000000000 +0100
+++ /sbin/new-kernel-pkg        2003-04-29 19:50:49.000000000 +0200
@@ -69,9 +69,9 @@
     short=$(echo $rootdevice | cut -d= -f1)
     if [ "$short" == "LABEL" ]; then
        label=$(echo $rootdevice | cut -d= -f2)
-       device=$(echo "showlabels" | /sbin/nash  --force --quiet | 
+       rootdevice=$(echo "showlabels" | /sbin/nash  --force --quiet | 
                        awk '$2 == "'$label'" {print $1}')
-       if [ -z "$device" ]; then
+       if [ -z "$rootdevice" ]; then
            rootdevice=$(mount | awk '$3 == "/" { print $1 }')
Comment 1 Jeremy Katz 2003-05-05 12:33:23 EDT
No, this is intentional so that labels get used for mounting the rootfs.  This
will work fine as long as you are using an initrd with nash which is what
new-kernel-pkg assumes.
Comment 2 Need Real Name 2003-05-12 10:26:46 EDT
OK I understand the response, but in that case the problem
is that new-kernel-pkg does not work with kernels compiled without
the initrd option - as new-kernel-pkg do not test this case
and set a root=LABEL=/ which cause an error in the boot
So new-kernel-pkg should be smarter - or the initrd should be
mandatory in kernels

Note You need to log in before you can comment on or make changes to this bug.