base-files: procd is now the init process
[openwrt.git] / include / kernel.mk
index eabf948..b637de5 100644 (file)
@@ -35,8 +35,9 @@ else
   endif
   KERNEL_BUILD_DIR ?= $(BUILD_DIR)/linux-$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET))
   LINUX_DIR ?= $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
-  LINUX_UAPI_DIR=$(firstword $(wildcard $(LINUX_DIR)/include/uapi $(LINUX_DIR)/include))
-
+  ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,3.7.0)),1)
+    LINUX_UAPI_DIR=uapi/
+  endif
   LINUX_VERMAGIC:=$(strip $(shell cat $(LINUX_DIR)/.vermagic 2>/dev/null))
   LINUX_VERMAGIC:=$(if $(LINUX_VERMAGIC),$(LINUX_VERMAGIC),unknown)
 
@@ -103,7 +104,7 @@ define ModuleAutoLoad
                mkdir -p $(2)/CONTROL; \
                echo "#!/bin/sh" > $(2)/CONTROL/postinst; \
                echo "[ -z \"\$$$$$$$$IPKG_INSTROOT\" ] || exit 0" >> $(2)/CONTROL/postinst; \
-               echo ". /etc/functions.sh" >> $(2)/CONTROL/postinst; \
+               echo ". /lib/functions.sh" >> $(2)/CONTROL/postinst; \
                echo "load_modules $$$$$$$$modules" >> $(2)/CONTROL/postinst; \
                chmod 0755 $(2)/CONTROL/postinst; \
        fi
@@ -162,11 +163,11 @@ $(call KernelPackage/$(1)/config)
                                if grep -q "$$$$$$$${mod##$(LINUX_DIR)/}" "$(LINUX_DIR)/modules.builtin"; then \
                                        echo "NOTICE: module '$$$$$$$$mod' is built-in."; \
                                else \
-                                       echo "ERROR: module '$$$$$$$$mod' is missing."; \
+                                       echo "ERROR: module '$$$$$$$$mod' is missing." >&2; \
                                        exit 1; \
                                fi; \
                        else \
-                               echo "WARNING: module '$$$$$$$$mod' missing and modules.builtin not available, assuming built-in."; \
+                               echo "WARNING: module '$$$$$$$$mod' missing and modules.builtin not available, assuming built-in." >&2; \
                        fi; \
                  done;
                  $(call ModuleAutoLoad,$(1),$$(1),$(AUTOLOAD))
@@ -177,7 +178,7 @@ $(call KernelPackage/$(1)/config)
     else
       compile: kmod-$(1)-unavailable
       kmod-$(1)-unavailable:
-               @echo "WARNING: kmod-$(1) is not available in the kernel config"
+               @echo "WARNING: kmod-$(1) is not available in the kernel config" >&2
   )
   endif
   $$(eval $$(call BuildPackage,kmod-$(1)))