vboot: convert LoadKernel and TryLoadKernel to vboot2-style errors

Convert LoadKernel and TryLoadKernel to use vboot2-style error
codes.  Error codes are renamed as follows:

  VBERROR_NO_KERNEL_FOUND
  --> VB2_ERROR_LK_NO_KERNEL_FOUND

  VBERROR_INVALID_KERNEL_FOUND
  --> VB2_ERROR_LK_INVALID_KERNEL_FOUND

  VBERROR_NO_DISK_FOUND
  --> VB2_ERROR_LK_NO_DISK_FOUND

Remove these error codes:

  VBERROR_LOAD_KERNEL_RECOVERY
    Remove VBSD_BOOT_DEV_SWITCH_ON check in vb2_developer_ui
    to align vboot_ui and vboot_ui_menu functionality.

  VBERROR_LOAD_KERNEL
    Unused.

BUG=b:124141368, chromium:988410
TEST=make clean && make runtests
BRANCH=none

Change-Id: I90389c6629cc6055c4a4acbbbdd358bb79b63bf7
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1728297
Tested-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
diff --git a/firmware/2lib/include/2return_codes.h b/firmware/2lib/include/2return_codes.h
index 0ab9e75..0d34447 100644
--- a/firmware/2lib/include/2return_codes.h
+++ b/firmware/2lib/include/2return_codes.h
@@ -69,16 +69,6 @@
 	VBERROR_TPM_LOCK_KERNEL               = 0x1000C,
 	/* Calling firmware requested shutdown via VbExIsShutdownRequested() */
 	VBERROR_SHUTDOWN_REQUESTED            = 0x1000D,
-	/* Unable to find a boot device on which to look for a kernel */
-	VBERROR_NO_DISK_FOUND                 = 0x1000E,
-	/* No OS kernel found on any boot device */
-	VBERROR_NO_KERNEL_FOUND               = 0x1000F,
-	/* All OS kernels found were invalid (corrupt, improperly signed...) */
-	VBERROR_INVALID_KERNEL_FOUND          = 0x10010,
-	/* VbSelectAndLoadKernel() requested recovery mode */
-	VBERROR_LOAD_KERNEL_RECOVERY          = 0x10011,
-	/* Other error inside VbSelectAndLoadKernel() */
-	VBERROR_LOAD_KERNEL                   = 0x10012,
 	/* Invalid Google binary block */
 	VBERROR_INVALID_GBB                   = 0x10013,
 	/* Invalid bitmap volume */
@@ -756,6 +746,22 @@
 	VB2_ERROR_EX_UNIMPLEMENTED,
 
 	/**********************************************************************
+	 * LoadKernel errors
+	 *
+	 * Should be ordered by specificity -- lower number means more specific.
+	 */
+	VB2_ERROR_LK = 0x100b0000,
+
+	/* Only an invalid kernel was found in LoadKernel() */
+	VB2_ERROR_LK_INVALID_KERNEL_FOUND = 0x100b1000,
+
+	/* No kernel partitions were found in LoadKernel() */
+	VB2_ERROR_LK_NO_KERNEL_FOUND = 0x100b2000,
+
+	/* No working block devices were found in VbTryLoadKernel() */
+	VB2_ERROR_LK_NO_DISK_FOUND = 0x100b3000,
+
+	/**********************************************************************
 	 * Errors generated by host library (non-firmware) start here.
 	 */
 	VB2_ERROR_HOST_BASE = 0x20000000,
diff --git a/firmware/lib/include/vboot_kernel.h b/firmware/lib/include/vboot_kernel.h
index 28c6cc9..5337d0a 100644
--- a/firmware/lib/include/vboot_kernel.h
+++ b/firmware/lib/include/vboot_kernel.h
@@ -24,8 +24,7 @@
  *
  * @param ctx			Vboot context
  * @param get_info_flags	Flags to pass to VbExDiskGetInfo()
- * @return VB2_SUCCESS, VBERROR_NO_DISK_FOUND if no disks of the specified
- * type were found, or other non-zero VBERROR_ codes for other failures.
+ * @return VB2_SUCCESS or the most specific VB2_ERROR_LK error.
  */
 vb2_error_t VbTryLoadKernel(struct vb2_context *ctx, uint32_t get_info_flags);
 
diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c
index 308a327..7b9d50e 100644
--- a/firmware/lib/vboot_api_kernel.c
+++ b/firmware/lib/vboot_api_kernel.c
@@ -60,7 +60,7 @@
 
 vb2_error_t VbTryLoadKernel(struct vb2_context *ctx, uint32_t get_info_flags)
 {
-	vb2_error_t rv = VBERROR_NO_DISK_FOUND;
+	vb2_error_t rv = VB2_ERROR_LK_NO_DISK_FOUND;
 	VbDiskInfo* disk_info = NULL;
 	uint32_t disk_count = 0;
 	uint32_t i;
@@ -113,20 +113,20 @@
 		}
 
 		/* Don't update error if we already have a more specific one. */
