From nobody Fri Dec 19 15:32:43 2025 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 4dXs3v6cKGz6LtWr for ; Fri, 19 Dec 2025 15:32: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXs3v4Xchz3Zmv for ; Fri, 19 Dec 2025 15:32:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158363; 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=f+x6X03FkSkwvBGG8T0FtLWEANfNZZqQ1umoJ0450Vo=; b=rGYmpHoJWlqpbkx+FUldfyzh1y++FuPLDLMLgGKN0eS1JXaG6RFiT4qGNzlBUo6e2u/n5+ f4Ku/9IL8F4S9aSrdlovheJ/dHpuOExosOyRKlagDNrLklOW8Tz5XFy8kyrqrOffacVaml CFdBJ15jv7RChTn5ohhFvMZFBJW1Acny8tVSGD2meXKRcQxoRUyt/1bejh7Xyx8D8aDqR5 jz2pzQvOqFaitnGWTos28iInP01X3788mty5o7YFHhq0TrA3X27ARErI6jwCRVYo00okK/ vK/EXIrF1XfBdJfVgegxMDn76d+PUQPam1dA+kKjvZmMUCfgMuqymYAQhUveMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158363; 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=f+x6X03FkSkwvBGG8T0FtLWEANfNZZqQ1umoJ0450Vo=; b=ROI2Xr9xEtx+GUWcR3tmeVUOttCE3K60F3Ym15q33QAZG5aVNk119Gj0awkHktijMksoSz AEgxURA+VF6C+M2oPoWKQpNebSI/4av6sBvb11cY7DG4mw/9kVO2/J9gz1J8Dt4grJjnz8 T9z3XLMfTJ9ZuFlcBzQA2qphr8VZHTWOSGojg54s6Z2TecakzltN279Z6VI5EJpZw5DSvq gXVC/C+lXKWTH6ZfiBEREKM1/uzBq1YLb5ze7RQAgXXzlRy9drK3KPqGDw74aFcAKNY00I Wb6+4NRbqcuCKz+u02v2iEOHRMJHtiQwReA2NtciwpqWcK4s2SVEjJQBentt0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766158363; a=rsa-sha256; cv=none; b=VHO0Rba9w00YULyb8ELEGE38C1lzAjPUoJSCJzIFkNSXwQRjcXgSl5O0rkKJ0rgjsF57W5 k8E08h/fWMICPlZjTZqTdOy+qqPf7mlyGlQakqN7DEjJ4GoxVLGuXeS4QJc7At+aaTnEyz wvwEIF3/4dlUv6bf4TleIBGd4QzkUSjFuE7hKQUwy9dBGPIj0sL3g7sM4IS9j9D+5xBCJh 8Qdsd3+FUY82cLsmbdooYvY7r9+tbhPEU5ms5Q4eJSmPIwrgbKFE5WgWgadfogET44D5Sa c1nb4Mt+/WiVc5PkwoutAdh9kqewYq1QUpy+Fusg/DNqgyfSlIagNDLYiqikyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dXs3v459yz1S6h for ; Fri, 19 Dec 2025 15:32:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 44e91 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 15:32:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: be89c92739ed - stable/14 - bsdinstall: Mount /dev and /packages after using the shell to partition disks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: be89c92739ed6063df479bc21b6d9acce133e78c Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 15:32:43 +0000 Message-Id: <6945701b.44e91.243c19f8@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=be89c92739ed6063df479bc21b6d9acce133e78c commit be89c92739ed6063df479bc21b6d9acce133e78c Author: John Baldwin AuthorDate: 2025-12-08 21:33:30 +0000 Commit: John Baldwin CommitDate: 2025-12-19 15:19:41 +0000 bsdinstall: Mount /dev and /packages after using the shell to partition disks Normally after partitions are created by the installer, the 'mount' script is used to mount the target disk partitions under /mnt. The tail end of this script also mounts a couple of additional filesystems under /mnt so that chrooted programs can work such as devfs and /packages. When the "Shell" option is used to permit the user to manually mount the destination filesystem, the "mount" script is not used as the user is instructed to mount the target filesystems and construct /mnt/etc/fstab, etc. However, this means that the user is responsible for mounting devfs (which is not included in /etc/fstab) and /packages as well. The help message for the "Shell" option doesn't mention these requirements, so users may not know to do so. This can lead to confusing errors as chrooted commands can fail to find needed /dev entries. For example, running fwget to fetch wireless firmware fails because /dev/pci doesn't exist. To make this less painful for users using this option, split out the bottom half of the 'mount' script that mounts these non-fstab-related filesystems into a separate 'mount_aux' script. Invoke 'mount_aux' after using "Shell" to create the filesystem to ensure that these filesystems are always present. PR: 290901 Reported by: Peter Tested by: Peter Differential Revision: https://reviews.freebsd.org/D53770 (cherry picked from commit f63a8c0a0915a3eceac179d4d18b2c03b1319fa2) --- tools/build/mk/OptionalObsoleteFiles.inc | 1 + usr.sbin/bsdinstall/scripts/Makefile | 1 + usr.sbin/bsdinstall/scripts/auto | 1 + usr.sbin/bsdinstall/scripts/mount | 10 +------- usr.sbin/bsdinstall/scripts/mount_aux | 39 ++++++++++++++++++++++++++++++++ 5 files changed, 43 insertions(+), 9 deletions(-) diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index e7e723916296..42514dc61b8c 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -420,6 +420,7 @@ OLD_FILES+=usr/libexec/bsdinstall/jail OLD_FILES+=usr/libexec/bsdinstall/keymap OLD_FILES+=usr/libexec/bsdinstall/mirrorselect OLD_FILES+=usr/libexec/bsdinstall/mount +OLD_FILES+=usr/libexec/bsdinstall/mount_aux OLD_FILES+=usr/libexec/bsdinstall/netconfig OLD_FILES+=usr/libexec/bsdinstall/netconfig_ipv4 OLD_FILES+=usr/libexec/bsdinstall/netconfig_ipv6 diff --git a/usr.sbin/bsdinstall/scripts/Makefile b/usr.sbin/bsdinstall/scripts/Makefile index cbe190d85f12..b13a69184b9b 100644 --- a/usr.sbin/bsdinstall/scripts/Makefile +++ b/usr.sbin/bsdinstall/scripts/Makefile @@ -14,6 +14,7 @@ SCRIPTS=auto \ keymap \ mirrorselect \ mount \ + mount_aux \ netconfig \ netconfig_ipv4 \ netconfig_ipv6 \ diff --git a/usr.sbin/bsdinstall/scripts/auto b/usr.sbin/bsdinstall/scripts/auto index 4d16dec6ac5a..71be4ae953a2 100755 --- a/usr.sbin/bsdinstall/scripts/auto +++ b/usr.sbin/bsdinstall/scripts/auto @@ -366,6 +366,7 @@ case "$PARTMODE" in clear echo "Use this shell to set up partitions for the new system. When finished, mount the system at $BSDINSTALL_CHROOT and place an fstab file for the new system at $PATH_FSTAB. Then type 'exit'. You can also enter the partition editor at any time by entering 'bsdinstall partedit'." sh 2>&1 + bsdinstall mount_aux || error "Failed to mount auxiliary filesystems" ;; "$msg_manual") # Manual if f_isset debugFile; then diff --git a/usr.sbin/bsdinstall/scripts/mount b/usr.sbin/bsdinstall/scripts/mount index fd13e13c6a77..a432ccd5dfe5 100755 --- a/usr.sbin/bsdinstall/scripts/mount +++ b/usr.sbin/bsdinstall/scripts/mount @@ -52,12 +52,4 @@ for i in $FILESYSTEMS; do fi done -# User might want a shell and require devfs, so mount it -mkdir $BSDINSTALL_CHROOT/dev 2>/dev/null -mount -t devfs devfs $BSDINSTALL_CHROOT/dev - -# If installing from the DVD, mount packages where they'll be accessible -if [ -d /packages ]; then - mkdir -p $BSDINSTALL_CHROOT/dist/packages - mount -t nullfs /packages $BSDINSTALL_CHROOT/dist/packages -fi +bsdinstall mount_aux diff --git a/usr.sbin/bsdinstall/scripts/mount_aux b/usr.sbin/bsdinstall/scripts/mount_aux new file mode 100755 index 000000000000..21def9b6e8c0 --- /dev/null +++ b/usr.sbin/bsdinstall/scripts/mount_aux @@ -0,0 +1,39 @@ +#!/bin/sh +#- +# Copyright (c) 2011 Nathan Whitehorn +# All rights reserved. +# +# 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. +# + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 + +# User might want a shell and require devfs, so mount it +mkdir $BSDINSTALL_CHROOT/dev 2>/dev/null +mount -t devfs devfs $BSDINSTALL_CHROOT/dev + +# If installing from the DVD, mount packages where they'll be accessible +if [ -d /packages ]; then + mkdir -p $BSDINSTALL_CHROOT/dist/packages + mount -t nullfs /packages $BSDINSTALL_CHROOT/dist/packages +fi