-
Notifications
You must be signed in to change notification settings - Fork 27
Building the Kernel
Once the build options have been added to the .config file, the kernel can be built.
To build the kernel from source, an ARM cross compiler is needed. If a compiler has not been installed, the following command will install the gcc compiler:
sudo apt-get install gcc-arm-linux-gnueabi
To add a system environment variable for the gcc compiler to the PC, use the following command:
export CROSS_COMPILE=arm-linux-gnueabi-
To build the kernel, use the following command:
make ARCH=arm
This will build the kernel and place the resulting compiled kernel image (zImage) in the arch/arm/boot directory. A new device tree binary file will also be compiled with the resulting file at91-sama5d3_xplained_pda4.dtb being located in the arch/arm/boot/dts directory.
Replace the old zImage and the .dtb file in the demo project linux4sam-poky-sam5d3_xplained_pda-5.7/ directory with the newly compiled files. To copy the files, use the following command:
sudo cp arch/arm/boot/zImage ~/linux4sam-poky-sam5d3_xplained_pda-5.7/zImage-sama5d3-xplained.bin
sudo cp arch/arm/boot/dts/at91-sama5d3_xplained_pda4.dtb ~/linux4sam-poky-sama5d3_xplained_pda-5.7/