Commit Graph

2313 Commits

Author SHA1 Message Date
Lexi Winter aa0bc7cca1 boot1.chrp: Specify --image-base
This is required for LLVM 22's ld.lld to avoid a build error:

ld.lld: error: section '.text' address (0x38000) is smaller than image base (0x10000000); specify --image-base
ld.lld: error: section '.rodata' address (0x3b308) is smaller than image base (0x10000000); specify --image-base
ld.lld: error: section '.data' address (0x3b610) is smaller than image base (0x10000000); specify --image-base
ld.lld: error: section '.bss' address (0x3f618) is smaller than image base (0x10000000); specify --image-base

Use 0x38000 for the image base, which is the address of the lowest
(and only) LOAD segment in the file.

Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D56459
2026-04-18 21:15:26 +01:00
Lexi Winter ba94d75749 stand/common/load_elf: Do kernel module relocations for PPC
reloc_ptr() skips relocations for the kernel module, because on most
platforms the kernel is ET_EXEC and this is not required.  On PPC,
the kernel is ET_DYN and we need to relocate here, otherwise the
module metadata will not be loaded properly and the kernel module
will have an incorrect version, preventing module dependencies from
resolving.

This fixes loading kernel modules from loader.conf on powerpc.

Diagnosed by:	jrtc27
Reviewed by:	jrtc27, adrian
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D56457
2026-04-18 13:07:10 +01:00
Warner Losh 4ed20e0236 kshim/usb: Add build option.
Add WITH{,OUT}_LOADER_USB to build the kshim usb library. Nothing
in-tree uses it, but this will make it easier to keep building. Updated
src.conf.5 with a few extra changes...

Sponsored by:		Netflix
2026-04-17 20:41:43 -06:00
Lexi Winter eb0279550d boot1.chrp: Improve comment for the SLOF hack
Since this original comment was written, the actual issue in SLOF
was diagnosed and documented in commit 424089a0fc, which fixed it
for loader(8).  Update the comment in boot1 to be more informative
to future readers.

MFC after:	3 days
Reviewed by:	jhibbits, adrian
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D56470
2026-04-17 17:56:33 +01:00
Jessica Clarke ab1d659e78 loader.efi: Defer efi_translate(e_entry) until after bi_load
bi_load itself loads various things into the staging area which can
cause it to grow, which may result in the staging area moving, including
the kernel. Therefore the address we get for the kernel entry point
prior to bi_load may not be correct afterwards when we actually call it,
and so we must defer the translation.

On arm and riscv (but not arm64, which predates both of them in
loader.efi and did not gain a copy of arm's added printf when arm
support was added) we also printf this entry point to the console, which
we can no longer do since bi_load calls ExitBootServices, so remove this
printf that, in practice, seems to not be so useful, given nobody ever
felt the need to add it to arm64. If anyone really feels this is an
important printf to have then bi_load will need to be split so we can
call printf after all the loading and potential reallocation of the
staging area, but before ExitBootServices is called.

We may also want to make this code more uniform and shared between the
three architectures here, since there isn't much architecture-specific
about this (and something like the RISC-V boot hart protocol could
easily be made an MD hook).

Reviewed by:	imp
Fixes:		0cafabf97f ("Add support for arm64 to loader.efi and boot1.efi")
Fixes:		ea7796a9ae ("EFI: don't call printf after ExitBootServices, since it uses Boot Services")
Fixes:		2192efc03b ("RISC-V boot1.efi and loader.efi support")
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56431
2026-04-17 15:20:12 +01:00
Mitchell Horne 48a05f833c stand/libofw: make OF_hasprop() part of the library
Currently it is only needed by powerpc ofwfdt.c, and defined statically
there. Make it available as part of libofw, mirroring what we have in
the kernel.

Two small tweaks are made to the implementation:
  1. Return type is changed to bool
  2. Return 'true' when OF_getproplen() == 0. This matches the expected
     semantics of the kernel version, described in OF_hasprop(9).

Reviewed by:	manu, imp, adrian
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D56429
2026-04-16 14:50:14 -03:00
Michael Osipov 4f684e929d loader.efi.8/efibootmgr.8: Don't use contradicting term 'EFI BIOS'
Both (U)EFI and BIOS are completely different things, be precise and don't use
them together.

