summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/fbsplash/splash-functions-arch.sh
diff options
context:
space:
mode:
authorCecil Hugh Watson <knoppmyth@gmail.com>2009-02-12 08:22:14 (GMT)
committerCecil Hugh Watson <knoppmyth@gmail.com>2009-02-12 08:22:14 (GMT)
commit40727c47f4a6319dc101ca97cddd72732db03889 (patch)
treec469bd876c58981ef4abd517af7af7f6c8f8868a /abs/core-testing/fbsplash/splash-functions-arch.sh
parentd39d6198243375c7cc8e72aa926d24fc6b625982 (diff)
downloadlinhes_pkgbuild-40727c47f4a6319dc101ca97cddd72732db03889.zip
linhes_pkgbuild-40727c47f4a6319dc101ca97cddd72732db03889.tar.gz
linhes_pkgbuild-40727c47f4a6319dc101ca97cddd72732db03889.tar.bz2
Initial inclusion of fbsplash and deps.
Diffstat (limited to 'abs/core-testing/fbsplash/splash-functions-arch.sh')
-rw-r--r--abs/core-testing/fbsplash/splash-functions-arch.sh71
1 files changed, 71 insertions, 0 deletions
diff --git a/abs/core-testing/fbsplash/splash-functions-arch.sh b/abs/core-testing/fbsplash/splash-functions-arch.sh
new file mode 100644
index 0000000..977ccef
--- /dev/null
+++ b/abs/core-testing/fbsplash/splash-functions-arch.sh
@@ -0,0 +1,71 @@
+# ArchLinux specific splash functions #
+# Author: Greg Helton <gt@fallendusk.org> #
+
+splash_init() {
+ splash_setup
+ splash_start
+}
+
+splash_exit() {
+ splash_comm_send "exit"
+ splash_cache_cleanup
+}
+
+splash_update_progress() {
+ local PROGRESS
+ PROGRESS=$(($1*65535/100))
+ splash_comm_send "progress ${PROGRESS}"
+ splash_comm_send "repaint"
+}
+
+var_save() {
+for i in $@ ;
+ do
+ local var
+ eval var=\$SPLASH_${i}
+ echo "SPLASH_$i=$(echo ${var})" > ${spl_cachedir}/${i}
+ done
+}
+
+var_load() {
+for i in $@ ;
+ do
+ local var
+ eval var=\$SPLASH_${i}
+ if [[ -z "$(echo ${var})" && -f ${spl_cachedir}/${i} ]] ; then
+ source ${spl_cachedir}/${i}
+ fi
+ done
+}
+
+save_boot_steps() {
+ var_load STEP_NR
+ echo $SPLASH_STEP_NR > /etc/conf.d/fbsplash.bootsteps
+}
+
+load_boot_steps() {
+ BOOT_STEPS=$(cat /etc/conf.d/fbsplash.bootsteps)
+ # Fail safe, so we don't divide by 0
+ if [ $BOOT_STEPS = 0 ]; then
+ BOOT_STEPS=1
+ fi
+ printf $BOOT_STEPS
+}
+
+save_shutdown_steps() {
+ var_load SHUTDOWN_STEPS
+ ((SPLASH_SHUTDOWN_STEPS++))
+ echo $SPLASH_SHUTDOWN_STEPS > /etc/conf.d/fbsplash.shutdownsteps
+ var_save SHUTDOWN_STEPS
+}
+
+load_shutdown_steps() {
+ SHUTDOWN_STEPS=$(cat /etc/conf.d/fbsplash.shutdownsteps)
+ # Fail safe, so we don't divide by 0
+ if [ $SHUTDOWN_STEPS = 0 ]; then
+ SHUTDOWN_STEPS=1
+ fi
+ printf $SHUTDOWN_STEPS
+}
+
+# EOF #