summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2020-02-20 16:43:11 +0800
committerCommit Bot <commit-bot@chromium.org>2020-02-27 17:25:16 +0000
commit8f4737628e96b7547b4166c700b218dafb0c5349 (patch)
treeadadcb08573bd794832d3b21c3f636f632f975c6
parent5abb36eae300851d7bae05784cfac306ad881254 (diff)
downloadvboot-8f4737628e96b7547b4166c700b218dafb0c5349.tar.gz
vboot: stop using wpsw_boot and remove it from crossystem
wpsw_boot is being deprecated, so just use wpsw_cur. BUG=b:124141368, chromium:950273 TEST=make clean && make runtests BRANCH=none Change-Id: Iae63b2a76b19629a9ecd9b87e5dd6367767860b3 Cq-Depend: chromium:2066154, chromium:2068241, chromium:2068209 Cq-Depend: chromium:2068297, chromium:2067229, chromium:2067231 Cq-Depend: chromium:2068242 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2066192 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
-rw-r--r--futility/updater_utils.c8
-rw-r--r--host/arch/mips/lib/crossystem_arch.c2
-rw-r--r--host/arch/x86/lib/crossystem_arch.c9
-rw-r--r--host/lib/crossystem.c2
-rwxr-xr-xscripts/image_signing/set_gbb_flags.sh2
-rw-r--r--utility/crossystem.c1
6 files changed, 3 insertions, 21 deletions
diff --git a/futility/updater_utils.c b/futility/updater_utils.c
index 36ea7981..4ef7a26e 100644
--- a/futility/updater_utils.c
+++ b/futility/updater_utils.c
@@ -417,13 +417,7 @@ static int host_get_tpm_fwver(void)
static int host_get_wp_hw(void)
{
/* wpsw refers to write protection 'switch', not 'software'. */
- int v = VbGetSystemPropertyInt("wpsw_cur");
-
- /* wpsw_cur may be not available, especially in recovery mode. */
- if (v < 0)
- v = VbGetSystemPropertyInt("wpsw_boot");
-
- return v;
+ return VbGetSystemPropertyInt("wpsw_cur");
}
/* A helper function to return "fw_vboot2" system property. */
diff --git a/host/arch/mips/lib/crossystem_arch.c b/host/arch/mips/lib/crossystem_arch.c
index ab7d0a49..cb0ea92f 100644
--- a/host/arch/mips/lib/crossystem_arch.c
+++ b/host/arch/mips/lib/crossystem_arch.c
@@ -42,8 +42,6 @@ int VbGetArchPropertyInt(const char* name)
return 0;
} else if (!strcasecmp(name,"recoverysw_ec_boot")) {
return 0;
- } else if (!strcasecmp(name,"wpsw_boot")) {
- return 1;
}
return -1;
}
diff --git a/host/arch/x86/lib/crossystem_arch.c b/host/arch/x86/lib/crossystem_arch.c
index 1e51cb0b..9213ccea 100644
--- a/host/arch/x86/lib/crossystem_arch.c
+++ b/host/arch/x86/lib/crossystem_arch.c
@@ -804,10 +804,8 @@ int VbGetArchPropertyInt(const char* name)
} else if (!strcasecmp(name,"wpsw_cur")) {
value = ReadGpio(GPIO_SIGNAL_TYPE_WP);
/* Use "write-protect at boot" as a fallback value. */
- if (-1 == value)
+ if (value == -1)
value = ReadFileBit(ACPI_CHSW_PATH, CHSW_WP_BOOT);
- if (-1 != value && FwidStartsWith("Mario."))
- value = 1 - value; /* Mario reports this backwards */
} else if (!strcasecmp(name,"recoverysw_ec_boot")) {
value = ReadFileBit(ACPI_CHSW_PATH, CHSW_RECOVERY_EC_BOOT);
} else if (!strcasecmp(name,"phase_enforcement")) {
@@ -822,11 +820,6 @@ int VbGetArchPropertyInt(const char* name)
value = ReadFileBit(ACPI_CHSW_PATH, CHSW_DEV_BOOT);
} else if (!strcasecmp(name,"recoverysw_boot")) {
value = ReadFileBit(ACPI_CHSW_PATH, CHSW_RECOVERY_BOOT);
- } else if (!strcasecmp(name,"wpsw_boot")) {
- value = ReadFileBit(ACPI_CHSW_PATH, CHSW_WP_BOOT);
- if (-1 != value && FwidStartsWith("Mario."))
- value = 1 - value; /* Mario reports this
- * backwards */
}
}
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c
index 995d0cb5..2ba21e64 100644
--- a/host/lib/crossystem.c
+++ b/host/lib/crossystem.c
@@ -431,8 +431,6 @@ int VbGetSystemPropertyInt(const char *name)
} else if (!strcasecmp(name, "wpsw_cur")) {
/* Use "write-protect at boot" as a fallback value. */
value = GetVdatInt(VDAT_INT_HW_WPSW_BOOT);
- } else if (!strcasecmp(name, "wpsw_boot")) {
- value = GetVdatInt(VDAT_INT_HW_WPSW_BOOT);
} else if (!strcasecmp(name,"vdat_flags")) {
value = GetVdatInt(VDAT_INT_FLAGS);
} else if (!strcasecmp(name,"tpm_fwver")) {
diff --git a/scripts/image_signing/set_gbb_flags.sh b/scripts/image_signing/set_gbb_flags.sh
index a313ec4b..7a22b85f 100755
--- a/scripts/image_signing/set_gbb_flags.sh
+++ b/scripts/image_signing/set_gbb_flags.sh
@@ -20,7 +20,7 @@ set -e
# ----------------------------------------------------------------------------
check_write_protection() {
local hw_wp="" sw_wp=""
- if ! crossystem "wpsw_boot?0"; then
+ if ! crossystem "wpsw_cur?0"; then
hw_wp="on"
fi
# Keep 'local' declaration split from assignment so return code is checked.
diff --git a/utility/crossystem.c b/utility/crossystem.c
index ee0b9658..cece7600 100644
--- a/utility/crossystem.c
+++ b/utility/crossystem.c
@@ -93,7 +93,6 @@ const Param sys_param_list[] = {
{"vdat_lfdebug", IS_STRING|NO_PRINT_ALL,
"LoadFirmware() debug data (not in print-all)"},
{"wipeout_request", CAN_WRITE, "Firmware requested factory reset (wipeout)"},
- {"wpsw_boot", 0, "Firmware write protect hardware switch position at boot"},
{"wpsw_cur", 0, "Firmware write protect hardware switch current position"},
/* Terminate with null name */
{NULL, 0, NULL}