本文共 1661 字,大约阅读时间需要 5 分钟。
设备的系统升级有两种方式:(1)下载更新包到手机后,手动安装,即所谓“卡刷包”的形式更新;(2) 通过 Over-the-air(OTA)的方式更新系统,简称为FOTA(Firmware Over The Air),FOTA升级有两种方式,一种是Full update,即将整个IMG置于升级包中,然后将升级包直接拷贝到系统;一种是Increamental update,即通过增量式的差分包,只是将系统更新的部分打包,然后以打补丁的形式应用到系统。
在介绍FOTA升级流程之前,先来看看Android系统的分区。一般,Android系统有如下几个分区(不同厂商、设备可能有差异):
ramdisk.img is a small partition image that is mounted read-only by the kernel at boot time. It only contains /init and a few config files. It is used to start init which will mount the rest of the system images properly and run the init procedure. A Ramdisk is a standard Linux feature.
/system/etc/security/otacerts.zip
),验证通过后,通知用户准备安装init.rc
脚本: service recovery /sbin/recovery
启动 recovery程序 执行 /cache/recovery/command
中的脚本命令,将其指向于升级包:
recovery首先校验升级包的签名是否与 /res/keys
(ramdisk)中的公钥相匹配
系统正常重启:
/system
分区),如果有差异,则更新recovery分区设备通知FOTA服务器升级完成
转载地址:http://tdhrj.baihongyu.com/