Commit graph

704 commits

Author SHA1 Message Date
Ed Maste
dac74b20c7 bsdinstall: Drop "Technology preview" from package sets
And refer to dist sets as "legacy."  This matches our expectation for
FreeBSD 16.0.

Reviewed by:	cperciva
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54156
2026-01-12 13:47:38 -05:00
Ricardo Branco
3e8619e535 bsdinstall: Create separate datasets for directories in /usr/ports
Both distfiles & packages contain compressed files.

Signed-off-by: Ricardo Branco <rbranco@suse.de>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1873
2026-01-09 22:05:37 -07:00
John Baldwin
f63a8c0a09 bsdinstall: Mount /dev and /packages after using the shell to partition disks
Normally after partitions are created by the installer, the 'mount'
script is used to mount the target disk partitions under /mnt.  The
tail end of this script also mounts a couple of additional filesystems
under /mnt so that chrooted programs can work such as devfs and
/packages.

When the "Shell" option is used to permit the user to manually mount
the destination filesystem, the "mount" script is not used as the user
is instructed to mount the target filesystems and construct
/mnt/etc/fstab, etc.  However, this means that the user is responsible
for mounting devfs (which is not included in /etc/fstab) and /packages
as well.  The help message for the "Shell" option doesn't mention
these requirements, so users may not know to do so.  This can lead to
confusing errors as chrooted commands can fail to find needed /dev
entries.  For example, running fwget to fetch wireless firmware fails
because /dev/pci doesn't exist.

To make this less painful for users using this option, split out the
bottom half of the 'mount' script that mounts these non-fstab-related
filesystems into a separate 'mount_aux' script.  Invoke 'mount_aux'
after using "Shell" to create the filesystem to ensure that these
filesystems are always present.

PR:		290901
Reported by:	Peter <freebsd@peterk.org>
Tested by:	Peter <freebsd@peterk.org>
Differential Revision:	https://reviews.freebsd.org/D53770
2025-12-08 16:33:30 -05:00
Colin Percival
d45816f369 bsdinstall: Ignore -p[0-9]+ in determining BRANCH
The patch level is not part of the branch per se and should not be
used in constructing the FreeBSD-base.conf file used by bsdinstall.

MFC after:	1 day
2025-11-26 09:07:24 -08:00
Colin Percival
a96230e032 bsdinstall: Enable FreeBSD-base repo when pkgbase
When performing a pkgbase install, create a configuration file in
/usr/local/etc/pkg/repos/FreeBSD.conf which enables the FreeBSD-base
repository.  (This repository is defined in /etc/pkg/FreeBSD.conf as
being disabled by default.)

Reported by:	Mark Millard
Reviewed by:	markj
MFC after:	immediately (needed for 15.0-RC1)
Differential Revision:	https://reviews.freebsd.org/D53777
2025-11-15 14:05:50 -08:00
Colin Percival
bdfc223c7a bsdinstall: Don't install FreeBSD-base.conf
When installing e.g. 15.0-RC1, we want to get files from the 15.0-RC1
pkgbase repository; but running 'pkg upgrade' after installation should
get the latest bits build from releng/15.0.

With hat:	re
MFC after:	8 hours (needed in 15.0-RC1)
2025-11-14 23:58:41 -08:00
Colin Percival
51184e38c9 bsdinstall: Use pkgbase.f.o for BETA/RC/RELEASE
For BETA/RC/RELEASE builds, fetch files from the appropriate repository
on pkgbase.freebsd.org, using the appropriate signing keys.  Note that
there is a separate repository for each BETA and RC; this ensures that
someone installing from e.g. a 15.0-RC1 ISO will get 15.0-RC1 bits and
not whatever happens to be the most recent build from releng/15.0.

