Skip to content

Commit 66dbaf9

Browse files
jackpot51crawfxrd
authored andcommitted
System76PayloadPkg: Notify System76 security callback prior to loading boot options
Signed-off-by: Jeremy Soller <jeremy@system76.com> Signed-off-by: Tim Crawford <tcrawford@system76.com>
1 parent 7b3eb55 commit 66dbaf9

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

System76PayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
1010
#include "PlatformBootManager.h"
1111
#include "PlatformConsole.h"
1212

13+
// GUID for System76 security driver
14+
EFI_GUID SYSTEM76_SECURITY_PROTOCOL_GUID = {0x764247c4, 0xa859, 0x4a6b, {0xb5, 0x00, 0xed, 0x5d, 0x7a, 0x70, 0x7d, 0xd4}};
15+
16+
typedef struct {
17+
// Run System76 security driver, will return true if we should boot immediately
18+
BOOLEAN (EFIAPI *Run)(VOID);
19+
} SYSTEM76_SECURITY_PROTOCOL;
20+
1321
/**
1422
Signal EndOfDxe event and install SMM Ready to lock protocol.
1523
@@ -118,6 +126,7 @@ PlatformBootManagerAfterConsole (
118126
EFI_GRAPHICS_OUTPUT_BLT_PIXEL White;
119127
EDKII_PLATFORM_LOGO_PROTOCOL *PlatformLogo;
120128
EFI_STATUS Status;
129+
SYSTEM76_SECURITY_PROTOCOL *System76Security;
121130

122131
Black.Blue = Black.Green = Black.Red = Black.Reserved = 0;
123132
White.Blue = White.Green = White.Red = White.Reserved = 0xFF;
@@ -149,6 +158,16 @@ PlatformBootManagerAfterConsole (
149158
// Process TPM PPI request
150159
//
151160
Tcg2PhysicalPresenceLibProcessRequest (NULL);
161+
162+
// If System76 security driver is installed
163+
Status = gBS->LocateProtocol (&SYSTEM76_SECURITY_PROTOCOL_GUID, NULL, (VOID **) &System76Security);
164+
if (!EFI_ERROR (Status)) {
165+
// Run System76 security driver
166+
if (System76Security->Run ()) {
167+
// Skip boot timeout if requested
168+
PcdSet16S (PcdPlatformBootTimeOut, 0);
169+
}
170+
}
152171
}
153172

154173
/**

0 commit comments

Comments
 (0)