X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=include%2Fkernel.mk;h=b637de5918339ba52c8544487f33c4fcb92d92ed;hb=577d1f28af41e91b332a86133401ad50c5650ac0;hp=0df0337c493d3df08c69bd886c760ea0bc83471e;hpb=801c73f8b8e222e62467a82643cb9f927a840365;p=openwrt.git diff --git a/include/kernel.mk b/include/kernel.mk index 0df0337c49..b637de5918 100644 --- a/include/kernel.mk +++ b/include/kernel.mk @@ -13,6 +13,7 @@ ifeq ($(DUMP),1) KERNEL?= BOARD?= LINUX_VERSION?= + LINUX_VERMAGIC?= else ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) export GCC_HONOUR_COPTS=s @@ -32,8 +33,13 @@ else PATCH_DIR ?= ./patches$(if $(wildcard ./patches-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER)) FILES_DIR ?= $(foreach dir,$(wildcard ./files ./files-$(KERNEL_PATCHVER)),"$(dir)") endif - KERNEL_BUILD_DIR ?= $(BUILD_DIR_BASE)/linux-$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET))$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX)) + KERNEL_BUILD_DIR ?= $(BUILD_DIR)/linux-$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET)) LINUX_DIR ?= $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) + 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) LINUX_UNAME_VERSION:=$(if $(word 3,$(subst ., ,$(KERNEL_BASE))),$(KERNEL_BASE),$(KERNEL_BASE).0) ifneq ($(findstring -rc,$(LINUX_VERSION)),) @@ -45,14 +51,10 @@ else LINUX_KERNEL:=$(KERNEL_BUILD_DIR)/vmlinux - LINUX_SOURCE:=linux-$(LINUX_VERSION).tar.bz2 + LINUX_SOURCE:=linux-$(LINUX_VERSION).tar.xz TESTING:=$(if $(findstring -rc,$(LINUX_VERSION)),/testing,) ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),) - ifeq ($(word 1,$(subst ., ,$(KERNEL_BASE))),3) LINUX_SITE:=@KERNEL/linux/kernel/v3.x$(TESTING) - else - LINUX_SITE:=@KERNEL/linux/kernel/v$(KERNEL)$(TESTING) - endif endif ifneq ($(TARGET_BUILD),1) @@ -102,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 @@ -130,7 +132,7 @@ define KernelPackage SECTION:=kernel CATEGORY:=Kernel modules DESCRIPTION:=$(DESCRIPTION) - EXTRA_DEPENDS:=kernel (=$(LINUX_VERSION)-$(LINUX_RELEASE)) + EXTRA_DEPENDS:=kernel (=$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC)) VERSION:=$(LINUX_VERSION)$(if $(PKG_VERSION),+$(PKG_VERSION))-$(if $(PKG_RELEASE),$(PKG_RELEASE),$(LINUX_RELEASE)) $(call KernelPackage/$(1)) $(call KernelPackage/$(1)/$(BOARD)) @@ -157,8 +159,15 @@ $(call KernelPackage/$(1)/config) if [ -e $$$$$$$$mod ]; then \ mkdir -p $$(1)/$(MODULES_SUBDIR) ; \ $(CP) -L $$$$$$$$mod $$(1)/$(MODULES_SUBDIR)/ ; \ + elif [ -e "$(LINUX_DIR)/modules.builtin" ]; then \ + 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." >&2; \ + exit 1; \ + fi; \ else \ - echo "WARNING: module '$$$$$$$$mod' does not exist, is it built-in?" ; \ + echo "WARNING: module '$$$$$$$$mod' missing and modules.builtin not available, assuming built-in." >&2; \ fi; \ done; $(call ModuleAutoLoad,$(1),$$(1),$(AUTOLOAD)) @@ -169,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)))