Bug 87594

Summary: space indented /etc/raidtab is not processed correctly
Product: [Retired] Red Hat Linux Reporter: Brad Clements <bkc>
Component: mkinitrdAssignee: Jeremy Katz <katzj>
Status: CLOSED CURRENTRELEASE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-04-02 06:03:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch grep statement to handle space or tab in /etc/raidtab none

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