From nobody Thu May 14 19:05:07 2026 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 4gGfsb6xg2z5WrTW for ; Thu, 14 May 2026 19:05:07 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gGfsb5wHMz47Kb for ; Thu, 14 May 2026 19:05:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778785507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JRJV+TT96T8kLszzKN6Nd9fBRf1d+fzYUA9nK0L9ncc=; b=kp/wkL0MZaux2N9lQ/5WtTtNsmQSEGGGE1nQa53Wo3wad75ySW1Ruczd2+FvYTHP15ZJkb C8BPM25Lb1XiXuJA6H6/LfcAQ8syIfG5Vhf6z02WeK06TMkBRVkRiCpBFyeNapI/0taUvp 1mBzjn4orqanlRtX8hFUMpccvjcw1/1W1MMgIeiqhaNiD9XpCf2G31F7wWkZvrwSsbNydU XTXCWHZSr8y1UTz2V3cRT13RKdO9NHqgdRaOxv27rpyLcaVks5M1hjoX5YMVc1Y2BAsz3K aHfcsiwnGvMkWd7msz3WzmU18jWY4KNvgfFjN2KIKmB/HF1C6v4cgzkj4JcEFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1778785507; a=rsa-sha256; cv=none; b=n6RtsC/DmOHaldhtw1FnIh2E6/ovitTKHXUow6AQGoCzFwxfrSTntBsB/i5qFF6r/5slMl +mjUBU7xdZYWrKCZWRv2UKPQyQYxY6Rl1LA9LzMI8boK6RDw3RQE4k2wA3+8mt7fMLyuP7 RCG/NL8pcmVrUzqC2Nz1KLnZ3Qn7fGY6xVO27Uywsq/VNGRLBVzWwUIO/aq8lOlcFyO+uj p+5XS1jjnemdkpyru7xCit55qhVw1V1jktzfFJpXGT8t2IhxjKZPi/64cePS/9gAsVokfC kdktxHouRS+pqDH35of4aqDmruYCkKdL1mOorljXsTDbiiTkpWZFDLzLt2aPtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778785507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JRJV+TT96T8kLszzKN6Nd9fBRf1d+fzYUA9nK0L9ncc=; b=R56xXJvPQXmiRGCgSDEB6thfZARYtgo61Nwht/89jPzx6sa/apIjBop5aTzVpKWfCvlu1O KAVnqx3kL2lPUQhfN3vS1BOeC0i/iiIhbLejE1jOzTsPY2VPhpuhyaN9BOhrZtMdRcyNhM 3NI/lejXm77Aubu0qWm4vMFRtu5KI7Odmx+fJs+zQ3O0LUkXTpXutLpXVGfvOA2Ta6tnER sS0rvOG9i6RsxRBqorwY7XlMOyer9A41Ov8zKdpOHYSfuw5bJJwQc3zfSlF9Fz04OGq/Tl xGzmfXb7Wataj5ZSrExgwwFhqnt9IkjDdbQmaHEvKH6y+9myzRy4vpOhBZC4LQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gGfsb5L1wzql3 for ; Thu, 14 May 2026 19:05:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25cda by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 14 May 2026 19:05:07 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Alan Somers From: Colin Percival Subject: git: cb7880bb0900 - releng/15.1 - bsdinstall: do pkgbase installations with the "script" command 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.1 X-Git-Reftype: branch X-Git-Commit: cb7880bb09009c977d3fb70a66b0f57f9fbe83ed Auto-Submitted: auto-generated Date: Thu, 14 May 2026 19:05:07 +0000 Message-Id: <6a061ce3.25cda.7c9c4d16@gitrepo.freebsd.org> The branch releng/15.1 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=cb7880bb09009c977d3fb70a66b0f57f9fbe83ed commit cb7880bb09009c977d3fb70a66b0f57f9fbe83ed Author: Alan Somers AuthorDate: 2026-04-28 17:27:17 +0000 Commit: Colin Percival CommitDate: 2026-05-14 19:04:21 +0000 bsdinstall: do pkgbase installations with the "script" command "bsdinstall script" will now do a pkgbase installation by default. The system components to install can be specified in the COMPONENTS variable, and have the same names as those used in the interactive installer. bsdinstall will still do a legacy distset installation if DISTRIBUTIONS is defined in the installerconfig file. Approved by: re (cperciva) PR: 290375 Sponsored by: ConnectWise Reviewed by: ziaee, ivy, jduran Differential Revision: https://reviews.freebsd.org/D56717 (cherry picked from commit dc14ae4217a0babb1240f813b642edc2d7b955a6) (cherry picked from commit 1f5869130f6ebd299e65a627eff23a8c3d360afb) --- UPDATING | 5 +++ usr.sbin/bsdinstall/bsdinstall.8 | 45 ++++++++++++++++----- usr.sbin/bsdinstall/scripts/pkgbase.in | 15 ++++++- usr.sbin/bsdinstall/scripts/script | 71 ++++++++++++++++++++-------------- 4 files changed, 95 insertions(+), 41 deletions(-) diff --git a/UPDATING b/UPDATING index 034dabc4da81..137d2aa78e6c 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,11 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20260512: + "bsdinstall script" will now do a pkgbase installation by default. To + revert to the legacy distset installation, set "DISTRIBUTIONS" in + your installerconfig. + 20260422: Bump __FreeBSD_version to 1500508 for LinuxKPI after merges of changes to eventfd and changes for DRM 6.11, as well as diff --git a/usr.sbin/bsdinstall/bsdinstall.8 b/usr.sbin/bsdinstall/bsdinstall.8 index 282b88328e99..a35c8f56ada7 100644 --- a/usr.sbin/bsdinstall/bsdinstall.8 +++ b/usr.sbin/bsdinstall/bsdinstall.8 @@ -29,7 +29,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 20, 2026 +.Dd May 12, 2026 .Dt BSDINSTALL 8 .Os .Sh NAME @@ -109,9 +109,12 @@ for more information on this target. .Pp The .Ev DISTRIBUTIONS -environment variable is set to -.Dq base.txz kernel.txz -by default for this target. +environment variable is unset by default for this target. +Instead, the +.Ev COMPONENTS +environment variable is effectively set to +.Dq base kernel kernel-dbg +for this target. .It Cm keymap If the current controlling TTY is a .Xr syscons 4 @@ -321,8 +324,17 @@ overridden when making scripted or customized installers. The directory to use for temporary files. Default: .Dq Pa /tmp +.It Ev COMPONENTS +The set of components to install for scripted installations using +base system packages, e.g., +.Dq base lib32 kernel-dbg tests . +Default: "base kernel-dbg" .It Ev DISTRIBUTIONS -The set of distributions to install, e.g., "base.txz kernel.txz ports.txz". +The set of distributions to install for traditional installations, e.g., +.Dq base.txz kernel.txz ports.txz . +If unset, then +.Nm +will install using base system packages. Default: unset unless noted otherwise in the .Sx TARGETS section. @@ -609,18 +621,18 @@ A typical bsdinstall script, using the default filesystem layout and the UFS filesystem, looks like this: .Bd -literal -offset indent PARTITIONS=DEFAULT -DISTRIBUTIONS="kernel.txz base.txz" +COMPONENTS="base debug" #!/bin/sh sysrc ifconfig_DEFAULT=DHCP sysrc sshd_enable=YES -pkg install puppet +pkg install -y puppet .Ed .Pp For a scripted installation involving a ZFS pool spanning multiple disks, the script instead looks like this: .Bd -literal -offset indent -DISTRIBUTIONS="kernel.txz base.txz" +COMPONENTS="base debug" export ZFSBOOT_VDEV_TYPE=stripe export ZFSBOOT_DISKS="ada0 ada1" export nonInteractive="YES" @@ -628,7 +640,20 @@ export nonInteractive="YES" #!/bin/sh echo "ifconfig_DEFAULT=DHCP" >> /etc/rc.conf echo "sshd_enable=YES" >> /etc/rc.conf -pkg install puppet +pkg install -y puppet +.Ed +.Pp +To install using traditional distributions sets instead of packages, set +.Ev DISTRIBUTIONS +to the list of distribution sets to install, like this: +.Bd -literal -offset indent +PARTITIONS=DEFAULT +DISTRIBUTIONS="kernel.txz base.txz" + +#!/bin/sh +sysrc ifconfig_DEFAULT=DHCP +sysrc sshd_enable=YES +pkg install -y puppet .Ed .Pp On @@ -653,7 +678,7 @@ arbitrary commands can be run here to extend the installer. In addition to the variables in .Sx ENVIRONMENT VARIABLES , in particular -.Ev DISTRIBUTIONS , +.Ev COMPONENTS , the preamble can contain a variable .Ev PARTITIONS which is passed to the diff --git a/usr.sbin/bsdinstall/scripts/pkgbase.in b/usr.sbin/bsdinstall/scripts/pkgbase.in index 89ddc244171e..2c7d6bcae904 100755 --- a/usr.sbin/bsdinstall/scripts/pkgbase.in +++ b/usr.sbin/bsdinstall/scripts/pkgbase.in @@ -180,7 +180,18 @@ local function select_components(components, options) } append_list(bsddialog_args, checklist_items) - local exit_code, output = bsddialog(bsddialog_args) + local exit_code = 0 + local output = "" + if options.non_interactive then + local env_components = os.getenv("COMPONENTS") + if env_components then + output = env_components:gsub(" ", "\n") + else + output = "base\nkernel-dbg" + end + else + exit_code, output = bsddialog(bsddialog_args) + end -- This should only be possible if bsddialog is killed by a signal -- or buggy, we disable the cancel option and esc key. -- If this does happen, there's not much we can do except exit with a @@ -300,6 +311,8 @@ local function parse_options() for _, a in ipairs(arg) do if a == "--jail" then options.jail = true + elseif a == "--non-interactive" then + options.non_interactive = true else io.stderr:write("Error: unknown option " .. a .. "\n") os.exit(1) diff --git a/usr.sbin/bsdinstall/scripts/script b/usr.sbin/bsdinstall/scripts/script index 21da2ea7c366..93d07c7899c3 100755 --- a/usr.sbin/bsdinstall/scripts/script +++ b/usr.sbin/bsdinstall/scripts/script @@ -40,6 +40,7 @@ f_include $BSDCFG_SHARE/variable.subr # PARTITIONS # DISTRIBUTIONS # BSDINSTALL_DISTDIR +# COMPONENTS # # Default name of the ZFS boot-pool @@ -97,7 +98,6 @@ awk 'BEGIN {pathb=ARGV[2]; ARGV[2]=""} /^#!/{b=1} { >$TMPDIR/bsdinstall-installscript-preamble . $TMPDIR/bsdinstall-installscript-preamble -: ${DISTRIBUTIONS="kernel.txz base.txz"}; export DISTRIBUTIONS export BSDINSTALL_DISTDIR # Re-initialize a new log if preamble changed BSDINSTALL_LOG @@ -118,37 +118,48 @@ else fi bsdinstall mount -# Fetch missing distribution files, if any -exec 5>&1 -export BSDINSTALL_DISTDIR=$(`dirname $0`/fetchmissingdists 2>&1 1>&5) -FETCH_RESULT=$? -exec 5>&- +if [ -n "$COMPONENTS" -a -n "$DISTRIBUTIONS" ]; then + error "Cannot set both COMPONENTS and DISTRIBUTIONS" +elif [ -z "$DISTRIBUTIONS" ]; then + # If COMPONENTS is set, or neither is, install with pkgbase + bsdinstall pkgbase --non-interactive +else + # Otherwise, unpack distsets -[ $FETCH_RESULT -ne 0 ] && error "Could not fetch remote distributions" + # Fetch missing distribution files, if any + exec 5>&1 + export BSDINSTALL_DISTDIR=$(`dirname $0`/fetchmissingdists 2>&1 1>&5) + FETCH_RESULT=$? + exec 5>&- -# Unpack distributions -bsdinstall checksum -if [ -t 0 ]; then - # If install is a tty, use distextract as normal - bsdinstall distextract -else - # Otherwise, we need to use tar (see https://reviews.freebsd.org/D10736) - for set in $DISTRIBUTIONS; do - f_dprintf "Extracting $BSDINSTALL_DISTDIR/$set" - # XXX: The below fails if any mountpoints are FAT, due to - # inability to set ctime/mtime on the root of FAT partitions, - # which is needed to support e.g. EFI system partitions. tar has - # no option to ignore this (distextract ignores them internally - # through a hack), and returns 1 on any warning or error, - # effectively turning all warnings into fatal errors. - # - # Work around this in an extremely lame way for the specific - # case of EFI system partitions only. This *ONLY WORKS* if - # /boot/efi is empty and does not handle analogous problems on - # other systems (ARM, PPC64). - tar -xf "$BSDINSTALL_DISTDIR/$set" -C $BSDINSTALL_CHROOT --exclude boot/efi - mkdir -p $BSDINSTALL_CHROOT/boot/efi - done + [ $FETCH_RESULT -ne 0 ] && error "Could not fetch remote distributions" + + bsdinstall checksum + if [ -t 0 ]; then + # If install is a tty, use distextract as normal + bsdinstall distextract + else + # Otherwise, we need to use tar (see + # https://reviews.freebsd.org/D10736) + for set in $DISTRIBUTIONS; do + f_dprintf "Extracting $BSDINSTALL_DISTDIR/$set" + # XXX: The below fails if any mountpoints are FAT, due + # to inability to set ctime/mtime on the root of FAT + # partitions, which is needed to support e.g. EFI + # system partitions. tar has no option to ignore this + # (distextract ignores them internally through a hack), + # and returns 1 on any warning or error, effectively + # turning all warnings into fatal errors. + # + # Work around this in an extremely lame way for the + # specific case of EFI system partitions only. This + # *ONLY WORKS* if /boot/efi is empty and does not + # handle analogous problems on other systems (ARM, + # PPC64). + tar -xf "$BSDINSTALL_DISTDIR/$set" -C $BSDINSTALL_CHROOT --exclude boot/efi + mkdir -p $BSDINSTALL_CHROOT/boot/efi + done + fi fi # Configure bootloader if needed