Targets can capture options required for a module explicitly in a trivial way:

target.mk:

MOD_OPTIONS_gpio_cs5535:=mask=0x0E000048 major=252

Tested for instances of multiple modules, like lib80211.

Fixed name clash.

Signed-off-by: Philip A. Prindeville


Index: include/kernel.mk
===================================================================
--- include/kernel.mk   (revision 23097)
+++ include/kernel.mk   (working copy)
@@ -67,16 +67,21 @@
        $(SH_FUNC) \
        export modules=; \
        add_module() { \
+               priority="$$$$$$$$1"; \
+               mods="$$$$$$$$2"; \
+               boot="$$$$$$$$3"; \
+               shift 3; \
                mkdir -p $(2)/etc/modules.d; \
                ( \
-                       [ "$$$$$$$$3" = "1" ] && { \
+                       [ "$$$$$$$$boot" = "1" ] && { \
                                echo '# May be required for rootfs' ; \
                        } ; \
-                       for mod in $$$$$$$$2; do \
-                               getvar mod; \
+                       for mod in $$$$$$$$mods; do \
+                               echo "$$$$$$$$mod $$$$$$$$1"; \
+                               shift ; \
                        done \
-               ) > $(2)/etc/modules.d/$$$$$$$$1-$(1); \
-               modules="$$$$$$$${modules:+$$$$$$$$modules }$$$$$$$$1-$(1)"; \
+               ) > $(2)/etc/modules.d/$$$$$$$$priority-$(1); \
+               modules="$$$$$$$${modules:+$$$$$$$$modules 
}$$$$$$$$priority-$(1)"; \
        }; \
        $(3) \
        if [ -n "$$$$$$$$modules" ]; then \
@@ -156,7 +161,7 @@
 endef

 define AutoLoad
-  add_module $(1) "$(2)" $(3);
+  add_module "$(1)" "$(2)" "$(3)" $(foreach 
module,$(2),"$(MOD_OPTIONS_$(module))");
 endef

 ifdef DUMP
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to