Skip to content

Commit d81ad9c

Browse files
me-cafebabestephan-gh
authored andcommitted
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 88c6e65 commit d81ad9c

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
@@ -1611,7 +1611,7 @@ int boot_linux_from_mmc(void)
16111611
void *vbmeta_image_buf = NULL;
16121612
uint32_t vbmeta_image_sz = 0;
16131613
#endif
1614-
char *ptn_name = NULL;
1614+
char *ptn_name = "boot";
16151615
#if DEVICE_TREE
16161616
void * image_buf = NULL;
16171617
unsigned int dtb_size = 0;
@@ -1647,14 +1647,11 @@ int boot_linux_from_mmc(void)
16471647
goto unified_boot;
16481648
}
16491649

1650-
/* For a/b recovery image code is on boot partition.
1651-
If we support multislot, always use boot partition. */
1652-
if (boot_into_recovery &&
1653-
((!partition_multislot_is_supported()) ||
1654-
(target_dynamic_partition_supported())))
1650+
if (boot_into_recovery) {
1651+
if (partition_get_index("recovery") != INVALID_PTN) {
16551652
ptn_name = "recovery";
1656-
else
1657-
ptn_name = "boot";
1653+
}
1654+
}
16581655

16591656
index = partition_get_index(ptn_name);
16601657
ptn = partition_get_offset(index);

0 commit comments

Comments
 (0)