Okay, in the part 2 of this series, we created a wrapper for the rc.S init script that was responsible for displaying the splash screen and then running rc.S and redirecting the output to a named pipe, which fed that output to a while loop that logged it. Now we just create a wrapper for rc.M, not much different than rc.S-gb. The exception being we send the string 'EOT' to the fifo to exit the while loop, otherwise it will hang. A little quirk I haven't figured out yet.
#!/bin/sh
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# /etc/rc.d/rc.S-gb
# wrapper for rc.S init script - Simple Graphical Boot
#
# YOU ARE FREE TO USE THIS SCRIPT, HOWEVER BY DOING SO, YOU RELEASE THE
# AUTHOR FROM ANY LIABILITY FOR ANY DAMAGES THAT MAY OCCUR AS A RESULT
# OF ITS USE. IT IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, ARE DISCLAIMED.
#
# © 2021 JuanKenobi | Dallas, TX USA
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/boot/initrd-tree/sbin
RC_M=/etc/rc.d/rc.M
MSGFIFO=/boot/GSplash/fbfifo
BOOTLOG=/media/ramdisk/boot.log
IMG=/boot/ready.ppm
SPLASH="/boot/initrd-tree/bin/busybox fbsplash -s $IMG -c -f $MSGFIFO"
# redirect stdout again
exec 6>&1
exec >> $BOOTLOG
# start rc.M init script
( $RC_M ; echo "EOT" ) &> $MSGFIFO &
COUNT=1
while read KMESG; do
if [ "$KMESG" != "EOT" ]; then
echo "$KMESG -- #$COUNT" #>> $BOOTLOG
COUNT=$(( $COUNT + 1 ))
else
break
fi
done <$MSGFIFO
echo "Total rc.M messages -- $COUNT" #>> $BOOTLOG
exec 1>&6 6>&-
# make sure TERM=linux
tset -I linux
# vim: sw=4 sts=4 expandtab:
The last thing we do is create rc.4.local to start the display manager for graphical login. I currently use sddm, although that may change. It doesn't matter which one you use, just make sure you use the right command to start it.
#!/bin/sh
#
# /etc/rc.d/rc.4.local
#
PATH=/sbin:/usr/sbin:/bin:/usr/bin
if [ -x /usr/bin/sddm ]; then
exec /usr/bin/sddm
fi
exec /sbin/agetty --noclear 38400 tty1 linux
exit 0
That's pretty much it. When you reboot your system you should see whatever image you chose for you splash screen instead of the boot messages scrolling down the console. I'm thinking about implementing graphical boot using plymouth, and if I do I'll be documenting the process here. Being the Slacker that I am, that is a big maybe, because I prefer my simple solutions that are easy to debug. I'm always finding new ways to break my machine, and how I recover my system will be posted as well. One last time before I go, make sure you have a way to recover you system before you reboot. If for some reason your machine won't boot, you've been warned. That being said, if you need help leave a comment and will do my best to help you get back running. It's usually not as bad as you would think, you just have to know how to recover a system, which is a lot easier when you know what caused it to break. Until the next time. . .May the Source be with you!