Android 5.x OTA Update官方文档(一,OTA 升级)

写在前面:

Android

本节主要描述了更新包的组织架构,并且概述了如何使用更新包打包工具制作系统升级的更新包。OTA的存在是用来对潜在系统的升级,或者在系统分区安装只读(不可卸载)的应用程序,因此在升级过程中不会影响到用于已经安装到系统中的应用程序。

本节的内容主要基于Android5.x版本。

一、Android设备布局的设计

通常,在

boot

boot

system

system

vendor

vendor

userdata

userdata分区是用户的天堂,用户在使用应用程序时所产生的一些数据都保存在这里,比如保存的常用联系人,短信息等。

cache

cache

recovery

recovery

misc

misc

二、OTA升级流程

标准的OTA升级流程包含以下几步:

1.Android

2.Update

3.设备会重启进入

4.recovery

5.Recovery

6.Recovery

7.重启设备

a.载入新的

b.系统启动时会同时校验

8.系统更新完成。

三、Android5.x

Cfunction

C++method

device_recovery_start()

Device::RecoveryStart()

device_toggle_display()device_reboot_now()

RecoveryUI::CheckKey()(alsoRecoveryUI::IsKeyPressed())

device_handle_key()

Device::HandleMenuKey()

device_perform_action()

Device::InvokeMenuItem()

device_wipe_data()

Device::WipeData()

device_ui_init()

ScreenRecoveryUI::Init()

下面为原文:

Android devices in the field can receive and install over-the-air (OTA) updates to the system and application software. Devices have a special recovery partition with the software needed to unpack a downloaded update package and apply it to the rest of the system.

This section describes the structure of these packages and the tools provided to build them. It is intended for developers who want to make the OTA update system work on new Android devices and those who are building update packages for use with released devices. OTA updates are designed to upgrade the underlying operating system and the read-only apps installed on the system partition; these updates donotaffect applications installed by the user from Google Play.

This section describes the OTA system as of the Android 5.x release. For help porting OTA-related code from older releases, seeMigrating from previous releases.

Android device layout

The flash space on an Android device typically contains the following partitions.

bootContains the Linux kernel and a minimal root filesystem (loaded into a RAM disk). It mounts system and other partitions and starts the runtime located on the system partition.systemContains system applications and libraries that have source code available on Android Open Source Project (AOSP). During normal operation, this partition is mounted read-only; its contents change only during an OTA update.vendorContains system applications and libraries that donothave source code available on Android Open Source Project (AOSP). During normal operation, this partition is mounted read-only; its contents change only during an OTA update.userdataStores the data saved by applications installed by the user, etc. This partition is not normally touched by the OTA update process.cacheTemporary holding area used by a few applications (accessing this partition requires special app permissions) and for storage of downloaded OTA update packages. Other programs use this space with the expectation that files can disappear at any time. Some OTA package installations may result in this partition being wiped completely.recoveryContains a second complete Linux system, including a kernel and the special recovery binary that reads a package and uses its contents to update the other partitions.miscTiny partition used by recovery to stash some information away about what it’s doing in case the device is restarted while the OTA package is being applied.Life of an OTA update

A typical OTA update contains the following steps:

Device performs regular check in with OTA servers and is notified of the availability of an update, including the URL of the update package and a description string to show the user.Update downloads to a cache or data partition, and its cryptographic signature is verified against the certificates in/system/etc/security/otacerts.zip. User is prompted to install the update.Device reboots normally.The newly updated boot partition is loaded, and it mounts and starts executing binaries in the newly updated system partition.As part of normal startup, the system checks the contents of the recovery partition against the desired contents (which were previously stored as a file in/system). They are different, so the recovery partition is reflashed with the desired contents. (On subsequent boots, the recovery partition already contains the new contents, so no reflash is necessary.)

The system update is complete!

Migrating from Previous Releases人生最好的旅行,就是你在一个陌生的地方,

Android 5.x OTA Update官方文档(一,OTA 升级)

相关文章:

你感兴趣的文章:

标签云: