summaryrefslogtreecommitdiff
path: root/firmware/lib
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2019-07-29 18:51:00 +0800
committerCommit Bot <commit-bot@chromium.org>2019-08-13 08:23:54 +0000
commitcf49e7b6ae5abee0552b596ec11b695b5d15853c (patch)
treea6a6ef6cdf73ee3078b07f0c195795d67c625b0b /firmware/lib
parente6b803355ee3dc548a4519a71b29672d856f9bc5 (diff)
downloadvboot-cf49e7b6ae5abee0552b596ec11b695b5d15853c.tar.gz
vboot: replace VBERROR_SUCCESS with VB2_SUCCESS
Replace vboot1-style VBERROR_SUCCESS with VB2_SUCCESS (trivial change since both are equal values). BUG=b:124141368, chromium:988410 TEST=make clean && make runtests BRANCH=none Change-Id: I46e02471a031e9f36ec869d11d0b957d1c1b5769 Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:1728114 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1722915 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'firmware/lib')
-rw-r--r--firmware/lib/ec_sync.c40
-rw-r--r--firmware/lib/ec_sync_all.c2
-rw-r--r--firmware/lib/include/ec_sync.h12
-rw-r--r--firmware/lib/include/load_kernel_fw.h2
-rw-r--r--firmware/lib/include/vboot_kernel.h4
-rw-r--r--firmware/lib/mocked_rollback_index.c2
-rw-r--r--firmware/lib/rollback_index.c2
-rw-r--r--firmware/lib/vboot_api_kernel.c20
-rw-r--r--firmware/lib/vboot_display.c8
-rw-r--r--firmware/lib/vboot_kernel.c4
-rw-r--r--firmware/lib/vboot_ui.c38
-rw-r--r--firmware/lib/vboot_ui_menu.c22
12 files changed, 78 insertions, 78 deletions
diff --git a/firmware/lib/ec_sync.c b/firmware/lib/ec_sync.c
index bdea2f9a..447bc843 100644
--- a/firmware/lib/ec_sync.c
+++ b/firmware/lib/ec_sync.c
@@ -50,7 +50,7 @@ static vb2_error_t protect_ec(struct vb2_context *ctx, int devidx,
if (rv == VBERROR_EC_REBOOT_TO_RO_REQUIRED) {
VB2_DEBUG("VbExEcProtect() needs reboot\n");
- } else if (rv != VBERROR_SUCCESS) {
+ } else if (rv != VB2_SUCCESS) {
VB2_DEBUG("VbExEcProtect() returned %d\n", rv);
request_recovery(ctx, VB2_RECOVERY_EC_PROTECT);
}
@@ -144,7 +144,7 @@ static vb2_error_t check_ec_hash(struct vb2_context *ctx, int devidx,
* @param ctx Vboot2 context
* @param devidx Index of EC device to check
* @param select Which firmware image to check
- * @return VBERROR_SUCCESS, or non-zero error code.
+ * @return VB2_SUCCESS, or non-zero error code.
*/
static vb2_error_t update_ec(struct vb2_context *ctx, int devidx,
enum VbSelectFirmware_t select)
@@ -166,7 +166,7 @@ static vb2_error_t update_ec(struct vb2_context *ctx, int devidx,
VB2_DEBUG("image len = %d\n", want_size);
rv = VbExEcUpdateImage(devidx, select, want, want_size);
- if (rv != VBERROR_SUCCESS) {
+ if (rv != VB2_SUCCESS) {
VB2_DEBUG("VbExEcUpdateImage() returned %d\n", rv);
/*
@@ -194,7 +194,7 @@ static vb2_error_t update_ec(struct vb2_context *ctx, int devidx,
return VBERROR_EC_REBOOT_TO_RO_REQUIRED;
}
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
}
/**
@@ -216,7 +216,7 @@ static vb2_error_t check_ec_active(struct vb2_context *ctx, int devidx)
vb2_error_t rv = VbExEcRunningRW(devidx, &in_rw);
/* If we couldn't determine where the EC was, reboot to recovery. */
- if (rv != VBERROR_SUCCESS) {
+ if (rv != VB2_SUCCESS) {
VB2_DEBUG("VbExEcRunningRW() returned %d\n", rv);
request_recovery(ctx, VB2_RECOVERY_EC_UNKNOWN_IMAGE);
return VBERROR_EC_REBOOT_TO_RO_REQUIRED;
@@ -225,7 +225,7 @@ static vb2_error_t check_ec_active(struct vb2_context *ctx, int devidx)
if (in_rw)
sd->flags |= IN_RW(devidx);
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
}
#define RO_RETRIES 2 /* Maximum times to retry flashing RO */
@@ -235,7 +235,7 @@ static vb2_error_t check_ec_active(struct vb2_context *ctx, int devidx)
*
* @param ctx Vboot2 context
* @param devidx Which device (EC=0, PD=1)
- * @return VBERROR_SUCCESS, or non-zero if error.
+ * @return VB2_SUCCESS, or non-zero if error.
*/
static vb2_error_t sync_one_ec(struct vb2_context *ctx, int devidx)
{
@@ -264,7 +264,7 @@ static vb2_error_t sync_one_ec(struct vb2_context *ctx, int devidx)
if (!(sd->flags & IN_RW(devidx))) {
VB2_DEBUG("jumping to EC-RW\n");
rv = VbExEcJumpToRW(devidx);
- if (rv != VBERROR_SUCCESS) {
+ if (rv != VB2_SUCCESS) {
VB2_DEBUG("VbExEcJumpToRW() returned %x\n", rv);
/*
@@ -319,16 +319,16 @@ static vb2_error_t sync_one_ec(struct vb2_context *ctx, int devidx)
/* Protect RO flash */
rv = protect_ec(ctx, devidx, VB_SELECT_FIRMWARE_READONLY);
- if (rv != VBERROR_SUCCESS)
+ if (rv != VB2_SUCCESS)
return rv;
/* Protect RW flash */
rv = protect_ec(ctx, devidx, select_rw);
- if (rv != VBERROR_SUCCESS)
+ if (rv != VB2_SUCCESS)
return rv;
rv = VbExEcDisableJump(devidx);
- if (rv != VBERROR_SUCCESS) {
+ if (rv != VB2_SUCCESS) {
VB2_DEBUG("VbExEcDisableJump() returned %d\n", rv);
request_recovery(ctx, VB2_RECOVERY_EC_SOFTWARE_SYNC);
return VBERROR_EC_REBOOT_TO_RO_REQUIRED;
@@ -344,9 +344,9 @@ vb2_error_t ec_sync_phase1(struct vb2_context *ctx)
/* Reasons not to do sync at all */
if (!(ctx->flags & VB2_CONTEXT_EC_SYNC_SUPPORTED))
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
if (gbb->flags & VB2_GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC)
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
#ifdef PD_SYNC
const int do_pd_sync = !(gbb->flags &
@@ -391,7 +391,7 @@ vb2_error_t ec_sync_phase1(struct vb2_context *ctx)
return VBERROR_EC_REBOOT_TO_RO_REQUIRED;
}
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
}
int ec_will_update_slowly(struct vb2_context *ctx)
@@ -433,7 +433,7 @@ vb2_error_t ec_sync_check_aux_fw(struct vb2_context *ctx,
if (!ec_sync_allowed(ctx) ||
(gbb->flags & VB2_GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC)) {
*severity = VB_AUX_FW_NO_UPDATE;
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
}
return VbExCheckAuxFw(severity);
}
@@ -455,11 +455,11 @@ vb2_error_t ec_sync_update_aux_fw(struct vb2_context *ctx)
vb2_error_t ec_sync_phase2(struct vb2_context *ctx)
{
if (!ec_sync_allowed(ctx))
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
/* Handle updates and jumps for EC */
vb2_error_t retval = sync_one_ec(ctx, 0);
- if (retval != VBERROR_SUCCESS)
+ if (retval != VB2_SUCCESS)
return retval;
#ifdef PD_SYNC
@@ -467,12 +467,12 @@ vb2_error_t ec_sync_phase2(struct vb2_context *ctx)
struct vb2_gbb_header *gbb = vb2_get_gbb(ctx);
if (!(gbb->flags & VB2_GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC)) {
retval = sync_one_ec(ctx, 1);
- if (retval != VBERROR_SUCCESS)
+ if (retval != VB2_SUCCESS)
return retval;
}
#endif
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
}
vb2_error_t ec_sync_phase3(struct vb2_context *ctx)
@@ -495,5 +495,5 @@ vb2_error_t ec_sync_phase3(struct vb2_context *ctx)
return VBERROR_SHUTDOWN_REQUESTED;
}
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
}
diff --git a/firmware/lib/ec_sync_all.c b/firmware/lib/ec_sync_all.c
index 600218d5..4a8cf670 100644
--- a/firmware/lib/ec_sync_all.c
+++ b/firmware/lib/ec_sync_all.c
@@ -96,5 +96,5 @@ vb2_error_t ec_sync_all(struct vb2_context *ctx)
if (rv)
return rv;
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
}
diff --git a/firmware/lib/include/ec_sync.h b/firmware/lib/include/ec_sync.h
index e71d68b0..ec1be2b2 100644
--- a/firmware/lib/include/ec_sync.h
+++ b/firmware/lib/include/ec_sync.h
@@ -19,7 +19,7 @@ struct vb2_context;
* whether any updates are necessary.
*
* @param ctx Vboot2 context
- * @return VBERROR_SUCCESS, VBERROR_EC_REBOOT_TO_RO_REQUIRED if the EC must
+ * @return VB2_SUCCESS, VBERROR_EC_REBOOT_TO_RO_REQUIRED if the EC must
* reboot back to its RO code to continue EC sync, or other non-zero error
* code.
*/
@@ -42,7 +42,7 @@ int ec_will_update_slowly(struct vb2_context *ctx);
*
* @param ctx Vboot2 context
* @param severity VB_AUX_FW_{NO,FAST,SLOW}_UPDATE
- * @return VBERROR_SUCCESS or non-zero error code.
+ * @return VB2_SUCCESS or non-zero error code.
*/
vb2_error_t ec_sync_check_aux_fw(struct vb2_context *ctx,
VbAuxFwUpdateSeverity_t *severity);
@@ -51,7 +51,7 @@ vb2_error_t ec_sync_check_aux_fw(struct vb2_context *ctx,
* Update and protect auxiliary firmware.
*
* @param ctx Vboot2 context
- * @return VBERROR_SUCCESS or non-zero error code.
+ * @return VB2_SUCCESS or non-zero error code.
*/
vb2_error_t ec_sync_update_aux_fw(struct vb2_context *ctx);
@@ -65,7 +65,7 @@ vb2_error_t ec_sync_update_aux_fw(struct vb2_context *ctx);
* warning screen before calling phase 2.
*
* @param ctx Vboot2 context
- * @return VBERROR_SUCCESS, VBERROR_EC_REBOOT_TO_RO_REQUIRED if the EC must
+ * @return VB2_SUCCESS, VBERROR_EC_REBOOT_TO_RO_REQUIRED if the EC must
* reboot back to its RO code to continue EC sync, or other non-zero error
* code.
*/
@@ -77,7 +77,7 @@ vb2_error_t ec_sync_phase2(struct vb2_context *ctx);
* This completes EC sync and handles battery cutoff if needed.
*
* @param ctx Vboot2 context
- * @return VBERROR_SUCCESS or non-zero error code.
+ * @return VB2_SUCCESS or non-zero error code.
*/
vb2_error_t ec_sync_phase3(struct vb2_context *ctx);
@@ -87,7 +87,7 @@ vb2_error_t ec_sync_phase3(struct vb2_context *ctx);
* This is a high-level function which calls the functions above.
*
* @param ctx Vboot context
- * @return VBERROR_SUCCESS, or non-zero if error.
+ * @return VB2_SUCCESS, or non-zero if error.
*/
vb2_error_t ec_sync_all(struct vb2_context *ctx);
diff --git a/firmware/lib/include/load_kernel_fw.h b/firmware/lib/include/load_kernel_fw.h
index 4b7fb639..f76d7535 100644
--- a/firmware/lib/include/load_kernel_fw.h
+++ b/firmware/lib/include/load_kernel_fw.h
@@ -62,7 +62,7 @@ typedef struct LoadKernelParams {
* @param ctx Vboot context
* @param params Params specific to loading the kernel
*
- * Returns VBERROR_SUCCESS if successful. If unsuccessful, sets a recovery
+ * Returns VB2_SUCCESS if successful. If unsuccessful, sets a recovery
* reason via VbNvStorage and returns an error code.
*/
vb2_error_t LoadKernel(struct vb2_context *ctx, LoadKernelParams *params);
diff --git a/firmware/lib/include/vboot_kernel.h b/firmware/lib/include/vboot_kernel.h
index 7044ba10..cf3c4bb3 100644
--- a/firmware/lib/include/vboot_kernel.h
+++ b/firmware/lib/include/vboot_kernel.h
@@ -20,11 +20,11 @@ struct vb2_context;
* Attempt loading a kernel from the specified type(s) of disks.
*
* If successful, sets lkp.disk_handle to the disk for the kernel and returns
- * VBERROR_SUCCESS.
+ * VB2_SUCCESS.
*
* @param ctx Vboot context
* @param get_info_flags Flags to pass to VbExDiskGetInfo()
- * @return VBERROR_SUCCESS, VBERROR_NO_DISK_FOUND if no disks of the specified
+ * @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.
*/
vb2_error_t VbTryLoadKernel(struct vb2_context *ctx, uint32_t get_info_flags);
diff --git a/firmware/lib/mocked_rollback_index.c b/firmware/lib/mocked_rollback_index.c
index 37b314a9..6dfeb5cf 100644
--- a/firmware/lib/mocked_rollback_index.c
+++ b/firmware/lib/mocked_rollback_index.c
@@ -16,7 +16,7 @@
vb2_error_t SetVirtualDevMode(int val)
{
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
}
uint32_t TPMClearAndReenable(void)
diff --git a/firmware/lib/rollback_index.c b/firmware/lib/rollback_index.c
index 41df72bb..663d50c1 100644
--- a/firmware/lib/rollback_index.c
+++ b/firmware/lib/rollback_index.c
@@ -166,7 +166,7 @@ vb2_error_t SetVirtualDevMode(int val)
return VBERROR_TPM_SET_BOOT_MODE_STATE;
VB2_DEBUG("TPM: Leaving\n");
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
}
uint32_t ReadSpaceKernel(RollbackSpaceKernel *rsk)
diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c
index 1a59e674..806874f5 100644
--- a/firmware/lib/vboot_api_kernel.c
+++ b/firmware/lib/vboot_api_kernel.c
@@ -80,8 +80,8 @@ vb2_error_t VbTryLoadKernel(struct vb2_context *ctx, uint32_t get_info_flags)
lkp.disk_handle = NULL;
/* Find disks */
- if (VBERROR_SUCCESS != VbExDiskGetInfo(&disk_info, &disk_count,
- get_info_flags))
+ if (VB2_SUCCESS != VbExDiskGetInfo(&disk_info, &disk_count,
+ get_info_flags))
disk_count = 0;
VB2_DEBUG("VbTryLoadKernel() found %d disks\n", (int)disk_count);
@@ -131,12 +131,12 @@ vb2_error_t VbTryLoadKernel(struct vb2_context *ctx, uint32_t get_info_flags)
* get, instead of just returning the value from the last disk
* attempted.
*/
- if (VBERROR_SUCCESS == retval)
+ if (VB2_SUCCESS == retval)
break;
}
/* If we didn't find any good kernels, don't return a disk handle. */
- if (VBERROR_SUCCESS != retval) {
+ if (VB2_SUCCESS != retval) {
VbSetRecoveryRequest(ctx, VB2_RECOVERY_RW_NO_KERNEL);
lkp.disk_handle = NULL;
}
@@ -343,7 +343,7 @@ static vb2_error_t vb2_kernel_setup(struct vb2_context *ctx,
}
}
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
}
static vb2_error_t vb2_kernel_phase4(struct vb2_context *ctx,
@@ -370,7 +370,7 @@ static vb2_error_t vb2_kernel_phase4(struct vb2_context *ctx,
return VBERROR_TPM_LOCK_KERNEL;
}
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
}
static void vb2_kernel_cleanup(struct vb2_context *ctx)
@@ -448,7 +448,7 @@ vb2_error_t VbSelectAndLoadKernel(struct vb2_context *ctx,
VbSelectAndLoadKernel_exit:
- if (VBERROR_SUCCESS == retval)
+ if (VB2_SUCCESS == retval)
retval = vb2_kernel_phase4(ctx, kparams);
vb2_kernel_cleanup(ctx);
@@ -607,7 +607,7 @@ vb2_error_t VbVerifyMemoryBootImage(struct vb2_context *ctx,
if (VbKernelHasFlags(preamble) == VBOOT_SUCCESS)
kparams->flags = preamble->flags;
- retval = VBERROR_SUCCESS;
+ retval = VB2_SUCCESS;
fail:
vb2_kernel_cleanup(ctx);
@@ -617,9 +617,9 @@ vb2_error_t VbVerifyMemoryBootImage(struct vb2_context *ctx,
vb2_error_t VbUnlockDevice(void)
{
VB2_DEBUG("Enabling dev-mode...\n");
- if (VBERROR_SUCCESS != SetVirtualDevMode(1))
+ if (VB2_SUCCESS != SetVirtualDevMode(1))
return VBERROR_TPM_SET_BOOT_MODE_STATE;
VB2_DEBUG("Mode change will take effect on next reboot.\n");
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
}
diff --git a/firmware/lib/vboot_display.c b/firmware/lib/vboot_display.c
index 364cd131..6661885e 100644
--- a/firmware/lib/vboot_display.c
+++ b/firmware/lib/vboot_display.c
@@ -39,7 +39,7 @@ vb2_error_t VbDisplayScreen(struct vb2_context *ctx, uint32_t screen, int force,
/* If requested screen is the same as the current one, we're done. */
if (disp_current_screen == screen && !force)
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
/* Keep track of the currently displayed screen */
disp_current_screen = screen;
@@ -63,7 +63,7 @@ vb2_error_t VbDisplayMenu(struct vb2_context *ctx, uint32_t screen, int force,
if (disp_current_screen == screen &&
disp_current_index == selected_index &&
!force)
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
/*
* If current screen is not the same, make sure we redraw the base
@@ -430,7 +430,7 @@ vb2_error_t VbCheckDisplayKey(struct vb2_context *ctx, uint32_t key,
case VB_KEY_DOWN:
/* Arrow keys = change localization */
loc = vb2_nv_get(ctx, VB2_NV_LOCALIZATION_INDEX);
- if (VBERROR_SUCCESS != VbExGetLocalizationCount(&count))
+ if (VB2_SUCCESS != VbExGetLocalizationCount(&count))
loc = 0; /* No localization count (bad GBB?) */
else if (VB_KEY_RIGHT == key || VB_KEY_UP == key)
loc = (loc < count - 1 ? loc + 1 : 0);
@@ -458,5 +458,5 @@ vb2_error_t VbCheckDisplayKey(struct vb2_context *ctx, uint32_t key,
return VbDisplayScreen(ctx, disp_current_screen, 1, data);
}
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
}
diff --git a/firmware/lib/vboot_kernel.c b/firmware/lib/vboot_kernel.c
index a8c536d5..34e41cd7 100644
--- a/firmware/lib/vboot_kernel.c
+++ b/firmware/lib/vboot_kernel.c
@@ -645,7 +645,7 @@ gpt_done:
shared->kernel_version_tpm = lowest_version;
/* Success! */
- retval = VBERROR_SUCCESS;
+ retval = VB2_SUCCESS;
} else if (found_partitions > 0) {
shcall->check_result = VBSD_LKC_CHECK_INVALID_PARTITIONS;
recovery = VB2_RECOVERY_RW_INVALID_OS;
@@ -659,7 +659,7 @@ gpt_done:
load_kernel_exit:
/* Store recovery request, if any */
vb2_nv_set(ctx, VB2_NV_RECOVERY_REQUEST,
- VBERROR_SUCCESS != retval ?
+ VB2_SUCCESS != retval ?
recovery : VB2_RECOVERY_NOT_REQUESTED);
shcall->return_code = (uint8_t)retval;
diff --git a/firmware/lib/vboot_ui.c b/firmware/lib/vboot_ui.c
index c93783a4..3bb1efa9 100644
--- a/firmware/lib/vboot_ui.c
+++ b/firmware/lib/vboot_ui.c
@@ -85,8 +85,8 @@ static int VbWantShutdown(struct vb2_context *ctx, uint32_t key)
static vb2_error_t VbTryUsb(struct vb2_context *ctx)
{
- uint32_t retval = VbTryLoadKernel(ctx, VB_DISK_FLAG_REMOVABLE);
- if (VBERROR_SUCCESS == retval) {
+ int retval = VbTryLoadKernel(ctx, VB_DISK_FLAG_REMOVABLE);
+ if (VB2_SUCCESS == retval) {
VB2_DEBUG("VbBootDeveloper() - booting USB\n");
} else {
vb2_error_notify("Could not boot from USB\n",
@@ -271,7 +271,7 @@ static vb2_error_t vb2_enter_vendor_data_ui(struct vb2_context *ctx,
VB2_DEBUG("Vendor Data UI - user pressed Esc: "
"exit to Developer screen\n");
data_value[0] = '\0';
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
case 'a'...'z':
key = toupper(key);
/* fall through */
@@ -305,7 +305,7 @@ static vb2_error_t vb2_enter_vendor_data_ui(struct vb2_context *ctx,
/* Enter pressed - confirm input */
VB2_DEBUG("Vendor Data UI - user pressed "
"Enter: confirm vendor data\n");
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
} else {
vb2_error_beep(VB_BEEP_NOT_ALLOWED);
}
@@ -318,7 +318,7 @@ static vb2_error_t vb2_enter_vendor_data_ui(struct vb2_context *ctx,
VbExSleepMs(DEV_KEY_DELAY);
} while (1);
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
}
/*
@@ -338,7 +338,7 @@ static vb2_error_t vb2_vendor_data_ui(struct vb2_context *ctx)
/* Vendor data was not entered just return */
if (data_value[0] == '\0')
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
VbDisplayScreen(ctx, VB_SCREEN_CONFIRM_VENDOR_DATA, 1, &data);
/* We'll loop until the user decides what to do */
@@ -357,7 +357,7 @@ static vb2_error_t vb2_vendor_data_ui(struct vb2_context *ctx)
/* Escape pressed - return to developer screen */
VB2_DEBUG("Vendor Data UI - user pressed Esc: "
"exit to Developer screen\n");
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
case VB_KEY_ENTER:
/* Enter pressed - write vendor data */
VB2_DEBUG("Vendor Data UI - user pressed Enter: "
@@ -365,7 +365,7 @@ static vb2_error_t vb2_vendor_data_ui(struct vb2_context *ctx)
data_value);
ret = VbExSetVendorData(data_value);
- if (ret == VBERROR_SUCCESS) {
+ if (ret == VB2_SUCCESS) {
vb2_nv_set(ctx, VB2_NV_DISABLE_DEV_REQUEST, 1);
return VBERROR_REBOOT_REQUIRED;
} else {
@@ -385,7 +385,7 @@ static vb2_error_t vb2_vendor_data_ui(struct vb2_context *ctx)
VbExSleepMs(DEV_KEY_DELAY);
} while (1);
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
}
static vb2_error_t vb2_check_diagnostic_key(struct vb2_context *ctx,
@@ -397,7 +397,7 @@ static vb2_error_t vb2_check_diagnostic_key(struct vb2_context *ctx,
return VBERROR_REBOOT_REQUIRED;
}
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
}
/*
@@ -739,8 +739,8 @@ static vb2_error_t vb2_developer_ui(struct vb2_context *ctx)
* key press.
*/
VbDisplayScreen(ctx, VB_SCREEN_BLANK, 0, NULL);
- if (VBERROR_SUCCESS == VbTryUsb(ctx)) {
- return VBERROR_SUCCESS;
+ if (VB2_SUCCESS == VbTryUsb(ctx)) {
+ return VB2_SUCCESS;
} else {
/* Show dev mode warning screen again */
VbDisplayScreen(ctx,
@@ -774,8 +774,8 @@ static vb2_error_t vb2_developer_ui(struct vb2_context *ctx)
}
if ((use_usb && !ctrl_d_pressed) && allow_usb) {
- if (VBERROR_SUCCESS == VbTryUsb(ctx)) {
- return VBERROR_SUCCESS;
+ if (VB2_SUCCESS == VbTryUsb(ctx)) {
+ return VB2_SUCCESS;
}
}
@@ -847,7 +847,7 @@ static vb2_error_t recovery_ui(struct vb2_context *ctx)
return VBERROR_SHUTDOWN_REQUESTED;
else if ((retval =
vb2_check_diagnostic_key(ctx, key)) !=
- VBERROR_SUCCESS)
+ VB2_SUCCESS)
return retval;
VbExSleepMs(REC_KEY_DELAY);
}
@@ -868,7 +868,7 @@ static vb2_error_t recovery_ui(struct vb2_context *ctx)
vb2_nv_set(ctx, VB2_NV_RECOVERY_REQUEST,
VB2_RECOVERY_NOT_REQUESTED);
- if (VBERROR_SUCCESS == retval)
+ if (VB2_SUCCESS == retval)
break; /* Found a recovery kernel */
VbDisplayScreen(ctx, VBERROR_NO_DISK_FOUND == retval ?
@@ -919,7 +919,7 @@ static vb2_error_t recovery_ui(struct vb2_context *ctx)
switch (VbUserConfirms(ctx, vbc_flags)) {
case 1:
VB2_DEBUG("Enabling dev-mode...\n");
- if (VBERROR_SUCCESS != SetVirtualDevMode(1))
+ if (VB2_SUCCESS != SetVirtualDevMode(1))
return VBERROR_TPM_SET_BOOT_MODE_STATE;
VB2_DEBUG("Reboot so it will take "
"effect\n");
@@ -941,7 +941,7 @@ static vb2_error_t recovery_ui(struct vb2_context *ctx)
}
} else if ((retval =
vb2_check_diagnostic_key(ctx, key)) !=
- VBERROR_SUCCESS) {
+ VB2_SUCCESS) {
return retval;
} else {
VbCheckDisplayKey(ctx, key, NULL);
@@ -952,7 +952,7 @@ static vb2_error_t recovery_ui(struct vb2_context *ctx)
}
}
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
}
vb2_error_t VbBootRecovery(struct vb2_context *ctx)
diff --git a/firmware/lib/vboot_ui_menu.c b/firmware/lib/vboot_ui_menu.c
index cad0d5a6..9827c1ea 100644
--- a/firmware/lib/vboot_ui_menu.c
+++ b/firmware/lib/vboot_ui_menu.c
@@ -192,9 +192,9 @@ static vb2_error_t boot_usb_action(struct vb2_context *ctx)
return VBERROR_KEEP_LOOPING;
}
- if (VBERROR_SUCCESS == VbTryLoadKernel(ctx, VB_DISK_FLAG_REMOVABLE)) {
+ if (VB2_SUCCESS == VbTryLoadKernel(ctx, VB_DISK_FLAG_REMOVABLE)) {
VB2_DEBUG("booting USB\n");
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
}
/* Loading kernel failed. Clear recovery request from that. */
@@ -362,7 +362,7 @@ static vb2_error_t to_dev_action(struct vb2_context *ctx)
return VBERROR_KEEP_LOOPING;
VB2_DEBUG("Enabling dev-mode...\n");
- if (VBERROR_SUCCESS != SetVirtualDevMode(1))
+ if (VB2_SUCCESS != SetVirtualDevMode(1))
return VBERROR_TPM_SET_BOOT_MODE_STATE;
/* This was meant for headless devices, shouldn't really matter here. */
@@ -729,14 +729,14 @@ static vb2_error_t vb2_init_menus(struct vb2_context *ctx)
menus[VB_MENU_LANGUAGES].size = count;
menus[VB_MENU_LANGUAGES].items = items;
- return VBERROR_SUCCESS;
+ return VB2_SUCCESS;
}
/**
* Main function that handles developer warning menu functionality
*
* @param ctx Vboot2 context
- * @return VBERROR_SUCCESS, or non-zero error code if error.
+ * @return VB2_SUCCESS, or non-zero error code if error.
*/
static vb2_error_t vb2_developer_menu(struct vb2_context *ctx)
{
@@ -826,8 +826,8 @@ static vb2_error_t vb2_developer_menu(struct vb2_context *ctx)
boot_legacy_action(ctx); /* Doesn't return on success. */
if (default_boot == VB2_DEV_DEFAULT_BOOT_USB)
- if (VBERROR_SUCCESS == boot_usb_action(ctx))
- return VBERROR_SUCCESS;
+ if (VB2_SUCCESS == boot_usb_action(ctx))
+ return VB2_SUCCESS;
return boot_disk_action(ctx);
}
@@ -836,7 +836,7 @@ static vb2_error_t vb2_developer_menu(struct vb2_context *ctx)
vb2_error_t VbBootDeveloperMenu(struct vb2_context *ctx)
{
vb2_error_t retval = vb2_init_menus(ctx);
- if (VBERROR_SUCCESS != retval)
+ if (VB2_SUCCESS != retval)
return retval;
retval = vb2_developer_menu(ctx);
VbDisplayScreen(ctx, VB_SCREEN_BLANK, 0, NULL);
@@ -878,7 +878,7 @@ static vb2_error_t broken_ui(struct vb2_context *ctx)
* Main function that handles recovery menu functionality
*
* @param ctx Vboot2 context
- * @return VBERROR_SUCCESS, or non-zero error code if error.
+ * @return VB2_SUCCESS, or non-zero error code if error.
*/
static vb2_error_t recovery_ui(struct vb2_context *ctx)
{
@@ -903,7 +903,7 @@ static vb2_error_t recovery_ui(struct vb2_context *ctx)
vb2_nv_set(ctx, VB2_NV_RECOVERY_REQUEST,
VB2_RECOVERY_NOT_REQUESTED);
- if (VBERROR_SUCCESS == ret)
+ if (VB2_SUCCESS == ret)
return ret; /* Found a recovery kernel */
if (usb_nogood != (ret != VBERROR_NO_DISK_FOUND)) {
@@ -938,7 +938,7 @@ static vb2_error_t recovery_ui(struct vb2_context *ctx)
vb2_error_t VbBootRecoveryMenu(struct vb2_context *ctx)
{
vb2_error_t retval = vb2_init_menus(ctx);
- if (VBERROR_SUCCESS != retval)
+ if (VB2_SUCCESS != retval)
return retval;
if (vb2_allow_recovery(ctx))
retval = recovery_ui(ctx);