| <html devsite><head> |
| <title>启动流程</title> |
| <meta name="project_path" value="/_project.yaml"/> |
| <meta name="book_path" value="/_book.yaml"/> |
| </head> |
| <body> |
| <!-- |
| Copyright 2018 The Android Open Source Project |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| //www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| <p> |
| 建议的设备启动流程如下所示: |
| </p> |
| <figure> |
| <img src="/security/images/verified-boot-flow.png" alt="验证启动流程"/> |
| <figcaption><b>图 1</b>.验证启动流程</figcaption> |
| </figure> |
| |
| <h2 id="flow-for-a-b-devices">适用于 A/B 设备的流程</h2> |
| <p> |
| 如果设备使用的是 A/B,则启动流程略有不同。必须先使用<a href="https://android.googlesource.com/platform/hardware/interfaces/+/master/boot/1.0/IBootControl.hal" class="external">启动控件 HAL</a> 将要启动的槽位标记为 <code>SUCCESSFUL</code>,<strong>然后</strong>再更新回滚保护元数据。 |
| </p> |
| <p> |
| 如果平台更新失败(未标记 <code>SUCCESSFUL</code>),A/B 堆栈便会回退至仍具有先前 Android 版本的其他槽位。不过,如果已设置回滚保护元数据,则之前的版本会因回滚保护而无法启动。 |
| </p> |
| |
| <h2 id="communicating-verified-boot-state-to-users">将验证启动状态传达给用户</h2> |
| <p> |
| 确定设备的启动状态后,您需要将该状态传达给用户。如果设备没有任何问题,则会继续运行,而不显示任何内容。验证启动问题分为以下几类:</p> |
| <ul> |
| <li>黄色:针对设有自定义信任根的已锁定设备的警告屏幕</li> |
| <li>橙色:针对未锁定设备的警告屏幕</li> |
| <li>红色 (EIO):针对 dm-verity 损坏的警告屏幕</li> |
| <li>红色(未找到操作系统):未找到有效的操作系统</li> |
| </ul> |
| <table class="columns"> |
| <colgroup><col width="50%" /> |
| <col width="50%" /> |
| </colgroup><tbody><tr> |
| <td> |
| <h3 id="locked-devices-with-custom-root-of-trust">具有自定义信任根的已锁定设备</h3> |
| |
| <p> |
| 如果设备处于已锁定状态,已设置自定义的信任根,并且映像已使用该自定义信任根进行签名,则会在每次启动时显示黄色屏幕。 |
| 黄色屏幕会在 10 秒钟后关闭,并且设备会继续启动。如果用户按下电源按钮,“Press power button to pause”(按电源按钮即可暂停)文字便会更改为“Press power button to continue”(按电源按钮即可继续),并且该屏幕永远都不会关闭,但设备可能会调暗或关闭该屏幕以防老化。如果再次按下按钮,该屏幕便会关闭,并且手机会继续启动。 |
| </p> |
| <p> |
| 对于十六进制数字<var></var>,请使用用于验证的 libavb 表示形式公钥的 sha256 的前 8 位数字,例如 <code>f7a24de1</code>。 |
| </p> |
| <p> |
| <strong>建议的文字:</strong> |
| </p> |
| <p> |
| 您的设备加载了不同的操作系统。 |
| </p> |
| <p> |
| 请在其他设备上访问此链接以了解详情: |
| </p> |
| <p> |
| g.co/ABH |
| </p> |
| <p> |
| ID:十六进制数字<var></var> |
| </p> |
| <p> |
| <span class="material-icons">power_settings_new</span> 按电源按钮即可暂停 |
| </p> |
| <p> </p> |
| </td> |
| <td> |
| |
| <figure> |
| <p><strong>黄色屏幕示例:</strong></p> |
| <img src="/security/images/boot_yellow1.png" alt="黄色设备警告屏幕"/> |
| </figure> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <h3 id="unlocked-devices">已解锁的设备</h3> |
| <p> |
| 如果设备处于已解锁状态,则会在每次启动时显示橙色屏幕。橙色屏幕会在 10 秒钟后关闭,并且设备会继续启动。如果用户按下电源按钮,“Press power button to pause”(按电源按钮即可暂停)文字便会更改为“Press power button to continue”(按电源按钮即可继续),并且该屏幕永远都不会关闭(设备可能会根据需要调暗和/或关闭该屏幕,以防出现老化或类似问题)。如果再次按下按钮,该屏幕便会关闭,并且手机会继续启动。 |
| </p> |
| <p> |
| 对于十六进制数字<var></var>,请使用用于验证的 ibavb 表示形式公钥的 sha256 的前 8 位数字,例如 <code>f7a24de1</code>。 |
| </p> |
| <p> |
| <strong>建议的文字:</strong> |
| </p> |
| <p> |
| 引导加载程序已解锁,无法保证软件完整性。攻击者可能可以获取设备上存储的所有数据。请勿在此设备上存储任何敏感数据。 |
| </p> |
| <p> |
| 请在其他设备上访问此链接以了解详情: |
| </p> |
| <p> |
| g.co/ABH |
| </p> |
| <p> |
| ID:十六进制数字<var></var> |
| </p> |
| <p> |
| <span class="material-icons">power_settings_new</span> 按电源按钮即可暂停。 |
| </p> |
| <p> </p> |
| </td> |
| <td> |
| |
| <figure> |
| <p><strong>橙色屏幕示例:</strong></p> |
| <img src="/security/images/boot_orange.png" alt="橙色设备警告屏幕"/> |
| </figure> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| |
| <h3 id="dm-verity-corruption">dm-verity 损坏</h3> |
| <p> |
| 如果找到 Android 的有效版本,并且设备当前处于 <code>eio</code> dm-verity 模式,则会显示红色 <code>eio</code> 屏幕。用户需要点击电源按钮才能继续。如果用户未在 30 秒内确认警告屏幕,则设备将关机(以防屏幕老化并节省电量)。 |
| </p> |
| |
| <aside class="note"> |
| <strong>注意</strong>:系统可能会在显示此屏幕后,显示其他警告屏幕。例如,如果设备处于 <code>UNLOCKED</code> 状态,则之后会显示橙色屏幕。 |
| </aside> |
| |
| <p> |
| <strong>建议的文字:</strong> |
| </p> |
| <p> |
| 您的设备已损坏。该设备不可信任,并且可能无法正常工作。 |
| </p> |
| <p> |
| 请在其他设备上访问此链接以了解详情: |
| </p> |
| <p> |
| g.co/ABH |
| </p> |
| <p> |
| <span class="material-icons">power_settings_new</span> 按电源按钮即可继续。 |
| </p> |
| <p> </p> |
| </td> |
| <td> |
| <figure> |
| <p><strong>红色 eio 屏幕示例:</strong></p> |
| <img src="/security/images/boot_red1.png" alt="红色 eio 设备警告屏幕"/> |
| </figure> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <h3 id="no-valid-os-found">找不到有效的操作系统</h3> |
| <p> |
| 如果找不到有效的 Android 版本,则屏幕会显示红色。设备无法继续启动。如果用户未在 30 秒内确认警告屏幕,则设备将关机(以防止屏幕老化并节省电量)。 |
| </p> |
| <p> |
| 对于十六进制数字<var></var>,请使用用于验证的 libavb 表示形式公钥的 sha256 的前 8 位数字,例如 <code>f7a24de1</code>。 |
| </p> |
| <p> |
| <strong>建议的文字:</strong> |
| </p> |
| <p> |
| 找不到有效的操作系统。设备无法启动。 |
| </p> |
| <p> |
| 请在其他设备上访问此链接以了解详情: |
| </p> |
| <p> |
| g.co/ABH |
| </p> |
| <p> |
| ID:十六进制数字<var></var> |
| </p> |
| <p> |
| <span class="material-icons">power_settings_new</span> 按电源按钮即可关机。 |
| </p> |
| <p> </p> |
| </td> |
| <td> |
| <figure> |
| <p><strong>红色屏幕示例:</strong></p> |
| <img src="/security/images/boot_red2.png" alt="红色损坏设备警告屏幕"/> |
| </figure> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <h3 id="unlock-confirmation">解锁确认</h3> |
| <p> |
| 显示解锁确认屏幕以响应通过 fastboot 接口执行的 <code>fastboot flashing unlock</code> 命令。最初选中的是“Don't lock”(不解锁)。<em></em>如果用户未在 30 秒内与警告屏幕互动,则屏幕会消失并且该命令会失败。 |
| </p> |
| <p> |
| <strong>建议的文字:</strong> |
| </p> |
| <p> |
| 如果您解锁引导加载程序,则可以在此手机上安装自定义操作系统软件。自定义操作系统未经过与原始操作系统相同级别的测试,可能会导致您的手机和已安装的应用停止正常工作。使用自定义操作系统无法保证软件完整性,因此在引导加载程序处于解锁状态时存储在手机上的所有数据都可能面临风险。 |
| </p> |
| <p> |
| 为防止未经授权访问您的个人数据,解锁引导加载程序还将删除您手机上的所有个人数据。 |
| </p> |
| <p> |
| 按音量调高按钮/音量调低按钮可选择是否解锁引导加载程序,然后按电源按钮即可继续。 |
| </p> |
| <p> |
| 解锁 |
| </p> |
| <p> |
| 解锁引导加载程序。 |
| </p> |
| <p> |
| 不解锁 |
| </p> |
| <p> |
| 不解锁引导加载程序并重启手机。 |
| </p> |
| <p> </p> |
| </td> |
| <td> |
| <figure> |
| <p><strong>屏幕示例:</strong></p> |
| <img src="/security/images/unlock-confirmation.png" alt="解锁设备警告屏幕"/> |
| </figure> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <h3 id="lock-confirmation">锁定确认</h3> |
| <p> |
| 显示锁定确认屏幕以响应通过 fastboot 接口执行的 <code>fastboot flashing |
| lock</code> 命令。最初选中的是“Don't lock”(不锁定)。<em></em>如果用户未在 30 秒内与警告屏幕互动,则屏幕会消失并且该命令将失败。 |
| </p> |
| <p> |
| <strong>文字:</strong> |
| </p> |
| <p> |
| 如果您锁定引导加载程序,则无法在此手机上安装自定义操作系统软件。为防止未经授权访问您的个人数据,锁定引导加载程序还将删除您手机上的所有个人数据。 |
| </p> |
| <p> |
| 按音量调高按钮/音量调低按钮可选择是否锁定引导加载程序,然后按电源按钮即可继续。 |
| </p> |
| <p> |
| 锁定 |
| </p> |
| <p> |
| 锁定引导加载程序。 |
| </p> |
| <p> |
| 不锁定 |
| </p> |
| <p> |
| 不锁定引导加载程序并重启手机。 |
| </p> |
| <p> </p> |
| </td> |
| <td> |
| <figure> |
| <p><strong>屏幕示例:</strong></p> |
| <img src="/security/images/lock-confirmation.png" alt="锁定确认设备警告屏幕"/> |
| </figure> |
| </td> |
| </tr> |
| </tbody></table> |
| <h2 id="communicating-verified-boot-state-to-android">将验证启动状态传达给 Android</h2> |
| <p> |
| 引导加载程序通过内核命令选项将验证启动状态传达给 Android。它会将 <code>androidboot.verifiedstate</code> 选项设置为以下其中一个值: |
| </p> |
| <ul> |
| <li><code>green</code>:如果设备已<code>LOCKED</code>且未使用可由用户设置的信任根</li> |
| <li><code>yellow</code>:如果设备已<code>LOCKED</code>且使用了可由用户设置的信任根</li> |
| <li><code>orange</code>:如果设备已<code>UNLOCKED</code></li> |
| </ul> |
| <p> |
| <code>androidboot.veritymode</code> 选项设置为 <code>eio</code> 或 <code>restart</code>,具体取决于引导加载程序在处理 dm-verity 错误时所处的状态。如需了解详情,请参阅<a href="/security/verifiedboot/verified-boot#handling-verification-errors">处理验证错误</a>。 |
| </p> |
| |
| </body></html> |