当前位置: 首页 > news >正文

Recovery介绍

Recovery介绍

Recovery相关源码路径/bootloader/recovery
编辑此区域
进入RecoveryMode的两种方式

开机过程中按下RecoveryKey键(一般为POWER和VOLUME+组合键)
系统指定进入RecoveryMode(如系统要求进入还原模式;OTA升级) # 与主系统通信 Recovery是一个独立的小系统,它与主系统通过/cache目录通信
/cache/recovery/command - INPUT - command line for tool, one arg per line
/cache/recovery/log - OUTPUT - combined log file from recovery run(s)

编辑此区域
支持的Command如下

The arguments which may be supplied in the recovery.command file:
--update_package=path - verify install an OTA package file
--wipe_data - erase user data (and cache), then reboot
--prompt_and_wipe_data - prompt the user that data is corrupt, with their consent erase user
data (and cache), then reboot
--wipe_cache - wipe cache (but not user data), then reboot
--show_text - show the recovery text menu, used by some bootloader (e.g. http://b/36872519).
--set_encrypted_filesystem=on|off - enables / diasables encrypted fs
--just_exit - do nothing; exit and reboot

编辑此区域
Recovery的两大功能,FactoryReset和OTA Install
编辑此区域
FACTORY RESET

1. user selects "factory reset"
2. main system writes "--wipe_data" to /cache/recovery/command
3. main system reboots into recovery
4. get_args() writes BCB with "boot-recovery" and "--wipe_data" -- after this, rebooting will restart the erase --
5. erase_volume() reformats /data
6. erase_volume() reformats /cache
7. finish_recovery() erases BCB -- after this, rebooting will restart the main system --
8. main() calls reboot() to boot main system

BCB:bootloader control block.是专门用于recovery和bootloader互相通信的一个flash块。存放在misc分区中

struct bootloader_message {
char command[32];
char status[32];
char recovery[768];

// The 'recovery' field used to be 1024 bytes.  It has only ever
// been used to store the recovery command line, so 768 bytes
// should be plenty.  We carve off the last 256 bytes to store the
// stage string (for multistage packages) and possible future
// expansion.
char stage[32];// The 'reserved' field used to be 224 bytes when it was initially
// carved off from the 1024-byte recovery field. Bump it up to
// 1184-byte so that the entire bootloader_message struct rounds up
// to 2048-byte.
char reserved[1184];

};

编辑此区域
OTA INSTALL

1. main system downloads OTA package to /cache/some-filename.zip
2. main system writes "--update_package=/cache/some-filename.zip"
3. main system reboots into recovery
4. get_args() writes BCB with "boot-recovery" and "--update_package=..."
-- after this, rebooting will attempt to reinstall the update --
5. install_package() attempts to install the update
NOTE: the package install must itself be restartable from any point
6. finish_recovery() erases BCB
-- after this, rebooting will (try to) restart the main system --
7. ** if install failed ** 7a. prompt_and_wait() shows an error icon and waits for the user 7b. the user reboots (pulling the battery, etc) into the main system

相关文章:

  • Java 网络编程
  • 2023亚太杯数学建模C题思路分析 - 我国新能源电动汽车的发展趋势
  • EEG 脑电信号处理合集(2): 信号预处理
  • CentOS 7 使用cJSON 库
  • Navicat 技术指引 | 适用于 GaussDB 的模型功能
  • C# APS.NET CORE 6.0 WEB API IIS部署
  • C语言之内存函数
  • 第十二章 : Spring Boot 日志框架详解
  • 云原生Kubernetes系列 | Kubernetes静态Pod的使用
  • 基本数据结构二叉树(1)
  • qml ParticleSystem3D使用介绍
  • 初始化与反初始化
  • Linux学习教程(第八章 Linux用户和用户组管理)三
  • 在ASP.NET Core 中使用 .NET Aspire 消息传递组件
  • rabbitMq确认机制之ConfirmType
  • CoolViewPager:即刻刷新,自定义边缘效果颜色,双向自动循环,内置垂直切换效果,想要的都在这里...
  • gcc介绍及安装
  • JavaScript 基础知识 - 入门篇(一)
  • JavaScript 一些 DOM 的知识点
  • jQuery(一)
  • Linux编程学习笔记 | Linux多线程学习[2] - 线程的同步
  • PAT A1050
  • php中curl和soap方式请求服务超时问题
  • Python中eval与exec的使用及区别
  • redis学习笔记(三):列表、集合、有序集合
  • Traffic-Sign Detection and Classification in the Wild 论文笔记
  • TypeScript实现数据结构(一)栈,队列,链表
  • 闭包,sync使用细节
  • 翻译:Hystrix - How To Use
  • 干货 | 以太坊Mist负责人教你建立无服务器应用
  • 关于使用markdown的方法(引自CSDN教程)
  • 使用 Node.js 的 nodemailer 模块发送邮件(支持 QQ、163 等、支持附件)
  • 微信端页面使用-webkit-box和绝对定位时,元素上移的问题
  • 小程序测试方案初探
  • 学习Vue.js的五个小例子
  • ​批处理文件中的errorlevel用法
  • (10)Linux冯诺依曼结构操作系统的再次理解
  • (6)【Python/机器学习/深度学习】Machine-Learning模型与算法应用—使用Adaboost建模及工作环境下的数据分析整理
  • (Arcgis)Python编程批量将HDF5文件转换为TIFF格式并应用地理转换和投影信息
  • (BFS)hdoj2377-Bus Pass
  • (delphi11最新学习资料) Object Pascal 学习笔记---第5章第5节(delphi中的指针)
  • (动态规划)5. 最长回文子串 java解决
  • (十六)Flask之蓝图
  • (学习日记)2024.03.25:UCOSIII第二十二节:系统启动流程详解
  • (一)【Jmeter】JDK及Jmeter的安装部署及简单配置
  • (转) Face-Resources
  • .cn根服务器被攻击之后
  • .net core 3.0 linux,.NET Core 3.0 的新增功能
  • .NET Framework 的 bug?try-catch-when 中如果 when 语句抛出异常,程序将彻底崩溃
  • .NET 设计模式—简单工厂(Simple Factory Pattern)
  • .NET命令行(CLI)常用命令
  • []AT 指令 收发短信和GPRS上网 SIM508/548
  • [2017][note]基于空间交叉相位调制的两个连续波在few layer铋Bi中的全光switch——
  • [Android]Android P(9) WIFI学习笔记 - 扫描 (1)
  • [BUAA软工]第一次博客作业---阅读《构建之法》