From nobody Wed Feb  7 00:14:43 2024
X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
	by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TV0wz4N4Dz5BFZ0;
	Wed,  7 Feb 2024 00:14:43 +0000 (UTC)
	(envelope-from git@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256
	 client-signature RSA-PSS (4096 bits) client-digest SHA256)
	(Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK))
	by mx1.freebsd.org (Postfix) with ESMTPS id 4TV0wz3qD0z41QS;
	Wed,  7 Feb 2024 00:14:43 +0000 (UTC)
	(envelope-from git@FreeBSD.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1707264883;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding;
	bh=enmlJ3ZFwct9AGLL5CbQ7tkrtQ5z7yH3o9sb5TdncRo=;
	b=JgooPWHve6f5wI7HgA512cFUxPHPYlH37J9dmZjyCD9JKl3Vlz8dv6Ymda1wl1xI8Fe4aE
	mlFp6sjJn/h0IYaI/6mY8D2P07cqVkfY9Uzk8Ficz+SnXxBsOJ/aQWkfLPSM+0PrroiKHs
	iOeWMiCP9OaqT+sHugUsrWV5PFBf6M2Hv2IQPhoLKY0PuOxywGrUCZpRw2sKgkPwol9Fal
	lDSh2ap6PSmrwPLJyDEDRjjWVe4uzJdkH4R7DRziGwcjqA8c1q6XIk7QUH7TsZai37gqXF
	7bAfJr7MUxDeqVcG2OJxu/4GpVONDefkb1rir9y1uR6+tRmRNCjVTU1bn5wlvQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1707264883;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding;
	bh=enmlJ3ZFwct9AGLL5CbQ7tkrtQ5z7yH3o9sb5TdncRo=;
	b=sDxBSLvDrgEjEnZBwB0oxZ1Rxzj0ZOv0MdWhDF1Nk11KyQxgqb38pUrGVjTp9UxMR3zd1u
	QbsSnpMj7/s7D3Jvu4V3d0uqeJztwlNVzi8bc8l4J9rpVB3FOZf8ezJrG7G6XsbkMSbERR
	kR7E9AOe6YLW5PfUkNCsmsdSOL6GsUELCMOEmOzY9pESdyWcygFN5CLMmMdT1Lx1uErUsd
	XCsJGoQvvKdz84OXQ70+6FCd5z4QmeH6hUcVggWpfUbvTTHP7OYjYKBTvbY20o4T+Wavfm
	zpTznBv/iyST0BmJU9vJXIq0HXPIfbm5gTxc9r7e+TSEXEbUSaFu0TcIhjECXw==
ARC-Authentication-Results: i=1;
	mx1.freebsd.org;
	none
ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707264883; a=rsa-sha256; cv=none;
	b=Mj4qBOYM6fLq9SeAWGNP56LIVvktfPE2MR7o0Lt7Wvvi43nu5X6FtQFhR0X6ydZVlJ8M4n
	+7Peus/rqYnwwSZ30fvfOqYkE/tFs4OJf9kmyTmG2ShMyXVJidsVgYHLqoFux1Bh1H/+yx
	IC161pKRrlOLhb5YTmt09S6SNP8CTTjeh77A5/qvSDkJ00heqegRZ4FQbPV16lcRywkjw+
	XZz3VtOqtEFkp0a9Tt2OMZklMtBgz27JZRMULI7VJWgw1kCYut4jWna+lA5K5Xqgsce1bs
	l7hD+JLv4WLV41MPk2NRxMydcJeBXvogwgFMnTIzf2dre3894Y8M8p1IBEdXMA==
Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(Client did not present a certificate)
	by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TV0wz2tVqzlMf;
	Wed,  7 Feb 2024 00:14:43 +0000 (UTC)
	(envelope-from git@FreeBSD.org)
Received: from gitrepo.freebsd.org ([127.0.1.44])
	by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4170EhG5056085;
	Wed, 7 Feb 2024 00:14:43 GMT
	(envelope-from git@gitrepo.freebsd.org)
Received: (from git@localhost)
	by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4170Ehw8056082;
	Wed, 7 Feb 2024 00:14:43 GMT
	(envelope-from git)
Date: Wed, 7 Feb 2024 00:14:43 GMT
Message-Id: <202402070014.4170Ehw8056082@gitrepo.freebsd.org>
To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org,
        dev-commits-src-branches@FreeBSD.org
From: Warner Losh <imp@FreeBSD.org>
Subject: git: 9d2f548bbebd - stable/13 - loader: For EFI, if we
  don't have ConOut, try ConIn
List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org>
List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all
List-Help: <mailto:dev-commits-src-all+help@freebsd.org>
List-Post: <mailto:dev-commits-src-all@freebsd.org>
List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org>
List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org>
Sender: owner-dev-commits-src-all@freebsd.org
X-BeenThere: dev-commits-src-all@freebsd.org
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Git-Committer: imp
X-Git-Repository: src
X-Git-Refname: refs/heads/stable/13
X-Git-Reftype: branch
X-Git-Commit: 9d2f548bbebdd4ecac1d9d75cdff82f84119984d
Auto-Submitted: auto-generated

The branch stable/13 has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=9d2f548bbebdd4ecac1d9d75cdff82f84119984d

commit 9d2f548bbebdd4ecac1d9d75cdff82f84119984d
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-02-04 21:09:48 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-02-07 00:12:40 +0000

    loader: For EFI, if we don't have ConOut, try ConIn
    
    Try ConIn if we don't have a ConOut variable. ConIn will contain HID
    devices and/or serial devices. We currently just search for serial
    devices and will use them instead of video with the current code. While
    ConIn w/o ConOut is fairly common on laptops, is kinda rare on servers.
    Some refinement may be needed in the future if servers come to
    light. This is also minimal to allow possible integration into 13.3
    release.
    
    MFC After:              1 week
    Sponsored by:           Netflix
    Reviewed by:            dab, tsoome
    Differential Revision:  https://reviews.freebsd.org/D43714
    
    (cherry picked from commit 064fa628ce375028f2510182f4edbafa7f469ecb)
---
 stand/efi/loader/main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c
index 3aee6cd3eb8e..e8a5b738aef9 100644
--- a/stand/efi/loader/main.c
+++ b/stand/efi/loader/main.c
@@ -724,7 +724,10 @@ setenv_int(const char *key, int val)
  * Parse ConOut (the list of consoles active) and see if we can find a
  * serial port and/or a video port. It would be nice to also walk the
  * ACPI name space to map the UID for the serial port to a port. The
- * latter is especially hard.
+ * latter is especially hard. Also check for ConIn as well. This will
+ * be enough to determine if we have serial, and if we don't, we default
+ * to video. If there's a dual-console situation with ConIn, this will
+ * currently fail.
  */
 int
 parse_uefi_con_out(void)
@@ -743,6 +746,8 @@ parse_uefi_con_out(void)
 	rv = efi_global_getenv("ConOut", buf, &sz);
 	if (rv != EFI_SUCCESS)
 		rv = efi_global_getenv("ConOutDev", buf, &sz);
+	if (rv != EFI_SUCCESS)
+		rv = efi_global_getenv("ConIn", buf, &sz);
 	if (rv != EFI_SUCCESS) {
 		/*
 		 * If we don't have any ConOut default to both. If we have GOP