Project

General

Profile

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

Revision 1 (Evgeny Novikov, 08/21/2020 10:44 AM) → Revision 2/3 (Evgeny Novikov, 08/21/2020 12:36 PM)

h1. 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: 
 <pre> 
 $ sudo apt-get install autoconf automake libtool libexpat1-dev libncurses5-dev bison flex patch texinfo build-essential gawk gperf help2man libtool-bin 
 </pre> 

 h2. Get cross CIF 

 You can either download an archive with cross CIF prepared in advance from "here":https://forge.ispras.ru/attachments/download/7828/arm-unknown-eabi-cif-d62e4d9.tar.xz or follow the next steps. 

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

 Build _crosstool-ng_ 1.23.0: 
 <pre> 
 $ cd ~ 
 $ wget http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.23.0.tar.xz 
 $ tar -xf crosstool-ng-1.23.0.tar.xz 
 $ cd crosstool-ng-1.23.0 
 $ ./configure --enable-local 
 $ make 
 </pre> 

 Build cross CIF: 
 <pre> 
 $ mkdir ~/cif/build/cross 
 </pre> 
 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>_. 
 <pre> 
 $ ~/crosstool-ng-1.23.0/ct-ng build 
 </pre> 

 Install cross CIF: 
 <pre> 
 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 
 </pre> 

 h2. 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: 
 <pre> 
 $ 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 
 </pre> 

 h2. Verify target modules 

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