Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 461
Ícaro Pires Avatar asked Jul 26 '20 17:07

Ícaro Pires


People also ask

How to blacklist driver modules in kernel?

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.

What is 3rd driver blacklist in Linux?

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.

Are there any disadvantages of adding modprobe blacklist=Nouveau to grub?

Are there any disadvantages of adding modprobe.blacklist=nouveau to grub? Possibly, there is a conflict between the open-source driver with that of the graphic card from Nvidia. I will write down the solution that worked for me, on a Lenovo ThinkPad P53 when installing Ubuntu 20.04 LTS, I faced some issues. Not the answer you're looking for?

How do I blacklist Nouveau in Ubuntu?

Follow the steps written below: 1 Boot to Ubuntu, but before you login in to Ubuntu, press Cntrl+Alt+F2 2 run the following command:#N#sudo nano /etc/modprobe.d/blacklist-nouveau.conf 3 add the 2 following lines, save & exit#N#blacklist nouveau options nouveau modeset=0 4 run the following command#N#sudo update-initramfs -u More ...


1 Answers

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

like image 169
LarryC Avatar answered Sep 30 '22 17:09

LarryC