From 3e2617ee38cae4eab303547130f8d3036e27a69b Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Tue, 31 Dec 2024 16:46:16 +0200 Subject: [PATCH] Scripts: Ensure user's sof-ctl is up-to-date before blobs rebuild The sof-ctl is used to create the bytes control SOF ABI header for the binary blob files. These changes ensure that the sof-ctl is built from tools and that the correct version of sof-ctl exists in user's path. Signed-off-by: Seppo Ingalsuo --- scripts/sof-rebuild-processing-comp-blobs.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/scripts/sof-rebuild-processing-comp-blobs.sh b/scripts/sof-rebuild-processing-comp-blobs.sh index 26410c811259..b1c11df49189 100755 --- a/scripts/sof-rebuild-processing-comp-blobs.sh +++ b/scripts/sof-rebuild-processing-comp-blobs.sh @@ -10,10 +10,24 @@ if [ -z "${SOF_WORKSPACE}" ]; then fi if ! command -v octave &> /dev/null; then - echo "Error: this scrip needs GNU Octave, see https://octave.org/" + echo "Error: this script needs GNU Octave, see https://octave.org/" exit 1 fi +"$SOF_WORKSPACE"/sof/scripts/build-tools.sh -c + +if ! command -v sof-ctl &> /dev/null; then + echo "Error: The sof-ctl utility is not found from path for executables. It is needed" + echo " to retrieve SOF ABI header It can be added with e.g. symlink to user's binaries:" + echo " ln -s $SOF_WORKSPACE/sof/tools/build_tools/ctl/sof-ctl $HOME/bin/sof-ctl" + exit 1 +fi + +cmp --quiet "$(which sof-ctl)" "$SOF_WORKSPACE"/sof/tools/build_tools/ctl/sof-ctl || { + echo "Error: The sof-ctl in user's path is not the same as sof-ctl build from tools." + exit 1 +} + OCTAVE="octave --quiet --no-window-system" cd "$SOF_WORKSPACE"/sof/src/audio/aria/tune; $OCTAVE sof_aria_blobs.m cd "$SOF_WORKSPACE"/sof/src/audio/crossover/tune; $OCTAVE sof_example_crossover.m