summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2014-02-14 09:00:34 +0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-02-14 15:29:59 +0000
commit4ff446b493e8a74804fd00082119681f768d366a (patch)
treeb281140056b5518723b0553778c0f409d1c3b010
parente8117120b677937902fc3c75ba3cee97e1fa0dc1 (diff)
downloadvboot-stabilize-5696.B.tar.gz
Early proto devices (for testers and developers) may have hardware write protection enabled and software disabled. They can still flash SPI ROM in that case, and no need to disable hardware WP switch. BRANCH=none BUG=chromium:341242 TEST=./set_gbb_flags.sh 0x39 # see WP messages. Change-Id: Id320410795a162a009b80360c2225c7510337591 Reviewed-on: https://chromium-review.googlesource.com/186336 Tested-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org> Commit-Queue: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rwxr-xr-xscripts/image_signing/set_gbb_flags.sh13
1 files changed, 7 insertions, 6 deletions
diff --git a/scripts/image_signing/set_gbb_flags.sh b/scripts/image_signing/set_gbb_flags.sh
index 157913aa..f114d413 100755
--- a/scripts/image_signing/set_gbb_flags.sh
+++ b/scripts/image_signing/set_gbb_flags.sh
@@ -51,19 +51,20 @@ FLASHROM_WRITE_OPT="$FLASHROM_COMMON_OPT -i GBB --fast-verify -w"
# Check write protection
# ----------------------------------------------------------------------------
check_write_protection() {
- local ret=$FLAGS_TRUE
+ local hw_wp="" sw_wp=""
if ! crossystem "wpsw_boot?0"; then
- echo "Hardware write protection must be disabled."
- ret=$FLAGS_FALSE
+ hw_wp="on"
fi
local wp_states="$(flashrom --wp-status 2>/dev/null | grep WP)"
local wp_disabled="$(echo "$wp_states" | grep "WP:.*is disabled.")"
local wp_zero_len="$(echo "$wp_states" | grep "WP:.*, len=0x00000000")"
if [ -z "$wp_disabled" -a -z "$wp_zero_len" ]; then
- echo "Software write protection must be disabled."
- ret=$FLAGS_FALSE
+ sw_wp="on"
fi
- return $ret
+ if [ -n "$hw_wp" -a -n "$sw_wp" ]; then
+ return $FLAGS_FALSE
+ fi
+ return $FLAGS_TRUE
}
# Main