-		if (VBERROR_INVALID_KERNEL_FOUND != rv)
+		if (VB2_ERROR_LK_INVALID_KERNEL_FOUND != rv)
 			rv = new_rv;
 	}
 
 	/* If we drop out of the loop, we didn't find any usable kernel. */
 	if (get_info_flags & VB_DISK_FLAG_FIXED) {
 		switch (rv) {
-		case VBERROR_INVALID_KERNEL_FOUND:
+		case VB2_ERROR_LK_INVALID_KERNEL_FOUND:
 			vb2api_fail(ctx, VB2_RECOVERY_RW_INVALID_OS, rv);
 			break;
-		case VBERROR_NO_KERNEL_FOUND:
+		case VB2_ERROR_LK_NO_KERNEL_FOUND:
 			vb2api_fail(ctx, VB2_RECOVERY_RW_NO_KERNEL, rv);
 			break;
-		case VBERROR_NO_DISK_FOUND:
+		case VB2_ERROR_LK_NO_DISK_FOUND:
 			vb2api_fail(ctx, VB2_RECOVERY_RW_NO_DISK, rv);
 			break;
 		default:
diff --git a/firmware/lib/vboot_kernel.c b/firmware/lib/vboot_kernel.c
index 1f1647c..48d0344 100644
--- a/firmware/lib/vboot_kernel.c
+++ b/firmware/lib/vboot_kernel.c
@@ -655,10 +655,10 @@
 		retval = VB2_SUCCESS;
 	} else if (found_partitions > 0) {
 		shcall->check_result = VBSD_LKC_CHECK_INVALID_PARTITIONS;
-		retval = VBERROR_INVALID_KERNEL_FOUND;
+		retval = VB2_ERROR_LK_INVALID_KERNEL_FOUND;
 	} else {
 		shcall->check_result = VBSD_LKC_CHECK_NO_PARTITIONS;
-		retval = VBERROR_NO_KERNEL_FOUND;
+		retval = VB2_ERROR_LK_NO_KERNEL_FOUND;
 	}
 
 load_kernel_exit:
diff --git a/firmware/lib/vboot_ui.c b/firmware/lib/vboot_ui.c
index 6e9e516..da78171 100644
--- a/firmware/lib/vboot_ui.c
+++ b/firmware/lib/vboot_ui.c
@@ -606,53 +606,43 @@
 		case ' ':
 			/* See if we should disable virtual dev-mode switch. */
 			VB2_DEBUG("shared->flags=%#x\n", shared->flags);
-			if (shared->flags & VBSD_BOOT_DEV_SWITCH_ON) {
-				/* Stop the countdown while we go ask... */
-				if (gbb->flags &
-				    VB2_GBB_FLAG_FORCE_DEV_SWITCH_ON) {
-					/*
-					 * TONORM won't work (only for
-					 * non-shipping devices).
-					 */
-					vb2_error_notify(
-						"WARNING: TONORM prohibited by "
-						"GBB FORCE_DEV_SWITCH_ON.\n",
-						NULL,
-						VB_BEEP_NOT_ALLOWED);
-					break;
-				}
-				VbDisplayScreen(ctx,
-					VB_SCREEN_DEVELOPER_TO_NORM,
+
+			/* Sanity check, should never fail. */
+			VB2_ASSERT(shared->flags & VBSD_BOOT_DEV_SWITCH_ON);
+
+			/* Stop the countdown while we go ask... */
+			if (gbb->flags & VB2_GBB_FLAG_FORCE_DEV_SWITCH_ON) {
+				/*
+				 * TONORM won't work (only for
+				 * non-shipping devices).
+				 */
+				vb2_error_notify(
+					"WARNING: TONORM prohibited by "
+					"GBB FORCE_DEV_SWITCH_ON.\n",
+					NULL, VB_BEEP_NOT_ALLOWED);
+				break;
+			}
+			VbDisplayScreen(ctx, VB_SCREEN_DEVELOPER_TO_NORM,
 					0, NULL);
-				/* Ignore space in VbUserConfirms()... */
-				switch (VbUserConfirms(ctx, 0)) {
-				case 1:
-					VB2_DEBUG("leaving dev-mode\n");
-					vb2_nv_set(ctx, VB2_NV_DISABLE_DEV_REQUEST,
-						1);
-					VbDisplayScreen(ctx,
-						VB_SCREEN_TO_NORM_CONFIRMED,
-						0, NULL);
-					VbExSleepMs(5000);
-					return VBERROR_REBOOT_REQUIRED;
-				case -1:
-					VB2_DEBUG("shutdown requested\n");
-					return VBERROR_SHUTDOWN_REQUESTED;
-				default:
-					/* Stay in dev-mode */
-					VB2_DEBUG("stay in dev-mode\n");
-					VbDisplayScreen(ctx,
-						VB_SCREEN_DEVELOPER_WARNING,
-						0, NULL);
-					/* Start new countdown */
-					vb2_audio_start(ctx);
-				}
-			} else {
-				/* This should never happen. */
-				VB2_DEBUG("going to recovery\n");
-				vb2_nv_set(ctx, VB2_NV_RECOVERY_REQUEST,
-					   VB2_RECOVERY_RW_UNSPECIFIED);
-				return VBERROR_LOAD_KERNEL_RECOVERY;
+			/* Ignore space in VbUserConfirms()... */
+			switch (VbUserConfirms(ctx, 0)) {
+			case 1:
+				VB2_DEBUG("leaving dev-mode\n");
+				vb2_nv_set(ctx, VB2_NV_DISABLE_DEV_REQUEST, 1);
+				VbDisplayScreen(ctx,
+					VB_SCREEN_TO_NORM_CONFIRMED, 0, NULL);
+				VbExSleepMs(5000);
+				return VBERROR_REBOOT_REQUIRED;
+			case -1:
+				VB2_DEBUG("shutdown requested\n");
+				return VBERROR_SHUTDOWN_REQUESTED;
+			default:
+				/* Stay in dev-mode */
+				VB2_DEBUG("stay in dev-mode\n");
+				VbDisplayScreen(ctx,
+					VB_SCREEN_DEVELOPER_WARNING, 0, NULL);
+				/* Start new countdown */
+				vb2_audio_start(ctx);
 			}
 			break;
 		case VB_KEY_CTRL('D'):
@@ -845,10 +835,10 @@
 		if (VB2_SUCCESS == retval)
 			break; /* Found a recovery kernel */
 
-		VbDisplayScreen(ctx, VBERROR_NO_DISK_FOUND == retval ?
-				VB_SCREEN_RECOVERY_INSERT :
-				VB_SCREEN_RECOVERY_NO_GOOD,
-				0, NULL);
+		enum VbScreenType_t next_screen =
+			retval == VB2_ERROR_LK_NO_DISK_FOUND ?
+			VB_SCREEN_RECOVERY_INSERT : VB_SCREEN_RECOVERY_NO_GOOD;
+		VbDisplayScreen(ctx, next_screen, 0, NULL);
 
 		key = VbExKeyboardRead();
 		/*
diff --git a/firmware/lib/vboot_ui_menu.c b/firmware/lib/vboot_ui_menu.c
index 08da08c..f07a814 100644
--- a/firmware/lib/vboot_ui_menu.c
+++ b/firmware/lib/vboot_ui_menu.c
@@ -887,9 +887,9 @@
 		if (VB2_SUCCESS == ret)
 			return ret; /* Found a recovery kernel */
 
-		if (usb_nogood != (ret != VBERROR_NO_DISK_FOUND)) {
+		if (usb_nogood != (ret != VB2_ERROR_LK_NO_DISK_FOUND)) {
 			/* USB state changed, force back to base screen */
-			usb_nogood = ret != VBERROR_NO_DISK_FOUND;
+			usb_nogood = ret != VB2_ERROR_LK_NO_DISK_FOUND;
 			enter_recovery_base_screen(ctx);
 		}
 
diff --git a/tests/vboot_api_kernel2_tests.c b/tests/vboot_api_kernel2_tests.c
index 87468c4..55c7d70 100644
--- a/tests/vboot_api_kernel2_tests.c
+++ b/tests/vboot_api_kernel2_tests.c
@@ -1105,7 +1105,7 @@
 {
 	ResetMocks();
 	shared->flags = VBSD_BOOT_REC_SWITCH_ON;
-	vbtlk_retval = VBERROR_NO_DISK_FOUND;
+	vbtlk_retval = VB2_ERROR_LK_NO_DISK_FOUND;
 	trust_ec = 1;
 	mock_keypress[0] = VB_KEY_CTRL('D');
 	mock_gpio[0].gpio_flags = 0;
@@ -1163,7 +1163,7 @@
 	mock_gpio[3].count = 100;
 	shared->flags = VBSD_BOOT_REC_SWITCH_ON;
 	trust_ec = 1;
-	vbtlk_retval = VBERROR_NO_DISK_FOUND;
+	vbtlk_retval = VB2_ERROR_LK_NO_DISK_FOUND;
 	vbtlk_expect_removable = 1;
 	TEST_EQ(VbBootRecovery(ctx),
 		VBERROR_SHUTDOWN_REQUESTED,
@@ -1200,7 +1200,7 @@
 	ResetMocks();
 	MockGpioAfter(10, GPIO_SHUTDOWN);
 	gbb.flags |= VB2_GBB_FLAG_FORCE_MANUAL_RECOVERY;
-	vbtlk_retval = VBERROR_NO_DISK_FOUND;
+	vbtlk_retval = VB2_ERROR_LK_NO_DISK_FOUND;
 	vbtlk_expect_removable = 1;
 	TEST_EQ(VbBootRecovery(ctx),
 		VBERROR_SHUTDOWN_REQUESTED,
@@ -1300,7 +1300,7 @@
 	ResetMocks();
 	shared->flags = VBSD_BOOT_REC_SWITCH_ON;
 	MockGpioAfter(2, GPIO_SHUTDOWN);
-	vbtlk_retval = VBERROR_NO_DISK_FOUND;
+	vbtlk_retval = VB2_ERROR_LK_NO_DISK_FOUND;
 	trust_ec = 1;
 	mock_keypress[0] = VB_KEY_CTRL('D');
 	mock_keypress[1] = ' ';
@@ -1320,7 +1320,7 @@
 	ResetMocks();
 	shared->flags = VBSD_BOOT_REC_SWITCH_ON;
 	MockGpioAfter(10, GPIO_SHUTDOWN);
-	vbtlk_retval = VBERROR_NO_DISK_FOUND;
+	vbtlk_retval = VB2_ERROR_LK_NO_DISK_FOUND;
 	trust_ec = 1;
 	mock_keypress[0] = VB_KEY_CTRL('D');
 	mock_keypress[1] = VB_KEY_ENTER;
@@ -1416,7 +1416,7 @@
 	ResetMocks();
 	shared->flags = VBSD_BOOT_REC_SWITCH_ON;
 	MockGpioAfter(10, GPIO_SHUTDOWN);
-	vbtlk_retval = VBERROR_NO_DISK_FOUND;
+	vbtlk_retval = VB2_ERROR_LK_NO_DISK_FOUND;
 	trust_ec = 1;
 	mock_keypress[0] = VB_KEY_CTRL('D');
 	mock_keypress[1] = VB_KEY_ENTER;
@@ -1431,7 +1431,7 @@
 	ResetMocks();
 	shared->flags = VBSD_BOOT_REC_SWITCH_ON;
 	trust_ec = 1;
-	vbtlk_retval = VBERROR_NO_DISK_FOUND;
+	vbtlk_retval = VB2_ERROR_LK_NO_DISK_FOUND;
 	MockGpioAfter(10, GPIO_SHUTDOWN);
 	mock_keypress[0] = VB_KEY_CTRL('C');
 	TEST_EQ(vb2_nv_get(ctx, VB2_NV_DIAG_REQUEST), 0,
@@ -1455,7 +1455,7 @@
 	shared->flags = VBSD_BOOT_REC_SWITCH_ON;
 	sd->flags &= ~VB2_SD_FLAG_DISPLAY_AVAILABLE;
 	trust_ec = 1;
-	vbtlk_retval = VBERROR_NO_DISK_FOUND;
+	vbtlk_retval = VB2_ERROR_LK_NO_DISK_FOUND;
 	MockGpioAfter(10, GPIO_SHUTDOWN);
 	mock_keypress[0] = VB_KEY_F(12);
 	TEST_EQ(vb2_nv_get(ctx, VB2_NV_DIAG_REQUEST), 0,
diff --git a/tests/vboot_api_kernel_tests.c b/tests/vboot_api_kernel_tests.c
index b558680..6107722 100644
--- a/tests/vboot_api_kernel_tests.c
+++ b/tests/vboot_api_kernel_tests.c
@@ -126,7 +126,7 @@
 		},
 		.disk_count_to_return = DEFAULT_COUNT,
 		.diskgetinfo_return_val = VB2_SUCCESS,
-		.loadkernel_return_val = {VBERROR_INVALID_KERNEL_FOUND, 0},
+		.loadkernel_return_val = {VB2_ERROR_LK_INVALID_KERNEL_FOUND, 0},
 
 		.expected_recovery_request_val = VB2_RECOVERY_NOT_REQUESTED,
 		.expected_to_find_disk = pickme,
@@ -175,7 +175,7 @@
 		.expected_recovery_request_val = VB2_RECOVERY_RW_NO_DISK,
 		.expected_to_find_disk = 0,
 		.expected_to_load_disk = 0,
-		.expected_return_val = VBERROR_NO_DISK_FOUND
+		.expected_return_val = VB2_ERROR_LK_NO_DISK_FOUND
 	},
 	{
 		.name = "VbExDiskGetInfo() error",
@@ -190,7 +190,7 @@
 		.expected_recovery_request_val = VB2_RECOVERY_RW_NO_DISK,
 		.expected_to_find_disk = 0,
 		.expected_to_load_disk = 0,
-		.expected_return_val = VBERROR_NO_DISK_FOUND,
+		.expected_return_val = VB2_ERROR_LK_NO_DISK_FOUND,
 	},
 	{
 		.name = "invalid kernel",
@@ -215,13 +215,13 @@
 		},
 		.disk_count_to_return = DEFAULT_COUNT,
 		.diskgetinfo_return_val = VB2_SUCCESS,
-		.loadkernel_return_val = {VBERROR_INVALID_KERNEL_FOUND,
-					  VBERROR_NO_KERNEL_FOUND},
+		.loadkernel_return_val = {VB2_ERROR_LK_INVALID_KERNEL_FOUND,
+					  VB2_ERROR_LK_NO_KERNEL_FOUND},
 
 		.expected_recovery_request_val = VB2_RECOVERY_RW_INVALID_OS,
 		.expected_to_find_disk = DONT_CARE,
 		.expected_to_load_disk = 0,
-		.expected_return_val = VBERROR_INVALID_KERNEL_FOUND,
+		.expected_return_val = VB2_ERROR_LK_INVALID_KERNEL_FOUND,
 	},
 	{
 		.name = "invalid kernel, order flipped",
@@ -232,13 +232,13 @@
 		},
 		.disk_count_to_return = DEFAULT_COUNT,
 		.diskgetinfo_return_val = VB2_SUCCESS,
-		.loadkernel_return_val = {VBERROR_NO_KERNEL_FOUND,
-					  VBERROR_INVALID_KERNEL_FOUND},
+		.loadkernel_return_val = {VB2_ERROR_LK_NO_KERNEL_FOUND,
+					  VB2_ERROR_LK_INVALID_KERNEL_FOUND},
 
 		.expected_recovery_request_val = VB2_RECOVERY_RW_INVALID_OS,
 		.expected_to_find_disk = DONT_CARE,
 		.expected_to_load_disk = 0,
-		.expected_return_val = VBERROR_INVALID_KERNEL_FOUND,
+		.expected_return_val = VB2_ERROR_LK_INVALID_KERNEL_FOUND,
 	},
 	{
 		.name = "no Chrome OS partitions",
@@ -249,13 +249,13 @@
 		},
 		.disk_count_to_return = DEFAULT_COUNT,
 		.diskgetinfo_return_val = VB2_SUCCESS,
-		.loadkernel_return_val = {VBERROR_NO_KERNEL_FOUND,
-					  VBERROR_NO_KERNEL_FOUND},
+		.loadkernel_return_val = {VB2_ERROR_LK_NO_KERNEL_FOUND,
+					  VB2_ERROR_LK_NO_KERNEL_FOUND},
 
 		.expected_recovery_request_val = VB2_RECOVERY_RW_NO_KERNEL,
 		.expected_to_find_disk = DONT_CARE,
 		.expected_to_load_disk = 0,
-		.expected_return_val = VBERROR_NO_KERNEL_FOUND,
+		.expected_return_val = VB2_ERROR_LK_NO_KERNEL_FOUND,
 	},
 	{
 		.name = "invalid kernel (removable)",
@@ -266,13 +266,13 @@
 		},
 		.disk_count_to_return = DEFAULT_COUNT,
 		.diskgetinfo_return_val = VB2_SUCCESS,
-		.loadkernel_return_val = {VBERROR_INVALID_KERNEL_FOUND,
-					  VBERROR_NO_KERNEL_FOUND},
+		.loadkernel_return_val = {VB2_ERROR_LK_INVALID_KERNEL_FOUND,
+					  VB2_ERROR_LK_NO_KERNEL_FOUND},
 
 		.expected_recovery_request_val = VB2_RECOVERY_NOT_REQUESTED,
 		.expected_to_find_disk = DONT_CARE,
 		.expected_to_load_disk = 0,
-		.expected_return_val = VBERROR_INVALID_KERNEL_FOUND,
+		.expected_return_val = VB2_ERROR_LK_INVALID_KERNEL_FOUND,
 	},
 	{
 		.name = "no kernel (removable)",
@@ -282,12 +282,12 @@
 		},
 		.disk_count_to_return = DEFAULT_COUNT,
 		.diskgetinfo_return_val = VB2_SUCCESS,
-		.loadkernel_return_val = {VBERROR_NO_KERNEL_FOUND},
+		.loadkernel_return_val = {VB2_ERROR_LK_NO_KERNEL_FOUND},
 
 		.expected_recovery_request_val = VB2_RECOVERY_NOT_REQUESTED,
 		.expected_to_find_disk = DONT_CARE,
 		.expected_to_load_disk = 0,
-		.expected_return_val = VBERROR_NO_KERNEL_FOUND,
+		.expected_return_val = VB2_ERROR_LK_NO_KERNEL_FOUND,
 	},
 };
 
diff --git a/tests/vboot_detach_menu_tests.c b/tests/vboot_detach_menu_tests.c
index d85acbc..3db3da9 100644
--- a/tests/vboot_detach_menu_tests.c
+++ b/tests/vboot_detach_menu_tests.c
@@ -1312,7 +1312,8 @@
 	vbtlk_retval[0] = VB2_SUCCESS - VB_DISK_FLAG_REMOVABLE;
 	vbtlk_retval[1] = VB2_SUCCESS - VB_DISK_FLAG_REMOVABLE;
 	vbtlk_retval[2] = VB2_SUCCESS - VB_DISK_FLAG_REMOVABLE;
-	vbtlk_retval[3] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[3] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
 	TEST_EQ(VbBootRecoveryMenu(ctx), VBERROR_SHUTDOWN_REQUESTED,
 		"Shutdown requested in BROKEN with disks");
 	TEST_EQ(vb2_nv_get(ctx, VB2_NV_RECOVERY_REQUEST), 0, "  no recovery");
@@ -1325,7 +1326,8 @@
 
 	/* BROKEN screen with disks on second attempt */
 	ResetMocks();
-	vbtlk_retval[0] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[0] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
 	vbtlk_retval[1] = VB2_SUCCESS - VB_DISK_FLAG_REMOVABLE;
 	TEST_EQ(VbBootRecoveryMenu(ctx), VBERROR_SHUTDOWN_REQUESTED,
 		"Shutdown requested in BROKEN with later disk");
@@ -1340,7 +1342,8 @@
 	/* BROKEN screen even if dev switch is on */
 	ResetMocks();
 	vbtlk_retval[0] = VB2_SUCCESS - VB_DISK_FLAG_REMOVABLE;
-	vbtlk_retval[1] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[1] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
 	vbtlk_retval[2] = VB2_SUCCESS - VB_DISK_FLAG_REMOVABLE;
 	shared->flags |= VBSD_BOOT_DEV_SWITCH_ON;
 	TEST_EQ(VbBootRecoveryMenu(ctx), VBERROR_SHUTDOWN_REQUESTED,
@@ -1355,7 +1358,8 @@
 
 	/* go to INSERT if recovery button physically pressed and EC trusted */
 	ResetMocksForManualRecovery();
-	vbtlk_retval[0] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[0] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
 	TEST_EQ(VbBootRecoveryMenu(ctx), VBERROR_SHUTDOWN_REQUESTED,
 		"Shutdown requested in INSERT with manual rec");
 	TEST_EQ(vb2_nv_get(ctx, VB2_NV_RECOVERY_REQUEST), 0, "  no recovery");
@@ -1368,7 +1372,8 @@
 
 	/* go to INSERT if forced by GBB flag */
 	ResetMocks();
-	vbtlk_retval[0] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[0] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
 	gbb.flags |= VB2_GBB_FLAG_FORCE_MANUAL_RECOVERY;
 	TEST_EQ(VbBootRecoveryMenu(ctx), VBERROR_SHUTDOWN_REQUESTED,
 		"Shutdown requested in INSERT forced by GBB flag");
@@ -1382,7 +1387,8 @@
 
 	/* Stay at BROKEN if recovery button not physically pressed */
 	ResetMocksForManualRecovery();
-	vbtlk_retval[0] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[0] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
 	shared->flags &= ~VBSD_BOOT_REC_SWITCH_ON;
 	TEST_EQ(VbBootRecoveryMenu(ctx), VBERROR_SHUTDOWN_REQUESTED,
 		"Go to BROKEN if recovery not manually requested");
@@ -1396,7 +1402,8 @@
 
 	/* Stay at BROKEN if EC is untrusted */
 	ResetMocksForManualRecovery();
-	vbtlk_retval[0] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[0] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
 	trust_ec = 0;
 	TEST_EQ(VbBootRecoveryMenu(ctx), VBERROR_SHUTDOWN_REQUESTED,
 		"Go to BROKEN if EC is not trusted");
@@ -1423,10 +1430,14 @@
 
 	/* INSERT boots eventually if we get a valid image later */
 	ResetMocksForManualRecovery();
-	vbtlk_retval[0] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
-	vbtlk_retval[1] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
-	vbtlk_retval[2] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
-	vbtlk_retval[3] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[0] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[1] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[2] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[3] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
 	vbtlk_retval[4] = VB2_SUCCESS - VB_DISK_FLAG_REMOVABLE;
 	TEST_EQ(VbBootRecoveryMenu(ctx), VB2_SUCCESS,
 		"INSERT boots after valid image appears");
@@ -1442,9 +1453,12 @@
 	/* invalid image, then remove, then valid image */
 	ResetMocksForManualRecovery();
 	vbtlk_retval[0] = VB2_ERROR_MOCK - VB_DISK_FLAG_REMOVABLE;
-	vbtlk_retval[1] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
-	vbtlk_retval[2] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
-	vbtlk_retval[3] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[1] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[2] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[3] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
 	vbtlk_retval[4] = VB2_SUCCESS - VB_DISK_FLAG_REMOVABLE;
 	TEST_EQ(VbBootRecoveryMenu(ctx), VB2_SUCCESS,
 		"INSERT boots after valid image appears");
@@ -1501,7 +1515,8 @@
 	mock_keypress[i] = VB_KEY_FLAG_TRUSTED_KEYBOARD;
 	mock_keypress[i++] = VB_BUTTON_VOL_DOWN_LONG_PRESS;
 	mock_keypress[i++] = VB_BUTTON_POWER_SHORT_PRESS;
-	vbtlk_retval[0] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[0] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
 	TEST_EQ(VbBootRecoveryMenu(ctx), VBERROR_SHUTDOWN_REQUESTED,
 		"Shortcuts ignored in INSERT");
 	TEST_EQ(virtdev_set, 0, "  virtual dev mode off");
@@ -1561,7 +1576,8 @@
 	mock_keyflags[1] = VB_KEY_FLAG_TRUSTED_KEYBOARD;
 	mock_keypress[1] = VB_BUTTON_VOL_DOWN_SHORT_PRESS; // power off
 	mock_keypress[2] = VB_BUTTON_POWER_SHORT_PRESS;
-	vbtlk_retval[0] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[0] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
 	TEST_EQ(VbBootRecoveryMenu(ctx), VBERROR_SHUTDOWN_REQUESTED,
 		"Power Off INSERT through TO_DEV");
 	TEST_EQ(vb2_nv_get(ctx, VB2_NV_RECOVERY_REQUEST), 0, "  no recovery");
@@ -1613,7 +1629,8 @@
 
 	/* Navigate to confirm dev mode selection and then cancel */
 	ResetMocksForManualRecovery();
-	vbtlk_retval[0] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[0] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
 	i = 0;
 	mock_keyflags[i] = VB_KEY_FLAG_TRUSTED_KEYBOARD;
 	mock_keypress[i++] = VB_BUTTON_VOL_UP_DOWN_COMBO_PRESS; // enter TO_DEV
@@ -1646,7 +1663,8 @@
 
 	/* Navigate to confirm dev mode selection and then confirm */
 	ResetMocksForManualRecovery();
-	vbtlk_retval[0] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[0] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
 	i = 0;
 	mock_keyflags[i] = VB_KEY_FLAG_TRUSTED_KEYBOARD;
 	mock_keypress[i++] = VB_BUTTON_VOL_UP_DOWN_COMBO_PRESS; // enter to_dev
@@ -1748,7 +1766,8 @@
 	/* Cannot enable dev mode if already enabled. */
 	ResetMocksForManualRecovery();
 	shared->flags |= VBSD_BOOT_DEV_SWITCH_ON;
-	vbtlk_retval[0] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[0] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
 	i = 0;
 	mock_keyflags[i] = VB_KEY_FLAG_TRUSTED_KEYBOARD;
 	mock_keypress[i++] = VB_BUTTON_VOL_UP_DOWN_COMBO_PRESS; // enter to_dev
@@ -1779,7 +1798,8 @@
 	mock_keypress[56] = VB_BUTTON_VOL_DOWN_SHORT_PRESS; // power off
 	mock_keypress[57] = VB_BUTTON_POWER_SHORT_PRESS;
 	vbtlk_retval[0] = VB2_ERROR_MOCK - VB_DISK_FLAG_REMOVABLE;
-	vbtlk_retval[1] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[1] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
 	TEST_EQ(VbBootRecoveryMenu(ctx), VBERROR_SHUTDOWN_REQUESTED,
 		"Drop back to INSERT from TO_DEV when removing invalid USB");
 	TEST_NEQ(shutdown_request_calls_left, 0, "  powered down explicitly");
@@ -1806,10 +1826,14 @@
 	mock_keypress[1] = VB_BUTTON_VOL_DOWN_SHORT_PRESS; // power off
 	mock_keypress[2] = VB_BUTTON_VOL_DOWN_SHORT_PRESS; // language
 	mock_keypress[3] = VB_BUTTON_POWER_SHORT_PRESS;
-	vbtlk_retval[0] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
-	vbtlk_retval[1] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
-	vbtlk_retval[2] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
-	vbtlk_retval[3] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[0] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[1] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[2] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[3] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
 	vbtlk_retval[4] = VB2_ERROR_MOCK - VB_DISK_FLAG_REMOVABLE;
 	TEST_EQ(VbBootRecoveryMenu(ctx), VBERROR_SHUTDOWN_REQUESTED,
 		"Drop back to NOGOOD from LANGUAGE when inserting invalid USB");
@@ -1836,7 +1860,8 @@
 	/* Plugging in valid USB boots straight from OPTIONS menu. */
 	ResetMocksForManualRecovery();
 	mock_keypress[0] = VB_BUTTON_VOL_UP_SHORT_PRESS; // enter OPTIONS
-	vbtlk_retval[0] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[0] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
 	vbtlk_retval[1] = VB2_SUCCESS - VB_DISK_FLAG_REMOVABLE;
 	TEST_EQ(VbBootRecoveryMenu(ctx), VB2_SUCCESS,
 		"Boot by plugging in USB straight from OPTIONS menu");
@@ -1896,7 +1921,8 @@
 
 	/* Navigate to all language menus from recovery */
 	ResetMocksForManualRecovery();
-	vbtlk_retval[0] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
+	vbtlk_retval[0] = VB2_ERROR_LK_NO_DISK_FOUND -
+		VB_DISK_FLAG_REMOVABLE;
 	i = 0;
 	mock_keypress[i++] = VB_BUTTON_VOL_UP_SHORT_PRESS; // enter OPTIONS
 	mock_keypress[i++] = VB_BUTTON_VOL_DOWN_SHORT_PRESS; // power off
diff --git a/tests/vboot_kernel_tests.c b/tests/vboot_kernel_tests.c
index 86afcb8..4075e25 100644
--- a/tests/vboot_kernel_tests.c
+++ b/tests/vboot_kernel_tests.c
@@ -606,12 +606,12 @@
 {
 	ResetMocks();
 	gpt_init_fail = 1;
-	TestLoadKernel(VBERROR_NO_KERNEL_FOUND, "Bad GPT");
+	TestLoadKernel(VB2_ERROR_LK_NO_KERNEL_FOUND, "Bad GPT");
 
 	/* This causes the stream open call to fail */
 	ResetMocks();
 	lkp.disk_handle = NULL;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND, "Bad disk handle");
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND, "Bad disk handle");
 }
 
 static void LoadKernelTest(void)
