To automatically load kernel modules in CentOS, you can add a script in the /etc/sysconfig/modules/ directory and load the required modules in this script. Here is a script called overlayfs.modules that I use to automatically load the overlayfs module in my CentOS 7.X: #!/bin/sh /sbin/modinfo -F filename overlayfs> /dev/null 2>&1 if [ $? -eq 0 ]; then /sbin/modprobe overlayfs fi The script first checks whether the overlayfs module file exists. If so, it calls the /sbin/modprobe command to load this module. Place this file in the /etc/sysconfig/modules/ directory and give it executable permissions. This way, the module will be automatically loaded the next time you restart the system. Additional knowledge: Centos7 automatically loads module ko when booting Suppose there is a kernel module file named c1004.ko 1. First copy the compiled module to the kernel device directory
2. Create a module startup file sudo cat > /etc/modules-load.d/c1004.conf <<EOF # Load c1004.ko at boot c1004 EOF 3. Update the module and restart
4. After restarting, check whether the module has been installed normally lsmod |grep c1004 # Output similar to the following indicates that the auto-start is OK c1004 30081 0 If an error occurs when running insmod c1004.ko, you need to recompile the driver file. Uninstall the driver rmmod c1004 The above article about automatically loading kernel module overlayfs when CentOS starts is all I want to share with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
>>: In-depth analysis of MySQL database transactions and locks
1. Check whether the check status module is insta...
.imgbox{ width: 1200px; height: 612px; margin-rig...
PHP7 has been out for quite some time, and it is ...
This article introduces how to solve the problem ...
The installation of compressed packages has chang...
The process packets with the SYN flag in the RFC7...
Table of contents 1. Routing and page jump 2. Int...
Recently, due to work needs, I need to format num...
This article example shares the specific code of ...
v-for directive Speaking of lists, we have to men...
Preface: Docker is an open source application con...
Hello everyone, I am Qiufeng. Recently, WeChat ha...
Overview Today we will mainly share how to config...
What is a generator? A generator is some code tha...
Table of contents Achieve results Implementation ...