aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2013-09-17 21:45:05 +0000
committerJohn Crispin <blogic@openwrt.org>2013-09-17 21:45:05 +0000
commita1d883cc85daebe3acdcbb5e61183db57040d02a (patch)
treed55bb9be34b8130d43919f53714e6d32972414eb /include
parent179d71542ddb6fa6a91505fe6355663228f883fd (diff)
downloadupstream-a1d883cc85daebe3acdcbb5e61183db57040d02a.tar.gz
upstream-a1d883cc85daebe3acdcbb5e61183db57040d02a.tar.bz2
upstream-a1d883cc85daebe3acdcbb5e61183db57040d02a.zip
include: add AutoProbe support
This is needed to make modprobe work Signed-off-by: John Crispin <blogic@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38020 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'include')
-rw-r--r--include/kernel.mk23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/kernel.mk b/include/kernel.mk
index 5442c9153f..86100d7859 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -79,6 +79,25 @@ endef
define ModuleAutoLoad
$(SH_FUNC) \
export modules=; \
+ probe_module() { \
+ mods="$$$$$$$$1"; \
+ boot="$$$$$$$$2"; \
+ shift 2; \
+ 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/$(1); \
+ fi; \
+ done; \
+ if [ -e $(2)/etc/modules.d/$(1) ]; then \
+ if [ "$$$$$$$$boot" = "1" ]; then \
+ mkdir -p $(2)/etc/modules-boot.d; \
+ ln -s ../modules.d/$(1) $(2)/etc/modules-boot.d/; \
+ fi; \
+ modules="$$$$$$$${modules:+$$$$$$$$modules}"; \
+ fi; \
+ dkl; \
+ }; \
add_module() { \
priority="$$$$$$$$1"; \
mods="$$$$$$$$2"; \
@@ -194,6 +213,10 @@ define AutoLoad
add_module "$(1)" "$(2)" "$(3)";
endef
+define AutoProbe
+ probe_module "$(1)" "$(2)";
+endef
+
version_field=$(if $(word $(1),$(2)),$(word $(1),$(2)),0)
kernel_version_merge=$$(( ($(call version_field,1,$(1)) << 24) + ($(call version_field,2,$(1)) << 16) + ($(call version_field,3,$(1)) << 8) + $(call version_field,4,$(1)) ))