summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMike Frysinger <vapier@chromium.org>2017-05-07 01:36:46 -0400
committerchrome-bot <chrome-bot@chromium.org>2018-01-08 17:22:51 -0800
commit46b7e0dae409ad83797a0b2feff314417bbb7b1c (patch)
tree5d36cacbc2c7e7361ab2a914d554806e8494e93c /scripts
parent1a5e02c7a9ca66fb20f6752225903aa7a4dd0f70 (diff)
downloadvboot-46b7e0dae409ad83797a0b2feff314417bbb7b1c.tar.gz
image_signing: ensure_no_password.sh: support mounted rootfs dirs
BRANCH=None BUG=chromium:714598 TEST=signing images still works Change-Id: Icc848e49b35aa29c1a1206fa9f351be6ec252b13 Reviewed-on: https://chromium-review.googlesource.com/852675 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: David Riley <davidriley@chromium.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/image_signing/ensure_no_password.sh23
1 files changed, 16 insertions, 7 deletions
diff --git a/scripts/image_signing/ensure_no_password.sh b/scripts/image_signing/ensure_no_password.sh
index 10363bf3..de01f92a 100755
--- a/scripts/image_signing/ensure_no_password.sh
+++ b/scripts/image_signing/ensure_no_password.sh
@@ -10,15 +10,24 @@ set -e
# Load common constants and variables.
. "$(dirname "$0")/common.sh"
-if [ $# -ne 1 ]; then
+main() {
+ if [[ $# -ne 1 ]]; then
echo "Usage $0 <image>"
exit 1
-fi
+ fi
-IMAGE=$1
-ROOTFS=$(make_temp_dir)
-mount_image_partition_ro "$IMAGE" 3 "$ROOTFS"
+ local image="$1"
-if ! no_chronos_password $ROOTFS; then
+ local rootfs
+ if [[ -d "${image}" ]]; then
+ rootfs="${image}"
+ else
+ rootfs=$(make_temp_dir)
+ mount_image_partition_ro "${image}" 3 "${rootfs}"
+ fi
+
+ if ! no_chronos_password "${rootfs}"; then
die "chronos password is set! Shouldn't be for release builds."
-fi
+ fi
+}
+main "$@"