android: fix retry mechanism with ab system
Minus the retry-count in every boot with ab system. If the ab system boot success, the system service boot_ctrl reset the retry-count or set boot-successful. Change-Id: Ic37f65b745d1feb978730332835246dc43d72dab Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
This commit is contained in:
parent
74b485fb2b
commit
f44ca27357
|
|
@ -574,17 +574,18 @@ static AvbSlotVerifyResult android_slot_verify(char *boot_partname,
|
||||||
memcpy((uint8_t *)load_address,
|
memcpy((uint8_t *)load_address,
|
||||||
slot_data[0]->loaded_partitions->data,
|
slot_data[0]->loaded_partitions->data,
|
||||||
slot_data[0]->loaded_partitions->data_size);
|
slot_data[0]->loaded_partitions->data_size);
|
||||||
|
|
||||||
/* ... and decrement tries remaining, if applicable. */
|
|
||||||
if (!ab_data.slots[slot_index_to_boot].successful_boot &&
|
|
||||||
ab_data.slots[slot_index_to_boot].tries_remaining > 0) {
|
|
||||||
ab_data.slots[slot_index_to_boot].tries_remaining -= 1;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
slot_set_unbootable(&ab_data.slots[slot_index_to_boot]);
|
slot_set_unbootable(&ab_data.slots[slot_index_to_boot]);
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
#ifdef CONFIG_ANDROID_AB
|
||||||
|
/* ... and decrement tries remaining, if applicable. */
|
||||||
|
if (!ab_data.slots[slot_index_to_boot].successful_boot &&
|
||||||
|
ab_data.slots[slot_index_to_boot].tries_remaining > 0) {
|
||||||
|
ab_data.slots[slot_index_to_boot].tries_remaining -= 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
env_update("bootargs", verify_state);
|
env_update("bootargs", verify_state);
|
||||||
if (save_metadata_if_changed(ops->ab_ops, &ab_data, &ab_data_orig)) {
|
if (save_metadata_if_changed(ops->ab_ops, &ab_data, &ab_data_orig)) {
|
||||||
printf("Can not save metadata\n");
|
printf("Can not save metadata\n");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue