Project

General

Profile

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

Evgeny Novikov, 10/18/2020 05:53 PM

1 1 Evgeny Novikov
h1. How to get cross CIF for building and verification of Linux kernel loadable modules on ARM
2 2 Evgeny Novikov
3
Instructions below are for Debian 9. You may need some changes for other versions of Debian.
4
5
Install prerequisites:
6
<pre>
7
$ sudo apt-get install autoconf automake libtool libexpat1-dev libncurses5-dev bison flex patch texinfo build-essential gawk gperf help2man libtool-bin
8
</pre>
9
10
h2. Get cross CIF
11
12 3 Evgeny Novikov
You can either download an archive with cross CIF prepared in advance from "here":https://forge.ispras.ru/attachments/download/8051/arm-unknown-eabi-cif-a451e44.tar.xz or follow the next steps.
13 2 Evgeny Novikov
14
Build CIF as usual. Below it is assumed that CIF sources and build files are within directory _<notextile>~/cif</notextile>_.
15
16
Build _crosstool-ng_ 1.23.0:
17
<pre>
18
$ cd ~
19
$ wget http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.23.0.tar.xz
20
$ tar -xf crosstool-ng-1.23.0.tar.xz
21
$ cd crosstool-ng-1.23.0
22
$ ./configure --enable-local
23
$ make
24
</pre>
25
26
Build cross CIF:
27
<pre>
28
$ mkdir ~/cif/build/cross
29
</pre>
30
Download file attachment:.config into _<notextile>~/cif/build/cross</notextile>_. Replace username _novikov_ with your one if necessary within _<notextile>~/cif/build/cross/.config</notextile>_.
31
<pre>
32
$ ~/crosstool-ng-1.23.0/ct-ng build
33
</pre>
34
35
Install cross CIF:
36
<pre>
37
sudo cp -r ~/x-tools/arm-unknown-eabi /usr/local/arm-unknown-eabi-cif
38
sudo cp /usr/local/cif/bin/cif /usr/local/arm-unknown-eabi-cif/bin/arm-unknown-eabi-cif
39
cd /usr/local/bin/
40
sudo ln -sf ../arm-unknown-eabi-cif/bin/arm-unknown-eabi-cif
41
sudo ln -sf ../arm-unknown-eabi-cif/bin/arm-unknown-eabi-gcc arm-unknown-eabi-aspectator
42
</pre>
43
44
h2. Get build base for Linux kernel loadable modules on ARM
45
46
Get sources of the target version of the Linux kernel. Below is an example for getting a build base for Linux 5.5:
47
<pre>
48
$ export PATH=$PATH:/usr/local/arm-unknown-eabi-cif/bin
49
$ make ARCH=arm CROSS_COMPILE=arm-unknown-eabi- defconfig
50
$ clade -p klever_linux_kernel_arm make -j8 ARCH=arm CROSS_COMPILE=arm-unknown-eabi- drivers/watchdog/davinci_wdt.ko
51
</pre>
52
53
h2. Verify target modules
54
55
In addition to the normal workflow you just need to specify "architecture": "ARM" within _job.json_.