@@ -635,27 +635,29 @@
 	/* Fail if no kernels found */
 	ResetMocks();
 	mock_parts[0].size = 0;
-	TestLoadKernel(VBERROR_NO_KERNEL_FOUND, "No kernels");
+	TestLoadKernel(VB2_ERROR_LK_NO_KERNEL_FOUND, "No kernels");
 
 	/* Skip kernels which are too small */
 	ResetMocks();
 	mock_parts[0].size = 10;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND, "Too small");
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND, "Too small");
 
 	ResetMocks();
 	disk_read_to_fail = 100;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND,
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND,
 		       "Fail reading kernel start");
 
 	ResetMocks();
 	keyblock_verify_fail = 1;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND, "Fail keyblock sig");
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND,
+		       "Fail key block sig");
 
 	/* In dev mode, fail if hash is bad too */
 	ResetMocks();
 	ctx->flags |= VB2_CONTEXT_DEVELOPER_MODE;
 	keyblock_verify_fail = 2;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND, "Fail keyblock dev hash");
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND,
+		       "Fail key block dev hash");
 
 	/* But just bad sig is ok */
 	ResetMocks();
@@ -668,50 +670,51 @@
 	ctx->flags |= VB2_CONTEXT_DEVELOPER_MODE;
 	vb2_nv_set(ctx, VB2_NV_DEV_BOOT_SIGNED_ONLY, 1);
 	keyblock_verify_fail = 1;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND, "Fail keyblock dev sig");
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND,
+		       "Fail key block dev sig");
 
 	ResetMocks();
 	ctx->flags |= VB2_CONTEXT_DEVELOPER_MODE;
 	fwmp->flags |= VB2_SECDATA_FWMP_DEV_ENABLE_OFFICIAL_ONLY;
 	keyblock_verify_fail = 1;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND,
