2

I have succeded (full story here) on installing some ethernet card that, according to the docs, must be manually started:

# modprobe e1000bp

I would like this driver startup to be performed on boot time.

What is the proper method to achieve this?

I thought about adding the command to /etc/rc.local, but for PPTP or OpenVPN connections there are another methods that are supposed to be more clean, so I was wondering if the same could be told for the drivers startup.

5

On Debian and derivatives (Ubuntu, Mint, elementary, …), modules listed in /etc/modules (one per line, and you can specify arguments) are loaded at boot time.

On systemd-based systems, modules listed in /etc/modules-load.d/*.conf (one per line) are loaded at boot time.

However you don't normally need to load a module explicitly. For most hardware, Linux will automatically detect the hardware and load the appropriate module. Linux finds the right module through a database stored in /lib/modules/VERSION/modules.alias which is populated from declarations in the module's source code. This answer explains the full process.

Put the .ko file that you compiled somewhere under /lib/modules/VERSION/ (you need to do that anyway to get modprobe to find it) and run depmod -a as root. This will update the modules.aliases database. After that, the module will be loaded automatically during startup, when the kernel detects the hardware (or rather when the module loading process starts, since the hardware is detected early during boot time).

If your hardware is also supported by a module that's provided by your distribution, but the distribution's driver is buggy, then I don't think there's an easy way to force one of the modules to be used. In this case, you should add the module you compiled to /etc/modules and blacklist the standard module by adding a line blacklist MODULE_NAME to /etc/modprobe.conf.

1

I'd be putting the driver into the /etc/modules (Debian, Ubuntu, Mint, etc.) or /etc/modules.conf (Fedora, RHEL, CentOS, Arch Linux, etc.) file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.