Page MenuHomeFreeBSD

Various boot1 enhancemnets
AbandonedPublic

Authored by imp on Aug 29 2017, 9:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 27, 8:40 PM
Unknown Object (File)
Feb 16 2024, 11:18 PM
Unknown Object (File)
Jan 16 2024, 7:47 PM
Unknown Object (File)
Nov 3 2023, 4:12 AM
Unknown Object (File)
Aug 18 2023, 8:37 AM
Unknown Object (File)
Jan 15 2023, 8:32 PM
Unknown Object (File)
Dec 1 2022, 8:58 PM
Subscribers
None

Details

Summary

Make efichar.c routines available to libefi.

Make efichar.c routines available to libefi as well as
libefivar. Define LIBEFI when building so we can conditionally include
stand.h vs the normal userland stuff.

boot1.efi: print more info about where boot1.efi is loaded from

Print the device that boot1.efi was loaded from. Print the path as
well (since it isn't included in DeviceHandle). Move block where we do
this earlier so all the block handle code is now together.

Exit rather than panic for most errors.

In the FreeBSD UEFI boot protocol, boot1.efi exits back to UEFI if it
can't boot the image for most reasons (so that further items in the
EFI boot manger list can be tried). Rename panic to efi_panic, make it
static and give it an extra status argument. Exit back to UEFI with
that status argument so the next loader can be tried.

Use malloc/free exclusively instead of mixing malloc/free and
AllocatePool/FreePool. The code is smaller.

Save where we're booted from

Record the file path for boot1.efi as the UEFI environemnt variable
FreeBSDBootVarGUID:Boot1Path. Record the device this came from as
FreeBSDBootVarGUID:Boot1Dev. While later stages of the boot may be
able to guess these values by retrieving UEFIGlobal:BootCurrent and
groveling through the correct UEFIGlobal:BootXXXX, this provides
certanty in the face of behavior from any part of the boot loader
chain that might "guess" what to do next. These env variables are
volatile and will disappear on reboot.

Test Plan

More of a preview than a ready to commit bundle for comment...

There's 4 changes here....

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 11291
Build 11657: arc lint + arc unit