'pb while applying incremental android OTA on pixel

I am building my own AOSP that include full and incremental OTA updates. My device is a google pixel running a 7.1.1.

I can perfectly build android images and generating OTA.
Within the AOSP, my steps are the following one :

  • update_api ;
  • droid (default target for generating android images) ;
  • brillo_update_payload ;
  • dist

Then I am generating OTA packages like this:

$ ./build/tools/releasetools/ota_from_target_files dist_output/tardis-target_files.zip ota_update.zip

and

$ ./build/tools/releasetools/ota_from_target_files -i PREVIOUS-tardis-target_files.zip dist_output/tardis-target_files.zip incremental_ota_update.zip # make incremental from the older version

It works fine for the full OTA, but it failed for the differential one. The logcat I have while applying the OTA is the following one:

04-05 08:13:07.156 2407 2421 D AMA.ou.Update: onStatusUpdate: status=3, progression=31.58676%

04-05 08:13:07.157 2407 2420 D AMA.ou.Update: onStatusUpdate: status=3, progression=32.635754%

04-05 08:13:07.166 2407 2407 D AMA.ou.UpdateView: Updating progressbar to 26%

04-05 08:13:07.166 2407 2407 D AMA.ou.UpdateView: Updating progressbar to 27%

04-05 08:13:07.166 2407 2407 D AMA.ou.UpdateView: Updating progressbar to 28%

04-05 08:13:07.167 2407 2407 D AMA.ou.UpdateView: Updating progressbar to 29%

04-05 08:13:07.167 2407 2407 D AMA.ou.UpdateView: Updating progressbar to 30%

04-05 08:13:07.167 2407 2407 D AMA.ou.UpdateView: Updating progressbar to 31%

04-05 08:13:07.168 2407 2407 D AMA.ou.UpdateView: Updating progressbar to 32%

04-05 08:13:08.783 643 643 I update_engine: [0405/081308:INFO:delta_performer.cc(359)] Applying 8991 operations to partition "system"

04-05 08:13:08.800 643 643 E update_engine: [0405/081308:ERROR:delta_performer.cc(1060)]

The hash of the source data on disk for this operation doesn't match the expected value. This could mean that the delta update payload was targeted for another version, or that the source partition was modified after it was installed, for example, by mounting a filesystem.

04-05 08:13:08.800 643 643 E update_engine: [0405/081308:ERROR:delta_performer.cc(1065)] Expected: sha256|hex = 8F508C72E6E95A3D98EA0B5F3A5D29BADE2224A09930FF479B1B4FE2D7AAAEDA

04-05 08:13:08.800 643 643 E update_engine: [0405/081308:ERROR:delta_performer.cc(1068)] Calculated: sha256|hex = 6BAA0BB1F6E02DBE752235E0BC7F5DA075340781B78E88BC61214C0DE353E5A6

04-05 08:13:08.800 643 643 E update_engine: [0405/081308:ERROR:delta_performer.cc(1077)] Operation source (offset:size) in blocks: 129:16

04-05 08:13:08.800 643 643 E update_engine: [0405/081308:ERROR:delta_performer.cc(1142)] ValidateSourceHash(source_hasher.raw_hash(), operation, error) failed.

04-05 08:13:08.800 643 643 E update_engine: [0405/081308:ERROR:delta_performer.cc(283)] Failed to perform SOURCE_COPY operation 13, which is the operation 2 in partition "system"

04-05 08:13:08.800 643 643 E update_engine: [0405/081308:ERROR:download_action.cc(273)] Error 20 in DeltaPerformer's Write method when processing the received payload -- Terminating processing

04-05 08:13:08.806 1033 1721 D DnsEventListenerService: Logging 100 results for netId 100

04-05 08:13:08.809 643 643 I update_engine: [0405/081308:INFO:multi_range_http_fetcher.cc(171)] Received transfer terminated.

04-05 08:13:08.809 643 643 I update_engine: [0405/081308:INFO:multi_range_http_fetcher.cc(123)] TransferEnded w/ code 200

04-05 08:13:08.809 643 643 I update_engine: [0405/081308:INFO:multi_range_http_fetcher.cc(125)] Terminating.

04-05 08:13:08.809 643 643 I update_engine: [0405/081308:INFO:action_processor.cc(116)] ActionProcessor: finished DownloadAction with code ErrorCode::kDownloadStateInitializationError

04-05 08:13:08.809 643 643 I update_engine: [0405/081308:INFO:action_processor.cc(121)] ActionProcessor: Aborting processing due to failure.

04-05 08:13:08.809 643 643 I update_engine: [0405/081308:INFO:update_attempter_android.cc(282)] Processing Done.

04-05 08:13:08.810 643 643 I update_engine: [0405/081308:INFO:update_attempter_android.cc(302)] Resetting update progress.

04-05 08:13:08.811 2407 2407 D AMA.ou.UpdateView: Updating progressbar to 0%

04-05 08:13:08.811 2407 2420 D AMA.ou.Update: onStatusUpdate: status=0, progression=0.0%

04-05 08:13:08.814 2407 2420 D AMA.ou.Update: onPayloadApplicationComplete: 20

04-05 08:13:12.348 1033 1033 W WindowManager: Attempted to remove non-existing token: android.os.Binder@ced7efb

Does anyone has any idea what may be the problem ?



Solution 1:[1]

The system img in your device different from the img in PREVIOUS-tardis-target_files.zip, the incremental ota require the device imgs content be same as base target. In other word, you can build the base full ota ptackage with:

./build/tools/releasetools/ota_from_target_files PREVIOUS-tardis-target_files.zip base_full_ota_update.zip

update base_full_ota_update.zip at first, reboot, and then update incremental_ota_update.zip, it should be successful.

=-=

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 yangjiaohua