From d606ee21b49f44fbe2a9b2dfe7abae1f6682ac91 Mon Sep 17 00:00:00 2001 From: Liam McLoughlin Date: Tue, 3 Jul 2012 16:48:57 -0700 Subject: [PATCH] Adding board specific image creation stage BUG=none TEST=Build a beaglebone image then verify that the beaglebone bootloader was installed into the ESP Change-Id: I1037ee6a61d409e8fd2d66ec6746048a54ce8f14 Reviewed-on: https://gerrit.chromium.org/gerrit/26738 Tested-by: Liam McLoughlin Reviewed-by: Mike Frysinger Commit-Ready: Liam McLoughlin --- build_image | 20 ++++++++++++++++++-- build_library/base_image_util.sh | 6 ++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/build_image b/build_image index ef76f5b489..ed9600b4ce 100755 --- a/build_image +++ b/build_image @@ -109,6 +109,13 @@ OVERLAY_CHROMEOS_DIR="${SRC_ROOT}/third_party/chromiumos-overlay/chromeos" parse_build_image_args +for overlay in $(cros_overlay_list --board "$BOARD"); do + setup_sh="${overlay}/scripts/board_specific_setup.sh" + if [[ -e ${setup_sh} ]]; then + source "${setup_sh}" + fi +done + # Tweak sizes defaulted or given based on any boost given (or defaulted). # This is syntactic sugar to separate concerns in callers, and unify # default values here. @@ -190,10 +197,14 @@ DEV_IMAGE_ROOT="${STATEFUL_FS_DIR}/dev_image" eclean-$BOARD -d packages -check_blacklist +if [[ ${skip_blacklist_check} -ne 1 ]]; then + check_blacklist +fi # Check that the build root is sane. -"${BUILD_LIBRARY_DIR}/test_build_root" --root="${BOARD_ROOT}" +if [[ ${skip_test_build_root} -ne 1 ]]; then + "${BUILD_LIBRARY_DIR}/test_build_root" --root="${BOARD_ROOT}" +fi # Hack to fix bug where x86_64 CHOST line gets incorrectly added. # ToDo(msb): remove this hack. @@ -237,6 +248,11 @@ if should_build_image "${PRISTINE_IMAGE_NAME}"; then "${DEVKEYSDIR}/recovery_key.vbpubk" ${BOOT_FLAG} fi +# Running board-specific setup if any exists. +if type board_setup &>/dev/null; then + board_setup "${BUILD_DIR}/${PRISTINE_IMAGE_NAME}" +fi + # Create a developer image if an image that is based on it is requested. if should_build_image ${CHROMEOS_DEVELOPER_IMAGE_NAME} \ ${CHROMEOS_TEST_IMAGE_NAME} ${CHROMEOS_FACTORY_TEST_IMAGE_NAME}; then diff --git a/build_library/base_image_util.sh b/build_library/base_image_util.sh index 5dabddb9e4..dfc25d1d03 100755 --- a/build_library/base_image_util.sh +++ b/build_library/base_image_util.sh @@ -193,8 +193,10 @@ create_base_image() { # Don't test the factory install shim if ! should_build_image ${CHROMEOS_FACTORY_INSTALL_SHIM_NAME}; then - # Check that the image has been correctly created. - test_image_content "$ROOT_FS_DIR" + if [[ ${skip_test_image_content} -ne 1 ]]; then + # Check that the image has been correctly created. + test_image_content "$ROOT_FS_DIR" + fi fi # Clean up symlinks so they work on a running target rooted at "/".