diff options
author | Prakruthi Deepak Heragu <pheragu@codeaurora.org> | 2020-02-03 16:33:59 -0800 |
---|---|---|
committer | Amit Pundir <amit.pundir@linaro.org> | 2022-05-30 14:46:00 +0530 |
commit | cc4dab50af32ff87e3421949207f0e2df6040768 (patch) | |
tree | b315c95a6bdd8c15d675f3de94c3c73cc8129110 | |
parent | 6db63451ac045cf5d4507321ec6f7f0b74a7c7ed (diff) |
QcomModulePkg: Add support for booting device into recovery
(cherry picked from commit 70ad7f4ab713334a7c1d822c6daf58e5847b830f)
https://source.codeaurora.org/quic/la/abl/tianocore/edk2/tree/?h=LA.VENDOR.1.0.r1-11900-WAIPIO.0
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
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
-rw-r--r-- | QcomModulePkg/Library/BootLib/BootLinux.c | 7 | ||||
-rwxr-xr-x | 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 112151d2f6..5e0f18a1e2 100644 --- a/QcomModulePkg/Library/BootLib/BootLinux.c +++ b/QcomModulePkg/Library/BootLib/BootLinux.c @@ -1157,13 +1157,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 4224ebb335..ce364d1b70 100755 --- a/QcomModulePkg/Library/avb/VerifiedBoot.c +++ b/QcomModulePkg/Library/avb/VerifiedBoot.c @@ -1191,7 +1191,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, @@ -1337,7 +1338,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)) { |