Build Kernel for AXIOM Beta

From apertus wiki
Jump to: navigation, search

You can build the Kernel and run it with the AXIOM Beta image. We recommended to first run it with QEMU. You can install QEMU as described in this link [1] and run the QEMU with the build Kernel as described in the end of this Wiki page.

Before you start building any kernel version, you need to install the dependencies first. Using the following command, you will be able to install the dependencies. This dependencies for Ubuntu.

       $ sudo apt install build-essential gcc-arm-linux-gnueabi libglib2.0-dev zlib1g-dev


1 Building Kernel 4.6.0

At the moment AXIOM Beta use Kernel 4.6.0 and it works properly on both camera and the QEMU. To build Kernel 4.6.0, first you need to download the Xilinx Linux Kernel source code. To get a clone of Xilinx Linux Kernel, you can use the following command.

       $ git clone https://github.com/Xilinx/linux-xlnx.git
       $ cd linux-xlnx

After getting the clone, you need to checkout for older version (Kernel 4.6.0). For that you can use the following command.

       $ git checkout tags/xilinx-v2016.4 -b xilinx-v2016.4

So now you are ready to build the Kernel 4.6.0. But before that you need to add the configuration first. To download the configuration file, you can use the following command.

       $ wget http://vserver.13thfloor.at/Stuff/AXIOM/BETA/kernel-4.6.0-xilinx-00016-gb49271f.config
       $ mv kernel-4.6.0-xilinx-00016-gb49271f.config .config

You have now got the Kernel and the configuration file. Now you can configure and build the kernel 4.6.0 using the following commands.

       $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- oldconfig
       $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-

If you get any errors during the building process, you probably haven't got dependencies. Search the error on internet and install the dependencies. Then you can continue building the Kernel.

2 Build Kernel 4.9.0

Kernel 4.9.0 is the resent Kernel on the Xilinx Linux Kernel git repo. You can build the Kernel 4.9.0 as described bellow.

First you need to clone the Xilinx Linux Kernel source code. You can do that using following command.

       $ git clone https://github.com/Xilinx/linux-xlnx.git
       $ cd linux-xlnx

After that you need to get the configuration file. You can add the configuration file using following command.

       $ wget http://vserver.13thfloor.at/Stuff/AXIOM/BETA/kernel-4.9.0-xilinx-00037-g5d029fd.config
       $ mv kernel-4.9.0-xilinx-00037-g5d029fd.config .config

Then you can configure and build the Kernel 4.9.0. To do that you can use the following commands.

       $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- oldconfig
       $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-

If you get any errors during the building process, you probably haven't got dependencies. Search the error on internet and install the dependencies. Then you can continue building the Kernel.


You can see the build kernel on linux-xlnx/arch/arm/boot/, named as zImage


3 Building modules for Kernel

After building the Kernel, you can also build the modules by using following command.

       $ INSTALL_MOD_PATH=../modules/ make modules_install ARCH=arm

The modules will be saved on modules folder outside of the linux-xlnx source folder.


4 Running AXIOM Beta QEMU with new build Kernel

First you need the verify that Apertus provided AXIOM Beta image work perfectly on QEMU. If you haven't created that yet, you have to get it done as described in this link [2].

After verifying that it works properly, you have to copy the zImage file located in linux-xlnx/arch/arm/boot/ folder, and paste it in the same folder which AXIOM Beta image consist. Then you have to run the following command to boot the QEMU with build Kernel.

       $ qemu-system-aarch64 -M arm-generic-fdt-7series -machine linux=on -m 1024 -serial /dev/null -serial mon:stdio -nographic -dtb devicetree.dtb -kernel zImage -drive if=sd,format=raw,index=0,file=beta_20170109.dd -boot mode=5 -append "root=/dev/mmcblk0p2 ro rootwait rootfstype=ext4" 

PLEASE NOTE THAT If you are using the same code discribed in [3] to run QEMU, you will not run the QEMU with build Kernel, but it boot with the Kernel which already have in the AXIOM Beta image. You can check for the kernel after booting QEMU, using the following command.

       $ uname -a


5 Current state

As we tested on QEMU, Kernel 4.6.0 work perfectly. But Kernel 4.9.0 does not seems to be working. It just start booting and struck on one point. Also, both Kernel 4.6.0 and 4.9.0 works on camera.