Get, patch and build the kernel

l3iggs edited this page Apr 28, 2015 · 20 revisions
git clone git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git
cd linux
git checkout master
git checkout v4.0 # the kernel was at version 4.0 at the time of this writing, update for your desired version
wget -N https://raw.githubusercontent.com/l3iggs/tbs2910-from-scratch/master/matrix.cfg
git reset --hard
${SETUP_CROSS_TOOLCHAIN}
make distclean
make imx_v6_v7_defconfig
scripts/kconfig/merge_config.sh -r .config matrix.cfg
make zImage
make dtbs imx6q-tbs2910.dtb

We're interested in arch/arm/boot/zImage and arch/arm/boot/dtbs/imx6q-tbs2910.dtb

Next we'll package the Linux build files for consumption by u-boot during the Linux boot process. For this we'll need the mkimage tool it is found in the tools/ folder of the u-boot project after building u-boot. Rename imx6q-tbs2910.dtb to target.dtb and copy it and zImage to the same directory. That you will run these commands from:

wget -N https://raw.githubusercontent.com/l3iggs/tbs2910-from-scratch/master/kernel_fdt.its
./mkimage -f kernel_fdt.its kernel_fdt.itb

You'll now have a bootable, FIT packaged Linux kernel file called kernel_fdt.itb.