xtensa-build-zephyr: run smex and install to new staging area

Ready to be transferred to the remote system. Sample output:

build-sof-staging
├── sof
│   ├── community
│   │   ├── sof-apl.ri
│   │   └── sof-tgl-h.ri
│   ├── sof-apl.ldc
│   └── sof-tgl-h.ldc
└── tools
    └── sof-logger

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit is contained in:
Marc Herbert 2021-07-12 05:09:34 +00:00 committed by Liam Girdwood
parent 2802f2a40a
commit bdae0ee127
1 changed files with 30 additions and 2 deletions

View File

@ -69,6 +69,11 @@ clone()
)
}
install_opts()
{
install -D -p "$@"
}
build()
{
cd "$WEST_TOP"
@ -81,6 +86,9 @@ build()
make -j"$BUILD_JOBS"
cd -
local STAGING=build-sof-staging
mkdir -p ${STAGING}/sof/ # smex does not use 'install -D'
for platform in "${PLATFORMS[@]}"; do
case "$platform" in
apl)
@ -102,18 +110,38 @@ build()
;;
esac
local bdir=build-"$platform"
(
# west can get lost in symbolic links and then
# show a confusing error.
/bin/pwd
set -x
west build --build-dir build-"$platform" --board "$PLAT_CONFIG" \
west build --build-dir "$bdir" --board "$PLAT_CONFIG" \
zephyr/samples/subsys/audio/sof
west sign --build-dir build-"$platform" \
# This should ideally be part of
# sof/zephyr/CMakeLists.txt but due to the way
# Zephyr works, the SOF library build there does
# not seem like it can go further than a
# "libmodules_sof.a" file that smex does not
# know how to use.
"$bdir"/zephyr/smex_ep/build/smex \
-l "$STAGING"/sof/sof-"$platform".ldc \
"$bdir"/zephyr/zephyr.elf
west sign --build-dir "$bdir" \
--tool rimage --tool-path "$RIMAGE_DIR"/rimage \
--tool-data modules/audio/sof/rimage/config -- -k "$RIMAGE_KEY"
)
install_opts -m 0644 "$bdir"/zephyr/zephyr.ri \
"$STAGING"/sof/community/sof-"$platform".ri
done
install_opts -m 0755 "$bdir"/zephyr/sof-logger_ep/build/logger/sof-logger \
"$STAGING"/tools/sof-logger
tree "$STAGING"
}
main()