page.title=Block-Based OTAs @jd:body
You can enable block-based over-the-air (OTA) updates for new devices running Android 5.0. OTA is the mechanism by which OEMs remotely update the system partition of a device:
Because block OTA ensures that each device uses the same partition, it enables the use of dm-verity to cryptographically sign the system partition. For details on dm-verity, see Verified Boot.
Note: You must have a working block OTA system before using dm-verity.
For devices launching with Android 5.0 or later, use block OTA updates in
the factory ROM. To generate a block-based OTA for subsequent updates, pass
the --block
option to ota_from_target_files
.
For devices that launched with Android 4.4 or earlier, use file OTA updates. While it is possible to transition devices by sending a full block OTA of Android 5.0 or later, it requires sending out a full OTA that is significantly larger than an incremental OTA (and is therefore discouraged).
Because dm-verity requires bootloader support found only in new devices shipping with Android 5.0 or later, you cannot enable dm-verity for existing devices.
Developers working on the Android OTA system (the recovery image and the scripts that generate OTAs) can keep up with changes by subscribing to the android-ota@googlegroups.com mailing list.
During a file-based OTA, Android attempts to change the contents of the system partition at the filesystem layer (on a file-by-file basis). The update is not guaranteed to write files in a consistent order, have a consistent last modified time or superblock, or even place the blocks in the same location on the block device. For this reason, file-based OTAs fail on a dm-verity-enabled device; after the OTA attempt, the device does not boot.
During a block-based OTA, Android serves the device the difference between the two block images (rather than two sets of files). The update checks a device build against the corresponding build server at the block level (below the filesystem) using one of the following methods:
Note: adb fastboot
places the
exact same bits on the device as a full OTA, so flashing is compatible with
block OTA.
For devices with unmodified system partitions running Android 5.0, the download and install process for a block OTA remains the same as for a file OTA. However, the OTA update itself might include one or more of the following differences:
In general, incremental block OTA updates are larger than incremental file OTA updates due to:
For devices with modified system partitions running Android 5.0:
adb remount
or as a result of malware. File
OTA tolerates some changes to the partition, such as the addition of files
that are not part of the source or target build. However, block OTA does not
tolerate additions to the partition, so users will need to install a full OTA
overwriting any system partition modifications) or flash a new system image to
enable future OTAs.