Poor man's graphical boot in Slackware revisited...
1 Attachment(s)
This is my first howto so please be kind!
Having read an interesting thread about boot splashes here: http://www.linuxquestions.org/questi...e-13-x-808823/ Which didn't seem to go anywhere I decided to see if I could do it. I've tried splashy etc but have had no success ( possibly becase I'm on a 64 bit system ), so I decided on using only the available tools, the result was this, please see the attached screen shot for an idea of what you are going to end up with. If you like lots of text during boot up and think that eye candy is for wimps then move along there's nothing for you here ;) Most IMPORTANT we will be making some small but important changes to some system scripts, if you get it wrong you may find that your system is unbootable so please make sure that before you start you have an aternate way to boot your system eg a "live" cd or rescue partition and also backup files BEFORE you change them so that you can remove/fix any changes you have made, if you don't do this and you can't boot your system then you will have learned an important lesson! First You need to make sure busybox is installed: Code:
sudo slackpkg install mkinitrd Code:
sudo mkinitrd -c Code:
mkdir initrd Second set up the frame buffer by adding : "vga=791 quiet" to your kernel options in your boot loader, in Grub2 ( which I use ) its the line starting with "linux" in the fisrst menu entry in the file /boot/grub/grub.cfg, I assume lilo is similar but I don't use it so if you do please consult the lilo documentation, update your bootloader as appoporiate. Prepare a splash pic by grabbing a suitable picture eg:: http://www.technama.com/wp-content/u...r-1024x768.jpg You will need to convert this to ppm format GIMP works fine or you can use imagemagic if you prefer as long as the size of the picture matches your frame buffer size ie 1024x768. And save it to ~/startup.ppm Reboot and make sure your frame buffer is set up properly by switching to a vtty ( CTRL-ALT-F6 ) and entering this command: Code:
/boot/initrd-tree/bin/busybox fbsplash -s ~/startup.ppm Third copy and paste the following two scripts into a text editor and save them to /etc/rc.d/rc.S-Wrap and /etc/rc.d/rc.M-Wrap ( you will need to be root for this ) eg: Code:
sudo gedit Code:
sudo chmod +x /etc/rc.d/rc.S-Wrap /etc/rc.d/rc.M-Wrap Code:
#!/bin/sh Code:
#!/bin/sh Code:
sudo cp /etc/inittab /etc/inittab.BAK Code:
sudo gedit /etc/inittab Now find the line:"rc:2345:wait:/etc/rc.d/rc.M" ( in my inittab its line 33 ) and change it to "rc:2345:wait:/etc/rc.d/rc.M-Wrap" and save it Check your changes thoroughly. now prepare the various files we need, you should already have a splash screen prepared from earlier. Make a config file ( details later just copy and paste for now ) Code:
BAR_LEFT=312 Now run the following commands Code:
sudo mkdir /boot/GSplash What does what: The fb.config file is reasonably self explanatory, the first 4 lines set the size and shape of the progress bar and the last 3 lines set the background colour of the bar, there seems to be no way to change the foreground colours of the bar oh well! The two "wrapper" scripts just capture the output of the real startup scripts and format them nicely to display at the bottom of the screen. The two pipes are used to control the status bar ( /boot/GSplash/fbfifo ) and and pipe the output from the startup scripts to the wrapper scripts ( /boot/GSplash/fifo ), "why not just use the '|' to pipe the output to the wrappers" I hear you cry, simple I need to get some variables from inside the while loops to the main script, as the '|' command starts a subshell the parent script can't read the variables from the child proccess, creating a pipe gets around this problem. When you first boot with this in place the scripts can not know how many startup items you have and so can't accurately set the progress bar so they count the number of lines echoed to the bottom of the screen ready for the next rebbot, if your startup changes the number of echoes to the wrappers the progress bar counts will be updated ready for the next boot but this should only happen when you add or remove a startup item/serveice. There is also a log file created in /tmp/S_LOG in case you want to examine the details of the boot up, if you don't want a log just comment out the appropriate lines in rc.S-Wrap and rc.M-Wrap. What you can customize: The splash pic, just create a new one at /boot/GSplash/startup.ppm making sure that the size and type is set correctly. The size, shape and background colour of the progress bar as defined in /boot/GSplash/fb.config The text colour can be changed at line 33 of /etc/rc.d/rc.S-Wrap, see the setterm man page for details. I hope some people find this useful, any problems, additions or if I've forgotton somthing please post. |
I was wondering if anyone was gonna put up a how to on this. I'm too lazy to figure it all out, sorry, but I will definitely be trying this how to out. Will have some feedback.
|
Looks like we need another LQ wiki page.
Slackware-Guides-Graphical_Boot Well that was a lot of information to try and summarize. Not sure it was even summarized... Either way, at least the wiki tags better define the steps needed and blocks everything up. |
i will definitely try this out soon.
|
Quote:
I've made one slight change to the rc.M-Wrap script I.ve moved the log line to the top of the loop that way the whole of the data sent by rc.M is saved to the log instead of the trimmed data that is printed at the bottom of the screen makes more sense that way. If any one would like to post their start up screens you can add the line Code:
/usr/bin/fbdump > /tmp/startup.ppm fbdump can be found here: http://www.rcdrummond.net/fbdump/fbdump-0.4.2.tar.gz There is also a slackbuild pending at SlackBuilds.org remember to convert it to a jpeg first! |
NP, I did it mainly to force my self to read it. Either way, I recommended the "echo EOFEOF" be moved to the end of the original rc.M script. From the point of view of a proper setup, it makes more sense that it goes there instead of in the rc.local which is supposed to be more dynamic than the rc.M. As for tracking the 'end' of the start up scripts, you may also be able to find the PID of the script it self and track when it ends by checking for it.
|
Very nice, what I like about this scheme is that it uses stock Slackware components! I've just found out that busybox is able to paint on the framebuffer! Wonderful. I will definitely be trying this stuff soon.
Thank you very much for the howto and the supplied scripts! Cheers, V'yacheslav. |
Re the echo "EOFEOF" added to the end of rc.local or rc.M. I didn't like either way of doing this as rc.M is a system script and could be changed by an update without warning also as lumak pointed out rc.local is dynamic so I came up with a much better way of signaling the end of the rc.M script, simply change line 32 in the rc.M-Wrap script from ""$STARTUP" 2&> /boot/GSplash/fifo &" to "( "$STARTUP";echo "EOFEOF" ) &> /boot/GSplash/fifo &" that way you don't have to modify rc.M or rc.local.
The script above has been edited to reflect this change, lumak do you want to update the wiki or shall I? I love that in Linux there's always a number of different ways to do do something! |
I liked seeing different start slackware!
Thank you very much :-) |
Well thanks everyone for the positive comments I have now added a wrapper script for a graphical shutdown/reboot like so:
Obviously you must be root to change any system files. Back up your inittab and make sure you have a live cd handy in case anything goes wrong! First copy this script: Code:
#!/bin/sh Code:
chmod +x /etc/rc.d/rc.6-Wrap l0:0:wait:/etc/rc.d/rc.0 -> l0:0:wait:/etc/rc.d/rc.0-Wrap l6:6:wait:/etc/rc.d/rc.6 -> l6:6:wait:/etc/rc.d/rc.6-Wrap Link rc.0-Wrap to rc.6-Wrap Code:
ln -sf /etc/rc.d/rc.6-Wrap /etc/rc.d/rc.0-Wrap Enjoy! |
The nice thing about the wiki page is that any registered user can change it and a history of all the changes is logged and can be un done.
As for the scripts, being that they take up so much of the bulk of the display, I wonder if there is a better way to handle them on the wiki... If not just creating a new wiki page link that redirects to each script individually... perhaps asking the LQ moderators would clear this up. Then again, you can always link to an anchor point on the page and the scripts could be moved to the bottom. |
Quote:
Installed fbdump ! part of my /etc/rc.d/rc.M-Wrap, "which I suppose must be the line ... Quote:
The startup.ppm generated in / tmp does not open, and has 0 KB in size Thanks :-) |
afreitascs what happens if you use fbdump from a virtual terminal does it create a picture?
This is from the readme file included with fbdump: Usage ----- fbdump currently supports the following arguments: -fb <string> Specifies the framebuffer device to grab from is <string> -vt <num> Bring virtual terminal number <num> to the foreground before grabbing (and return to the current terminal afterwards). -delay <num> Delay <num> seconds after switching, but before grabbing. If the -fb option is not provided, fbdump defaults to grabbing from the device /dev/fb0. You can also specify the framebuffer via the environment variable FRAMEBUFFER (a value supplied with -fb switch on the command line will override this). For example: FRAMEBUFFER=/dev/fb1 fbdump >out.ppm Try setting the framebuffer device explicitly. Also try adding 2>/tmp/fbdump.log to the end of the fbdump command and see what the error is. |
Quote:
fbdump is executable in /usr/local/bin and not/usr/bin ....in my case Here is my startup ...(in jpeg due to the server hosting the image) http://yfrog.com/n5startupj Please ask another question: Because the cursor disappears at the end of the boot (init 3)? If I leave the X, the cursor still missing ... Thanks very much :-) |
Quote:
Code:
setterm -msg off -cursor off -foreground red Code:
setterm -default Code:
setterm -cursor on |
All times are GMT -5. The time now is 08:47 AM. |