Report if UEFI is missing (can't read variables)

This commit is contained in:
Lauri Kenttä
2025-01-02 19:16:18 +02:00
parent afd0780b61
commit a1f6297759
2 changed files with 21 additions and 14 deletions

View File

@@ -966,7 +966,14 @@ public class Setup {
InitEspPath();
InitEspInfo();
var bootLog = $"\n--- BOOT LOG START ---\n{Efi.GetHackBGRTLog()}\n--- BOOT LOG END ---";
Func<string> tryGetBootLog = () => {
try {
return $"\n--- BOOT LOG START ---\n{Efi.GetHackBGRTLog()}\n--- BOOT LOG END ---";
} catch (NotImplementedException e) {
throw new SetupException($"Looks like you're not booting in UEFI mode. ({e.Message})");
}
};
var bootLog = tryGetBootLog();
Setup.Log(bootLog);
Efi.LogBGRT();
EfiBootEntries.TryLogEntries();