kernel: update 3.14 to 3.14.27
[openwrt.git] / include / kernel.mk
index 86100d7..eeb0c3d 100644 (file)
@@ -64,13 +64,20 @@ endif
 
 ifneq (,$(findstring uml,$(BOARD)))
   LINUX_KARCH=um
+else ifneq (,$(findstring $(ARCH), aarch64 aarch64_be))
+  LINUX_KARCH := arm64
+else ifneq (,$(findstring $(ARCH), armeb))
+  LINUX_KARCH := arm
+else ifneq (,$(findstring $(ARCH), mipsel mips64 mips64el))
+  LINUX_KARCH := mips
+else ifneq (,$(findstring $(ARCH), sh2 sh3 sh4))
+  LINUX_KARCH := sh
+else ifneq (,$(findstring $(ARCH), i386 x86_64))
+  LINUX_KARCH := x86
 else
-  ifeq (,$(LINUX_KARCH))
-    LINUX_KARCH=$(strip $(subst i386,x86,$(subst armeb,arm,$(subst mipsel,mips,$(subst mips64,mips,$(subst mips64el,mips,$(subst sh2,sh,$(subst sh3,sh,$(subst sh4,sh,$(ARCH))))))))))
-  endif
+  LINUX_KARCH := $(ARCH)
 endif
 
-
 define KernelPackage/Defaults
   FILES:=
   AUTOLOAD:=
@@ -84,10 +91,8 @@ define ModuleAutoLoad
                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; \
+                       mkdir -p $(2)/etc/modules.d; \
+                       echo "$$$$$$$$mod" >> $(2)/etc/modules.d/$(1); \
                done; \
                if [ -e $(2)/etc/modules.d/$(1) ]; then \
                        if [ "$$$$$$$$boot" = "1" ]; then \
@@ -96,7 +101,6 @@ define ModuleAutoLoad
                        fi; \
                        modules="$$$$$$$${modules:+$$$$$$$$modules}"; \
                fi; \
-               dkl; \
        }; \
        add_module() { \
                priority="$$$$$$$$1"; \
@@ -104,10 +108,8 @@ define ModuleAutoLoad
                boot="$$$$$$$$3"; \
                shift 3; \
                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); \
-                       fi; \
+                       mkdir -p $(2)/etc/modules.d; \
+                       echo "$$$$$$$$mod" >> $(2)/etc/modules.d/$$$$$$$$priority-$(1); \
                done; \
                if [ -e $(2)/etc/modules.d/$$$$$$$$priority-$(1) ]; then \
                        if [ "$$$$$$$$boot" = "1" ]; then \
@@ -172,7 +174,7 @@ $(call KernelPackage/$(1)/config)
   $(call KernelPackage/depends)
 
   ifneq ($(if $(filter-out %=y %=n %=m,$(KCONFIG)),$(filter m y,$(foreach c,$(filter-out %=y %=n %=m,$(KCONFIG)),$($(c)))),.),)
-    ifneq ($(strip $(FILES)),)
+    ifneq ($(if $(SDK),$(filter-out $(LINUX_DIR)/%.ko,$(FILES)),$(strip $(FILES))),)
       define Package/kmod-$(1)/install
                  @for mod in $$(FILES); do \
                        if [ -e $$$$$$$$mod ]; then \