From: Luis R. Rodriguez Date: Wed, 25 Aug 2010 23:10:22 +0000 (-0700) Subject: compat-wireless: enable compilation of ath9k on >= 2.6.24 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3913cbf0709ed63239bf2b1cce2ea63e140b5c93;p=openwrt%2Fstaging%2Fblogic.git compat-wireless: enable compilation of ath9k on >= 2.6.24 Re-enabling 2.6.23 requires a little bit of more work: mcgrof@tux ~/devel/compat-wireless-2.6 (git::linux-2.6.36.y)$ make V=1 KLIB=/lib/modules/2.6.23.17-dirty/build KLIB_BUILD=/lib/modules/2.6.23.17-dirty/build make -C /lib/modules/2.6.23.17-dirty/build M=/home/mcgrof/devel/compat-wireless-2.6 modules make[1]: Entering directory `/home/mcgrof/linux-2.6-allstable' test -e include/linux/autoconf.h -a -e include/config/auto.conf || ( \ echo; \ echo " ERROR: Kernel configuration is invalid."; \ echo " include/linux/autoconf.h or include/config/auto.conf are missing."; \ echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ echo; \ /bin/false) mkdir -p /home/mcgrof/devel/compat-wireless-2.6/.tmp_versions rm -f /home/mcgrof/devel/compat-wireless-2.6/.tmp_versions/* make -f scripts/Makefile.build obj=/home/mcgrof/devel/compat-wireless-2.6 make -f scripts/Makefile.build obj=/home/mcgrof/devel/compat-wireless-2.6/compat gcc -Wp,-MD,/home/mcgrof/devel/compat-wireless-2.6/compat/.main.o.d -I/home/mcgrof/devel/compat-wireless-2.6/include/ -include /home/mcgrof/devel/compat-wireless-2.6/include/linux/compat-2.6.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -O2 -mtune=generic -m64 -mno-red-zone -mcmodel=kernel -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -funit-at-a-time -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -maccumulate-outgoing-args -fomit-frame-pointer -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -O2 -mtune=generic -m64 -mno-red-zone -mcmodel=kernel -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -funit-at-a-time -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -maccumulate-outgoing-args -fomit-frame-pointer -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(main)" -D"KBUILD_MODNAME=KBUILD_STR(compat)" -c -o /home/mcgrof/devel/compat-wireless-2.6/compat/main.o /home/mcgrof/devel/compat-wireless-2.6/compat/main.c /home/mcgrof/devel/compat-wireless-2.6/compat/main.c:8:2: error: #error "You need a COMPAT_BASE_TREE" /home/mcgrof/devel/compat-wireless-2.6/compat/main.c:12:2: error: #error "You need a COMPAT_BASE_TREE_VERSION" /home/mcgrof/devel/compat-wireless-2.6/compat/main.c:16:2: error: #error "You need a COMPAT_VERSION" /home/mcgrof/devel/compat-wireless-2.6/compat/main.c:19: error: ‘COMPAT_BASE_TREE’ undeclared here (not in a function) /home/mcgrof/devel/compat-wireless-2.6/compat/main.c:20: error: ‘COMPAT_BASE_TREE_VERSION’ undeclared here (not in a function) /home/mcgrof/devel/compat-wireless-2.6/compat/main.c:21: error: ‘COMPAT_VERSION’ undeclared here (not in a function) /home/mcgrof/devel/compat-wireless-2.6/compat/main.c: In function ‘compat_init’: /home/mcgrof/devel/compat-wireless-2.6/compat/main.c:41: error: expected ‘)’ before ‘COMPAT_PROJECT’ /home/mcgrof/devel/compat-wireless-2.6/compat/main.c:45: error: expected ‘)’ before ‘COMPAT_BASE_TREE’ make[3]: *** [/home/mcgrof/devel/compat-wireless-2.6/compat/main.o] Error 1 make[2]: *** [/home/mcgrof/devel/compat-wireless-2.6/compat] Error 2 make[1]: *** [_module_/home/mcgrof/devel/compat-wireless-2.6] Error 2 make[1]: Leaving directory `/home/mcgrof/linux-2.6-allstable' make: *** [modules] Error 2 So we need to figure out why this: CFLAGS += \ -DCOMPAT_BASE_TREE="\"$(shell cat compat_base_tree)\"" \ -DCOMPAT_BASE_TREE_VERSION="\"$(shell cat compat_base_tree_version)\"" \ -DCOMPAT_PROJECT="\"Compat-wireless\"" \ -DCOMPAT_VERSION="\"$(shell cat compat_version)\"" is not being picked up on 2.6.23 and/or work our way around it. Signed-off-by: Luis R. Rodriguez --- diff --git a/config.mk b/config.mk index edfeca262559..0d951d16fae9 100644 --- a/config.mk +++ b/config.mk @@ -25,8 +25,8 @@ KERNEL_SUBLEVEL := $(shell $(MAKE) -C $(KLIB_BUILD) kernelversion | sed -n 's/^2 COMPAT_VERSIONS := $(shell I=$(COMPAT_LATEST_VERSION); while [ "$$I" -gt $(KERNEL_SUBLEVEL) ]; do echo $$I; I=$$(($$I - 1)); done) $(foreach ver,$(COMPAT_VERSIONS),$(eval CONFIG_COMPAT_KERNEL_$(ver)=y)) -ifdef CONFIG_COMPAT_KERNEL_25 -$(error "ERROR: compat-wireless by default supports kernels >= 2.6.25, try enabling only one driver though") +ifdef CONFIG_COMPAT_WIRELESS_23 +$(error "ERROR: compat-wireless for selected driver requires a kernel >= 2.6.23") endif ifeq ($(CONFIG_CFG80211),y) diff --git a/enable-older-kernels/enable-2.6.23.patch b/enable-older-kernels/enable-2.6.23.patch index e415923ba892..948d24911c35 100644 --- a/enable-older-kernels/enable-2.6.23.patch +++ b/enable-older-kernels/enable-2.6.23.patch @@ -1,6 +1,8 @@ ---- a/config.mk 2010-01-11 10:27:53.000000000 -0800 -+++ b/config.mk 2010-01-11 10:32:49.000000000 -0800 -@@ -26,8 +26,8 @@ +diff --git a/config.mk b/config.mk +index 777ebd3..2ad11fc 100644 +--- a/config.mk ++++ b/config.mk +@@ -25,8 +25,8 @@ KERNEL_SUBLEVEL := $(shell $(MAKE) -C $(KLIB_BUILD) kernelversion | sed -n 's/^2 COMPAT_VERSIONS := $(shell I=$(COMPAT_LATEST_VERSION); while [ "$$I" -gt $(KERNEL_SUBLEVEL) ]; do echo $$I; I=$$(($$I - 1)); done) $(foreach ver,$(COMPAT_VERSIONS),$(eval CONFIG_COMPAT_KERNEL_$(ver)=y)) @@ -12,7 +14,7 @@ ifeq ($(CONFIG_CFG80211),y) diff --git a/scripts/gen-compat-autoconf.sh b/scripts/gen-compat-autoconf.sh -index 6c7cae7..bb2ea6d 100755 +index 1e3002e..64dac69 100755 --- a/scripts/gen-compat-autoconf.sh +++ b/scripts/gen-compat-autoconf.sh @@ -11,7 +11,7 @@ @@ -21,6 +23,6 @@ index 6c7cae7..bb2ea6d 100755 # Update this if you are adding support for older kernels. -OLDEST_KERNEL_SUPPORTED="2.6.25" +OLDEST_KERNEL_SUPPORTED="2.6.23" - COMPAT_RELEASE="compat-release" - KERNEL_RELEASE="git-describe" + COMPAT_RELEASE="compat_version" + KERNEL_RELEASE="compat_base_tree_version" MULT_DEP_FILE=".compat_pivot_dep" diff --git a/enable-older-kernels/enable-2.6.24.patch b/enable-older-kernels/enable-2.6.24.patch index f27af866c32b..9bc48771ecec 100644 --- a/enable-older-kernels/enable-2.6.24.patch +++ b/enable-older-kernels/enable-2.6.24.patch @@ -1,6 +1,8 @@ ---- a/config.mk 2010-01-11 10:27:53.000000000 -0800 -+++ b/config.mk 2010-01-11 10:32:49.000000000 -0800 -@@ -26,8 +26,8 @@ +diff --git a/config.mk b/config.mk +index 777ebd3..2ad11fc 100644 +--- a/config.mk ++++ b/config.mk +@@ -25,8 +25,8 @@ KERNEL_SUBLEVEL := $(shell $(MAKE) -C $(KLIB_BUILD) kernelversion | sed -n 's/^2 COMPAT_VERSIONS := $(shell I=$(COMPAT_LATEST_VERSION); while [ "$$I" -gt $(KERNEL_SUBLEVEL) ]; do echo $$I; I=$$(($$I - 1)); done) $(foreach ver,$(COMPAT_VERSIONS),$(eval CONFIG_COMPAT_KERNEL_$(ver)=y)) @@ -12,15 +14,15 @@ ifeq ($(CONFIG_CFG80211),y) diff --git a/scripts/gen-compat-autoconf.sh b/scripts/gen-compat-autoconf.sh -index 6c7cae7..bb2ea6d 100755 +index 1e3002e..64dac69 100755 --- a/scripts/gen-compat-autoconf.sh +++ b/scripts/gen-compat-autoconf.sh @@ -11,7 +11,7 @@ # This indicates which is the oldest kernel we support # Update this if you are adding support for older kernels. --OLDEST_KERNEL_SUPPORTED="2.6.25" +-OLDEST_KERNEL_SUPPORTED="2.6.24" +OLDEST_KERNEL_SUPPORTED="2.6.24" - COMPAT_RELEASE="compat-release" - KERNEL_RELEASE="git-describe" + COMPAT_RELEASE="compat_version" + KERNEL_RELEASE="compat_base_tree_version" MULT_DEP_FILE=".compat_pivot_dep" diff --git a/scripts/driver-select b/scripts/driver-select index 9721df699832..b7c58d8db13a 100755 --- a/scripts/driver-select +++ b/scripts/driver-select @@ -297,7 +297,7 @@ case $1 in disable_bt_usb_ethernet_var select_driver CONFIG_ATH_COMMON select_ath9k_driver - #patch -p1 < enable-older-kernels/enable-2.6.23.patch + patch -p1 < enable-older-kernels/enable-2.6.23.patch ;; ar9170) disable_bt_usb_ethernet_var diff --git a/scripts/gen-compat-autoconf.sh b/scripts/gen-compat-autoconf.sh index 1e3002e8f511..64dac69f6926 100755 --- a/scripts/gen-compat-autoconf.sh +++ b/scripts/gen-compat-autoconf.sh @@ -11,7 +11,7 @@ # This indicates which is the oldest kernel we support # Update this if you are adding support for older kernels. -OLDEST_KERNEL_SUPPORTED="2.6.25" +OLDEST_KERNEL_SUPPORTED="2.6.23" COMPAT_RELEASE="compat_version" KERNEL_RELEASE="compat_base_tree_version" MULT_DEP_FILE=".compat_pivot_dep"