SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2011-01-29 22:54:59

Tunafish
#! Die Hard
From: the Netherlands
Registered: 2010-03-07
Posts: 1,204

Plymouth pulsating crunchbang logo with boot messages and progress bar

I created another plymouth theme for #!

It's the pulsating #! logo Corenominal made, and i added a progress bar and boot messages.
I like the plymouth screen, but i also want to see what's going on during boot (especially when it's taking longer than usual).

You can get the files here: http://dl.dropbox.com/u/19896418/plymou … ler.tar.gz
extract the tar.gz and copy the files to /usr/share/plymouth/theme/statler/

Then you have to edit /lib/lsb/init-functions so it will sent messages to plymouth.
Open the file and add this code after every echo command:

if [ -x /bin/plymouth ]; then
           /bin/plymouth update --status="$@"
        fi

Replace $@ with the message from the echo command.

To get the messages that are sent to usplash in this theme, you can redirect them to plymouth with this small program: https://launchpad.net/plymouth-usplash

Then you have to set the theme for plymouth and update initramfs:

sudo plymouth-set-default-theme statler
sudo update-initramfs -u

Tuna

Last edited by Tunafish (2011-02-02 16:11:52)


sed 's/stress/relaxation/g'
Privacy & Security on #!

Offline

Be excellent to each other!

#2 2011-02-17 05:20:29

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 2,991
Website

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

Hi Tuna, I finally got round to trying this - thank you for your work, it's just the sort of bootscreen I'd like to have. smile

As yet I haven't tried any tweaking, but installed plymouth-usplash instead. First impression:

The messages look very nice: good-looking font, just the right size and location under the #! logo. Unfortunately, I only get one message "Mounting root file system...   OK". A bug with plymouth-usplash? I'll try uninstalling it and editing /lib/lsb/init-functions instead.

The progress bar is a bit big for my taste - for me it came out right across the bottom of the screen, about the same size and shape as the tint2 panel. Personally I'd prefer something slim and elegant like the one in the Crunchbang 9.04 usplash theme. I don't know how difficult that is to change though... Plymouth seems to use its own scripting language. roll Also, the bar only got about 1/3 across the screen before dropping into the pre-gdm black screen with the "busy" cursor.

About  /lib/lsb/init-functions - do you really want us to add that bit of code after every occurence of "echo..." ? That file seems to contain a lot of different functions, for example one to get the pid of a process - do we want random pid numbers added to the boot messages? (The article you link to just calls for the _log_msg function to be edited.) I'm just now having a look round that file, trying to figure out which functions to send the output of to plymouth. Looks quite complicated. Refers to /etc/lsb-base-logging.sh which doesn't exist...

Anyway, this looks like a great idea. (I wish Plymouth was a bit simpler, though.)
Have you seen this stuff?
http://brej.org/blog/?cat=16


John
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

#3 2011-02-17 05:47:51

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 2,991
Website

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

I tried editing /lib/lsb/init-functions, and that looks better than using plymouth-usplash.
Added your code (changed to

[ -x /bin/plymouth ] && /bin/plymouth update --status="$@"

just to keep it on one line), with the various bits substituted for "$@" as necessary, in every function except  pidofproc () and killproc (). That seems to be working nicely. smile

I'm still a little unsure about how to handle the bits that use 'echo -n' or 'echo -e'. Without -n echo outputs a trailing newline by default, but I don't know what plymouth update does. Likewise the -e option for backslash escapes. Anyway it seems OK.

That just leaves the progress bar...

Last edited by johnraff (2011-02-17 05:48:45)


John
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

#4 2011-02-17 09:02:57

Tunafish
#! Die Hard
From: the Netherlands
Registered: 2010-03-07
Posts: 1,204

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

johnraff wrote:

The messages look very nice: good-looking font, just the right size and location under the #! logo. Unfortunately, I only get one message "Mounting root file system...   OK". A bug with plymouth-usplash? I'll try uninstalling it and editing /lib/lsb/init-functions instead.

Not a bug, most messages are sent from /lib/lsb/init-functions. You can use both with my theme, it has two lines of messages (one for status-update, one for text-messages).

johnraff wrote:

