From b5006f7771e82953cc3179024a2c5ee74191c46b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20Kentt=C3=A4?= Date: Sat, 14 May 2016 11:46:58 +0300 Subject: [PATCH] In debug mode, confirm before booting --- src/main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index ce51a1e..b7e4d5b 100644 --- a/src/main.c +++ b/src/main.c @@ -280,13 +280,19 @@ EFI_STATUS EFIAPI EfiMain(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *ST_) { goto fail; } - Debug(L"HackBGRT: Loading and booting %s.\n", config.boot_path); + Debug(L"HackBGRT: Loading %s.\n", config.boot_path); EFI_DEVICE_PATH* boot_dp = FileDevicePath(image->DeviceHandle, (CHAR16*) config.boot_path); EFI_HANDLE next_image_handle; if (EFI_ERROR(BS->LoadImage(0, image_handle, boot_dp, 0, 0, &next_image_handle))) { Print(L"HackBGRT: LoadImage for new image (%s) failed.\n", config.boot_path); goto fail; } + if (config.debug) { + Print(L"HackBGRT: Ready to boot.\nPress escape to cancel, any other key to boot.\n"); + if (ReadKey().ScanCode == SCAN_ESC) { + return 0; + } + } if (EFI_ERROR(BS->StartImage(next_image_handle, 0, 0))) { Print(L"HackBGRT: StartImage for %s failed.\n", config.boot_path); goto fail;