summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-10-16 03:42:56 -0600
committerchrome-bot <chrome-bot@chromium.org>2018-10-18 19:01:10 -0700
commitebd087a925e3b3c62c5b6ba98f951848844ffdf3 (patch)
treed0dc6a56af45d0c35fe7fdecf34165cbf01bdec4
parentc61d34f02b9210f5b42cc072bbdcbadd19058d88 (diff)
downloadvboot-ebd087a925e3b3c62c5b6ba98f951848844ffdf3.tar.gz
Add a variable for allowing alternative firmware
At present the condition for this is checked in one place in boot_legacy_action(). We need to be able to check it in more than one place, so put it in a variable when entering developer mode. This matches how the keyboard UI works. BUG=chromium:837018 BRANCH=none TEST=FEATURES=test emerge-grunt --nodeps vboot_reference Change-Id: Iaf01b827095b0a1139a36af6834eba4dbf7fb150 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1286218 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--firmware/lib/vboot_ui_menu.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/firmware/lib/vboot_ui_menu.c b/firmware/lib/vboot_ui_menu.c
index eb75be2b..1ed01da9 100644
--- a/firmware/lib/vboot_ui_menu.c
+++ b/firmware/lib/vboot_ui_menu.c
@@ -33,6 +33,7 @@ static VB_MENU current_menu, prev_menu;
static int current_menu_idx, disabled_idx_mask, usb_nogood;
static uint32_t default_boot;
static uint32_t disable_dev_boot;
+static uint32_t altfw_allowed;
static struct vb2_menu menus[];
/**
@@ -132,9 +133,7 @@ static VbError_t boot_legacy_action(struct vb2_context *ctx)
return VBERROR_KEEP_LOOPING;
}
- if (!vb2_nv_get(ctx, VB2_NV_DEV_BOOT_LEGACY) &&
- !(vb2_get_sd(ctx)->gbb_flags & VB2_GBB_FLAG_FORCE_DEV_BOOT_LEGACY)
- && !(vb2_get_fwmp_flags() & FWMP_DEV_ENABLE_LEGACY)) {
+ if (!altfw_allowed) {
vb2_flash_screen(ctx);
VB2_DEBUG("Legacy boot is disabled\n");
VbExDisplayDebugInfo("WARNING: Booting legacy BIOS has not "
@@ -664,6 +663,9 @@ static VbError_t vb2_developer_menu(struct vb2_context *ctx)
VB2_DEBUG("dev_disable_boot is set.\n");
}
}
+ altfw_allowed = vb2_nv_get(ctx, VB2_NV_DEV_BOOT_LEGACY) ||
+ (vb2_get_sd(ctx)->gbb_flags & VB2_GBB_FLAG_FORCE_DEV_BOOT_LEGACY) ||
+ (vb2_get_fwmp_flags() & FWMP_DEV_ENABLE_LEGACY);
/* Show appropriate initial menu */
if (disable_dev_boot)