With hat:	re
MFC after:	8 hours (needed in 15.0-RC1)
2025-11-14 23:58:41 -08:00
Colin Percival
6b0909f940 bsdinstall: Copy in all keys
The keys used for pkgbase signing are going to be placed in
/usr/share/keys/pkgbase-N where N is the FreeBSD major version
number; as such it's not sufficient to copy /usr/share/keys/pkg
into the install chroot, but instead we need /usr/share/keys/*.

With hat:	re
MFC after:	8 hours (needed in 15.0-RC1)
Differential Revision:	https://reviews.freebsd.org/D53753
2025-11-14 23:58:40 -08:00
Ed Maste
4109cdf0f8 bsdinstall: Use fat32 EFI system partition for ZFS
This is consistent with other operating systems and with bsdinstall's
UFS config and with bsdinstall's ZFS config prior to commit
0b7472b3d8.

Fixes: 0b7472b3d8 ("Mount the EFI system partition (ESP) on newly-installed systems.")
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53642
2025-11-11 13:17:56 -05:00
Ed Maste
4e36942420 bsdinstall: Fix newfs bsddialog menu
The second and third members of struct bsddialog_menuitem are `bool on`
and `unsigned int depth`. The newfs dialog options in bsdinstall's
partition tool had these two swapped, so the default selection did not
work.

PR: 290857
Reviewed by: asiciliano
Fixes: 50e244964e ("bsdinstall/partedit: Replace libdialog with libbsddialog")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53639
2025-11-08 10:01:35 -05:00
Jose Luis Duran
74921426d5
bsdinstall: jail: Fix DISTMENU items
The menu was incorrectly using the fourth column (distname) instead of
the first (dist) of the MANIFEST.

The actual file name is on the first column of the MANIFEST file.
Remove the .txz part of the name to build the menu options.

Reviewed by:	jamie
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D53177
2025-10-22 18:22:44 +00:00
Ed Maste
b0c64ce0ea bsdinstall: Use pkgbase release URL for BETA/RC
PR:		290238
Reviewed by:	ivy
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53214
2025-10-20 09:28:49 -04:00
Jose Luis Duran
4ee348e271
bsdinstall: Fix typos
Reviewed by:	emaste
MFC after:	2 days
Differential Revision:	https://reviews.freebsd.org/D53170
2025-10-18 17:13:16 +00:00
Ed Maste
52f9722e6f bsdinstall: Limit default swap to maximum supported by kernel
PR:		251993
Reviewed by:	cperciva
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53106
2025-10-15 12:29:56 -04:00
Ed Maste
abd9424590 bsdinstall: Tweak pkgbase/dist set labels
Have the button labels refer to the artifact type directly (distribution
sets / packages), and use "Tech Preview" as packaged base is no longer
experimental.

Reviewed by:	ivy, cperciva
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52999
2025-10-11 13:22:19 -04:00
Lexi Winter
ed5023c96c bsdinstall.8: Fix '---jail' option in manpage
The .Fl macro implicitly adds a '-', so only use a single '-' in the
--jail option.

Fixes:	8d0a90512e ("bsdinstall: Improve pkgbase handling for jails")
MFC after:	1 day
Reported by:	Mark Millard <marklmi@yahoo.com>
Sponsored by:	https://www.patreon.com/bsdivy
2025-10-08 10:28:03 +01:00
Alexander Ziaee
81d9e08a4d
bsdinstall.8: Minor maintenance
Replace CD-ROMs with "discs, USBs, or network boot environments"
to both modernize aesthetic and also nudge youths to think at scale.
Since I'm disrupting the flow of these lines anyway, expand the VM
acronym because I think this is one of the first manuals people will
be looking at.

Reset list alignment to seven characters. It was at 19 characters,
and that was not enough to align them all, wasting many extra lines
by crunching all the words over. Seven actually bought us some lines
from six due to avg item size. Tag SPDX.

MFC after:	3 days
Discussed with:	ivy, zi
2025-10-04 19:24:15 -04:00
Lexi Winter
8d0a90512e bsdinstall: Improve pkgbase handling for jails
Add a new --jail option to the pkgbase script which installs
jail-specific set variants if they exist:

* "minimal" is replaced with "minimal-jail"

* A kernel is not installed.

* For sets shown in the component selection dialogue, only show the
  appropriate variant (jail or non-jail) for the target.

Modify the jail script to pass --jail to the pkgbase script.

Remove the redundant --no-kernel option, which was added in 15.0 and
was only used to install jails.

MFC after:	3000ms
Reviewed by:	ifreund_freebsdfoundation.org
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D52829
2025-10-03 22:51:48 +01:00
Lexi Winter
ed6716207d bsdinstall/pkgbase: Restore the kernel-dbg component
Commit 561dc357c2 changed the way we handle components in the prompt,
and accidentally resulted in the kernel-dbg component not being listed
since we now hide all components ending in "-dbg".

Add an exception for kernel-dbg to bring it back.

Fixes:	561dc357c2 ("bsdinstall: Use package sets for pkgbase install")
MFC after:	3 seconds
Reviewed by:	emaste
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D52826
2025-10-02 02:37:35 +01:00
Lexi Winter
2507698b63 bsdinstall: Only offer to enable services which are installed
With pkgbase, users may decide to install a minimal set of packages
that's missing some daemons.  Check which services are installed, and
only include the ones which are present in the dialogue.

MFC after:	1 day
Reviewed by:	cperciva
Differential Revision:	https://reviews.freebsd.org/D52646
2025-09-30 07:02:51 +01:00
Warner Losh
494de51bc0 bsdinstall: Add loader.efi to all ESPs we create
For proper redundancy, add copies of loader.efi to each of the ESPs we
create when we create multi-volume ZFS datasets. zfsboot creates a list
of secondary ESPs, while bootpart doesn't create any (it's the UFS
partitioning tool) because we don't supporg UFS over gmirror. The
primary ESP is mounted and is what we use efibootmgr to boot from. The
redundant copies allow the system to boot if the primary disks fails.

Sponsored by:		Netflix
MFC After:		2 days
PR:			208802
Reviewed by:		cperciva
Differential Revision:	https://reviews.freebsd.org/D52780
2025-09-29 20:55:46 -06:00
Lexi Winter
eaecc9551a packages: Add an "optional" set
This is everything in "base" but without compilers.  This means we
have sets to support four basic workloads:

- "minimal" for a small installation where the user intends to add
  other packages by hand.

- "optional" for a complete installation on a production system which
  does not need to compile software.

- "devel", which can be added to either minimal or optional when
  compilers are required.

- "base" for a complete installation, including compilers, for users
  who don't want to interact with pkgbase and just want the complete
  system installed like it was before.

This is probably the last set want to add; any further metapackages
would be better treated as "task" packages intended to target one
specific workload.

MFC after:	3 days
Reviewed by:	cperciva, bapt
Differential Revision:	https://reviews.freebsd.org/D52777
2025-09-29 22:53:34 +01:00
Lexi Winter
4422265c67 bsdinstall: Install pkg if it's available
Now that the pkg package is shipped on the pkgbase release media,
install it by default for a pkgbase install if it's present.

If it's not available (e.g., when running bsdinstall from a repository
built from src alone, without ports), skip it and assume the user will
install it another way.

MFC after:	1 day
Reviewed by:	ifreund_freebsdfoundation.org, cperciva
Differential Revision:	https://reviews.freebsd.org/D52639
2025-09-24 10:16:13 +01:00
Lexi Winter
3f5385beea release: Improve kernel package handling
Although support for PowerPC kernels (GENERIC64 and GENERIC64LE) was
added to pkgbase-stage.lua, the equivalent support was missing from
bsdinstall, so the installer would fail at runtime since it wouldn't
find a kernel package.

Improve the pkgbase-stage logic to have a specific list of kernels
we want to support (which avoids breaking if multiple kernels are
available), and use the same logic in both bsdinstall and pkgbase-stage.

MFC after:	1 day
Reviewed by:	cperciva
Differential Revision:	https://reviews.freebsd.org/D52638
2025-09-24 10:16:13 +01:00
Siva Mahadevan
87a7b35f04 bsdinstall: fix vfs.zfs.vdev.min_auto_ashift oid
Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
PR: 266374
Pull request: https://github.com/freebsd/freebsd-src/pull/1851
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
2025-09-19 12:02:57 -04:00
Lexi Winter
561dc357c2 bsdinstall: Use package sets for pkgbase install
Update the pkgbase component selection dialogue to take the components
list from the meta-package sets available on the install media, except
for "kernel" which is still handled magically.

Always install "minimal", and by default select "base", "kernel-dbg"
and any libcompat sets (e.g., lib32) if they're available.

Replace the various "dbg" options with a single "debug" component that
installs the debug symbols for all the components the user selected,
except for kernel since we handle that separately and it's common to
want kernel debugs symbols without userland debug symbols.

MFC after:	3 seconds
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D52558
2025-09-19 02:15:10 +01:00
Michael Osipov
f304c5bb8b bsdinstall: Drop outdated comments about ZFS dataset compression
All datasets on zroot pool are compressed by default since FreeBSD 11.0 [1],
no need to mention that on some specific datasets these days.

[1] 47206692f2

Reviewed by:	jrm (mentor), ziaee
MFC after:	3 days
Differential Revision:	 https://reviews.freebsd.org/D52304
2025-09-09 12:00:54 +02:00
Jessica Clarke
ccbd3de0f3 bsdinstall: Copy /etc/localtime as symlink in jail script
Without -P (or -R, which defaults to enabling -P) symlinks are
dereferenced and so the target file is copied, not the symlink itself.

Fixes:	5e16809c95 ("tzsetup: symlink /etc/localtime instead of copying")
2025-08-27 22:35:54 +01:00
Isaac Freund
6fa24b29d8 release, bsdinstall: include FreeBSD-kernel-man package
This package has been newly split off during man page reorganization and
should be considered part of the "base" component rather than being
ignored. Update pkgbase release and bsdinstall scripts for this change.

Reviewed by:	ivy
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51519
2025-07-30 18:57:17 -04:00
Lexi Winter
16045420e7 bsdinstall: use the canonical name for compression
According to zfsprops(7), the canonical property for the compression
algorithm is "compression", with "compress" accepted as an alternate
name.  Use the canonical name in bsdinstall.

While here, change "lz4" to "on" so we pick up any future changes in
the default compression algorithm.

MFC after:	1 week
Reviewed by:	delphij
Differential Revision:	https://reviews.freebsd.org/D51572
2025-07-28 13:45:26 +01:00
Ed Maste
ebc6ff8db1 bsdinstall: Improve message for existing FreeBSD EFI entry
When reinstalling FreeBSD bsdinstall reported "There are multiple
FreeBSD EFI boot entries."  This sounds like something went wrong in the
past.  Clarify that there may be only one existing entry, which is not
surprising for a reinstall.

Reviewed by:	manu, ziaee
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51527
2025-07-26 16:06:22 -04:00
Ed Maste
ee110941e3 bsdinstall: Remove support for ZFS + MBR disk layouts
It hasn't worked for some time -- as reported in review D40816
"Installing FreeBSD with Auto ZFS + MBR has been broken ever since the
move to OpenZFS with FreeBSD 13."  It relied on the partition table and
ZFS data overlapping in a very fragile way and is not a good idea.

Reviewed by:	jhb
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51028
2025-07-25 15:26:09 -04:00
Ed Maste
00294d7b0a bsdinstall: Guard against invalid branch/revision
I somehow ended up with a tree where make -V BRANCH and make -V REVISION
were broken, resulting in a FreeBSD-base.conf with a broken repo URL.
Check for BRANCH == RELEASE explicitly and emit a warning if BRANCH does
not match an expected case.

Reviewed by:	Isaac Freund <ifreund@freebsdfoundation.org>
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51528
2025-07-25 11:33:56 -04:00
Isaac Freund
cc413e2c04 bsdinstall: Always install FreeBSD-base.conf if using pkgbase
Currently bsdinstall does not install FreeBSD-base.conf when performing
an offline pkgbase installation. This commit fixes that.

PR:		287821
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51101
2025-07-21 15:29:04 -04:00
Bjoern A. Zeeb
153e73d782 bsdinstall: wlanconfig: ensure the interface is always up for scanning
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	thj (earlier), emaste
Differential Revision: https://reviews.freebsd.org/D51312
2025-07-15 18:41:05 +00:00
Bjoern A. Zeeb
5a1e2927d6 bsdinstall: wlanconfig: properly format regdomain dialog input
Without the extra '\n' the dual-column ('REGD' '') are not properly
separated for dialog which leads to an [misleading] error hidden on
the command line:
	Error: --menu bad arguments items number.
[Writing this I wonder why the dual-column input is needed].

It is still unclear as to where the error message quoted in PR287538
suddenly came from for 14.3-RELEASE given the code was broken since 2016
(or noone ever noticed or reported).

Looking at manual ifconfig output:
    ifconfig wlan0 country GB regdomain Expected
    -> ifconfig: unknown regdomain Expected
and "ifconfig: " gets stripped by the script, which means the regdomain
variable would have to be set to "Expected" or more likely to
"Expected eval: Use: not found" which looks like a concatination of
errors.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Fixes:		95ee591e83
PR:		287538
Reviewed by:	emaste, thj
Differential Revision: https://reviews.freebsd.org/D51313
2025-07-15 17:53:21 +00:00
Ed Maste
1b0b13915a bsdinstall: Report error from installing firmware
We should improve error reporting from commands invoked by binstall more
generally, but this is a small improvement for an observed failure case.

PR:		287654
Reviewed by:	allanjude
Event:		Kitchener-Waterloo Hackathon 202506
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50941
2025-06-24 15:13:39 -04:00
Ed Maste
47c3158b65 bsdinstall: Skip pkgbase question if no legacy dist sets
If the install media was built without dist sets (and so has no MANIFEST
file) we do not need to prompt the user, and only pkgbase is in use.

Reviewed by:	Isaac Freund <ifreund@freebsdfoundation.org>
Event:		Kitchener-Waterloo Hackathon 202506
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50918
2025-06-23 10:44:14 -04:00
Ed Maste
eb5884c564 bsdinstall: Emit a warning if the system has too little memory
PR:		251993
Reviewed by:	adrian
Event:		Kitchener-Waterloo Hackathon 202506
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50944
2025-06-20 15:22:18 -04:00
Ed Maste
9134ed1573 bsdinstall: Default to pkgbase if media contains base packages
As of commit 62d18f8c4c ("release: Add -DPKGBASE option to include
pkgbase packages") we can include base system packages on the install
media instead of dist tarballs.

Set the default for the traditional/pkgbase question to match the
artifact type included in the install image.

Reviewed by:	jrm
Event:		Kitchener-Waterloo Hackathon 202506
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50467
2025-06-16 18:44:57 -04:00
Chattrapat Sangmanee
754bc3dcd3 bsdinstall: fix ps3 regression
b6644f5 introduces FREEBSD_BOOTLABEL="FreeBSD" as default value
but cc42ef5 removed this line, expecting it to be set by update_uefi_bootentry()

But ps3 don't use this function so its broken completely.

So we add this line back.

Signed-off-by: Chattrapat Sangmanee <aomsin27@hotmail.co.th>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1594
2025-06-12 19:21:45 -06:00
Pierre Pronchery
9de72af2cc bsdinstall: restore the environment when restarting
It is possible to restart the installation process upon errors, when
installing normally through the `auto` script, or when installing a jail
with the `jail` script. However, some values obtained interactively from
the user or guessed by some scripts were kept in the environment when
restarting the process; this made it impossible to re-run some steps as
expected after the restart.

For instance, if a bad choice of mirror was made in the `mirrorselect`
phase, restarting the installer remembered the choice made, and would
never prompt for a different one again. Rebooting was then the only easy
way out of this situation.

This change restores a pre-defined list of environment variables when
restarting the installation process.

PR:		266987
Reviewed by:	emaste
Approved by:	philip (mentor)
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D42281
2025-06-01 14:53:16 +02:00
Pierre Pronchery
046800313a bsdinstall: implement rootpass with bsddialog
This provides a more consistent user experience to the FreeBSD
installer.

Tested by:	thj
Approved by:	philip (mentor)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D44280
2025-05-30 16:45:48 +02:00
Isaac Freund
0a86a8ace3 bsdinstall: support offline pkgbase installation
Reviewed by:	bapt, emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50347
2025-05-23 09:41:49 -04:00
Isaac Freund
0bfa8a4596 bsdinstall: improve pkgbase target retry prompts
These now use bsddialog rather than prompting the user for input on the
console.

Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50270
2025-05-23 09:40:12 -04:00
Isaac Freund
3c3dd62966 bsdinstall: add pkgbase component selection dialog
This matches the style of the component selection dialog for traditional
tarball-based installations. The only difference is that there is
currently no ports component offered when using pkgbase.

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50178
2025-05-22 14:59:47 -04:00
Graham Perrin
f69afe4201 zfsboot: fix misuse of the phrase zpool
A pool is not a zpool.

Reviewed by:	jbh, ivy
Approved by:	des (mentor)
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1569
2025-05-19 09:10:29 +01:00
Dag-Erling Smørgrav
5870d6a1ef bsdinstall: Use a login shell for final configuration.
If the user accepts our offer of a shell to perform final configuration
tasks before rebooting, start a login shell.  This ensures it will have
the correct PATH and be able to install packages without issues.

PR:		286722
MFC after:	3 days
Reviewed by:	jrtc27, allanjude, emaste
Differential Revision:	https://reviews.freebsd.org/D50297
2025-05-11 23:04:55 +02:00
Isaac Freund
34b43f4b26 bsdinstall: add pkgbase prompt to auto script
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49824
2025-04-28 20:34:18 -04:00
Isaac Freund
4daf244aed bsdinstall: add pkgbase prompt to jail script
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49823
2025-04-28 20:34:18 -04:00