Index: mod_image_for_test.sh |
diff --git a/mod_image_for_test.sh b/mod_image_for_test.sh |
index 1ea312126b2f2e8f77595265f599e7648907bd9c..ca14d539145424abf3feb3ffd3916dbdec35d492 100755 |
--- a/mod_image_for_test.sh |
+++ b/mod_image_for_test.sh |
@@ -68,6 +68,23 @@ if [ ! -f $FLAGS_image ] ; then |
exit 1 |
fi |
+# What cross-build are we targeting? |
+. "${FLAGS_build_root}/${FLAGS_board}/etc/make.conf.board_setup" |
+# Figure out ARCH from the given toolchain. |
+# TODO: Move to common.sh as a function after scripts are switched over. |
+TC_ARCH=$(echo "${CHOST}" | awk -F'-' '{ print $1 }') |
+case "${TC_ARCH}" in |
+ arm*) |
+ ARCH="arm" |
+ ;; |
+ *86) |
+ ARCH="x86" |
+ ;; |
+ *) |
+ error "Unable to determine ARCH from toolchain: ${CHOST}" |
+ exit 1 |
+esac |
+ |
# Make sure anything mounted in the rootfs/stateful is cleaned up ok on exit. |
cleanup_mounts() { |
# Occasionally there are some daemons left hanging around that have our |
@@ -185,7 +202,7 @@ else |
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}" \ |
- STATEFUL_DIR="${STATEFUL_DIR}" "${MOD_TEST_ROOT}/test_setup.sh" |
+ STATEFUL_DIR="${STATEFUL_DIR}" ARCH="${ARCH}" "${MOD_TEST_ROOT}/test_setup.sh" |
if [ ${FLAGS_factory} -eq ${FLAGS_TRUE} ]; then |
install_autotest |