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

Unified Diff: src/scripts/mod_image_for_test.sh

Issue 1755012: Make modify-image-for-factory scripts more readable. (Closed) Base URL: ssh://git@chromiumos-git/chromiumos
Patch Set: Fix comments 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/mod_for_factory_scripts/factory_setup.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 fc7f500f17eca8c5f37f597020e52da4a67933ae..0707d206aff98dc3c94d9fa653c6e836118c0f14 100755
--- a/src/scripts/mod_image_for_test.sh
+++ b/src/scripts/mod_image_for_test.sh
@@ -114,51 +114,16 @@ fi
sudo losetup -o $(( $offset * 512 )) "${LOOP_DEV}" "${FLAGS_image}"
sudo mount "${LOOP_DEV}" "${ROOT_FS_DIR}"
-MOD_SCRIPTS_ROOT="${GCLIENT_ROOT}/src/scripts/mod_for_test_scripts"
-# Run test setup script inside chroot jail to modify the image
+MOD_TEST_ROOT="${GCLIENT_ROOT}/src/scripts/mod_for_test_scripts"
+# Run test setup script to modify the image
sudo GCLIENT_ROOT="${GCLIENT_ROOT}" ROOT_FS_DIR="${ROOT_FS_DIR}" \
- "${MOD_SCRIPTS_ROOT}/test_setup.sh"
+ "${MOD_TEST_ROOT}/test_setup.sh"
-# Run manufacturing test setup
if [ ${FLAGS_factory} -eq ${FLAGS_TRUE} ]; then
- echo "Modifying image ${FLAGS_image} for manufacturing test..."
-
- echo "Disabling ui.conf, don't do chrome startup on boot."
- sudo mv ${ROOT_FS_DIR}/etc/init/ui.conf \
- ${ROOT_FS_DIR}/etc/init/ui.conf.disabled
-
- echo "Applying patch to init scripts"
- MOD_MFG_ROOT="${GCLIENT_ROOT}/src/scripts/mod_for_factory_scripts"
- pushd ${ROOT_FS_DIR}
- sudo patch -d ${ROOT_FS_DIR} -p1 < ${MOD_MFG_ROOT}/factory.patch
- popd
-
- echo "Modifying Release Description for Factory."
- FILE="${ROOT_FS_DIR}/etc/lsb-release"
- sudo sed -i 's/Test/Factory/' $FILE
-
- echo "Done applying patch."
-
- # Try to use the sytem component file in the most recent autotest result
- FLAGS_qualdb=$(ls -dt ${FLAGS_qualdb} 2>&-| head -1)
-
- # Try to append the full path to the file if FLAGS_qualdb is a directory
- if [ ! -z ${FLAGS_qualdb} ] && [ -d ${FLAGS_qualdb} ]; then
- # TODO(waihong): Handle multiple results to deliver to multiple images
- FLAGS_qualdb="${FLAGS_qualdb}/hardware_Components,*"
- FLAGS_qualdb=$(ls -dt ${FLAGS_qualdb} 2>&-| head -1)
- FLAGS_qualdb="${FLAGS_qualdb}/hardware_Components/results/system_components"
- fi
-
- if [ ! -z ${FLAGS_qualdb} ] && [ -f ${FLAGS_qualdb} ]; then
- # Copy the qualified component file to the image
- echo "Copying ${FLAGS_qualdb} to the image."
- sudo mkdir -p ${ROOT_FS_DIR}/usr/local/manufacturing
- sudo cp -f ${FLAGS_qualdb} \
- ${ROOT_FS_DIR}/usr/local/manufacturing/qualified_components
- else
- echo "No qualified component file found at: ${FLAGS_qualdb}"
- fi
+ MOD_FACTORY_ROOT="${GCLIENT_ROOT}/src/scripts/mod_for_factory_scripts"
+ # Run factory setup script to modify the image
+ sudo GCLIENT_ROOT="${GCLIENT_ROOT}" ROOT_FS_DIR="${ROOT_FS_DIR}" \
+ QUALDB="${FLAGS_qualdb}" "${MOD_FACTORY_ROOT}/factory_setup.sh"
fi
cleanup
« no previous file with comments | « src/scripts/mod_for_factory_scripts/factory_setup.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698