博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
OTA Package Tools
阅读量:5897 次
发布时间:2019-06-19

本文共 4219 字,大约阅读时间需要 14 分钟。

OTA Package Tools

The tool provided in build/tools/releasetools can build two types of package: full and incremental. The tool takes the target-files .zip file produced by the Android build system as input.

Full updates


A full update is one where the entire final state of the device (system, boot, and recovery partitions) is contained in the package. As long as the device is capable of receiving the package and booting the recovery system, the package can install the desired build regardless of the current state of the device.

Example: Using the release tools to build a full update for the hypothetical tardis device:

# first, build the target-files .zip % . build/envsetup.sh && lunch tardis-eng % mkdir dist_output % make dist DIST_DIR=dist_output [...] % ls -l dist_output/*target_files* -rw-r----- 1 user eng 69965275 Sep 29 15:51 tardis-target_files.zip

The target-files .zip contains everything needed to construct OTA packages.

% ./build/tools/releasetools/ota_from_target_files \ dist_output/tardis-target_files.zip ota_update.zip unzipping target target-files... done. % ls -l ota_update.zip -rw-r----- 1 user eng 62236561 Sep 29 15:58 ota_update.zip

The ota_update.zip is now ready to be sent to test devices (everything is signed with the test key). For user devices, generate and use your own private keys as detailed in .

Incremental updates


An incremental update contains a set of binary patches to be applied to the data already on the device. This can result in considerably smaller update packages:

  • Files that have not changed don't need to be included.
  • Files that have changed are often very similar to their previous versions, so the package need only contain an encoding of the differences between the two files.

You can install the incremental update package only on a device that has the old or source build used when constructing the package. To build an incremental update, you need the target_files .zip from the previous build (the one you want to update from) as well as the target_files .zip from the new build.

% ./build/tools/releasetools/ota_from_target_files \ -i PREVIOUS-tardis-target_files.zip \ # make incremental from this older version     dist_output/tardis-target_files.zip incremental_ota_update.zip unzipping target target-files... unzipping source target-files... [...] done. % ls -l incremental_ota_update.zip -rw-r----- 1 user eng 1175314 Sep 29 16:10 incremental_ota_update.zip

This build is very similar to the previous build, and the incremental update package is much smaller than the corresponding full update (about 1 MB instead of 60 MB).

Note: To generate a for subsequent updates, pass the --block option to ota_from_target_files.

Distribute an incremental package only to devices running exactly the same previous build used as the incremental package's starting point. Attempting to install the incremental package on a device with some other build results in the recovery error icon. Rebooting the device at this point returns the user to the old system; the package verifies the previous state of all the files it updates before touching them, so the device should not be left in a half upgraded state if this occurs.

Update packages


An update package (ota_update.zip, incremental_ota_update.zip) is a .zip file that contains the executable binary META-INF/com/google/android/update-binary. After verifying the signature on the package, recovery extracts this binary to /tmp and runs it, passing the following arguments:

  • Update binary API version number. If the arguments passed to the update binary change, this number is incremented.
  • File descriptor of the command pipe. The update program can use this pipe to send commands back to the recovery binary (mostly for UI changes such as indicating progress to the user).
  • Filename of the update package .zip file.

A recovery package can use any statically-linked binary as the update binary. The OTA package construction tools use the updater program (source in bootable/recovery/updater), which provides a simple scripting language that can do many installation tasks. You can substitute any other binary running on the device.

For details on the updater binary, edify syntax, and builtin functions, see .

转载地址:http://nkasx.baihongyu.com/

你可能感兴趣的文章
js document.queryCommandState() 各个参数
查看>>
分组训练2
查看>>
将二维数组中某个值为空的数组进行删除!
查看>>
c语言指针详解
查看>>
bzoj 2001 CITY 城市建设 cdq分治
查看>>
Spring Boot MyBatis 连接数据库
查看>>
大型网站架构系列:分布式消息队列(一) (转)
查看>>
简单工厂模式(Simple Factory) 创建型模式
查看>>
php关联数组(hash数组)
查看>>
jQuery为div添加select和option
查看>>
leetcode------Path Sum II
查看>>
Java虚拟机1:什么是Java
查看>>
周末学习总结(二)
查看>>
clang failed with exit code 1 的常见情况
查看>>
oc面试 内存泄露
查看>>
Beta版冲刺前准备
查看>>
UGUI学习(一)Canvas
查看>>
nodejs post 数据到php $_POST["content"]接收不到的问题
查看>>
数据系列:如何在Windows Azure虚拟机上设置SQL Server
查看>>
mapper 传多个参数
查看>>