boot_control: Do not swap guid's for the xbl_config partition
Selection of the appropriate a/b version of xbl_config is handled
by the bootloader based on the active LUN being booted from. We do
not need to swap GUID's for this partition.
We also now correctly return a error when setting the active slot on
one of the LUN's fails.
Change-Id: Idad9d0aa3b3e2e1bd29c90414b06898e967abb8a
diff --git a/boot_control.cpp b/boot_control.cpp
index 539c52c..7319f9a 100644
--- a/boot_control.cpp
+++ b/boot_control.cpp
@@ -464,7 +464,8 @@
memcpy((void*)inactive_guid, (const void*)pentryA,
TYPE_GUID_SIZE);
} else {
- ALOGE("Both A & B are inactive..Aborting");
+ ALOGE("Both A & B for %s are inactive..Aborting",
+ prefix.c_str());
goto error;
}
if (!strncmp(slot_suffix_arr[slot], AB_SLOT_A_SUFFIX,
@@ -536,8 +537,14 @@
//actual names. To do this we append the slot suffix to every member
//in the list.
for (i = 0; i < ARRAY_SIZE(ptn_list); i++) {
- //XBL is handled differrently for ufs devices so ignore it
- if (is_ufs && !strncmp(ptn_list[i], PTN_XBL, strlen(PTN_XBL)))
+ //XBL & XBL_CFG are handled differrently for ufs devices so
+ //ignore them
+ if (is_ufs && (!strncmp(ptn_list[i],
+ PTN_XBL,
+ strlen(PTN_XBL))
+ || !strncmp(ptn_list[i],
+ PTN_XBL_CFG,
+ strlen(PTN_XBL_CFG))))
continue;
//The partition list will be the list of _a partitions
string cur_ptn = ptn_list[i];
@@ -560,7 +567,11 @@
for (map_iter = ptn_map.begin(); map_iter != ptn_map.end(); map_iter++){
if (map_iter->second.size() < 1)
continue;
- boot_ctl_set_active_slot_for_partitions(map_iter->second, slot);
+ if (boot_ctl_set_active_slot_for_partitions(map_iter->second,
+ slot)) {
+ ALOGE("%s: Failed to set active slot", __func__);
+ goto error;
+ }
}
if (is_ufs) {
if (!strncmp(slot_suffix_arr[slot], AB_SLOT_A_SUFFIX,