Reviewed by:	imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D56329
2026-04-11 20:24:43 +02:00
Simon J. Gerraty 35bbdfad28 Pass severity to vectx_open() rather than vectx_close()
file_loadraw() can have a need to load unverified files
like "dtrace_dof".  Allow severity_guess() to look at the filename
but if it returns less than VE_MUST check that the type is not
one we insist on verifying.

In vectx_open if severity < VE_MUST we can allow it to be unverified.
If passed VE_GUESS we call severity_guess().
Regardless, we record severity in ctx so it is available to vectx_close().

Sponsored by: Hewlett Packard Enterprise Development LP

Reviewed by:	khng
Differential Revision:	https://reviews.freebsd.org/D56297
2026-04-10 10:46:54 -07:00
Toomas Soome aacf448007 loader.efi: panic() should show stack trace
Because panic() does provide mechanism to have architecture specific
panic call, we can instruct it to print out stack trace too
(in hope we actually can print). While there, also implement simple
check to detect loop in trace.

illumos issue: https://www.illumos.org/issues/17887
2026-04-09 16:29:12 +03:00
Toomas Soome c1c97f18b5 gptzfsboot: boot prompt should emit new line on input
In case the user did input, we should put newline
on screen to avoid possible error messages to get
mixed with user input.
2026-04-09 14:24:42 +03:00
Kyle Evans bf0881060e lualoader: allow the local module to filter out the BE list
This allows something like the following local.lua to install a filter
to implement its own notion of hidden BEs using a naming convention of
a leading dot to hide them:

-- file: /boot/lua/local.lua
local core = require("core")

local function be_hide(be)
    if core.isSingleUserBoot() then
        -- All BEs are accepted for single-user
        return true
    end

    local name = be:match("/([^/]+)$")
    if not name then
        -- Accept malformed BEs, for whatever reason
        return true
    end

    return name:match("^%.") == nil
end

if core.bootenvFilter then
    -- Just in case we need to be compatible with older versions of
    -- core.lua without the filtering functionality.
    core.bootenvFilter(be_hide)
end
-- EOF

Requested by:	Marek Zarychta
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D55359
2026-04-08 07:49:58 -05:00
Simon J. Gerraty a371b008d1 Add boot_setenv
Move is_restricted_var() to libsa/environment.c so it can be leveraged
by boot_setenv called from subr_boot with not truted input.

Also, allow for local tuning via ENV_IS_RESTRICTED_ALLOWED_LIST and
ENV_IS_RESTRICTED_LIST

Sponsored by:	Hewlett Packard Enterprise Development LP.

Reviewed by:	kevans, imp
Differential Revision:	https://reviews.freebsd.org/D56287
2026-04-07 09:29:07 -07:00
Quentin Thébault 4b862c713a splash: add shutdown splash
This commit adds a shutdown splash to the existing kernel startup splash(4)
screen feature. It can be customized by providing a PNG image to the
shutdown_splash directive loader.conf(5).

Sponsored by: 	Defenso
MFC after: 	2 weeks
Reviewed by:	vexeduxr, ziaee, manu
Differential Revision:	https://reviews.freebsd.org/D55140
2026-04-03 09:15:29 +02:00
Ed Maste 61f78130c2 stand: Force disable RETPOLINE for boot loaders
Boot loaders do not require speculative execution protection, and may be
too large if enabled.

Reported by:	Shawn Webb
Reviewed by:	dim, imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56068
2026-03-24 22:33:43 -04:00
Navdeep Parhar 0661997cea loader(8): embedded MD should be the most preferred currdev
A loader built with MD_IMAGE_SIZE is almost always meant for use with
its embedded image and should try that as currdev before anything else.
Recent changes (d69fc3a9dc, 784150fd25) seem to have relaxed the ZFS
code's search for a rootfs and exposed this problem.

