aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2015-04-10 20:39:44 +0000
committerJohn Crispin <blogic@openwrt.org>2015-04-10 20:39:44 +0000
commite7eaef8bc0da33f88099bcd197d7a52ea724734a (patch)
treecd70f339e5764a98abcd08532a1a7e3abcca51c1 /package/base-files/files/lib
parent30be2eb4c468fabacf1f850718d1a55f39df8c9e (diff)
downloadmaster-187ad058-e7eaef8bc0da33f88099bcd197d7a52ea724734a.tar.gz
master-187ad058-e7eaef8bc0da33f88099bcd197d7a52ea724734a.tar.bz2
master-187ad058-e7eaef8bc0da33f88099bcd197d7a52ea724734a.zip
modules: fix postinst generation for kernel modules
Fixes ticket #19352. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> Signed-off-by: John Crispin <blogic@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45367 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files/lib')
-rwxr-xr-xpackage/base-files/files/lib/functions.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
index dc3b80534b..72d954db3c 100755
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -154,10 +154,13 @@ config_list_foreach() {
}
insert_modules() {
- [ -d /etc/modules.d ] && {
- cd /etc/modules.d
- sed 's/^[^#]/insmod &/' $* | ash 2>&- || :
- }
+ for m in $*; do
+ if [ -f /etc/modules.d/$m ]; then
+ sed 's/^[^#]/insmod &/' /etc/modules.d/$m | ash 2>&- || :
+ else
+ modprobe $m
+ fi
+ done
}
default_prerm() {