From b1f2527a7d710d41b84cd27997bb1ae290dfc6d7 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Mon, 3 Jun 2024 10:48:07 -0700 Subject: [PATCH] lib.sh: get_ldc_subdir(): add optional platform argument to strip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is needed by IPC4 - which generally does not use the .ldc file but that's another debate for later; let's just get the check-sof-logger.sh test passing again for now. This problem wasn't found until last week when Fred cleaned up and simplified the internal Intel deployment script. This part of the logic has too many fallbacks so one of them was probably hiding the issue, probably picking up some .ldc file in /etc instead. ``` ── sof-ipc4 │   ├── arl │   │   └── community │   │   └── sof-arl.ri -> ../../mtl/community/sof-mtl.ri │   ├── arl-s │   │   └── community │   │   └── sof-arl-s.ri -> ../../mtl/community/sof-mtl.ri │   ├── mtl │   │   └── community │   │   └── sof-mtl.ri │   ├── sof-arl.ldc -> sof-mtl.ldc │   ├── sof-arl-s.ldc -> sof-mtl.ldc │   └── sof-mtl.ldc ``` Signed-off-by: Marc Herbert --- case-lib/lib.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/case-lib/lib.sh b/case-lib/lib.sh index 55e20762..7cb4a27f 100644 --- a/case-lib/lib.sh +++ b/case-lib/lib.sh @@ -305,8 +305,10 @@ fake_kern_error() } +# $1: optional (platform) string to strip. Useful for IPC4. get_ldc_subdir() { + local strip_arg="$1" local subdir='intel/sof' # default local fw_path local fw_path_info='/sys/kernel/debug/sof/fw_profile/fw_path' @@ -323,6 +325,8 @@ get_ldc_subdir() subdir=${subdir%/community} subdir=${subdir%/intel-signed} subdir=${subdir%/dbgkey} + subdir=${subdir%/dbgkey} + test -z "$strip_arg" || subdir=${subdir%/"$strip_arg"} fi fi printf '%s' "$subdir" @@ -345,7 +349,7 @@ find_ldc_file() } ldcFile=/etc/sof/sof-"$platf".ldc [ -e "$ldcFile" ] || { - local subdir; subdir=$(get_ldc_subdir) + local subdir; subdir=$(get_ldc_subdir "$platf") ldcFile=/lib/firmware/"${subdir}"/sof-"$platf".ldc } fi