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

Unified Diff: src/scripts/image_to_usb.sh

Issue 1606004: Only mod image for test if necessary (Closed)
Patch Set: Dealt with whitespace Created 10 years, 9 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: src/scripts/image_to_usb.sh
diff --git a/src/scripts/image_to_usb.sh b/src/scripts/image_to_usb.sh
index b881e1a946d062b6c88aa0e5d59dc26202377a19..ad033ccbc4d6f06c228507228dbaea478bd7ee2e 100755
--- a/src/scripts/image_to_usb.sh
+++ b/src/scripts/image_to_usb.sh
@@ -48,7 +48,7 @@ AUTOTEST_SRC="${SYSROOT}/usr/local/autotest"
set -e
# No board, no default and no image set then we can't find the image
-if [ -z ${FLAGS_from} ] && [ -z ${FLAGS_board} ] ; then
+if [ -z ${FLAGS_from} ] && [ -z ${FLAGS_board} ] ; then
setup_board_warning
exit 1
fi
@@ -90,13 +90,16 @@ SRC_IMAGE="${FLAGS_from}/chromiumos_image.bin"
# If we're asked to modify the image for test, then let's make a copy and
# modify that instead.
if [ ${FLAGS_test_image} -eq ${FLAGS_TRUE} ] ; then
- # Copy it.
- echo "Creating test image from original..."
- cp -f "${SRC_IMAGE}" "${FLAGS_from}/chromiumos_test_image.bin"
+ if [ ! -f "${FLAGS_from}/chromiumos_test_image.bin" ] ; then
+ # Copy it.
+ echo "Creating test image from original..."
+ cp -f "${SRC_IMAGE}" "${FLAGS_from}/chromiumos_test_image.bin"
+ # Modify it.
+ "${SCRIPTS_DIR}/mod_image_for_test.sh" --image \
+ "${FLAGS_from}/chromiumos_test_image.bin"
+ fi
# Use it.
SRC_IMAGE="${FLAGS_from}/chromiumos_test_image.bin"
- # Modify it.
- "${SCRIPTS_DIR}/mod_image_for_test.sh" --image "${SRC_IMAGE}"
fi
STATEFUL_DIR="${FLAGS_from}/stateful_partition"
@@ -139,10 +142,10 @@ if [ ${FLAGS_install_autotest} -eq ${FLAGS_TRUE} ] ; then
sudo mkdir -p "${stateful_root}${autotest_client}"
sudo cp -fpru ${AUTOTEST_SRC}/client/* \
- "${stateful_root}/${autotest_client}"
+ "${stateful_root}/${autotest_client}"
sudo chmod 755 "${stateful_root}/${autotest_client}"
sudo chown -R 1000:1000 "${stateful_root}/${autotest_client}"
-
+
sudo umount ${STATEFUL_DIR}
sudo losetup -d "${stateful_loop_dev}"
trap - INT TERM 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