From 2b6facc8d4b33c04ae0b544933d1489adf347bfc Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 23 Aug 2017 22:27:32 +0200 Subject: include: kernel.mk: simplify module autoloading Let the generic postinstall script invoke "kmodloader" when the just installed package contains any /etc/module.d/ entries. This allows us to skip the explicit "insert_module()" calls in the package postinstall. Due to the removed insert_module calls we do not need to assemble a complete list of modules per package anymore, which allows for vast simplification of the package generation code. While we're at it, also support specifying default parameters for modules using either the MODPARAM or MODPARAM.modulename variables in KernelPackage. Signed-off-by: Jo-Philipp Wich --- package/base-files/files/lib/functions.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'package/base-files/files/lib') diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index 81ef84b..c3988b9 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -235,6 +235,10 @@ default_postinst() { rm -fR $root/rootfs-overlay/ fi + if [ -z "$root" ] && grep -q -s "^/etc/modules.d/" "/usr/lib/opkg/info/${pkgname}.list"; then + kmodloader + fi + if [ -z "$root" ] && grep -q -s "^/etc/uci-defaults/" "/usr/lib/opkg/info/${pkgname}.list"; then . /lib/functions/system.sh [ -d /tmp/.uci ] || mkdir -p /tmp/.uci -- cgit v1.1