2 # Copyright 2012 Luis R. Rodriguez <mcgrof@frijolero.org>
3 # Copyright 2012 Hauke Mehrtens <hauke@hauke-m.de>
5 # This generates a bunch of CONFIG_COMPAT_KERNEL_2_6_22
6 # CONFIG_COMPAT_KERNEL_3_0 .. etc for each kernel release you need an object
9 # Note: this is part of the compat.git project, not compat-wireless.git,
10 # send patches against compat.git.
12 if [[ ! -f ${KLIB_BUILD}/Makefile ]]; then
16 # Actual kernel version
17 KERNEL_VERSION=$(${MAKE} -C ${KLIB_BUILD} kernelversion | sed -n 's/^\([0-9]\)\..*/\1/p')
20 COMPAT_LATEST_VERSION="5"
23 # Note that this script will export all variables explicitly,
24 # trying to export all with a blanket "export" statement at
25 # the top of the generated file causes the build to slow down
26 # by an order of magnitude.
28 if [[ ${KERNEL_VERSION} -eq "3" ]]; then
29 KERNEL_SUBLEVEL=$(${MAKE} -C ${KLIB_BUILD} kernelversion | sed -n 's/^3\.\([0-9]\+\).*/\1/p')
31 COMPAT_26LATEST_VERSION="39"
32 KERNEL_26SUBLEVEL=$(${MAKE} -C ${KLIB_BUILD} kernelversion | sed -n 's/^2\.6\.\([0-9]\+\).*/\1/p')
33 let KERNEL_26SUBLEVEL=${KERNEL_26SUBLEVEL}+1
35 for i in $(seq ${KERNEL_26SUBLEVEL} ${COMPAT_26LATEST_VERSION}); do
36 eval CONFIG_COMPAT_KERNEL_2_6_${i}=y
37 echo "export CONFIG_COMPAT_KERNEL_2_6_${i}=y"
41 let KERNEL_SUBLEVEL=${KERNEL_SUBLEVEL}+1
42 for i in $(seq ${KERNEL_SUBLEVEL} ${COMPAT_LATEST_VERSION}); do
43 eval CONFIG_COMPAT_KERNEL_3_${i}=y
44 echo "export CONFIG_COMPAT_KERNEL_3_${i}=y"
47 # The purpose of these seem to be the inverse of the above other varibales.
48 # The RHEL checks seem to annotate the existance of RHEL minor versions.
49 RHEL_MAJOR=$(grep ^RHEL_MAJOR ${KLIB_BUILD}/Makefile | sed -n 's/.*= *\(.*\)/\1/p')
50 if [[ ! -z ${RHEL_MAJOR} ]]; then
51 RHEL_MINOR=$(grep ^RHEL_MINOR $(KLIB_BUILD)/Makefile | sed -n 's/.*= *\(.*\)/\1/p')
52 for i in $(seq 0 ${RHEL_MINOR}); do
53 eval CONFIG_COMPAT_${RHEL_MAJOR}_${i}=y
54 echo "export CONFIG_COMPAT_${RHEL_MAJOR}_${i}=y"
58 if [[ ${CONFIG_COMPAT_KERNEL_2_6_33} = "y" ]]; then
59 echo "export CONFIG_COMPAT_FIRMWARE_CLASS=m"
62 if [[ ${CONFIG_COMPAT_KERNEL_2_6_36} = "y" ]]; then
63 echo "export CONFIG_COMPAT_KFIFO=y"
66 if [[ ${CONFIG_COMPAT_KERNEL_3_5} = "y" ]]; then
67 # We don't have 2.6.24 backport support yet for Codel / FQ CoDel
68 # For those who want to try this is what is required that I can tell
71 # - init and change callback ops use a different argument dataype
72 # - you need to parse data received from userspace differently
73 if [[ ${CONFIG_COMPAT_KERNEL_2_6_25} != "y" ]]; then
74 echo "export CONFIG_COMPAT_NET_SCH_CODEL=m"
75 echo "export CONFIG_COMPAT_NET_SCH_FQ_CODEL=m"