The way I do it in slackware is create /etc/rc.d/rc.progress with:
Code:
#!/bin/sh
#
# rc.progress This file has a common subroutine used to update a
# bootsplash progress bar
#
# Count the number of times the progress bar is likely to be increased
num=$((`cat /etc/rc.d/rc.* | grep -c "^progressup"`))
function progressup(){
progress=$((`cat /tmp/progressbar`));
progress=$(($progress+1));
echo $progress > /tmp/progressbar
echo "show $(( 65534 * $progress / $num ))" > /proc/splash
}
Then at the top of each rc file you want to increase the bar in add:
# Load the splash function
. /etc/rc.d/rc.progress
At the end of rc.local add:
# Remove the temporary progress bar file
rm -f /tmp/progressbar
After that just add "progressup" to each file where you want the progress bar to increase (make sure it is at the start of a new line each time).
An example diff for rc.S in current is:
Code:
@@ -5,6 +5,9 @@
# Mostly written by: Patrick J. Volkerding, <volkerdi@slackware.com>
#
+# Load the splash stuff
+. /etc/rc.d/rc.progress
+
PATH=/sbin:/usr/sbin:/bin:/usr/bin
# Mount /proc right away:
@@ -41,9 +44,11 @@
/etc/rc.d/rc.udev
fi
fi
+progressup
# Enable swapping:
/sbin/swapon -a
+progressup
# Test to see if the root partition is read-only, like it ought to be.
READWRITE=no
@@ -171,6 +176,7 @@
if [ -d /sys/bus ]; then
/sbin/mount -f sysfs /sys -t sysfs
fi
+progressup
# Set the system time from the hardware clock using hwclock --hctosys.
if [ -x /sbin/hwclock ]; then
@@ -187,6 +193,7 @@
/sbin/hwclock $CLOCK_OPT --localtime --hctosys
fi
fi
+progressup
# Configure ISA Plug-and-Play devices:
if [ -r /etc/isapnp.conf ]; then
@@ -194,12 +201,14 @@
/sbin/isapnp /etc/isapnp.conf
fi
fi
+progressup
# This loads any kernel modules that are needed. These might be required to
# use your ethernet card, sound card, or other optional hardware.
if [ -x /etc/rc.d/rc.modules -a -r /proc/modules ]; then
. /etc/rc.d/rc.modules
fi
+progressup
# Configure runtime kernel parameters:
if [ -x /sbin/sysctl -a -r /etc/sysctl.conf ]; then
@@ -243,6 +252,7 @@
# because TCP/IP is not yet configured, and not proc because
# that has already been mounted):
/sbin/mount -a -v -t nonfs,nosmbfs,noproc
+progressup
# Clean up some temporary files:
( cd /var/log/setup/tmp && rm -rf * )
@@ -270,6 +280,7 @@
touch /var/run/utmp
chown root.utmp /var/run/utmp
chmod 664 /var/run/utmp
+progressup
if [ "$ROOTTYPE" = "umsdos" ]; then # we need to update any files added in DOS:
echo "Synchronizing UMSDOS directory structure:"
@@ -306,4 +317,5 @@
dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 2> /dev/null
fi
chmod 600 /etc/random-seed
+progressup