diff -rNu fbsplash.34/fbsplash-basic.sh fbsplash.35/fbsplash-basic.sh --- fbsplash.34/fbsplash-basic.sh 1970-01-01 10:13:08.000000000 +0100 +++ fbsplash.35/fbsplash-basic.sh 2011-03-04 12:05:18.000000000 +0100 @@ -12,18 +12,20 @@ [[ $PREVLEVEL && $RUNLEVEL ]] || return 0 -# Do nothing if improved scripts are installed -[ -r /etc/rc.d/functions.d/fbsplash-extras.sh ] && return +# Do nothing if advanced script is installed +[[ -r /etc/rc.d/functions.d/fbsplash-extras.sh ]] && return # Only do this where needed # Since we use BASH, all important functions and variables are exported case ${0#/etc/rc.} in sysinit | multi | shutdown ) - export SPLASH_PUSH_MESSAGES="no" - export SPLASH_VERBOSE_ON_ERRORS="no" + # splash-functions.sh will run splash_setup which needs /proc + # code line copied from /etc/rc.sysinit + /bin/mountpoint -q /proc || /bin/mount -n -t proc proc /proc -o nosuid,noexec,nodev + export SPLASH_PUSH_MESSAGES SPLASH_VERBOSE_ON_ERRORS . /sbin/splash-functions.sh # /etc/conf.d/splash is also sourced by this unset options opt i # eliminate splash_setup non local vars ## FIX ME ## - declare -ix SPLASH_STEPS=3 # sysinit steps - declare -ix SPLASH_STEPS_DONE=0 + SPLASH_STEPS=3 # sysinit steps + SPLASH_STEPS_DONE=0 esac # Verbose mode is handled by fbcondecor kernel patch and daemon script @@ -59,7 +61,7 @@ splash_progress } splash_sysinit_postfsck() { # fsck failure emergency exit - [ ${fsckret} -gt 1 -a ${fsckret} -ne 32 ] && chvt 1 + (( fsckret > 1 && fsckret != 32 )) && chvt 1 } splash_sysinit_end() { splash_progress @@ -131,7 +133,7 @@ case $daemon in $SPLASH_XSERVICE | @$SPLASH_XSERVICE ) break ;; \!* |@* ) continue esac - SPLASH_STEPS+=1 + (( SPLASH_STEPS++ )) done } @@ -141,7 +143,6 @@ } # Start the splash daemon - using upstream function -splash_set_event_dev() { :; } # override - Never grab the keyboard splash_begin() { if ! [[ $( /bin/pidof -o %PPID $spl_daemon ) ]]; then stat_busy "Starting Fbsplash daemon" diff -rNu fbsplash.34/fbsplash.initcpio_hook fbsplash.35/fbsplash.initcpio_hook --- fbsplash.34/fbsplash.initcpio_hook 1970-01-01 10:13:08.000000000 +0100 +++ fbsplash.35/fbsplash.initcpio_hook 2011-03-04 10:56:15.000000000 +0100 @@ -1,99 +1,49 @@ run_hook () { - SPLASH_INIT_MESSAGE="Initializing the kernel" - SPLASH_MODE_REQ="off" - SPLASH_THEME="default" - SPLASH_TTY=16 - SPLASH_TEXTBOX="no" - SPLASH_AUTOVERBOSE=0 - - . /etc/conf.d/splash - - # Kernel parameters override config file - local ifs="$IFS" - IFS=',' - set -- $splash - IFS="$ifs" - local arg effects - for arg in "$@"; do - case "$arg" - in off ) SPLASH_MODE_REQ="off" - ;; silent ) SPLASH_MODE_REQ="silent" - ;; verbose ) SPLASH_MODE_REQ="verbose" - ;; theme:?* ) SPLASH_THEME="${arg#theme:}" - ;; tty:?* ) SPLASH_TTY="${arg#tty:}" - ;; insane ) SPLASH_SANITY="insane" - ;; fadein | fadeout ) effects="$effects,$arg" - esac - done - if [ -n "$effects" ]; then - SPLASH_EFFECTS="${effects#,}" - fi - - if [ "${SPLASH_MODE_REQ}" != "silent" ]; then - return - fi - - if ! [ "$console" = tty1 -o "$SPLASH_SANITY" = insane ]; then - err "Fbsplash requires console=tty1 in kernel line!" - return 1 - fi - - # Start the daemon here if possible - # to show animations early and gain some bootup speed - if [ -x /sbin/fbsplashd.static ]; then - if [ -x /etc/splash/"$SPLASH_THEME"/scripts/rc_init-pre ]; then - msg "Found '/etc/splash/$SPLASH_THEME/scripts/rc_init-pre'" - msg "Not starting Fbsplash daemon - no theme hook support in initcpio." - else + # avoid exporting configuration + ( + SPLASH_INIT_MESSAGE="Initializing the kernel" + # Get configuration and functions (faking sysinit for config file hacks) + PREVLEVEL=N; RUNLEVEL=S + . /sbin/splash-functions.sh + unset PREVLEVEL RUNLEVEL + + [ "${SPLASH_MODE_REQ}" = "silent" ] || exit 0 + + # Start the daemon here if possible + # to show animations early and gain some bootup speed + if [ -x /sbin/fbsplashd.static ]; then msg "Starting Fbsplash Daemon" - ( - set -e - # Hold the cache and fifo within /dev to get it moved to the new root - mkdir /dev/.splash-cache - # code line derived from splash-functions.sh - mount -t tmpfs cachedir /dev/.splash-cache -o rw,mode=0644,size=4096k - # Take over any existing cache content - mkdir -p /lib/splash/cache - mv /lib/splash/cache /lib/splash/.splash-cache - cp -a /lib/splash/.splash-cache /dev/ - ln -s /dev/.splash-cache /lib/splash/cache - mkfifo -m 600 /lib/splash/cache/.splash - # Wait for any fbcondecor fadein - may take very long on some broken systems - i=0 - while [ -n "$( pidof fbcondecor_helper )" ]; do - if [ $i -ge 50 ]; then - err "timeout on waiting for fbcondecor_helper to die!" - exit 1 - fi - sleep .1 - i=$(( i + 1 )) - done - # Actually start the daemon - options="" - [ -n "$SPLASH_THEME" ] && options="$options --theme=$SPLASH_THEME" - [ -n "$SPLASH_EFFECTS" ] && options="$options --effects=$SPLASH_EFFECTS" - [ "$SPLASH_TEXTBOX" = yes ] && options="$options --textbox" - cd /dev/.splash-cache - BOOT_MSG="${SPLASH_INIT_MESSAGE}" \ - /sbin/fbsplashd.static --type=bootup --pidfile=daemon.pid $options - ( - echo set tty silent $SPLASH_TTY - echo set mode silent - echo repaint - echo set autoverbose $SPLASH_AUTOVERBOSE - ) >/lib/splash/cache/.splash & - ) - return + set -e + # Mount the cache within /dev to get it moved to the new root + mkdir /dev/.splash-cache + ( spl_cachedir=/dev/.splash-cache; splash_cache_prep ) + # Take over any existing cache content + mkdir -p $spl_cachedir + parent=$( dirname $spl_cachedir ) + mv $spl_cachedir $parent/.splash-cache + cp -a $parent/.splash-cache /dev/ + # Symlink for starting the daemon + ln -s /dev/.splash-cache $spl_cachedir + # Wait for any fbcondecor fadein - may take very long on some broken systems + i=0 + while [ -n "$( pidof fbcondecor_helper )" ]; do + if [ $i -ge 50 ]; then + err "timeout on waiting for fbcondecor_helper to die!" + exit 1 + fi + sleep .1 + i=$(( i + 1 )) + done + # Actually start the daemon + cd /dev/.splash-cache + set +e + SPLASH_BOOT_MESSAGE="${SPLASH_INIT_MESSAGE}" + splash_start && sleep .1 # allow the daemon to open the event dev + exit fi - fi - # Start the fbcondecor helper if not already done by fbcondecor kernel - ( - # code copied from splash-functions.sh - fbcondecor_supported() { - [ -e /dev/fbsplash -o -e /dev/fbcondecor ] - } + # Start the fbcondecor helper if not already done by fbcondecor kernel if ! fbcondecor_supported; then BOOT_MSG="${SPLASH_INIT_MESSAGE}" \ /sbin/fbcondecor_helper 2 init 0 0 $SPLASH_THEME diff -rNu fbsplash.34/fbsplash.initcpio_install fbsplash.35/fbsplash.initcpio_install --- fbsplash.34/fbsplash.initcpio_install 1970-01-01 10:13:08.000000000 +0100 +++ fbsplash.35/fbsplash.initcpio_install 2011-03-07 08:57:08.000000000 +0100 @@ -1,104 +1,95 @@ install() { - ( - . /etc/conf.d/splash - - if /bin/mountpoint -q /lib/splash/cache; then - /bin/umount /lib/splash/cache - fi - - # Add the helper - add_binary /sbin/fbcondecor_helper - - # Add the daemon for early start - if [[ $SPLASH_DAEMON = early ]]; then - add_binary /sbin/fbsplashd.static + # Add config file, splash-functions and the helper + add_file /etc/conf.d/splash + add_file /sbin/splash-functions.sh + add_binary /sbin/fbcondecor_helper + + # Get in configuration, parameters and functions + . /etc/conf.d/splash + . /sbin/splash-functions.sh + + # Unmount any stale cache tmpfs + splash_cache_cleanup + + SPLASH_PROFILE=off + + if [[ $SPLASH_DAEMON = early ]]; then + # Add stuff needed to run splash_start function (except optional evdev module) + add_dir $spl_tmpdir + add_binary $spl_daemon + if [[ -e /etc/rc.d/functions.d/fbsplash-extras.sh ]]; then + . /etc/rc.d/functions.d/fbsplash-extras.sh + # Add files from a prepared cache (faking sysinit) + splash_cache_prep_initcpio && add_full_dir $spl_cachedir fi + fi - # Add a clean config file avoiding errors when running the hook - file=$( /usr/bin/mktemp ) - for var in SPLASH_INIT_MESSAGE SPLASH_MODE_REQ SPLASH_THEME SPLASH_TTY \ - SPLASH_AUTOVERBOSE SPLASH_EFFECTS SPLASH_TEXTBOX - do - eval value=\"\$$var\" - [ -n "$value" ] && echo $var="'$value'" - done >|$file - add_file $file /etc/conf.d/splash - - # List file paths contained in given Fbsplash theme cfg file - _get_cfg_files() { - < "$1" /bin/sed -re ' - # convert all whitespace into single blanks - s,[[:space:]]+, ,g ; t L1 - :L1 - # drop comments, grouping directives and blank lines - /^ *([#<]|$)/ d - # get a filepath or drop - s,.*[ =]([^ ]*/[^ ]+).*,\1, ; t ; d - ' | /usr/bin/sort -u - } - - # Check if cfg file name or path - _match_cfg() { - [[ "$1" =~ (^|/)[0-9]+x[0-9]+\.cfg$ ]] - } - - # Add non-cfg files in given dir - _add_non_cfg_files() { - local file dir="$1" - for file in $( /bin/ls "$dir" ); do - if [ -f "$dir/$file" ]; then - _match_cfg "$file" || add_file "$dir/$file" - fi - done - } - - # Add global non-cfg files - _add_non_cfg_files /etc/splash - - # Add themes - dirs="" - for theme in ${SPLASH_THEMES[*]}; do # string list and array allowed - [ ${theme:0:1} = / ] || theme=/etc/splash/$theme - if [ -f $theme ]; then - if ! _match_cfg $theme; then - err "Not a valid theme cfg file name: $theme" - continue - fi - add_file $theme || continue - dir=$( dirname $theme ) - # Add non-cfg files in theme dir - _add_non_cfg_files $dir - # Add files refered in cfg file by paths - for file in $( _get_cfg_files $theme ); do - if [ ${file:0:1} = / ]; then - add_file $file - continue - fi - # Path may be relative to theme-dir or to /etc/splash - [ -e $dir/$file -o ! -f /etc/splash/$file ] && add_file $dir/$file - [ -e /etc/splash/$file -o ! -f $dir/$file ] && add_file /etc/splash/$file + # List file paths contained in given Fbsplash theme cfg files + # (Only file paths containing at least one slash will be found by this.) + fbsplash_list_paths() { + (( $# )) || return 0 + /bin/sed -re ' + # convert all whitespace into single blanks + s,[[:space:]]+, ,g ; t L1 + :L1 + # drop comments, grouping directives and blank lines + /^ *([#<]|$)/ d + # get a filepath or drop + s,.*[ =]([^ ]*/[^ ]+).*,\1, ; t ; d + ' "$@" | /usr/bin/sort -u + } + + # Check if arg is a theme cfg file path + fbsplash_is_cfg() { + [[ $1 =~ ^/etc/splash/[^/]+/[0-9]+x[0-9]+\.cfg$ ]] + } + + # Add all files referenced by path in given theme cfg files + # args: ... + fbsplash_add_files_from_cfgs() { + local file theme_dir=$1; shift + while read file; do + if [[ $file == /* ]]; then + add_file $file + else # Path may be relative to /etc/splash or theme-dir + local found=0 + for file in /etc/splash/$file "$theme_dir"/$file; do + [[ -f $file ]] && { add_file $file; found=1; } done - elif [ -d $theme ]; then - dir=$theme - add_full_dir $dir - else - err "Theme not found: $theme" - continue + (( found )) || err "Theme '${theme_dir##*/}': File not found: '$file'" fi - if [[ " "$dirs" " != *" "$dir" "* ]]; then - dirs+=" "$dir - fi - done - for dir in $dirs; do - # Add the rc_init-pre script if we have one - # Currently this just prevents early daemon start for the theme - if [[ $SPLASH_DAEMON = early && -x $dir/scripts/rc_init-pre ]]; then - add_file $dir/scripts/rc_init-pre || continue - echo "WARNING: rc_init-pre script found - no early daemon with '${dir##*/}'!" >&2 - fi - done - ) + done < <( fbsplash_list_paths "$@" ) + } + + # Add common files (may be referenced in cfg by plain file name) + local file + for file in /etc/splash/*; do + [[ -f $file ]] && add_file "$file" + done + + # Add themes + local file theme + for theme in $SPLASH_THEMES; do + if [[ -d /etc/splash/$theme && $theme != */* ]]; then + add_full_dir /etc/splash/$theme + local files=() + for file in /etc/splash/$theme/*.cfg; do + [[ -f $file ]] && fbsplash_is_cfg "$file" && files+=( $file ) + done + fbsplash_add_files_from_cfgs /etc/splash/$theme "${files[@]}" + elif [[ -f /etc/splash/$theme ]] && fbsplash_is_cfg /etc/splash/$theme; then + file=/etc/splash/$theme; theme=${theme%/*} + add_file $file + fbsplash_add_files_from_cfgs /etc/splash/$theme $file + # Add all non-cfg files from theme dir (may be referenced by plain file name) + for file in /etc/splash/$theme/*; do + [[ -f $file ]] && ! fbsplash_is_cfg "$file" && add_file "$file" + done + else + err "Theme invalid or not found: '$theme'" + fi + done SCRIPT="fbsplash" } @@ -106,8 +97,7 @@ help() { cat<=2.0.10 is installed, but there +## might still be some sophisticated ones which break when using this. SPLASH_DAEMON="early" ## Make the splash daemon use fade effects. ## Note: The initcpio helper does only use the kernel parameter! +# Just use fadein on bootup and fadeout on shutdown/reboot +case $PREVLEVEL in N ) SPLASH_EFFECTS="fadein" ; esac +case $RUNLEVEL in [06] ) SPLASH_EFFECTS="fadeout"; esac +# Uncomment this line to allways use both # SPLASH_EFFECTS="fadein,fadeout" -## Uggly hack to get that in from the kernel line :p -SPLASH_EFFECTS=$(e=();IFS=',';for w in $splash;do [[ $w == fade* ]]&&e+=($w);done;echo "${e[*]}") ## Enable the textbox when starting the Fbsplash daemon. ## Useful if the theme provides a message log or other textbox. @@ -54,7 +63,7 @@ SPLASH_VERBOSE_ON_ERRORS="no" ## Name of the DAEMONS script starting Xorg if any -## Set this to avoid virtual terminal change struggle between Xorg and Fbsplash. +## Set this to avoid virtual terminal change struggle between X and Fbsplash. SPLASH_XSERVICE="gdm" #SPLASH_XSERVICE="kdm" #SPLASH_XSERVICE="xdm" diff -rNu fbsplash.34/splash_start_initcpio.patch fbsplash.35/splash_start_initcpio.patch --- fbsplash.34/splash_start_initcpio.patch 1970-01-01 01:00:00.000000000 +0100 +++ fbsplash.35/splash_start_initcpio.patch 2011-03-03 09:47:19.000000000 +0100 @@ -0,0 +1,22 @@ +diff -ru src.orig//splashutils-1.5.4.3/scripts/splash-functions.sh.in src//splashutils-1.5.4.3/scripts/splash-functions.sh.in +--- src.orig//splashutils-1.5.4.3/scripts/splash-functions.sh.in 2008-11-13 20:54:19.000000000 +0100 ++++ src//splashutils-1.5.4.3/scripts/splash-functions.sh.in 2011-03-03 09:45:29.258901793 +0100 +@@ -250,6 +250,9 @@ + # Start the splash daemon + BOOT_MSG="$(splash_get_boot_message)" ${spl_daemon} --theme="${SPLASH_THEME}" --pidfile="${spl_pidfile}" --type=${ttype} ${options} + ++ # First let the daemon open the event dev before it's gone away in case this is run in the initcpio ++ splash_set_event_dev ++ + # Set the silent TTY and boot message + splash_comm_send "set tty silent ${SPLASH_TTY}" + +@@ -261,8 +264,6 @@ + + splash_comm_send "set autoverbose ${SPLASH_AUTOVERBOSE}" + +- splash_set_event_dev +- + return 0 + } +