Cross compile i.MX6 kernel using LTIB toolchain

Published on January 20, 2013

Archived Notice

This article has been archived and may contain broken links, photos and out-of-date information. If you have any questions, please Contact Us.

Again, this may be old hat to many, but here's a quick how-to on getting and cross compiling a kernel from our Github kernel repository.

~/$ git clone git:// ~/$ cd linux-imx6 ~/linux-imx6$ export PATH=/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/:$PATH ~/linux-imx6$ export ARCH=arm ~/linux-imx6$ export CROSS_COMPILE=arm-none-linux-gnueabi- ~/linux-imx6$ git checkout origin/boundary-imx-3.0.35_1.1.0 -b boundary-imx-3.0.35_1.1.0 ~/linux-imx6$ make nitrogen6x_defconfig ~/linux-imx6$ make uImage modules The output will be placed in ~/linux-imx6/arch/arm/boot/uImage.

If you've build any drivers as modules, you'll generally want to install them into /lib/modules/kernelversion/.... You can use the INSTALL_MOD_PATH variable and the modules_install make target to install them to a temporary location as follows. Note that before copying them to an SD card or filesystem image, you'll generally want to kill the link back to the source directory, or you'll copy 100s of MBytes of source code and increase your disk image size.

~/linux-imx6$ make INSTALL_MOD_PATH=~/tmp modules_install ~/linux-imx6$ find ~/tmp/lib/modules -type l -exec rm -f {} ; ~/linux-imx6$ cp -ravf ~/tmp/lib/modules/* /media/myrootfs/lib/modules/