X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=include%2Fkernel.mk;h=ae2dcc3fd98206871751e002cb25c412a02ff501;hb=27db1b56994d56757c845eabb98c40346f70b8d7;hp=5442c9153f2aeb415fd146bc33e48a95a576ac48;hpb=48d92e595e061e46a09a974ae5be6fb6da6cb3d2;p=openwrt.git diff --git a/include/kernel.mk b/include/kernel.mk index 5442c9153f..ae2dcc3fd9 100644 --- a/include/kernel.mk +++ b/include/kernel.mk @@ -79,6 +79,24 @@ 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; \ + }; \ add_module() { \ priority="$$$$$$$$1"; \ mods="$$$$$$$$2"; \ @@ -194,6 +212,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)) ))