aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/bsdinstall
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/bsdinstall')
-rw-r--r--usr.sbin/bsdinstall/Makefile3
-rw-r--r--usr.sbin/bsdinstall/bsdinstall.827
-rw-r--r--usr.sbin/bsdinstall/partedit/part_wizard.c25
-rwxr-xr-xusr.sbin/bsdinstall/scripts/auto6
-rwxr-xr-xusr.sbin/bsdinstall/scripts/bootconfig2
-rwxr-xr-xusr.sbin/bsdinstall/scripts/jail10
-rwxr-xr-xusr.sbin/bsdinstall/scripts/keymap2
-rwxr-xr-xusr.sbin/bsdinstall/scripts/pkgbase.in94
-rwxr-xr-xusr.sbin/bsdinstall/scripts/script2
-rwxr-xr-xusr.sbin/bsdinstall/scripts/zfsboot2
10 files changed, 117 insertions, 56 deletions
diff --git a/usr.sbin/bsdinstall/Makefile b/usr.sbin/bsdinstall/Makefile
index e5bb3197fa05..5d7be97ed7cf 100644
--- a/usr.sbin/bsdinstall/Makefile
+++ b/usr.sbin/bsdinstall/Makefile
@@ -22,7 +22,8 @@ REVISION?= ${_REVISION}
.if ${BRANCH} == CURRENT || ${BRANCH} == STABLE
SUBURL= base_latest
-.elif ${BRANCH} == RELEASE
+.elif ${BRANCH} == RELEASE || ${BRANCH:C/[0-9]+$//} == BETA || \
+ ${BRANCH:C/[0-9]+$//} == RC
SUBURL= base_release_${REVISION:C/[0-9]+\.//}
.else
.warning Invalid branch "${BRANCH}"
diff --git a/usr.sbin/bsdinstall/bsdinstall.8 b/usr.sbin/bsdinstall/bsdinstall.8
index 5ccbaef87835..ee141e1d4296 100644
--- a/usr.sbin/bsdinstall/bsdinstall.8
+++ b/usr.sbin/bsdinstall/bsdinstall.8
@@ -1,4 +1,6 @@
-.\"-
+.\"
+.\" SPDX-License-Identifier: BSD-2-Clause
+.\"
.\" Copyright (c) 2011-2013 Nathan Whitehorn <nwhitehorn@FreeBSD.org> All rights reserved.
.\" Copyright (c) 2018 Roberto Fernandez Cueto <roberfern@gmail.com>
.\" Copyright (c) 2024 The FreeBSD Foundation
@@ -27,7 +29,7 @@
.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd November 4, 2024
+.Dd October 3, 2025
.Dt BSDINSTALL 8
.Os
.Sh NAME
@@ -40,9 +42,10 @@
.Op Ar ...
.Sh DESCRIPTION
.Nm
-is used for installation of new systems, both for system setup from
-installation media, e.g., CD-ROMs, and for use on live systems to prepare
-VM images and jails.
+is used for installation of new systems,
+both for system setup from installation media,
+such as discs, USBs, or network boot environments,
+and for use on live systems to prepare jails and virtual machine images.
.Pp
Much like
.Xr make 1 , Nm
@@ -56,7 +59,7 @@ these subtargets can be invoked separately by an installation script.
.Sh OPTIONS
.Nm
supports the following options, global to all targets:
-.Bl -tag -width indent+
+.Bl -tag -width "-D file"
.It Fl D Ar file
Provide a path for the installation log file
.Pq overrides Ev BSDINSTALL_LOG .
@@ -73,7 +76,7 @@ For interactive use, most users will be interested only in the
and
.Cm script
targets.
-.Bl -tag -width "jail destination"
+.Bl -tag -width "-D file"
.It Cm auto
Run the standard interactive installation, including disk partitioning.
.It Cm jail Ar destination
@@ -244,7 +247,7 @@ Extracts the distributions listed in
.Ev DISTRIBUTIONS
into
.Ev BSDINSTALL_CHROOT .
-.It Cm pkgbase Op Fl --no-kernel
+.It Cm pkgbase Op Fl -jail
Fetch and install base system packages to
.Ev BSDINSTALL_CHROOT .
Packages are fetched according to repository configuration in
@@ -253,8 +256,10 @@ if set, or
.Lk pkg.freebsd.org
otherwise.
If the
-.Fl --no-kernel
-option is passed, no kernel is installed.
+.Fl -jail
+option is passed, no kernel is installed, and the
+.Dq jail
+variant of each package set will be selected where applicable.
.It Cm firmware
executes
.Xr fwget 8
@@ -293,7 +298,7 @@ Many are used internally during installation and have reasonable default values
for most installation scenarios.
Others are set by various interactive user prompts, and can be usefully
overridden when making scripted or customized installers.
-.Bl -tag -width "BSDINSTALL_DISTSITE"
+.Bl -tag -width "-D file"
.It Ev TMPDIR
The directory to use for temporary files.
Default:
diff --git a/usr.sbin/bsdinstall/partedit/part_wizard.c b/usr.sbin/bsdinstall/partedit/part_wizard.c
index 90a8da1c3c9b..9146a2af782f 100644
--- a/usr.sbin/bsdinstall/partedit/part_wizard.c
+++ b/usr.sbin/bsdinstall/partedit/part_wizard.c
@@ -27,6 +27,7 @@
*/
#include <sys/param.h>
+#include <sys/sysctl.h>
#include <errno.h>
#include <inttypes.h>
@@ -34,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include <libgeom.h>
#include <bsddialog.h>
@@ -41,10 +43,29 @@
#include "partedit.h"
#define MIN_FREE_SPACE (1023*1024*1024) /* Just under 1 GB */
-#define SWAP_SIZE(available) MIN(available/20, 4*1024*1024*1024LL)
static char *wizard_partition(struct gmesh *mesh, const char *disk);
+/*
+ * Determine default swap (partition) size in bytes for a given amount of free
+ * disk space in bytes. The algorithm should likely be revisited in light of
+ * contemporary memory and disk sizes.
+ */
+static intmax_t
+swap_size(intmax_t available)
+{
+ intmax_t swapsize;
+ unsigned long swap_maxpages;
+ size_t sz;
+
+ swapsize = MIN(available/20, 4*1024*1024*1024LL);
+ sz = sizeof(swap_maxpages);
+ if (sysctlbyname("vm.swap_maxpages", &swap_maxpages, &sz, NULL, 0) == 0)
+ swapsize = MIN(swapsize, (intmax_t)swap_maxpages * getpagesize());
+
+ return (swapsize);
+}
+
int
part_wizard(const char *fsreq)
{
@@ -383,7 +404,7 @@ wizard_makeparts(struct gmesh *mesh, const char *disk, const char *fstype,
return (!retval); /* Editor -> return 0 */
}
- swapsize = SWAP_SIZE(available);
+ swapsize = swap_size(available);
humanize_number(swapsizestr, 7, swapsize, "B", HN_AUTOSCALE,
HN_NOSPACE | HN_DECIMAL);
humanize_number(rootsizestr, 7, available - swapsize - 1024*1024,
diff --git a/usr.sbin/bsdinstall/scripts/auto b/usr.sbin/bsdinstall/scripts/auto
index 61d52065af2a..5fefc07e4c07 100755
--- a/usr.sbin/bsdinstall/scripts/auto
+++ b/usr.sbin/bsdinstall/scripts/auto
@@ -73,7 +73,7 @@ msg_yes="YES"
# error [$msg]
#
# Display generic error message when a script fails. An optional message
-# argument can preceed the generic message. User is given the choice of
+# argument can precede the generic message. User is given the choice of
# restarting the installer or exiting.
#
error()
@@ -209,9 +209,9 @@ if [ ! -f $BSDINSTALL_DISTDIR/MANIFEST ]; then
PKGBASE=yes
else
bsddialog --backtitle "$OSNAME Installer" --title "Select Installation Type" \
- --yes-label "Traditional" --no-label "Packages (Experimental)" --yesno \
+ --yes-label "Distribution Sets" --no-label "Packages (Tech Preview)" --yesno \
$PKGBASE_DEFAULT_BUTTON \
- "Would you like to install the base system using traditional distribution sets or packages (experimental)?" 0 0
+ "Would you like to install the base system using traditional distribution sets or packages (technology preview)?" 0 0
if [ $? -eq 1 ]; then
PKGBASE=yes
fi
diff --git a/usr.sbin/bsdinstall/scripts/bootconfig b/usr.sbin/bsdinstall/scripts/bootconfig
index 6736e78b450a..9c188c1d8a91 100755
--- a/usr.sbin/bsdinstall/scripts/bootconfig
+++ b/usr.sbin/bsdinstall/scripts/bootconfig
@@ -163,7 +163,7 @@ if [ -n "$(awk '{if ($2=="/boot/efi") printf("%s\n",$1);}' $PATH_FSTAB)" ]; then
rmdir "${mntpt}"
fi
- # Try to set the UEFI NV BootXXXX variables to recod the boot location
+ # Try to set the UEFI NV BootXXXX variables to record the boot location
if [ "$BSDINSTALL_CONFIGCURRENT" ] && [ "$ARCHBOOTNAME" != ia32 ]; then
update_uefi_bootentry
fi
diff --git a/usr.sbin/bsdinstall/scripts/jail b/usr.sbin/bsdinstall/scripts/jail
index 0c3c7e125fdd..e4238ac0a687 100755
--- a/usr.sbin/bsdinstall/scripts/jail
+++ b/usr.sbin/bsdinstall/scripts/jail
@@ -45,7 +45,7 @@ user_env_vars="BSDINSTALL_DISTSITE DISTRIBUTIONS"
# error [$msg]
#
# Display generic error message when a script fails. An optional message
-# argument can preceed the generic message. User is given the choice of
+# argument can precede the generic message. User is given the choice of
# restarting the installer or exiting.
#
error() {
@@ -79,7 +79,7 @@ distbase() {
: ${DISTRIBUTIONS="base.txz"}; export DISTRIBUTIONS
if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; then
- DISTMENU=`cut -f 4,5,6 $BSDINSTALL_DISTDIR/MANIFEST | grep -v -e ^kernel -e ^base`
+ DISTMENU=$(cut -f 1,5,6 $BSDINSTALL_DISTDIR/MANIFEST | grep -v -e ^kernel -e ^base | sed -E 's/\.txz//g')
if [ ! "$nonInteractive" == "YES" ]
then
@@ -175,15 +175,15 @@ fi
if [ ! "$nonInteractive" == "YES" ]; then
bsddialog --backtitle "$OSNAME Installer" --title "Select Installation Type" \
- --yes-label "Traditional" --no-label "Packages (Experimental)" --yesno \
- "Would you like to install the base system using traditional distribution sets or packages (experimental)?" 0 0
+ --yes-label "Distribution Sets" --no-label "Packages (Tech Preview)" --yesno \
+ "Would you like to install the base system using traditional distribution sets or packages (technology preview)?" 0 0
if [ $? -eq 1 ]; then
PKGBASE=yes
fi
fi
if [ "$PKGBASE" == yes ]; then
- bsdinstall pkgbase --no-kernel || error "Installation of base system packages failed"
+ bsdinstall pkgbase --jail || error "Installation of base system packages failed"
else
distbase
fi
diff --git a/usr.sbin/bsdinstall/scripts/keymap b/usr.sbin/bsdinstall/scripts/keymap
index 6f4060c0772e..669a1062df95 100755
--- a/usr.sbin/bsdinstall/scripts/keymap
+++ b/usr.sbin/bsdinstall/scripts/keymap
@@ -216,7 +216,7 @@ while :; do
n=$( eval f_dialog_menutag2index_with_help \
\"\$menu_choice\" $menu_list )
- # Turn that number ithe name of the keymap struct
+ # Turn that number into the name of the keymap struct
k=$( set -- $KEYMAPS; eval echo \"\${$(( $n - 2))}\" )
# Get actual keymap setting while we update $keymap and $KEYMAPFILE
diff --git a/usr.sbin/bsdinstall/scripts/pkgbase.in b/usr.sbin/bsdinstall/scripts/pkgbase.in
index d02d89b23865..5299d34fcb71 100755
--- a/usr.sbin/bsdinstall/scripts/pkgbase.in
+++ b/usr.sbin/bsdinstall/scripts/pkgbase.in
@@ -80,7 +80,9 @@ local function select_components(components, options)
["kernel-dbg"] = "Debug symbols for the kernel",
["devel"] = "C/C++ compilers and related utilities",
["optional"] = "Optional software (excluding compilers)",
+ ["optional-jail"] = "Optional software (excluding compilers)",
["base"] = "The complete base system (includes devel and optional)",
+ ["base-jail"] = "The complete base system (includes devel and optional)",
["src"] = "System source tree",
["tests"] = "Test suite",
["lib32"] = "32-bit compatibility libraries",
@@ -91,6 +93,7 @@ local function select_components(components, options)
-- by default.
local defaults = {
["base"] = "on",
+ ["base-jail"] = "on",
["kernel-dbg"] = "on",
}
-- Enable compat sets by default.
@@ -101,40 +104,66 @@ local function select_components(components, options)
-- Sorting the components is necessary to ensure that the ordering is
-- consistent in the UI.
local sorted_components = {}
+
+ -- Determine which components we want to offer the user.
+ local show_component = function (component)
+ -- "pkg" is always installed if present.
+ if component == "pkg" then return false end
+
+ -- Don't include individual "-dbg" components, because those
+ -- are handled via the "debug" component, except for kernel-dbg
+ -- which is always shown for non-jail installations.
+ if component == "kernel-dbg" then
+ return (not options.jail)
+ end
+ if component:match("%-dbg$") then return false end
+
+ -- Some sets have "-jail" variants which are jail-specific
+ -- variants of the base set.
+
+ if options.jail and components[component.."-jail"] then
+ -- If we're installing in a jail, and this component
+ -- has a jail variant, hide it.
+ return false
+ end
+
+ if not options.jail and component:match("%-jail$") then
+ -- Otherwise if we're not installing in a jail, and
+ -- this is a jail variant, hide it.
+ return false
+ end
+
+ -- "minimal(-jail)" is always installed if present.
+ if component == "minimal" or component == "minimal-jail" then
+ return false
+ end
+
+ -- "kernel" (the generic kernel) and "kernels" (the set) are
+ -- never offered; we always install the kernel for a non-jail
+ -- installation.
+ if component == "kernel" or component == "kernels" then
+ return false
+ end
+
+ -- If we didn't find a reason to hide this component, show it.
+ return true
+ end
+
for component, _ in pairs(components) do
- -- Decide which sets we want to offer to the user:
- --
- -- "minimal" is not offered since it's always included, as is
- -- "pkg" if it's present.
- --
- -- "-dbg" sets are never offered, because those are handled
- -- via the "debug" component.
- --
- -- "kernels" is never offered because we only want one kernel,
- -- which is handled separately.
- --
- -- Sets whose name ends in "-jail" are intended for jails, and
- -- are only offered if no_kernel is set.
- if component ~= "pkg" and
- not component:match("^minimal") and
- not component:match("%-dbg$") and
- not (component == "kernels") and
- not (not options.no_kernel and component:match("%-jail$")) then
+ if show_component(component) then
table.insert(sorted_components, component)
end
end
+
table.sort(sorted_components)
local checklist_items = {}
for _, component in ipairs(sorted_components) do
- if component ~= "kernel" and not
- (component == "kernel-dbg" and options.no_kernel) then
- local description = descriptions[component] or ""
- local default = defaults[component] or "off"
- table.insert(checklist_items, component)
- table.insert(checklist_items, description)
- table.insert(checklist_items, default)
- end
+ local description = descriptions[component] or ""
+ local default = defaults[component] or "off"
+ table.insert(checklist_items, component)
+ table.insert(checklist_items, description)
+ table.insert(checklist_items, default)
end
local bsddialog_args = {
@@ -162,7 +191,12 @@ local function select_components(components, options)
-- to work. The base set depends on minimal, but it's fine to install
-- both, and this way the user can remove the base set without pkg
-- autoremove then trying to remove minimal.
- local selected = {"minimal"}
+ local selected = {}
+ if options.jail then
+ table.insert(selected, "minimal-jail")
+ else
+ table.insert(selected, "minimal")
+ end
-- If pkg is available, always install it so the user can manage the
-- installed system. This is optional, because a repository built
@@ -171,7 +205,7 @@ local function select_components(components, options)
table.insert(selected, "pkg")
end
- if not options.no_kernel then
+ if not options.jail then
table.insert(selected, "kernel")
end
@@ -264,8 +298,8 @@ end
local function parse_options()
local options = {}
for _, a in ipairs(arg) do
- if a == "--no-kernel" then
- options.no_kernel = true
+ if a == "--jail" then
+ options.jail = 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 00ded5f8e24d..21da2ea7c366 100755
--- a/usr.sbin/bsdinstall/scripts/script
+++ b/usr.sbin/bsdinstall/scripts/script
@@ -144,7 +144,7 @@ else
#
# 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 analagous problems on
+ # /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
diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot
index 95cbba3fa131..9ea6ec3a4ac9 100755
--- a/usr.sbin/bsdinstall/scripts/zfsboot
+++ b/usr.sbin/bsdinstall/scripts/zfsboot
@@ -255,7 +255,7 @@ msg_encrypt_disks="Encrypt Disks?"
msg_encrypt_disks_help="Use geli(8) to encrypt all data partitions"
msg_error="Error"
msg_force_4k_sectors="Force 4K Sectors?"
-msg_force_4k_sectors_help="Align partitions to 4K sector boundries and set vfs.zfs.vdev.min_auto_ashift=12"
+msg_force_4k_sectors_help="Align partitions to 4K sector boundaries and set vfs.zfs.vdev.min_auto_ashift=12"
msg_freebsd_installer="$OSNAME Installer"
msg_geli_password="Enter a strong passphrase, used to protect your encryption keys. You will be required to enter this passphrase each time the system is booted"
msg_geli_setup="Initializing encryption on selected disks,\n this will take several seconds per disk"