Project

General

Profile

SB30 OTA Guide » History » Revision 2

Revision 1 (Lion Wang, 08/06/2021 09:46 AM) → Revision 2/3 (Lion Wang, 08/06/2021 09:47 AM)

h1. SB30 OTA Guide 

 Update device.mk & BoardConfig.mk 

 1. Modify device/inoco/sb30/device.mk 
 Update OTA url (persist.vendor.otaurl) to customer's server. 
 For example, update OTA url to "https://www.custurl.com" 

 persist.vendor.otaurl=https://www.custurl.com/download/SB30.json 

 2. Apply "sb30_ota.patch" 

 Index: device/inoco/sb30/BoardConfig.mk 
 sb30_ota.patch can download from  
 https://support.innocomm.com/redmine/attachments/download/3/sb30_ota.patch 


 =================================================================== 
 --- device/inoco/sb30/BoardConfig.mk 
 +++ device/inoco/sb30/BoardConfig.mk 
 @@ -16,6 +16,9 @@ 
  endif 
  BOARD_FLASH_BLOCK_SIZE := 4096 

 +#build timestamp 
 +BUILD_NUMBER := $(shell date +%s) 
 + 
  # Add path of project sepolicy folder 
  BOARD_SEPOLICY_DIRS += \ 
      device/inoco/$(MTK_TARGET_PROJECT)/sepolicy 

 3. Build OTA package 
 $ export INOCO_RPI=yes 
 $ source build/envsetup.sh 
 $ lunch sb30-userdebug 
 $ make -j8 
 $ make otapackage 
 $ export INOCO_RPI= 

 The ota package will be located at out/target/product/sb30/sb30-ota-???.zip 

 OTA by local 
 ABOTAUpdate App > Option menu > Pick File > Select "sb30-ota-???.zip" 

 OTA by server 
 Extract "sb30-ota-???.zip", you can find version/hash/size/incremental information as below to modify SB30.json. 

 For example, extract sb30-ota-eng.lin.zip: 

 sb30-ota-eng.lin/payload.bin (This is the OTA download file) 
 sb30-ota-eng.lin/payload_properties.txt 
 FILE_HASH=KrcnrqCzAIcnnjc1ysoVY0jpIgDPsVPB9oGjjyg34fI= 
 FILE_SIZE=411430579 
 METADATA_HASH=ePssh8AaT6JuDcQznmqq/kHi+ZwSUr2tBXEXwq4xLnQ= 
 METADATA_SIZE=110793 

 sb30-ota-eng.lin/META-INF/com/android/metadata 
 post-build-incremental=1581318174 
 Upload SB30.json to https://www.custurl.com/download/ 
 Upload payload.bin to https://www.custurl.com/download/ 

 SB30.json: 

 { 
     "master":{ 
         "version":"1581318174", 
         "url":"https://www.custurl.com/download/payload.bin", 
         "description":"This is Note for Master, upgrade to version 1581318174", 
         "FILE_HASH":"KrcnrqCzAIcnnjc1ysoVY0jpIgDPsVPB9oGjjyg34fI=", 
         "FILE_SIZE":411430579, 
         "METADATA_HASH":"ePssh8AaT6JuDcQznmqq/kHi+ZwSUr2tBXEXwq4xLnQ=", 
         "METADATA_SIZE":110793 
     } 
 } 
 ABOTAUpdate App will compare "version"(the value of ro.build.version.incremental) from this content and then use TAG "url" as downloading path. 
 If your firmware version is NUM_VERSION_A and then you will download version_a+.bin as your new firmware. 
 If your firmware version can't be found through JSON file, and your firmware version is older than NUM_VERSION_B, then you will download "master" url specified version_b.bin as your new firmware. 
 Sample Content of SB30.json 

 { 

     "master":{ 
         "version":"NUM_VERSION_B", 
         "url":"https://www.custurl.com/download/version_b.bin", 
 ... 
     }, 
     "NUM_VERSION_A":{ 
         "version":"NUM_VERSION_A+", 
         "url":"https://www.custurl.com/download/version_a+.bin", 
 ... 
     } 
 }