关于recovery更新相关的几点总结记录:
1、recovery升级的大致流程:
①编译:执行make otapackage
②.main system模式下,将升级包重名为update.zip,下载到/cache目录下
③.创建文件/cache/recovery/command,并向command中写入:--update_package=/cache/update.zip
④终端执行reboot recovery进入recovery模式,也可以通过android上层调用函数android_reboot,并设置进入recovery模式的代码
⑤.系统重启,进入recovery模式,并启动recovery进程,该进程会检测/cache/recovery/command的内容,然后升级update.zip。
2、命令文件/cache/recovery/command:保存着Main
system传给Recovery的命令行,每一行就是一条命令,支持一下几种的组合。
--send_intent=anystring
//write the text out to recovery/intent
//在Recovery结束时在finish_recovery函数中将定义的intent字符串作为参数传进来,并写入到/cache/recovery/intent中
--update_package=root:path
//verify install an OTA package file Main system将这条命令写入时,代表系统需要升级,在进入Recovery模式后,
//将该文件中的命令读取并写入BCB中,然后进行相应的更新update.zip包的操作。
--wipe_data
//erase user data(and cache),then reboot。擦除用户数据。擦除data分区时必须要擦除cache分区。
--wipe_cache //wipe
cache(but not user data),then reboot。擦除cache分区。
3、recovery时分区相关需要与system主模式的分区号一致
位置:bootable/bootloader/uboot-imx/include/autoconf.mk
CONFIG_ANDROID_CACHE_PARTITION_MMC=12
CONFIG_ANDROID_RECOVERY_PARTITION_MMC=6
CONFIG_ANDROID_SYSTEM_PARTITION_MMC=5
CONFIG_A