Personally I'd prefer something slim and elegant like the one in the Crunchbang 9.04 usplash theme. I don't know how difficult that is to change though... Plymouth seems to use its own scripting language. roll Also, the bar only got about 1/3 across the screen before dropping into the pre-gdm black screen with the "busy" cursor.

It's easy to change the bar. It's an image, which size and position are calculated in the statler.script file.
The progress bar doesn't make sense... it just shows you something is still going on there....

johnraff wrote:

About  /lib/lsb/init-functions - do you really want us to add that bit of code after every occurence of "echo..." ? That file seems to contain a lot of different functions, for example one to get the pid of a process - do we want random pid numbers added to the boot messages? (The article you link to just calls for the _log_msg function to be edited.) I'm just now having a look round that file, trying to figure out which functions to send the output of to plymouth. Looks quite complicated. Refers to /etc/lsb-base-logging.sh which doesn't exist...

I don't know any other way to get these messages to plymouth. If someone does....

johnraff wrote:

Anyway, this looks like a great idea. (I wish Plymouth was a bit simpler, though.)
Have you seen this stuff?
http://brej.org/blog/?cat=16

I've seen that site, but not much about doing scripting with Plymouth. Plymouth isn't that hard if you want to adjust some small things. I'll post the code for the 'elegant' progress bar later.

Tuna


sed 's/stress/relaxation/g'
Privacy & Security on #!

Offline

#5 2011-02-17 13:04:58

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 2,991
Website

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

Tunafish wrote:

I'll post the code for the 'elegant' progress bar later.

Or, maybe, just leave it out. The messages are enough visual feedback really.


John
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

#6 2011-02-17 15:37:28

Tunafish
#! Die Hard
From: the Netherlands
Registered: 2010-03-07
Posts: 1,204

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

johnraff wrote:
Tunafish wrote:

I'll post the code for the 'elegant' progress bar later.

Or, maybe, just leave it out. The messages are enough visual feedback really.

Oh... that's easy... just delete the whole --------------- Progress Bar --------------------- section in the statler.script file. (From line 119-146). And there goes the progress bar.

Tuna


sed 's/stress/relaxation/g'
Privacy & Security on #!

Offline

#7 2011-03-05 22:47:55

tradetaxfree
#! CrunchBanger
Registered: 2011-03-05
Posts: 124

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

If you run several kernels update initramfs with:

sudo update-initramfs -k "all" -u

or only the highest numbered kernel will be updated.

Changing the size of the progress bar can be done with GIMP:

/usr/share/plymouth/themes/statler/progress_bar.png
/usr/share/plymouth/themes/statler/progress_box.png

----> image ----> scale image & click the top chain icon then change the height to your preference

Offline

#8 2011-03-06 13:31:43

Tunafish
#! Die Hard
From: the Netherlands
Registered: 2010-03-07
Posts: 1,204

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

tradetaxfree wrote:

If you run several kernels update initramfs with:

sudo update-initramfs -k "all" -u

or only the highest numbered kernel will be updated.

Changing the size of the progress bar can be done with GIMP:

/usr/share/plymouth/themes/statler/progress_bar.png
/usr/share/plymouth/themes/statler/progress_box.png

----> image ----> scale image & click the top chain icon then change the height to your preference

This works for some plymouth themes.
My plymouth theme makes the image width fit the screen and has a fixed height, so it doesn't matter what the original file size is.


sed 's/stress/relaxation/g'
Privacy & Security on #!

Offline

#9 2011-03-06 13:41:18

ali
#! Die Hard
Registered: 2010-05-31
Posts: 1,035

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

a screenshot would be nice

Offline

#10 2011-03-08 10:30:15

Tunafish
#! Die Hard
From: the Netherlands
Registered: 2010-03-07
Posts: 1,204

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

ali wrote:

a screenshot would be nice

I tried to execute scrot during the boot process, but it didn't work  smile


sed 's/stress/relaxation/g'
Privacy & Security on #!

Offline

#11 2011-03-08 22:37:06

kook
#! CrunchBanger
Registered: 2009-10-25
Posts: 101

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

uuh, anyone has a patch for the init-functions? Its 23:36:43 here..:)

Offline

#12 2011-03-09 05:10:23

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 2,991
Website

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

ali wrote:

a screenshot would be nice

I think you'd need to take a photo - there's no OS at this point.

