diff options
author | fenner <fenner@FreeBSD.org> | 2002-09-05 23:51:28 +0000 |
---|---|---|
committer | fenner <fenner@FreeBSD.org> | 2002-09-05 23:51:28 +0000 |
commit | 62292673aa24a0b6d5a0399350d3a7b1098cce44 (patch) | |
tree | 46ec2d8b0c141babe76fcdd3946643c957d51c71 /etc/rc.d/syscons | |
parent | 472042a2cb4375af9b10a7ab6bb39bbdcb378260 (diff) | |
download | FreeBSD-src-62292673aa24a0b6d5a0399350d3a7b1098cce44.zip FreeBSD-src-62292673aa24a0b6d5a0399350d3a7b1098cce44.tar.gz |
Only try to initialize syscons if /dev/ttyv0 exists and it's not a pcvt.
Diffstat (limited to 'etc/rc.d/syscons')
-rw-r--r-- | etc/rc.d/syscons | 296 |
1 files changed, 156 insertions, 140 deletions
diff --git a/etc/rc.d/syscons b/etc/rc.d/syscons index 32bf5bf..5339151 100644 --- a/etc/rc.d/syscons +++ b/etc/rc.d/syscons @@ -34,6 +34,8 @@ . /etc/rc.subr name="syscons" +start_precmd="syscons_precmd" +start_cmd="syscons_start" load_rc_config $name # stdin must be redirected because it might be for a serial console @@ -41,143 +43,157 @@ load_rc_config $name kbddev=/dev/ttyv0 viddev=/dev/ttyv0 -echo -n 'Configuring syscons:' - -# keymap -# -case ${keymap} in -[Nn][Oo] | '') - ;; -*) - echo -n ' keymap'; kbdcontrol < ${kbddev} -l ${keymap} - ;; -esac - -# keyrate -# -case ${keyrate} in -[Nn][Oo] | '') - ;; -*) - echo -n ' keyrate'; kbdcontrol < ${kbddev} -r ${keyrate} - ;; -esac - -# keybell -# -case ${keybell} in -[Nn][Oo] | '') - ;; -*) - echo -n ' keybell'; kbdcontrol < ${kbddev} -b ${keybell} - ;; -esac - -# change function keys -# -case ${keychange} in -[Nn][Oo] | '') - ;; -*) - echo -n ' keychange' - set - ${keychange} - while [ $# -gt 0 ]; do - kbdcontrol <${kbddev} -f "$1" "$2" - shift; shift - done - ;; -esac - -# cursor type -# -case ${cursor} in -[Nn][Oo] | '') - ;; -*) - echo -n ' cursor'; vidcontrol < ${viddev} -c ${cursor} - ;; -esac - -# screen mapping -# -case ${scrnmap} in -[Nn][Oo] | '') - ;; -*) - echo -n ' scrnmap'; vidcontrol < ${viddev} -l ${scrnmap} - ;; -esac - -# font 8x16 -# -case ${font8x16} in -[Nn][Oo] | '') - ;; -*) - echo -n ' font8x16'; vidcontrol < ${viddev} -f 8x16 ${font8x16} - ;; -esac - -# font 8x14 -# -case ${font8x14} in -[Nn][Oo] | '') - ;; -*) - echo -n ' font8x14'; vidcontrol < ${viddev} -f 8x14 ${font8x14} - ;; -esac - -# font 8x8 -# -case ${font8x8} in -[Nn][Oo] | '') - ;; -*) - echo -n ' font8x8'; vidcontrol < ${viddev} -f 8x8 ${font8x8} - ;; -esac - -# blank time -# -case ${blanktime} in -[Nn][Oo] | '') - ;; -*) - echo -n ' blanktime'; vidcontrol < ${viddev} -t ${blanktime} - ;; -esac - -# screen saver -# -case ${saver} in -[Nn][Oo] | '') - ;; -*) - echo -n ' screensaver' - for i in `kldstat | awk '$5 ~ "^splash_.*$" { print $5 }'`; do - kldunload ${i} - done - kldstat -v | grep -q _saver || kldload ${saver}_saver - ;; -esac - -# set this mode for all virtual screens -# -if [ -n "${allscreens_flags}" ]; then - echo -n ' allscreens' - for ttyv in /dev/ttyv*; do - vidcontrol ${allscreens_flags} < ${ttyv} > ${ttyv} 2>&1 - 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 '.' +syscons_precmd() +{ + if [ -c $kbddev ] && \ + [ -x /usr/sbin/ispcvt ] && \ + ! /usr/sbin/ispcvt + then + return 0 + fi + return 1 +} + +syscons_start() +{ + echo -n 'Configuring syscons:' + + # keymap + # + case ${keymap} in + [Nn][Oo] | '') + ;; + *) + echo -n ' keymap'; kbdcontrol < ${kbddev} -l ${keymap} + ;; + esac + + # keyrate + # + case ${keyrate} in + [Nn][Oo] | '') + ;; + *) + echo -n ' keyrate'; kbdcontrol < ${kbddev} -r ${keyrate} + ;; + esac + + # keybell + # + case ${keybell} in + [Nn][Oo] | '') + ;; + *) + echo -n ' keybell'; kbdcontrol < ${kbddev} -b ${keybell} + ;; + esac + + # change function keys + # + case ${keychange} in + [Nn][Oo] | '') + ;; + *) + echo -n ' keychange' + set - ${keychange} + while [ $# -gt 0 ]; do + kbdcontrol <${kbddev} -f "$1" "$2" + shift; shift + done + ;; + esac + + # cursor type + # + case ${cursor} in + [Nn][Oo] | '') + ;; + *) + echo -n ' cursor'; vidcontrol < ${viddev} -c ${cursor} + ;; + esac + + # screen mapping + # + case ${scrnmap} in + [Nn][Oo] | '') + ;; + *) + echo -n ' scrnmap'; vidcontrol < ${viddev} -l ${scrnmap} + ;; + esac + + # font 8x16 + # + case ${font8x16} in + [Nn][Oo] | '') + ;; + *) + echo -n ' font8x16'; vidcontrol < ${viddev} -f 8x16 ${font8x16} + ;; + esac + + # font 8x14 + # + case ${font8x14} in + [Nn][Oo] | '') + ;; + *) + echo -n ' font8x14'; vidcontrol < ${viddev} -f 8x14 ${font8x14} + ;; + esac + + # font 8x8 + # + case ${font8x8} in + [Nn][Oo] | '') + ;; + *) + echo -n ' font8x8'; vidcontrol < ${viddev} -f 8x8 ${font8x8} + ;; + esac + + # blank time + # + case ${blanktime} in + [Nn][Oo] | '') + ;; + *) + echo -n ' blanktime'; vidcontrol < ${viddev} -t ${blanktime} + ;; + esac + + # screen saver + # + case ${saver} in + [Nn][Oo] | '') + ;; + *) + echo -n ' screensaver' + for i in `kldstat | awk '$5 ~ "^splash_.*$" { print $5 }'`; do + kldunload ${i} + done + kldstat -v | grep -q _saver || kldload ${saver}_saver + ;; + esac + + # set this mode for all virtual screens + # + if [ -n "${allscreens_flags}" ]; then + echo -n ' allscreens' + for ttyv in /dev/ttyv*; do + vidcontrol ${allscreens_flags} < ${ttyv} > ${ttyv} 2>&1 + 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 '.' +} |