semantics of --ignore-install

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bug or feature?

diff -U 0 \
  <(modprobe -q --show-depends nfs) \
  <(modprobe -q --show-depends nfs --ignore-install)

----- Forwarded message from Andras Korn <korn-debbugs@xxxxxxxxxxxxxx> -----

From: Andras Korn <korn-debbugs@xxxxxxxxxxxxxx>
To: Debian Bug Tracking System <submit@xxxxxxxxxxxxxxx>
Subject: Bug#1022172: /lib/modprobe.d/50-nfs.conf causes initramfs-tools to
	stop including sunrpc module for nfs

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.

----- End forwarded message -----
----- Forwarded message from Marco d'Itri <md@xxxxxxxx> -----

From: Marco d'Itri <md@xxxxxxxx>
To: Andras Korn <korn-debbugs@xxxxxxxxxxxxxx>, 1022172@xxxxxxxxxxxxxxx,
	initramfs-tools@xxxxxxxxxxxxxxxxxxx, nfs-utils@xxxxxxxxxxxxxxxxxxx
Subject: Bug#1022172: /lib/modprobe.d/50-nfs.conf causes initramfs-tools to
	stop including sunrpc module for nfs

On Oct 21, Andras Korn <korn-debbugs@xxxxxxxxxxxxxx> wrote:

> I thought --ignore-install was completely broken, but no, because without it, the output contains *more* "install" lines:
What you are actually seeing is that --ignore-install is applied only to 
the nfs module (the one which you have requested to load) but not to its 
own dependencies:

diff -U 0 <(modprobe --all --set-version="6.0.0-1-amd64" --ignore-install --quiet --show-depends nfs) <(modprobe --all --set-version="6.0.0-1-amd64" --quiet --show-depends nfs)

I am not sure if this is a bug or a feature, so this should be discussed 
with the upstream maintainer.

So the possible solutions are:
- the semantics of --ignore-install are changed upstream (this may take 
  some time)
- initramfs-tools learns to parse the install directives
- nfs-kernel-server uses a different design

No matter what happens to --ignore-install I suggest that 
nfs-kernel-server will replace the modprobe configuration with some udev 
rules like this one (untested):

ACTION=="add", SUBSYSTEM=="module", KERNEL=="sunrpc", \
  RUN+="/sbin/sysctl -q --pattern sunrpc --system"

-- 
ciao,
Marco



----- End forwarded message -----

-- 
ciao,
Marco

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux