Nothing uses it anymore, so drop it from the 'safe' list. Also, move
stand/efi/loader/main.c to using machine/_inttypes.h which is all it
really needs.
Sponsored by: Netflix
unistd.h includes too much extra stuff for the boot loader. This creates
a fair amount of namespace pollution and it's best to just make it an
alias for stand.h like the other include files already are.
Sponsored by: Netflix
We only need to provide sig_atomic_t in emulation. However, including
machine/signal.h brings in too much namespace pollution related to
signals. Instead, define sig_atomic_t as long. Setting long is async
atomic on all platforms (though powerpc64 defines it to an int), though
that doesn't matter since the boot loader doesn't use signals.
Sponsored by: Netflix
- loader.efi.8: use proper way of printing a backslash.
- usr.bin/gzip/gzip.1: contained a non-breaking space (in utf-8, 0xC2A0).
- lib/libpmc/pmc.*.3: remove two duplicate .Xr lines
Signed-off-by: Graham Percival <gperciva@tarsnap.com>
Reviewed by: mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
MFC after: 3 days
Sponsored by: Tarsnap Backup Inc.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1523
It was disabled by default in fe52b7f60e. We planned to (but did not)
remove the option before FreeBSD 14. Remove it now, for FreeBSD 15.
Relnotes: Yes
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31558
But comment out FDT stuff for amd64 built inside kboot. This also
restricts a bit the powerpc platforms we build on to powerpc64.
Sponsored by: Netflix
This does not change the rendered ascii at all.
Signed-off-by: Graham Percival <gperciva@tarsnap.com>
Reviewed by: mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
MFC after: 3 days
Sponsored by: Tarsnap Backup Inc.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1473
We include too many references to networking things in the
non-networking build for loader.efi. Ifdef out netserver command when we
are disabling network support to resolve.
PR: 277528
MFC After: 2 days
Reviewed by: imp
Only the gfx-enabled boot loader supports unicode. Otherwise, we have to
use the old cons25 / ibmpc upper code page drawing characters. Check to
see if we have the gfx.term_drawbox function. If we do, we support the
unicode drawing characters. If we don't, then we have an older loader
that doesn't support it *OR* we have the reduced function, text-only
boot loader. In either of those cases, we need to use the old graphics
characters. Abstract all those details into core.hasUnicode function.
PR: 282465
MFC After: 2 day
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D47403
So this is a gross hack to fix the 'noclean' build since we changed to
text-only loader. We have to fix it in a better way, but for the moment,
this will fix non-meta no-clean builds. A better hack is to fix this so
we build either vidconsole.c or textvidc.c, but some minor refactoring
and variable renaming is needed.
Fixes: 23dee252da
Sponsored by: Netflix
These were reported by `mandoc -T lint ...` as errors.
Signed-off-by: Graham Percival <gperciva@tarsnap.com>
Reviewed by: mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
Sponsored by: Tarsnap Backup Inc.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1472
These are internal to the loader and generally can only be set in a
makefile that's compiling some variation of loader. Add caveats since
these aren't really user-serviceable parts, though some downstreams will
tweak individual makefiles for their own purposes.
Sponsored by: Netflix
After talking with a number of people about the removal of some things
to make the loader fit, readjust things a little.
Add back GZIP and BZIP2 compression support. Many of the downstream MFC
packaging systems depend on this. This adds back 20k to the size of the
loader.
Make the boot loader text-only by default. This saves 40k in size. Net,
we're 20k smaller. The graphics loader for BIOS is less useful than the
zip functionality: You can still boot w/a text only one it and you can
build a custom one if you really want it. It's also the default we use
for dual console.
This should be merged back into stable/14 and stable/13 so it's in the
next release for each of these. That way we have only one release (13.4)
with the other defaults.
MFC After: 3 days
Sponsored by: Netflix
Reviewed by: olce, rgrimes, emaste
Differential Revision: https://reviews.freebsd.org/D47203
Currently, quotes in a comment lead to mal-formed lines warnings. Remove
the quotes since it doesn't matter. The underlying bug likely should be
fixed, but since stability week is neigh, workaround this.
Fixes: 7df3e400ea
Sponsored by: Netflix
Reviewed by: bcran
Differential Revision: https://reviews.freebsd.org/D47201
These were reported by `mandoc -T lint ...` as errors.
The rendered output (in ascii and html) is not affected by this commit.
Signed-off-by: Graham Percival <gperciva@tarsnap.com>
Reviewed by: mhorne
MFC after: 3 days
Sponsored by: Tarsnap Backup Inc.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1459
We can get the UART clock from v3 SPCR, and a precise baudrate from
v4. Some precise baudrates will currently be rejected by the kernel.
Sponsored by: Netflix
Reviewed by: adrian, andrew
Differential Revision: https://reviews.freebsd.org/D47096
If there's a SPCR, then use it to create and pass the right values to
the uart. We pass xo=0 in to calcuate the xo from the baud rate. We try
to be smart about what we set. We either set io or mm or pv/pd. Old
kernels will still work, despite pb/pd not being supported, because
we'll fall back to the SPCR parsing in the kernel.
We don't support Rev3 or Rev4 SPCR yet. It's too new to be in real
hardware yet.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D47085
how is assumed to be 0, so we directly assign to it. It might not always
be 0, so or-in these bits.
Sponsored by: Netflix
Reviewed by: bz, andrew
Differential Revision: https://reviews.freebsd.org/D47084
Make rsdp pointer to the RSDP global so we can look up other tables.
Sponsored by: Netflix
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D47083
Setting boot_mute="YES" currently use the in-kernel black and white logo.
Instead default to the color png one.
Sponsored by: Beckhoff Automation GmbH & Co. KG
BLUE often translates to DARK BLUE. On BLACK this is hard to
read. Instead, use CYAN which looks good on both black and white
backgrounds.
Discussed with: kevans
Sponsored by: Netflix
* Add PVR bits for POWER10 and POWER11
* Initialize the `err` outvar, in case it's not touched on success by
the hypervisor, to prevent spurious errors.
Notable upstream pull request merges:
#9416 -multiple zio_compress: introduce max size threshold
#10018a10e552b9 Adding Direct IO Support
#15147e419a63bf xattr dataset prop: change defaults to sa
#154547e957fde7 send/recv: open up additional stream feature flags
#158100d77e738e Defer resilver only when progress is above a threshold
#159213cf2bfa57 Allocate zap_attribute_t from kmem instead of stack
#16483 -multiple dmu_objset: replace dnode_hash impl with cityhash4
#164858be2f4c3d zio_resume: log when unsuspending the pool
#1649188433e640 sys/types32.h: Remove struct timeval32 from libspl header
#16496f245541e2 zfs_file: implement zfs_file_deallocate for FreeBSD 14
#16511308f7c2f1 Fix an uninitialized data access
#1652929c9e6c32 Fix handling of DNS names with '-' in them for sharenfs
#16531ddf5f34f0 Avoid fault diagnosis if multiple vdevs have errors
#165396f50f8e16 zfs_log: add flex array fields to log record structs
#16546d40d40913 Evicting too many bytes from MFU metadata
#165513014dcb76 Reduce and handle EAGAIN errors on AIO label reads
#1655480645d658 FreeBSD: restore zfs_znode_update_vfs()
#16565832f66b21 FreeBSD: Sync taskq_cancel_id() returns with Linux
#1656748d1be254 Properly release key in spa_keystore_dsl_key_hold_dd()
#16569141368a4b Restrict raidz faulted vdev count
#16583c84a37ae9 lua: add flex array field to TString type
#1658486737c592 Avoid computing strlen() inside loops
#16587d34d4f97a snapdir: add 'disabled' value to make .zfs inaccessible
#16593224393a32 feature: large_microzap
#16597412105977 Temporarily disable Direct IO by default
#166054ebe674d9 ARC: Cache arc_c value during arc_evict()
Backported pull request merges:
#16613ab777f436 Return boolean_t in inline functions of
lib/libspl/include/sys/uio.h
#16616efeb60b86 FreeBSD: ignore some includes when not building kernel
#16635 ---TBD--- zdb: fix printf format in dump_zap()
Obtained from: OpenZFS
OpenZFS commit: b109925820
OpenZFS tag: 2.3.0-rc1
With 8GB disk image and FAT32, our read offset calculation wraps over
32-bit integer and we end up reading garbage. The problem appears when
disk image is filled with data and the block to bytes translations do
not fit into 32-bit integers.
illumos issue: https://www.illumos.org/issues/16666
Sponsored by: MNX Cloud, Inc.
MFC after: 1 week
These were reported by `mandoc -T lint ...` as errors.
The rendered output (in ascii and html) is not affected by this commit.
Signed-off-by: Graham Percival <gperciva@tarsnap.com>
Reviewed by: mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
MFC after: 3 days
Sponsored by: Tarsnap Backup Inc.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1454
fsize is using 2 bytes for cluster number, but with fat32 we
actually do have 4 bytes and with large disks the high bytes will be in use.
illumos issue: https://www.illumos.org/issues/16821
Sponsored by: MNX Cloud, Inc.
MFC after: 1 week
Reduce the number of md5c.c between the three of these from two to one
by just reaching into the kernel build for both userland builds. The
precedent for this already exists for sha2 in both cases.
_libmd_ symbol privatization bits have been moved to sys/md5.h and
md5.h remains to #include <sys/md5.h> for compatibility.
This stops exporting MD5Pad() in the process because the kernel stopped
exporting it in 502a35d60f. soversion is bumped accordingly.
This also renames the libc version of stack_protector.c; it previously
only worked by coincidence because .PATH ordering worked out such that
we got the right one, but this is not the case anymore. Remove the
landmine.
PR: 280784 (exp-run)
Reviewed by: allanjude, delphij
Differential Revision: https://reviews.freebsd.org/D34497
In two places we use '0' for a column number. However, the upper left
hand corner of the screen is 1, 1. Fix those two confusions. Also, fix
a comment that flipped the coordinates in a comment (I'm used to the
vt100 convention where it's row, column (eg y, x)) and didn't notice
the rest of the code uses x, y.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D46777
print automatically adds a newline, while printc does not. Use printc in
preference to print for managing the autoboot message. This means we can
use line 24 safely on a 24x80 terminal, restoring some functionality
that was lost in 101afbc6ee.
Note: we still set the default curosor position to 25,1 in screen.lua,
but real VT100s (and successors) will treat any row larger than the
pnumber of rows in a cursor motion command to be the last physical row
(this is so you can move to 9999,9999 and do a cursor location query to
get the size of the screen). Keeping that as is looks better on a
typical VGA console.
Fixes: 101afbc6ee
Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D46771
The upstream fix to make lld output for our EFI loaders reproducible
again was committed in 54521a2ff9. Bump lld's LINKER_FREEBSD_VERSION
to be able to check this in the EFI loader Makefile.
MFC after: 3 days
In 5c73b3e0a3 calls to core.loadEntropy were added to core.boot
and core.autoboot; but neither of those is invoked if we disable
the "beastie" menu. Add a core.loadEntropy call to the no-menu
path.
Reviewed by: imp
MFC after: 1 week
Sponsored by: Amazon
Fixes: 5c73b3e0a3 ("Add support for getting early entropy from UEFI")
Differential Revision: https://reviews.freebsd.org/D46637
The EFI RNG on some platforms takes a long time if we request 2048
bytes of entropy, so we would like to request less; but our kernel
Fortuna RNG needs to be fed 2048 bytes in order to consider itself
"fully seeded". If we have between 64 bytes (the size of a single
Fortuna pool and enough to guarantee cryptographic security) and
2048 bytes (what Fortuna wants) then the boot process will hang
waiting for more entropy despite in fact having enough to operate
securely.
Since 64 bytes of entropy is plenty to be cryptographically secure
(an attack of cost ~ 2^128 is infeasible, which implies a mere 16
bytes of entropy), use PBKDF2 (aka pkcs5v2_genkey_raw) to spread
the entropy across 2048 bytes. This is secure since PBKDF2 has
the property that every subset of output bytes has within O(1) of
the maximum possible amount of entropy.
Reviewed by: pjd
MFC after: 1 week
Sponsored by: Amazon
Differential Revision: https://reviews.freebsd.org/D46635
This was previously only available if GELI support was included, but I
want to use it for processing entropy from EFI
Reviewed by: imp
MFC after: 1 week
Sponsored by: Amazon
Differential Revision: https://reviews.freebsd.org/D46634
Add a new loader variable entropy_efi_seed_size which defaults to 2048;
if not defined (e.g. if the /boot/lua/ is updated but /boot/defaults/
isn't) the same 2048 default will be used.
Reviewed by: Val Packett
MFC after: 1 week
Sponsored by: Amazon
Differential Revision: https://reviews.freebsd.org/D46632
On some systems, the EFI GetRNG is slow. Make it show up in flamecharts.
MFC after: 1 week
Sponsored by: Amazon
Differential Revision: https://reviews.freebsd.org/D46631
Wrap each call to a built-in command with TSENTER/TSEXIT to make
it easier to see where time is going in the loader.
MFC after: 1 week
Sponsored by: Amazon
Differential Revision: https://reviews.freebsd.org/D46630
With the new 32-bit UEFI loader, it's convenient to have a sysctl to
figure out how we booted. Can be accessed at machdep.efi_arch
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1098
Some machines have 64-bit capable cpus but are stuck on 32-bit uefi
firmware.
Add support for them by building a new "loader_ia32" with
LOADER_DEFAULT_INTERP along with the 64-bit one. The loader
can be disabled using MK_LOADER_IA32.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1098
main.c - Fix rsdp cast.
framebuffer.c -
- Use temp variable instead of directly passing pointer when
EFI_PHYSICAL_ADDRESS is expected.
Also fix FreePages cast.
- Mask framebuffer address given to us by UEFI.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1098
Using AllocateMaxAddress here means that gfx_state->tg_shadow_fb is
treated as the highest address we can receive. Since
gfx_state->tg_shadow_fb is NULL, we never receive anything. Use
AllocateAnyPages instead.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1098
In preparation for supporting 64-bit machines with 32-bit UEFI firmware,
add a 32-bit variant of libefi since we need to compile both the 64-bit
version and the 32-bit version at the same time.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1098