Add SBAT section to the EFI binaries

This commit is contained in:
Lauri Kenttä
2023-11-09 10:44:48 +02:00
parent be8a5d35d2
commit 9b3b045a21
3 changed files with 14 additions and 4 deletions

View File

@@ -477,8 +477,8 @@ EFI_STATUS EFIAPI EfiMain(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *ST_) {
fail: {
Print(L"HackBGRT has failed. Use parameter debug=1 for details.\n");
Print(L"Get a Windows install disk or a recovery disk to fix your boot.\n");
#ifdef GIT_DESCRIBE
Print(L"HackBGRT version: " GIT_DESCRIBE L"\n");
#ifdef GIT_DESCRIBE_W
Print(L"HackBGRT version: " GIT_DESCRIBE_W L"\n");
#else
Print(L"HackBGRT version: unknown; not an official release?\n");
#endif

10
src/sbat.c Normal file
View File

@@ -0,0 +1,10 @@
#ifdef GIT_DESCRIBE
#define SBAT_READABLE_VERSION GIT_DESCRIBE
#else
#define SBAT_READABLE_VERSION "unknown"
#endif
const char sbat[] __attribute__ ((section (".sbat"))) =
"sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md\n"
"hackbgrt,1,Metabolix,HackBGRT," SBAT_READABLE_VERSION ",https://github.com/Metabolix/HackBGRT\n"
;