Bug 88594 - mkinitrd-3.4.43-1 incompatible with gawk-3.1.2-1 -- fails to detect RAID devices
Summary: mkinitrd-3.4.43-1 incompatible with gawk-3.1.2-1 -- fails to detect RAID devices
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: gawk
Version: 1.0
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Florian La Roche
QA Contact: Brock Organ
Depends On:
TreeView+ depends on / blocked
Reported: 2003-04-11 06:50 UTC by Jonathan Kamens
Modified: 2007-04-18 16:52 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2003-04-15 08:42:11 UTC

Attachments (Terms of Use)
feed /proc/mdstat into awk with cat (707 bytes, patch)
2003-04-11 06:51 UTC, Jonathan Kamens
no flags Details | Diff

Description Jonathan Kamens 2003-04-11 06:50:30 UTC
/sbin/mkinitrd in mkinitrd-3.4.43-1 contains code that looks like this:

  awk '/^md[0-9][0-9]*[ 	]*:/ { print $4 }' /proc/mdstat

Unfortunately, it appears that the version of awk in gawk-3.1.2-1 refuses to
read any data from a file if stat on the file returns a size of 0:

  $ awk '/^md[0-9][0-9]*[       ]*:/ { print $4 }' /proc/mdstat
  $ cat /proc/mdstat | awk '/^md[0-9][0-9]*[    ]*:/ { print $4 }'  

Now, it could be argued that this is a bug in gawk, and indeed, I think I'll
file a bug report about it, but still, I think it would be best for mkinitrd to
be resilient in the face of this problem by using the "cat" technique shown
above.  I'll attach a patch.

Comment 1 Jonathan Kamens 2003-04-11 06:51:05 UTC
Created attachment 91071 [details]
feed /proc/mdstat into awk with cat

Comment 2 Jeremy Katz 2003-04-11 18:22:26 UTC
No, this is gawk being busted and needing to be fixed, not something that should
be worked around in mkinitrd

Comment 3 Florian La Roche 2003-04-15 08:42:11 UTC
3.1.2-2 has a fix in it. Please reopen if that does not work for you.

Thanks a lot for this bug-report,

Florian La Roche

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