From nobody Fri Dec 19 15:32:15 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 4dXs3N52GFz6LtQ3 for ; Fri, 19 Dec 2025 15:32:16 +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 4dXs3N0TPjz3YyR for ; Fri, 19 Dec 2025 15:32:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158336; 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=gEkXAhjLvQ28fDvTGuQjByWAy3hdFqnSMPQx+8ycFrA=; b=rT0V0Czj4UtEW2Zd6Fw99eepM4yjcv74FPGUrLELdMOi5oVm7FcuGXuZq46jQFEl4erfOE Jrkv4+txa+Fokwvwa8UmSVgfXMzfiohARinjEBC4Jy3T5eF48MnKnm69w3TKELwkBlr6aA r6Ux/b6U/aj75eiQmyH6QzaYADsxyXs/Ora44woDd3efPJO7/mf1kFr17XtvXmTl34tXJA wZPU4cu/JFBnGyEDA9IwylJlZApXZpO7sJQobCcGqc9Fi3WpFU/7i672dUjSCqITc43ate usU7sfR09Rg4IomxHZ4Nm/VN+IX3XHJF7+Gqujmyp9tylae14fxhuJXcn0/2bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158336; 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=gEkXAhjLvQ28fDvTGuQjByWAy3hdFqnSMPQx+8ycFrA=; b=HgRb9m9brNgdp9qcvMjAiPCLeQ9DqehqTId+7mucfGJovkDDKSiCIA1/BYWDiUMXVowL/s hkzQeNiYATE8KlJunXhxsfAH2BuXqLKabFdBmXTU5hcgtwO9CSkoI6xAXTksQhp+4XGMSq DfGwTZYC0f4f+Pe4MvfL24cXcIBTbuCM/FKZDV16zC0ZSGzrr60C4LESWu1qg5ZgXlVUkq BhAhIUcJAdIP28VvUjqzZaiTlVQBeAw5XrUQmm+E6j7l91hWpoAPKgFO3EAMEDh0khr1Ht 9CjWP1EEWcjPX2K0N6EfyFnRmHkswURalW+WZ32x+BmIZ1xnkLezAHj2wPBdaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766158336; a=rsa-sha256; cv=none; b=dlWgTw8EdjaV1OxCo7452gSi3O6GfX5R+NF4ul9Qk670op6XQP5q9t/qLMKzcKZgQRU5L2 YXTZiFfdwpHRSQKJVfbJBXZWMGDWG0vVLtP7hGFk34LDtZanCqwUtLFczUMENwm76rl2zK yZoPnVqAHDohVXHZLE8c34JbNSwOEUHZ9UDPtKEQHXunQE+eiaGnQiI4Bm+32twosSZ8D7 JyYPo40wHsn/yHsd96ZEd/nx+qZxBlc8N6coDtHa7uDo88pWpw+m4dPyDWvGOXXuNlWRm9 huPy8B1tluOLURZgF9mjMLtyfNlcuG6enM4wqKTB1FCO70SB2/Pz9TH+bpSIeQ== 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 4dXs3N03NMzHM for ; Fri, 19 Dec 2025 15:32:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 434d6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 15:32:15 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 444d2f9e2152 - stable/15 - 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/15 X-Git-Reftype: branch X-Git-Commit: 444d2f9e21521f5ff29f518a357a22a81c9d03d5 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 15:32:15 +0000 Message-Id: <69456fff.434d6.77051938@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=444d2f9e21521f5ff29f518a357a22a81c9d03d5 commit 444d2f9e21521f5ff29f518a357a22a81c9d03d5 Author: John Baldwin AuthorDate: 2025-12-08 21:33:30 +0000 Commit: John Baldwin CommitDate: 2025-12-19 15:19:44 +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 7cf742616e63..df51f6955d2d 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -434,6 +434,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 4fd59e49d506..92a455d8e9e3 100644 --- a/usr.sbin/bsdinstall/scripts/Makefile +++ b/usr.sbin/bsdinstall/scripts/Makefile @@ -16,6 +16,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 5fefc07e4c07..2204b33ae105 100755 --- a/usr.sbin/bsdinstall/scripts/auto +++ b/usr.sbin/bsdinstall/scripts/auto @@ -405,6 +405,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