summaryrefslogtreecommitdiff
path: root/host
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 /host
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 'host')
-rw-r--r--host/lib/crossystem.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c
index 67149e59..9d23091f 100644
--- a/host/lib/crossystem.c
+++ b/host/lib/crossystem.c
@@ -69,7 +69,7 @@ typedef enum VbBuildOption {
} VbBuildOption;
static const char *fw_results[] = {"unknown", "trying", "success", "failure"};
-static const char *default_boot[] = {"disk", "usb", "legacy"};
+static const char *default_boot[] = {"disk", "usb", "altfw"};
/* Masks for kern_nv usage by kernel. */
#define KERN_NV_FWUPDATE_TRIES_MASK 0x000F
@@ -420,8 +420,9 @@ int VbGetSystemPropertyInt(const char *name)
value = vb2_get_nv_storage(VB2_NV_BACKUP_NVRAM_REQUEST);
} else if (!strcasecmp(name,"dev_boot_usb")) {
value = vb2_get_nv_storage(VB2_NV_DEV_BOOT_EXTERNAL);
- } else if (!strcasecmp(name,"dev_boot_legacy")) {
- value = vb2_get_nv_storage(VB2_NV_DEV_BOOT_LEGACY);
+ } else if (!strcasecmp(name,"dev_boot_altfw") ||
+ !strcasecmp(name,"dev_boot_legacy")) {
+ value = vb2_get_nv_storage(VB2_NV_DEV_BOOT_ALTFW);
} else if (!strcasecmp(name,"dev_boot_signed_only")) {
value = vb2_get_nv_storage(VB2_NV_DEV_BOOT_SIGNED_ONLY);
} else if (!strcasecmp(name,"dev_enable_udc")) {
@@ -630,9 +631,10 @@ int VbSetSystemPropertyInt(const char *name, int value)
} else if (!strcasecmp(name,"dev_boot_usb")) {
return vb2_set_nv_storage_with_backup(
VB2_NV_DEV_BOOT_EXTERNAL, value);
- } else if (!strcasecmp(name,"dev_boot_legacy")) {
+ } else if (!strcasecmp(name,"dev_boot_altfw") ||
+ !strcasecmp(name,"dev_boot_legacy")) {
return vb2_set_nv_storage_with_backup(
- VB2_NV_DEV_BOOT_LEGACY, value);
+ VB2_NV_DEV_BOOT_ALTFW, value);
} else if (!strcasecmp(name,"dev_boot_signed_only")) {
return vb2_set_nv_storage_with_backup(
VB2_NV_DEV_BOOT_SIGNED_ONLY, value);
@@ -681,6 +683,16 @@ int VbSetSystemPropertyString(const char* name, const char* value)
} else if (!strcasecmp(name, "dev_default_boot")) {
int i;
+ /* "legacy" term deprecated in favour of "altfw"
+ (see: b/179458327) */
+ if (!strcasecmp(value, "legacy")) {
+ fprintf(stderr,
+ "!!!\n"
+ "!!! PLEASE USE 'altfw' INSTEAD OF 'legacy'\n"
+ "!!!\n");
+ value = "altfw";
+ }
+
for (i = 0; i < ARRAY_SIZE(default_boot); i++) {
if (!strcasecmp(value, default_boot[i]))
return vb2_set_nv_storage(