diff options
Diffstat (limited to 'lib/avb/fsl/fsl_bootctrl.c')
-rwxr-xr-x | lib/avb/fsl/fsl_bootctrl.c | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/lib/avb/fsl/fsl_bootctrl.c b/lib/avb/fsl/fsl_bootctrl.c index 38733cebb1..53c4113890 100755 --- a/lib/avb/fsl/fsl_bootctrl.c +++ b/lib/avb/fsl/fsl_bootctrl.c @@ -462,10 +462,6 @@ out: #define PARTITION_NAME_LEN 13 #define PARTITION_BOOTLOADER "bootloader" -#ifdef CONFIG_ANDROID_AUTO_SUPPORT -/* This should always sync with the gpt */ -#define PARTITION_MISC_ID 9 -#endif extern int mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value); @@ -487,11 +483,7 @@ int fsl_save_metadata_if_changed_dual_uboot(struct blk_desc *dev_desc, /* Save metadata if changed. */ if (memcmp(ab_data, ab_data_orig, sizeof(struct bootloader_control)) != 0) { /* Get misc partition info */ -#ifdef CONFIG_ANDROID_AUTO_SUPPORT - if (part_get_info(dev_desc, PARTITION_MISC_ID, &info) == -1) { -#else - if (part_get_info_by_name(dev_desc, FASTBOOT_PARTITION_MISC, &info) == -1) { -#endif + if (part_get_info_efi_by_name(dev_desc, FASTBOOT_PARTITION_MISC, &info) == -1) { printf("Can't get partition info of partition: misc\n"); return -1; } @@ -519,11 +511,7 @@ int fsl_load_metadata_dual_uboot(struct blk_desc *dev_desc, struct bootloader_control serialized; size_t num_bytes; -#ifdef CONFIG_ANDROID_AUTO_SUPPORT - if (part_get_info(dev_desc, PARTITION_MISC_ID, &info) == -1) { -#else - if (part_get_info_by_name(dev_desc, FASTBOOT_PARTITION_MISC, &info) == -1) { -#endif + if (part_get_info_efi_by_name(dev_desc, FASTBOOT_PARTITION_MISC, &info) == -1) { printf("Can't get partition info of partition: misc\n"); return -1; } else { @@ -888,10 +876,9 @@ AvbABFlowResult avb_flow_dual_uboot(AvbABOps* ab_ops, AvbOps* ops = ab_ops->ops; AvbSlotVerifyData* slot_data = NULL; AvbSlotVerifyData* data = NULL; - AvbABFlowResult ret; + AvbABFlowResult ret = 0; struct bootloader_control ab_data, ab_data_orig; AvbIOResult io_ret; - bool saw_and_allowed_verification_error = false; AvbSlotVerifyResult verify_result; bool set_slot_unbootable = false; int target_slot, n; @@ -960,8 +947,7 @@ AvbABFlowResult avb_flow_dual_uboot(AvbABOps* ab_ops, "AVB_SLOT_VERIFY_FLAGS_ALLOW_VERIFICATION_ERROR " "is set.\n", NULL); - saw_and_allowed_verification_error = - true; + ret = AVB_AB_FLOW_RESULT_OK_WITH_VERIFICATION_ERROR; } else { set_slot_unbootable = true; } @@ -1040,13 +1026,6 @@ AvbABFlowResult avb_flow_dual_uboot(AvbABOps* ab_ops, avb_assert(slot_data != NULL); data = slot_data; slot_data = NULL; - if (saw_and_allowed_verification_error) { - avb_assert( - flags & AVB_SLOT_VERIFY_FLAGS_ALLOW_VERIFICATION_ERROR); - ret = AVB_AB_FLOW_RESULT_OK_WITH_VERIFICATION_ERROR; - } else { - ret = AVB_AB_FLOW_RESULT_OK; - } out: io_ret = fsl_save_metadata_if_changed(ab_ops, &ab_data, &ab_data_orig); @@ -1212,11 +1191,10 @@ AvbABFlowResult avb_ab_flow_fast(AvbABOps* ab_ops, AvbOps* ops = ab_ops->ops; AvbSlotVerifyData* slot_data[2] = {NULL, NULL}; AvbSlotVerifyData* data = NULL; - AvbABFlowResult ret; + AvbABFlowResult ret = 0; struct bootloader_control ab_data, ab_data_orig; size_t slot_index_to_boot, n; AvbIOResult io_ret; - bool saw_and_allowed_verification_error = false; size_t target_slot; AvbSlotVerifyResult verify_result; bool set_slot_unbootable = false; @@ -1285,9 +1263,8 @@ AvbABFlowResult avb_ab_flow_fast(AvbABOps* ab_ops, "AVB_SLOT_VERIFY_FLAGS_ALLOW_VERIFICATION_ERROR " "is set.\n", NULL); - saw_and_allowed_verification_error = - true; slot_index_to_boot = target_slot; + ret = AVB_AB_FLOW_RESULT_OK_WITH_VERIFICATION_ERROR; n = 2; } else { set_slot_unbootable = true; @@ -1375,13 +1352,6 @@ AvbABFlowResult avb_ab_flow_fast(AvbABOps* ab_ops, avb_assert(slot_data[slot_index_to_boot] != NULL); data = slot_data[slot_index_to_boot]; slot_data[slot_index_to_boot] = NULL; - if (saw_and_allowed_verification_error) { - avb_assert( - flags & AVB_SLOT_VERIFY_FLAGS_ALLOW_VERIFICATION_ERROR); - ret = AVB_AB_FLOW_RESULT_OK_WITH_VERIFICATION_ERROR; - } else { - ret = AVB_AB_FLOW_RESULT_OK; - } /* ... and decrement tries remaining, if applicable. */ if (!ab_data.slot_info[slot_index_to_boot].successful_boot && |