Author: blogic Date: 2015-04-10 22:39:44 +0200 (Fri, 10 Apr 2015) New Revision: 45367
Modified: trunk/include/kernel.mk trunk/package/base-files/files/lib/functions.sh Log: modules: fix postinst generation for kernel modules Fixes ticket #19352. Signed-off-by: Yousong Zhou <[email protected]> Signed-off-by: John Crispin <[email protected]> Modified: trunk/include/kernel.mk =================================================================== --- trunk/include/kernel.mk 2015-04-10 20:02:55 UTC (rev 45366) +++ trunk/include/kernel.mk 2015-04-10 20:39:44 UTC (rev 45367) @@ -97,7 +97,7 @@ mkdir -p $(2)/etc/modules-boot.d; \ ln -s ../modules.d/$(1) $(2)/etc/modules-boot.d/; \ fi; \ - modules="$$$$$$$${modules:+$$$$$$$$modules}"; \ + modules="$$$$$$$${modules:+$$$$$$$$modules }$$$$$$$$mods"; \ fi; \ }; \ add_module() { \ @@ -121,11 +121,11 @@ if [ -n "$$$$$$$$modules" ]; then \ mkdir -p $(2)/etc/modules.d; \ mkdir -p $(2)/CONTROL; \ - echo "#!/bin/sh" > $(2)/CONTROL/postinst; \ - echo "[ -z \"\$$$$$$$$IPKG_INSTROOT\" ] || exit 0" >> $(2)/CONTROL/postinst; \ - echo ". /lib/functions.sh" >> $(2)/CONTROL/postinst; \ - echo "insert_modules $$$$$$$$modules" >> $(2)/CONTROL/postinst; \ - chmod 0755 $(2)/CONTROL/postinst; \ + echo "#!/bin/sh" > $(2)/CONTROL/postinst-pkg; \ + echo "[ -z \"\$$$$$$$$IPKG_INSTROOT\" ] || exit 0" >> $(2)/CONTROL/postinst-pkg; \ + echo ". /lib/functions.sh" >> $(2)/CONTROL/postinst-pkg; \ + echo "insert_modules $$$$$$$$modules" >> $(2)/CONTROL/postinst-pkg; \ + chmod 0755 $(2)/CONTROL/postinst-pkg; \ fi endef Modified: trunk/package/base-files/files/lib/functions.sh =================================================================== --- trunk/package/base-files/files/lib/functions.sh 2015-04-10 20:02:55 UTC (rev 45366) +++ trunk/package/base-files/files/lib/functions.sh 2015-04-10 20:39:44 UTC (rev 45367) @@ -154,10 +154,13 @@ } 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() { _______________________________________________ openwrt-commits mailing list [email protected] https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits
