Skip to content

Commit

Permalink
lib.sh: source additional files local_config.bash
Browse files Browse the repository at this point in the history
Source additional files /etc/sof/local_config.bash and
sof-test/case-lib/local_config.bash.

This helps solving device-specific issues like thesofproject#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 <[email protected]>
  • Loading branch information
marc-hb committed Sep 23, 2024
1 parent ea0419b commit b42cc3c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions case-lib/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:-}
Expand Down
9 changes: 9 additions & 0 deletions case-lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit b42cc3c

Please sign in to comment.