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

Unified Diff: src/scripts/mod_image_for_test.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/image_to_usb.sh ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scripts/mod_image_for_test.sh
diff --git a/src/scripts/mod_image_for_test.sh b/src/scripts/mod_image_for_test.sh
index 5bc1b2fbb0a05b700ba62db70d69f30bb3e6dbbf..8bcdcbd64268838736b3ca9bf18f1ccec21ea5aa 100755
--- a/src/scripts/mod_image_for_test.sh
+++ b/src/scripts/mod_image_for_test.sh
@@ -20,6 +20,8 @@ DEFINE_string qualdb "/tmp/run_remote_tests.*" \
"Location of qualified component file"
DEFINE_string image "" "Location of the rootfs raw image file"
DEFINE_boolean factory $FLAGS_FALSE "Modify the image for manufacturing testing"
+DEFINE_boolean factory_install $FLAGS_FALSE \
+ "Modify the image for factory install shim"
DEFINE_boolean yes $FLAGS_FALSE "Answer yes to all prompts" "y"
# Parse command line
@@ -73,6 +75,7 @@ cleanup() {
cleanup_mounts "${ROOT_FS_DIR}"
if [ -n "${ROOT_LOOP_DEV}" ]
then
+ sudo umount "${ROOT_FS_DIR}/var"
cleanup_loop "${ROOT_LOOP_DEV}"
fi
rmdir "${ROOT_FS_DIR}"
@@ -134,6 +137,7 @@ if [ -z "$STATEFUL_LOOP_DEV" ]; then
fi
sudo losetup -o $(( $offset * 512 )) "${STATEFUL_LOOP_DEV}" "${FLAGS_image}"
sudo mount "${STATEFUL_LOOP_DEV}" "${STATEFUL_DIR}"
+sudo mount --bind "${STATEFUL_DIR}/var" "${ROOT_FS_DIR}/var"
STATEFUL_DIR="${STATEFUL_DIR}"
MOD_TEST_ROOT="${GCLIENT_ROOT}/src/scripts/mod_for_test_scripts"
@@ -149,6 +153,20 @@ if [ ${FLAGS_factory} -eq ${FLAGS_TRUE} ]; then
"${MOD_FACTORY_ROOT}/factory_setup.sh"
fi
+if [ ${FLAGS_factory_install} -eq ${FLAGS_TRUE} ]; then
+ # Run factory setup script to modify the image.
+ sudo emerge-${FLAGS_board} --root=$ROOT_FS_DIR --usepkgonly \
+ --root-deps=rdeps chromeos-factoryinstall
+
+ # Set factory server if necessary.
+ if [ "${FACTORY_SERVER}" != "" ]; then
+ sudo sed -i \
+ "s/CHROMEOS_AUSERVER=.*$/CHROMEOS_AUSERVER=\
+http:\/\/${FACTORY_SERVER}:8080\/update/" \
+ ${ROOT_FS_DIR}/etc/lsb-release
+ fi
+fi
+
cleanup
trap - EXIT
« no previous file with comments | « src/scripts/image_to_usb.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698