From d200f27ac3b8a4f58e52a5ee798e11e3fdf74924 Mon Sep 17 00:00:00 2001 From: kavsrf Date: Thu, 2 Feb 2017 11:40:40 +0300 Subject: double reboot in pre-test phase force boot messages --- DcsInt/DcsInt.c | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'DcsInt') diff --git a/DcsInt/DcsInt.c b/DcsInt/DcsInt.c index 1499069..e792993 100644 --- a/DcsInt/DcsInt.c +++ b/DcsInt/DcsInt.c @@ -994,20 +994,31 @@ UefiMain( if (!devFound) return OnExit(gOnExitNotFound, OnExitAuthNotFound, EFI_NOT_FOUND); } - // Try to find by OS partition GUID - if (SecRegionData == NULL && gPartitionGuidOS != NULL) { - UINTN i; - for (i = 0; i < gBIOCount; ++i) { - EFI_GUID guid; - res = EfiGetPartGUID(gBIOHandles[i], &guid); - if(EFI_ERROR(res)) continue; - if (memcmp(gPartitionGuidOS, &guid, sizeof(guid)) == 0) { - res = SecRegionLoadDefault(gBIOHandles[i]); - if (EFI_ERROR(res)) { - return OnExit(gOnExitNotFound, OnExitAuthNotFound, res); + // Force authorization + if (SecRegionData == NULL && gDcsBootForce != 0) { + res = EFI_NOT_FOUND; + if (gPartitionGuidOS != NULL) { + // Try to find by OS partition GUID + UINTN i; + for (i = 0; i < gBIOCount; ++i) { + EFI_GUID guid; + res = EfiGetPartGUID(gBIOHandles[i], &guid); + if (EFI_ERROR(res)) continue; + if (memcmp(gPartitionGuidOS, &guid, sizeof(guid)) == 0) { + res = SecRegionLoadDefault(gBIOHandles[i]); + break; } } + } else { + res = SecRegionLoadDefault(gFileRootHandle); + } + if (EFI_ERROR(res)) { + return OnExit(gOnExitNotFound, OnExitAuthNotFound, res); } + // force password type and message + gAuthPasswordType = gForcePasswordType; + gAuthPasswordMsg = gForcePasswordMsg; + gPasswordProgress = gForcePasswordProgress; } // ask any way? (by DcsBoot flag) -- cgit v1.2.3