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.
Created attachment 90788 [details] patch grep statement to handle space or tab in /etc/raidtab
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:] ??
Fixed in the mkinitrd in Red Hat Linux 9