Witam!

Dzisiaj zorientowałem się, że skrypt kbd.init nie włącza mi numlocka, na
konsoli tekstowej. Po obejżeniu skryptu zauważyłem, że robi on to tylko
na framebufferze. W załączeniu mała poprawka na ww plik. W zasadzie to
nawet dwie poprawki. W jednej robię to z automatu dla wszystkich konsol
z inittaba. W drugiej jest to robione tak jak dla fb (jeżeli jest
ustawione $SET_FONT_TERMINALS to dla konsol które są tam wymienione,
jeżeli jest puste to dla wszystkich z inittaba).

Jeśli nie będzie żadnych uwag, to prosiłbym o zaaplikowanie.

-- 
Pozdrawiam
Przemysław Białek
--- kbd.init.orig       2004-06-28 21:24:23.000000000 +0200
+++ kbd.init    2004-10-11 19:40:06.427346984 +0200
@@ -49,36 +49,31 @@
                show "Loading console font and map"
                busy
 
+               # check if devfs (workaround: -a option don't work at all)
+               if [ -d /dev/vc ]; then
+                       DEVICES="`ls /dev/vc/* | sed 's|/dev/vc/||g'`"
+                       pattern="s/\/dev\/vc\///g"
+                       VC_PATH="/dev/vc/"
+               else
+                       DEVICES="`cat /etc/inittab | grep '^[0-9]*:' | cut -f1 -d :`"
+                       pattern="s/\/dev\/tty//g"
+                       VC_PATH="/dev/tty"
+               fi
+
                # don't initialize on multiple terminals if we use fbset
                # (assume that, in this case fb is loaded as a module)
                if [ ! -z "$FB" ]; then
-                       # Check for devfs (workaround: -a option don't work at all)
-                       if [ -d /dev/vc ]; then
-                               pattern="s/\/dev\/vc\///g"
-                       else
-                               pattern="s/\/dev\/tty//g"
-                       fi
-
                        # save old tty number
                        tty=`/usr/bin/tty | sed $pattern`
 
-                       # check if devfs (workaround: -a option don't work at all)
-                       if [ -d /dev/vc ]; then
-                               DEVICES="`ls /dev/vc/* | sed 's|/dev/vc/||g'`"
-                       else
-                               DEVICES="`cat /etc/inittab | grep '^[0-9]*:' | cut -f1 
-d :`"
-                       fi
-
                        [ -z "$SET_FONT_TERMINALS" ] && SET_FONT_TERMINALS="$DEVICES"
 
                        for cons in $SET_FONT_TERMINALS; do
                                /usr/bin/open -c $cons -s -w -- $CMD
-                               if [ "$NUM_LOCK" ]; then
-                                       if [ $NUM_LOCK = "on" ]; then
-                                               /usr/bin/open -c $cons -s -w -- 
/usr/bin/setleds -D +num
-                                       else
-                                               /usr/bin/open -c $cons -s -w -- 
/usr/bin/setleds -D -num
-                                       fi
+                               if is_yes "$NUM_LOCK"; then
+                                       /usr/bin/open -c $cons -s -w -- 
/usr/bin/setleds -D +num
+                               else
+                                       /usr/bin/open -c $cons -s -w -- 
/usr/bin/setleds -D -num
                                fi
                        done
 
@@ -87,6 +82,11 @@
                        fi
                        /usr/bin/switchto $tty
                else
+                       if is_yes "$NUM_LOCK"; then
+                               for cons in $DEVICES; do
+                                       /usr/bin/setleds -D +num < $VC_PATH$cons
+                               done
+                       fi
                        $CMD
                fi
                ok
--- kbd.init.orig       2004-06-28 21:24:23.000000000 +0200
+++ kbd.init    2004-10-11 19:54:37.985849952 +0200
@@ -49,36 +49,31 @@
                show "Loading console font and map"
                busy
 
+               # check if devfs (workaround: -a option don't work at all)
+               if [ -d /dev/vc ]; then
+                       DEVICES="`ls /dev/vc/* | sed 's|/dev/vc/||g'`"
+                       pattern="s/\/dev\/vc\///g"
+                       VC_PATH="/dev/vc/"
+               else
+                       DEVICES="`cat /etc/inittab | grep '^[0-9]*:' | cut -f1 -d :`"
+                       pattern="s/\/dev\/tty//g"
+                       VC_PATH="/dev/tty"
+               fi
+
+               [ -z "$SET_FONT_TERMINALS" ] && SET_FONT_TERMINALS="$DEVICES"
+
                # don't initialize on multiple terminals if we use fbset
                # (assume that, in this case fb is loaded as a module)
                if [ ! -z "$FB" ]; then
-                       # Check for devfs (workaround: -a option don't work at all)
-                       if [ -d /dev/vc ]; then
-                               pattern="s/\/dev\/vc\///g"
-                       else
-                               pattern="s/\/dev\/tty//g"
-                       fi
-
                        # save old tty number
                        tty=`/usr/bin/tty | sed $pattern`
 
-                       # check if devfs (workaround: -a option don't work at all)
-                       if [ -d /dev/vc ]; then
-                               DEVICES="`ls /dev/vc/* | sed 's|/dev/vc/||g'`"
-                       else
-                               DEVICES="`cat /etc/inittab | grep '^[0-9]*:' | cut -f1 
-d :`"
-                       fi
-
-                       [ -z "$SET_FONT_TERMINALS" ] && SET_FONT_TERMINALS="$DEVICES"
-
                        for cons in $SET_FONT_TERMINALS; do
                                /usr/bin/open -c $cons -s -w -- $CMD
-                               if [ "$NUM_LOCK" ]; then
-                                       if [ $NUM_LOCK = "on" ]; then
-                                               /usr/bin/open -c $cons -s -w -- 
/usr/bin/setleds -D +num
-                                       else
-                                               /usr/bin/open -c $cons -s -w -- 
/usr/bin/setleds -D -num
-                                       fi
+                               if is_yes "$NUM_LOCK"; then
+                                       /usr/bin/open -c $cons -s -w -- 
/usr/bin/setleds -D +num
+                               else
+                                       /usr/bin/open -c $cons -s -w -- 
/usr/bin/setleds -D -num
                                fi
                        done
 
@@ -87,6 +82,11 @@
                        fi
                        /usr/bin/switchto $tty
                else
+                       if is_yes "$NUM_LOCK"; then
+                               for cons in $SET_FONT_TERMINALS; do
+                                       /usr/bin/setleds -D +num < $VC_PATH$cons
+                               done
+                       fi
                        $CMD
                fi
                ok
_______________________________________________
pld-devel-pl mailing list
[EMAIL PROTECTED]
http://lists.pld-linux.org/mailman/listinfo/pld-devel-pl

Odpowiedź listem elektroniczym