[Pkg-kbd-commit] r247 - kbd/trunk/debian

Anton Zinoviev zinoviev at alioth.debian.org
Thu May 10 12:33:40 UTC 2007


Author: zinoviev
Date: 2007-05-10 12:33:40 +0000 (Thu, 10 May 2007)
New Revision: 247

Modified:
   kbd/trunk/debian/changelog
   kbd/trunk/debian/console-screen.kbd.sh
Log:
kbd(console-screen.kbd.sh): fix per-VC font load, don't use static paths, do not run unicode_start for consoles with APP_CHARSET_MAP_vcN


Modified: kbd/trunk/debian/changelog
===================================================================
--- kbd/trunk/debian/changelog	2007-05-10 11:07:40 UTC (rev 246)
+++ kbd/trunk/debian/changelog	2007-05-10 12:33:40 UTC (rev 247)
@@ -6,11 +6,15 @@
     closes: #398439.
   * Search for an installed font in unicode_start since now LatArCyrHeb-16
     may not be installed.
-  * Run unicode_{start,stop} before setfont in the init.d script.  Give a
-    font argument to unicode_start so the font doesn't change twice.
-    Thanks to Mattia, closes: #421390.
-  * (Re)enable the ACM load in the init.d script.
-
+  * Some changes in /etc/init.d/console_screen.kbd.sh:
+    - run unicode_{start,stop} before setfont.  Give a font argument to
+      unicode_start so the font doesn't change twice. Thanks to Mattia,
+      closes: #421390;
+    - fix the per-VC font load;
+    - (re)enable the per-VC ACM load;
+    - do not run unicode_start for consoles with defined APP_CHARSET_MAP_vcN;
+    - do not use static paths such as /usr/bin/setfont.
+  
  -- Anton Zinoviev <zinoviev at debian.org>  Thu, 10 May 2007 11:21:53 +0300
 
 kbd (1.12-17) unstable; urgency=low

Modified: kbd/trunk/debian/console-screen.kbd.sh
===================================================================
--- kbd/trunk/debian/console-screen.kbd.sh	2007-05-10 11:07:40 UTC (rev 246)
+++ kbd/trunk/debian/console-screen.kbd.sh	2007-05-10 12:33:40 UTC (rev 247)
@@ -26,19 +26,9 @@
 . /lib/lsb/init-functions
 
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
-SETFONT="/usr/bin/setfont"
 SETFONT_OPT="-v"
-VCSTIME="/usr/sbin/vcstime"
 
-# Different device name for 2.6 kernels and devfs
-if [ `uname -r | cut -f 2 -d .` = 6 ] && [ -e /dev/.devfsd ]; then
-    VCSTIME_OPT="-2 /dev/vcsa0"
-else
-    VCSTIME_OPT=""
-fi
 
-
-
 # set DEVICE_PREFIX depending on devfs/udev
 if [ -d /dev/vc ]; then
     DEVICE_PREFIX="/dev/vc/"
