After OSUpdate device not booting from slot B even after marking slot B as active

210 Views Asked by At

I am working on the OSUpdate feature.When OSUpdate starts, the AOSP mark the target/next slot as active. So when update the successful, in next boot the device will boot from next slot or we can say the slot which is marked as active. Currently I am stuck in the scenario where in the abrupt/immediate battery removal (1-2 sec) after successful OSUpdate, the device is not able to boot from the marked active slot. Instead it is booting from the previous slot. Whereas if the battery is being removed after 6-7 sec of successful OSUpdate, the device is booting from the next slot.

I tried putting logs in

/hardware/qcom/bootctrl/boot_control.cpp

set_active_boot_slot() to see whether this method is taking time to set the next slot as active or not. And I found that marking of target/next slot as active is successful. It is not taking time.

Here is the logs :

07-05 07:40:11.511 E/[email protected](  636): ************ Entry setActiveBootSlot()**********
07-05 07:40:11.511 I/OSUpdateManager( 5625): update_engine onStatusUpdate status_code = 5 percentage = NaN
07-05 07:40:11.509 W/[email protected](  636): type=1400 audit(0.0:3942): avc: denied { getattr } for path="/dev/block/mmcblk0p62" dev="tmpfs" ino=17342 scontext=u:r:hal_bootctl_default:s0 tcontext=u:object_r:dtbo_block_device_ab:s0 tclass=blk_file permissive=0
07-05 07:40:11.516 E/[email protected](  636): ****** ret= 0 , ****** Exiting setActiveBootSlot()****
07-05 07:40:11.516 I/update_engine( 2947): [0705/074011.516883:INFO:boot_control_android.cc(171)] SetActiveBootSlot : isOk()= 1
07-05 07:40:11.517 I/update_engine( 2947): [0705/074011.517186:INFO:postinstall_runner_action.cc(345)] install_plan_ checking if target slot is bootable: 1
07-05 07:40:11.517 I/update_engine( 2947): [0705/074011.517949:INFO:postinstall_runner_action.cc(347)] install_plan_ and Yes target slot is bootable: 
07-05 07:40:11.518 I/update_engine( 2947): [0705/074011.518003:INFO:postinstall_runner_action.cc(368)] All post-install commands succeeded
07-05 07:40:11.519 I/update_engine( 2947): [0705/074011.519100:INFO:action_processor.cc(116)] ActionProcessor: finished last action PostinstallRunnerAction with code ErrorCode::kSuccess
07-05 07:40:11.519 I/update_engine( 2947): [0705/074011.519224:INFO:update_attempter_android.cc(456)] Processing Done.
07-05 07:40:11.519 I/update_engine( 2947): [0705/074011.519715:INFO:update_attempter_android.cc(464)] Update successfully applied, waiting to reboot.
07-05 07:40:11.520 I/OSUpdateManager( 5625): update_engine onStatusUpdate status_code = 6 percentage = 0.0
07-05 07:40:11.522 I/OSUpdateManager( 5625): update_engine onPayloadApplicationComplete error_code = 0
07-05 07:40:11.524 I/OSUpdateManager( 5625): UpdateHandler case UPDATE_SUCCESS
07-05 07:40:11.528 I/update_engine( 2947): [0705/074011.528371:INFO:metrics_reporter_android.cc(29)] uploading 1 to histogram for metric ota_update_engine_attempt_number
07-05 07:40:11.528 I/update_engine( 2947): [0705/074011.528513:INFO:metrics_reporter_android.cc(29)] uploading 0 to histogram for metric ota_update_engine_attempt_payload_type
07-05 07:40:11.528 I/update_engine( 2947): [0705/074011.528696:INFO:metrics_reporter_android.cc(29)] uploading 4 to histogram for metric ota_update_engine_attempt_duration_boottime_in_minutes
07-05 07:40:11.528 I/update_engine( 2947): [0705/074011.528761:INFO:metrics_reporter_android.cc(29)] uploading 4 to histogram for metric ota_update_engine_attempt_duration_monotonic_in_minutes
07-05 07:40:11.528 I/update_engine( 2947): [0705/074011.528826:INFO:metrics_reporter_android.cc(29)] uploading 1277 to histogram for metric ota_update_engine_attempt_payload_size_mib
07-05 07:40:11.528 I/update_engine( 2947): [0705/074011.528890:INFO:metrics_reporter_android.cc(29)] uploading 0 to histogram for metric ota_update_engine_attempt_result
07-05 07:40:11.528 I/update_engine( 2947): [0705/074011.528954:INFO:metrics_reporter_android.cc(29)] uploading 0 to histogram for metric ota_update_engine_attempt_error_code
07-05 07:40:11.529 I/update_engine( 2947): [0705/074011.529335:INFO:metrics_reporter_android.cc(29)] uploading 1339436263 to histogram for metric ota_update_engine_attempt_current_bytes_downloaded_mib
07-05 07:40:11.530 I/update_engine( 2947): [0705/074011.530710:INFO:metrics_reporter_android.cc(29)] uploading 1 to histogram for metric ota_update_engine_successful_update_attempt_count
07-05 07:40:11.530 I/update_engine( 2947): [0705/074011.530786:INFO:metrics_reporter_android.cc(29)] uploading 0 to histogram for metric ota_update_engine_successful_update_payload_type
07-05 07:40:11.530 I/update_engine( 2947): [0705/074011.530851:INFO:metrics_reporter_android.cc(29)] uploading 1277 to histogram for metric ota_update_engine_successful_update_payload_size_mib
07-05 07:40:11.530 I/update_engine( 2947): [0705/074011.530916:INFO:metrics_reporter_android.cc(29)] uploading 1277 to histogram for metric ota_update_engine_successful_update_total_bytes_downloaded_mib
07-05 07:40:11.531 I/update_engine( 2947): [0705/074011.530979:INFO:metrics_reporter_android.cc(29)] uploading 0 to histogram for metric ota_update_engine_successful_update_download_overhead_percentage
07-05 07:40:11.531 I/update_engine( 2947): [0705/074011.531044:INFO:metrics_reporter_android.cc(29)] uploading 4 to histogram for metric ota_update_engine_successful_update_total_duration_in_minutes
07-05 07:40:11.531 I/update_engine( 2947): [0705/074011.531190:INFO:metrics_reporter_android.cc(29)] uploading 0 to histogram for metric ota_update_engine_successful_update_reboot_count
07-05 07:40:11.532 I/update_engine( 2947): [0705/074011.531896:INFO:metrics_utils.cc(353)] Updated Marker = 1/1/1970 0:16:15 GMT
07-05 07:40:11.563 I/OSUpdateManager( 5625): status WAITING_FOR_REBOOT
07-05 07:40:11.576 I/OSUpdateManager( 5625): UPDATE_SUCCESS suppress_reboot = false

Any help will be appreciated.

0

There are 0 best solutions below