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

1

10

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?

Altonaltona answered 26/7, 2020 at 17:47 Comment(1)
Interestingly I had to use modprobe.blacklist recently when I updated Fedora 34 to kernel 5.16.15, otherwise nouveau would load and block the Nvidia driver. Previously I'd just set rd.driver.blacklist.Scottyscotus
M
12

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

Milka answered 9/2, 2021 at 2:0 Comment(3)
Thanks for answering! Can you provide me with some references so I can understand better?Auxiliaries
I added some links, aboveMilka
Thx for the adding, @Milka :)Auxiliaries

© 2022 - 2024 — McMap. All rights reserved.