summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaurav Shah <gauravsh@chromium.org>2010-12-10 14:43:53 -0800
committerGaurav Shah <gauravsh@chromium.org>2010-12-10 14:43:53 -0800
commit04d9975aa22bb6e805e9358e1e077ce1f756ff1c (patch)
tree45414a9ce79cb0b26e78e0424f24e40f91e475d2
parent1615bbff9a55f3d85e6b9d33fd4829afe8b41ad5 (diff)
downloadvboot-04d9975aa22bb6e805e9358e1e077ce1f756ff1c.tar.gz
Be less verbose while changing the password. Add a script for checking if password already exists.
Change-Id: Ia2b524e0bb2935d7acf220e78aebc65255cd26a2 BUG=chrome-os-partner:1564 TEST=manual Review URL: http://codereview.chromium.org/5722004
-rwxr-xr-xscripts/image_signing/ensure_no_password.sh25
-rwxr-xr-xscripts/image_signing/set_chronos_password.sh4
2 files changed, 27 insertions, 2 deletions
diff --git a/scripts/image_signing/ensure_no_password.sh b/scripts/image_signing/ensure_no_password.sh
new file mode 100755
index 00000000..5bda0a7b
--- /dev/null
+++ b/scripts/image_signing/ensure_no_password.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# abort on error
+set -e
+
+# Load common constants and variables.
+. "$(dirname "$0")/common.sh"
+
+if [ $# -ne 1 ]; then
+ echo "Usage $0 <image>"
+ exit 1
+fi
+
+IMAGE=$1
+ROOTFS=$(make_temp_dir)
+mount_image_partition_ro "$IMAGE" 3 "$ROOTFS"
+
+if ! no_chronos_password $rootfs; then
+ echo "chronos password is set! Shouldn't be for release builds."
+ exit 1
+fi
diff --git a/scripts/image_signing/set_chronos_password.sh b/scripts/image_signing/set_chronos_password.sh
index 1319dbf5..e3a33553 100755
--- a/scripts/image_signing/set_chronos_password.sh
+++ b/scripts/image_signing/set_chronos_password.sh
@@ -14,7 +14,7 @@
change_chronos_password() {
local rootfs=$1
local password=$2
- echo "Changing chronos password to '$password'..."
+ echo "Setting chronos password..."
local crypted_password="$(echo $password | openssl passwd -1 -stdin)"
local temp_shadow="$rootfs/etc/tempshadow"
echo "chronos:$crypted_password:14500:0:99999::::" \
@@ -47,7 +47,7 @@ main() {
mount_image_partition "$image" 3 "$rootfs"
change_chronos_password "$rootfs" "$chronos_password"
touch "$image" # Updates the image modification time.
- echo "Password Changed."
+ echo "Password Set."
}
main $@