if (avb_ops)
return CMD_RET_SUCCESS;
+ printf("Failed to initialize avb2\n");
+
return CMD_RET_FAILURE;
}
return CMD_RET_SUCCESS;
}
+ printf("Failed to read from partition\n");
+
return CMD_RET_FAILURE;
}
return CMD_RET_SUCCESS;
}
+ printf("Failed to read from partition\n");
+
free(buffer);
return CMD_RET_FAILURE;
}
return CMD_RET_SUCCESS;
}
+ printf("Failed to write in partition\n");
+
return CMD_RET_FAILURE;
}
if (avb_ops->read_rollback_index(avb_ops, index, &rb_idx) ==
AVB_IO_RESULT_OK) {
- printf("Rollback index: %llu\n", rb_idx);
+ printf("Rollback index: %llx\n", rb_idx);
return CMD_RET_SUCCESS;
}
+
+ printf("Failed to read rollback index\n");
+
return CMD_RET_FAILURE;
}
AVB_IO_RESULT_OK)
return CMD_RET_SUCCESS;
+ printf("Failed to write rollback index\n");
+
return CMD_RET_FAILURE;
}
return CMD_RET_SUCCESS;
}
+ printf("Failed to read UUID\n");
+
return CMD_RET_FAILURE;
}
{
AvbSlotVerifyResult slot_result;
AvbSlotVerifyData *out_data;
+ char *cmdline;
+ char *extra_args;
bool unlocked = false;
int res = CMD_RET_FAILURE;
switch (slot_result) {
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");
/* export additional bootargs to AVB_BOOTARGS env var */
- env_set(AVB_BOOTARGS, out_data->cmdline);
+
+ extra_args = avb_set_state(avb_ops, AVB_GREEN);
+ if (extra_args)
+ cmdline = append_cmd_line(out_data->cmdline,
+ extra_args);
+ else
+ cmdline = out_data->cmdline;
+
+ env_set(AVB_BOOTARGS, cmdline);
res = CMD_RET_SUCCESS;
break;
return CMD_RET_SUCCESS;
}
+ printf("Can't determine device lock state.\n");
+
return CMD_RET_FAILURE;
}