Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2310)

Unified Diff: bin/cros_sign_to_ssd

Issue 3273011: fix sign_to_ssd (Closed) Base URL: http://git.chromium.org/git/crosutils.git
Patch Set: rebase Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/cros_sign_to_ssd
diff --git a/bin/cros_sign_to_ssd b/bin/cros_sign_to_ssd
index 7200e4c82c82c9d3ba86cb111ef9186e2cda9f7d..d961de1a37b4c69103380eb491068e6033382a95 100755
--- a/bin/cros_sign_to_ssd
+++ b/bin/cros_sign_to_ssd
@@ -22,35 +22,49 @@ DEFINE_string from "chromiumos_image.bin" \
FLAGS "$@" || exit 1
eval set -- "${FLAGS_ARGV}"
+failure() {
+ echo "SIGNING HAD FAILED"
+ exit 1
+}
+
# Abort on error
set -e
-if [ -z $FLAGS_from ] || [ ! -f $FLAGS_from ] ; then
+trap "failure" EXIT
+
+if [ -z "${FLAGS_from}" ] || [ ! -f "${FLAGS_from}" ] ; then
echo "Error: invalid flag --from"
exit 1
fi
# Example commandline is as follows:
-# ./bin/cros_resign_image.sh \
-#--from ../build/images/x86-generic/b903/chromiumos_ssd_image.bin \
-#--datakey ../platform/vboot_reference/tests/devkeys/kernel_data_key.vbprivk \
-#--keyblock ../platform/vboot_reference/tests/devkeys/kernel.keyblock \
-#--vsubkey ../platform/vboot_reference/tests/devkeys/kernel_subkey.vbpubk \
-#--vbutil_dir /usr/bin/ \
-#--to ../build/images/x86-generic/b903/chromiumos_ssd_test_image.bin
+# ./sign_official_build.sh \
+# ssd \
+# /.../build/images/x86-mario/0.8.68.2/chromiumos_test_image.bin \
+# ../../tests/devkeys/ \
+# /.../build/images/x86-mario/0.8.68.2/chromiumos_test_ssd_image.bin
+
+VBOOT_DIR="$(dirname "$0")/../../platform/vboot_reference"
+if [ ! -d "${VBOOT_DIR}" ]; then
+ die "VBOOT DIR NOT FOUND at \'${VBOOT_DIR}\' .."
+fi
+
+TMP_IMAGE=$(mktemp)
+VBOOT_KEYS="${VBOOT_DIR}/tests/devkeys"
+if [ ! -d "${VBOOT_KEYS}" ]; then
+ die "VBOOT KEYS NOT FOUND at \'${VBOOT_KEYS}\' .."
+fi
+VBOOT_SIGN="${VBOOT_DIR}/scripts/image_signing/sign_official_build.sh"
+if [ ! -x "${VBOOT_SIGN}" ]; then
+ die "VBOOT TOOL sign_official_build.sh NOT FOUND at \'${VBOOT_SIGN}\' .."
+fi
-TMP_IMAGE=/tmp/image.bin
-VBOOT_KEYS=$(dirname "$0")/../../platform/vboot_reference/tests/devkeys
-cp $FLAGS_from $TMP_IMAGE
+cp "${FLAGS_from}" "${TMP_IMAGE}"
-$(dirname "$0")/cros_resign_image.sh \
- --from $TMP_IMAGE \
- --datakey ${VBOOT_KEYS}/kernel_data_key.vbprivk \
- --keyblock ${VBOOT_KEYS}/kernel.keyblock \
- --vsubkey ${VBOOT_KEYS}/kernel_subkey.vbpubk \
- --vbutil_dir /usr/bin/ \
- --to $FLAGS_from
+${VBOOT_SIGN} ssd "${TMP_IMAGE}" "${VBOOT_KEYS}" "${FLAGS_from}"
-rm $TMP_IMAGE
+rm "${TMP_IMAGE}"
+set +e
+trap - EXIT
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698