3

My man modprobe.d says the following:

NAME
       modprobe.d - Configuration directory for modprobe

SYNOPSIS
       /lib/modprobe.d/*.conf

       /etc/modprobe.d/*.conf

       /run/modprobe.d/*.conf

My question is: anybody knows what is the purpose of each of these folders?

I have only seen this page where somebody had a problem (in Red Hat) and had to move a conf file from /etc to /lib because the former wasn't available in the initramfs:

The /etc/modprobe.d directory isn't available in the initramfs, so the initramfsblacklist.conf isn't created and the rd.driver.blacklist isn't honored.

Changing from /etc/modprobe.d to /lib/modprobe.d/ here restore the module blacklist behavior.


As an example, this is what I have in a new droplet in Digital Ocean with Ubuntu 17.10:

$ ls -l /lib/modprobe.d/
total 16
-rw-r--r-- 1 root root  655 Aug 15  2017 aliases.conf
-rw-r--r-- 1 root root 1461 Mar 14 07:38 blacklist_linux_4.13.0-38-generic.conf
-rw-r--r-- 1 root root  390 Feb 20 12:50 fbdev-blacklist.conf
-rw-r--r-- 1 root root  668 Feb 20 13:11 systemd.conf

$ ls -l /etc/modprobe.d/
total 32
-rw-r--r-- 1 root root  325 Aug 15  2017 blacklist-ath_pci.conf
-rw-r--r-- 1 root root  210 Aug 15  2017 blacklist-firewire.conf
-rw-r--r-- 1 root root  697 Aug 15  2017 blacklist-framebuffer.conf
-rw-r--r-- 1 root root  583 Aug 15  2017 blacklist-rare-network.conf
-rw-r--r-- 1 root root 1603 Aug 15  2017 blacklist.conf
-rw-r--r-- 1 root root  347 Aug 15  2017 iwlwifi.conf
-rw-r--r-- 1 root root  379 Oct 10  2017 mdadm.conf
-rw-r--r-- 1 root root  104 Aug 15  2017 mlx4.conf

$ ls -l /run/modprobe.d/
ls: cannot access '/run/modprobe.d/': No such file or directory

Is it all about the the boot stage the conf files are read?


Further reading the linked page, it seems /lib/modprobe.d is for conf files for the packages we install in the system. Is it correct?

whoan
  • 2,427
  • 1
  • 13
  • 13

1 Answers1

2

Where to place modules settings

/etc/modprobe.d

it seems /lib/modprobe.d is for conf files for the packages we install in the system.

Yes, there are directories for software packages and site specific:

modprobe: use more than one config directory

Read config files from the following directories:

/run/modprobe.d config files generated at runtime, useful e.g. for compatibility with non-standard config files (such as /etc/rc.conf in Arch)

/etc/modprobe.d config files manually created by the administrator

/lib/modprobe.d config files installed by third-party packages

/usr/local/lib/modprobe.d config files during development of third-party packages

This scheme is the same as the one employed by udev, systemd and possibly others.

A follow-up patch lets files in one directory override files in others, as done elsewhere.

/usr/lib/modprobe.d/ is also a thing, there's some noise about it on Red Hat and Debian bug trackers, and the Arch wiki. (Both the merged /usr proponents and opponents can have it their way!)

John Mahowald
  • 30,009
  • 1
  • 17
  • 32