LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Bootsplash - progress bar - not working (https://www.linuxquestions.org/questions/linux-general-1/bootsplash-progress-bar-not-working-343363/)

depi 07-15-2005 03:21 AM

Bootsplash - progress bar - not working
 
Hi all!

I was yesterday playing with the bootsplash, but I have some problems. I write there what I have done:
1) I have patched, compiled and installed the new kernel (2.6.12.2)
2) I downloaded and installed bootsplash-3.0.7.tgz (I use Slackware-current)
3) I have created th folders /etc/bootsplash/themes... and copy there the themes
4) And I created a initrd.splash in /boot
5) then start lilo and the bootsplash work after restart, but when I use silent mode the progress bar dont work.
I know that I must do something with rc_splash() script or so, but the info on bootsplash.org is not fully. there is a file /etc/init.d/rc - but I dont know wich file is it in Slackware.

Can me please somebody help? And write there a easily installation, I know that Im near of my goal :)

Thanks!

david_ross 07-15-2005 03:51 PM

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


evilDagmar 08-13-2007 05:26 AM

This just caught my attention due to someone on IRC referencing it.

I feel obliged to mention that perhaps writing to /tmp like this is fundamentally unsafe on a multi-user machine. Should you ever happen to clear /tmp after booting, one of your users can do something as simple as:

ln -s /etc/shadow /tmp/progressbar

...and really ruin your day. Your next boot-up will not go as planned.

I suggest you use /boot/progressbar, or /root/.progressbar instead. /var/run/progressbar would also be good, but might react oddly if /var is it's own filesystem.

Other than that, the progressup() function is pretty slick.


All times are GMT -5. The time now is 07:57 PM.