I've been hacking at that script a bit to make the progress bar smaller and slimmer, under the logo, and also to get the last 5 messages scrolling, as they should be. It works, but there are still things to fix:

*)messages come out split up, like
"doing something...
done"
Where what you want is "doing something... done"
*)red for error messages would be nice
*)haven't yet tried how plymouth-usplash will fit in

I have some ideas for how this might be doable, but I'll post the current hacked script, in case people want to play with it, as soon as I get back on Statler (tonight?).

Somewhat helpful page on Plymouth scripting: http://www.freedesktop.org/wiki/Softwar … th/Scripts


John
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

#13 2011-03-09 05:18:00

ali
#! Die Hard
Registered: 2010-05-31
Posts: 1,035

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

Tunafish wrote:

I tried to execute scrot during the boot process, but it didn't work  smile

johnraff wrote:

I think you'd need to take a photo - there's no OS at this point.

virtual machine anyone?

Last edited by ali (2011-03-09 05:19:05)

Offline

#14 2011-03-09 08:45:25

Tunafish
#! Die Hard
From: the Netherlands
Registered: 2010-03-07
Posts: 1,204

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

johnraff wrote:
ali wrote:

a screenshot would be nice

I think you'd need to take a photo - there's no OS at this point.

Yep, or virtualbox as ali says. A photo will be mainly a picture of me, because of reflection.

johnraff wrote:

*)messages come out split up, like
"doing something...
done"
Where what you want is "doing something... done"
*)red for error messages would be nice
*)haven't yet tried how plymouth-usplash will fit in

I just left out the 'done' parts.
Red error messages would be nice, maybe even on a different line, so they will stay visible all the time.

Tuna


sed 's/stress/relaxation/g'
Privacy & Security on #!

Offline

#15 2011-03-09 17:23:23

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 2,991
Website

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

Hi Tuna, how did you leave out the 'done' bits? By being selective in where you added that extra plymouth code in init-functions?

Anyway, fwiw, I've put my hacked-up version of the statler.script in the pastebin.
Changes:
*) Logo scaled according to screen width. (Phillip, if you're reading this, what screen width was that 40px logo intended to look best on?)
*) Everything else, except text (how?) scaled too.
*) Progress bar much smaller and thinner, under the logo.
*) Five lines of scrolling messages, as promised here, under the progress bar.
*) Anything I couldn't understand the purpose of, I took it out unless it broke something, when I put it back.
*) Worked on the assumption that it was quicker to read a variable than do a GetWidth() every time you needed the width of an image.
*) The progress bar never got more than 1/3 way across, so just multiplied the "progress" by 3. roll

I'm not sure whether it's better to use the plymouth 'update' or 'message' command. Anyway, plymouth-usplash uses 'message' so I added a line to pick up those too and add them to the same scrolling update messages.

To use this, just replace your /usr/share/plymouth/theme/statler/statler.script file with this. (Make a backup first!)

To get the "done." bits at the end of the message lines needs some more study of what string functions exist in this plymouth scripting language, and a good look at what the scripts in  /etc/init.d are doing. I thought a quick fix might be to look for a "done" substring in "text", but haven't yet found out how to test for a pattern in a string... (more googling) When that's fixed, it shouldn't be hard to change the colour if "failed" comes up, or,  better, if the "error" init-function is called. It should all be possible... smile

(I've decided the next language I should try to learn is Javascript, not Python after all.)

Last edited by johnraff (2011-03-10 13:14:16)


John
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

#16 2011-03-09 17:39:20

Tunafish
#! Die Hard
From: the Netherlands
Registered: 2010-03-07
Posts: 1,204

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

johnraff wrote:

Hi Tuna, how did you leave out the 'done' bits? By being selective in where you added that extra plymouth code in init-functions?

Exactly!

johnraff wrote:

Anyway, fwiw, I've put my hacked-up version of the statler.script in the pastebin.

I'll have a look at it tomorrow.


johnraff wrote:

*) Everything else, except text (how?) scaled too.

I didn't find a way to scale text (or change font) in plymouth

johnraff wrote:

*) The progress bar never got more than 1/3 way across, so just multiplied the "progress" by 3. roll

Great solution!  It does get to the end, when my disk is being checked.

