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

Unified Diff: src/scripts/image_to_usb.sh

Issue 1945004: Allow factory install shim to be overlay installed (Closed) Base URL: ssh://git@chromiumos-git/chromeos
Patch Set: Allow factory install to be overlayed on an existing image Created 10 years, 8 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 | « src/scripts/build_image ('k') | src/scripts/mod_image_for_test.sh » ('j') | 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 e22e2bf62d6218950ca3187d508b15bce5446805..ff1a1bbd801e0edb35a195a1534d453a2c49e117 100755
--- a/src/scripts/image_to_usb.sh
+++ b/src/scripts/image_to_usb.sh
@@ -22,6 +22,8 @@ DEFINE_string from "" \
DEFINE_string to "" "${DEFAULT_TO_HELP}"
DEFINE_boolean yes ${FLAGS_FALSE} "Answer yes to all prompts" "y"
DEFINE_boolean force_copy ${FLAGS_FALSE} "Always rebuild test image"
+DEFINE_boolean factory_install ${FLAGS_FALSE} \
+ "Whether to generate a factory install shim."
DEFINE_boolean factory ${FLAGS_FALSE} \
"Whether to generate a factory runin image. Implies aututest and test"
DEFINE_boolean install_autotest ${FLAGS_FALSE} \
@@ -37,6 +39,13 @@ DEFINE_string build_root "/build" \
FLAGS "$@" || exit 1
eval set -- "${FLAGS_ARGV}"
+if [ ${FLAGS_factory} -eq ${FLAGS_TRUE} ] ; then
+ if [ ${FLAGS_factory_install} -eq ${FLAGS_TRUE} ] ; then
+ echo "Factory test image is incompatible with factory install shim."
+ exit 1
+ fi
+fi
+
# Require autotest for manucaturing image.
if [ ${FLAGS_factory} -eq ${FLAGS_TRUE} ] ; then
echo "Factory image requires --install_autotest and --test_image, setting."
@@ -44,6 +53,13 @@ if [ ${FLAGS_factory} -eq ${FLAGS_TRUE} ] ; then
FLAGS_test_image=${FLAGS_TRUE}
fi
+# Require test for for factory install shim.
+if [ ${FLAGS_factory_install} -eq ${FLAGS_TRUE} ] ; then
+ echo "Factory install shim requires --test_image, setting."
+ FLAGS_test_image=${FLAGS_TRUE}
+fi
+
+
# Inside the chroot, so output to usb.img in the same dir as the other
# Script can be run either inside or outside the chroot.
if [ ${INSIDE_CHROOT} -eq 1 ]
@@ -159,14 +175,19 @@ if [ ${FLAGS_test_image} -eq ${FLAGS_TRUE} ] ; then
# Check for manufacturing image.
if [ ${FLAGS_factory} -eq ${FLAGS_TRUE} ] ; then
- FACTORY_ARGS="--factory"
+ EXTRA_ARGS="--factory"
+ fi
+
+ # Check for instqall shim.
+ if [ ${FLAGS_factory_install} -eq ${FLAGS_TRUE} ] ; then
+ EXTRA_ARGS="--factory_install"
fi
# Modify it. Pass --yes so that mod_image_for_test.sh won't ask us if we
# really want to modify the image; the user gave their assent already with
# --test-image and the original image is going to be preserved.
"${SCRIPTS_DIR}/mod_image_for_test.sh" --image \
- "${FLAGS_from}/chromiumos_test_image.bin" ${FACTORY_ARGS} --yes
+ "${FLAGS_from}/chromiumos_test_image.bin" ${EXTRA_ARGS} --yes
echo "Done with mod_image_for_test."
else
echo "Using cached test image."
« no previous file with comments | « src/scripts/build_image ('k') | src/scripts/mod_image_for_test.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698