mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-25 18:55:24 +00:00
vboot2: add a flag to indicate firmware was selected by vboot2
TEST=Done manually on Nyan: localhost ~ # sudo /tmp/crossystem fw_vboot2 0 localhost ~ # sudo /tmp/crossystem fw_vboot2=1 localhost ~ # sudo /tmp/crossystem fw_vboot2 0 # reboot with vboot2 firmware localhost ~ # /tmp/crossystem fw_vboot2 1 BUG=none BRANCH=none Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I6ed553c48bdfebf07393f6f5f46832a60971314a Reviewed-on: https://chromium-review.googlesource.com/205664 Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
This commit is contained in:
committed by
chrome-internal-fetch
parent
4cb5497984
commit
d11086caf0
@@ -261,6 +261,8 @@ typedef struct VbKernelPreambleHeader {
|
||||
#define VBSD_BOOT_FIRMWARE_SW_WP_ENABLED 0x00002000
|
||||
/* VbInit() was told that the recovery button is a virtual one */
|
||||
#define VBSD_BOOT_REC_SWITCH_VIRTUAL 0x00004000
|
||||
/* Firmware used vboot2 for firmware selection */
|
||||
#define VBSD_BOOT_FIRMWARE_VBOOT2 0x00008000
|
||||
|
||||
/*
|
||||
* Supported flags by header version. It's ok to add new flags while keeping
|
||||
|
||||
@@ -47,7 +47,8 @@ typedef enum VdatIntField {
|
||||
VDAT_INT_TRIED_FIRMWARE_B, /* Tried firmware B due to fwb_tries */
|
||||
VDAT_INT_KERNEL_KEY_VERIFIED, /* Kernel key verified using
|
||||
* signature, not just hash */
|
||||
VDAT_INT_RECOVERY_REASON /* Recovery reason for current boot */
|
||||
VDAT_INT_RECOVERY_REASON, /* Recovery reason for current boot */
|
||||
VDAT_INT_FW_BOOT2 /* Firmware selection by vboot2 */
|
||||
} VdatIntField;
|
||||
|
||||
|
||||
@@ -395,6 +396,8 @@ int GetVdatInt(VdatIntField field) {
|
||||
case VDAT_INT_KERNEL_VERSION_TPM:
|
||||
value = (int)sh->kernel_version_tpm;
|
||||
break;
|
||||
case VDAT_INT_FW_BOOT2:
|
||||
value = (sh->flags & VBSD_BOOT_FIRMWARE_VBOOT2 ? 1 : 0);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -459,6 +462,8 @@ int VbGetSystemPropertyInt(const char* name) {
|
||||
value = VbGetNvStorage(VBNV_CLEAR_TPM_OWNER_DONE);
|
||||
} else if (!strcasecmp(name,"fwb_tries")) {
|
||||
value = VbGetNvStorage(VBNV_TRY_B_COUNT);
|
||||
} else if (!strcasecmp(name,"fw_vboot2")) {
|
||||
value = GetVdatInt(VDAT_INT_FW_BOOT2);
|
||||
} else if (!strcasecmp(name,"fwupdate_tries")) {
|
||||
value = VbGetNvStorage(VBNV_KERNEL_FIELD);
|
||||
if (value != -1)
|
||||
|
||||
@@ -53,6 +53,7 @@ const Param sys_param_list[] = {
|
||||
{"ecfw_act", IS_STRING, "Active EC firmware"},
|
||||
{"fmap_base", 0, "Main firmware flashmap physical address", "0x%08x"},
|
||||
{"fwb_tries", CAN_WRITE, "Try firmware B count (writable)"},
|
||||
{"fw_vboot2", 0, "1 if firmware was selected by vboot2 or 0 otherwise"},
|
||||
{"fwid", IS_STRING, "Active firmware ID"},
|
||||
{"fwupdate_tries", CAN_WRITE,
|
||||
"Times to try OS firmware update (writable, inside kern_nv)"},
|
||||
|
||||
Reference in New Issue
Block a user