diff options
author | Prakruthi Deepak Heragu <pheragu@codeaurora.org> | 2020-02-03 16:33:59 -0800 |
---|---|---|
committer | Amit Pundir <amit.pundir@linaro.org> | 2022-12-21 00:33:22 +0530 |
commit | f16bebd3b647964d2adae008485e7c55f850cad9 (patch) | |
tree | 4332d5133eaaa7b8d777631bf3dda39b15373ebe | |
parent | 07003625f3cad7444a78ab5cefb118e49e495bfd (diff) |
QcomModulePkg: Add support for booting device into recovery
From Header Version 3 onwards, there is no explicit partition for
recovery. boot.img acts as recovery image. The build system mentions
if boot has to be used for recovery through BUILD_USES_RECOVERY_AS_BOOT.
Using IsBuildUseRecoveryAsBoot() make decisions whether to use
recovery.img or boot.img as recovery.
Change-Id: Idae6d07a165da05d4b29c27ade0183a29cf8ce0f
-rw-r--r-- | QcomModulePkg/Library/BootLib/BootLinux.c | 7 | ||||
-rw-r--r-- | QcomModulePkg/Library/avb/VerifiedBoot.c | 6 |
2 files changed, 9 insertions, 4 deletions
diff --git a/QcomModulePkg/Library/BootLib/BootLinux.c b/QcomModulePkg/Library/BootLib/BootLinux.c index cacdc501cf..5919b99ac6 100644 --- a/QcomModulePkg/Library/BootLib/BootLinux.c +++ b/QcomModulePkg/Library/BootLib/BootLinux.c @@ -1160,13 +1160,16 @@ BootLinux (BootInfo *Info) (UINTN *)&BootParamlistPtr.ImageSize, ((!Info->MultiSlotBoot || IsDynamicPartitionSupport ()) && - Recovery)? "recovery" : "boot"); + (Recovery && + !IsBuildUseRecoveryAsBoot ()))? + "recovery" : "boot"); if (Status != EFI_SUCCESS || BootParamlistPtr.ImageBuffer == NULL || BootParamlistPtr.ImageSize <= 0) { DEBUG ((EFI_D_ERROR, "BootLinux: Get%aImage failed!\n", (!Info->MultiSlotBoot && - Recovery)? "Recovery" : "Boot")); + (Recovery && + !IsBuildUseRecoveryAsBoot ()))? "Recovery" : "Boot")); return EFI_NOT_STARTED; } /* Find if MDTP is enabled and Active */ diff --git a/QcomModulePkg/Library/avb/VerifiedBoot.c b/QcomModulePkg/Library/avb/VerifiedBoot.c index 438679d998..abacaa2429 100644 --- a/QcomModulePkg/Library/avb/VerifiedBoot.c +++ b/QcomModulePkg/Library/avb/VerifiedBoot.c @@ -1176,7 +1176,8 @@ LoadImageAndAuthVB2 (BootInfo *Info) if ( ( (!Info->MultiSlotBoot) || IsDynamicPartitionSupport ()) && - Info->BootIntoRecovery) { + (Info->BootIntoRecovery && + !IsBuildUseRecoveryAsBoot ())) { AddRequestedPartition (RequestedPartitionAll, IMG_RECOVERY); NumRequestedPartition += 1; Result = avb_slot_verify (Ops, (CONST CHAR8 *CONST *)RequestedPartition, @@ -1313,7 +1314,8 @@ LoadImageAndAuthVB2 (BootInfo *Info) GUARD_OUT (GetImage (Info, &ImageBuffer, &ImageSize, ( (!Info->MultiSlotBoot || IsDynamicPartitionSupport ()) && - Info->BootIntoRecovery) ? + (Info->BootIntoRecovery && + !IsBuildUseRecoveryAsBoot ())) ? "recovery" : "boot")); if (ImageSize < sizeof (boot_img_hdr)) { |