busybox-initramfs: modinfo reports "can't open '/${VERSION}/': No such file or directory"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
busybox (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Working on 16.04 and trying to solve some unrelated issues due to a complex initrd set-up I discovered that the included "modinfo" tool doesn't work, whether given just a module name or an absolute path to the .ko file.
In this case it always reports, e.g:
(initramfs) pwd
/lib/modules/
(initramfs) modinfo dm-crypt
modinfo: can't open '/4.4.0-
(initramfs) modinfo /lib/modules/
modinfo: can't open '/4.4.0-
There seems there may be a related issue with modprobe too, as I've found it doesn't always insert a module when instructed to - also using either just name, or absolute path. In the specific case here I was working with a LUKS/dm-crypt rootfs, where the initrd.img had been generated using "MODULES=dep" and hadn't included dm-crypt.ko.
I connected a USB storage device with an identical root file-system (same kernel version, etc.) at /mnt/USB/ and was trying to use:
(initramfs) modprobe -v -d /mnt/USB dm-crypt
modprobe: FATAL: Module dm-crypt not found in directory /mnt/USB/
I'm *assuming* this is because despite setting the alternate root directory with "-d" it is still looking at the "modules.dep" in /lib/modules/
Using a chroot the module(s) can be loaded and the block device unlocked:
(initramfs) chroot /mnt/USB
(initramfs) modprobe dm-crypt
(initramfs) modprobe aesni-intel
(initramfs) modprobe xts
(initramfs) exit
(initramfs) grep dm_crypt /proc/modules
dm_crypt 28672 0 - Live 0xffffffffc02fa000
(initramfs) LD_LIBRARY_
(initramfs) blkid /dev/mapper/
/dev/mapper/
Status changed to 'Confirmed' because the bug affects multiple users.