Debian This forum is for the discussion of Debian Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
06-07-2006, 11:01 PM
|
#1
|
LQ Newbie
Registered: Nov 2005
Posts: 21
Rep:
|
[solved] getting bootsplash progress bar working with recent sysv-rc scripts (2.86+)
I'm posting this as a guide to my progress along finding a way to get bootsplash to work with sysv-rc (version on my computer is 2.86.ds1-14.1). Hopefully it can be of some use to others wanting to do a similar thing.
From the looks of things, sysv-rc was changed to shift a lot of the functionality from /etc/init.d/rcS to /etc/init.d/rc. The bootsplash sysv-rc patches from http://debian.bootsplash.de/ seem to have a lot more in /etc/init.d/rcS, which causes all the hunks to fail.
I have noticed that /etc/init.d/rc appears to have some support for usplash (the ubuntu userspace splash screen package), and suspect that modifying this slightly for bootsplash should be fairly straightforward. Here's the usplash related stuff in that file:
Code:
# Count the number of scripts we need to run (for usplash progress bar)
num_steps=0
for s in /etc/rc$runlevel.d/S*; do
num_steps=$(($num_steps + 1))
case "${s##/etc/rc$runlevel.d/S??}" in
gdm|xdm|kdm)
break
;;
esac
done
...
# Use 50% of the progress bar for rcS and the rest for the
# runlevel we want to end up in
step=$(($step + $step_change))
progress=$(($step * $progress_size / $num_steps + $first_step))
if type usplash_write >/dev/null 2>&1; then
usplash_write "PROGRESS $progress" || true
fi
And here's the rc_splash related lines from http://www.bootsplash.org:
Code:
function rc_splash()
{
test "$SPLASH" != "no" && test "$_rc_splash" -eq 1 && /sbin/splash "$1"
progress=$(( $progress + 1 ))
}
when adding the rc_splash call to your runlevel script scheduler, do it
about like this:
for i in $runrc/S${rex}*; do
[..]
# send information to bootsplash handler.
rc_splash "$i start"
[..]
done
I'll post a few more times to indicate my progress towards trying to find a way to integrate bootsplash with these scripts.
Last edited by gringer; 06-10-2006 at 11:34 AM.
|
|
|
06-08-2006, 05:40 AM
|
#2
|
LQ Newbie
Registered: Nov 2005
Posts: 21
Original Poster
Rep:
|
manually applying sysv-rc-bootsplash scripts
This is the diff file that results from a somewhat naive attempt at patching /etc/init.d/rc with the patch file from /usr/share/sysv-rc-bootsplash/rc-bootsplash.patch (i.e. the patch that failed on the attempted install of the package):
Code:
--- rc.old 2006-06-07 22:35:03.000000000 +1200
+++ rc 2006-06-08 21:23:22.000000000 +1200
@@ -140,6 +140,8 @@
# Set onlcr to avoid staircase effect.
stty onlcr 0>&1
+rc_splash "splash start" # let bootsplash know we are ready
+
# Now find out what the current and what the previous runlevel are.
runlevel=$RUNLEVEL
@@ -170,6 +172,51 @@
. /etc/default/rcS
export VERBOSE
+# -- start bootsplash stuff --
+
+# source the bootsplash config file
+test -f /etc/default/bootsplash && . /etc/default/bootsplash
+
+#
+# initialize boosplash progressbar variables
+#
+runrcS=/etc/rcS.d
+runrc=/etc/rc2.d # assume we will boot into runlevel 2
+
+SSC=($(echo $runrcS/S*))
+case "$SSC" in
+ *\*) sscripts=0 ;;
+ *) sscripts=${#SSC[*]} ;;
+esac
+
+SSC=($(echo $runrc/S*))
+case "$SSC" in
+ *\*) sscripts=0 ;;
+ *) sscripts=$((${#SSC[*]} + $sscripts)) ;;
+esac
+
+progress=0
+kscripts=0
+
+export sscripts kscropts progress
+
+#
+# Update bootsplash stuff. (progress bar, animations...)
+#
+rc_splash() {
+ #test "$SPLASH" != "no" && test "$_rc_splash" -eq 1 && /sbin/splash "$1"
+ test "$SPLASH" != "no" && /sbin/splash.sh "$1"
+
+ # make sure we don't add unless we really made progress
+ if [ "$1" != "master" -a "$1" != "splash start" -a "$1" != "shutdown" ]
+ then
+ progress=$(( $progress + 1 ))
+ fi
+}
+
+# -- end bootsplash stuff --
+
+
# Is there an rc directory for this new runlevel?
if [ -d /etc/rc$runlevel.d ]
then
@@ -261,6 +308,8 @@
for i in /etc/rc$runlevel.d/S$level*
do
[ ! -f $i ] && continue
+
+ rc_splash "$i start" # update bootsplash progress bar
if [ "$previous" != N ]
then
@@ -307,6 +356,7 @@
then
/sbin/setup.sh
fi
+ rc_splash "master" # stop playing bootsplash animations
fi
trap - EXIT # Disable emergency handler
It does update the progress bar, but seems to reset the progress bar after the start of each new runlevel. This is probably related to the reset being placed early in the file.
|
|
|
06-08-2006, 10:15 AM
|
#3
|
LQ Newbie
Registered: Nov 2005
Posts: 21
Original Poster
Rep:
|
smaller diff, uses usplash variables
Okay, here's another diff. This time I've tried to think through what the usplash lines mean, and make bootsplash work with those:
Code:
--- rc.old 2006-06-07 22:35:03.000000000 +1200
+++ rc 2006-06-09 02:09:31.000000000 +1200
@@ -140,6 +140,15 @@
# Set onlcr to avoid staircase effect.
stty onlcr 0>&1
+# source the bootsplash config file
+test -f /etc/default/bootsplash && . /etc/default/bootsplash
+rc_splash "splash start" # let bootsplash know we are ready
+
+# Update bootsplash stuff. (progress bar, animations...)
+rc_splash() {
+ test "$SPLASH" != "no" && /sbin/splash.sh "$1"
+}
+
# Now find out what the current and what the previous runlevel are.
runlevel=$RUNLEVEL
@@ -245,6 +254,12 @@
esac
done
+ # initialize boosplash progressbar variables
+ progress=0
+ kscripts=0
+ sscripts=$progress_size
+ export sscripts kscripts progress
+
# Now run the START scripts for this runlevel.
# Run all scripts with the same level in parallel
CURLEVEL=""
@@ -289,6 +304,7 @@
if type usplash_write >/dev/null 2>&1; then
usplash_write "PROGRESS $progress" || true
fi
+ rc_splash "$i start" # update bootsplash progress bar
done
fi
@@ -307,6 +323,7 @@
then
/sbin/setup.sh
fi
+ rc_splash "master" # stop playing bootsplash animations
fi
trap - EXIT # Disable emergency handler
I'm still gettting the progress bar resetting itself halfway through, and I'm not sure if I'm right in assuming $sscripts in bootsplash should be the same as $progress_size when using the usplash progress variables.
|
|
|
06-09-2006, 09:23 AM
|
#4
|
LQ Newbie
Registered: Nov 2005
Posts: 21
Original Poster
Rep:
|
properly working progress bar, startup and shutdown
I had a look at the progress bar for ubuntu 6.06 LTS, and noticed that it seemed to progress on startup and shutdown correctly, so had a look at those scripts to see if anything could be done. The following diff is the result of that:
Code:
--- rc.old 2006-06-07 22:35:03.000000000 +1200
+++ rc 2006-06-10 01:10:45.000000000 +1200
@@ -28,6 +28,20 @@
umask 022
+# Update bootsplash stuff. (progress bar, animations...)
+rc_splash() {
+ test "$SPLASH" != "no" && /sbin/splash.sh "$1"
+}
+
+update_splash() {
+ step=$(($step + $step_change))
+ progress=$(($step * $progress_size / $num_steps + $first_step))
+ if type usplash_write >/dev/null 2>&1; then
+ usplash_write "PROGRESS $progress" || true
+ fi
+ rc_splash "$i start" # update bootsplash progress bar
+}
+
#
# Start script or program.
#
@@ -58,6 +72,7 @@
$debug "$script" $action
;;
esac
+ update_splash
done
}
;;
@@ -89,6 +104,7 @@
backgrounded=1
;;
esac
+ update_splash
done
[ 1 = "$backgrounded" ] && wait
}
@@ -140,6 +156,10 @@
# Set onlcr to avoid staircase effect.
stty onlcr 0>&1
+# source the bootsplash config file
+test -f /etc/default/bootsplash && . /etc/default/bootsplash
+rc_splash "splash start" # let bootsplash know we are ready
+
# Now find out what the current and what the previous runlevel are.
runlevel=$RUNLEVEL
@@ -173,6 +193,56 @@
# Is there an rc directory for this new runlevel?
if [ -d /etc/rc$runlevel.d ]
then
+ # Find out where in the progress bar the initramfs got to.
+ PROGRESS_STATE=0
+ if [ -f /dev/.initramfs/progress_state ]; then
+ . /dev/.initramfs/progress_state
+ fi
+
+ # Split the remaining portion of the progress bar into thirds
+ progress_size=$(((100 - $PROGRESS_STATE) / 3))
+
+
+ case "$runlevel" in
+ 0|6)
+ ACTION=stop
+ # count down from 100 and use the whole bar
+ first_step=100
+ progress_size=100
+ step_change=-1
+ ;;
+ S)
+ ACTION=start
+ first_step=$PROGRESS_STATE
+ progress_size=$(($progress_size * 2))
+ step_change=1
+ ;;
+ *)
+ ACTION=start
+ first_step=$(($progress_size * 2 + $PROGRESS_STATE))
+ step_change=1
+ ;;
+ esac
+
+ # Count the number of scripts we need to run (for usplash progress bar)
+ num_steps=0
+ for s in /etc/rc$runlevel.d/[SK]*; do
+ case "${s##/etc/rc$runlevel.d/S??}" in
+ gdm|xdm|kdm|reboot|halt)
+ break
+ ;;
+ esac
+ num_steps=$(($num_steps + 1))
+ done
+ step=0
+
+ # initialize boosplash progressbar variables
+ progress=0
+ kscripts=100
+ sscripts=100
+ export sscripts kscripts progress
+
# First, run the KILL scripts.
if [ "$previous" != N ]
then
@@ -213,38 +283,6 @@
done
fi
- case "$runlevel" in
- 0|6)
- ACTION=stop
- first_step=100
- progress_size=100
- step_change=-1
- ;;
- S)
- ACTION=start
- first_step=0
- progress_size=100
- step_change=1
- ;;
- *)
- ACTION=start
- first_step=0
- progress_size=100
- step_change=1
- ;;
- esac
-
- # Count the number of scripts we need to run (for usplash progress bar)
- num_steps=0
- for s in /etc/rc$runlevel.d/S*; do
- num_steps=$(($num_steps + 1))
- case "${s##/etc/rc$runlevel.d/S??}" in
- gdm|xdm|kdm)
- break
- ;;
- esac
- done
-
# Now run the START scripts for this runlevel.
# Run all scripts with the same level in parallel
CURLEVEL=""
@@ -282,13 +320,6 @@
done
startup $ACTION $SCRIPTS
- # Use 50% of the progress bar for rcS and the rest for the
- # runlevel we want to end up in
- step=$(($step + $step_change))
- progress=$(($step * $progress_size / $num_steps + $first_step))
- if type usplash_write >/dev/null 2>&1; then
- usplash_write "PROGRESS $progress" || true
- fi
done
fi
@@ -307,6 +338,7 @@
then
/sbin/setup.sh
fi
+ rc_splash "master" # stop playing bootsplash animations
fi
trap - EXIT # Disable emergency handler
The progress bar now moves correctly at startup from start to finish without resetting, getting to the end just before booting into X. In addition, it moves from finish back to start on shutdown, although there's a few delays at the start and end of the progress movement (I suspect these are not all that related to this rc script). This should be all the patching required for /etc/init.d/rc to get the progress bar showing progress correctly. When I looked at the dapper ubuntu scripts, I noticed that there also seemed to be functionality for the initramfs stuff (it checks /dev/.initramfs/progress_state), so I'll explore that next.
Edit: fixed progress delay problems at shutdown
Last edited by gringer; 06-10-2006 at 11:32 AM.
|
|
|
06-11-2006, 12:34 AM
|
#5
|
LQ Newbie
Registered: Nov 2005
Posts: 21
Original Poster
Rep:
|
initramfs-tools patches -- /usr/share/initramfs-tools/scripts/functions
This patch should complete the splash progress. It puts another bit into the initramfs functions to update the progress bar while the ramdisk is going through its paces.
Code:
--- initramfs-tools.old/scripts/functions 2006-06-10 02:01:49.000000000 +1200
+++ initramfs-tools/scripts/functions 2006-06-11 16:25:25.000000000 +1200
@@ -52,6 +52,9 @@
if [ -x /sbin/usplash_write ]; then
/sbin/usplash_write "PROGRESS $PROGRESS_STATE"
fi
+ if [ -w /proc/splash ]; then
+ echo "show $(( $PROGRESS_STATE * 65534 / 100 ))" > /proc/splash
+ fi
}
panic()
So, hopefully, there you have it. Patches to two files that enable and update the bootsplash progress bar with recent sysv-rc scripts. This assumes (at a minimum -- there are other requirements) that you have included a repository similar to 'deb http://debian.bootsplash.de/ unstable main' in /etc/apt/sources.list, and have /sbin/splash.sh, /usr/sbin/splash and /usr/share/initramfs-tools/hooks/bootsplash.
Enjoy!
Last edited by gringer; 06-11-2006 at 12:36 AM.
|
|
|
06-11-2006, 03:45 AM
|
#6
|
Member
Registered: Nov 2003
Location: Zwolle
Distribution: Arch
Posts: 651
Rep:
|
Hmm, using splashy keeps you from having to patch the kernel, it just runs in user space.
|
|
|
10-19-2006, 07:43 PM
|
#7
|
LQ Newbie
Registered: Nov 2005
Posts: 21
Original Poster
Rep:
|
And it appears that the more recent unstable Debian builds (as of about October 2006) seem to support an updating splash screen "out of the box" (whatever that means for Debian...).
|
|
|
10-19-2006, 09:12 PM
|
#8
|
Member
Registered: Dec 2004
Location: San Antonio, TX
Distribution: Debian-AMD64 Sid
Posts: 481
Rep:
|
Gringer, you should submit your patch to the bug report for that package.
A lot of users (myself include) would really benefit from this.
|
|
|
04-28-2007, 01:07 AM
|
#10
|
Member
Registered: Nov 2005
Distribution: Ubuntu 9.10 and Slackware 13.1
Posts: 78
Rep:
|
Hey... I've been trying to get bootsplash working on Feisty... Will this patch still work, or does it need to be modified?
|
|
|
04-28-2007, 05:10 AM
|
#11
|
LQ Newbie
Registered: Nov 2005
Posts: 21
Original Poster
Rep:
|
The patch is for a Debian system (sid/etch), and the changes that I made were pulled from Ubuntu (dapper), which seemed to work fine for me anyway. If you're trying to do this on Feisty and it doesn't already work, it's very likely that it will need to be modified.
|
|
|
All times are GMT -5. The time now is 08:53 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|