首页 > 其他分享 >Android官方资料--OTA Updates

Android官方资料--OTA Updates

时间:2023-09-06 14:04:46浏览次数:43  
标签:recovery -- OTA partition update system Updates device


OTA Updates


IN THIS DOCUMENT

  1. Android device layout
  2. Life of an OTA update
  3. Migrating from Previous Releases



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 do not affect 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, see Migrating from previous releases.

Android device layout


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


Contains 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. system Contains 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. vendor Contains system applications and libraries that do  not 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.

userdata Stores the data saved by applications installed by the user, etc. This partition is not normally touched by the OTA update process. cache Temporary 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. recovery Contains 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. misc Tiny 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:

  1. 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.
  2. Update downloads to a cache or data partition, and its cryptographic signature is verified against the certificates in 

/system/etc/security/otacerts.zip

  1. . User is prompted to install the update.
  2. Device reboots into recovery mode, in which the kernel and system in the recovery partition are booted instead of the kernel in the boot partition.
  3. Recovery binary is started by init. It finds command-line arguments in 

/cache/recovery/command

  1. Recovery verifies the cryptographic signature of the package against the public keys in 

/res/keys

  1. Data is pulled from the package and used to update the boot, system, and/or vendor partitions as necessary. One of the new files left on the system partition contains the contents of the new recovery partition.
  2. Device reboots normally.
  1. The newly updated boot partition is loaded, and it mounts and starts executing binaries in the newly updated system partition.
  2. 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

  1. ). 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


When migrating from Android 2.3/3.0/4.0 release, the major change is the conversion of all the device-specific functionality from a set of C functions with predefined names to C++ objects. The following table lists the old functions and the new methods that serve a roughly equivalent purpose:

C function

C++ method

device_recovery_start()

Device::RecoveryStart()

device_toggle_display()

device_reboot_now()

RecoveryUI::CheckKey()

(also RecoveryUI::IsKeyPressed())

device_handle_key()

Device::HandleMenuKey()

device_perform_action()

Device::InvokeMenuItem()

device_wipe_data()

Device::WipeData()

device_ui_init()

ScreenRecoveryUI::Init()

Conversion of old functions to new methods should be reasonably straightforward. Don't forget to add the newmake_device()

标签:recovery,--,OTA,partition,update,system,Updates,device
From: https://blog.51cto.com/u_16248677/7386443

相关文章

  • c++中输出浮点数
    flata=1;flatb=3;cout<<a<endl;cout<<showpoint<<b<endl;ANSI C++里一个浮点型若是小数部分为0,直接输出必然是不带小数点的,例如floatb=3;你若想输出3.0,输出代码要这样写:cout << showpoint << a;......
  • 利用亚马逊云科技数据分析能力,这伴科技打造一站式大数据平台
    当前,利用数据分析能力赋能精准营销逐渐成为全球企业的主流趋势之一,然而复杂的基础设施和运维压力也不容忽视,因此如何才能构建行之有效的数据分析平台,支撑业务营销服务,实现与客户的共创互赢? 数字营销时代,企业通过自动化和数字化工具,高效地管理和执行营销活动,并实现更好地资源利用和......
  • 在Android中用e.printStackTrace()
    IsitabadideatouseprintStackTrace()inAndroidExceptions?upvote35downvotefavorite7IsitabadideatouseprintStackTrace()inAndroidExceptionslikethis?}catch(Exceptione){e.printStackTrace();}}catch......
  • git 用一个project添加两个远程仓库
    以android的recovery项目为例,目前gitbranch-r中只有A仓库的分支 gitbranch-r m/dev->A/branch_nameA A/master这是因为manifest中的recovery项目配置为:<remotename="A"fetch="ssh://git@git.****.cn/A/"review="gerrit.pt.A.com"/><pro......
  • Socks5代理IP:保障跨境电商的网络安全
    在数字化时代,跨境电商已成为全球商业的重要一环。然而,随着其发展壮大,网络安全问题也逐渐浮出水面。为了确保跨境电商的安全和隐私,Socks5代理IP技术成为了一项不可或缺的工具。本文将深入探讨Socks5代理IP在跨境电商中的应用,以及如何保障网络安全。1.了解Socks5代理IP1.1什么是Soc......
  • Android OTA升级之升级包生成脚本ota_from_target_files
    我们在这里主要分析OTA升级过程中对ota_from_target_files.py脚本的调用,这个脚本主的作用是生成各种OTA完整包和增量包。 以生成完整OTA包为例,假设我们的命令为:./build/tools/releasetools/ota_from_target_files-n input_file_dir/target_file.zip output_file_dir/outp......
  • android调试工具--dumpsys
    dumpsys执行格式为:dumpsys[option] 其中option参数可以为service和acitivity,参数service可以是系统中任意一个服务,比如meminfo服务显示内存信息,cpuinfo现实cpu信息参数acitivity可以现实所有的activity信息......
  • Android原生库和架构层通信的socket
    Android为原生库和架构层之间的通信提供了socket机制,在系统中为其提供了/dev/socket节点。/dev/socket节点是在init.rc文件初始化时生成的, $ls/dev/socketadbdcnddnsproxyddpmddpmwrapperfwmarkdims_datadims_qmidims_rtpdinstalldipacm_log_filelmkdlogdlogdrlo......
  • ubuntu下syslog.conf 不存在
    ubuntu的/etc/syslog.conf不再有!而是/etc/rsyslog.conf代替!https://wiki.ubuntu.com/KarmicKoala/ReleaseNotes目前一些Linux发行版用Rsyslogd替代了syslogd。RHEL从6版本开始就默认使用rsyslogd了。rsyslogd兼容syslogd的配置。Rsyslog是一个syslogd的多线......
  • sysfs文件系统各子目录含义
    /sys/block块设备目录,目前此目录已指向到/sys/devices/中设备描述符链接文件/sys/bus设备按总线类型分层放置子目录,/sys/devices/中的所有设备都是链接于某种总线,bus子目录在每一种具体总线之下都可以找到对应每一个具体设备的描述符号链接/sys/class设备按功能分类放置子目录,/......