--- rc.sysinit.orig 2008-03-02 16:37:53.000000000 +0200 +++ rc.sysinit 2008-03-02 16:32:17.000000000 +0200 @@ -346,21 +370,29 @@ echo "export LANG=$LOCALE" >>/etc/profil stat_done if echo "$LOCALE" | /bin/grep -qi utf ; then - stat_busy "Setting Consoles to UTF-8" + stat_busy "Setting Consoles to UTF-8 mode" + # UTF-8 consoles are default since 2.6.24 kernel + # this code is needed not only for older kernels, + # but also when user has set vt.default_utf8=0 but LOCALE is *.UTF-8. /usr/bin/kbd_mode -u - for i in $(seq 1 63); do - echo -ne "\e%G" > /dev/vc/${i} + for i in $(seq 0 63); do + printf "\e%%G" > /dev/vc/${i} done # the $CONSOLE check helps us avoid this when running scripts from cron - echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then echo -ne "\e%G"; fi' >>/etc/profile.d/locale.sh - stat_done - stat_busy "Loading Keyboard Map: $KEYMAP in utf-8 mode" - /bin/loadkeys -q -u "$KEYMAP" > /dev/null 2>&1 + echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "\e%%G"; fi' >>/etc/profile.d/locale.sh stat_done + status "Loading Keyboard Map: $KEYMAP" /bin/loadkeys -q -u defkeymap $KEYMAP else - stat_busy "Loading Keyboard Map: $KEYMAP in legacy mode" - /bin/loadkeys -q "$KEYMAP" > /dev/null 2>&1 + stat_busy "Setting Consoles to legacy mode" + # make non-UTF-8 consoles work on 2.6.24 and newer kernels + /usr/bin/kbd_mode -a + for i in $(seq 0 63); do + printf "\e%%@" > /dev/vc/${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 "\e%%@"; fi' >>/etc/profile.d/locale.sh stat_done + status "Loading Keyboard Map: $KEYMAP" /bin/loadkeys -q defkeymap $KEYMAP fi if [ -n "$CONSOLEFONT" ]; then @@ -369,19 +401,23 @@ if [ -n "$CONSOLEFONT" ]; then if [ -n "$CONSOLEMAP" ] && echo "$LOCALE" | /bin/grep -qi utf ; then CONSOLEMAP="" fi - for i in $(seq 1 63); do + for i in $(seq 0 63); do if [ -n "$CONSOLEMAP" ]; then - /usr/bin/setfont -m $CONSOLEMAP $CONSOLEFONT -C /dev/vc/${i} + /usr/bin/setfont -m $CONSOLEMAP $CONSOLEFONT -C /dev/vc/${i} >/dev/null 2>&1 else - /usr/bin/setfont $CONSOLEFONT -C /dev/vc/${i} + /usr/bin/setfont $CONSOLEFONT -C /dev/vc/${i} >/dev/null 2>&1 fi done - for i in $(seq 1 63); do - echo -ne "\e(K" > /dev/vc/${i} - done - # the $CONSOLE check helps us avoid this when running scripts from cron - echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then echo -ne "\e(K"; fi' >>/etc/profile.d/locale.sh - stat_done + if [ $? -ne 0 ]; then + stat_fail + else + for i in $(seq 0 63); do + printf "\e(K" > /dev/vc/${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 "\e(K"; fi' >>/etc/profile.d/locale.sh + stat_done + fi fi # Adding persistent network/cdrom generated rules