Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions case-lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,23 @@ fake_kern_error()

}

# Prints the .ldc file found on stdout, errors on stderr.
get_ldc_subdir()
{
local subdir='intel/sof' # default
if test -e /sys/module/snd_sof_pci/parameters/fw_path; then
local fw_path
fw_path=$(cat /sys/module/snd_sof_pci/parameters/fw_path)
if [ "$fw_path" != '(null)' ]; then
subdir=${fw_path%/} # strip any trailing slash
subdir=${subdir%/community}
subdir=${subdir%/intel-signed}
subdir=${subdir%/dbgkey}
fi
fi
printf '%s' "$subdir"
}

# Prints the .ldc file found on stdout, logs on stderr.
find_ldc_file()
{
local ldcFile
Expand All @@ -306,8 +322,10 @@ find_ldc_file()
return 1
}
ldcFile=/etc/sof/sof-"$platf".ldc
[ -e "$ldcFile" ] ||
ldcFile=/lib/firmware/intel/sof/sof-"$platf".ldc
[ -e "$ldcFile" ] || {
local subdir; subdir=$(get_ldc_subdir)
ldcFile=/lib/firmware/"${subdir}"/sof-"$platf".ldc
}
fi

[[ -e "$ldcFile" ]] || {
Expand Down