TS-TPC-7990 Kernel Compile Guide: Difference between revisions

From embeddedTS Manuals
Line 84: Line 84:
Now recompile the kernel following the guide in the previous section.
Now recompile the kernel following the guide in the previous section.


As another option the Linux kernel logo can be disabled completely with "logo.nologo" [[#Modify_Linux_Kernel_cmdline in the kernel cmdline]].
As another option the Linux kernel logo can be disabled completely with "logo.nologo" [[#Modify_Linux_Kernel_cmdline|in the kernel cmdline]].

Revision as of 09:39, 6 February 2017

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

This board 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-boots by default is only present for about a second while the kernel, device tree, and optionally the FPGA are loaded. As a quick change the u-boot splash can be disabled and only the kernel's splash will be shown 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 your logo in u-boot take the imagefile file and convert it to a .bmp, and compress it with gz. The logo should be as small and simple as possible to compress well and load fast.

Install imagemagick on your 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 users 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/sd the splash screen from u-boot will only be shown for about 1-3 seconds until Linux is loaded.

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 splashscreen 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 your image, 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/

Now recompile the kernel following the guide in the previous section.

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