TS-7250-V3 kernel compile guide: Difference between revisions

From embeddedTS Manuals
(Created page with "The kernel can be compiled on its own using the Debian 10 Cross Compiler. This should be run from a workstation, and not directly on the boar...")
 
No edit summary
Line 33: Line 33:
</source>
</source>


After building this will output a kernel to ~/Projects/tsimx6ul/kernel/linux/kernel.tar.gz.
After building this will output a kernel to ~/Projects/tsimx6ul/kernel/linux/kernel.tar.gz. This file can be copied to the board, and then installed with:
<source lang=bash>
tar -xf kernel.tar.gz -C /
</source>
 
This can also be added to an image with:
<source lang=bash>
mkdir /tmp/image/
sudo tar --numeric-owner -xf old-image.tar.bz2 -C /tmp/image/
sudo tar -xf kernel.tar.gz -C /tmp/image/
sudo tar --numeric-owner -cjf new-image.tar.bz2 -C /tmp/image .
</source>

Revision as of 11:45, 20 April 2020

The kernel can be compiled on its own using the Debian 10 Cross Compiler. This should be run from a workstation, and not directly on the board. As with the Debian development, this requires setting up the docker for cross compiling.

Enter the cross compile environment:

# Create a place to store the kernel:
mkdir -p ~/Projects/tsimx6ul/kernel/
cd ~/Projects/tsimx6ul/kernel/
docker run -it --volume $(pwd):/work armhf-buster-toolchain bash

Inside the docker run:

cd /work/
git clone https://github.com/embeddedarm/linux-4.9.y.git --depth 1 linux
cd linux/

export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
export TEMP=$(mktemp -d)

make tsimx6ul_defconfig

# Make customizations here

make -j $(nproc --all) all zImage

mkdir "$TEMP/boot/"
cp arch/arm/boot/zImage "$TEMP"/boot/zImage
cp arch/arm/boot/dts/imx6*-ts*.dtb "$TEMP"/boot/ 
INSTALL_MOD_PATH="$TEMP" make modules_install
tar czf kernel.tar.gz -C "$TEMP" .
exit

After building this will output a kernel to ~/Projects/tsimx6ul/kernel/linux/kernel.tar.gz. This file can be copied to the board, and then installed with:

tar -xf kernel.tar.gz -C /

This can also be added to an image with:

mkdir /tmp/image/
sudo tar --numeric-owner -xf old-image.tar.bz2 -C /tmp/image/
sudo tar -xf kernel.tar.gz -C /tmp/image/
sudo tar --numeric-owner -cjf new-image.tar.bz2 -C /tmp/image .