OPNsense - FreeBSD source
Find a file
Nathan Whitehorn 4601382e13 Fix scripted installs on EFI systems after default mounting of the ESP.
Because the ESP mount point (/boot/efi) is in mtree, tar will attempt to
extract a directory at that point post-mount when the system is installed.
Normally, this is fine, since tar can happily set whatever properties it
wants. For FAT32 file systems, however, like the ESP, tar will attempt to
set mtime on the root directory, which FAT does not support, and tar will
interpret this as a fatal error, breaking the install (see
https://github.com/libarchive/libarchive/issues/1516). This issue would
also break scripted installs on bare-metal POWER8, POWER9, and PS3
systems, as well as some ARM systems.

This patch solves the problem in two ways:
- If stdout is a TTY, use the distextract stage instead of tar, as in
  interactive installs. distextract solves this problem internally and
  provides a nicer UI to boot, but requires a TTY.
- If stdout is not a TTY, use tar but, as a stopgap for 13.0, exclude
  boot/efi from tarball extraction and then add it by hand. This is a
  hack, and better solutions (as in the libarchive ticket above) will
  obsolete it, but it solves the most common case, leaving only
  unattended TTY-less installs on a few tier-2 platforms broken.

In addition, fix a bug with fstab generation uncovered once the tar issue
is fixed that umount(8) can depend on the ordering of lines in fstab in a
way that mount(8) does not. The partition editor now writes out fstab in
mount order, making sure umount (run at the end of scripted, but not
interactive, installs) succeeds.

PR:		254395
Approved by:	re (gjb)
Reviewed by:	gjb, imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D29380

(cherry picked from commit c2f16c595e)
2021-03-23 15:21:33 -04:00
.github/workflows GitHub actions: unbreak macOS build 2021-01-08 15:36:38 +01:00
bin bin/pkill: Fix {pgrep,pkill}-j_test.sh 2021-03-17 09:57:15 +00:00
cddl openzfs: attach pam_zfs_key to build 2021-03-10 02:57:42 +01:00
contrib Vendor import of bc 3.3.4 2021-03-21 16:42:34 +01:00
crypto Handle partial data re-sending on ktls/sendfile on FreeBSD 2021-02-25 14:45:41 -08:00
etc zfs: bump version and install new share files 2021-03-10 02:26:35 +01:00
gnu Bump shared library versions after ncurses bump in 13. 2021-02-04 17:51:45 -08:00
include Remove __NO_TLS. 2021-03-02 02:49:42 +02:00
kerberos5 kerberos5: Silence compiler warnings 2021-03-17 09:53:08 +00:00
lib Speed up geom_stats_resync in the presence of many devices 2021-03-21 02:23:42 +00:00
libexec rc.d/auditd: set pidfile 2021-03-17 09:53:17 +00:00
release Mount the EFI system partition (ESP) on newly-installed systems and VM 2021-03-09 09:22:58 -05:00
rescue ping: add a ping6 hard link for backwards compatibility 2020-11-26 18:33:04 +00:00
sbin pfctl: Add missing 'va' code point name 2021-03-20 15:45:48 +01:00
secure OpenSSL: Regen manual page for the previous commit 2021-02-25 14:45:59 -08:00
share MFC c743a6bd4f: 2021-03-23 11:50:29 +01:00
stand stand: Load INIT_ARRAY and FINI_ARRAY sections 2021-03-22 21:32:08 -04:00
sys pf: pool/kpool conversion code 2021-03-23 13:23:55 +01:00
targets targets: no longer depend on bt3cfw(8) 2021-01-16 23:53:13 +01:00
tests fusefs: set d_off during VOP_READDIR 2021-03-21 02:00:33 +00:00
tools Silence a macro-redefined warning when crossbuilding 2021-03-17 22:22:48 +00:00
usr.bin fortune: add a tip about gstat 2021-03-21 02:15:05 +00:00
usr.sbin Fix scripted installs on EFI systems after default mounting of the ESP. 2021-03-23 15:21:33 -04:00
.arcconfig arcconfig: add callsign again 2020-11-23 04:39:29 +00:00
.arclint arc lint: ignore /tests/ in chmod 2017-12-19 03:38:06 +00:00
.cirrus.yml Cirrus-CI: temporarily avoid qemu smoke test boot 2021-03-05 12:51:04 -05:00
.clang-format clang-format: Avoid breaking after the opening paren of function definitions 2020-10-28 11:54:00 +00:00
.gitattributes Add a basic clang-format configuration file 2019-06-07 15:23:52 +00:00
.gitignore Revert "bc: Vendor import of Gavin Howard's bc version 3.2.6" 2021-02-05 20:53:34 +01:00
COPYRIGHT copyrights: Happy New Year 2021 2020-12-31 10:29:44 -05:00
LOCKS LOCKS: update current locks 2018-06-09 03:08:04 +00:00
MAINTAINERS Add a pointer to csprng@ for the CSPRNG driver. This is enforced anyway by 2020-09-01 08:02:12 +00:00
Makefile Rename NO_WERROR -> MK_WERROR=no 2021-01-07 09:31:03 +00:00
Makefile.inc1 build: remove LIBPTHREAD/LIBTHR build options 2021-01-28 19:21:46 -06:00
Makefile.libcompat libcompat: remove redundant path for ncurses 2021-01-07 15:14:52 +01:00
Makefile.sys.inc AUTO_OBJ: For all top-level targets enforce using an OBJDIR. 2017-12-05 21:29:47 +00:00
ObsoleteFiles.inc Add ObsoleteFiles.inc entries for various OCF headers removed in 13. 2021-03-11 11:17:57 -08:00
README Mark the repository has been converted to Git 2020-12-23 12:27:27 +08:00
README.md Revert "bc: Vendor import of Gavin Howard's bc version 3.2.6" 2021-02-05 20:53:34 +01:00
RELNOTES [skip ci] Add RELNOTES entries for aio_writev and fusefs 2021-03-07 16:17:41 +00:00
UPDATING Bump __FreeBSD_version for multiple LinuxKPI updates conflicting 2021-02-02 11:52:50 +00:00

FreeBSD Source:

This is the top level of the FreeBSD source directory. This file was last revised on: FreeBSD

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms. A large community has continually developed it for more than thirty years. Its advanced networking, security, and storage features have made FreeBSD the platform of choice for many of the busiest web sites and most pervasive embedded networking and storage devices.

For copyright information, please see the file COPYRIGHT in this directory. Additional copyright information also exists for some sources in this tree - please see the specific source directories for more information.

The Makefile in this directory supports a number of targets for building components (or all) of the FreeBSD source tree. See build(7), config(8), https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html, and https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html for more information, including setting make(1) variables.

Source Roadmap:

bin		System/user commands.

cddl		Various commands and libraries under the Common Development
		and Distribution License.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

rescue		Build system for statically linked /rescue utilities.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

stand		Boot loader sources.

sys		Kernel sources.

sys/<arch>/conf Kernel configuration files. GENERIC is the configuration
		used in release builds. NOTES contains documentation of
		all possible entries.

tests		Regression tests which can be run by Kyua.  See tests/README
		for additional information.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.

For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see:

https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/current-stable.html