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

From embeddedTS Manuals
(→‎Change Kernel Splash Screen: Updated grammar and added clarifications)
Line 52: Line 52:


== Change Kernel Splash Screen ==
== 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:
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:
<source lang=bash>
<source lang=bash>
# This tells the splash command to just run "true" which returns immediately instead of
# This tells the splash command to just run "true" which returns immediately instead of
Line 60: Line 60:
</source>
</source>


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.
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.


Install imagemagick on your host system to convert to the correct format.
The imagemagick tool can be used on a host system to convert to the correct format.
<source lang=bash>
<source lang=bash>
convert yoursplash.png -colors 256 -depth 8 -compress none splash.bmp3
convert yoursplash.png -colors 256 -depth 8 -compress none splash.bmp3
Line 68: Line 68:
</source>
</source>


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.
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.
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.   
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 your image, for example, "mylogo.png":
To convert an image to be compatible with the Linux splash screen, for example, "mylogo.png":
<source lang=bash>
<source lang=bash>
convert mylogo.png mylogo.ppm
convert mylogo.png mylogo.ppm
Line 82: Line 82:
</source>
</source>


Now recompile the kernel following the guide in the previous section.
In order for this to take effect on boot, the [[#Compile_the_Kernel|kernel must be re-compiled]].


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 17:02, 27 September 2018

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.