diff options
author | Simon Glass <sjg@chromium.org> | 2018-04-08 23:26:57 -0400 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-09-26 14:59:54 -0700 |
commit | 89a517730f0207dbef9b3ff219d360904dca456e (patch) | |
tree | f88a77c3e82d345099ceb034f4eec01024ebcdcf /tests/vboot_detach_menu_tests.c | |
parent | c297fe4ddfaf0d9308955a5c41da5074e34324e7 (diff) | |
download | vboot-89a517730f0207dbef9b3ff219d360904dca456e.tar.gz |
Add support for booting into alternative boot loaders
Add a generic way of selecting an alternative bootloader to run from the
developer-mode menu. This enables keys 1-9 to select a particular numbered
bootloader.
Adjust VbExLegacy() to take a numeric parameter to signal which boot
loader to run.
CQ-DEPEND=CL:1228875
BUG=chromium:837018
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference
Change-Id: I02eab1b87e21a6401ec42317c4c1fa1bd2767b53
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1060854
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'tests/vboot_detach_menu_tests.c')
-rw-r--r-- | tests/vboot_detach_menu_tests.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/vboot_detach_menu_tests.c b/tests/vboot_detach_menu_tests.c index 264fbf86..6ec9f334 100644 --- a/tests/vboot_detach_menu_tests.c +++ b/tests/vboot_detach_menu_tests.c @@ -41,6 +41,7 @@ static VbError_t vbtlk_last_retval; static int vbtlk_retval_count; static const VbError_t vbtlk_retval_fixed = 1002; static int vbexlegacy_called; +static int altfw_num; static int debug_info_displayed; static int trust_ec; static int virtdev_set; @@ -84,6 +85,7 @@ static void ResetMocks(void) shutdown_request_calls_left = 301; audio_looping_calls_left = 60; vbexlegacy_called = 0; + altfw_num = -1; debug_info_displayed = 0; trust_ec = 0; virtdev_set = 0; @@ -160,9 +162,11 @@ uint32_t VbExGetSwitches(uint32_t request_mask) return 0; } -int VbExLegacy(void) +int VbExLegacy(int _altfw_num) { vbexlegacy_called++; + altfw_num = _altfw_num; + return 0; } @@ -271,6 +275,7 @@ static void VbBootDevTest(void) TEST_EQ(VbBootDeveloperMenu(&ctx), vbtlk_retval_fixed, "default legacy GBB"); TEST_EQ(vbexlegacy_called, 1, " try legacy"); + TEST_EQ(altfw_num, 0, " check altfw_num"); TEST_EQ(screens_displayed[0], VB_SCREEN_DEVELOPER_WARNING_MENU, " warning screen"); TEST_EQ(screens_displayed[1], VB_SCREEN_BLANK, " blank (error flash)"); @@ -290,6 +295,7 @@ static void VbBootDevTest(void) TEST_EQ(VbBootDeveloperMenu(&ctx), vbtlk_retval_fixed, "default legacy NV"); TEST_EQ(vbexlegacy_called, 1, " try legacy"); + TEST_EQ(altfw_num, 0, " check altfw_num"); TEST_EQ(screens_displayed[0], VB_SCREEN_DEVELOPER_WARNING_MENU, " warning screen"); TEST_EQ(screens_displayed[1], VB_SCREEN_BLANK, " blank (error flash)"); @@ -611,6 +617,7 @@ static void VbBootDevTest(void) TEST_EQ(VbBootDeveloperMenu(&ctx), vbtlk_retval_fixed, "Ctrl+L force legacy"); TEST_EQ(vbexlegacy_called, 1, " try legacy"); + TEST_EQ(altfw_num, 0, " check altfw_num"); TEST_EQ(screens_displayed[0], VB_SCREEN_DEVELOPER_WARNING_MENU, " warning screen"); TEST_EQ(screens_displayed[1], VB_SCREEN_BLANK, " blank (error flash)"); @@ -646,6 +653,7 @@ static void VbBootDevTest(void) TEST_EQ(VbBootDeveloperMenu(&ctx), vbtlk_retval_fixed, "Ctrl+L fwmp legacy"); TEST_EQ(vbexlegacy_called, 1, " fwmp legacy"); + TEST_EQ(altfw_num, 0, " check altfw_num"); TEST_EQ(screens_displayed[0], VB_SCREEN_DEVELOPER_WARNING_MENU, " warning screen"); TEST_EQ(screens_displayed[1], VB_SCREEN_BLANK, " blank (error flash)"); @@ -908,6 +916,7 @@ static void VbBootDevTest(void) "Menu selected legacy boot"); TEST_EQ(debug_info_displayed, 0, " no debug info"); TEST_EQ(vbexlegacy_called, 2, " tried legacy boot twice"); + TEST_EQ(altfw_num, 0, " check altfw_num"); TEST_EQ(audio_looping_calls_left, 0, " audio timeout"); TEST_EQ(vb2_nv_get(&ctx, VB2_NV_RECOVERY_REQUEST), 0, " no recovery"); i = 0; @@ -2189,6 +2198,7 @@ static void VbNavigationTest(void) "developer mode long navigation"); TEST_EQ(debug_info_displayed, 1, " showed debug info"); TEST_EQ(vbexlegacy_called, 1, " tried legacy"); + TEST_EQ(altfw_num, 0, " check altfw_num"); TEST_EQ(audio_looping_calls_left, 0, " audio timeout"); TEST_EQ(vb2_nv_get(&ctx, VB2_NV_RECOVERY_REQUEST), 0, " no recovery"); i = 0; |