From e775e6b675671a0fab2b5517840c371b60d157c0 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Wed, 5 Nov 2025 15:57:14 +0000 Subject: [PATCH 1/6] scripts: vscode: use script dir as fallback workspace Use a relative directory to script dir for default workspace if workspace is not set. Signed-off-by: Liam Girdwood --- scripts/vscode-task.sh | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/scripts/vscode-task.sh b/scripts/vscode-task.sh index b5a3ba1cecd5..c507b00bd15c 100755 --- a/scripts/vscode-task.sh +++ b/scripts/vscode-task.sh @@ -5,17 +5,16 @@ # Simple helper script for vscode task support. # Current vscode tasks have difficulty executing multiple commands. -# check if Zephyr environment is set up -if [ ! -z "$ZEPHYR_BASE" ]; then - VENV_DIR="$ZEPHYR_BASE/.venv" - echo "Using Zephyr environment at $ZEPHYR_BASE" -elif [ ! -z "$SOF_WORKSPACE" ]; then - VENV_DIR="$SOF_WORKSPACE/zephyr/.venv" - echo "Using SOF/Zephyr environment at $SOF_WORKSPACE" +# check if SOF workspace environment is set up +if [ ! -z "$SOF_WORKSPACE" ]; then + VENV_DIR="$SOF_WORKSPACE/.venv" + echo "Using SOF environment at $SOF_WORKSPACE" else - # fallback to the zephyr default from the getting started guide - VENV_DIR="$HOME/zephyrproject/.venv" - echo "Using default Zephyr environment at $VENV_DIR" + # fallback to the script directory default path + SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) + SOF_REPO=$(dirname "$SCRIPT_DIR") + VENV_DIR="$SOF_REPO/../.venv" + echo "Using default SOF environment at $VENV_DIR" fi # start the virtual environment From 34afc3a4e65657a59f4847b3268c8463a2d816e1 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Thu, 13 Nov 2025 15:06:35 +0000 Subject: [PATCH 2/6] scripts: use local directory if workspace not defined. Determine workspace if environment variable not defined. Signed-off-by: Liam Girdwood --- scripts/sof-testbench-helper.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/sof-testbench-helper.sh b/scripts/sof-testbench-helper.sh index 5de7d8d43a7b..d1726c5c1755 100755 --- a/scripts/sof-testbench-helper.sh +++ b/scripts/sof-testbench-helper.sh @@ -32,8 +32,11 @@ usage() { } if [ -z "${SOF_WORKSPACE}" ]; then - echo "Error: environment variable SOF_WORKSPACE need to be set to top level sof directory" - exit 1 + # fallback to the script directory default path + SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) + SOF_REPO=$(dirname "$SCRIPT_DIR") + SOF_WORKSPACE="$SOF_REPO/../" + echo "Using default SOF environment at $SOF_WORKSPACE" fi OUTWAV= From 84b9ace635c3b2ce42a58bad7e8216cf6d36adc8 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Mon, 1 Dec 2025 16:36:02 +0000 Subject: [PATCH 3/6] scripts: xtensa-build-zephyr: Add more meaningful help for --key-type-subdir Add more context to this command line option around deployment usage. Signed-off-by: Liam Girdwood --- scripts/xtensa-build-zephyr.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/xtensa-build-zephyr.py b/scripts/xtensa-build-zephyr.py index 7610f81c1b81..2ecee2f8e58f 100755 --- a/scripts/xtensa-build-zephyr.py +++ b/scripts/xtensa-build-zephyr.py @@ -356,6 +356,7 @@ def parse_args(): sign must be used (https://bugs.python.org/issue9334)""", ) + # Firmware deployment options using signing key based links parser.add_argument("--key-type-subdir", default="community", choices=["community", "none", "dbgkey"], help="""Output subdirectory for rimage signing key type. @@ -364,8 +365,9 @@ def parse_args(): parser.add_argument("--use-platform-subdir", default = False, action="store_true", - help="""Use an output subdirectory for each platform. -Otherwise, all firmware files are installed in the same staging directory by default.""") + help="""Deployment: Use an output subdirectory for each platform. +Otherwise, all firmware files are installed in the same staging directory by default. If none +is specified then firmware binary can be linked to default firmware loading path directly.""") parser.add_argument("--no-interactive", default=False, action="store_true", help="""Run script in non-interactive mode when user input can not be provided. From 37176538c99ef2e9c7d380de6432fef240b5165e Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Tue, 2 Dec 2025 15:59:17 +0000 Subject: [PATCH 4/6] scripts: alsa-build: fallback to relative SOF environment if not set. Use a fallback SOF_WORKSPACE relative to script dir if environment not set. Signed-off-by: Liam Girdwood --- scripts/build-alsa-tools.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/build-alsa-tools.sh b/scripts/build-alsa-tools.sh index 5e1e7f75d39d..1084a9e124a0 100755 --- a/scripts/build-alsa-tools.sh +++ b/scripts/build-alsa-tools.sh @@ -22,14 +22,17 @@ declare -a COMMIT_ID=( ) # Directory where repositories will be cloned/updated. -if [[ -z "$SOF_WORKSPACE" ]]; then - # Environment variable is empty or unset so use default - BASE_DIR="$HOME/work/sof" -else - # Environment variable exists and has a value - BASE_DIR="$SOF_WORKSPACE" +if [ -z "${SOF_WORKSPACE}" ]; then + # fallback to the script directory default path + SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) + SOF_REPO=$(dirname "$SCRIPT_DIR") + SOF_WORKSPACE="$SOF_REPO/../" + echo "Using default SOF environment at $SOF_WORKSPACE" fi +# Environment variable exists and has a value +BASE_DIR="$SOF_WORKSPACE" + # Arguments to pass to ./configure for each repository. Add or remove declare -a CONFIGURE_ARGS=( "--prefix=${BASE_DIR}/tools" From 039fcb5ddd48c3ceb53d9121a6d365b567bb6700 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Tue, 2 Dec 2025 15:59:31 +0000 Subject: [PATCH 5/6] scripts: doc-gen: fallback to relative SOF environment if not set. Use a fallback SOF_WORKSPACE relative to script dir if environment not set. Signed-off-by: Liam Girdwood --- scripts/gen-doc.sh | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/scripts/gen-doc.sh b/scripts/gen-doc.sh index 7b36c0da96d6..9b0cc6238dd7 100755 --- a/scripts/gen-doc.sh +++ b/scripts/gen-doc.sh @@ -10,17 +10,16 @@ # so that the python packages are available (and more up to date than # the system packages). -# check if Zephyr environment is set up -if [ ! -z "$ZEPHYR_BASE" ]; then - VENV_DIR="$ZEPHYR_BASE/.venv" - echo "Using Zephyr environment at $ZEPHYR_BASE" -elif [ ! -z "$SOF_WORKSPACE" ]; then - VENV_DIR="$SOF_WORKSPACE/zephyr/.venv" - echo "Using SOF/Zephyr environment at $SOF_WORKSPACE" +# check if SOF workspace environment is set up +if [ ! -z "$SOF_WORKSPACE" ]; then + VENV_DIR="$SOF_WORKSPACE/.venv" + echo "Using SOF environment at $SOF_WORKSPACE" else - # fallback to the zephyr default from the getting started guide - VENV_DIR="$HOME/zephyrproject/.venv" - echo "Using default Zephyr environment at $VENV_DIR" + # fallback to the script directory default path + SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) + SOF_REPO=$(dirname "$SCRIPT_DIR") + VENV_DIR="$SOF_REPO/../.venv" + echo "Using default SOF environment at $VENV_DIR" fi # start the virtual environment From e1a526949fd92415f0d7ceef558593de727595d3 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Tue, 2 Dec 2025 15:59:50 +0000 Subject: [PATCH 6/6] scripts: testbench profile: fallback to relative SOF environment if not set. Use a fallback SOF_WORKSPACE relative to script dir if environment not set. Signed-off-by: Liam Girdwood --- scripts/sof-testbench-build-profile.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/sof-testbench-build-profile.sh b/scripts/sof-testbench-build-profile.sh index 342f0710ff23..c91f8ce1e2e1 100755 --- a/scripts/sof-testbench-build-profile.sh +++ b/scripts/sof-testbench-build-profile.sh @@ -15,8 +15,11 @@ MODULES_S32="asrc dcblock drc drc_multiband eqfir eqiir gain src tdfb" MODULES_S24="aria" if [ -z "${SOF_WORKSPACE}" ]; then - echo "Error: environment variable SOF_WORKSPACE need to be set to top level sof directory" - exit 1 + # fallback to the script directory default path + SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) + SOF_REPO=$(dirname "$SCRIPT_DIR") + SOF_WORKSPACE="$SOF_REPO/../" + echo "Using default SOF environment at $SOF_WORKSPACE" fi PLATFORM=none