From nobody Tue May 12 14:13:55 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 4gFJVX0Lzvz6cFfY for ; Tue, 12 May 2026 14:13:56 +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 4gFJVW67lQz3KN0 for ; Tue, 12 May 2026 14:13:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778595235; 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=fsQAbidLCr8uZMYnTeFIsM6G3L/RuZw7LFMIdXxY2go=; b=oNElQJwvwa5lEEawsAYVLMGRhrEwpL++ySAy85VpjLK2SOBi9Z9uq8du7b79IxsKifkfHo ky643oj7TYR1pTvlbEgHYTkOy8/f0lV+EglbaMv2CszAcZj9zoOl1eGJCP3K2VdaQTFVCg o+3eey8nQvu8fD/X/4p2nASwuoeMRCpMBO8ecigqBTo/BsGZYJXRxQRL94oW/HUOfHBQ+a 3Fv3HjQII3/oPKRpxb9uSBCF3XvZlAjak9LRgktg1+VINMhifhATQxvjEwU9ZH5w17NybC leCbM/NKg4KXCfl0JnrPqy1F6hagCAsLke0CRuOSdSoKsrYhwMS7TKWvdlP3zg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1778595235; a=rsa-sha256; cv=none; b=S4zBFHikvzM3ov1i9O/r1QAQGcOg7CzbCPG9gLRCSW+xJInyn2CjeGfrH6a200MLVk5QoW TxtIzHPFiT0jXtRQ1xQxCvsMg6el+Hb6fGfWjuSmRWEgQqGOxaxEdAXw6DLKFVcGD96Xhm S+1MpxGx1fHGoW4i5QDReC6+RY/oXDL3OkxIdivqBQHEGg1pWbJPCjX0FsP325Rdp/L44G jPQZ3RaiMn6z9kcDMWG0Fqk7ZbZ5Do/O0Yvf8yUAuvNo3cbgk2Ux3Ub0wrklpgwHnG1Inj ShR2Spk2B5eEOfcWiFArypEyHIm046PnQvEKJAHQ15fdm/1oswAnlf1TuJargA== 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=1778595235; 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=fsQAbidLCr8uZMYnTeFIsM6G3L/RuZw7LFMIdXxY2go=; b=wZnHotJWkGMCMnnslTSICbTUU8HWV5DMkO8SMQDm794cu/J5kmk3AJb9vFcUXrLFC6146u 72sNAryHEtTvPGYylqZbb9sY3pbOJeXh0XiYLWX4lc2b1UAK54AJay553ZpoOix603VQVt UD2s6mIU2/VrKKfAOhJfxrlU8lwW4R1m41iBu+JSyirg9KxQqvR8I5kBhBUVBe6TY93mB6 KhHcgpRt9VpbotGeGFALBS781afnHCkO8z6bo1FPfISsTawcvFMOTcctj+l+10CgPtCxqb UXalzjD+bwNNXX3hidOMLIxdQh7dY5voyD1XEPQdBdXgLSERSpGlkZ83zjLv5w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gFJVW5kgRz15nc for ; Tue, 12 May 2026 14:13:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25016 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 12 May 2026 14:13:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: dc14ae4217a0 - main - 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/main X-Git-Reftype: branch X-Git-Commit: dc14ae4217a0babb1240f813b642edc2d7b955a6 Auto-Submitted: auto-generated Date: Tue, 12 May 2026 14:13:55 +0000 Message-Id: <6a0335a3.25016.6508a60e@gitrepo.freebsd.org> The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=dc14ae4217a0babb1240f813b642edc2d7b955a6 commit dc14ae4217a0babb1240f813b642edc2d7b955a6 Author: Alan Somers AuthorDate: 2026-04-28 17:27:17 +0000 Commit: Alan Somers CommitDate: 2026-05-12 14:13:16 +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. MFC: 1 week PR: 290375 Sponsored by: ConnectWise Reviewed by: ziaee, ivy, jduran Differential Revision: https://reviews.freebsd.org/D56717 --- 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 c60143c6184e..58d12856c581 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 16.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20260512: + "bsdinstall script" will now do a pkgbase installation by default. To + revert to the legacy distset installation, set "DISTRIBUTIONS" in + your installerconfig. + 20260412: The /etc/rc.d/NETWORKING script no longer provides the legacy NETWORK alias. Third-party or local RC scripts that still use 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