shortcut-fe-cm: load only once to avoid panic (#5019)

This commit is contained in:
AmadeusGhost 2020-07-07 11:40:17 +08:00 committed by CN_SZTL
parent 2319486746
commit 36080d8e9f
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
2 changed files with 6 additions and 5 deletions

View File

@ -88,4 +88,4 @@ endef
$(eval $(call KernelPackage,$(PKG_NAME)))
$(eval $(call KernelPackage,$(PKG_NAME)-noload))
$(eval $(call BuildPackage,fast-classifier-example))
#$(eval $(call BuildPackage,fast-classifier-example))

View File

@ -30,11 +30,12 @@ load_sfe_cm() {
#shortcut-fe-drv.ko is not needed because other connection manager is not enabled
[ -d "/sys/module/shortcut_fe_drv" ] && rmmod shortcut_fe_drv
[ -e "/lib/modules/$kernel_version/shortcut-fe-cm.ko" ] && {
[ -d /sys/module/shortcut_fe_cm ] || insmod /lib/modules/$kernel_version/shortcut-fe-cm.ko
}
[ -e "/lib/modules/$kernel_version/fast-classifier.ko" ] && {
[ -d /sys/module/fast_classifier ] || insmod /lib/modules/$kernel_version/fast-classifier.ko
[ -d /sys/module/fast_classifier ] || insmod /lib/modules/$kernel_version/fast-classifier.ko && return
}
[ -e "/lib/modules/$kernel_version/shortcut-fe-cm.ko" ] && {
[ -d /sys/module/shortcut_fe_cm ] || insmod /lib/modules/$kernel_version/shortcut-fe-cm.ko && return
}
}