Bug 77422 - mkinitrd gives syntax error (line 315) when kudzu detects >1 SCSI device
mkinitrd gives syntax error (line 315) when kudzu detects >1 SCSI device
Status: CLOSED NEXTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: mkinitrd (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Jones
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-11-06 15:37 EST by Paul Clements
Modified: 2007-04-18 12:48 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-08-04 16:32:16 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Paul Clements 2002-11-06 15:37:40 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020830

Description of problem:
mkinitrd displays a shell syntax error:

/sbin/mkinitrd: line 315: [: too many arguments

The fix is as follows, I believe:

--- /sbin/mkinitrd.ORIG 2002-11-06 15:30:10.000000000 -0500
+++ /sbin/mkinitrd      2002-11-06 15:30:39.000000000 -0500
@@ -311,7 +311,7 @@
        dev=$(mount | awk "/ on ${esc} / { print \$1 }" | sed 's/[0-9]*$//' |
cut -d/ -f3)
        if [ "$(echo $dev | cut -c1-2)" = sd ]; then
            host=$(kudzu --probe -b scsi |
-             gawk '/^device: '${dev}'/,/^host:/ { if (/^host/) print $2; }') 
+             gawk '/^device: '${dev}'/,/^host:/ { if (/^host/) { print $2;
exit; } }') 
            if [ -d /proc/scsi/usb-storage-${host} ]; then
                needusb=1
            fi


This way, only the first SCSI device that is detected, and matches, will be checked.

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


How reproducible:
Always

Steps to Reproduce:
1.run mkinitrd on a system with more than 1 SCSI device (that kudzu can detect)
and also with root or /boot FS on an sd[a-z] device

	

Actual Results:  syntax error, as described above

Expected Results:  no syntax error, and correct USB handling (not sure if that's
broken because of this or not, I don't actually have USB)

Additional info:
Comment 1 Jeremy Katz 2003-01-05 23:58:27 EST
thanks for the fix, added to cvs and will be in 3.4.34-1
Comment 2 Bill Nottingham 2006-08-04 16:32:16 EDT
Red Hat Linux and Red Hat Powertools are currently no longer supported by Red
Hat, Inc. In an effort to clean up bugzilla, we are closing all bugs in MODIFIED
state for these products.

However, we do want to make sure that nothing important slips through the
cracks. If, in fact, these issues are not resolved in a current Fedora Core
Release (such as Fedora Core 5), please open a new issues stating so. Thanks.

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