aboutsummaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorKurt J. Bosch <kjb-temp-2009@alpenjodel.de>2010-02-16 23:32:19 +0100
committerThomas Bächler <thomas@archlinux.org>2010-02-16 23:51:27 +0100
commit0ff97e6d8289d18d231cedae7371a3bd7ecedf97 (patch)
treeaac961770c0696c3b8d9beb26830a5ba7b9d361d /functions
parent284670262b3254f0b7a0574b4cf017171637fbc9 (diff)
downloadinitscripts-0ff97e6d8289d18d231cedae7371a3bd7ecedf97.tar.xz
Make consolefont code deferrable to avoid destroying splash
Diffstat (limited to 'functions')
-rw-r--r--functions28
1 files changed, 28 insertions, 0 deletions
diff --git a/functions b/functions
index 4dca333..b7b9511 100644
--- a/functions
+++ b/functions
@@ -271,6 +271,34 @@ run_hook() {
done
}
+# Function for setting console font if required
+set_consolefont() {
+ if [ -n "$CONSOLEFONT" ]; then
+ stat_busy "Loading Console Font: $CONSOLEFONT"
+ #CONSOLEMAP in UTF-8 shouldn't be used
+ if [ -n "$CONSOLEMAP" ] && echo "$LOCALE" | /bin/grep -qi utf ; then
+ CONSOLEMAP=""
+ fi
+ for i in /dev/tty[0-9]*; do
+ if [ -n "$CONSOLEMAP" ]; then
+ /usr/bin/setfont -m $CONSOLEMAP $CONSOLEFONT -C ${i} >/dev/null 2>&1
+ else
+ /usr/bin/setfont $CONSOLEFONT -C ${i} >/dev/null 2>&1
+ fi
+ done
+ if [ $? -ne 0 ]; then
+ stat_fail
+ else
+ for i in /dev/tty[0-9]*; do
+ printf "\033(K" > ${i}
+ done
+ # the $CONSOLE check helps us avoid this when running scripts from cron
+ echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "\033(K"; fi' >>/etc/profile.d/locale.sh
+ stat_done
+ fi
+ fi
+}
+
# Source additional functions at the end to allow overrides
for f in /etc/rc.d/functions.d/*; do
if [ -e $f ]; then