Bug 104673 - mkinitrd does not create a good initrd for usb-storage devices
mkinitrd does not create a good initrd for usb-storage devices
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: mkinitrd (Show other bugs)
9
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Jeremy Katz
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-09-18 14:49 EDT by Barry Graham
Modified: 2007-04-18 12:57 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-09-23 00:16:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Barry Graham 2003-09-18 14:49:31 EDT
Description of problem:
mkinitrd does not create a good initrd for usb-storage devices

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


How reproducible:

I discovered (and fixed) a bug in mkinitrd.

I have an external USB disk attached to a USB 2.0 PCMCIA card.  I realize that 
I cannot have the /boot partition on the external disk, but I have the / 
partition on the external disk.  I was able to install perfectly.

However when I try to boot up, the initrd that is created does not have the 
correct configuration to power on my external USB disk, so I get a kernel panic.

Evenually I was able to get it to work, by creating a new initrd.  I also had 
to edit mkinitrd.  You have a sleep statement in there that waits for 5 seconds 
after loading usb-storage.o.  However your if statement is incorrect - I do not 
have the script in front of me, but basically you say that "if module being 
loaded is usb-storage then sleep 5 seconds" - but what you SHOULD say is "if 
module being loaded is usb-storage.o then sleep 5 seconds" - i.e. you omitted 
the ".o" after usb-storage.

Also, I have run out of patience, but it may be that you also have to put in a 
sleep after loading all the usb drivers, such as usb-uhci, usb-ohci, etc.

It REALLY would be nice actually if your installer would generate an initrd 
which supports the system that is being installed.  It's ridiculous that the 
installer is able to recognize my external disk, yet once I try to boot up, I 
have to make manual modifications to the initrd.

Also, I have noticed that when I shutdown, the shutdown process turns off 
PCMCIA support while the disk is still mounted, so of course the shutdown 
hangs.  I will report this separately.

Steps to reproduce:
1.vi /sbin/mkinitrd
2.search for sleep 5
3.look in amazement as you see that the programmer left off ".o" after usb-
storage in the previous if statement.

Actual results:
System cannot boot.

Expected results:
I expect that if anaconda allows me to install on my external USB disk, I 
should be able to load the system that I created.

Additional info:
Comment 1 Jeremy Katz 2003-09-19 12:54:29 EDT
usb disks are only allowed as an installation target in expert mode, which is
not supported.

mkinitrd with the --with-usb flag in rawhide does things right for usb-storage.
Comment 2 Barry Graham 2003-09-21 13:51:31 EDT
I tried the with-usb option and it makes no difference.  Until you fix the bug 
in the if statement and change it to look for "usb-storage.o" rather than "usb-
storage" it will not work.
Comment 3 Jeremy Katz 2003-09-21 14:21:35 EDT
No, $module has the .o (or .ko if using 2.6) sed'd off the end.  Look up about
10 or 15 lines.
Comment 4 Barry Graham 2003-09-22 19:57:02 EDT
I did look 10-15 lines above, and I saw this:

    module=`echo $MODULE | sed "s|.*/||"`

However if you actually run this command (and I tried it out on the command 
line as well as echo-ing the value of $MODULE afterwards, it does NOT strip off 
the .o - please try it before you assume that it works.
Comment 5 Jeremy Katz 2003-09-23 00:16:42 EDT
Again, rawhide.  It's a different beast :)

module=`echo $MODULE | sed "s|.*/||" | sed "s/.k\?o$//"`

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