Android 9 imx8mq OTA incremental update error

cancel
Showing results for 
Search instead for 
Did you mean: 

Android 9 imx8mq OTA incremental update error

930 Views
Contributor II

hi,

1.I use make otapackage -j12 build a full update package , it works well.

2. when I use incremental package to update, there is a error occurs:

      Applying 21701 operations to partition "system"
      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.
     Expected:   sha256|hex = 839ACF5296B9AB820DC822B6C09EBA896905531EB2C581093A357411F1A444A0
     Calculated: sha256|hex = 18AF8D6842A71554893F1DE65B87F2A9639FB390357C71D5383C6ED7A6051AFA

someone tells me , make otapackage will repack system.img, so I should use xxx\obj\PACKAGING\target_files_intermediates\dw8761-target_files-eng.panxf\IMAGES\system.img  replace xxx\system.img , then flash the device as base version. 

 

but when I replace system.img, use uuu flash the device, the device cannot boot again, the error is:

  4.288597]   #3: imx-audio-hdmi
[    4.292000] device-mapper: init: attempting early device configuration.
[    4.299566] device-mapper: init: adding target '0 5159992 verity 1 PARTUUID=086d1015-b508-4da4-9a28-bd2669b17f2c PARTUUID=086d1015-b508-4da4-9a28-bd2669b17f2c 4096 4096 644999 644999 sha1 8498f26cb2fd144a646330255483dd3d0218ad85 49f7d94f9f35948263f3244905675f7eeaf7d3ed 10 restart_on_corruption ignore_zero_blocks use_fec_from_device PARTUUID=086d1015-b508-4da4-9a28-bd2669b17f2c fec_roots 2 fec_blocks 650080 fec_start 650080'
[    4.339884] device-mapper: init: dm-0 is ready
[    4.355318] device-mapper: verity-fec: 179:5: FEC: recursion too deep
[    4.361795] device-mapper: verity: 179:5: metadata block 644999 is corrupted
[    4.368991] imx-sdma 302c0000.sdma: external firmware not found, using ROM firmware
[    4.369503] kvm: exiting hardware virtualization
[    4.376795] imx-sdma 30bd0000.sdma: external firmware not found, using ROM firmware
[    4.417371] reboot: Restarting system with command 'dm-verity device corrupted'

xxx\obj\PACKAGING\target_files_intermediates\dw8761-target_files-eng.panxf\IMAGES\system.img [size: 1173853kB]

xxx\system.img [1173849KB]

use xxx\system.img  flash the device is ok.

so where make otapackage -j12 build system image is different from  make -j12. how to resolve this problem?

Labels (1)
Tags (4)
5 Replies

186 Views
Senior Contributor II

Hi, chen yy

The reason for this issue is that the system.img of OTA package is not consistent/same with the system.img of the out directory because "make otapackage" will repackage the system.img from the out directory.

Please verify the md5sum of both the system.img reside at "out/target/product/evk_8mq/obj/PACKAGING/systemimage_intermediates/" and "out/target/product/evk_8mq" are same.

For making the full OTA package, you first need to compile the AOSP i.e. you need to run the commands as per below sequence.

  1. cd ${MY_ANDROID}
  2. source build/envsetup.sh
  3. lunch evk_8mq-userdebug               // Configuration for i.MX8MQ EVK
  4. make -j4
  5. make otapackage -j4                       //this will generate the full OTA package in out directory

And for making incremental OTA, please follow below-mentioned steps.

    1. make target-files-package -j4      

        //this will generate the previously changed target file in "{MY_ANDROID}/out/target/product/evk_8mq/obj/PACKAGING/target_files_intermediates/" directory

          Copy the PREVIOUS-target_files.zip to ${MY_ANDROID}

    2. Apply your changes in the source

    3. make target-files-package -j4

        //this will generate the previously changed target file in "{MY_ANDROID}/out/target/product/evk_8mq/obj/PACKAGING/target_files_intermediates/" directory

          Copy the NEW-target_files.zip to ${MY_ANDROID}

    4. ./build/tools/releasetools/ota_from_target_files -i PREVIOUS-target_files.zip NEW-target_files.zip incremental_ota_update.zip

To apply the incremental OTA please follow the steps given in Section 7.1.3 of Android User Guide attached here.

I have tested the above steps on i.MX8MQ EVK with Android version 9.0.0.1.0.0 and able to apply the full OTA and incremental OTA successfully.

Let us know if you still face the issue with above steps.

Regards,

Shivani

186 Views
NXP Employee
NXP Employee

Hello,

I suggest you follow section 7 of our Android_Users_Guide. There you could find all the information that we have about OTA.

Best regards,

Diego.

0 Kudos

186 Views
Contributor II

hi, I follow, but it is wrong

0 Kudos

186 Views
NXP Employee
NXP Employee

Hello,

Have you followed the following steps to apply the OTA update?

To update system from board's storage, perform the following steps:
      1. Unzip ota_update.zip or incremental_ota_update.zip (Generated on 7.1.2 and 7.1.3) to get payload.bin
          and payload_properties.txt.
      2. Push payload.bin to board's /sdcard dir: adb push payload.bin /sdcard/.
      3. Cat the content of payload_properties.txt like this:
            • FILE_HASH=0fSBbXonyTjaAzMpwTBgM9AVtlBeyOigpCCgkoOfHKY=
            • FILE_SIZE=379074366
            • METADATA_HASH=Icrs3NqoglzyppyCZouWKbo5f08IPokhlUfHDmz77WQ=
            • METADATA_SIZE=46866
      4. Input the following command on the board's console to update:
          update_engine_client --payload=file:///sdcard/payload.bin --update --
          headers="FILE_HASH=0fSBbXonyTjaAzMpwTBgM9AVtlBeyOigpCCgkoOfHKY=
          FILE_SIZE=379074366
          METADATA_HASH=Icrs3NqoglzyppyCZouWKbo5f08IPokhlUfHDmz77WQ=
          METADATA_SIZE=46866"
      5. The system will update in the background. After it finishes, it will show "Update successfully applied, waiting to
          reboot" in the logcat.

Best regards,

Diego.

0 Kudos

186 Views
Contributor II

who konw this

0 Kudos