27 |
|
|
28 |
case "${action}" in |
case "${action}" in |
29 |
add) |
add) |
30 |
CONFIG="${MROOT}/etc/modules-load.d/mcore-${module}.conf" |
mcore-kernel-module --method "${action}" --module "${module}" --opts "${opts}" |
|
clearconfig |
|
|
addconfig "# mcore autogenerated file - do not edit" |
|
|
addconfig "${module}" |
|
|
|
|
|
if [[ -n ${opts} ]] |
|
|
then |
|
|
CONFIG="${MROOT}/etc/modprobe.d/mcore-${module}.conf" |
|
|
clearconfig |
|
|
addconfig "# mcore autogenerated file - do not edit" |
|
|
addconfig "${module}.${opts}" |
|
|
fi |
|
|
|
|
|
# restart systemd modules-load service |
|
|
# systemd |
|
|
if is_provided systemd |
|
|
then |
|
|
mcore-system-service --restart --service systemd-modules-load.service |
|
|
fi |
|
|
# sysvinit |
|
|
if is_provided sysvinit |
|
|
then |
|
|
mcore-system-service --restart --service modules |
|
|
fi |
|
31 |
;; |
;; |
32 |
|
|
33 |
del) |
del) |
34 |
if [[ -f ${MROOT}/etc/modules-load.d/mcore-${module}.conf ]] |
mcore-kernel-module --method "${action}" --module "${module}" |
|
then |
|
|
rm ${MROOT}/etc/modules-load.d/mcore-${module}.conf |
|
|
fi |
|
|
if [[ -f ${MROOT}/etc/modprobe.d/mcore-${module}.conf ]] |
|
|
then |
|
|
rm ${MROOT}/etc/modprobe.d/mcore-${module}.conf |
|
|
fi |
|
|
|
|
|
# try to remove the kernel module |
|
|
modprobe -r "${module}" |
|
|
|
|
|
# restart systemd modules-load service |
|
|
# systemd |
|
|
if is_provided systemd |
|
|
then |
|
|
mcore-system-service --restart --service systemd-modules-load.service |
|
|
fi |
|
|
# sysvinit |
|
|
if is_provided sysvinit |
|
|
then |
|
|
mcore-system-service --restart --service modules |
|
|
fi |
|
35 |
;; |
;; |
36 |
|
|
37 |
*) help_kernel_module && return 1 ;; |
*) help_kernel_module && return 1 ;; |