summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2021-01-20 17:54:15 +0800
committerCommit Bot <commit-bot@chromium.org>2021-02-27 07:45:46 +0000
commit5b1e2e75b48db4f056dc952616c9a9fecf3535c1 (patch)
treed289d09b20c48aeb214a2bd428e056c1351c7615 /firmware
parent6466c58b87e0d6c944bc8aa7dbac3f9f54690b71 (diff)
downloadvboot-5b1e2e75b48db4f056dc952616c9a9fecf3535c1.tar.gz
vboot: standardize legacy boot and altfw terminology
Standardize on the term "altfw" (short form) and "alternate bootloader" (long form) in both code and documentation. Remove the VbAltFwIndex_t enum, and replace with a simple uint32_t. Rename VbExLegacy to vb2ex_run_altfw, and move to vboot2 namespace. Rename crossystem param dev_boot_legacy to dev_boot_altfw, but leave an alias. Rename crossystem param dev_default_boot value from legacy to altfw, but leave an alias. BUG=b:179458327 TEST=make clean && make runtests TEST=emerge vboot_reference and check output for: crossystem dev_boot_legacy=0 crossystem dev_boot_altfw=0 crossystem dev_default_boot=legacy crossystem dev_default_boot=altfw BRANCH=none Cq-Depend: chromium:2641196 Signed-off-by: Joel Kitching <kitching@google.com> Change-Id: I289df63d992a3d9ae3845c59779ecbd115b18ee2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2641346 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
Diffstat (limited to 'firmware')
-rw-r--r--firmware/2lib/2misc.c26
-rw-r--r--firmware/2lib/2nvstorage.c4
-rw-r--r--firmware/2lib/2recovery_reasons.c4
-rw-r--r--firmware/2lib/2stub.c2
-rw-r--r--firmware/2lib/2ui.c4
-rw-r--r--firmware/2lib/2ui_screens.c48
-rw-r--r--firmware/2lib/include/2api.h29
-rw-r--r--firmware/2lib/include/2gbb_flags.h6
-rw-r--r--firmware/2lib/include/2misc.h6
-rw-r--r--firmware/2lib/include/2nvstorage.h2
-rw-r--r--firmware/2lib/include/2recovery_reasons.h4
-rw-r--r--firmware/2lib/include/2secdata.h2
-rw-r--r--firmware/2lib/include/2ui.h2
-rw-r--r--firmware/include/vboot_api.h27
-rw-r--r--firmware/stub/vboot_api_stub.c2
15 files changed, 76 insertions, 92 deletions
diff --git a/firmware/2lib/2misc.c b/firmware/2lib/2misc.c
index ec460b32..13cd35a2 100644
--- a/firmware/2lib/2misc.c
+++ b/firmware/2lib/2misc.c
@@ -250,7 +250,7 @@ vb2_error_t vb2_check_dev_switch(struct vb2_context *ctx)
* developer mode.
*/
vb2_nv_set(ctx, VB2_NV_DEV_BOOT_EXTERNAL, 0);
- vb2_nv_set(ctx, VB2_NV_DEV_BOOT_LEGACY, 0);
+ vb2_nv_set(ctx, VB2_NV_DEV_BOOT_ALTFW, 0);
vb2_nv_set(ctx, VB2_NV_DEV_BOOT_SIGNED_ONLY, 0);
vb2_nv_set(ctx, VB2_NV_DEV_DEFAULT_BOOT, 0);
}
@@ -527,8 +527,8 @@ enum vb2_dev_default_boot_target vb2api_get_dev_default_boot_target(
{
struct vb2_gbb_header *gbb = vb2_get_gbb(ctx);
- if (gbb->flags & VB2_GBB_FLAG_DEFAULT_DEV_BOOT_LEGACY)
- return VB2_DEV_DEFAULT_BOOT_TARGET_LEGACY;
+ if (gbb->flags & VB2_GBB_FLAG_DEFAULT_DEV_BOOT_ALTFW)
+ return VB2_DEV_DEFAULT_BOOT_TARGET_ALTFW;
switch (vb2_nv_get(ctx, VB2_NV_DEV_DEFAULT_BOOT)) {
case VB2_DEV_DEFAULT_BOOT_TARGET_EXTERNAL:
@@ -536,9 +536,9 @@ enum vb2_dev_default_boot_target vb2api_get_dev_default_boot_target(
return VB2_DEV_DEFAULT_BOOT_TARGET_EXTERNAL;
break;
- case VB2_DEV_DEFAULT_BOOT_TARGET_LEGACY:
- if (vb2_dev_boot_legacy_allowed(ctx))
- return VB2_DEV_DEFAULT_BOOT_TARGET_LEGACY;
+ case VB2_DEV_DEFAULT_BOOT_TARGET_ALTFW:
+ if (vb2_dev_boot_altfw_allowed(ctx))
+ return VB2_DEV_DEFAULT_BOOT_TARGET_ALTFW;
break;
}
@@ -555,14 +555,14 @@ int vb2_dev_boot_allowed(struct vb2_context *ctx)
return 1;
}
-int vb2_dev_boot_legacy_allowed(struct vb2_context *ctx)
+int vb2_dev_boot_altfw_allowed(struct vb2_context *ctx)
{
struct vb2_gbb_header *gbb = vb2_get_gbb(ctx);
- return vb2_nv_get(ctx, VB2_NV_DEV_BOOT_LEGACY) ||
- (gbb->flags & VB2_GBB_FLAG_FORCE_DEV_BOOT_LEGACY) ||
+ return vb2_nv_get(ctx, VB2_NV_DEV_BOOT_ALTFW) ||
+ (gbb->flags & VB2_GBB_FLAG_FORCE_DEV_BOOT_ALTFW) ||
vb2_secdata_fwmp_get_flag(ctx,
- VB2_SECDATA_FWMP_DEV_ENABLE_LEGACY);
+ VB2_SECDATA_FWMP_DEV_ENABLE_ALTFW);
}
int vb2_dev_boot_external_allowed(struct vb2_context *ctx)
@@ -660,9 +660,9 @@ char *vb2api_get_debug_info(struct vb2_context *ctx)
i = vb2_nv_get(ctx, VB2_NV_DEV_BOOT_EXTERNAL);
DEBUG_INFO_APPEND("\ndev_boot_usb: %d", i);
- /* Add dev_boot_legacy flag */
- i = vb2_nv_get(ctx, VB2_NV_DEV_BOOT_LEGACY);
- DEBUG_INFO_APPEND("\ndev_boot_legacy: %d", i);
+ /* Add dev_boot_altfw flag */
+ i = vb2_nv_get(ctx, VB2_NV_DEV_BOOT_ALTFW);
+ DEBUG_INFO_APPEND("\ndev_boot_altfw: %d", i);
/* Add dev_default_boot flag */
i = vb2_nv_get(ctx, VB2_NV_DEV_DEFAULT_BOOT);
diff --git a/firmware/2lib/2nvstorage.c b/firmware/2lib/2nvstorage.c
index c3cdca5e..1cd5ba25 100644
--- a/firmware/2lib/2nvstorage.c
+++ b/firmware/2lib/2nvstorage.c
@@ -145,7 +145,7 @@ uint32_t vb2_nv_get(struct vb2_context *ctx, enum vb2_nv_param param)
case VB2_NV_DEV_BOOT_EXTERNAL:
return GETBIT(VB2_NV_OFFS_DEV, VB2_NV_DEV_FLAG_EXTERNAL);
- case VB2_NV_DEV_BOOT_LEGACY:
+ case VB2_NV_DEV_BOOT_ALTFW:
return GETBIT(VB2_NV_OFFS_DEV, VB2_NV_DEV_FLAG_LEGACY);
case VB2_NV_DEV_BOOT_SIGNED_ONLY:
@@ -331,7 +331,7 @@ void vb2_nv_set(struct vb2_context *ctx,
SETBIT(VB2_NV_OFFS_DEV, VB2_NV_DEV_FLAG_EXTERNAL);
break;
- case VB2_NV_DEV_BOOT_LEGACY:
+ case VB2_NV_DEV_BOOT_ALTFW:
SETBIT(VB2_NV_OFFS_DEV, VB2_NV_DEV_FLAG_LEGACY);
break;
diff --git a/firmware/2lib/2recovery_reasons.c b/firmware/2lib/2recovery_reasons.c
index 093ef863..8c43dcef 100644
--- a/firmware/2lib/2recovery_reasons.c
+++ b/firmware/2lib/2recovery_reasons.c
@@ -152,8 +152,8 @@ const char *vb2_get_recovery_reason_string(uint8_t code)
return "Recovery hash space lock error in RO firmware";
/* 0x60 */ case VB2_RECOVERY_TPM_DISABLE_FAILED:
return "Failed to disable TPM before running untrusted code";
- /* 0x61 */ case VB2_RECOVERY_ALTFW_HASH_FAILED:
- return "Verification of alternative firmware payload failed";
+ /* 0x61 */ case VB2_RECOVERY_ALTFW_HASH_MISMATCH:
+ return "Verification of alternate bootloader payload failed";
/* 0x62 */ case VB2_RECOVERY_SECDATA_FWMP_INIT:
return "FWMP secure NVRAM (TPM) initialization error";
/* 0x63 */ case VB2_RECOVERY_CR50_BOOT_MODE:
diff --git a/firmware/2lib/2stub.c b/firmware/2lib/2stub.c
index d26ee745..79fcf717 100644
--- a/firmware/2lib/2stub.c
+++ b/firmware/2lib/2stub.c
@@ -223,7 +223,7 @@ uint32_t vb2ex_get_locale_count(void)
}
__attribute__((weak))
-uint32_t vb2ex_get_bootloader_count(void)
+uint32_t vb2ex_get_altfw_count(void)
{
return 0;
}
diff --git a/firmware/2lib/2ui.c b/firmware/2lib/2ui.c
index 10de1760..80d0568d 100644
--- a/firmware/2lib/2ui.c
+++ b/firmware/2lib/2ui.c
@@ -422,8 +422,8 @@ vb2_error_t developer_action(struct vb2_ui_context *ui)
if (ui->key == VB_KEY_CTRL('D') ||
(DETACHABLE && ui->key == VB_BUTTON_VOL_DOWN_LONG_PRESS))
return vb2_ui_developer_mode_boot_internal_action(ui);
- if (ui->key == VB_KEY_CTRL('L'))
- return vb2_ui_developer_mode_boot_alternate_action(ui);
+ if (ui->key == VB_KEY_CTRL('L')) /* L for aLtfw (formerly Legacy) */
+ return vb2_ui_developer_mode_boot_altfw_action(ui);
if (ui->key == '\t')
return vb2_ui_screen_change(ui, VB2_SCREEN_DEBUG_INFO);
diff --git a/firmware/2lib/2ui_screens.c b/firmware/2lib/2ui_screens.c
index 4aeeda14..a3ee41a5 100644
--- a/firmware/2lib/2ui_screens.c
+++ b/firmware/2lib/2ui_screens.c
@@ -681,7 +681,7 @@ static const struct vb2_screen_info recovery_disk_step3_screen = {
#define DEVELOPER_MODE_ITEM_RETURN_TO_SECURE 1
#define DEVELOPER_MODE_ITEM_BOOT_INTERNAL 2
#define DEVELOPER_MODE_ITEM_BOOT_EXTERNAL 3
-#define DEVELOPER_MODE_ITEM_SELECT_BOOTLOADER 4
+#define DEVELOPER_MODE_ITEM_SELECT_ALTFW 4
vb2_error_t developer_mode_init(struct vb2_ui_context *ui)
{
@@ -703,18 +703,18 @@ vb2_error_t developer_mode_init(struct vb2_ui_context *ui)
DEVELOPER_MODE_ITEM_BOOT_EXTERNAL);
/* Don't show "Select alternate bootloader" button if not allowed. */
- if (!vb2_dev_boot_legacy_allowed(ui->ctx))
+ if (!vb2_dev_boot_altfw_allowed(ui->ctx))
VB2_SET_BIT(ui->state->hidden_item_mask,
- DEVELOPER_MODE_ITEM_SELECT_BOOTLOADER);
+ DEVELOPER_MODE_ITEM_SELECT_ALTFW);
/* Choose the default selection. */
switch (default_boot) {
case VB2_DEV_DEFAULT_BOOT_TARGET_EXTERNAL:
ui->state->selected_item = DEVELOPER_MODE_ITEM_BOOT_EXTERNAL;
break;
- case VB2_DEV_DEFAULT_BOOT_TARGET_LEGACY:
+ case VB2_DEV_DEFAULT_BOOT_TARGET_ALTFW:
ui->state->selected_item =
- DEVELOPER_MODE_ITEM_SELECT_BOOTLOADER;
+ DEVELOPER_MODE_ITEM_SELECT_ALTFW;
break;
default:
ui->state->selected_item = DEVELOPER_MODE_ITEM_BOOT_INTERNAL;
@@ -831,9 +831,9 @@ static const struct vb2_menu_item developer_mode_items[] = {
.text = "Boot from external disk",
.action = vb2_ui_developer_mode_boot_external_action,
},
- [DEVELOPER_MODE_ITEM_SELECT_BOOTLOADER] = {
+ [DEVELOPER_MODE_ITEM_SELECT_ALTFW] = {
.text = "Select alternate bootloader",
- .target = VB2_SCREEN_DEVELOPER_SELECT_BOOTLOADER,
+ .target = VB2_SCREEN_DEVELOPER_SELECT_ALTFW,
},
ADVANCED_OPTIONS_ITEM,
POWER_OFF_ITEM,
@@ -929,7 +929,7 @@ static const struct vb2_screen_info developer_invalid_disk_screen = {
};
/******************************************************************************/
-/* VB2_SCREEN_DEVELOPER_SELECT_BOOTLOADER */
+/* VB2_SCREEN_DEVELOPER_SELECT_ALTFW */
static const struct vb2_menu_item developer_select_bootloader_items_before[] = {
LANGUAGE_SELECT_ITEM,
@@ -943,7 +943,7 @@ static const struct vb2_menu_item developer_select_bootloader_items_after[] = {
static vb2_error_t developer_select_bootloader_init(struct vb2_ui_context *ui)
{
if (get_menu(ui)->num_items == 0) {
- ui->error_code = VB2_UI_ERROR_NO_BOOTLOADER;
+ ui->error_code = VB2_UI_ERROR_ALTFW_EMPTY;
return vb2_ui_screen_back(ui);
}
/* Select the first bootloader. */
@@ -952,40 +952,40 @@ static vb2_error_t developer_select_bootloader_init(struct vb2_ui_context *ui)
return VB2_REQUEST_UI_CONTINUE;
}
-vb2_error_t vb2_ui_developer_mode_boot_alternate_action(
+vb2_error_t vb2_ui_developer_mode_boot_altfw_action(
struct vb2_ui_context *ui)
{
- uint32_t altfw_num;
+ uint32_t altfw_id;
const size_t menu_before_len =
ARRAY_SIZE(developer_select_bootloader_items_before);
if (!(ui->ctx->flags & VB2_CONTEXT_DEVELOPER_MODE) ||
!vb2_dev_boot_allowed(ui->ctx) ||
- !vb2_dev_boot_legacy_allowed(ui->ctx)) {
+ !vb2_dev_boot_altfw_allowed(ui->ctx)) {
VB2_DEBUG("ERROR: Dev mode alternate bootloader not allowed\n");
- ui->error_code = VB2_UI_ERROR_ALTERNATE_BOOT_DISABLED;
+ ui->error_code = VB2_UI_ERROR_ALTFW_DISABLED;
return VB2_REQUEST_UI_CONTINUE;
}
- if (vb2ex_get_bootloader_count() == 0) {
+ if (vb2ex_get_altfw_count() == 0) {
VB2_DEBUG("ERROR: No alternate bootloader was found\n");
- ui->error_code = VB2_UI_ERROR_NO_BOOTLOADER;
+ ui->error_code = VB2_UI_ERROR_ALTFW_EMPTY;
return VB2_REQUEST_UI_CONTINUE;
}
if (ui->key == VB_KEY_CTRL('L')) {
- altfw_num = 0;
+ altfw_id = 0;
VB2_DEBUG("Try booting from default bootloader\n");
} else {
- altfw_num = ui->state->selected_item - menu_before_len + 1;
- VB2_DEBUG("Try booting from bootloader #%u\n", altfw_num);
+ altfw_id = ui->state->selected_item - menu_before_len + 1;
+ VB2_DEBUG("Try booting from bootloader #%u\n", altfw_id);
}
- /* VbExLegacy will not return if successful */
- VbExLegacy(altfw_num);
+ /* vb2ex_run_altfw will not return if successful */
+ vb2ex_run_altfw(altfw_id);
VB2_DEBUG("ERROR: Alternate bootloader failed\n");
- ui->error_code = VB2_UI_ERROR_ALTERNATE_BOOT_FAILED;
+ ui->error_code = VB2_UI_ERROR_ALTFW_FAILED;
return VB2_REQUEST_UI_CONTINUE;
}
@@ -1002,7 +1002,7 @@ static const struct vb2_menu *get_bootloader_menu(struct vb2_ui_context *ui)
if (ui->bootloader_menu.num_items > 0)
return &ui->bootloader_menu;
- num_bootloaders = vb2ex_get_bootloader_count();
+ num_bootloaders = vb2ex_get_altfw_count();
if (num_bootloaders == 0) {
VB2_DEBUG("ERROR: No bootloader was found\n");
return NULL;
@@ -1024,7 +1024,7 @@ static const struct vb2_menu *get_bootloader_menu(struct vb2_ui_context *ui)
for (i = 0; i < num_bootloaders; i++) {
items[i + menu_before_len].text = "Some bootloader";
items[i + menu_before_len].action =
- vb2_ui_developer_mode_boot_alternate_action;
+ vb2_ui_developer_mode_boot_altfw_action;
}
/* Copy postfix items to the end. */
@@ -1039,7 +1039,7 @@ static const struct vb2_menu *get_bootloader_menu(struct vb2_ui_context *ui)
}
static const struct vb2_screen_info developer_select_bootloader_screen = {
- .id = VB2_SCREEN_DEVELOPER_SELECT_BOOTLOADER,
+ .id = VB2_SCREEN_DEVELOPER_SELECT_ALTFW,
.name = "Select alternate bootloader",
.init = developer_select_bootloader_init,
.get_menu = get_bootloader_menu,
diff --git a/firmware/2lib/include/2api.h b/firmware/2lib/include/2api.h
index 5ea06e2f..2b7fce4a 100644
--- a/firmware/2lib/include/2api.h
+++ b/firmware/2lib/include/2api.h
@@ -875,8 +875,8 @@ enum vb2_dev_default_boot_target {
/* Default to boot from external disk. */
VB2_DEV_DEFAULT_BOOT_TARGET_EXTERNAL = 1,
- /* Default to boot legacy OS. */
- VB2_DEV_DEFAULT_BOOT_TARGET_LEGACY = 2,
+ /* Default to boot altfw. */
+ VB2_DEV_DEFAULT_BOOT_TARGET_ALTFW = 2,
};
/**
@@ -1339,8 +1339,8 @@ enum vb2_screen {
VB2_SCREEN_DEVELOPER_BOOT_EXTERNAL = 0x320,
/* Invalid external disk inserted */
VB2_SCREEN_DEVELOPER_INVALID_DISK = 0x330,
- /* Select alternate bootloader ("legacy boot") */
- VB2_SCREEN_DEVELOPER_SELECT_BOOTLOADER = 0x340,
+ /* Select alternate bootloader ("altfw") */
+ VB2_SCREEN_DEVELOPER_SELECT_ALTFW = 0x340,
/* Diagnostic tools */
VB2_SCREEN_DIAGNOSTICS = 0x400,
/* Storage diagnostic screen */
@@ -1366,11 +1366,11 @@ enum vb2_ui_error {
/* Untrusted confirmation */
VB2_UI_ERROR_UNTRUSTED_CONFIRMATION,
/* Alternate bootloader is disabled */
- VB2_UI_ERROR_ALTERNATE_BOOT_DISABLED,
- /* No bootloader was found */
- VB2_UI_ERROR_NO_BOOTLOADER,
+ VB2_UI_ERROR_ALTFW_DISABLED,
+ /* No alternate bootloader was found */
+ VB2_UI_ERROR_ALTFW_EMPTY,
/* Alternate bootloader failed */
- VB2_UI_ERROR_ALTERNATE_BOOT_FAILED,
+ VB2_UI_ERROR_ALTFW_FAILED,
/* Diagnostics internal failure */
VB2_UI_ERROR_DIAGNOSTICS,
};
@@ -1426,7 +1426,18 @@ uint32_t vb2ex_get_locale_count(void);
*
* @return Number of alternate bootloaders. 0 if none or on error.
*/
-uint32_t vb2ex_get_bootloader_count(void);
+uint32_t vb2ex_get_altfw_count(void);
+
+/**
+ * Run alternate bootloader.
+ *
+ * @param altfw_id ID of alternate bootloader to run, where
+ * altfw_id <= vb2ex_get_altfw_count(). 0 for default,
+ * which corresponds to an alternate bootloader in
+ * the range 1 <= altfw_id <= vb2ex_getfw_count().
+ * @return VB2_SUCCESS, or error code on error.
+ */
+vb2_error_t vb2ex_run_altfw(uint32_t altfw_id);
/**
* Delay for at least the specified number of milliseconds.
diff --git a/firmware/2lib/include/2gbb_flags.h b/firmware/2lib/include/2gbb_flags.h
index c1c937c9..0eff7f70 100644
--- a/firmware/2lib/include/2gbb_flags.h
+++ b/firmware/2lib/include/2gbb_flags.h
@@ -53,8 +53,8 @@ enum vb2_gbb_flag {
/* Allow Enter key to trigger dev->tonorm screen transition */
VB2_GBB_FLAG_ENTER_TRIGGERS_TONORM = 1 << 6,
- /* Allow booting Legacy OSes in dev mode even if dev_boot_legacy=0. */
- VB2_GBB_FLAG_FORCE_DEV_BOOT_LEGACY = 1 << 7,
+ /* Allow booting Legacy OSes in dev mode even if dev_boot_altfw=0. */
+ VB2_GBB_FLAG_FORCE_DEV_BOOT_ALTFW = 1 << 7,
/*
* Currently running FAFT tests. May be used as a hint to disable
@@ -69,7 +69,7 @@ enum vb2_gbb_flag {
VB2_GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC = 1 << 9,
/* Default to booting legacy OS when dev screen times out */
- VB2_GBB_FLAG_DEFAULT_DEV_BOOT_LEGACY = 1 << 10,
+ VB2_GBB_FLAG_DEFAULT_DEV_BOOT_ALTFW = 1 << 10,
/* Disable auxiliary firmware (auxfw) software sync */
VB2_GBB_FLAG_DISABLE_AUXFW_SOFTWARE_SYNC = 1 << 11,
diff --git a/firmware/2lib/include/2misc.h b/firmware/2lib/include/2misc.h
index 334b1485..3d96293b 100644
--- a/firmware/2lib/include/2misc.h
+++ b/firmware/2lib/include/2misc.h
@@ -224,13 +224,13 @@ int vb2_dev_boot_allowed(struct vb2_context *ctx);
* Determine if booting from legacy BIOS is allowed.
*
* Legacy BIOS is allowed if any of these flags are set:
- * VB2_NV_DEV_BOOT_LEGACY, VB2_GBB_FLAG_FORCE_DEV_BOOT_LEGACY, and
- * VB2_SECDATA_FWMP_DEV_ENABLE_LEGACY.
+ * VB2_NV_DEV_BOOT_ALTFW, VB2_GBB_FLAG_FORCE_DEV_BOOT_ALTFW, and
+ * VB2_SECDATA_FWMP_DEV_ENABLE_ALTFW.
*
* @param ctx Vboot context
* @return 1 if allowed, or 0 otherwise.
*/
-int vb2_dev_boot_legacy_allowed(struct vb2_context *ctx);
+int vb2_dev_boot_altfw_allowed(struct vb2_context *ctx);
/**
* Determine if booting from external disk is allowed.
diff --git a/firmware/2lib/include/2nvstorage.h b/firmware/2lib/include/2nvstorage.h
index 9de8056e..2f40b233 100644
--- a/firmware/2lib/include/2nvstorage.h
+++ b/firmware/2lib/include/2nvstorage.h
@@ -49,7 +49,7 @@ enum vb2_nv_param {
/* Allow booting from external disk in developer mode. 0=no, 1=yes. */
VB2_NV_DEV_BOOT_EXTERNAL,
/* Allow booting of legacy OSes in developer mode. 0=no, 1=yes. */
- VB2_NV_DEV_BOOT_LEGACY,
+ VB2_NV_DEV_BOOT_ALTFW,
/* Only boot Google-signed images in developer mode. 0=no, 1=yes. */
VB2_NV_DEV_BOOT_SIGNED_ONLY,
/*
diff --git a/firmware/2lib/include/2recovery_reasons.h b/firmware/2lib/include/2recovery_reasons.h
index e8cff424..30dbd2e3 100644
--- a/firmware/2lib/include/2recovery_reasons.h
+++ b/firmware/2lib/include/2recovery_reasons.h
@@ -265,8 +265,8 @@ enum vb2_nv_recovery {
/* Failed to disable the TPM [prior to running untrusted code] */
VB2_RECOVERY_TPM_DISABLE_FAILED = 0x60,
- /* Alt FW Failed hash verification */
- VB2_RECOVERY_ALTFW_HASH_FAILED = 0x61,
+ /* Verification of altfw payload failed (deprecated) */
+ VB2_RECOVERY_ALTFW_HASH_MISMATCH = 0x61,
/* FWMP secure data initialization error */
VB2_RECOVERY_SECDATA_FWMP_INIT = 0x62,
diff --git a/firmware/2lib/include/2secdata.h b/firmware/2lib/include/2secdata.h
index 5e419340..f9a0e308 100644
--- a/firmware/2lib/include/2secdata.h
+++ b/firmware/2lib/include/2secdata.h
@@ -181,7 +181,7 @@ enum vb2_secdata_fwmp_flags {
VB2_SECDATA_FWMP_DEV_DISABLE_BOOT = (1 << 0),
VB2_SECDATA_FWMP_DEV_DISABLE_RECOVERY = (1 << 1),
VB2_SECDATA_FWMP_DEV_ENABLE_EXTERNAL = (1 << 2),
- VB2_SECDATA_FWMP_DEV_ENABLE_LEGACY = (1 << 3),
+ VB2_SECDATA_FWMP_DEV_ENABLE_ALTFW = (1 << 3),
VB2_SECDATA_FWMP_DEV_ENABLE_OFFICIAL_ONLY = (1 << 4),
VB2_SECDATA_FWMP_DEV_USE_KEY_HASH = (1 << 5),
/* CCD = case-closed debugging on cr50; flag implemented on cr50 */
diff --git a/firmware/2lib/include/2ui.h b/firmware/2lib/include/2ui.h
index 2e1f3651..c5d13311 100644
--- a/firmware/2lib/include/2ui.h
+++ b/firmware/2lib/include/2ui.h
@@ -132,7 +132,7 @@ vb2_error_t vb2_ui_developer_mode_boot_internal_action(
struct vb2_ui_context *ui);
vb2_error_t vb2_ui_developer_mode_boot_external_action(
struct vb2_ui_context *ui);
-vb2_error_t vb2_ui_developer_mode_boot_alternate_action(
+vb2_error_t vb2_ui_developer_mode_boot_altfw_action(
struct vb2_ui_context *ui);
/**
diff --git a/firmware/include/vboot_api.h b/firmware/include/vboot_api.h
index 739019ad..43752e4a 100644
--- a/firmware/include/vboot_api.h
+++ b/firmware/include/vboot_api.h
@@ -355,33 +355,6 @@ uint32_t VbExIsShutdownRequested(void);
/* Shutdown requested due to a power button being pressed. */
#define VB_SHUTDOWN_REQUEST_POWER_BUTTON 0x00000004
-enum VbAltFwIndex_t {
- VB_ALTFW_DIAGNOSTIC = -1,
- VB_ALTFW_DEFAULT = 0,
- VB_ALTFW_FIRST = 1,
- VB_ALTFW_SECOND,
- VB_ALTFW_THIRD,
- VB_ALTFW_FOURTH,
- VB_ALTFW_FIFTH,
- VB_ALTFW_SIXTH,
- VB_ALTFW_SEVENTH,
- VB_ALTFW_EIGHTH,
- VB_ALTFW_NINTH,
-};
-
-/**
- * Execute legacy boot option.
- *
- * @param altfw_num Bootloader sequence number to execute. Use
- * 0 to boot the default payload, if any
- * >0 (i.e., positive #) run a payload by # based in altfw/list file
- * <0 (i.e., negative #) run a specific payload by name without using
- * the altfw/list file. Typically payloads in this category will be
- * verified before they are run. Currently these #s are defined:
- * -1 diagnostic payload
- */
-vb2_error_t VbExLegacy(enum VbAltFwIndex_t altfw_num);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/firmware/stub/vboot_api_stub.c b/firmware/stub/vboot_api_stub.c
index a0da9ae1..bc5f2fe9 100644
--- a/firmware/stub/vboot_api_stub.c
+++ b/firmware/stub/vboot_api_stub.c
@@ -37,7 +37,7 @@ uint32_t VbExIsShutdownRequested(void)
}
__attribute__((weak))
-vb2_error_t VbExLegacy(enum VbAltFwIndex_t altfw_num)
+vb2_error_t vb2ex_run_altfw(uint32_t altfw_id)
{
return VB2_SUCCESS;
}