busybox-initramfs: modinfo reports "can't open '/${VERSION}/': No such file or directory"

Bug #1574107 reported by TJ
14
This bug affects 3 people
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/4.4.0-21-generic/kernel/drivers/md

(initramfs) modinfo dm-crypt
modinfo: can't open '/4.4.0-21-generic/': No such file or directory

(initramfs) modinfo /lib/modules/4.4.0-21-generic/kernel/drivers/md/dm-crypt.ko
modinfo: can't open '/4.4.0-21-generic/': No such file or directory

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/lib/modules/4.4.0-21-generic

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/4.4.0-21-generic rather than prefixing the "-d" alternate root.

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_PATH=/mnt/USB/lib/x86_64-gnu-linux /mnt/USB/sbin/cryptsetup open /dev/sda4 LUKS_VG02 --type luks

(initramfs) blkid /dev/mapper/LUKS_VG02
/dev/mapper/LUKS_VG02: UUID="xxxx...xxxx" TYPE="LVM2_member"

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in busybox (Ubuntu):
status: New → Confirmed
Revision history for this message
Diederick Niehorster (dcnie) wrote :

I'm also affected by this bug, on 18.04.2, can't open /4.18.0-20-generic/

Revision history for this message
Shane Thompson (shanept) wrote :

I am also affected. Additionally I can not get any stderr output from modprobe, whether I use -v or not.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.