TS-TPC-7990 Kernel Compile Guide

From embeddedTS Manuals
Revision as of 17:02, 27 September 2018 by Kris (talk | contribs) (→‎Change Kernel Splash Screen: Updated grammar and added clarifications)

The kernels we use in our images are built using the toolchains built by Yocto. You can download the appropriate cross toolchain for your Linux system here. Right click and save as for the appropriate toolchain:

# X86_64 (64 bit)
chmod a+x poky-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-2.1.1.sh
sudo ./poky-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-2.1.1.sh

# i686 (32 bit)
chmod a+x poky-glibc-i686-meta-toolchain-qt5-cortexa9hf-neon-toolchain-2.1.1.sh
sudo ./poky-glibc-i686-meta-toolchain-qt5-cortexa9hf-neon-toolchain-2.1.1.sh

This will ask for the install directory for the toolchain. You can choose another directory than the default, but the following instructions will assume the defaults.

This also requires several tools from your distribution. For Ubuntu/Debian:

sudo apt-get install git build-essential lzop u-boot-tools libncursesw5-dev

Once those are installed:

# This is the branch we recommend for our standard images:
git clone https://github.com/embeddedarm/linux-3.10.17-imx6.git -b imx_4.1.15_1.0.0_ga linux-technologic
cd linux-technologic/

# This mus be run every time you open a new terminal to build the kernel
source /opt/poky/2.1.1/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
export LOADADDR=0x10008000
make ts4900_defconfig

## Make any changes in "make menuconfig" or driver modifications, then compile
make -j4 && make uImage

To install this to a board you would use a USB SD reader and plug in the card. Assuming your Linux rootfs is all on "sdc1":

export DEV=/dev/sdc1
sudo mount "$DEV" /mnt/sd
# Yocto makes this a symlink which must first be removed
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

Change Kernel Splash Screen

The TS-7990 uses two splash screens. By default they display the same image. U-Boot draws the very first splash screen, and the kernel the second. U-Boot's is only present for about a second while the kernel, device tree, and optionally the FPGA are loaded. The U-Boot splash can be disabled allowing only the kernel's splash screen to show up during boot. This change can be made with:

# This tells the splash command to just run "true" which returns immediately instead of
# drawing a splash screen
env set splash true
env save

To use a custom logo or splash screen in U-Boot, convert the file to a .bmp, and compress it with gz. The logo should be as small and simple as possible to compress well and load fast.

The imagemagick tool can be used on a host system to convert to the correct format.

convert yoursplash.png -colors 256 -depth 8 -compress none splash.bmp3
gzip splash.bmp3

This is provided in U-Boot primarily for applications that may want to give some feedback to the user. For example, a developer may want to use this U-Boot splash as failed to boot screen or to show the user a message while updating from custom U-Boot scripts. In the default configuration when booting off of eMMC or SD the splash screen from U-Boot will only be shown for about 1-3 seconds until the OS kernel is started.

After U-Boot runs, the Linux kernel is typically started which will set up the clock tree and reinitialize hardware. It is not possible for the U-Boot splash to persist through this, but the kernel can redraw the splash a second later which will appear as a short flicker.

The kernel splash screen allows 224 colors. It also allows up to the full screen resolution, but for fastest boot speed it should be kept as small as possible. The image will be centered around a black background.

To convert an image to be compatible with the Linux splash screen, for example, "mylogo.png":

convert mylogo.png mylogo.ppm
ppmquant 224 mylogo.ppm > mylogo-224.ppm
pnmnoraw mylogo-224.ppm > logo_user_clut224.ppm
cp logo_user_clut224.ppm <kernel build sources>/drivers/video/logo/

In order for this to take effect on boot, the kernel must be re-compiled.

As another option the Linux kernel logo can be disabled completely with "logo.nologo" in the kernel cmdline.