freebsd-dev/stand
Kyle Evans c318828929 Preload hostuuid for early-boot use
prison0's hostuuid will get set by the hostid rc script, either after
generating it and saving it to /etc/hostid or by simply reading /etc/hostid.

Some things (e.g. arbitrary MAC address generation) may use the hostuuid as
a factor in early boot, so providing a way to read /etc/hostid (if it's
available) and using it before userland starts up is desirable. The code is
written such that the preload doesn't *have* to be /etc/hostid, thus not
assuming that there will be newline at the end of the buffer or even the
exact shape of the newline. White trailing whitespace/non-printables
trimmed, the result will be validated as a valid uuid before it's used for
early boot purposes.

The preload can be turned off with hostuuid_load="NO" in /boot/loader.conf,
just as other preloads; it's worth noting that this is a 37-byte file, the
overhead is believed to be generally minimal.

It doesn't seem necessary at this time to be concerned with kern.hostid.

One does wonder if we should consider validating hostuuids coming in
via jail_set(2); some bits seem to care about uuid form and we bother
validating format of smbios-provided uuid and in-fact whatever uuid comes
from /etc/hostid.

Reviewed by:	karels, delphij, jamie
MFC after:	1 week (don't preload by default, probably)
Differential Revision:	https://reviews.freebsd.org/D24288
2020-04-16 00:54:06 +00:00
..
arm Remove NAND and NANDFS support 2019-06-25 04:50:09 +00:00
arm64 No need to make objects here. 2018-04-27 22:15:18 +00:00
common Fix pkgfs stat so it satisfies libsecureboot 2020-03-25 19:12:19 +00:00
defaults Preload hostuuid for early-boot use 2020-04-16 00:54:06 +00:00
efi loader.efi: restore the init and fix the color setup 2020-03-28 22:37:50 +00:00
fdt stand/fdt: Scale blob size better as overlays apply 2020-01-09 04:34:42 +00:00
ficl veloader use vectx API for kernel and modules 2020-03-09 16:02:54 +00:00
ficl32 Enable veriexec for loader 2019-02-26 06:22:10 +00:00
forth loader: Fully reset terminal settings, not just colors 2020-03-27 17:37:31 +00:00
i386 loader: remove libsa/crc32.c and use version from zlib 2020-03-19 21:05:11 +00:00
kshim A more definitions to kernel emulation shim in order to build stand/usb. 2018-02-07 18:50:36 +00:00
liblua veloader use vectx API for kernel and modules 2020-03-09 15:48:53 +00:00
liblua32 Add Lua as a scripting langauge to /boot/loader 2018-02-12 15:31:53 +00:00
libofw veloader use vectx API for kernel and modules 2020-03-08 17:42:42 +00:00
libsa Improve interaction of vectx and tftp 2020-04-07 16:56:34 +00:00
libsa32 Enable veriexec for loader 2019-02-26 06:22:10 +00:00
lua loader: Fully reset terminal settings, not just colors 2020-03-27 17:37:31 +00:00
man Remove sparc64 support from the boot loader. 2020-02-03 17:34:57 +00:00
mips stand: -fno-common fixes for !x86 loaders 2020-04-07 12:57:50 +00:00
powerpc Add support to MSDOS FS in PPC loader 2020-04-07 19:46:00 +00:00
uboot stand: -fno-common fixes for !x86 loaders 2020-04-07 12:57:50 +00:00
usb Fix build of stand/usb . 2020-01-23 10:40:34 +00:00
userboot userboot: mark host_fsops as extern 2020-03-29 02:29:06 +00:00
defs.mk [PowerPC] Switch powerpc and powerpcspe to lld 2020-03-27 01:00:03 +00:00
fdt.mk
ficl.mk ficl pfopen: verify file 2019-05-24 19:43:38 +00:00
loader.mk loader: remove libsa/crc32.c and use version from zlib 2020-03-19 21:05:11 +00:00
lua.mk Do not include float interfaces when using libsa. 2018-02-23 04:04:25 +00:00
Makefile Move stand/ofw/libofw to stand/libofw. 2020-01-02 04:34:22 +00:00
Makefile.amd64 Create LOADER_UBOOT, and LOADER_OFW. Move these options out of 2018-03-01 19:50:55 +00:00
Makefile.inc Minor flags cleanup 2017-12-02 00:06:58 +00:00
uboot.mk Unify metadata load files for arm, mips, powerpc, sparc64 2018-02-13 03:44:50 +00:00