O.K. it fixes it in correct place - in /etc/rc.d/rc. It also moves the
code out of profile.d/lang.sh, but that is not strcitly needed - I just
thought we better have it in one place (in case we need to add more
encodings).
The name for mandrake_consmap is arbitrary - please, select what you
wish :-)
Please, apply.
-andrej
--- /etc/rc.d/init.d/mandrake_consmap.bor Sat Sep 1 21:42:24 2001
+++ /etc/rc.d/init.d/mandrake_consmap Sat Sep 1 21:47:52 2001
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+if [ -n "$SYSFONTACM" ]; then
+ case $SYSFONTACM in
+ iso01*|iso02*|iso15*|koi*|latin2-ucw*)
+ if [ "`/sbin/consoletype`" = "vt" -a \( -z "$TERM" -o
"$TERM" = linux \) ]; then
+ echo -n -e '\033(K' 2>/dev/null
+ fi
+ ;;
+ esac
+fi
--- /etc/rc.d/rc.bor Sat Sep 1 08:34:59 2001
+++ /etc/rc.d/rc Sat Sep 1 21:40:16 2001
@@ -13,6 +13,10 @@
# Source function library.
. /etc/init.d/functions
[ -n "$aurora" ] && . /lib/aurora/functions
+
+# Make sure console is using the correct map table
+
+[ -f /etc/init.d/mandrake_consmap ] && . /etc/init.d/mandrake_consmap
# We do not want these to be recalculated, especially if Aurora is running
--- /etc/profile.d/lang.sh.bor Sat Sep 1 08:34:58 2001
+++ /etc/profile.d/lang.sh Sat Sep 1 21:49:07 2001
@@ -79,16 +79,7 @@
[ -n "$XMODIFIERS" ] && export XMODIFIERS || unset XMODIFIERS
[ -n "$_XKB_CHARSET" ] && export _XKB_CHARSET || unset _XKB_CHARSET
- if [ -n "$SYSFONTACM" ]; then
- case $SYSFONTACM in
- iso01*|iso02*|iso15*|koi*|latin2-ucw*)
- if [ "$TERM" = "linux" -a "`/sbin/consoletype`" = "vt"
]; then
- echo -n -e '\033(K' 2>/dev/null > /proc/$$/fd/0
- fi
- ;;
- esac
- fi
-
+ [ -f /etc/init.d/mandrake_consmap ] && . /etc/init.d/mandrake_consmap
unset SYSFONTACM SYSFONT
# handling of special cases where localization is done
Borsenkow Andrej wrote:
> In some locales you need to explicitly switch console to locale
> encoding. Currently it is done in /etc/profile.d/lang.sh:
>
> if [ -n "$SYSFONTACM" ]; then
> case $SYSFONTACM in
> iso01*|iso02*|iso15*|koi*|latin2-ucw*)
> if [ "$TERM" = "linux" -a "`/sbin/consoletype`" = "vt"
> ]; then
> echo -n -e '\033(K' 2>/dev/null > /proc/$$/fd/0
> fi
> ;;
> esac
> fi
>
> The problem is, this file is sourced only on login. It means, that if
> nobody has ever logged in on console (as is the case with GUI logon),
> shutdown messages are unreadable. Moreover, it applies to every tty, so
> even if you have logged in on tty2 but were on tty1 when shutdwon was
> started messages are still unreadable.
>
> I suggest ripping the above commands (including sourcing of
> /etc/sysconfig/i18n of course) into seperate file and executing it out
> of inittab before entering main runlevel, like
>
> lf1:2345:once:/etc/rc.d/rc.sysfont < /dev/tty1 > /dev/tty1 2>&1
> lf2:2345:once:/etc/rc.d/rc.sysfont < /dev/tty1 > /dev/tty2 2>&1
> ...
>
> just before mingetty. Once is actually enough (for all I can tell) as
> long as somebody has not reset tty back. Unfortunately, mcc is known to
> do it :-(
>
> -andrej
>