compat-wireless: enable compilation of ath9k on >= 2.6.24
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Wed, 25 Aug 2010 23:10:22 +0000 (16:10 -0700)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Wed, 25 Aug 2010 23:36:23 +0000 (16:36 -0700)
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 <lrodriguez@atheros.com>
config.mk
enable-older-kernels/enable-2.6.23.patch
enable-older-kernels/enable-2.6.24.patch
scripts/driver-select
scripts/gen-compat-autoconf.sh

index edfeca26255955b8b822a1d6821b9aff02f06907..0d951d16fae94badf2b1fe9c276b3eea87b2b129 100644 (file)
--- 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)
index e415923ba8923e1e41a5343736a5b8dfa0c81a62..948d24911c350c8318b958c504c0204bc7323fa9 100644 (file)
@@ -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"
index f27af866c32ba58e30091c562654cd1214817bee..9bc48771ecec14d7c35a87ab27d951f26db48e0e 100644 (file)
@@ -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))
  
  
  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"
index 9721df69983211897ae45a38793ad4522763576e..b7c58d8db13ab913b9bf637a97ef6412615ee21c 100755 (executable)
@@ -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
index 1e3002e8f5118e125cfa20aa59430b2c27629598..64dac69f69266630bdb0942156a859393e91e3fd 100755 (executable)
@@ -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"