chromeos-config: Rename whitelabel-tag in cros_config_mock
The only caller of this script is the factory code, which at the
moment does not use the --whitelabel-tag flag. Thus, we can safely
rename the flag without needing any aliases.
BUG=b:169766857,b:244677198
TEST=on bobba, "cros_config_mock --custom-label-tag gik / name"
outputs "gik"
Change-Id: If01e4c96ec13e0ef07aaebd5b3128d8b56015196
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/3543316
Reviewed-by: Stimim Chen <stimim@chromium.org>
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
Tested-by: Jack Rosenthal <jrosenth@chromium.org>
(cherry picked from commit 4709d3c9ee8c0eac7feea4a643c69dbfc4369947)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/3874275
Commit-Queue: Kenny Pan <kennypan@google.com>
Tested-by: Ken Lu <ken_lu@pegatron.corp-partner.google.com>
Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org>
diff --git a/chromeos-config/cros_config_mock.sh b/chromeos-config/cros_config_mock.sh
index 807b008..c344973 100755
--- a/chromeos-config/cros_config_mock.sh
+++ b/chromeos-config/cros_config_mock.sh
@@ -21,12 +21,12 @@
Usage: $0 [OPTIONS...] PATH PROPERTY
Optional arguments:
- --configfs-image FILE Path to configfs image.
- --smbios-name NAME Override the SMBIOS name from firmware.
- --dt-compatible STRING Add STRING to the device-tree compatible list.
- --sku-id SKU Override the SKU id from firmware.
- --whitelabel-tag VALUE Override the whitelabel tag from VPD.
- --help Show this help message and exit.
+ --configfs-image FILE Path to configfs image.
+ --smbios-name NAME Override the SMBIOS name from firmware.
+ --dt-compatible STRING Add STRING to the device-tree compatible list.
+ --sku-id SKU Override the SKU id from firmware.
+ --custom-label-tag VALUE Override the whitelabel tag from VPD.
+ --help Show this help message and exit.
Positional arguments:
PATH The path to get from config.
@@ -57,8 +57,8 @@
SKU_ID="$2"
shift
;;
- --whitelabel-tag )
- WHITELABEL_TAG="$2"
+ --custom-label-tag )
+ CUSTOM_LABEL_TAG="$2"
shift
;;
--help )
@@ -107,8 +107,12 @@
SKU_ID="$(cut -b4- </sys/class/dmi/id/product_sku)"
fi
-if [[ -f /sys/firmware/vpd/ro/whitelabel_tag && -z "${WHITELABEL_TAG}" ]]; then
- read -r WHITELABEL_TAG </sys/firmware/vpd/ro/whitelabel_tag
+if [[ -f /sys/firmware/vpd/ro/custom_label_tag && -z "${CUSTOM_LABEL_TAG}" ]]; then
+ read -r CUSTOM_LABEL_TAG </sys/firmware/vpd/ro/custom_label_tag
+fi
+
+if [[ -f /sys/firmware/vpd/whitelabel_tag && -z "${CUSTOM_LABEL_TAG}" ]]; then
+ read -r CUSTOM_LABEL_TAG </sys/firmware/vpd/whitelabel_tag
fi
on_exit_unmount () {
@@ -147,7 +151,7 @@
continue
fi
- if file_mismatch "${base}/identity/whitelabel-tag" "${WHITELABEL_TAG}"; then
+ if file_mismatch "${base}/identity/custom-label-tag" "${CUSTOM_LABEL_TAG}"; then
continue
fi