fix(build_image): Add auto-enter-chroot call

This makes build_image and image_to_vm behave like build_packages, where
if you call the script outside of the SDK's chroot it will automatically
reexecute itself inside of the chroot.
This commit is contained in:
Michael Marineau 2014-03-23 20:17:05 -04:00
parent 0a8f178002
commit 934675d19b
2 changed files with 11 additions and 1 deletions

View File

@ -12,6 +12,11 @@
SCRIPT_ROOT=$(dirname $(readlink -f "$0"))
. "${SCRIPT_ROOT}/common.sh" || exit 1
# Script must run inside the chroot
restart_in_chroot_if_needed "$@"
assert_not_root_user
# Developer-visible flags.
DEFINE_string board "${DEFAULT_BOARD}" \
"The board to build an image for."

View File

@ -8,10 +8,15 @@
# disk image, supporting a variety of different targets.
# Helper scripts should be run from the same location as this script.
SCRIPT_ROOT=$(dirname "$(readlink -f "$0")")
. "${SCRIPT_ROOT}/common.sh" || exit 1
# Script must run inside the chroot
restart_in_chroot_if_needed "$@"
assert_not_root_user
. "${BUILD_LIBRARY_DIR}/toolchain_util.sh" || exit 1
. "${BUILD_LIBRARY_DIR}/build_image_util.sh" || exit 1
. "${BUILD_LIBRARY_DIR}/vm_image_util.sh" || exit 1