From 2a709f2364c765548b34b6972b6d9894fbfe7f27 Mon Sep 17 00:00:00 2001 From: Kurt J. Bosch Date: Tue, 16 Feb 2010 23:32:19 +0100 Subject: [PATCH 2/2] Make consolefont code deferrable to avoid destroying splash --- functions | 28 ++++++++++++++++++++++++++++ rc.sysinit | 26 ++------------------------ 2 files changed, 30 insertions(+), 24 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 diff --git a/rc.sysinit b/rc.sysinit index 67f0d5d..c4ebd77 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -373,30 +373,8 @@ else [ -n "$KEYMAP" ] && status "Loading Keyboard Map: $KEYMAP" /bin/loadkeys -q $KEYMAP fi -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 +# Set console font if required +set_consolefont # Adding persistent network/cdrom generated rules if [ -f "/dev/.udev/tmp-rules--70-persistent-cd.rules" ]; then -- 1.6.6.1