Modify

Opened 9 years ago

Closed 7 years ago

Last modified 19 months ago

#2359 closed defect (duplicate)

AutoLoad does not work with module parameters

Reported by: kkoehne Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: base system Version:
Keywords: autoload modules.d module parameter Cc:

Description

Hi,

I would like to add parameters to one of the modules which are automatically loaded via /etc/modules.d. However, the AutoLoad function used to create the files does not work for module parameters.

$(call AutoLoad,50,ath_pci countrycode=276)

obviously regards ath_pci and countrycode=276 as two different modules.

$(call AutoLoad,50,ath_pci\ countrycode=276) does not work either, nor does
$(call AutoLoad,50,'ath_pci countrycode=276).

Regards,

Kai Koehne

Attachments (0)

Change History (8)

comment:1 Changed 9 years ago by kkoehne

Hi,

I managed to get the problem down to following for-loop in kernel.mk:

for mod in $$$$$$$$2; do \

getvar mod; \

done

Unfortunately I did not find a way to let the for loop ignore a space ...

comment:2 Changed 9 years ago by bifferos

Just thought I'd add a 'me too' here. This is not helped by the fact that it's seemingly rather hard to alter the contents of /etc/modules.d/XX-some-script and have it go into the firmware image.

This capability is essential for easy use of the new i2c-gpio-custom module by Gabor. Without it you can only hack a solution.

Please add this feature!

comment:3 Changed 8 years ago by anonymous

Me too. :(

Please add this feature!

comment:4 Changed 8 years ago by anonymous

For the impatient the following workaround works for me:

--- include/kernel.mk    (revision XXXX)
+++ include/kernel.mk    (working copy)
@@ -64,7 +64,7 @@
                        for mod in $$$$$$$$2; do \
                                getvar mod; \
                        done \
-               ) > $(2)/etc/modules.d/$$$$$$$$1-$(1); \
+               ) | sed -e 's|/| |g' > $(2)/etc/modules.d/$$$$$$$$1-$(1); \
                modules="$$$$$$$${modules:+$$$$$$$$modules }$$$$$$$$1-$(1)"; \
        }; \
        $(3) \

And then you can add parameters to modules separated by '/' instead of ' ', e.g.:

--- package/madwifi/Makefile     (revision XXXX)
+++ package/madwifi/Makefile     (working copy)
@@ -72,10 +72,10 @@
        wlan_xauth
 
 ifeq ($(findstring AHB,$(BUS)),AHB)
-       MADWIFI_AUTOLOAD += ath_ahb
+       MADWIFI_AUTOLOAD += ath_ahb/tpc=1
 endif
 ifeq ($(findstring PCI,$(BUS)),PCI)
-       MADWIFI_AUTOLOAD += ath_pci
+       MADWIFI_AUTOLOAD += ath_pci/tpc=1
 endif
 
 define KernelPackage/madwifi

comment:5 Changed 7 years ago by florian

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #1458

comment:6 Changed 22 months ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

comment:7 Changed 19 months ago by bvalaboj@…

Is there any solution to the issue raised. I am using openWRT BB and trying to figure out a way to autoload module with parameters. I understand that #1458 is closed with "wontfix" and the solution provided to reboot the board after changing the file in /etc/modules.d is not a good solution for our product.

comment:8 Changed 19 months ago by anonymous

Index: include/kernel.mk
===================================================================
--- include/kernel.mk	(revision 43298)
+++ include/kernel.mk	(working copy)
@@ -101,11 +101,16 @@
 		priority="$$$$$$$$1"; \
 		mods="$$$$$$$$2"; \
 		boot="$$$$$$$$3"; \
-		shift 3; \
+		args="$$$$$$$$4"; \
+		shift 4; \
 		for mod in $$$$$$$$mods; do \
 			if [ -e $(2)/$(MODULES_SUBDIR)/$$$$$$$$mod.ko ]; then \
 				mkdir -p $(2)/etc/modules.d; \
-				echo "$$$$$$$$mod" >> $(2)/etc/modules.d/$$$$$$$$priority-$(1); \
+				if [ -n "$$$$$$$$args" ]; then \
+					echo "$$$$$$$$mod $$$$$$$$args" >> $(2)/etc/modules.d/$$$$$$$$priority-$(1); \
+				else \
+					echo "$$$$$$$$mod" >> $(2)/etc/modules.d/$$$$$$$$priority-$(1); \
+				fi; \
 			fi; \
 		done; \
 		if [ -e $(2)/etc/modules.d/$$$$$$$$priority-$(1) ]; then \
@@ -209,7 +214,7 @@
 endef
 
 define AutoLoad
-  add_module "$(1)" "$(2)" "$(3)";
+  add_module "$(1)" "$(2)" "$(3)" "$(4)";
 endef
 
 define AutoProbe

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.