FS#60354 - [REGRESSION] [linux] [mkinitcpio] autodetect hook skips usb-storage after updating kernel to 4.18.11

Attached to Project: Arch Linux
Opened by Max (qtmax) - Monday, 08 October 2018, 23:33 GMT
Last edited by Dave Reisner (falconindy) - Monday, 08 October 2018, 23:41 GMT
Task Type Bug Report
Category Kernel
Status Closed
Assigned To No-one
Architecture All
Severity Critical
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

/usr/lib/initcpio/install/block contains the following code:

# usb
if add_checked_modules -f '(_cs|sl811_hcd|isp116x_hcd)' '/usb/host'; then
blockdevs+=(['usb_storage?']=1 ['sd_mod?']=1 ['sr_mod?']=1)
add_checked_modules '/drivers/usb/storage/'
fi

add_checked_modules returns 0 (true) if at least one module has been added. So, if the modules for USB host are included into the initramfs, the script includes USB storage drivers.

Prior to Linux 4.18.11, USB host drivers were separate modules, that could be found under /usr/lib/modules/4.18.10-arch1-1-ARCH/kernel/drivers/usb/host/{o,u,e,x}hci-hcd.ko.xz. Starting from 4.18.11, the kernel config changed, and these drivers are built into the kernel now, so there are no *hci-hcd.ko.xz files in the filesystem.

That means that after upgrading to Linux 4.18.11 or later, mkinitcpio fails to include USB storage drivers when "autodetect" hook is used. It happens, because `add_checked_modules /usb/host` no longer adds any module (they are compiled into the kernel now), returns 1 (false), and "block" hook doesn't even try to add USB storage drivers.

This is a critical regression, because this kernel update rendered my system unbootable: initramfs lacks USB storage drivers necessary to bring my system up. However, the fix should go not into the kernel config, but into the mkinitcpio, because it makes a wrong assumption that USB host drivers are separate modules.

Additional info:
* mkinitcpio 24-2 is used
* linux 4.18.11 is the first affected version

Steps to reproduce:

* Ensure that "autodetect" and "block" hooks (exactly in this order) are used in mkinitcpio.conf.
* Run `mkinitcpio -p linux` (without quotes).
* Run `lsinitcpio /boot/initramfs-linux.img | grep /modules/ | grep usb-storage` (without quotes).

Expected result:

The output of the second command is not empty if the computer has USB host driven by uhci-hcd, ohci-hcd, ehci-hcd or xhci-hcd (i.e. any x86 desktop or laptop).

Actual result:

The output of the second command is empty on kernels 4.18.11 and later from Archlinux repos.
This task depends upon

Closed by  Dave Reisner (falconindy)
Monday, 08 October 2018, 23:41 GMT
Reason for closing:  Duplicate
Additional comments about closing:   FS#60272 

Loading...