linuxlinux-kerneldrivergrub

Differences between modprobe.blacklist and rd.driver.blacklist in Linux kernel parameters


Context

I've seen, mainly, three ways of blacklisting driver modules by appending parameters to the kernel: (i) modprobe.blacklist=driver_name, (ii) rd.driver.blacklist=driver_name, or (iii) last both. This is usually done by appending these parameters to GRUB_CMDLINE_LINUX variable at /etc/default/grub.

I wasn't able to find out the real differences, in practice, between those. But I guess it might also change with your environment. In doubt, I've been using both at the same time and it works on my Fedora 31.

My research

rd.driver.blacklist

At man dracut.cmdline:

rd.driver.blacklist=<drivername>[,<drivername>,...]
           do not load kernel module <drivername>. This parameter can be
           specified multiple times.

modprobe.blacklist

At man modprobe:

(...). modprobe will also use module options specified on the kernel command line in the form of <module>.<option> and blacklists in the form of modprobe.blacklist=<module>.

Summarized question

So, what are the differences between modprobe.blacklist and rd.driver.blacklist for blacklisting drivers in Linux? When should I use each one?


Solution

  • rd.driver.blacklist is a configuration option for the kernel command line, to be applied when the kernel is loaded from the Linux boot image ( the initramfs ). Here you would call out certain kernel modules that are loaded from that initial filesystem image.

    Later on, after the root filesystem is online i.e. has been mounted and the operating system is loading loadable modules ... you can use modprobe.blacklist to affect the handling of loadable modules. modprobe actually reads the kernel command line, to find parameters that affect loadable modules. So while it looks like this parameter is applicable to loading of the Linux kernel, it is not really. modprobe finds it and uses modprobe.blacklist along with other loadable module parameters.

    So whether to use the ramdisk option, or the modprobe option ... depends on whether the driver in question resides in the boot image ( put there by dracut ), or resides in the root filesystem of the OS ( and is handled by modprobe ).

    References

    dracut 053
    Search for rd.driver.blacklist

    SUSE Linux Enterprise Desktop Documentation / Administration Guide / System / Managing Kernel Modules
    Go to : 23.2.2 Blacklisting Kernel Modules with modprobe

    Red Hat Customer Portal / Products & Services / Knowledgebase / How do I prevent a kernel module from loading automatically?
    Go to :
    Finishing Steps for Red Hat Enterprise Linux 8 only
    Finishing Steps for Red Hat Enterprise Linux 7 only