Skip to content

Commit ca53577

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 e4665e8 commit ca53577

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
@@ -1655,7 +1655,7 @@ int boot_linux_from_mmc(void)
16551655
void *vbmeta_image_buf = NULL;
16561656
uint32_t vbmeta_image_sz = 0;
16571657
#endif
1658-
char *ptn_name = NULL;
1658+
char *ptn_name = "boot";
16591659
#if DEVICE_TREE
16601660
void * image_buf = NULL;
16611661
unsigned int dtb_size = 0;
@@ -1692,14 +1692,11 @@ int boot_linux_from_mmc(void)
16921692
goto unified_boot;
16931693
}
16941694

1695-
/* For a/b recovery image code is on boot partition.
1696-
If we support multislot, always use boot partition. */
1697-
if (boot_into_recovery &&
1698-
((!partition_multislot_is_supported()) ||
1699-
(target_dynamic_partition_supported())))
1695+
if (boot_into_recovery) {
1696+
if (partition_get_index("recovery") != INVALID_PTN) {
17001697
ptn_name = "recovery";
1701-
else
1702-
ptn_name = "boot";
1698+
}
1699+
}
17031700

17041701
retry_boot:
17051702
index = partition_get_index(ptn_name);

0 commit comments

Comments
 (0)