Package: kmod
Version: 30+20220905-1
Severity: important

Hi,

I noticed that the sunrpc module was strangely absent from my initramfs, which 
resulted in a failure to netboot (which is my justification for the severity).

Upon examination, it turns out that the way module dependencies are worked out 
for initramfs generation depend on the output of this command:

# /sbin/modprobe --all --set-version="6.0.0-1-amd64" --ignore-install --quiet 
--show-depends nfs
insmod /lib/modules/6.0.0-1-amd64/kernel/fs/netfs/netfs.ko 
insmod /lib/modules/6.0.0-1-amd64/kernel/fs/fscache/fscache.ko 
insmod /lib/modules/6.0.0-1-amd64/kernel/net/sunrpc/sunrpc.ko 
insmod /lib/modules/6.0.0-1-amd64/kernel/fs/nfs_common/grace.ko 
insmod /lib/modules/6.0.0-1-amd64/kernel/fs/lockd/lockd.ko 
insmod /lib/modules/6.0.0-1-amd64/kernel/fs/nfs/nfs.ko 

This, above, is what the output looked like with versions of nfs-kernel-server 
before 1:2.6.2-1+b1, which didn't ship /lib/modprobe.d/50-nfs.conf.

With the new version of nfs-kernel-server, the output becomes:

# /sbin/modprobe --all --set-version="6.0.0-1-amd64" --ignore-install --quiet 
--show-depends nfs
insmod /lib/modules/6.0.0-1-amd64/kernel/fs/netfs/netfs.ko 
insmod /lib/modules/6.0.0-1-amd64/kernel/fs/fscache/fscache.ko 
install /sbin/modprobe --ignore-install sunrpc $CMDLINE_OPTS && { /sbin/sysctl 
-q --pattern sunrpc --system; exit 0; } 
insmod /lib/modules/6.0.0-1-amd64/kernel/fs/nfs_common/grace.ko 
install /sbin/modprobe --ignore-install lockd $CMDLINE_OPTS && { /sbin/sysctl 
-q --pattern fs.nfs.n[sl]m --system; exit 0; } 
insmod /lib/modules/6.0.0-1-amd64/kernel/fs/nfs/nfs.ko 

This confuses manual_add_modules() from 
/usr/share/initramfs-tools/hook-functions, which expects to only see insmod 
lines, not install lines here.

I thought --ignore-install was completely broken, but no, because without it, 
the output contains *more* "install" lines:

# /sbin/modprobe --all --set-version="6.0.0-1-amd64" --quiet --show-depends nfs
insmod /lib/modules/6.0.0-1-amd64/kernel/fs/netfs/netfs.ko
insmod /lib/modules/6.0.0-1-amd64/kernel/fs/fscache/fscache.ko
install /sbin/modprobe --ignore-install sunrpc $CMDLINE_OPTS && { /sbin/sysctl 
-q --pattern sunrpc --system; exit 0; }
insmod /lib/modules/6.0.0-1-amd64/kernel/fs/nfs_common/grace.ko
install /sbin/modprobe --ignore-install lockd $CMDLINE_OPTS && { /sbin/sysctl 
-q --pattern fs.nfs.n[sl]m --system; exit 0; }
install /sbin/modprobe --ignore-install nfs $CMDLINE_OPTS && { /sbin/sysctl -q 
--pattern fs.nfs --system; exit 0; }

If the /lib/modprobe.d/50-nfs.conf shipped by nfs-kernel-server is valid, then 
modprobe --ignore-install doesn't handle it correctly; if it's invalid, then I 
suppose modprobe should print an error. There seems to be a problem with 
modprobe either way, unless initramfs-tools misunderstands the purpose of 
--ignore-install.

Best regards,

AndrĂ¡s

-- System Information:
Debian Release: bookworm/sid
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (350, 'unstable'), (1, 'experimental')
merged-usr: no
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.17.15-caeeng (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=hu_HU.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8
Shell: /bin/sh linked to /bin/dash
Init: runit (via /run/runit.stopit)
LSM: AppArmor: enabled

-- 
 Perl: The only language that looks the same before and after RSA encryption.

Reply via email to