johnraff wrote:

To use this, just replace your /usr/share/plymouth/theme/statler/statler.script file with this. (Make a backup first!)

Most people don't have a .../theme/statler/statler.script file. That's the theme i created. The original statler theme by Corenominal is called 'script'.


sed 's/stress/relaxation/g'
Privacy & Security on #!

Offline

#17 2011-03-10 05:42:50

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 2,991
Website

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

Tunafish wrote:
johnraff wrote:

To use this, just replace your /usr/share/plymouth/theme/statler/statler.script file with this. (Make a backup first!)

Most people don't have a .../theme/statler/statler.script file. That's the theme i created. The original statler theme by Corenominal is called 'script'.

This version was intended as a variation on your theme. smile Looking in the folders, though, it would probably work in the 'script' theme too. The main difference in other files seems to be in the progress bar images, which get resized anyway.


John
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

#18 2011-03-10 09:27:22

Tunafish
#! Die Hard
From: the Netherlands
Registered: 2010-03-07
Posts: 1,204

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

@johnraff
Corenominal made the progress bar images transparent, so you don't see them.


sed 's/stress/relaxation/g'
Privacy & Security on #!

Offline

#19 2011-03-10 13:13:40

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 2,991
Website

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

Ah, so they're there anyway! Avoiding extra work was why I carved out what seemed (to me) like unnecessary code from the script. Anyway, my variant was intended to work with your files.

btw An error: I changed what I thought was an unnecessary "i" to "4" in one place. Now restored: http://crunchbanglinux.org/pastebin/975
(There are a lot of "i" variables floating around - maybe this one was global.)


John
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

#20 2011-04-22 18:11:48

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 2,991
Website

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

While I was away from the net I hacked on this some more, and managed to get the '...done'  bits tacked on the end of messages, and colours - yellow for warnings and red for failures.

First, I might say I'm not 100% thrilled with plymouth, in particular the boot messages don't seem to be saved to /var/log/boot.log as they should be. You can press esc to see them, but it's not great. neutral

Anyway, first I messed with /lib/lsb/init-functions. I wanted to get the separate additions to each function as simple as possible, and didn't want to test for the existence of /bin/plymouth every time a function was called, so made a new function to send messages to plymouth which each of those init-functions could use:

# SEND MESSAGES TO PLYMOUTH
if [ -x /bin/plymouth ] && pidof plymouthd >/dev/null
then
    plymouth_send() {
        [ "$1" = '-n' ] && { # add a flag '>' for lines that will be extended
            shift
            /bin/plymouth message --text=">$*" || true
            return
        }
        [ "$1" = '-w' ] && { # add "warning" formatting
            shift
            /bin/plymouth update --status="warning" || true
            /bin/plymouth message --text="$*" || true
            /bin/plymouth update --status="normal" || true
            return
        }
        [ "$1" = '-f' ] && { # add "failed" formatting
            shift
            /bin/plymouth update --status="failed" || true
            /bin/plymouth message --text="$*" || true
            /bin/plymouth update --status="normal" || true
            return
        }
        /bin/plymouth message --text="$*" || true
    }
else
    plymouth_send() { :; }
fi

EDIT: updated 11/04/26
And then modified each function, adding a plymouth_send line, like:

    echo -n "$@"
    plymouth_send -n "$@"

and

    elif [ $1 -eq 255 ]; then
        /bin/echo -e " ${YELLOW}(warning).${NORMAL}"
        plymouth_send -w " (warning)."
    else
        /bin/echo -e " ${RED}failed!${NORMAL}"
        plymouth_send -f " failed!"

So the function plymouth_send behaves almost like echo. My version of init-functions is here:
http://crunchbanglinux.org/pastebin/1022 EDIT: updated 11/04/26

But that begs the question of how to send messages. OK the page Tuna got the original idea from used 'plymouth update' to send messages, while plymouth-usplash uses 'plymouth message' which seemed more appropriate to me,and left update for other purposes. I thought "warning" or "failed" qualified OK for status updates, so used them to get the colour information sent. That left the "newline or not" problem. There might well be a better way, but I stuck a ">" on the beginning of messages which shouldn't be ended with a newline.