-		       "Fail keyblock dev sig fwmp");
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND,
+		       "Fail key block dev sig fwmp");
 
 	/* Check keyblock flag mismatches */
 	ResetMocks();
 	kbh.keyblock_flags =
 		VB2_KEYBLOCK_FLAG_RECOVERY_0 | VB2_KEYBLOCK_FLAG_DEVELOPER_1;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND,
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND,
 		       "Keyblock dev flag mismatch");
 
 	ResetMocks();
 	kbh.keyblock_flags =
 		VB2_KEYBLOCK_FLAG_RECOVERY_1 | VB2_KEYBLOCK_FLAG_DEVELOPER_0;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND,
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND,
 		       "Keyblock rec flag mismatch");
 
 	ResetMocks();
 	ctx->flags |= VB2_CONTEXT_RECOVERY_MODE;
 	kbh.keyblock_flags =
 		VB2_KEYBLOCK_FLAG_RECOVERY_1 | VB2_KEYBLOCK_FLAG_DEVELOPER_1;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND,
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND,
 		       "Keyblock recdev flag mismatch");
 
 	ResetMocks();
 	ctx->flags |= VB2_CONTEXT_RECOVERY_MODE | VB2_CONTEXT_DEVELOPER_MODE;
 	kbh.keyblock_flags =
 		VB2_KEYBLOCK_FLAG_RECOVERY_1 | VB2_KEYBLOCK_FLAG_DEVELOPER_0;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND,
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND,
 		       "Keyblock rec!dev flag mismatch");
 
 	ResetMocks();
 	kbh.data_key.key_version = 1;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND,
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND,
 		       "Keyblock kernel key rollback");
 
 	ResetMocks();
 	kbh.data_key.key_version = 0x10000;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND,
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND,
 		       "Keyblock kernel key version too big");
 
 	ResetMocks();
