include: calculate md5sum over sorted kernel config symbol list and incorperate it...
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 8 Jan 2012 15:23:11 +0000 (15:23 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 8 Jan 2012 15:23:11 +0000 (15:23 +0000)
SVN-Revision: 29686

include/kernel-defaults.mk
include/kernel.mk
package/kernel/Makefile

index 5fd27ae7cdf76dce6bb039a8dbcb88d6ec5c99e7..52ce03776caaa59f6a8aa1b99f08a333b8a1aab0 100644 (file)
@@ -89,6 +89,7 @@ define Kernel/Configure/Default
        $(call Kernel/SetInitramfs)
        -$(_SINGLE)$(MAKE) $(KERNEL_MAKEOPTS) oldconfig prepare scripts
        rm -rf $(KERNEL_BUILD_DIR)/modules
+       $(SH_FUNC) grep '=[ym]' $(LINUX_DIR)/.config | LC_ALL=C sort | md5s > $(LINUX_DIR)/.vermagic
 endef
 
 define Kernel/CompileModules/Default
index 1af072d6bb4eae9668a5295462a8c508f904faa7..c0d8ef8a2368f5a91226545943799429e6b85feb 100644 (file)
@@ -13,6 +13,7 @@ ifeq ($(DUMP),1)
   KERNEL?=<KERNEL>
   BOARD?=<BOARD>
   LINUX_VERSION?=<LINUX_VERSION>
+  LINUX_VERMAGIC?=<LINUX_VERMAGIC>
 else
   ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
     export GCC_HONOUR_COPTS=s
@@ -35,6 +36,9 @@ else
   KERNEL_BUILD_DIR ?= $(BUILD_DIR_BASE)/linux-$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET))$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX))
   LINUX_DIR ?= $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
 
+  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)),)
     LINUX_UNAME_VERSION:=$(LINUX_UNAME_VERSION)-$(strip $(lastword $(subst -, ,$(LINUX_VERSION))))
@@ -130,7 +134,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))
index 13a305d7a1e99d687fec7ebfcac115a72ec20b1a..e094c601ef4f74cfedc40d1866082d7e7015cb86 100644 (file)
@@ -35,7 +35,7 @@ define Package/kernel
   CATEGORY:=Kernel
   DEFAULT:=y
   TITLE:=Virtual kernel package
-  VERSION:=$(LINUX_VERSION)-$(LINUX_RELEASE)
+  VERSION:=$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC)
   URL:=http://www.kernel.org/
 endef