From 7f281908524cd9f73f405099947ab38ca6ec8365 Mon Sep 17 00:00:00 2001 From: kettenis Date: Mon, 28 Mar 2022 18:53:40 +0000 Subject: [PATCH] Running getty(8) on /dev/console when using a glass console interferes with 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 | 9 +++++++-- distrib/miniroot/install.sub | 5 +++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/distrib/arm64/ramdisk/install.md b/distrib/arm64/ramdisk/install.md index 2fe08eb030c..abd5fdfdc1b 100644 --- a/distrib/arm64/ramdisk/install.md +++ b/distrib/arm64/ramdisk/install.md @@ -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) ;; diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 379671e7b6a..6c58c01a668 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -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 @@ -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 -- 2.20.1