IntroductionDuring the Linux kernel boot process, a small penguin icon corresponding to the number of cores appears in the upper left corner of the screen (for the dual-core i.MX93, two small penguins will appear). Each penguin image has a resolution of 80×80, and this image corresponds to the ppm file in the kernel source code. In practical embedded device applications, users often wish to customize the boot screen, and sometimes need to display an image that fills the entire screen or a small icon and set the icon’s position. In this article, we will guide you step-by-step on how to replace the icon, set the icon’s position, and control the number of icons displayed.1 Prepare an ImageDetermine the resolution of the logo to be modified based on the resolution of the screen being used. For example, here we choose the standard MIPI-DSI vertical MX8-DSI-OLED1A display for the i.MX93, which has a resolution of 1080×1920. The first step is to find an image you wish to replace, and using image processing software, adjust the image resolution to be equal to or less than the LCD resolution. Note that the resolution can be smaller but must not exceed the original size.2 Convert the Image to PPM FormatSince the kernel’s logo format is ppm, we first need to convert the png image to ppm format. Here we will use netpbm as an example. Netpbm is a toolkit for processing images, including tools like pngtopnm, pnmquant, and pnmtoplainpnm. Execute the following commands on an Ubuntu PC to install the netpbm toolkit.
sudo apt update
sudo apt install netpbm
Execute the following commands to convert the image format:
# Convert PNG to PNM format
pngtopnm nxp-logo.png > nxp-logo.pnm
# Quantize colors to 224 colors, Linux boot logo requires 224 colors
pnmquant 224 nxp-logo.pnm > nxp-logo_224.pnm
# Convert binary PNM to plain text (ASCII) format PPM
pnmtoplainpnm nxp-logo_224.pnm > logo_linux_clut224.ppm
rm nxp-logo.pnm nxp-logo_224.pnm
3 Replace the Logo FileCopy the generated “logo_linux_clut224.ppm” file to replace the “drivers/video/logo/logo_linux_clut224.ppm” file. Ensure that there are no files named “logo_xgdlinux_clut224.c” and “logo_xgdlinux_clut224.o” in that directory; if they exist, delete them.Execute the following commands to recompile the kernel. This article is primarily based on NXP’s L6.6.52_2.2.0 version of the BSP, demonstrated on the IMX93-EVK.
/* Set environment variables */
export CROSS_COMPILE=aarch64-linux-gnu-
export ARCH=arm64
/* Compile */
make imx_v8_defconfig
make -j$(nproc)
4 Full-Screen Logo Demonstration ImageAfter compilation, upload the new image to the board via SCP or USB drive and run it again. The effect is as follows; you can see that the kernel’s small penguin has been replaced with our custom logo.
Demonstration Video5 Disable the YOCTO Progress Bar on Linux BootIn the demonstration video, we can see a YOCTO progress bar after the boot logo, which relies on the psplash service. We can disable the psplash service by modifying the systemd configuration to turn off the progress bar.Use the following two systemctl commands to disable the psplash service:
systemctl disable psplash-start
systemctl disable psplash-systemd
After making the changes, restart the board, and the systemd configuration will take effect. The YOCTO progress bar will disappear, and the Linux boot logo will directly enter the Weston desktop.6 Centering a Non-Full-Screen Logo and Changing to a Single IconThe previous steps introduced how to modify a logo that fills the entire screen. What if you want to center a non-full-screen logo and display only one image?6.1 Setting MethodFollowing the previous steps, we can generate a new PNG image with a resolution of 640×480, convert it to PPM format, replace the kernel source logo file, and finally recompile the kernel.Starting from kernel version 5.10, the system supports uboot boot parameters to set the kernel logo’s position and the number of logos. Users can refer to the help file “Documentation/fb/fbcon.rst” in the kernel source for more information.You can add the following definitions in the u-boot bootargs parameter: “fbcon=logo-pos:center,logo-count:1” or “fbcon=logo-pos:center fbcon=logo-count:1” and save it.
setenv mmcargs "setenv bootargs ${jh_clk} ${mcore_clk} console=${console} root=${mmcroot} fbcon=logo-pos:center,logo-count:1"
saveenv
6.2 Parameter Passing ProcessEntry Point: The fbcon_setup() function (located in drivers/video/fbdev/core/fbcon.c) is responsible for parsing the parameters after fbcon=.Key Code Logic:
- When the kernel starts, fbcon_setup() is called, and its parameter options points to the string after fbcon= (e.g., “logo-pos:center”).
- By matching the prefix “logo-pos:” with strncmp, if “center” is detected, set fb_center_logo = true.
if (!strncmp(options, "logo-pos:", 9)) {
options += 9;
if (!strcmp(options, "center")) fb_center_logo = true;
continue;
}
Example of Call Chain:During kernel startup, command line parameters are passed through the following path:
start_kernel()→ console_init()→ fbcon_init()// Initialize fbcon→ fbcon_setup()// Parse "fbcon=" parameters
The options parameter of fbcon_setup() comes directly from the substring after fbcon=.6.3 Non-Full-Screen Logo Demonstration Image
7 Remove the Cursor Below the LogoWe can enter the current directory of the kernel and go to the drivers/video/fbdev/core/fbcon.c file, commenting out the contents of static void fb_flashcursor(struct work_struct *work) and static void fbcon_cursor(struct vc_data *vc, int mode) to make them empty functions.ConclusionThis article demonstrated how to modify both full-screen and non-full-screen logos in Linux. The non-full-screen logo also involves centering the logo, controlling the number of logos displayed, and removing the cursor display. For more information on customizing and replacing the Kernel boot logo and demonstration videos, feel free to leave comments or private messages for discussion.