From 0eb89c45bc38f89cdac062a1180302a2d4e29eac Mon Sep 17 00:00:00 2001 From: Peter Korsgaard Date: Tue, 25 Sep 2007 13:32:08 +0000 Subject: [PATCH] Generalized kernel headers handling for new-style kernels --- .../kernel-headers-new.makefile | 87 +++---------------- 1 file changed, 12 insertions(+), 75 deletions(-) diff --git a/toolchain/kernel-headers/kernel-headers-new.makefile b/toolchain/kernel-headers/kernel-headers-new.makefile index 712ad088e9..4ff8e6045a 100644 --- a/toolchain/kernel-headers/kernel-headers-new.makefile +++ b/toolchain/kernel-headers/kernel-headers-new.makefile @@ -4,12 +4,19 @@ # ############################################################# -ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.6.22.7") -VERSION:=2 -PATCHLEVEL:=6 -SUBLEVEL:=22 -EXTRAVERSION:=.7 +# new-style kernels? +ifeq ($(LINUX_HEADERS_VERSION),) +# parse linux version string +LNXVER:=$(subst ., , $(strip $(DEFAULT_KERNEL_HEADERS))) +VERSION:=$(word 1, $(LNXVER)) +PATCHLEVEL:=$(word 2, $(LNXVER)) +SUBLEVEL:=$(word 3, $(LNXVER)) +EXTRAVERSION:=$(word 4, $(LNXVER)) LOCALVERSION:= + +# should contain prepended dot +EXTRAVERSION:=$(if $(EXTRAVERSION),.$(EXTRAVERSION),) + LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) LINUX_HEADERS_SITE:=http://www.kernel.org/pub/linux/kernel/v2.6/ LINUX_HEADERS_SOURCE:=linux-$(LINUX_HEADERS_VERSION).tar.bz2 @@ -20,83 +27,13 @@ LINUX_HEADERS_IS_KERNEL=y endif ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.6.22.1") -VERSION:=2 -PATCHLEVEL:=6 -SUBLEVEL:=22 -EXTRAVERSION:=.1 -LOCALVERSION:= -LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) -LINUX_HEADERS_SITE:=http://www.kernel.org/pub/linux/kernel/v2.6/ -LINUX_HEADERS_SOURCE:=linux-$(LINUX_HEADERS_VERSION).tar.bz2 -LINUX_HEADERS_CAT:=$(BZCAT) -LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION) -LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux -LINUX_HEADERS_IS_KERNEL=y LINUX_RT_VERSION:=rt9 endif -ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.6.21.7") -VERSION:=2 -PATCHLEVEL:=6 -SUBLEVEL:=21 -EXTRAVERSION:=.7 -LOCALVERSION:= -LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) -LINUX_HEADERS_SITE:=http://www.kernel.org/pub/linux/kernel/v2.6/ -LINUX_HEADERS_SOURCE:=linux-$(LINUX_HEADERS_VERSION).tar.bz2 -LINUX_HEADERS_CAT:=$(BZCAT) -LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION) -LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux -LINUX_HEADERS_IS_KERNEL=y -endif - ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.6.21.5") -VERSION:=2 -PATCHLEVEL:=6 -SUBLEVEL:=21 -EXTRAVERSION:=.5 -LOCALVERSION:= -LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) -LINUX_HEADERS_SITE:=http://www.kernel.org/pub/linux/kernel/v2.6/ -LINUX_HEADERS_SOURCE:=linux-$(LINUX_HEADERS_VERSION).tar.bz2 -LINUX_HEADERS_CAT:=$(BZCAT) -LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION) -LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux -LINUX_HEADERS_IS_KERNEL=y LINUX_RT_VERSION:=rt20 endif -ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.6.20.19") -VERSION:=2 -PATCHLEVEL:=6 -SUBLEVEL:=20 -EXTRAVERSION:=.19 -LOCALVERSION:= -LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) -LINUX_HEADERS_SITE:=http://www.kernel.org/pub/linux/kernel/v2.6/ -LINUX_HEADERS_SOURCE:=linux-$(LINUX_HEADERS_VERSION).tar.bz2 -LINUX_HEADERS_CAT:=$(BZCAT) -LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION) -LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux -LINUX_HEADERS_IS_KERNEL=y -endif - -ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.6.20.4") -VERSION:=2 -PATCHLEVEL:=6 -SUBLEVEL:=20 -EXTRAVERSION:=.4 -LOCALVERSION:= -LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) -LINUX_HEADERS_SITE:=http://www.kernel.org/pub/linux/kernel/v2.6/ -LINUX_HEADERS_SOURCE:=linux-$(LINUX_HEADERS_VERSION).tar.bz2 -LINUX_HEADERS_CAT:=$(BZCAT) -LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION) -LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux -LINUX_HEADERS_IS_KERNEL=y -endif - - ifeq ($(LINUX_HEADERS_IS_KERNEL),y) # Need to redefine KERNEL_HEADERS_PATCH_DIR if you want # board specific kernel headers -- 2.30.2