Running getty(8) on /dev/console when using a glass console interferes with
authorkettenis <kettenis@openbsd.org>
Mon, 28 Mar 2022 18:53:40 +0000 (18:53 +0000)
committerkettenis <kettenis@openbsd.org>
Mon, 28 Mar 2022 18:53:40 +0000 (18:53 +0000)
running Xorg in a way that isn't fully understood.  So change the arm64
install.md to munge /etc/ttys to enable the ttyC0 entry if we detect that
wsdisplay0 is the console and make sure the code in install.sub that
does the actual munging disables the console entry before enabling another
entry to prevent running two getty(8) processes on (effectively) the same
device.

ok deraadt@

distrib/arm64/ramdisk/install.md
distrib/miniroot/install.sub

index 2fe08eb..abd5fdf 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: install.md,v 1.29 2022/03/22 15:38:27 kettenis Exp $
+#      $OpenBSD: install.md,v 1.30 2022/03/28 18:53:40 kettenis Exp $
 #
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -190,8 +190,13 @@ md_congrats() {
 md_consoleinfo() {
        local _fw
 
-       CTTY=console
        DEFCONS=y
+       case $(scan_dmesg '/^\([^ ]*\).*: console.*std.*$/s//\1/p') in
+       wsdisplay0)
+               CTTY=ttyC0;;
+       *)
+               CTTY=console;;
+       esac
        case $CSPEED in
        9600|19200|38400|57600|115200|1500000)
                ;;
index 379671e..6c58c01 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/ksh
-#      $OpenBSD: install.sub,v 1.1192 2022/02/06 11:29:18 visa Exp $
+#      $OpenBSD: install.sub,v 1.1193 2022/03/28 18:53:40 kettenis Exp $
 #
 # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback
 # Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org>
@@ -2774,7 +2774,8 @@ apply() {
 
        if [[ $DEFCONS == y ]]; then
                cp /mnt/etc/ttys /tmp/i/ttys
-               sed     -e "/^$CTTY/s/std.9600/std.${CSPEED}/" \
+               sed     -e "/^console/s/on  secure/off secure/" \
+                       -e "/^$CTTY/s/std.9600/std.${CSPEED}/" \
                        -e "/^$CTTY/s/std.115200/std.${CSPEED}/" \
                        -e "/^$CTTY/s/unknown/vt220     /" \
                        -e "/$CTTY/s/off.*/on secure/" /tmp/i/ttys >/mnt/etc/ttys