Bug 87594 - space indented /etc/raidtab is not processed correctly
Summary: space indented /etc/raidtab is not processed correctly
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: mkinitrd
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-03-29 18:54 UTC by Brad Clements
Modified: 2007-04-18 16:52 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2003-04-02 06:03:39 UTC
Embargoed:


Attachments (Terms of Use)
patch grep statement to handle space or tab in /etc/raidtab (897 bytes, patch)
2003-03-29 18:57 UTC, Brad Clements
no flags Details | Diff

Description Brad Clements 2003-03-29 18:54:50 UTC
Description of problem:

mkinitrd does not add raid modules to the kernel ramdisk if /etc/raidtab has 
been formatted with spaces instead of tabs.

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

version 3.4.28


How reproducible:

Every time

Steps to Reproduce:
1. Convert a non-raid SCSI server to a raid based system following common how-
to's
2. When creating /etc/raidtab, indent lines with spaces instead of tabs. 
Specifically, indent the 'raid-level' line using spaces and no tabs
3. run mkinitrd
    
Actual results:

mkinitrd does not recognize the raid level specificed in raidtab, so does not 
add raid(x) and raidstart commands to linuxrc

Expected results:

mkinitrd should recognize raid-level lines that are not indented, or are 
indented with spaces or tabs


Additional info:

The problem is due to this grep in mkinitrd:

        for number in $(grep '^[        ]*raid-level' /etc/raidtab 2>/dev/null |
                          awk '{print $2}' | LC_ALL=C sort -u) ; do

You can't tell from the text above, but there is a single tab character in the 
grep regex ^[ ]  pattern.

Comment 1 Brad Clements 2003-03-29 18:57:32 UTC
Created attachment 90788 [details]
patch grep statement to handle space or tab in /etc/raidtab

Comment 2 Brad Clements 2003-03-29 19:00:15 UTC
I've attached a patch that changes the grep statement to [\t ], but perhaps the 
regex for 'any whitespace' should be used instead. Sorry, I'm not a regex 
wizard so I don't recall what that is [:space:]  ??


Comment 3 Jeremy Katz 2003-04-02 06:03:39 UTC
Fixed in the mkinitrd in Red Hat Linux 9


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