From 8b46ad6f40df85c1939196f0f75e46d212193756 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 25 Apr 2024 10:21:19 +0200 Subject: MHR-16: Prevent other EFI from booting. Signed-off-by: Amlal El Mahrouss --- Private/FirmwareKit/EFI/API.hxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Private/FirmwareKit/EFI/API.hxx b/Private/FirmwareKit/EFI/API.hxx index 0e2ef200..093d10b3 100644 --- a/Private/FirmwareKit/EFI/API.hxx +++ b/Private/FirmwareKit/EFI/API.hxx @@ -121,6 +121,13 @@ inline void InitEFI(EfiSystemTable *SystemTable) noexcept { ST->BootServices->SetWatchdogTimer(0, 0, 0, nullptr); ST->ConOut->EnableCursor(ST->ConOut, false); + + if (ST->FirmwareVendor[0] != '@' || + ST->FirmwareVendor[1] != 'M' || + ST->FirmwareVendor[1] != 'H' || + ST->FirmwareVendor[1] != 'R') { + EFI::ThrowError(L"Unsupported Firmware", L"Firmware is unsupported, please build OVMF by yourself."); + } } #ifdef __BOOTLOADER__ -- cgit v1.2.3