diff options
author | emax <emax@FreeBSD.org> | 2006-03-16 17:42:28 +0000 |
---|---|---|
committer | emax <emax@FreeBSD.org> | 2006-03-16 17:42:28 +0000 |
commit | f1994b9421bd6f78b686a1c232ee6aa96cea9f5d (patch) | |
tree | 88b3b35cb803445fbddc9e3e9b0914e7751511ab /etc | |
parent | c82f5e5987891517403fabece3f22b9bd81bbd2f (diff) | |
download | FreeBSD-src-f1994b9421bd6f78b686a1c232ee6aa96cea9f5d.zip FreeBSD-src-f1994b9421bd6f78b686a1c232ee6aa96cea9f5d.tar.gz |
Reorganize /etc/rc.d/syscons and move all keyboard related settings
into one function syscons_configure_keyboard(). Call new function from
both syscons_start() and sysconst_setkeyboard(). The reason for this
is because syscons_start() will (re)configure both keyboard and screen
settings. Apparently, some graphics cards have problems with running
vidcontrol(1) while X11 is running.
Remove "/etc/rc.d/syscons restart" from /etc/devd.conf. It is no longer
required. Using "/etc/rc.d/syscons setkeyboard" is enough. This also
should fix annoying "syscons not running?" message.
Tested by: Ulrich Spoerlein < q at galgenberg dot net >
MFC after: 3 days
Diffstat (limited to 'etc')
-rw-r--r-- | etc/devd.conf | 2 | ||||
-rw-r--r-- | etc/rc.d/syscons | 102 |
2 files changed, 57 insertions, 47 deletions
diff --git a/etc/devd.conf b/etc/devd.conf index 5385e06..a8d7716 100644 --- a/etc/devd.conf +++ b/etc/devd.conf @@ -99,7 +99,7 @@ detach 100 { # When a USB keyboard arrives, attach it as the console keyboard. attach 100 { device-name "ukbd0"; - action "/etc/rc.d/syscons setkeyboard /dev/ukbd0 && /etc/rc.d/syscons restart"; + action "/etc/rc.d/syscons setkeyboard /dev/ukbd0"; }; detach 100 { device-name "ukbd0"; diff --git a/etc/rc.d/syscons b/etc/rc.d/syscons index 751f69a..f4eccf7c 100644 --- a/etc/rc.d/syscons +++ b/etc/rc.d/syscons @@ -44,44 +44,9 @@ start_cmd="syscons_start" kbddev=/dev/ttyv0 viddev=/dev/ttyv0 -syscons_setkeyboard() +# helper +syscons_configure_keyboard() { - kbd=$1 - - if [ -z "${kbd}" ]; then - return 1 - fi - - # Check if the kbdmux(4) is the current active keyboard - kbdcontrol -i < ${kbddev} | grep kbdmux > /dev/null 2>&1 - if [ $? != 0 ]; then - kbdcontrol -k ${kbd} < ${kbddev} > /dev/null 2>&1 - fi -} - -syscons_precmd() -{ - if [ ! -c $kbddev ] - then - return 1 - fi - if [ -x /usr/sbin/ispcvt ] && /usr/sbin/ispcvt - then - return 1 - fi - return 0 -} - -syscons_start() -{ - echo -n 'Configuring syscons:' - - # keyboard - # - if [ -n "${keyboard}" ]; then - echo -n ' keyboard'; syscons_setkeyboard ${keyboard} - fi - # keymap # case ${keymap} in @@ -127,6 +92,60 @@ syscons_start() ;; esac + # set this keyboard mode for all virtual terminals + # + if [ -n "${allscreens_kbdflags}" ]; then + echo -n ' allscreens_kbd' + for ttyv in /dev/ttyv*; do + kbdcontrol ${allscreens_kbdflags} < ${ttyv} > ${ttyv} 2>&1 + done + fi +} + +syscons_setkeyboard() +{ + kbd=$1 + + if [ -z "${kbd}" ]; then + return 1 + fi + + # Check if the kbdmux(4) is the current active keyboard + kbdcontrol -i < ${kbddev} | grep kbdmux > /dev/null 2>&1 + if [ $? != 0 ]; then + kbdcontrol -k ${kbd} < ${kbddev} > /dev/null 2>&1 + fi + + echo -n 'Configuring keyboard:' + syscons_configure_keyboard + echo '.' +} + +syscons_precmd() +{ + if [ ! -c $kbddev ] + then + return 1 + fi + if [ -x /usr/sbin/ispcvt ] && /usr/sbin/ispcvt + then + return 1 + fi + return 0 +} + +syscons_start() +{ + echo -n 'Configuring syscons:' + + # keyboard + # + if [ -n "${keyboard}" ]; then + echo -n ' keyboard'; syscons_setkeyboard ${keyboard} + fi + + syscons_configure_keyboard + # cursor type # case ${cursor} in @@ -210,15 +229,6 @@ syscons_start() done fi - # set this keyboard mode for all virtual terminals - # - if [ -n "${allscreens_kbdflags}" ]; then - echo -n ' allscreens_kbd' - for ttyv in /dev/ttyv*; do - kbdcontrol ${allscreens_kbdflags} < ${ttyv} > ${ttyv} 2>&1 - done - fi - echo '.' } |