How to get cross CIF for building and verification of Linux kernel loadable modules on ARM

Instructions below are for Debian 9. You may need some changes for other versions of Debian.

Install prerequisites:

$ sudo apt-get install autoconf automake libtool libexpat1-dev libncurses5-dev bison flex patch texinfo build-essential gawk gperf help2man libtool-bin

Get cross CIF

You can either download an archive with cross CIF prepared in advance from here or follow the next steps.

Build CIF as usual. Below it is assumed that CIF sources and build files are within directory ~/cif.

Build crosstool-ng 1.23.0:

$ cd ~
$ wget
$ tar -xf crosstool-ng-1.23.0.tar.xz
$ cd crosstool-ng-1.23.0
$ ./configure --enable-local
$ make

Build cross CIF:

$ mkdir ~/cif/build/cross

Download file .config into ~/cif/build/cross. Replace username novikov with your one if necessary within ~/cif/build/cross/.config.
$ ~/crosstool-ng-1.23.0/ct-ng build

Install cross CIF:

sudo cp -r ~/x-tools/arm-unknown-eabi /usr/local/arm-unknown-eabi-cif
sudo cp /usr/local/cif/bin/cif /usr/local/arm-unknown-eabi-cif/bin/arm-unknown-eabi-cif
cd /usr/local/bin/
sudo ln -sf ../arm-unknown-eabi-cif/bin/arm-unknown-eabi-cif
sudo ln -sf ../arm-unknown-eabi-cif/bin/arm-unknown-eabi-gcc arm-unknown-eabi-aspectator

Get build base for Linux kernel loadable modules on ARM

Get sources of the target version of the Linux kernel. Below is an example for getting a build base for Linux 5.5:

$ export PATH=$PATH:/usr/local/arm-unknown-eabi-cif/bin
$ make ARCH=arm CROSS_COMPILE=arm-unknown-eabi- defconfig
$ clade -p klever_linux_kernel_arm make -j8 ARCH=arm CROSS_COMPILE=arm-unknown-eabi- drivers/watchdog/davinci_wdt.ko

Verify target modules

In addition to the normal workflow you just need to specify "architecture": "ARM" within job.json.

Updated by Evgeny Novikov over 3 years ago · 3 revisions