@@ -58,7 +48,7 @@
 setup ()
 {
     # be sure the main program is installed
-    [ -x "${SETFONT}" ] || return
+    which setfont >/dev/null || return
 
     VT="no"
     # If we can't access the console, quit
@@ -75,9 +65,15 @@
     [ $VT = "no" ] && return
 
     # start vcstime
-    if [ "${DO_VCSTIME}" = "yes" ] && [ -x ${VCSTIME} ]; then
+    if [ "${DO_VCSTIME}" = "yes" ] && which vcstime >/dev/null; then
+        # Different device name for 2.6 kernels and devfs
+	if [ `uname -r | cut -f 2 -d .` = 6 ] && [ -e /dev/.devfsd ]; then
+	    VCSTIME_OPT="-2 /dev/vcsa0"
+	else
+	    VCSTIME_OPT=""
+	fi
         [ "$VERBOSE" != "no" ] && log_action_begin_msg "Starting clock on text console"
-        ${VCSTIME} ${VCSTIME_OPT} &
+        vcstime ${VCSTIME_OPT} &
         [ "$VERBOSE" != "no" ] && log_action_end_msg 0
     fi
 
@@ -100,18 +96,18 @@
         done
     fi
     CHARMAP=`LANG=$LANG LC_ALL=$LC_ALL LC_CTYPE=$LC_CTYPE locale charmap 2>/dev/null`
-    if [ "$CHARMAP" = "UTF-8" ]; then
-        action=unicode_start
-    else
-        action=unicode_stop
-    fi
     for vc in $LIST_CONSOLES
     do
-        if [ "${CONSOLE_FONT}" ]; then
-            $action "${CONSOLE_FONT}" < ${DEVICE_PREFIX}$vc > ${DEVICE_PREFIX}$vc 2> /dev/null || true
+        if [ "$CHARMAP" = "UTF-8" -a -z "$(eval echo \$APP_CHARSET_MAP_vc$vc)" ]; then
+	    action=unicode_start
 	else
-            $action < ${DEVICE_PREFIX}$vc > ${DEVICE_PREFIX}$vc 2> /dev/null || true
+	    action=unicode_stop
 	fi
+	if [ "${CONSOLE_FONT}" ]; then
+	    $action "${CONSOLE_FONT}" < ${DEVICE_PREFIX}$vc > ${DEVICE_PREFIX}$vc 2> /dev/null || true
+	else
+	    $action < ${DEVICE_PREFIX}$vc > ${DEVICE_PREFIX}$vc 2> /dev/null || true
+	fi
     done
 
 
@@ -123,7 +119,7 @@
         # Set for the first 6 VCs (as they are allocated in /etc/inittab)
         for vc in $LIST_CONSOLES
         do
-            if ! ${SETFONT} -C ${DEVICE_PREFIX}$vc ${SETFONT_OPT} ${CONSOLE_FONT}; then
+            if ! setfont -C ${DEVICE_PREFIX}$vc ${SETFONT_OPT} ${CONSOLE_FONT}; then
                 [ "$VERBOSE" != "no" ] && log_action_end_msg 1
                 break
             fi
@@ -139,12 +135,12 @@
         for font in ${PERVC_FONTS}
         do
             # extract VC and FONTNAME info from variable setting
-            vc=`echo $font | cut -b15- | cut -d= -f1`
+            vc=`echo $font | cut -b16- | cut -d= -f1`
             eval font=\$CONSOLE_FONT_vc$vc
             # eventually find an associated SFM
             eval sfm=\${CONSOLE_MAP_vc${vc}}
             [ "$sfm" ] && sfm="-u $sfm"
-            if ! ${SETFONT} -C ${DEVICE_PREFIX}$vc ${SETFONT_OPT} $sfm $font; then
+            if ! setfont -C ${DEVICE_PREFIX}$vc ${SETFONT_OPT} $sfm $font; then
                 [ "$VERBOSE" != "no" ] && log_action_end_msg 1
                 break
             fi
@@ -153,26 +149,26 @@
     fi
 
 
-    # Global ACM
-    [ "${APP_CHARSET_MAP}" ] && setfont -m ${APP_CHARSET_MAP}
+#     # Global ACM
+#     [ "${APP_CHARSET_MAP}" ] && setfont -m ${APP_CHARSET_MAP}
 
 
-    # Per-VC ACMs
-    PERVC_ACMS="`set | grep "^APP_CHARSET_MAP_vc[0-9]*="  | tr -d \' `"
-    if [ "${PERVC_ACMS}" ]; then
-        [ "$VERBOSE" != "no" ] && log_action_begin_msg "Setting up per-VC ACM's"
-        for acm in ${PERVC_ACMS}
-        do
-            # extract VC and FONTNAME info from variable setting
-            vc=`echo $acm | cut -b19- | cut -d= -f1`
-            eval acm=\$APP_CHARSET_MAP_vc$vc
-            if ! setfont -C "${DEVICE_PREFIX}$vc" -m "$acm"; then
-                [ "$VERBOSE" != "no" ] && log_action_end_msg 1
-                break
-            fi
-        done
-        [ "$VERBOSE" != "no" ] && log_action_end_msg 0
-    fi
+     # Per-VC ACMs
+     PERVC_ACMS="`set | grep "^APP_CHARSET_MAP_vc[0-9]*="  | tr -d \' `"
+     if [ "${PERVC_ACMS}" ]; then
+         [ "$VERBOSE" != "no" ] && log_action_begin_msg "Setting up per-VC ACM's"
+         for acm in ${PERVC_ACMS}
+         do
+             # extract VC and ACM_FONTNAME info from variable setting
+             vc=`echo $acm | cut -b19- | cut -d= -f1`
+             eval acm=\$APP_CHARSET_MAP_vc$vc
+             if ! setfont -C "${DEVICE_PREFIX}$vc" -m "$acm"; then
+                 [ "$VERBOSE" != "no" ] && log_action_end_msg 1
+                 break
+             fi
+         done
+         [ "$VERBOSE" != "no" ] && log_action_end_msg 0
+     fi
 
 
     # screensaver stuff




More information about the Pkg-kbd-commit mailing list