AOSP 9.0 OTA update for iMX8M Mini

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AOSP 9.0 OTA update for iMX8M Mini

2,571 Views
msingh1920
Contributor V

Hi Sir,

I am using iMX8M Mini EVK and AOSP 9.0 version and I am able to run AOSP successfully on my EVK board.

Now I am trying to test OTA update on iMX8M Mini EVK for that I referred steps given in in Section 7 of Android user guide.

I followed all the steps given in Section 7 of Android user guide.

 

I did following steps -

 

1. Created a full OTA update package using -
$ source build/envsetup.sh
$ lunch evk_8mm-userdebug
$ make otapackage -j4

 

it created a .zip file and it includes payload.bin and payload_properties.txt .

 

2. And kept these file to my local server and I am able to access it from another computer over wifi.

 

3. After that I Booted the iMX8M mini EVK and connected the board with same wifi network.. 

 

4. connected the debug port of iMX8Mini with my laptop and open the console with putty / minicom .

 

5. Now I am executing below command -

update_engine_client --payload=http://192.168.1.1:10888/payload.bin --update --
headers="FILE_HASH=0fSBbXonyTjaAzMpwTBgM9AVtlBeyOigpCCgkoOfHKY=
FILE_SIZE=379074366
METADATA_HASH=Icrs3NqoglzyppyCZouWKbo5f08IPokhlUfHDmz77WQ/de8Dgp9zFXt8Fo
+Hxccp465uTOvKNsteWU=
METADATA_SIZE=46866"

 

NOTE : - I replaced the ip address with my server ip and other payload_properties parameters with my parameter found in
               payload_properties.txt file

But when I run this command on IMX8 (from putty console ) then I get this error and nothing happens.


[0218/140214.639666:ERROR:update_engine_client_android.cc(148)] Found a positional argument 'headers=FILE_HASH=EA1rY4uVUN35goXDkeNaPVWj6ueoRNmS3hfOfxL9zgk= FILE_SIZE=440383379 METADATA_HASH=R+TqI4RldiQxOQqUgxZnGXXPgBFs4EXKwXaB2esWgKE= METADATA_SIZE=58809t'. If you want to pass a value to a flag, pass it as --flag=value.
1|evk_8mm:/ $

 

 

Any help or suggestion why this issue might be coming ???

And How do I know if this command is working or executing successfully and download is stared ?

and where this OTA files will be downloaded ?

 

Thanks,

Maneesh

0 Kudos
4 Replies

2,249 Views
msingh1920
Contributor V

Hi Sir,

 

I Solved this positional argument Error and now update command is executing successfully.

But I observed that when I Execute update command on debug console -

 

 I tried to execute command in this way ->

update_engine_client --payload=http://192.168.1.1/payload.bin --update  \
--headers="FILE_HASH=EA1rY4uVUN35goXDkeNaPVWj6ueoRNmS3hfOfxL9zgk= \
FILE_SIZE=440383379 \
METADATA_HASH=R+TqI4RldiQxOQqUgxZnGXXPgBFs4EXKwXaB2esWgKE= \
METADATA_SIZE=58809t"

 

and by this way also -

 

update_engine_client --payload=http://172.18.3.215/payload.bin --update --headers="FILE_HASH=EA1rY4uVUN35goXDkeNaPVWj6ueoRNmS3hfOfxL9zgk= FILE_SIZE=440383379 METADATA_HASH=R+TqI4RldiQxOQqUgxZnGXXPgBFs4EXKwXaB2esWgKE= METADATA_SIZE=58809t"

 

 

 

But I always get avc_denied error like below -

 

 

[ 7715.455315] type=1400 audit(1582115439.038:73): avc: denied { read } for pid=7366 comm="update_engine_c" name="misc" dev="proc" ino=40265319
28 scontext=u:r:shell:s0 tcontext=u:object_r:proc_misc:s0 tclass=file permissive=1
[ 7715.475597] type=1400 audit(1582115439.038:73): avc: denied { read } for pid=7366 comm="update_engine_c" name="misc" dev="proc" ino=40265319
evk_8mm:/ $ su
evk_8mm:/ # setenforce 0
evk_8mm:/ #
evk_8mm:/ #
evk_8mm:/ #

 

 

But if I make selinux permissive as shown above then these errors go off .

and update command execute without any error or warning or any print message. 

 

so my question is - 

1. how can I verify if my update-engine command executed successfully or not ?

2. how I will I verify if OTA update is started or not after executing this command ?

3. Where can I find the OTA files on my board which will be downloaded by this command ?

 

 Any help or suggestions will be very helpful.

Thanks,

Maneesh

0 Kudos

2,249 Views
diegoadrian
NXP Employee
NXP Employee

Hello,

This question is more related to the AOSP project. To see more information related to this topic I suggest you check the following web-page.

A/B (Seamless) System Updates  |  Android Open Source Project 

Normally, in the new Android releases. There are A/B partitions. This means that the OTA update will be performing in the current partition slot. If an error occurs during the update, the system will change automatically to the other partition slot.

Best regards,

Diego.

2,248 Views
msingh1920
Contributor V

Hi Diego Adrian Cuevas,

Thanks for your reply and response. I checked the A/B (Seamless) System Updates  |  Android Open Source Project 

But it doesn't solve my problem.


I am trying to do OTA update for iMX8M Mini EVK and for that I am following steps give in Section 7 of Android user guide.

I am able to execute update_engine_client command without any error or warning or any other print message.   

 

But I have few question  - 

 

1. How can I verify if my update_engine_client command executed successfully or not ?

2. How will I verify if OTA update is started or not after executing this command ?

3. Where can I find the OTA files on my board which will be downloaded by this command ?

 

Any help or suggestions how can I Verify above questions ?
Or

Is there any other way to do OTA update ?


Thanks,

Maneesh

0 Kudos

2,249 Views
shivanipatel
Senior Contributor II

Hi Maneesh Singh,

Please find my answers as below:

Q1: How can I verify if my update_engine_client command executed successfully or not ?

A1: You can verify this from the logs. When the update is finished, you will get the log like "Update successfully applied, waiting to reboot" in the logcat.

Q2: How will I verify if OTA update is started or not after executing this command ?

A2: This will also verify from the logs in the logcat. Please run the logcat command parallelly while OTA updating. So, if any kind of error occurs, it will be known from the logs.

Q3: Where can I find the OTA files on my board which will be downloaded by this command ?

A3:  OTA will update/replace the new .img files in the respective partition. it does not copy the images. You will get a clear idea about the OTA process from this link suggested by diegoadrian.

Q4: Is there any other way to do OTA update ?

A4: There are below mentioned ways to do the OTA.

  • adb sideload command. (in recovery mode)
  • FSLOta customized iMX Android Application.
  • update_engine_client command line utility.

Hope this will help you.

Let us know if you have any concerns.

Regards,

Shivani

0 Kudos