--- /usr/src/etc/rc.syscons Sun Aug 18 15:05:29 2002 +++ /etc/rc.syscons Sun Sep 29 16:54:35 2002 @@ -171,21 +171,40 @@ ;; esac -# set this mode for all virtual screens +# Use ${allscreens_flags) and ${allscreens_kbdflags} for all virtual terminals: # +vt_list() { + # Assume that VTs are the /dev/ttyv* devices which the shell + # redirection mechanism can successfully open; it should + # mean that the device has been kernel-configured as a VT. + for ttyv in /dev/ttyv*; do + if { : <${ttyv}; } 2>/dev/null; then + ## keep the braces to redirect the error messages + echo "${ttyv}" + fi + done +} + if [ -n "${allscreens_flags}" ]; then + # load the "vesa" kernel module if it looks like one of the "VESA" or + # "132" modes has been requested and it's not already loaded. + if [ "${allscreens_flags#VESA} != "${allscreens_flags}" -o \ + "${allscreens_flags#132} != "${allscreens_flags}" ] ; then + if ! kldstat -n vesa >/dev/null 2>&1; then + kldload vesa >/dev/null + fi + fi + # continue echo -n ' allscreens' - for ttyv in /dev/ttyv*; do - vidcontrol ${allscreens_flags} < ${ttyv} > ${ttyv} 2>&1 + for vt in $(vt_list); do + vidcontrol ${allscreens_flags} < ${vt} 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 + for vt in $(vt_list); do + kbdcontrol ${allscreens_kbdflags} < ${vt} done fi