Bug 171871 - mkinitrd can produce broken linuxrc file
Summary: mkinitrd can produce broken linuxrc file
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: mkinitrd
Version: 3.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Brian Lane
QA Contact: Kevin Baker
URL:
Whiteboard:
Depends On:
Blocks: 190430
TreeView+ depends on / blocked
 
Reported: 2005-10-27 10:39 UTC by Bastien Nocera
Modified: 2014-12-01 23:08 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-20 13:22:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
example-fstab (2.22 KB, text/plain)
2005-10-27 10:39 UTC, Bastien Nocera
no flags Details

Description Bastien Nocera 2005-10-27 10:39:55 UTC
Present in RHEL3 (mkinitrd-3.5.13-6.1) and RHEL4 (mkinitrd-4.2.1.6-1).

1. Run mkinitrd on the attached fstab
2. the linuxrc will contain a 3 line root mount command:
 mount -o defaults
 defaults --ro -t ext3
 ext3 /dev/root /sysroot
instead of:
 mount -o default --ro -t ext3 /dev/root /sysroot

The fix is to replace the following awk commands:
 rootfs=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $3; }}' $fstab)
 rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' $fstab)
with:
 rootfs=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $3; exit }}' $fstab)
 rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; exit }}' $fstab)

(Notice the exit after the print statement)

"Patch" by Martin Poole <mpoole>

Comment 1 Bastien Nocera 2005-10-27 10:39:56 UTC
Created attachment 120458 [details]
example-fstab

Comment 4 Kenneth MacDonald 2007-07-16 11:06:45 UTC
This happens whenever there are two lines in /etc/fstab with the "/" mount
point.  I've just been stung by this bug in FC6 too.  

Martin's suggested fix takes the first entry in /etc/fstab.  Alternatively,
using "tail -n 1" after the awk will get the last entry from /etc/fstab.

This leaves the system unbootable when it happens.  

Comment 6 Jiri Pallich 2012-06-20 13:22:04 UTC
Thank you for submitting this issue for consideration in Red Hat Enterprise Linux. The release for which you requested us to review is now End of Life. 
Please See https://access.redhat.com/support/policy/updates/errata/

If you would like Red Hat to re-consider your feature request for an active release, please re-open the request via appropriate support channels and provide additional supporting details about the importance of this issue.


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