p

How the Plymouth boot screen (splash screen) works

This was accurate for my system in October 2013.

I had a lot of fun investigating plymouth. Much of the info I found was out of date. It seems plymouth is being rapidly developed , so this example (autumn 2013) will likely be also out of date within a year.

SuSE 12.3 repositories contain a stable version, check here if you want to look at the latest version from the developers.

I called my theme "quickboot" for ease of reading and understanding this page. I have used "quickboot" in all these examples. Once you are up and running, you can call your plymouth screen whatever you want.

Here is a summary, with links to the details :

Code for quickboot.script :
# This is a quick plymouth boot screen.
#
#

bgimage.image = Image("new_plymouth_bg.png");
my_background.sprite = Sprite(bgimage.image); 
my_background.sprite.SetX(0);
my_background.sprite.SetY(0);
my_background.sprite.SetOpacity(1.0);


#############
# callbacks #
#############

##########
# status #
##########

statusmsg.sprite = Sprite();
counter_statusmsg = 0;

fun update_status_callback (text)
	{
     counter_statusmsg++;
     status.image = Image.Text(counter_statusmsg + " - " + text, 1, 1, 1, 1, "droidsansmono", "left");
     statusmsg.sprite.SetImage(status.image);
     statusmsg.sprite.SetX(150);
     statusmsg.sprite.SetY(660);
     statusmsg.sprite.SetOpacity(1.0);
}
Plymouth.SetUpdateStatusFunction(update_status_callback);
    

###########
# message #
###########

# This is called from the shell scripts, using the 
# plymouth command
# plymouth display-message --text="".
#

messagemsg.sprite = Sprite();

fun message_callback (text) 
{
  message.image = Image.Text(text, 1, 1, 1, 1, "droidsansmono", "left");
  messagemsg.sprite.SetImage(message.image);
  messagemsg.sprite.SetX(900);
  messagemsg.sprite.SetY(80);
  messagemsg.sprite.SetOpacity(1.0);
}
Plymouth.SetMessageFunction(message_callback);

#################
# Boot Progress #
#################

# 
# Boot Progress : Show the time and %age progress
#

bootprogressmsg.sprite = Sprite();

fun boot_progress_callback (time_taken, percentage_progress)
{
    progress.image = Image.Text("Time : " + time_taken + "\nProgress : " + percentage_progress, 1, 1, 1, 1, "droidsansmono", "left");
    bootprogressmsg.sprite.SetImage(progress.image);
    bootprogressmsg.sprite.SetX(1000);
    bootprogressmsg.sprite.SetY(600);
    bootprogressmsg.sprite.SetOpacity(1.0);

    if (Plymouth.GetMode () == "shutdown")
        {
        statusmsg.sprite.SetOpacity(1.0);
        bootprogressmsg.sprite.SetOpacity(1.0);
        }
}
Plymouth.SetBootProgressFunction (boot_progress_callback);

########
# quit #
########

fun quit_callback () {
	statusmsg.sprite.SetOpacity(1.0);
	my_background.sprite.SetOpacity(1.0);
	bootprogressmsg.sprite.SetOpacity(1.0);
	messagemsg.sprite.SetOpacity(1.0);
}

Plymouth.SetQuitFunction(quit_callback);
	
Page hits : 2191