How to autoload the kernel module in Gentoo Linux?

I want to autoload some kernel modules when it starts. I read the tutorial but can't help. Now the modules I want to download are vboxdrv vboxnetadp vboxpci vboxnetflt , the modules directory /lib/modules/3.0.6-gentoo/ , the configuration file directory /etc/modules.autoload.d/kernel-3.0.6 , in this file All modules are included. And now, after rebooting, use lsmod , I can not see that these modules are loaded. What is the problem?

 thinkpad walle # ls -l /boot/总用量 17068 lrwxrwxrwx 1 root root 1 1月 10 01:22 boot -> . drwxr-xr-x 2 root root 4096 4月 27 10:55 grub -rw-r--r-- 1 root root 5771120 3月 23 09:27 kernel-3.0.6 -rw-r--r-- 1 root root 5771120 4月 26 17:48 kernel-3.0.6-n5 -rw-r--r-- 1 root root 5876784 4月 27 10:55 kernel-3.0.6-n6 drwx------ 2 root root 16384 1月 17 15:47 lost+found 

Now I use kernel-3.0.6-n6 as my boot kernel.

 thinkpad walle # cat /etc/modules.autoload.d/kernel-3.0.6 xt_mark test_nx scsi_wait_scan wlagn ext2 vboxdrv vboxnetadp vboxpci vboxnetflt 
+6
source share
3 answers

/etc/conf.d/modules is not used. Systemd uses its own structure

Place the module list file in / etc / modules -load.d / man modules-load.d

Put your additional module file in /etc/modprobe.d/ man modprobe.d

+7
source

Startup modules are listed in /etc/conf.d/modules according to http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=7#doc_chap5

/etc/init.d/modules script reads the /etc/conf.d/modules file and loads the modules. It should already be at the boot level, but if it is not, run rc-update add modules boot so that they boot at boot.

+12
source

Well, editing /etc/conf.d/modules is not an autoload, because you need to edit this file after every kernel recovery.

The basic idea of ​​automatically loading kernel hardware modules is described here: http://doc.opensuse.org/documentation/html/openSUSE/opensuse-reference/cha.udev.html as well as http://wiki.gentoo.org/wiki/ Udev

In a few words: udev manages your hardware, and every time new hardware appears (the kernel creates a link in / dev), udev searches for a suitable kernel module and loads it if found. All device information is provided by sysfs.

+1
source

Source: https://habr.com/ru/post/916513/


All Articles