compat: explicitly export generated variables
authorJohannes Berg <>
Fri, 30 Mar 2012 11:11:44 +0000 (13:11 +0200)
committerLuis R. Rodriguez <>
Fri, 30 Mar 2012 21:48:11 +0000 (14:48 -0700)
Doing the blanket "export" statement at the beginning
of the generated file confuses the kernel's Makefiles
and causes extreme build slowdowns.

mcgrof@tux ~/compat (git::master)$ ckmake
Trying kernel                  3.3.0-030300rc2-generic  [OK]
Trying kernel                     3.2.2-030202-generic  [OK]
Trying kernel                    3.1.10-030110-generic  [OK]
Trying kernel                    3.0.18-030018-generic  [OK]
Trying kernel                  2.6.39-02063904-generic  [OK]
Trying kernel                        2.6.38-13-generic  [OK]
Trying kernel                  2.6.38-02063808-generic  [OK]
Trying kernel                  2.6.37-02063706-generic  [OK]
Trying kernel                  2.6.36-02063604-generic  [OK]
Trying kernel                  2.6.35-02063512-generic  [OK]
Trying kernel                  2.6.34-02063410-generic  [OK]
Trying kernel                  2.6.33-02063305-generic  [OK]
Trying kernel                  2.6.32-02063255-generic  [OK]
Trying kernel                        2.6.31-22-generic  [OK]
Trying kernel                  2.6.31-02063113-generic  [OK]
Trying kernel                  2.6.30-02063010-generic  [OK]
Trying kernel                  2.6.29-02062906-generic  [OK]
Trying kernel                  2.6.28-02062810-generic  [OK]
Trying kernel                    2.6.27-020627-generic  [OK]
Trying kernel                    2.6.26-020626-generic  [OK]
Trying kernel                    2.6.25-020625-generic  [OK]
Trying kernel                    2.6.24-020624-generic  [OK]

Signed-off-by: Johannes Berg <>
Signed-off-by: Luis R. Rodriguez <>

index 5d6e34c..6cdac12 100755 (executable)
@@ -20,9 +20,10 @@ KERNEL_VERSION=$(${MAKE} -C ${KLIB_BUILD} kernelversion | sed -n 's/^\([0-9]\)\.
-# This allows all these variables to be propagated through
-# all of our Makefiles
-echo export
+# Note that this script will export all variables explicitly,
+# trying to export all with a blanket "export" statement at
+# the top of the generated file causes the build to slow down
+# by an order of magnitude.
 if [[ ${KERNEL_VERSION} -eq "3" ]]; then
        KERNEL_SUBLEVEL=$(${MAKE} -C ${KLIB_BUILD} kernelversion | sed -n 's/^3\.\([0-9]\+\).*/\1/p')
@@ -33,14 +34,14 @@ else
        for i in $(seq ${KERNEL_26SUBLEVEL} ${COMPAT_26LATEST_VERSION}); do
                eval CONFIG_COMPAT_KERNEL_2_6_${i}=y
-               echo "CONFIG_COMPAT_KERNEL_2_6_${i}=y"
+               echo "export CONFIG_COMPAT_KERNEL_2_6_${i}=y"
        eval CONFIG_COMPAT_KERNEL_3_${i}=y
-       echo "CONFIG_COMPAT_KERNEL_3_${i}=y"
+       echo "export CONFIG_COMPAT_KERNEL_3_${i}=y"
 # The purpose of these seem to be the inverse of the above other varibales.
@@ -50,14 +51,14 @@ if [[ ! -z ${RHEL_MAJOR} ]]; then
        RHEL_MINOR=$(grep ^RHEL_MINOR $(KLIB_BUILD)/Makefile | sed -n 's/.*= *\(.*\)/\1/p')
        for i in $(seq 0 ${RHEL_MINOR}); do
                eval CONFIG_COMPAT_${RHEL_MAJOR}_${i}=y
-               echo "CONFIG_COMPAT_${RHEL_MAJOR}_${i}=y"
+               echo "export CONFIG_COMPAT_${RHEL_MAJOR}_${i}=y"
 if [[ ${CONFIG_COMPAT_KERNEL_2_6_33} = "y" ]]; then
+       echo "export CONFIG_COMPAT_FIRMWARE_CLASS=m"
 if [[ ${CONFIG_COMPAT_KERNEL_2_6_36} = "y" ]]; then
-       echo "CONFIG_COMPAT_KFIFO=y"
+       echo "export CONFIG_COMPAT_KFIFO=y"