From ea4046ce5df4a225d01c43c0864afd6191ef0547 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 7 May 2017 01:36:46 -0400 Subject: 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 Tested-by: Mike Frysinger Reviewed-by: David Riley (cherry picked from commit 46b7e0dae409ad83797a0b2feff314417bbb7b1c) Reviewed-on: https://chromium-review.googlesource.com/861608 Reviewed-by: Shelley Chen Commit-Queue: Shelley Chen Tested-by: Shelley Chen --- scripts/image_signing/ensure_no_password.sh | 23 ++++++++++++++++------- 1 file 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 " 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 "$@" -- cgit v1.2.1