Zhanrui Android 10 platform OTA upgrade

OTA overall upgrade package production steps (take SC9863A platform as an example)

  1. Download the code for Project AP.
  2. Set up the compilation environment with the following command.
    source build/envsetup.sh
    lunch
    kheader
  3. Compile the entire project through the make command.
  4. Enter the "device/sprd/sharkle/sl8541e_1h10_32b/" directory (the corresponding directory of the board), and manually create the modem_bins subdirectory.
  5. Rename the modem bins corresponding to the AP version released by Zhanrui according to the specified name in "device/sprd/sharkle/common/ModemBuild.mk" and copy them to the "device/sprd/sharkle/sl8541e_1h10_32b/modem_bins/" directory.

The following is an example of SC9863A platform

device/sprd/sharkle/common/ModemBuild.mk
MODEM_COPY_LIST := ltemodem ltegdsp ltedsp pmsys ltenvitem wcnmodem ltedeltanv \
	gnssmodem gnssbdmodem

For the renaming rules, please refer to "Modem bins renaming mapping at the end of the document".

The main modem file with the suffix of ".dat" should also be changed to the file with the suffix of ".bin".

ps: It can also be found in flash.cfg according to the green box in ota_partition in the ini file is the renamed name, and the actual modem can be found in flash.cfg according to the uppercase name corresponding to the red box

  • Compile the OTA package through the command "make otapackage". After running this command, the version target package and the OTA package will be generated. Whole package directory: out/target/product/sl8541e_1h10_32b/sl8541e_1h10_32b_Natv-ota-eng.q.zip

PS: In order to use the differential upgrade when the version is upgraded in the future, the target file corresponding to this version should be reserved. The path is:

out/target/product/sl8541e_1h10_32b/obj/PACKAGING/target_files_intermediates/sl8541e_1h10_32b_Natv-target_files-eng.q.zip
  • If you want to make a version PAC package, please execute the command to generate a PAC package at this time.

PS: Please make the PAC package strictly after executing make otapackage, because the make otapackage command will recompile many imgs, and only the PAC package made after this step is strictly corresponding to the target package.

We can also make the whole ota package according to the target package:

./build/tools/releasetools/ota_from_target_files -k build/target/product/security/testkey sl8541e_1h10_32b_Natv-target_files-eng.q.zip update.zip

Incremental upgrade package production steps

Differential upgrade packages are divided into upgrade differential packages and downgrade differential packages. The downgrade differential package is to downgrade from the new version to the old version. Android 7.0 and later versions support this kind of upgrade package. Since it is a rollback downgrade, userdata must be erased, so this kind of upgrade package should be used with caution.

  1. Download the version A code, perform all the steps in "3.1 OTA overall upgrade package production steps", and then save the target package A-target.zip corresponding to this version.
  2. Download the B version code, perform all the steps in "3.1 OTA overall upgrade package production steps", and then save the target package B-target.zip corresponding to this version.
  3. Execute the command to make a differential upgrade package. The parameter sign_key_dir after "-k" is the actual version key placement directory, which is "build/target/product/security/release/releasekey" in the user version and "build/target/product/security/testkey" in the userdebug version.
    升级差分包制作:
    ./build/tools/releasetools/ota_from_target_files –k sign_key_dir -i A-target.zip B-target.zip A-B_update.zip
    降级差分包制作此处须注意 A 版本必须要比 B 版本新,即编译时间靠后。这种差分包需要加入“--downgrade”参数。
    ./build/tools/releasetools/ota_from_target_files --downgrade –k sign_key_dir -i A-target.zip B-target.zip A-B__downgrade_update.zip
    
    举例子:
    ./build/tools/releasetools/ota_from_target_files -k build/target/product/security/testkey -i sl8541e_1h10_32b_Natv-target_files-eng.q.V1.zip sl8541e_1h10_32b_Natv-target_files-eng.q.zip update.zip

Generate OTA upgrade package through PAC package 

The benefits of directly generating the OTA upgrade package from the PAC package are:

  • No need to compile the target package, saving compilation time.
  • The update package will not be unable to be generated due to the loss of the target package.
  • There is no need to allocate a large storage space for target package and OTA package storage.

The idea of ​​OTATOOLS with this function is to analyze the necessary elements for making an OTA update package from the imgs and partition table in the PAC package, and finally produce an OTA update package.

Currently existing OTATOOLS can use both PAC package and target package to generate upgrade packages, and can generate OTA full packages, differential packages, downgrade packages, etc.

OTATOOLS tool acquisition

Execute the following commands in sequence to compile the otatool corresponding to the project:

1. source build/envsetup.sh
2. lunch 对应项目工程
3. kheader
4. make otatools

The compiled otatool is in the out/target/product/spXXXX/ directory. Since this directory may be deleted and recompiled frequently, please move the otatool folder (otatools.zip can also be decompressed) to other non-engineering code linux environments separate directory for use.

Features of the otatool:

  • Once compiled, it can be used for a long time without having to regenerate each version.
  • This tool can use target package to generate OTA update package, and can also use PAC package to generate OTA update package.

 

Specific package instructions

制作 OTA 整包
./build/make/tools/releasetools/ota_from_pac_files -p product_name -k sign_key -t pac_target full_update.zip
制作 OTA 差分升级包
./build/make/tools/releasetools/ota_from_pac_files -p product_name -k sign_key -b pac_base -t pac_target delta_base-to-target.zip
制作降级差分升级包
./build/make/tools/releasetools/ota_from_pac_files -d -p product_name -k sign_key -b pac_newer_build -t pac_oldrget delta_update_newer-to-old.zip

 

Modem bins rename map

 

 

 

 The above can make OTA whole package or differential package. 

 Single cycle "Fulfillment"

 

Guess you like

Origin blog.csdn.net/androidzmm/article/details/128285841