summaryrefslogtreecommitdiffstats
path: root/abs/core/fbsplash/fbsplash.initcpio_hook
diff options
context:
space:
mode:
authorCecil <knoppmyth@gmail.com>2011-09-24 07:20:16 (GMT)
committerCecil <knoppmyth@gmail.com>2011-09-24 07:20:16 (GMT)
commitbe452ab0786fa9a452938c647704122f42838a28 (patch)
tree3a13b0052d437b3b16328023cf5d3f6f370036d1 /abs/core/fbsplash/fbsplash.initcpio_hook
parentae5fc8a102437e1671eb2d4a53a3c999cf1e1339 (diff)
downloadlinhes_pkgbuild-be452ab0786fa9a452938c647704122f42838a28.zip
linhes_pkgbuild-be452ab0786fa9a452938c647704122f42838a28.tar.gz
linhes_pkgbuild-be452ab0786fa9a452938c647704122f42838a28.tar.bz2
fbsplash:Bumped to latest version.
Diffstat (limited to 'abs/core/fbsplash/fbsplash.initcpio_hook')
-rw-r--r--abs/core/fbsplash/fbsplash.initcpio_hook128
1 files changed, 39 insertions, 89 deletions
diff --git a/abs/core/fbsplash/fbsplash.initcpio_hook b/abs/core/fbsplash/fbsplash.initcpio_hook
index 62048df..02617a2 100644
--- a/abs/core/fbsplash/fbsplash.initcpio_hook
+++ b/abs/core/fbsplash/fbsplash.initcpio_hook
@@ -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
+ # 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
- if ! [ "$console" = tty1 -o "$SPLASH_SANITY" = insane ]; then
- err "Fbsplash requires console=tty1 in kernel line!"
- return 1
- fi
+ [ "${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
- 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
+ # Start the daemon here if possible
+ # to show animations early and gain some bootup speed
+ if [ -x "$spl_daemon" ]; 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 /run to get it moved to the new root
+ mkdir /run/.splash-cache
+ ( spl_cachedir=/run/.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 /run/
+ # Symlink for starting the daemon
+ ln -s /run/.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 /run/.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