LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 07-15-2005, 04:21 AM   #1
depi
LQ Newbie
 
Registered: Apr 2005
Location: EU - Slovakia
Posts: 12

Rep: Reputation: 0
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!
 
Old 07-15-2005, 04:51 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 65
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

Last edited by david_ross; 07-15-2005 at 04:52 PM.
 
Old 08-13-2007, 06:26 AM   #3
evilDagmar
Member
 
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480

Rep: Reputation: 31
Exclamation

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.

Last edited by evilDagmar; 08-13-2007 at 06:32 AM. Reason: To say something positive
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cp with progress bar? Rotwang Linux - General 5 04-27-2005 08:49 PM
MDK 10.1: bootsplash progress bar not working fulat2k Mandriva 1 11-04-2004 07:18 PM
bootsplash : progress ykcorse Linux - Software 4 04-02-2004 07:01 PM
cp: progress bar chii-chan Linux - General 2 10-30-2003 07:30 PM
Progress Bar zael Programming 3 10-01-2003 01:20 PM


All times are GMT -5. The time now is 07:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration