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" 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 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 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= 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 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.