「Linux」- 开机启动时自动加载内核模块

  CREATED BY JENKINSBOT

CentOS 6.5

Remember to load your kernel modules at boot
How to load modules on boot CentOS 6.x

以BONDING模块为例:

#!/bin/sh

cat > /etc/sysconfig/modules/bonding.modules <<EOF
#!/bin/sh
exec /sbin/modprobe bonding 2>&1
EOF

chmod 755 /etc/sysconfig/modules/bonding.modules

CentOS 7.4

Products & Services/Product Documentation/Red Hat Enterprise Linux/7.4/Kernel Administration Guide

以virtio-net.ko模块为例:

#!/bin/sh

cat > /etc/modules-load.d/virtio-net.conf <<EOF
# Load virtio-net.ko at boot
virtio-net
EOF