Page MenuHomeFreeBSD

D56717.id176823.diff
No OneTemporary

D56717.id176823.diff

diff --git a/UPDATING b/UPDATING
--- a/UPDATING
+++ b/UPDATING
@@ -27,6 +27,11 @@
world, or to merely disable the most expensive debugging functionality
at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".)
+20260428:
+ "bsdinstall script" will now do a pkgbase installation by default. To
+ revert to the legacy distset installation, set "PKGBASE=no" 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
--- 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 April 28, 2026
.Dt BSDINSTALL 8
.Os
.Sh NAME
@@ -321,8 +321,13 @@
The directory to use for temporary files.
Default:
.Dq Pa /tmp
+.It Ev COMPONENTS
+The set of components to install for scripted pkgbase installations, e.g.,
+"base lib32 kernel-dbg tests".
+Default: install the minimal packages necessary for a viable system.
.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.,
+"base.txz kernel.txz ports.txz".
Default: unset unless noted otherwise in the
.Sx TARGETS
section.
@@ -457,6 +462,14 @@
If this directory does not already exist, it will be created.
Default:
.Dq Pa $TMPDIR/bsdinstall_boot
+.It Ev PKGBASE
+For scripted installations, set to
+.Dq yes .
+Or set to
+.Dq no
+for traditional distset-based installations.
+Default:
+.Dq yes .
.It Ev ROOTPASS_ENC
Encrypted string to set the root password to in the format expected by
.Xr pw 8
@@ -609,7 +622,7 @@
filesystem, looks like this:
.Bd -literal -offset indent
PARTITIONS=DEFAULT
-DISTRIBUTIONS="kernel.txz base.txz"
+COMPONENTS="base debug"
#!/bin/sh
sysrc ifconfig_DEFAULT=DHCP
@@ -620,7 +633,7 @@
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"
@@ -631,6 +644,24 @@
pkg install puppet
.Ed
.Pp
+To install using traditional distributions sets instead of pkgbase, set the
+.Ev PKGBASE
+variable to
+.Dq no
+and set
+.Ev DISTRIBUTIONS
+to the list of distribution sets to install, like this:
+.Bd -literal -offset indent
+PARTITIONS=DEFAULT
+PKGBASE=no
+DISTRIBUTIONS="kernel.txz base.txz"
+
+#!/bin/sh
+sysrc ifconfig_DEFAULT=DHCP
+sysrc sshd_enable=YES
+pkg install puppet
+.Ed
+.Pp
On
.Fx
release media, such a script placed at
diff --git a/usr.sbin/bsdinstall/scripts/pkgbase.in b/usr.sbin/bsdinstall/scripts/pkgbase.in
--- a/usr.sbin/bsdinstall/scripts/pkgbase.in
+++ b/usr.sbin/bsdinstall/scripts/pkgbase.in
@@ -180,7 +180,16 @@
}
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")
+ 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 +309,8 @@
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
--- a/usr.sbin/bsdinstall/scripts/script
+++ b/usr.sbin/bsdinstall/scripts/script
@@ -118,37 +118,46 @@
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>&-
-
-[ $FETCH_RESULT -ne 0 ] && error "Could not fetch remote distributions"
-
-# Unpack distributions
-bsdinstall checksum
-if [ -t 0 ]; then
- # If install is a tty, use distextract as normal
- bsdinstall distextract
+if [ "$PKGBASE" != "no" ]; then
+ # By default, do a pkgbase installation
+ bsdinstall pkgbase --non-interactive
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
+ # Otherwise, unpack distsets
+
+ # Fetch missing distribution files, if any
+ exec 5>&1
+ export BSDINSTALL_DISTDIR=$(`dirname $0`/fetchmissingdists 2>&1 1>&5)
+ FETCH_RESULT=$?
+ exec 5>&-
+
+ [ $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

File Metadata

Mime Type
text/plain
Expires
Mon, May 25, 8:07 PM (2 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33515042
Default Alt Text
D56717.id176823.diff (6 KB)

Event Timeline