Skip to content

Commit

Permalink
lib.sh: get_ldc_subdir(): add optional platform argument to strip
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
marc-hb committed Jun 3, 2024
1 parent 6a55123 commit f2e3ae9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion case-lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -323,6 +325,7 @@ get_ldc_subdir()
subdir=${subdir%/community}
subdir=${subdir%/intel-signed}
subdir=${subdir%/dbgkey}
test -z "$strip_arg" || subdir=${subdir%/"$strip_arg"}
fi
fi
printf '%s' "$subdir"
Expand All @@ -345,7 +348,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
Expand Down

0 comments on commit f2e3ae9

Please sign in to comment.