Bug 104673 - mkinitrd does not create a good initrd for usb-storage devices
Summary: mkinitrd does not create a good initrd for usb-storage devices
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: mkinitrd
Version: 9
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-09-18 18:49 UTC by Barry Graham
Modified: 2007-04-18 16:57 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2003-09-23 04:16:42 UTC
Embargoed:


Attachments (Terms of Use)

Description Barry Graham 2003-09-18 18:49:31 UTC
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 16:54:29 UTC
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 17:51:31 UTC
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 18:21:35 UTC
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 23:57:02 UTC
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 04:16:42 UTC
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.