From nobody Mon Oct 03 16:09:44 2022 X-Original-To: dev-commits-src-main@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 4Mh5Q05nnYz4d5sN; Mon, 3 Oct 2022 16:09:44 +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 4Mh5Q03rwKz3Ktc; Mon, 3 Oct 2022 16:09:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664813384; 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=O6dPb+BRP0RrP93G+mkB82/9RIP6PUe5AmSN5l3jnWg=; b=JlRKtDVZ2sB2eBT99VRnAAQRKqeL5kq+FwY3WE2a/AZyQiiy4/DgHvumBc6R5K3ahaknce NO3MCN46zCA/GuBmcXu77nnPg8LOSIOh9OEe5Q6m4ycPS/NkO7iaHPyl3rGYfEMLxlQuqx 3JTj0VviC0jIpDUeiDyjAexzjBCtfedaq+Xd86IMO3ImtVzP0duH8YmQ8n4UfzyM+tqBhv Wnbc/71pDMqvn4tPGyyph500/K1QGCf4KO/KaYBPNnA8mrSDdPIbpi5na8S3ISeOP7gieI SST8HlRFtRzik9SW316IuwOcddnvyapMyfZ9ZiOUVZxNdvBOqY5WXnvG8EUR1Q== 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 4Mh5Q02YQYzG7b; Mon, 3 Oct 2022 16:09:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 293G9iZP022615; Mon, 3 Oct 2022 16:09:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 293G9iJs022614; Mon, 3 Oct 2022 16:09:44 GMT (envelope-from git) Date: Mon, 3 Oct 2022 16:09:44 GMT Message-Id: <202210031609.293G9iJs022614@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: a09af1b7fd95 - main - bsdinstall release: Start installer on multiple consoles List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a09af1b7fd95d9479954c5b8e96a126cad468424 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664813384; 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=O6dPb+BRP0RrP93G+mkB82/9RIP6PUe5AmSN5l3jnWg=; b=KX3b5LB1YfUOi7v+uI5Jp+H1DjC0Fxl0vjaBd0hZ6gwCg2HNzfA4jGd+3z3XGtBVDZEDTw Sc65Mgwh6qFIzh0z8vIZszf7PTak+Hh4sgIvx+6PZQY/ZoS+mdtQ453KlQ/a42C2LN9dN0 c51GJI4RDz3u6BDkpiuivQEYYWVugaSyyKQk+B2aGb/VVnLFJXdReDZDrD/82z3qkJ4ddS u555LUTA6YT7UHDp3BvfXv7Z01VIrQikUzHiinw3/RdW33KVjiaDryILGe0srV0DIVDe43 jaw97udhLU20iLf1Ro0iJIhWGplzUFWZa+MeIboxxvvjXkEqmGlWq2aTZ3Zvcg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664813384; a=rsa-sha256; cv=none; b=NqztrxgG9xnX8hTB4ymdlm+OXttlGtPz5A1UoRhnZM4n1qDBLz58DaqHMFsbzXk8aEHRT6 HjME3U4LilyBs8qdhbm9cAcuFIV+cdmQWm0u5GiqR5IgdI7DULwPBZmf4eBi2igfbYavfq YM9Z0z2v69XJAXPM4Wz8qh12lEGDl94WsIzgDtBNA81b01BfWdc9nqP7D/2vwGC32Sheu2 OzBJ5gOWveP9SyxTpyuOXBYVsjQqa4JCvV+rT0hKk9tbqsyw2E27YNd1pdGgQkhcpxDfMH h11s+mFdPgN87TW/isu6FFUdO0nlQcJfAqVNGxaciMb16YxSf6+BFijuu7PPEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=a09af1b7fd95d9479954c5b8e96a126cad468424 commit a09af1b7fd95d9479954c5b8e96a126cad468424 Author: Jessica Clarke AuthorDate: 2022-10-03 16:09:17 +0000 Commit: Jessica Clarke CommitDate: 2022-10-03 16:09:17 +0000 bsdinstall release: Start installer on multiple consoles Currently the installer is only started on the primary ("high level") console. For systems where this is the video console and serial consoles aren't of interest, and headless systems with just a serial console, this works just fine, but for systems where both video and serial consoles are present and meaningful this requires the user to select the right primary console in loader, with the poor user experience of the system appearing to hang if they leave the wrong one selected. This notably differs from our multi-user behaviour of spawning getty on every console, where the only issue with selecting the wrong primary console is a quieter boot process until the login prompt appears (or the system crashes). Instead, use the newly-added runconsoles helper to run the installer on every console (except for ttyv*, where only ttyv0 will be used). For interactive installations, any of the consoles can be used, though only one should be used at a time as no effort is made to avoid multiple installations running at the same time clobbering each other. If the Live CD option is selected, the other installers (which should, if the user is well-behaved, be sitting at the welcome screen) will be killed. If an automated install is in use, the primary console will be used to display its output, and the others will direct the user to the primary console. Reviewed by: brooks, gjb Differential Revision: https://reviews.freebsd.org/D36805 --- release/rc.local | 54 +++++++++++++++++++++++++++++++++++-- usr.sbin/bsdinstall/startbsdinstall | 5 +++- 2 files changed, 56 insertions(+), 3 deletions(-) diff --git a/release/rc.local b/release/rc.local index 943c175ddd52..a2c1676313c5 100755 --- a/release/rc.local +++ b/release/rc.local @@ -1,7 +1,57 @@ #!/bin/sh -# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2022 Jessica Clarke +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +bsdinstall_multicons_disabled() +{ + local var value + + var=bsdinstall.multicons_disable + value=`kenv -q $var` + case "${value:-NO}" in + [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) + return 0 + ;; + [Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0) + return 1 + ;; + *) + warn "$var is not set properly, ignoring" + return 1 + ;; + esac +} # resolv.conf from DHCP ends up in here, so make sure the directory exists mkdir /tmp/bsdinstall_etc -/usr/libexec/bsdinstall/startbsdinstall +if bsdinstall_multicons_disabled; then + /usr/libexec/bsdinstall/startbsdinstall primary +else + echo + /usr/libexec/bsdinstall/runconsoles /usr/libexec/bsdinstall/startbsdinstall % +fi diff --git a/usr.sbin/bsdinstall/startbsdinstall b/usr.sbin/bsdinstall/startbsdinstall index 3a5a07e85b4d..0a8207df9bd8 100644 --- a/usr.sbin/bsdinstall/startbsdinstall +++ b/usr.sbin/bsdinstall/startbsdinstall @@ -45,7 +45,10 @@ export TERM resizewin -z if [ -f /etc/installerconfig ]; then - if bsdinstall script /etc/installerconfig; then + if [ "$1" != "primary" ]; then + bsddialog --backtitle "FreeBSD Installer" --title "Installing" --msgbox "FreeBSD is being installed from a script; please use the primary console." 0 0 + . "$0" + elif bsdinstall script /etc/installerconfig; then bsddialog --backtitle "FreeBSD Installer" --title "Complete" --no-cancel --ok-label "Reboot" --pause "Installation of FreeBSD complete! Rebooting in 10 seconds" 10 30 10 reboot else