Bug 77422 - mkinitrd gives syntax error (line 315) when kudzu detects >1 SCSI device
Summary: mkinitrd gives syntax error (line 315) when kudzu detects >1 SCSI device
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: mkinitrd
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Peter Jones
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-11-06 20:37 UTC by Paul Clements
Modified: 2007-04-18 16:48 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-08-04 20:32:16 UTC
Embargoed:


Attachments (Terms of Use)

Description Paul Clements 2002-11-06 20:37:40 UTC
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-06 04:58:27 UTC
thanks for the fix, added to cvs and will be in 3.4.34-1

Comment 2 Bill Nottingham 2006-08-04 20:32:16 UTC
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.