You are not logged in.

#1 2023-01-24 19:46:21

dojero
Member
Registered: 2011-11-26
Posts: 37

Splash screen bmp added to UKI file with mkinitcpio

I boot using a unified kernel image (an .efi file). I create the image with the mkinitcpio command that uses a linux-preset file and a kernel cmdline file. In the linux-preset file, I set the splash screen with a default_options setting.

To create the splash screen, I used GIMP to convert a jpg file to a bmp file, and then put that bmp file into /usr/share/systemd/bootctl/. And it works perfectly.

But then I wanted to change the splash screen. I went through the same process, acquiring a jgp file, and then exporting to to a bmp file with GIMP.

But when I boot, there's no splash screen...it's just blank. When I replace the splash screen option in linux-preset with the original bmp or with the arch-splash bmp, it works. But not with the new bmp.

Any suggestions as to why?

Offline

#2 2023-01-26 17:02:48

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,999
Website

Re: Splash screen bmp added to UKI file with mkinitcpio

Is the resolution the same? Run the `file` command on both .bmp images and compare the output.


Jin, Jîyan, Azadî

Offline

#3 2023-03-01 21:30:33

kousu
Member
Registered: 2022-01-25
Posts: 13

Re: Splash screen bmp added to UKI file with mkinitcpio

I have this working. This is my UKI config:

[kousu@laptop ~]$ cat /etc/mkinitcpio.d/linux.preset 
# mkinitcpio preset file for the 'linux' package

ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/boot/vmlinuz-linux"
ALL_microcode=(/boot/*-ucode.img)

PRESETS=('default' 'fallback')

#default_config="/etc/mkinitcpio.conf"
default_image="/boot/initramfs-linux.img"

#fallback_config="/etc/mkinitcpio.conf"
fallback_image="/boot/initramfs-linux-fallback.img"
fallback_options="-S autodetect"

default_uki="/boot/efi/boot/bootx64.efi"
default_options="--splash=/home/kousu/Pictures/Wallpapers/symbiontworld.bmp"
fallback_uki="/boot/efi/boot/archlinux-linux-fallback.efi"

And I installed as normal with

[kousu@laptop ~]$ sudo mkinitcpio -p linux

I cropped and resized the image using `pinta`, not GIMP. It's not the same dimensions as the default:

[root@bomp ~]# file /usr/share/systemd/bootctl/splash-arch.bmp /home/kousu/Pictures/Wallpapers/symbiontworld.bmp
/usr/share/systemd/bootctl/splash-arch.bmp:        PC bitmap, Windows 98/2000 and newer format, 566 x 167 x 32, cbSize 378226, bits offset 138
/home/kousu/Pictures/Wallpapers/symbiontworld.bmp: PC bitmap, Windows 3.x format, 566 x 347 x 24, image size 589900, cbSize 589954, bits offset 54

and it showed up for me during boot. However it looked like it was rescaled to 566 x 167, so maybe that's a limitation of UKI? That all splash images have to be that size?

I don't know why yours didn't show up at all. Are you sure you saved it as a .bmp image? Were there any errors when you ran `mkinitcpio`?

Edit: I still haven't found the official docs for this (is it a mkinitcpio thing? a kernel thing?) but I've figured out the rules:

- the --splash file must be .bmp
- it must be smaller than your screen's resolution

The particular kind of .bmp doesn't seem to matter, whether it's 24 or 32 bits deep or Windows 95 or 98 format. It just has to *fit*. That's the main rule. That's probably why your images weren't showing.

For me

$ cat /sys/class/drm/card*/modes 
1366x768

So I found a background at the right aspect ratio and rescaled it to fit exactly in that.

$ file /usr/share/backgrounds/Sehnsucht-Dark_Hedges_N._Ireland.bmp
/usr/share/backgrounds/Sehnsucht-Dark_Hedges_N._Ireland.bmp: PC bitmap, Windows 95/NT4 and newer format, 1365 x 768 x 32, cbSize 4193402, bits offset 122

And built with

$ cat /etc/mkinitcpio.d/linux.preset 
# mkinitcpio preset that builds a https://wiki.archlinux.org/title/Unified_kernel_image
# which is an EFI-bootable file that bundles the contents of /etc/kernel/cmdline, a splash image,
# and the kernel and initrd into one single file, without a second-stage bootloader like GRUB or syslinux.

#ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/boot/vmlinuz-linux"

PRESETS=('default' 'fallback')

# Build into the default boot path for 64-bit EFI ($ESP/boot/bootx64.efi)
# which means that there's no need to modify the system EFI settings.
default_uki="/boot/efi/boot/bootx64.efi"
#default_options="--splash=/usr/share/systemd/bootctl/splash-arch.bmp"
default_options="--splash=/usr/share/backgrounds/Sehnsucht-Dark_Hedges_N._Ireland.bmp"

fallback_uki="/boot/efi/boot/archlinux-linux-fallback.efi"
fallback_options="-S autodetect"
$ sudo mkinitcpio -P linux

With this, I have a full screen bootsplash and it looks great.

Last edited by kousu (2025-11-01 05:20:17)

Offline

Board footer

Powered by FluxBB