Reviewed by:	imp, tsoome
MFC after:	1 week
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D55979
2026-03-20 07:40:41 -07:00
Martin Matuska 80aae8a3f8 zfs: merge openzfs/zfs@3ee08abd2
Notable upstream pull request merges:
 #17000 -multiple cmd/zfs: support creating parents with canmount=no
 #17926 b481a8bbb Make zpool status dedup table support raw bytes -p output
 #18238 -multiple Report space metrics per allocation class
 #18240 5dad9459d Add --no-preserve-encryption flag
 #18257 1eace5906 libzfs: use mount_setattr for selective remount including
                  legacy mounts
 #18259 1e2c94a04 More consistent use of TREE_* macros in AVL comparators
 #18262 c58b8b7dc Fix check for .cfi_negate_ra_state on aarch64
 #18264 f109c7bb9 Add the --file-layout (-f) option to zdb(8)
 #18268 304de7f19 libzfs: handle EDOM error in zpool_create
 #18275 753f1e1e2 zstream: add a drop_record subcommand
 #18276 0f90a797d Fix vdev_rebuild_range() tx commit
 #18277 1e1d64d66 Fix log vdev removal issues
 #18278 06b0abfe6 Fix the send --exclude option to work with encryption
 #18281 e73ada771 libzpool: lift zfs_file ops out to separate source file
 #18284 d97945776 zstream: consolidate shared code
 #18285 -multiple Separate SIMD compile checks for userspace and kernel
 #18288 c5905b2cb Implement lzc_send_progress
 #18289 -multiple L2ARC: Add depth cap and write budget fairness for
                  persistent markers
 #18290 d45c8d648 FreeBSD: Improve dmesg kernel message prefix
 #18294 b403040c4 draid: fix data corruption after disk clear
 #18296 -multiple libzfs: mnttab cleanup
 #18300 d35951b18 zpool clear: remove undocumented rewind flags
 #18301 ae7fcd5f9 fix libzfs diff mem leak in an error path
 #18303 65165df12 zilstat: add man page
 #18314 7f65e04ab libzfs: scrub: only include start and end nv pairs if
                  needed for scrub
 #18315 -multiple Sync ZVOLs block cloning conditions with file systems
 #18330 f80338fac zarcsummary: add man page
 #18337 f259a47c7 zpool-iostat.8: clarify first report shows per-second
                  averages

Obtained from:	OpenZFS
OpenZFS commit:	3ee08abd2f
2026-03-19 21:25:34 +01:00
Martin Matuska 8a62a2a565 zfs: merge openzfs/zfs@f8e5af53e
Notable upstream pull request merges:
 #17358 4975430cf Add vdev property to disable vdev scheduler
 #18031 c77f17b75 Add snapshots_changed_nsecs dataset property
 #18080 dbb3f247e cmd/zfs: clone: accept `-u` to not mount newly created
                  datasets
 #18089 -multiple Zstd: Update bundled library to version 1.5.7
 #18091 2301755df Fix zfs_open() to skip zil_async_to_sync() for the
                  snapshot
 #18093 -multiple L2ARC: Rework write throttling with DWPD rate limiting
                  and parallel writes
 #18095 2dbd6af5e Rename several printf attributes declarations to
                  __printf__
 #18096 8605bdfdd FreeBSD: unbreak compilation on i386
 #18105 794f1587d When receiving a stream with the large block flag,
                  activate feature
 #18115 765929cb4 DDT: Add locking for table ZAP destruction
 #18118 09e4e01e9 Fix history logging for `zpool create -t`
 #18119 2f1f25217 icp: emit .note.GNU-stack section for all ELF targets
 #18131 3fffe4e70 Fix --enable-invariants on FreeBSD
 #18133 d2f5cb3a5 Move range_tree, btree, highbit64 to common code
 #18136 54b141fab FreeBSD: Remove references to DEBUG_VFS_LOCKS
 #18138 cdf89f413 Flush RRD only when TXGs contain data
 #18139 a157ef62a Make sure we can still write data to txg
 #18140 cd895f0e5 remove thread unsafe debug code causing FreeBSD double
                  free panic
 #18144 4f180e095 Fix activating large_microzap on receive
 #18146 35b2d3970 Lock db_mtx around arc_release() in couple places
 #18154 b36472052 nvpair: chase FreeBSD xdrproc_t definition
 #18160 21bbe7cb6 Improve caching for dbuf prefetches
 #18177 -multiple Multihost Improvements
 #18179 2646bd558 Allow rewrite skip cloned and snapshotted blocks
 #18180 aa29455dd Restrict cloning with different properties
 #18184 040ba7a7c libzfs: improve error message for zpool create with
                  ENXIO
 #18188 1412bdc6c zfs_vnops_os.c: Move a vput() to after
                  zfs_setattr_dir()
 #18198 cc184fe98 Fix `send:raw` permission for send `-w -I`
 #18208 ba970eb20 Cleanup allocation class selection
 #18212 0f9564e85 Simplify dnode_level_is_l2cacheable()
 #18214 370570890 Remove parent ZIO from dbuf_prefetch()
 #18218 bfb276e55 freebsd: Fix TIMESPEC_OVERFLOW for PowerPC
 #18222 d06a1d9ac Fix available space accounting for special/dedup
 #18225 d48967728 ICP: AES-GCM VAES-AVX2: fix typos and document
                  source files
 #18226 c8a72a27e ICP: AES-GCM assembly: remove unused Gmul functions
 #18230 -multiple Fix zdb --key crash for unencrypted datasets, and
                  teach tests to understand this better
 #18233 -multiple icp: add SHA-512 implementation using Intel SHA512
                  extension
 #18245 991fc56fa Introduce dedupused/dedupsaved pool properties
 #18251 6a717f31e Improve misleading error messages for
                 ZPOOL_STATUS_CORRUPT_POOL
 #18254 7744f0496 SIMD: libspl: test the correct CPUID bit for AVX512VL
 #18255 6495dafd5 range_tree: use zfs_panic_recover() for
                  partial-overlap remov
 #18256 3408332d7 zhack: Fix importing large allocation profiles on
                  small pools
 #18258 f8457fbdc Fix deadlock on dmu_tx_assign() from vdev_rebuild()
 #18263 f8e5af53e Fix redundant declaration of dsl_pool_t

