From nobody Wed May 13 19:31:32 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 4gG3VX44kyz6ctWs for ; Wed, 13 May 2026 19:31:32 +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 4gG3VX3WP2z3S8w for ; Wed, 13 May 2026 19:31:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778700692; 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=rPChTGNA8D/vsCxJxy0DBKzOMSqCmOQHQ/g+S+lrM9M=; b=fJQPuS6gVt6CCIJQQjluC/SLbs4CLdN8vSwFaMGZwh3jBY9Fik6DW3IpKPMK40hZ4e2/Jt ExB7xMNnowGSvDICtgfC6Sl8l/IXnw9CwXj+37Fn+hl7T0XtlRNkcezi9pUVnBuA+J563B gv0VT2EbBYAetux7ArpzuT6qgeh9hxFoTyQ/HpxY4W7pxN64jnDaeIr45/q0C3KzyhJL3d oJWmANONscRHlkzaE2IukR/lk85yGbB+Ww6L+svgDodMuKV+PpKivmnwUXMlRY2+/Qn4v3 w7FPNVeavTMPQ3s5+xbwcBVjyG6hIcRFhlAWkzTfrHrlKigYtglgnJafR7cSnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1778700692; a=rsa-sha256; cv=none; b=rmt7iFut7J4XMRCn3bq3JdqMmLeuLqUZhOQdBhh55ifVeXB6sIQEWFnCmZIrLhsKSvekO/ LF/XG3TtEyDGr7eFfbzvm0uQz7saZGSt1+Z6bnWms7OKg4iGHwVU398f6wcxNVzI465xW1 5n3inB8aKeVj0IAtd8GH6WePIp25tEGr3ldXblqK9UXtv7Z/REqMraTKz/d17CI9JxU+h1 YaloltTb2iT94iE7jRk+THaf163+xCndCgIPRqU9L8Vy9oVZMeRS2p3a4HEzBNSVg2QuWK kc4owOQqHjGfKFSGzIQCdb4D9DsdyeCgyFDR956KEseAJWoMNqydHMLBmX2g8w== 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=1778700692; 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=rPChTGNA8D/vsCxJxy0DBKzOMSqCmOQHQ/g+S+lrM9M=; b=xD1BmV4orCrhdTjsfG5paJ00Wgv8EiG+kQgHlerkHG8CE8l1Czle5b/DFGoHLc7BAMSb0u yF+zj77qhQKB03sYWA/FUn7EG3TCwjh+CN0zzPivVH1nMUhW3Kq2Jutri1tbZwK4dVdIvw dYHis/NKbfKaAg8USkFobDIX0UrKm6JpGJU6FbhWOHN5Z+LUAft9Mgy4xbXDwAtOHVUb2P UicZeG/gL4dUma/0fagqXhAbsazsbfqdQtc/ib+joFIngoMYxDV3WBL1sbGinTZpRivmdO pUFuOSOeDR+UHda98anTUSnvh18JPY41Qy2qi7W+ghP88O8dDe9WGbgMHTIkgg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gG3VX325pz13rG for ; Wed, 13 May 2026 19:31:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26ce0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 13 May 2026 19:31:32 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 1f5869130f6e - stable/15 - 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: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 1f5869130f6ebd299e65a627eff23a8c3d360afb Auto-Submitted: auto-generated Date: Wed, 13 May 2026 19:31:32 +0000 Message-Id: <6a04d194.26ce0.d7af0b5@gitrepo.freebsd.org> The branch stable/15 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=1f5869130f6ebd299e65a627eff23a8c3d360afb commit 1f5869130f6ebd299e65a627eff23a8c3d360afb Author: Alan Somers AuthorDate: 2026-04-28 17:27:17 +0000 Commit: Alan Somers CommitDate: 2026-05-13 19:27:34 +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. PR: 290375 Sponsored by: ConnectWise Reviewed by: ziaee, ivy, jduran Differential Revision: https://reviews.freebsd.org/D56717 (cherry picked from commit dc14ae4217a0babb1240f813b642edc2d7b955a6) --- 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