Skip to content

Commit f94cdc7

Browse files
committed
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 <marc.herbert@intel.com>
1 parent 5b29567 commit f94cdc7

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

case-lib/config.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
# this file is used for defining global variables
44

5+
# To change some of these variables without polluting git status/git
6+
# diff, override them in either /etc/sof/local_config.bash or
7+
# sof-test/case-lib/local_config.bash
8+
59
# Some variables need manual configuration
610
# Some commands need to access system node, so they need the sudo password
711
SUDO_PASSWD=${SUDO_PASSWD:-}

case-lib/lib.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ source "$SCRIPT_HOME/case-lib/pipeline.sh"
2121
# shellcheck source=case-lib/hijack.sh
2222
source "$SCRIPT_HOME/case-lib/hijack.sh"
2323

24+
# source these last (and in this order) so they win
25+
for f in /etc/sof/local_config.bash ${SCRIPT_HOME}/case-lib/local_config.bash; do
26+
if test -e "$f"; then
27+
dlogw "Sourcing local and optional $f"
28+
# shellcheck disable=SC1090
29+
source "$f"
30+
fi
31+
done
32+
2433
# restrict bash version for some bash feature
2534
[[ $(echo -e "$BASH_VERSION\n4.1"|sort -V|head -n 1) == '4.1' ]] || {
2635
dlogw "Bash version: ${BASH_VERSINFO[0]}.${BASH_VERSINFO[1]} should > 4.1"

0 commit comments

Comments
 (0)