hello i am trying to customize my image boot animation using plymouth here’s what i did already :
this is the video.script that suppose to ensure that my video keeps playing till the user interface appear :
import time
import animation
# Play the animation (loop if needed)
animation.play_animation("/usr/share/plymouth/themes/video-theme/308С_Intro_fix2_Preview.mp4")
# Keep showing the animation until the user-space takes over
while True:
time.sleep(1)
this the video.plymouth :
[Plymouth Theme]
Name=Video Boot Animation
Description=A theme that plays a video as boot animation.
ModuleName=script
[script]
ImageDir=/usr/share/plymouth/themes/video-theme
ScriptFile=/usr/share/plymouth/themes/video-theme/video.script
BackgroundStartColor=0x000000
BackgroundEndColor=0x000000
HorizontalAlignment=.5
VerticalAlignment=.7
when i built the whole image and checked rootfs file the plymouth.default file shows that the default theme is spinner which is the old one so how can i change to mine through the recipe i checked this solution but i want make sure that it’s right before applying it
PREFERRED_THEME = "video-theme"
ROOTFS_POSTPROCESS_COMMAND += "set_plymouth_theme;"
set_plymouth_theme() {
# Set the theme and rebuild initrd
plymouth-set-default-theme video-theme --rebuild-initrd
}
can u please check my work and tell me if there is anything wrong i did and please tell me if the solution i found will set theme-video as the default one or not
thank u
Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!
Did you like my answer?
Hello,
Your approach to setting a custom Plymouth theme in your Yocto build appears to be on the right track. Let’s review your steps and ensure everything is correctly configured:
Theme Files: Your video.plymouth and video.script files seem properly set up to define a custom video boot animation. Double-check that all paths and filenames are consistent with your build environment.
Yocto Recipe (plymouth_%.bbappend): Your recipe correctly includes the theme files and specifies their installation paths. Ensure the do_install:append function places the files in the correct directory structure within the root filesystem.
Setting the Default Theme:
The PREFERRED_THEME variable is not typically used for Plymouth themes. Instead, your use of ROOTFS_POSTPROCESS_COMMAND is appropriate. The set_plymouth_theme function should effectively set your theme and rebuild the initrd.
Verification:
After building the image, confirm that the theme files are in the expected directory on the target device.
Check the Plymouth configuration file (usually /etc/plymouth/plymouthd.conf) on the target to ensure it points to your custom theme.
Verify that the initrd is rebuilt with the new theme settings. You can manually inspect the initrd contents if necessary.
By following these steps, your custom theme should be set as the default. If you encounter any issues, ensure that the plymouth-set-default-theme command is executed correctly during the build process.
Best regards,
Toradex AI Assistant
Please, also check if these links can help you solve your problem:
This was exactly what I was going to ask you… I see you tried to use a video (MP4), but from Plymouth’s documentation, I couldn’t see a way of using video.
On top of that, there are several projects on Github that convert a video to be used as an animation by Plymouth: from what I could understand, they extract a sequence of still frames from the video so Plymouth can display them. For instance: plymouth-boot-animations · GitHub Topics · GitHub (I didn’t try it myself)
Seems like this is Plymouth’s approach to display a “video”.
Related: this is an interesting repository with several Plymouth themes. Maybe this can be helpful/serve as an inspiration.
now my problem is in the bbappend recipe i am confused of the way to set my boot animation as the default theme besides rebuilding the initramfs to apply the changes
look at the recipe and tell me what do u think of it
this is .script file i don’t really like the scaling process it will take sooo long to load each time is there a way to optimize it for exemple to prefix the screen size for the images