This is consistent with other operating systems and with bsdinstall's
UFS config and with bsdinstall's ZFS config prior to commit
0b7472b3d8.
PR: 290857
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
(cherry picked from commit 4109cdf0f817162cf3032aa589dd180dfa910025)
(cherry picked from commit 65e347d315449e8c28dbcb0c5bb64f79d822d024)
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
(cherry picked from commit ee110941e35c4354baa2e5b6fd64d3025cff4b7e)
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
(cherry picked from commit 494de51bc0074472d1b01604f085daea0844f240)
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
(cherry picked from commit f304c5bb8be65df83b86f8a50e1c7982b266262d)
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
(cherry picked from commit ebc6ff8db17683b566d49fe89a43a668d3d67915)
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
(cherry picked from commit 16045420e7f83489ecd5e2163aa9bb11236962f5)
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
(cherry picked from commit 9de72af2cceb6fc4aead0990cccdf565531bc248)
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
Fixes: 95ee591e83
PR: 287538
Reviewed by: emaste, thj
Differential Revision: https://reviews.freebsd.org/D51313
(cherry picked from commit 5a1e2927d63ed6394b767088eb2d66676f275467)
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
(cherry picked from commit f69afe4201ff33da0b3c3ca464a92e2e0b07ac43)
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.
Approved by: re (cperciva)
PR: 286722
MFC after: 3 days
Reviewed by: jrtc27, allanjude, emaste
Differential Revision: https://reviews.freebsd.org/D50297
(cherry picked from commit 5870d6a1ef4ec5d6fc91d0f1635bca59e09a040d)
(cherry picked from commit 242b52ba3c38108f2c2af4194a031ed495b95dbc)
This handles copying in install-boot.sh and bsdinstall's bootconfig.
install-boot.sh:
make_esp_file now optionally takes extra arguments so it can copy
multiple files. This is used by the amd64 release scripts.
make_esp_device also takes an extra optional argument for efibootname.
This is currently unused, but it can be used in the future to do
something like:
make_esp_device loader.efi bootx64
make_esp_device loader_ia32.efi bootia32
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1098
(cherry picked from commit 599273f942b8dc6f957487bb28f36694dab9dad2)
In an AMA session on the FreeBSD Discord, it was revealed that no
logic remains calling GPART_BOOTCODE_PARTONLY. It was removed in
aa2a0e0fc3 for FreeBSD 12. git grep shows no other references.
No functional change intended.
MFC after: 2 weeks
Fixes: aa2a0e0fc3 (Enable new UEFI+GELI support)
Reported by: Antranig Vartanian <antranigv@freebsd.am>
Reviewed by: emaste, mhorne
Approved by: emaste, mhorne (src)
Approved by: mhorne, carlavilla (mentors)
Differential Revision: https://reviews.freebsd.org/D48086
(cherry picked from commit 347eb42dbcb352f3266e716a2101898fe054bdba)
This allows the default options (-O compress=lz4 -O atime=off) to be
overridden, before the ZFS boot pool is created. For example, to set the
compression algorithm to something different.
Reviewed by: jhb, dim
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D47478
(cherry picked from commit ca7e12f7df222458ec5cac8009c5b0931fb4a95b)
Add a menu to the installer to run fwget(8) inside the newly installed
system to install firmware known to be needed.
This requires working netowrking.
This is needed at least for wireless currently for when we entirely
stop shipping new firmware in src.git to have working networking on
the installed system (we already do need this for at least rtw89).
Sponsored by: The FreeBSD Foundation
Tested with: 4 different iwlwifi chipsets in a system (earlier version)
Suggested improvments by: jrtc27
Differential Revision: https://reviews.freebsd.org/D47491
(cherry picked from commit bbe2a1da2df639c616869aa838244c8094779bd4)
Make sure an interface is back up before (re-)starting wpa_supplicant
in wlanconfig not relying on wpa to UP the interface (though we fixed
that).
Sponsored by: The FreeBSD Foundation
Reviewed by: emaste (in D47491)
Differential Revision: https://reviews.freebsd.org/D47491
(cherry picked from commit 5399052c63a7a3d2f54615d31bfd092ab887a600)
This isn't inherently an error. It is if you're attempting to download
dist tarballs or later install packages, but a FreeBSD system with no
NIC is a reasonable setup to have, especially in a throwaway VM setting,
so we shouldn't say it is one.
Leaving the exit code as 1 is still fine, since auto will ignore it, and
avoids breaking other uses.
MFC after: 1 week
(cherry picked from commit 7414d14bd51d8378057bbe952c2715b9f32d1d3e)
The script uses [ -z "$INTERFACES" ] to check if the list of interfaces
is empty and will exit early if so, but INTERFACES always contains at
least a space due to the way it appends the list of wireless devices.
Fix this by only adding the space when there are devices to append,
mirroring the behaviour for non-wireless devices above (both will result
in a redundant leading space when the list is non-empty, but that one is
harmless).
Fixes: 159ca5c844 ("Adapt to new wireless scheme where base wlan interfaces do not show up in ifconfig anymore.")
MFC after: 1 week
(cherry picked from commit b809c7d6a26924ac351e49a15011da718cc3feec)
pkg_add has been gone since 2013(?). Refer to pkg(8) instead.
Sponsored by: The FreeBSD Foundation
Reviewed by: jrtc27
Differential Revision: https://reviews.freebsd.org/D44946
(cherry picked from commit ad31d4764255c0848f1f0fa10760d16b5a2922aa)
In 2024, users are more likely to have working HTTP than working FTP.
Present http://ftp.FreeBSD.org as the first option in the installer.
Keep ftp://ftp.FreeBSD.org as the second option.
MFC after: 3 weeks
(cherry picked from commit 9c59988175ffd6b42c6927c0939e13abc43f7344)
Only set a default value of 1 if the shell variable is unset. This allows
installer scripts to disable the variable.
PR: 274513
Reported by: Albin "a12l" Otterhäll <bugs.freebsd.org@a12l.xyz>
Differential Revision: https://reviews.freebsd.org/D42319
(cherry picked from commit de82aed1192470574a08d3e479d81c4c1280487a)
Currently we just strip the .txz of the dist name (and add a status_
prefix) to get the shell variable name for its status, but this doesn't
give a valid result for dists like base-dbg, kernel-dbg and lib32-dbg,
or even kernel.KERNCONF (or, combining the two, kernel.KERNCONF-dbg). As
a result, four things go wrong for such dists:
1. If there is a dot and/or a dash in the name, writing to the variable
fails and spits an error out on stderr to the log
3. If there is a dot in the name before any dash, the syntax is always
invalid, reading the variable fails, spits an error out on stderr to
the log, the result is the empty string and that is interpreted as
being 0%
2. If there is a dash in the name before any dot, and there is a dist
whose name is the substring up to that first dash, and it has already
had its status written to, reading the variable instead reads that
dist's variable and so the status of that dist is displayed instead
3. If there is a dash in the name before any dot, and either there is
not a dist whose name is the substring up to that first dash or there
is such a dist but it has not already had its status written to,
reading the varaible instead results in the substring after the first
dash, including any additional string expansion syntax that follows
(i.e. ${status_kernel-dbg:--11}, the expression used to read the
variable, is interpreted as reading status_kernel with a default
value of "dbg:--11")
For example, in a default install with base, kernel, kernel-dbg and
lib32, the following sequence of displays happens:
1. base is In Progress, kernel is Pending, kernel-dbg is 0% (what shows
for the garbage input "dbg:--11") and lib32 is Pending
2. base is Passed, kernel is In Progress, kernel-dbg is In Progress
(since kernel has now had its status written to) and lib32 is
Pending
3. base is Passed, kernel is Passed, kernel-dbg is Passed (again, since
that is the status of kernel, despite that kernel-dbg is being
verified at this point) and lib32 is Pending
4. base is Passed, kernel is Passed, kernel-dbg is Passed and lib32 is
In Progress
Fix this with a crude encoding scheme. More special characters can
easily be added if needed in future.
Note that, prior to bsddialog being used (and thus for branches this is
MFC'ed to where dialog is still used), the same problem existed but
displayed slightly differently due to a combination of different default
values and different behaviour for unintended inputs.
Fixes: b70047d413 ("Add generation of an installation manifest containing SHA256 checksums as ...")
MFC after: 1 week
(cherry picked from commit 47d669f10ea3eb92a3783376549728b42c9e22b9)
Now that pw (hence adduser and the initial install) use /home for
user home directories rather than /usr/home, create a dataset for
/home rather than /usr/home. Update the man page to match.
Reviewed by: rgrimes, markj
Differential Revision: https://reviews.freebsd.org/D40086
The mirrors list is in sync with the Handbook / Mirrors section [1],
which was refreshed a few months ago. Mirrors removed were not
responding or had duplicated addresses (aliases) with another mirror.
1 - https://docs.freebsd.org/en/books/handbook/mirrors/
Reviewed by: philip (clusteradm)
Approved by: philip
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D38014
The variable used for the checklist's default value needs to correspond
to the rc.conf variable as that's what's being parsed to determine them.
In the case of local_unbound it's missing the _enable suffix and thus
always defaults to off on revisit.
Fixes: 58eb9abb31 ("Add a line to the post-installation configuration dialog to enable the local_unbound service.")
There are a few issues here, some of which are hiding others. The first
is that we don't use double quotes around the command substitution so
every word in the conf file is treated as a separate argument to eval,
resulting in spaces being used in place of newlines and thus comments in
the file commenting out the rest of the file, not just to the end of
their line. In particular, we insert one comment just before the dumpdev
entry (the final one in the file) and so we never see dumpdev as set,
and thus set a default value of on for the menu.
The second issue is that, for dumpdev, it takes a value of AUTO not YES
when set, but we don't replace this with on when eval'ing, so then end
up giving AUTO to bsddialog which is interpreted the same as off (which
seems to match GPL dialog). Thus handle AUTO like YES otherwise it will
always appear as unchecked on revisit.
The final issue is that our case-insensitive YES/NO (and now AUTO)
replacements have no word boundaries around them so match the middle of
words too. As it happens this doesn't matter in practice at the moment,
but it could in future; currently the only effect is that it rewrites
moused_nondefault_enable to moused_offndefault_enable, but since this
variable is never read, only written based on moused(_enable) this is
harmless, but we should fix it in case a service comes along in future
that does get affected by it.
This installer option is currently totally useless, as it ends up
creating an ntpd_sync_on_start_enable="YES" entry in rc.conf, not an
ntpd_sync_on_start="YES" entry, as is the correct name. This can also be
noticed by revisiting the services menu, which parses the previously
written rc.conf.services file to set variables governing the default
menu entry values so that selecting OK regenerates the same file, as the
menu entry will use the correct variable name and thus think the entry
was not selected last time, defaulting back to off and losing the
setting.
Thus, add a special case in the loop for this option. The only other
entry that doesn't follow the *_enable pattern is dumpdev (even moused
does, it just also sets a second variable), but that also deviates in
terms of being explicitly set either way and using AUTO rather than YES,
hence why ntpd_sync_on_start follows a different pattern here and is
special-cased rather than introducing a whole new variable that governs
behaviour outside the loop.
Fixes: c153a35bfd ("bsdinstall: replace ntpdate by ntpd_sync_on_start")
fetchmissingdists naturally sets BSDINSTALL_DISTDIR to a directory in
the new filesystem that it can write fetched distfiles to. As a result,
BSDINSTALL_DISTSITE was incorrectly set to the scratch space on /mnt for
the call to distfetch when grabbing local distfiles, and it would
subsequently fail.
Switch to using the copy of BSDINSTALL_DISTDIR that we stashed off
coming into fetchmissingdists; this one is in-fact set to the path where
the local distfiles are stored.
Patch suggested by jrtc27.
Reported and tested by: Daniel O'Connor <darius dons net au>
MFC after: 1 week
* change current NTP services offered by the FreeBSD Installer;
* no longer offer ntpdate to be enabled and started on boot;
* start offering the option to make ntpd set the date and time on boot itself.
The motivation for this change comes from the ntpdate(8) manpage:
Note: The functionality of this program is now available in the ntpd(8)
program. See the -q command line option in the ntpd(8) page. After a
suitable period of mourning, the ntpdate utility is to be retired from
this distribution.
Approved by: cy (src), dteske (src)
Differential Revision: https://reviews.freebsd.org/D36206
Currently we only set canmount=noauto on the root of the BE, this
change makes it so we set it on all datasets under the BE as well.
Reviewed by: allanjude
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35422
If installing from the DVD, mount its packages in the chroot at
/dist/packages. That way they'll be accessible to an install script.
MFC after: 2 weeks
Sponsored by: Axcient
Reviewed by: gjb
Differential Revision: https://reviews.freebsd.org/D35330
Don't shadow an already-local variable with another local declaration.
Reported by: dteske
MFC after: 13 days
MFC with: caf73e5857
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D35331
If the ZFSBOOT_DISKS variable is set to one or more disk names, then
those disks should be preselected in the disk menu. However, the code
wasn't correctly setting the variable, leaving all disks unselected.
MFC after: 2 weeks
Sponsored by: Axcient
Reviewed by: dteske
Differential Revision: https://reviews.freebsd.org/D35331
Otherwise, boot will hang if the numbering of disks has changed since
initial install.
MFC after: 2 weeks
Sponsored by: Axcient
Reviewed by: brd
Differential Revision: https://reviews.freebsd.org/D35309