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

Bug#1021918: debian-installer: Kernel module blacklisting inconsistent



On 17/10/2022 at 13:13, Olaf Meeuwissen wrote:

I recently tried this version with hardware that triggers loading of the
mt7921e kernel module.  Loading the module fails due to a firmware file
load error but the installer starts okay.  However, the installer later
crashes when probing for network hardware (when it tries to rmmod the
kernel module).

How does the installer crash exactly ? Kernel panic ? Freeze ? Error ?

The first issue I ran into was that the documented[1] way to blacklist
kernel modules is no longer correct

  [1]: https://www.debian.org/releases/testing/amd64/ch05s03.en.html#module-blacklist

Instead of

   mt7921e.blacklist=yes

I had to use

   modprobe.blacklist=mt7921e

/lib/debian-installer-startup.d/S02module-params has the following comment:

# Before udev is started, parse kernel command word for module params of
# the form module.param=value and register them so they will be used when
# modules are loaded. Also check for modules to be blacklisted.

But udev is actually started earlier, so the first method does not work with modules included in initrd.gz (e.g. storage drivers).

However it should work with network driver modules which are installed much later.

However, upon booting I saw a pile of ATA bus and I/O errors that made
me suspicious.  The disk is brand new and a smartmontools extended test
reports no errors.

I found a /etc/modprobe.d/blacklist.local.conf file with

   blacklist modprobe

This is a minor bug in /lib/debian-installer-startup.d/S02module-params which can be easily fixed. However, it should not have any actual impact as "modprobe" does not match any kernel module name or alias.

For completeness' sake, the /etc/default/grub file included

   GRUB_CMDLINE_LINUX="modprobe.blacklist=mt7921e"

As expected.

Seeing that the kernel boot argument is added correctly to the GRUB
configuration, there is no need to create a file in /etc/modprobe.d/.
In addition, the installation manual needs to be updated to use the
correct syntax.

If I understand correctly, this is how things work:

The kernel runs /init.
/init runs /lib/debian-installer/start-udev which starts udevd.
udevd gets hotplug events and calls modprobe to load matching modules included in initrd.gz.
Then /init exec's /bin/busybox init.

busybox init reads /etc/inittab and runs /sbin/debian-installer-startup.
debian-installer-startup runs /lib/debian-installer-startup.d/S02module-params. /lib/debian-installer-startup.d/S02module-params calls /bin/register-module for each module parameter or blacklist in the kernel command line. register-module writes module blacklists in /etc/modprobe.d/blacklist.local.conf and module parameters in /etc/modprobe.d/local.conf.

Later, network driver modules are installed and loaded.

Later, /usr/bin/grub-installer calls /bin/user-params which retrieves kernel parameters after "--" or "---" in the command line and writes them to grub2/linux_cmdline in debconf and GRUB_CMDLINE_LINUX in /etc/default/grub.

So indeed kernel module parameters and blacklists may be duplicated in /etc/modprobe.d and GRUB_CMDLINE_LINUX. To avoid duplication they should be inserted before "---" in the installer command line.


Reply to: