FS#15376 - [mkinitcpio] USB hook doesn't include USB storage sub-driver modules

Attached to Project: Arch Linux
Opened by Jonathan Liu (net147) - Sunday, 05 July 2009, 09:33 GMT
Last edited by Roman Kyrylych (Romashka) - Friday, 07 August 2009, 08:41 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Aaron Griffin (phrakture)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
* When the "usb" hook is added to HOOKS array in /etc/mkinitcpio.conf, the USB mass storage sub-drivers aren't added. This causes USB booting to fail with the chipsets for which there is a USB storage sub-driver module. This occurs because the USB storage sub-drivers were split into separate modules in 2.6.30. As such, the "usb" hook needs to be updated to include these modules in order to allow booting on a wide range of USB storage chipsets. A patch is attached to correct the issue.

Additional info:
* kernel26 2.6.30-5
* mkinitcpio 0.5.25-1

Steps to reproduce:
* Install Arch Linux on USB drive
* Upgrade kernel26 to 2.6.30
* mkinitcpio -p kernel26
* Reboot. The USB drive no longer boots because the appropriate USB storage sub-driver modules aren't available in the initial ramdisk.
This task depends upon

This task blocks these from closing
 FS#15378 - mkinitcpio does not load usb module  
Closed by  Roman Kyrylych (Romashka)
Friday, 07 August 2009, 08:41 GMT
Reason for closing:  Fixed
Additional comments about closing:  Seems to be fixed with 0.5.26-1 now in core
Comment by Thomas Bächler (brain0) - Sunday, 05 July 2009, 14:53 GMT
Can we autodetect those modules? Do they appear in mkinitcpio -M for you?
Comment by Jonathan Liu (net147) - Sunday, 05 July 2009, 22:40 GMT
We can't exactly autodetect these modules when upgrading to 2.6.30 from 2.6.29 because these modules aren't present in 2.6.29. mkinitcpio -M doesn't list the module for my USB drive (ums_cypress) when it is loaded.

Including only the loaded modules would make a USB drive with Arch installed only boot on a computers that have the appropriate modules autodetected when the initial ramdisk is built.

It seems better to just include all the USB mass storage drivers as people adding the USB hook would probably want to have their USB drive boot on as many systems as 2.6.29 did. Another option is to add another hook of some sort for adding all these mass storage drivers but we should have documented this issue when 2.6.30 was released to prevent people making their Arch Linux USB drives unbootable.
Comment by Thomas Bächler (brain0) - Monday, 06 July 2009, 18:55 GMT
First, it doesn't matter which kernel is running, the autodetection of device modules always detects everything for the target kernel, not the running kernel. The problem is that all devices must appear in sysfs. This doesn't work for USB keyboards and apparently also for USB storage, because the submodules are not listed as devices in /sys.

To your second point: If you want to boot on any machine, you must disable autodetect anyway, as autodetection will disable all usb host controllers which are not present on the build machine. Thus, if we are able to autodetect devices, we always do so, people should use the fallback image or disable the autodetect hook if they like it differently.

All of this doesn't really matter, because it seems we cannot autodetect the modules, in which case we can use your patch as-is. To confirm, please post mkinitcpio -M.
Comment by Jonathan Liu (net147) - Monday, 06 July 2009, 23:00 GMT
Attached is the mkinitcpio -M output after upgrade with the USB drive plugged in. It does include the appropriate ums_cypress module.
However when upgrading from 2.6.29, the module was not included in either the normal image or the fallback image.
/sys/module/ums_cypress does exist when using 2.6.30 but not in 2.6.29.

On 2.6.30 when a drive is plugged in, the appropriate modules are automatically loaded.
Comment by Thomas Bächler (brain0) - Tuesday, 07 July 2009, 09:57 GMT
Okay, it seems we can autodetect them (your concern about it not working when upgrading is invalid, this is only detected by /sys/devices). I'll change all_modules to checked_modules in the patch attached by you. If you want to boot on any computer, use an image without the autodetect hook.
Comment by Jonathan Liu (net147) - Tuesday, 07 July 2009, 11:20 GMT
I've tested changing all_modules to checked_modules in the patch. It works as long as I use fallback image. Thanks for the advice.
Comment by Thomas Bächler (brain0) - Tuesday, 07 July 2009, 11:24 GMT
With checked_modules, the non-fallback image should still work on the machine you built it on (i.e. the image should include ums-cypress).
Comment by Jonathan Liu (net147) - Tuesday, 07 July 2009, 14:39 GMT
It does, but I mean it only includes all the modules in the fallback image. I haven't had any issues at all booting with normal image in the past with regard to USB host controllers. The Cypress chipset is for the USB hard drive enclosure. I've switched to use fallback image as I want it to boot on as many systems as possible.
Comment by Dieter Plaetinck (Dieter_be) - Sunday, 19 July 2009, 11:40 GMT
Hello, can we push this to testing and then to core? This is a blocker for releng ( FS#15378 )
Thanks.
Comment by Jonathan Liu (net147) - Sunday, 19 July 2009, 11:59 GMT
Modified patch to include only needed modules when using autodetect.
Comment by Emil Mårtensson (GizmoTheGreen) - Friday, 24 July 2009, 05:10 GMT
Hi!

How to use this patch?
will the change be fixed (is fixed) in mkinitcpio package?

i can update my archinstall via use of raw disk in vmware
it emulates ide for my usb disk.

someone can close task 15281 again (kernel fails to boot)
Comment by Jonathan Liu (net147) - Friday, 24 July 2009, 05:29 GMT
The patch hasn't been included in mkinitcpio package yet.

To apply the patch to an existing system:
1. Install curl, sudo and patch packages
2. curl 'http://bugs.archlinux.org/task/15376?getfile=3820' | sudo patch -Np0
3. sudo mkinitcpio -p kernel26
Comment by Thomas Bächler (brain0) - Friday, 24 July 2009, 08:48 GMT Comment by Emil Mårtensson (GizmoTheGreen) - Saturday, 25 July 2009, 14:20 GMT
this file solved my problem, i can now use my arch install from my usb-storage!

thanks alot!
Comment by Dieter Plaetinck (Dieter_be) - Thursday, 30 July 2009, 07:49 GMT
can this be moved to core? thanks :)
Comment by Thomas Bächler (brain0) - Thursday, 30 July 2009, 08:23 GMT
To move it to core, I either need to rebuild it or we need full -any support, as this is an architecute-independent package.
Comment by Aaron Griffin (phrakture) - Thursday, 30 July 2009, 16:44 GMT
It will be moved soon - I'll try to get the dbscripts pushed live asap
Comment by Gerhard Brauer (GerBra) - Friday, 07 August 2009, 08:30 GMT
Should we close this report then?
I like to close the blocked report  FS#15378  soon... so i'll do a close request..

Loading...