Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Load Kernel Modules at Boot (Read 3351 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Load Kernel Modules at Boot

Hello all,
Where do I put a file to load a kernel module, or list of kernel modules, at boot? Is it /etc/modprobe.d/?

Thank you for any help!

Re: Load Kernel Modules at Boot

Reply #1
Hello all,
Where do I put a file to load a kernel module, or list of kernel modules, at boot? Is it /etc/modprobe.d/?

Thank you for any help!


wiki.archlinux.org still working ;-)
why you not ask there? https://wiki.archlinux.org/index.php/Kernel_module (ignoring the part about systemd)

necessary modules for boot you can add in to /etc/mkinitcpio.conf too  https://wiki.archlinux.org/index.php/Mkinitcpio

Re: Load Kernel Modules at Boot

Reply #2

wiki.archlinux.org still working ;-)
why you not ask there? https://wiki.archlinux.org/index.php/Kernel_module (ignoring the part about systemd)

necessary modules for boot you can add in to /etc/mkinitcpio.conf too  https://wiki.archlinux.org/index.php/Mkinitcpio

Well, I didn't know if it was any different than Arch Linux, since it seems that kernel modules with Arch Linux tends to be linked to systemd (that's what it looked like on the kernel module archwiki page I have looked at, but maybe not enough...), but I don't know enough to tell if it is or not. I appreciate your help. :) Thanks for the link on mkinitcpio, I didn't know about it. I'll look into this and post here if I run into any problems. :)

EDIT: I guess my real question then, is if putting a file like /etc/modules-load.d/virtio-net.conf with the module I want to load in it will work on Artix, since I don't have systemd.


Re: Load Kernel Modules at Boot

Reply #4
Thanks Alium, I appreciate your help. This is why I wanted to clarify, as it doesn't say you can put modules there, but module settings.

Re: Load Kernel Modules at Boot

Reply #5
what works (tested by myself) is puting your module for automaticaly load in /etc/conf.d/modules

Code: [Select]
[picasso alois]# cat /etc/conf.d/modules 
# Linux users can define a list of modules for a specific kernel version,
# a released kernel version, a main kernel version or all kernel versions.
# The most specific versioned variable will take precedence.
# FreeBSD users can only use the modules="foo bar" setting.
modules="virtio_net"

after reboot i can see:
Code: [Select]
[picasso alois]# lsmod | grep virti
virtio_net             61440  0
net_failover           20480  1 virtio_net

Re: Load Kernel Modules at Boot

Reply #6
Well, I didn't know if it was any different than Arch Linux, since it seems that kernel modules with Arch Linux tends to be linked to systemd (that's what it looked like on the kernel module archwiki page I have looked at, but maybe not enough...), but I don't know enough to tell if it is or not. I appreciate your help. :) Thanks for the link on mkinitcpio, I didn't know about it. I'll look into this and post here if I run into any problems. :)

EDIT: I guess my real question then, is if putting a file like /etc/modules-load.d/virtio-net.conf with the module I want to load in it will work on Artix, since I don't have systemd.

Actually every init on artix should support /etc/modules-load.d/*.conf so that should actually work. You can set modules in mkinitcpio as well if you want though.

Re: Load Kernel Modules at Boot

Reply #7
That not works for me, etc/modules-load.d not exist ,  and if I create it, system ignored it

Re: Load Kernel Modules at Boot

Reply #8
Hmm, maybe I spoke too soon. runit and s6 run modules-load on boot which is a script that takes care of this. I assumed openrc did as well but I guess not?

Re: Load Kernel Modules at Boot

Reply #9
Hmm, maybe I spoke too soon. runit and s6 run modules-load on boot which is a script that takes care of this. I assumed openrc did as well but I guess not?

Openrc modules service will use /usr/lib/modules-load.d or /run/modules-load.d or /etc/modules-load.d if it contains *.conf files.

Re: Load Kernel Modules at Boot

Reply #10
How do I load them on dinit?
I tried /etc/modules and /etc/conf.d/modules, I had to create the files.

Re: Load Kernel Modules at Boot

Reply #11
How do I load them on dinit?
I tried /etc/modules and /etc/conf.d/modules, I had to create the files.

The modules service runs /usr/bin/modules-load which I assume is the same as for s6 and runit. It looks for *.conf files in each of /etc/modules-load.d, /run/modules-load.d, and /usr/lib/modules-load.d