The plymouth script then takes the ">" off again, and attaches the next nessage to the end of that one. Some shortening is also done to fit into the 50 (or whatever) character limit, and colour changed if a "status update" has come in. Anyway, here's the end result:
http://crunchbanglinux.org/pastebin/1019

It's working OK for me, except for one or two messages which are still being line-broken unnecessarily, or not broken even if they should be. I don't know what's happening there, but 90% or so looks right.

To try it out: follow Tuna's instructions in the first post, then substitute my /lib/lsb/init-functions for yours, and my statler.script for Tuna's. (Make backups first!)
Run sudo update-initramfs -u again and reboot.
Hope you like it. smile

Last edited by johnraff (2011-04-25 17:16:42)


John
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

#21 2011-04-25 17:13:21

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 2,991
Website

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

Just found a bug. While that init-functions file worked OK at bootup, it broke the scripts in /etc/init.d/ at other times, eg if you did '/etc/init.d/apache2 restart' The reason was if you called plymouth after bootup was finished the daemon wasn't running and returned 1. The apache script has 'set -e', so exits if a command fails. Two possible cures are to add a check if the plymouth daemon is running before setting up the plymouth_send function, or to end each call to plymouth with '|| true' so even if the call fails it returns true. On a belt-and-braces basis I've added both to the previous post and updated the pastebin. roll

This illustrates the danger of messing with a basic system file like init-functions I guess. Plymouth scripts are just froth, but this could stop you booting up if you make a mistake. It would be nice if there was a cleaner way of getting boot messages to plymouth...


John
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

#22 2011-04-26 13:39:48

Tunafish
#! Die Hard
From: the Netherlands
Registered: 2010-03-07
Posts: 1,204

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

@johnraff:
I'm running your plymouth theme now. It works fine, except for a few lines with just a dot.
Can't you solve the problem in post #21, by placing all the plymouth commands in a if... fi statement?

if [ -x /bin/plymouth ]; then
           /bin/plymouth update --status="$@"
        fi

Tuna


sed 's/stress/relaxation/g'
Privacy & Security on #!

Offline

#23 2011-04-26 17:11:01

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 2,991
Website

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

Tunafish wrote:

It works fine, except for a few lines with just a dot.

Yes I'd like to get to the bottom of that. It could be a bug somewhere else. I think I saw some dots like that even in the onscreen messages you get after pressing "Esc". I'll have to have another look.

Can't you solve the problem in post #21, by placing all the plymouth commands in a if... fi statement?

if [ -x /bin/plymouth ]; then
           /bin/plymouth update --status="$@"
        fi

Well, I put that 'if [ -x /bin/plymouth ]...' stuff in the definition of the plymouth_send function I cooked up (in init-functions), so as not to have to do that test over and over again every time a message was sent. The effect should be the same. However, the bug I found in post #21 was slightly different - related to trying to run an init script after bootup is finished. In that case plymouth is still executable, but. because the plymouthd daemon isn't running, an attempt to send a message fails, and, because of the 'set -e' line, the scripts stops too. To fix that I added another test to check if the plymouth daemon is running: 'pidof plymouthd'. That seems to fix the issue, but just to make sure I also put '|| true' after the plymouth calls.


John
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

#24 2011-04-27 08:41:54

Tunafish
#! Die Hard
From: the Netherlands
Registered: 2010-03-07
Posts: 1,204

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

Unfortunately i didn't have error or warnings.. so i didn't have colored messages.
I did see them in a test run though. Nice.

Tuna


sed 's/stress/relaxation/g'
Privacy & Security on #!

Offline

Be excellent to each other!

#25 2011-04-27 16:18:17

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 2,991
Website

Re: Plymouth pulsating crunchbang logo with boot messages and progress bar

I get one red "failed" message when I boot with the liqorix kernel. Something to do with an invalid option or something - it goes too fast to read properly, and there's no logfile I've been able to find. neutral
Doesn't seem to be any problem though.

I definitely get at least one unwanted dot even in the normal onscreen messages after pressing Esc, so it's not 100% my fault! roll
Maybe the plymouth script can be hacked to just ignore lines with only a dot in... It's only entertainment after all - noone's going to be reading this for real information are they?

btw why isn't your avatar a tuna fish any more?

Last edited by johnraff (2011-04-27 16:19:20)


John
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo