diff options
author | Hung-Te Lin <hungte@chromium.org> | 2022-03-18 14:38:19 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-03-18 16:05:02 +0000 |
commit | 8f30263bde6636a58e1d33d7fdd007c3abb4f7ce (patch) | |
tree | dcd1bf81eb6028377334e59628979f17a1ec9bb2 | |
parent | 613f22e8de3f8ef3d87bf8e5de6f277e92e3a631 (diff) | |
download | vboot-8f30263bde6636a58e1d33d7fdd007c3abb4f7ce.tar.gz |
futility: updater: rename 'customlabel_tag' to 'custom_label_tag'
Per discussion, the 'custom_label_tag' is easier to read than
'customlabel_tag'. We should rename it before any real devices
have started using the different names.
BUG=b:169766857
TEST=make; build and run test
BRANCH=None
Change-Id: I3672e7b20bc85f79796470ba1a58c2896d26ff88
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3534491
Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
-rw-r--r-- | futility/updater.c | 2 | ||||
-rw-r--r-- | futility/updater.h | 2 | ||||
-rw-r--r-- | futility/updater_archive.c | 16 | ||||
-rw-r--r-- | futility/updater_quirks.c | 22 | ||||
-rwxr-xr-x | tests/futility/test_update.sh | 4 |
5 files changed, 23 insertions, 23 deletions
diff --git a/futility/updater.c b/futility/updater.c index e6834a97..c1ac58a5 100644 --- a/futility/updater.c +++ b/futility/updater.c @@ -1546,7 +1546,7 @@ static int updater_setup_archive( if (!model->patches.rootkey) { if (is_factory || is_write_protection_enabled(cfg) || - get_config_quirk(QUIRK_ALLOW_EMPTY_CUSTOMLABEL_TAG, + get_config_quirk(QUIRK_ALLOW_EMPTY_CUSTOM_LABEL_TAG, cfg)) { WARN("No VPD for custom label.\n"); } else { diff --git a/futility/updater.h b/futility/updater.h index 4e10fc7f..30a96a39 100644 --- a/futility/updater.h +++ b/futility/updater.h @@ -42,7 +42,7 @@ enum quirk_types { QUIRK_UNLOCK_ME_FOR_UPDATE, QUIRK_UNLOCK_WILCO_ME_FOR_UPDATE, QUIRK_EVE_SMM_STORE, - QUIRK_ALLOW_EMPTY_CUSTOMLABEL_TAG, + QUIRK_ALLOW_EMPTY_CUSTOM_LABEL_TAG, QUIRK_EC_PARTIAL_RECOVERY, QUIRK_OVERRIDE_SIGNATURE_ID, QUIRK_PRESERVE_ME, diff --git a/futility/updater_archive.c b/futility/updater_archive.c index fb917228..1d916db6 100644 --- a/futility/updater_archive.c +++ b/futility/updater_archive.c @@ -53,7 +53,7 @@ * - rootkey.$CLTAG * - vblock_A.$CLTAG * - vblock_B.$CLTAG - * The $CLTAG should come from VPD value 'customlabel_tag'. For legacy devices, + * The $CLTAG should come from VPD value 'custom_label_tag'. For legacy devices, * the VPD name may be 'whitelabel_tag', or 'customization_id'. * The 'customization_id' has a different format: LOEM[-VARIANT] and we can only * take LOEM as $CLTAG, for example A-B => $CLTAG=A. @@ -69,7 +69,7 @@ * - vblock_A.$SIGID * - vblock_B.$SIGID * If $SIGID starts with 'sig-id-in-*' then we have to replace it by VPD value - * 'customlabel_tag' as '$MODEL-$CLTAG'. + * 'custom_label_tag' as '$MODEL-$CLTAG'. */ static const char * const SETVARS_IMAGE_MAIN = "IMAGE_MAIN", @@ -80,8 +80,8 @@ static const char * const SETVARS_IMAGE_MAIN = "IMAGE_MAIN", * const DIR_KEYSET = "keyset", * const DIR_MODELS = "models", * const DEFAULT_MODEL_NAME = "default", - * const VPD_CUSTOMLABEL_TAG = "customlabel_tag", - * const VPD_CUSTOMLABEL_TAG_LEGACY = "whitelabel_tag", + * const VPD_CUSTOM_LABEL_TAG = "custom_label_tag", + * const VPD_CUSTOM_LABEL_TAG_LEGACY = "whitelabel_tag", * const VPD_CUSTOMIZATION_ID = "customization_id", * const ENV_VAR_MODEL_DIR = "${MODEL_DIR}", * const PATH_STARTSWITH_KEYSET = "keyset/", @@ -918,18 +918,18 @@ const struct model_config *manifest_find_model(const struct manifest *manifest, static char *resolve_signature_id(struct model_config *model, const char *image) { int is_unibuild = model->signature_id ? 1 : 0; - char *tag = vpd_get_value(image, VPD_CUSTOMLABEL_TAG); + char *tag = vpd_get_value(image, VPD_CUSTOM_LABEL_TAG); char *sig_id = NULL; if (tag == NULL) - tag = vpd_get_value(image, VPD_CUSTOMLABEL_TAG_LEGACY); + tag = vpd_get_value(image, VPD_CUSTOM_LABEL_TAG_LEGACY); /* Unified build: $model.$tag, or $model (b/126800200). */ if (is_unibuild) { if (!tag) { WARN("No VPD '%s' set for custom label. " "Use model name '%s' as default.\n", - VPD_CUSTOMLABEL_TAG, model->name); + VPD_CUSTOM_LABEL_TAG, model->name); return strdup(model->name); } @@ -981,7 +981,7 @@ int model_apply_custom_label( } else { signature_id = ""; WARN("No VPD '%s' set for custom label - use default keys.\n", - VPD_CUSTOMLABEL_TAG); + VPD_CUSTOM_LABEL_TAG); } if (!model->patches.rootkey) { ERROR("No keys found for signature_id: '%s'\n", signature_id); diff --git a/futility/updater_quirks.c b/futility/updater_quirks.c index 7a135b82..8d6114bf 100644 --- a/futility/updater_quirks.c +++ b/futility/updater_quirks.c @@ -57,20 +57,20 @@ static const struct quirks_record quirks_records[] = { { .match = "Google_Trogdor.", .quirks = "min_platform_version=2" }, /* Legacy custom label units. */ - { .match = "Google_Hana.", .quirks = "allow_empty_customlabel_tag" }, - { .match = "Google_Reks.", .quirks = "allow_empty_customlabel_tag" }, - { .match = "Google_Relm.", .quirks = "allow_empty_customlabel_tag" }, - { .match = "Google_Wizpig.", .quirks = "allow_empty_customlabel_tag" }, + { .match = "Google_Hana.", .quirks = "allow_empty_custom_label_tag" }, + { .match = "Google_Reks.", .quirks = "allow_empty_custom_label_tag" }, + { .match = "Google_Relm.", .quirks = "allow_empty_custom_label_tag" }, + { .match = "Google_Wizpig.", .quirks = "allow_empty_custom_label_tag" }, { .match = "Google_Enguarde.", - .quirks = "allow_empty_customlabel_tag" }, + .quirks = "allow_empty_custom_label_tag" }, { .match = "Google_Expresso.", - .quirks = "allow_empty_customlabel_tag" }, + .quirks = "allow_empty_custom_label_tag" }, { .match = "Google_Veyron_Jaq.", - .quirks = "allow_empty_customlabel_tag" }, + .quirks = "allow_empty_custom_label_tag" }, { .match = "Google_Veyron_Jerry.", - .quirks = "allow_empty_customlabel_tag" }, + .quirks = "allow_empty_custom_label_tag" }, { .match = "Google_Veyron_Mighty.", - .quirks = "allow_empty_customlabel_tag" }, + .quirks = "allow_empty_custom_label_tag" }, { .match = "Google_Phaser.", .quirks = "override_signature_id" }, }; @@ -484,8 +484,8 @@ void updater_register_quirks(struct updater_config *cfg) "dedicated FMAP section."; quirks->apply = quirk_eve_smm_store; - quirks = &cfg->quirks[QUIRK_ALLOW_EMPTY_CUSTOMLABEL_TAG]; - quirks->name = "allow_empty_customlabel_tag"; + quirks = &cfg->quirks[QUIRK_ALLOW_EMPTY_CUSTOM_LABEL_TAG]; + quirks->name = "allow_empty_custom_label_tag"; quirks->help = "chromium/906962; allow devices without custom label " "tags set to use default keys."; quirks->apply = NULL; /* Simple config. */ diff --git a/tests/futility/test_update.sh b/tests/futility/test_update.sh index 8b247429..e6360c35 100755 --- a/tests/futility/test_update.sh +++ b/tests/futility/test_update.sh @@ -371,7 +371,7 @@ test_update "Full update (--quirks preserve_me)" \ --quirks preserve_me \ -i "${TO_IMAGE}" --wp=0 --sys_props 0,0x10001,1 -# Test archive and manifest. CL_TAG is for customlabel_tag. +# Test archive and manifest. CL_TAG is for custom_label_tag. A="${TMP}.archive" mkdir -p "${A}/bin" echo 'echo "${CL_TAG}"' >"${A}/bin/vpd" @@ -418,7 +418,7 @@ test_update "Full update (--archive, custom label, no VPD - factory mode)" \ test_update "Full update (--archive, custom label, no VPD - quirk mode)" \ "${LINK_BIOS}" "${A}/image.bin" \ -a "${A}" --wp=0 --sys_props 0,0x10001,1,3 \ - --quirks=allow_empty_customlabel_tag + --quirks=allow_empty_custom_label_tag test_update "Full update (--archive, custom label, single package)" \ "${A}/image.bin" "${LINK_BIOS}" \ |