Obtained from:	OpenZFS
OpenZFS commit:	f8e5af53e9
2026-03-14 13:14:56 +01:00
Ed Maste 96294c22f7 build: Stop testing LINKER_FEATURES for ifunc and build-id
These features are available in all supported linkers, and we can expect
that they'll be supported by any GNU-compatible linker that we'd use to
link FreeBSD.

Reviewed by:	imp, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55676
2026-03-10 20:00:17 -04:00
Craig Leres e6d579be42 core.lua: follow symlinks when looking for bootable kernels
PR: 293654
Reviewed by:	kevans
Approved by:	kevans
Differential Revision:	https://reviews.freebsd.org/D55713
2026-03-09 14:47:47 -07:00
Warner Losh 784150fd25 stand/efi: Allow RELAXED or STRICT boot policies
The RELAXED boot policy will automatically search for any root
filesystem (currently zfs only) on any device. STRICT policy only
searches on the boot device. RELEAXED will still prefer the device we
booted from, which is the smallest behavior change we should do. STRICT
may be needed for releases, though.

Sponsored by:		Netflix
Reviewed by:		glebius
Differential Revision:	https://reviews.freebsd.org/D55107
2026-02-26 18:01:36 -07:00
Gleb Smirnoff d69fc3a9dc loader.efi: try all ZFS pools found by efi_zfs_probe()
Remove global uint64_t pool_guid and instead iterate over all pools that
efizfs_get_zfsinfo_list() provides.

The global pool_guid used to mark that we have constructed a ZFS pool and
the pool label that was used for that was stored on a partition that is
the EFI image device handle.

First problem here is that it is too restrictive.  If the very first
device to probe is a spare member of a pool, it will be used to
instantiate a pool but (pd->pd_handle == boot_img->DeviceHandle) won't be
true, thus global pool_guid won't be populated and ZFS boot won't be
tried.

Second problem is that potentially we may find several pools, and all
should be tried to boot.  Note that the code for that is already here -
efizfs_get_zfsinfo_list() is imported by efizfs.h but was not used until
now.

Reviewed by: imp
Differential Revision:	https://reviews.freebsd.org/D55094
2026-02-26 18:01:36 -07:00
Toomas Soome 23605a8e51 loader.efi: efi_redirect_exceptions does use uninitialized pointer
loader_idt.rd_base is not set when we are attempting to bcopy(),
resulting to data stored to page 0 and therefore corrupting it.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D55180
2026-02-21 17:27:35 +02:00
Toomas Soome f2186bbd63 loader.efi: free_tables() appears to free tss_pa twice.
we check and reset loader_gdt_pa, but use FreePages(tss_pa).

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D55179
2026-02-21 17:20:54 +02:00
Toomas Soome dc11af08a4 loader.efi: tss_pa setup seems to be flawed in trap.c
since sd_lobase is 24 bits, we would need to shift 24 bits, not 16.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D55178
2026-02-21 10:49:34 +02:00
Toomas Soome 503374af39 fix typo in efi/loader/arch/amd64/trap.c
Rename grap_faults to grab_faults

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D55177
2026-02-21 10:40:48 +02:00
Ahmad Khalifa a404c2315b Revert "stand: compile ia32 EFI loader with -malign-double"
The loader shares types with various libraries that don't compile with
this flag. Revert for now.

