Bug 90155 - mkinitrd fails mysteriously when fstab has multiple entries for /
Summary: mkinitrd fails mysteriously when fstab has multiple entries for /
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: mkinitrd   
(Show other bugs)
Version: 9
Hardware: athlon
OS: Linux
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2003-05-03 18:12 UTC by D. Hugh Redelmeier
Modified: 2007-04-18 16:53 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-05-16 22:04:41 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description D. Hugh Redelmeier 2003-05-03 18:12:25 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003

Description of problem:
I mistakenly had two entries for / in /etc/fstab.  As a result, when I installed
an updated kernel RPM, I got the following mysterious message:
# rpm -iv redhat-9up/athlon/kernel-2.4.20-9.athlon.rpm
Preparing packages for installation...
awk: cmd. line:1: $2 == "rhl9
awk: cmd. line:1:       ^ unterminated string

I tracked this down to the script /sbin/new-kernel-pkg:
71          label=$(echo $rootdevice | cut -d= -f2)
72          device=$(echo "showlabels" | /sbin/nash  --force --quiet |
73                          awk '$2 == "'$label'" {print $1}')

This last line becomes malformed after the substitution of $label because $label
contains multiple tokens.  To make the code more robust, enclose the variable
reference in double quotes:
73                          awk '$2 == "'"$label"'" {print $1}')
This should prevent the very obscure message but does nothing to properly report
the problem.

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

How reproducible:
Didn't try but should happen every time.

Steps to Reproduce:
1.have two entries in /etc/fstab for /
2.directly or indirectly run mkinitrd

Additional info:

Comment 1 Jeremy Katz 2003-05-16 22:04:41 UTC
Made it so that we only look at the first entry for / in /etc/fstab, even though
I consider it to be a broken setup.

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