Skip to content
Snippets Groups Projects
Commit 30f0b8a2 authored by Guillaume LA ROQUE's avatar Guillaume LA ROQUE Committed by Mattijs Korpershoek
Browse files

cmd: avb: use unlocked state return by avb_ops->read_is_device_unlocked

use unlocked state to know if device is lock.
with android10 and new dunamic partition android have a userspace
implementation to flash parition, userspace fastboot[1] use
"androidboot.verifiedbootstate"[2] to know if device is lock or not.

[1] https://android.googlesource.com/platform/system/core/+/refs/heads/master/fastboot/device/utility.cpp#202
[2] https://source.android.com/security/verifiedboot/boot-flow#communicating-verified-boot-state-to-users



Signed-off-by: default avatarGuillaume La Roque <glaroque@baylibre.com>
parent e4b6ebd3
No related branches found
No related tags found
No related merge requests found
...@@ -271,16 +271,14 @@ int do_avb_verify_part(struct cmd_tbl *cmdtp, int flag, ...@@ -271,16 +271,14 @@ int do_avb_verify_part(struct cmd_tbl *cmdtp, int flag,
switch (slot_result) { switch (slot_result) {
case AVB_SLOT_VERIFY_RESULT_OK: case AVB_SLOT_VERIFY_RESULT_OK:
/* Until we don't have support of changing unlock states, we
* assume that we are by default in locked state.
* So in this case we can boot only when verification is
* successful; we also supply in cmdline GREEN boot state
*/
printf("Verification passed successfully\n"); printf("Verification passed successfully\n");
/* export additional bootargs to AVB_BOOTARGS env var */ /* export additional bootargs to AVB_BOOTARGS env var */
if (unlocked)
extra_args = avb_set_state(avb_ops, AVB_ORANGE);
else
extra_args = avb_set_state(avb_ops, AVB_GREEN);
extra_args = avb_set_state(avb_ops, AVB_GREEN);
if (extra_args) if (extra_args)
cmdline = append_cmd_line(out_data->cmdline, cmdline = append_cmd_line(out_data->cmdline,
extra_args); extra_args);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment