Making compat scripts distribution agnostic

Share on Facebook0Tweet about this on TwitterShare on Google+0

There exists 2 very useful scripts for testing the work done in compat.git tree: ckmake and get-compat-kernels.

get-compat-kernels downloads and installs a predefined set of kernels (namely from 2.6.24 to the latest one available) to your system. Since we need a configured source tree in which a kernel build is already done, .deb packages from Ubuntu PPA mainline kernel repository are used to ease the process but since we need dpkg to install these packages, the script was written so that it only works on Ubuntu.

So I modified the script in a way that it will extract the packages correctly on any linux distribution in which the ar utility is installed (.deb packages are simply ar archives in which there exists a data.tar.gz containing the files that will be installed on your system).  Ar is shipped within the binutils package which should already be installed on your system if you are doing development.

Once you use get-compat-kernels to download and extract the kernel source trees, you now have to use ckmake to build the compat tree against all the extracted kernels. ckmake sequentially switches to the source trees found under /lib/modules/ and builds the compat tree. Since get-compat-kernels does not depend on Ubuntu anymore , I dropped the distribution check in ckmake to make that function on any distribution.

Now I can test the backports/modifications on Fedora before sending them to the upstream to make sure that they don’t break anything. ckmake script outputs a nice summary about the build state for every kernel version:

Trying kernel                     3.4.0-030400-generic	[OK]
Trying kernel                     3.3.7-030307-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-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-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]


Share on Facebook0Tweet about this on TwitterShare on Google+0