How To Compile the Mainline Linux Kernel v4.9 for TS-4900

embedded-linux-ts-board

Here’s a quick how-to guide straight from one of our engineers on how to compile the mainline Linux Kernel v4.9-rc1 and install it on the TS-4900. Support for the TS-4900 in the mainline kernel image (v4.9 and up) is a pretty big deal for us, and we’re excited about it. A big shout out to our friends at Savoir-faire Linux for their hard work in making this happen!

Step 1: Install the Toolchain

We need to install the toolchain from Ubuntu or Debian Jessie by running the following command:

apt-get install gcc-arm-linux-gnueabihf build-essential lzop u-boot-tools libncursesw5-dev -y

Step 2: Clone the Kernel Git Repository:

We’ll now clone the kernel source code from the official Linux kernel Git repository and change directory into the cloned path.

git clone --depth 1 git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git -b v4.9-rc1
cd linux

Step 3: Setup Build Environment Variables

We need to setup important environment variables so everything compiles appropriately for the TS-4900 ARM CPU and load address.

export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
export LOADADDR=0x10008000

Step 4: Grab Official TS-4900 Kernel Defconfig File

Next step is grabbing the defconfig file which defines what kernel features we need in order to get it working on the TS-4900. If you want to make any modifications to this, you can run make menuconfig before continuing to the compiling step.

wget ftp.embeddedarm.com/ftp/ts-socket-macrocontrollers/ts-4900-linux/sources/vanilla-rc1-defconfig -O .config

Step 5: Compile!

Now we’ll actually compile the kernel image using a fairly standard ‘make’ command.

make -j8 uImage

Step 6: Install

This next step comes directly from the “Compile the Kernel” section of the TS-4900 manual. Basically, we’ll be installing it to the microSD card, so you’ll need a microSD card reader and have the microSD card plugged in. Let’s assume your Linux rootfs is all on /dev/sdc1, and we’ll execute each of these commands in order. Replace /dev/sdc1 with your specific Linux rootfs after determining using fdisk -l.

export DEV=/dev/sdc1
sudo mount "$DEV" /mnt/sd
sudo rm /mnt/sd/boot/uImage
sudo cp arch/arm/boot/uImage /mnt/sd/boot/uImage
sudo cp arch/arm/boot/dts/imx6*ts*.dtb /mnt/sd/boot/
INSTALL_MOD_PATH="/mnt/sd" sudo -E make modules_install
INSTALL_HDR_PATH="/mnt/sd" sudo -E make headers_install
sudo umount /mnt/sd/
sync

Final Confirmation

After installing the microSD card into the TS-4900, power up the board to a command prompt. Execute the uname -a command to verify the kernel version.

root@ts-imx6:~# uname -a
Linux ts-imx6 4.9.0-rc1 #7 SMP Tue Oct 18 08:45:39 MST 2016 armv7l GNU/Linux

Similar Posts:

    None Found

Author: Derek Hildreth

eBusiness Manager for Technologic Systems