首页 > 其他分享 >Android官方资料--Block-Based OTAs

Android官方资料--Block-Based OTAs

时间:2023-09-06 12:32:53浏览次数:59  
标签:Based -- OTAs system updates file OTA Android block


Block-Based OTAs


IN THIS DOCUMENT

  1. Recommendations
  2. File vs. Block OTAs
  1. Updating unmodified systems
  2. Updating modified systems



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:

  • Android 5.0 and later versions use block OTA updates to ensure that each device uses the exact same partition. Instead of comparing individual files and computing binary patches, block OTA handles the entire partition as one file and computes a single binary patch, ensuring the resultant partition contains exactly the intended bits. This allows the device system image to achieve the same state via fastboot or OTA.
  • Android 4.4 and earlier versions used file OTA updates, which ensured devices contained similar file contents, permissions, and modes, but allowed metadata such as timestamps and the layout of the underlying storage to vary between devices based on the update method.

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.

Recommendations


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, youcannot 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 mailing list.

File vs. Block OTAs


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:

  • Full update. Copying the full system image is simple and makes patch generation easy but also generates large images that can make applying patches expensive.
  • Incremental update. Using a binary differ tool generates smaller images and makes patch application easy, but is memory-intensive when generating the patch itself.

Note: adb fastboot

Updating unmodified systems

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:

  • Download size. Full block OTA updates are approximately the same size as full file OTA updates, and incremental updates can be just a few megabytes larger.

Figure 1.

In general, incremental block OTA updates are larger than incremental file OTA updates due to:

  • Data preservation. Block-based OTAs preserve more data (file metadata, dm-verity data, ext4 layout, etc.) than file-based OTA.
  • Computation algorithm differences. In a file OTA update, if a file path is identical in both builds, the OTA package contains no data for that file. In a block OTA update, determining little or no change in a file depends on the quality of the patch computation algorithm and layout of file data in both source and target system.
  • Sensitivity to faulty flash and RAM. If a file is corrupted, a file OTA succeeds as long as it doesn't touch the corrupted file, but a block OTA fails if it detects any corruption on the system partition.

Updating modified systems

For devices with modified system partitions running Android 5.0:

  • Incremental block OTA updates fail. A system partition might be modified during an 

adb remount

  • Attempts to change modified files cause update failure. For both file and block OTA updates, if the OTA attempts to change a file that has been modified, the OTA update fails.
  • Attempts to access modified files generate errors (dm-verity only). For both file and block OTA updates, if dm-verity is enabled and the OTA attempts to access modified parts of the system filesystem, the OTA generates an error.

标签:Based,--,OTAs,system,updates,file,OTA,Android,block
From: https://blog.51cto.com/u_16248677/7385238

相关文章

  • Android官方资料--Signing Builds for Release
    SigningBuildsforReleaseINTHISDOCUMENTReleasekeysSigningOTApackagesSignaturesandsideloadingCertificatesandprivatekeysAdvancedsigningoptionsManuallygeneratingkeysCreatingimagefilesAndroidOSimagesusecryptographicsignaturesintwo......
  • 无涯教程-JavaScript - ISOWEEKNUM函数
    描述ISOWEEKNUM函数返回给定日期的年份的ISO周编号。语法ISOWEEKNUM(date)争论Argument描述Required/OptionalDateDateisthedate-timecodeusedbyExcelfordateandtimecalculation.RequiredNotesMicrosoftExcel将日期存储为连续数字,因此可以在计算......
  • 华为S7706交换机设置 DHCP
    1.登陆S7706核心交换机后1.建立新的VLANvlan156vlan1572.为VLAN156VLAN157分别设置DHCP的POOL(也就是需要分配的地址)ippoolvlan156gateway-list10.10.156.1network10.10.156.0mask255.255.255.0excluded-ip-address10.10.156.210.10.156.50excluded-ip-ad......
  • CloudQuery ✖️ PolarDB:让数据库管理更简单
    近日,CloudQuery数据操作管控平台与阿里云PolarDB数据库管理软件,完成产品集成认证测试。也在以下功能上完善了用户使用PolarDB的体验,使数据库的管理更加安全高效。1.支持在CloudQuery中创建连接,便于进行数据库管控。2.支持编辑连接、资源纳管、连接池管理以及连接设置,可设置......
  • 使用python自动根据数据库的成品重量编写一个ppt并保存在"d:\test.ppt"
    要使用Python自动创建一个PPT并根据数据库中的成品重量生成内容,你可以使用Python的`python-pptx`库来实现。首先,你需要确保已经安装了这个库。你可以使用以下命令安装它:```pythonpipinstallpython-pptx```接下来,你可以按照以下步骤创建一个Python脚本来实现你的需求:```py......
  • spring boot logback日志显示时间差8小时
    参考:https://blog.csdn.net/u014453475/article/details/100579856官方文档:Thesecondparameterspecifiesatimezone.Forexample,the'%date{HH:mm:ss.SSS,Australia/Perth}wouldprintthetimeinthetimezoneofPerth,Australia,theworld'smostiso......
  • 第15章_File类与IO流 1
    第15章_File类与IO流11.File类的理解File类位于java.io包下,本章中涉及到的相关流也都声明在java.io包下。File类的一个对象,对应与操作系统下的一个文件或一个文件目录(或文件夹)File类中声明了新建、删除、获取名称、重命名等方法,并没有涉及到文件内容的读写操作。要想实现......
  • 如何在OpenJ9场景下使用Arthas
    Alibaba开源的Arthas是一个非常有名的Java诊断工具,他可以解析JVM的运行资源占用,运行状况,可以查看类的加载过程,使用的类加载器等等。但是比较可惜的是,他没有对于OpenJ9做出额外的支持,因此当你的JVM选择OpenJ9后,使用arthas可能会存在一定问题。本文将从我的亲身使用出发,看看OpenJ9在......
  • CMake生成Visual Studio工程
    CMake–生成VisualStudio工程C/C++项目经常使用CMake构建工具。CMake项目文件(例如CMakeLists.txt)可以直接由VisualStudio使用。本文要说明的是如何将CMake项目转换到VisualStudio解决方案(.sln)或项目(.vcxproj)开发环境为了生成VisualStudio解决方案,必须安装以下内......
  • [数据库] SQL特定查询场景之时间段切分方法
    1序言大数据项目、数据分析场景中,经常遇到需要切分时段的需求。如下是一些项目上的经验总结。2实时数仓即席查询场景的解决方法2.1函数拼接法方法特点:时间数据以时间戳形式存储在数据库,而非以时间字符串查询时实时运算时间段基于此,支持根据终端用户所处位置/时区......