Skip to content

Commit 334417a

Browse files
committed
aboot: Correct the logic for selecting partition for recovery mode
There is actually msm89xx devices with A/B partition scheme that has a dedicated recovery partition on the market, even though Android recommends to remove recovery partition for A/B devices. It is not related with dynamic partitions at all, dynamic partitions supports both non-A/B and A/B configurations. Let's just automatically detect whether if a dedicated recovery partition is present or not, and use it if it's present.
1 parent 4d1e0d2 commit 334417a

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

app/aboot/aboot.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,7 @@ int boot_linux_from_mmc(void)
16611661
void *vbmeta_image_buf = NULL;
16621662
uint32_t vbmeta_image_sz = 0;
16631663
#endif
1664-
char *ptn_name = NULL;
1664+
char *ptn_name = "boot";
16651665
#if DEVICE_TREE
16661666
void * image_buf = NULL;
16671667
unsigned int dtb_size = 0;
@@ -1698,14 +1698,11 @@ int boot_linux_from_mmc(void)
16981698
goto unified_boot;
16991699
}
17001700

1701-
/* For a/b recovery image code is on boot partition.
1702-
If we support multislot, always use boot partition. */
1703-
if (boot_into_recovery &&
1704-
((!partition_multislot_is_supported()) ||
1705-
(target_dynamic_partition_supported())))
1701+
if (boot_into_recovery) {
1702+
if (partition_get_index("recovery") != INVALID_PTN) {
17061703
ptn_name = "recovery";
1707-
else
1708-
ptn_name = "boot";
1704+
}
1705+
}
17091706

17101707
retry_boot:
17111708
index = partition_get_index(ptn_name);

0 commit comments

Comments
 (0)