Reported by:	jrtc27
2026-02-15 18:02:59 +02:00
Ahmad Khalifa a60e7e6ff0 stand: compile ia32 EFI loader with -malign-double
The UEFI spec says:
> Structures are aligned on boundaries equal to the largest internal
> datum of the structure and internal data are implicitly padded to
> achieve natural alignment.

By default, structs containing members of type "long long" have 4 byte
alignment on i386. This caused some EFI structures to be subtly wrong.

Fix this by compiling the ia32 EFI loader with -malign-double, which
bumps the alignment up to 8 if such members are present.

MFC after:	3 days
2026-02-15 15:30:06 +02:00
Gordon Bergling fa567fe7c5 libsa/geli: Fix a typo in an error message
- s/crypo/crypto/

MFC after:	5 days
2026-02-07 06:20:16 +01:00
Warner Losh fe8105de14 stand: Minor style tweaks
re-wrap the function calls in a couple of ifs in get_zfs_root so they
are more readable. They really didn't need to be wrapped like this in
the first place.

Sponsored by:		Netflix
2026-02-04 10:29:11 -07:00
Alexander Ziaee 1f5795b642 INDEX.fonts: Minor maintenance
+ Mention relevance of this file in the vt manual screen.font entry
+ The vidfont manual is in section one, not eight
+ Remove leftover blank line from freebsd tag removal

MFC after:	3 days
2026-01-31 19:27:37 -05:00
John Baldwin fe45651224 stand: Add compiler builtins needed by GCC for RISC-V
Reviewed by:	mhorne
Differential Revision:	https://reviews.freebsd.org/D54963
2026-01-31 12:10:36 -05:00
John Baldwin 2e8ef82b34 stand: Use the correct OUTPUT_ARCH in the linker script for RISC-V
Compare to the OUTPUT_ARCH in sys/conf/ldscript.riscv.

Reviewed by:	mhorne
Differential Revision:	https://reviews.freebsd.org/D54962
2026-01-31 12:09:44 -05:00
Michael Osipov 56970c3c4b loader: Prefer comma-separated list of values for "console"
PR:		292595
Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54923
2026-01-29 09:44:45 +01:00
Michael Osipov 240c614d48 loader.conf.5: "console" setting does not document multi-value possiblity
PR:		292595
Approved by:	ziaee, dab, imp, tsoome
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D54843
2026-01-28 09:53:52 +01:00
Toomas Soome da33cae6c7 stand: fix typo in common/nvstore.c
Some out of order chars.
2026-01-28 10:38:26 +02:00
Toomas Soome ab5f29ae9e stand/zfs: fix path setup in zfs_mount()
Need to check argument 'path', not just allocated struct member.
2026-01-28 10:32:13 +02:00
Colin Percival ec2b3d786b loader: Only warn for !FDT && !ACPI take two
For unclear reasons, we used to print two warnings about not having a
DTB: First,
	printf("No valid device tree blob found!\n");
and immediately later a second,
	printf("WARNING! Trying to fire up the kernel, but no "
	    "device tree blob found!\n");

A previous commit silenced the second warning in the event that the
acpi.revision environment variable was set, on the theory that systems
which have ACPI might not need a DTB; this commit silences the first
of the two warnings under the same condition.

Reviewed by:	andrew
Fixes:	3989a3d817 ("loader: Only warn when we have neither FDT nor ACPI")
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D54772
2026-01-24 12:18:35 -08:00
Justin Hibbits dce3d3a8c0 powerpc/loader: Size the CAS PVR array correctly
Fixes:		895eeb492 ("powerpc/loader: Add CAS support for older CPUs")
MFC after:	1 week
2026-01-17 16:54:43 -05:00
Justin Hibbits 895eeb4923 powerpc/loader: Add CAS support for older CPUs
QEMU creates a "ibm,arch-vec-5-platform-support" property for all
pseries emulations.  Add POWER7 and POWER6 to the CAS list, more can be
added later as needed/desired.

