From 4d4fd8c4267bebbc25e8dd4f5ef277b11e16b5eb Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 25 Aug 2021 18:08:58 +0200 Subject: [PATCH] xtensa-build-zephyr.sh: build rimage later, just before it's needed. We care about other build errors more. This also makes it easier to test locally that "west build" does not depend on rimage to create zephyr.elf Signed-off-by: Marc Herbert --- scripts/xtensa-build-zephyr.sh | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/scripts/xtensa-build-zephyr.sh b/scripts/xtensa-build-zephyr.sh index 6738e5168..b5ab9f1e1 100755 --- a/scripts/xtensa-build-zephyr.sh +++ b/scripts/xtensa-build-zephyr.sh @@ -107,14 +107,6 @@ build() # https://github.com/zephyrproject-rtos/west/issues/419 } - # Build rimage - RIMAGE_DIR=build-rimage - mkdir -p "$RIMAGE_DIR" - cd "$RIMAGE_DIR" - cmake ../modules/audio/sof/rimage - make -j"$BUILD_JOBS" - cd - - local STAGING=build-sof-staging mkdir -p ${STAGING}/sof/ # smex does not use 'install -D' @@ -189,6 +181,11 @@ build() -l "$STAGING"/sof/sof-"$platform".ldc \ "$bdir"/zephyr/zephyr.elf + # Build rimage + RIMAGE_DIR=build-rimage + cmake -B "$RIMAGE_DIR" -S modules/audio/sof/rimage + make -C "$RIMAGE_DIR" -j"$BUILD_JOBS" + west sign --build-dir "$bdir" \ --tool rimage --tool-path "$RIMAGE_DIR"/rimage \ --tool-data modules/audio/sof/rimage/config -- -k "$RIMAGE_KEY" @@ -271,8 +268,9 @@ main() ln -s "$SOF_TOP" "${WEST_TOP}"/modules/audio/sof } - # Support for submodules in west is too recent, cannot - # rely on it + # FIXME: remove this hack. Downloading and building + # should be kept separate but support for submodules in + # west is too recent, cannot rely on it yet. test -e "${WEST_TOP}"/modules/audio/sof/rimage/CMakeLists.txt || ( cd "${WEST_TOP}"/modules/audio/sof git submodule update --init --recursive