The question is if it's worth it. I haven't tested initramfs on Pi4, but the kernel initialization takes about 1.5 seconds on Pi3B+ and Pi4. If I added initramfs it took another 1.5 seconds to load it. So you replace 1.5 seconds of black screen while kernel is being loaded and add another 1.5 seconds while initramfs is being loaded.DarkElvenAngel wrote: ↑Mon Mar 02, 2020 10:32 pmThis is true however sometimes this is the simplest way at the cost of a few seconds but on a Pi 4 there really isn't much time lost at all
Yes, the problem with kernel updating is the biggest disadvantage. That's why I talked about incorporating it into official Raspberry kernel directly. We use custom kernel modules in our project so we need to build kernel anyway.DarkElvenAngel wrote: ↑Mon Mar 02, 2020 10:32 pmThat's something I have played with an it's not for a novice plus you need a way to keep the kernel updated. So that going to require more effort in the long term.kolsi wrote: ↑Mon Mar 02, 2020 7:55 pmc) the most cleaner way to have boot splash during the whole boot is to build your own kernel and replace the small Raspberry logo with high-resolution (same as your screen resolution) image (max 224 colours, PPM format). This image will be displayed over the whole screen until something clears the screen (e.g. Xorg starts up).
The service cannot display the static image only. It must periodically refresh it in the background. Such service is loaded immediately when systemd is initialized. Also "-background none" switch must be added to Xorg, so the screen is not cleared when Xorg starts. Something like this:DarkElvenAngel wrote: ↑Mon Mar 02, 2020 10:32 pmThis is an issue I have also found most guides only use the service to display the image. The problem is that a Pi 4 is so fast it lasts for a fraction of a second and this isn't desirable for some users.kolsi wrote: ↑Mon Mar 02, 2020 7:55 pmd) when vc4-fkms driver is used then the video device is reinitialized and the frame buffer is cleared by systemd-udev service. You can create custom simple systemd service that is wanted by sysinit.target and executes a shell script that paints your logo (same as compiled into the kernel) to the frame buffer in the loop and checks for Xorg process existence. As a bonus, you can use it to create some kind of nice animation (e.g. spinner below the logo)
Code: Select all
#!/bin/sh i=0 while [ -z $(pidof Xorg) ] do # logo $(dirname $0)/fb_viewer $(dirname $0)/bootsplash-logo.bmp # spinner $(dirname $0)/fb_viewer $(dirname $0)/bootsplash-spinner-$i.bmp sleep 0.1 if [ $i -eq 7 ]; then i=0 else i=$(($i + 1)) fi done
My bad. I meant root partition, not boot - just something that is accessible during the kernel boot and user can put the image file there directly without the need of kernel recompiling. If I have time, I can work on it and create a patch, but I'm not sure if developers will be interested in incorporating it to the official kernel.DarkElvenAngel wrote: ↑Mon Mar 02, 2020 10:32 pmI've actually been working on such a thing but it uses the initramfs solution and some custom software. Building that functionality into a kernel is possible, but you have to remember the boot partition isn't mount by the kernel the root partition is. The smaller you can build the initramfs the faster it loads. I think having a slight delay in boot so you can have a picture is fine it's a trade off that more than a few are willing to make.