MFC after:	1 week
2026-01-17 13:59:43 -05:00
kitkat1424 7b3fb3caef loader.efi(8): clarify UEFI boot path and boot1.efi usage
Reorganise and clarify the legacy role of boot1.efi in DESCRIPTION to
improve clarity.

Add a minor missing word in the BUGS section ["...caution is required*..."].

See also - PR: 290794

Signed-off-by: Aaditya Singh <aadityavksingh@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1939
2026-01-09 14:16:24 -07:00
Minsoo Choo fa6736526e stand: remove powerpcspe linker script
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by:	emaste
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1914
(cherry picked from commit 9c72e8e3500408f7ce5fc7be500dd3efc0307674)
2026-01-09 15:11:22 -05:00
Minsoo Choo 94d1731e73 Makefile*: remove powerpcspe
As reported on the freebsd-announce mailing list[1] FreeBSD is
continuing to retire 32-bit support.  Remove powerpcspe from build
infrastructure.

[1] https://lists.freebsd.org/archives/freebsd-announce/2024-February/000117.html

Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by:	jhibbits, emaste
Pull request:	https://github.com/freebsd/freebsd-src/pull/1914
2026-01-09 11:28:43 -05:00
Warner Losh 3989a3d817 loader: Only warn when we have neither FDT nor ACPI
Sponsored by:		Netflix
Reviewed by:		adrian, andrew
Differential Revision:	https://reviews.freebsd.org/D54510
2026-01-07 22:34:28 -07:00
Jarmo Jaakkola d82698ac68 loader.efi: Only use SPCR if enabled.
SerialPort in the SPCR is zeroed when serial redirection is disabled,
rather than the SPCR being omitted from the ACPI tables ony many
systems. Check to see that SerialPort.Address is non-zero before using.

FreeBSD would fail to boot on systems that could have a serial port
redireciton, but don't have it enabled because the loader would create a
bogus hw.uart.console. While one could unset this value to boot, you
couldn't do that automatically very easily. Instead, don't even look
at the SPCR table if the SerialPort is zero'd.

PR: 292206
MFC After: 3 days
Sponsored by: Netflix
Co-authored-by: Warner Losh <imp@FreeBSD.org>
Closes:  https://github.com/freebsd/freebsd-src/pull/1948
2026-01-07 22:28:44 -07:00
Kyle Evans e30086ab4c lualoader: fix pruning of non-existent default kernel
Removing the kernel from the list of available kernels is sufficient to
avoid rendering it in the list, but we need more for booting to actually
work.  Notably, the 'kernel' loader.conf var was left intact to its
default value, so if one didn't use the kernel selector in the menu then
we'd try to boot the nonexistent 'kernel' instead of the new default
(first autodetected).

There's room to improve the error messages here, but for now let's just
make it actually work correctly.

PR:		292232
Fixes:	d04415c520 ("loader: lua: remove the default kernel [...]")
2026-01-07 12:20:05 -06:00
Alexander Ziaee 1961785e35 pxeboot.8: Fix mdoc typo for emails, tag spdx
Fixes:		a37825313f (Fix mdoc typos for emails, tag spdx)
MFC after:	3 days
2026-01-06 17:47:54 -05:00
Frank Hilgendorf be6ba97aae loader.efi: add stride & offset for MacBookPro3,1
Note that there are three variants of this MacBook. We only have the
stride and offset values for the 17" 1680x1050 model.

Reviewed by:	vexeduxr
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1584
2026-01-06 18:29:01 +02:00
Ahmad Khalifa 9595055ae7 loader.efi: only use firmware provided Blt on GOP
gfx_state.tg_private points to a EFI_GRAPHICS_OUTPUT_PROTOCOL only when
using GOP.

The firmware provided Blt functions on UGA platforms have been observed
to not work on old MacBooks, and are likley hit or miss anyways as UGA
has been deprecated since 2006.

Reviewed by:	tsoome
PR:		291935
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54432
2026-01-04 15:15:37 +02:00
Ahmad Khalifa 5d85dde27b loader.efi: probe for UGA if GOP isn't found
Probe for UGA instead of returning early if we can't find GOP.

Reviewed by:	tsoome
PR:		291935
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54431
2026-01-04 15:15:02 +02:00
Warner Losh 8e8d7d489f loader: Use C99 initializations for file_format
For greppability, use C99 initializers for the struct file_format.

Sponsored by:		Netflix
2025-12-27 22:37:56 -07:00