@@ -739,15 +742,16 @@
 
 	ResetMocks();
 	unpack_key_fail = 2;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND, "Bad data key");
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND, "Bad data key");
 
 	ResetMocks();
 	preamble_verify_fail = 1;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND, "Bad preamble");
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND, "Bad preamble");
 
 	ResetMocks();
 	kph.kernel_version = 0;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND, "Kernel version rollback");
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND,
+		       "Kernel version rollback");
 
 	ResetMocks();
 	kph.kernel_version = 0;
@@ -764,7 +768,7 @@
 	ctx->flags |= VB2_CONTEXT_DEVELOPER_MODE;
 	fwmp->flags |= VB2_SECDATA_FWMP_DEV_USE_KEY_HASH;
 	fwmp->dev_key_hash[0]++;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND,
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND,
 		       "Fail keyblock dev fwmp hash");
 
 	/* Check developer key hash - good */
@@ -775,11 +779,13 @@
 
 	ResetMocks();
 	kph.preamble_size |= 0x07;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND, "Kernel body offset");
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND,
+		       "Kernel body offset");
 
 	ResetMocks();
 	kph.preamble_size += 65536;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND, "Kernel body offset huge");
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND,
+		       "Kernel body offset huge");
 
 	/* Check getting kernel load address from header */
 	ResetMocks();
@@ -792,12 +798,12 @@
 
 	ResetMocks();
 	lkp.kernel_buffer_size = 8192;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND,
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND,
 		       "Kernel too big for buffer");
 
 	ResetMocks();
 	mock_parts[0].size = 130;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND,
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND,
 		       "Kernel too big for partition");
 
 	ResetMocks();
@@ -806,12 +812,12 @@
 
 	ResetMocks();
 	disk_read_to_fail = 228;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND,
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND,
 		       "Fail reading kernel data");
 
 	ResetMocks();
 	verify_data_fail = 1;
-	TestLoadKernel(VBERROR_INVALID_KERNEL_FOUND, "Bad data");
+	TestLoadKernel(VB2_ERROR_LK_INVALID_KERNEL_FOUND, "Bad data");
 
 	/* Check that EXTERNAL_GPT flag makes it down */
 	ResetMocks();