From f94cdc772758692b09f3029768324ad1b4edd3ef Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Mon, 23 Sep 2024 15:48:42 -0700 Subject: [PATCH] lib.sh: source additional files local_config.bash Source additional files /etc/sof/local_config.bash and sof-test/case-lib/local_config.bash. This helps solving device-specific issues like #1233 and many others before that - for instance git blame the "ignore_str" variable in sof-kernel-log-check.sh Signed-off-by: Marc Herbert --- case-lib/config.sh | 4 ++++ case-lib/lib.sh | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/case-lib/config.sh b/case-lib/config.sh index 2127c8d6..69cfc242 100644 --- a/case-lib/config.sh +++ b/case-lib/config.sh @@ -2,6 +2,10 @@ # this file is used for defining global variables +# To change some of these variables without polluting git status/git +# diff, override them in either /etc/sof/local_config.bash or +# sof-test/case-lib/local_config.bash + # Some variables need manual configuration # Some commands need to access system node, so they need the sudo password SUDO_PASSWD=${SUDO_PASSWD:-} diff --git a/case-lib/lib.sh b/case-lib/lib.sh index 94886bbc..02096638 100644 --- a/case-lib/lib.sh +++ b/case-lib/lib.sh @@ -21,6 +21,15 @@ source "$SCRIPT_HOME/case-lib/pipeline.sh" # shellcheck source=case-lib/hijack.sh source "$SCRIPT_HOME/case-lib/hijack.sh" +# source these last (and in this order) so they win +for f in /etc/sof/local_config.bash ${SCRIPT_HOME}/case-lib/local_config.bash; do + if test -e "$f"; then + dlogw "Sourcing local and optional $f" + # shellcheck disable=SC1090 + source "$f" + fi +done + # restrict bash version for some bash feature [[ $(echo -e "$BASH_VERSION\n4.1"|sort -V|head -n 1) == '4.1' ]] || { dlogw "Bash version: ${BASH_VERSINFO[0]}.${BASH_VERSINFO[1]} should > 4.1"