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
This commit is contained in:
parent
32363c848e
commit
6fc8bb3fd9
@ -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";
|
||||
|
102
etc/rc.d/syscons
102
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 '.'
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user