Skip to content

Commit

Permalink
case-lib/lib.sh: switch is_firmware_file_zephyr() to fw_relfilepath()
Browse files Browse the repository at this point in the history
Faster and more flexible.

Signed-off-by: Marc Herbert <[email protected]>
  • Loading branch information
marc-hb committed Jul 25, 2024
1 parent e4ce41e commit a74f994
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions case-lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -879,11 +879,6 @@ fw_relfilepath()
printf '%s' "$from_klogs"
}


# TODO: switch to new debugfs `fw_profile`, see
# https://github.com/thesofproject/linux/issues/3867 and friends. Keep this existing
# journalctl_cmd() code as a fallback for older kernels or when the firmware has been
# unloaded. Fallback similar to the one in commit 646a3b3b71003
fw_relfilepath_from_klogs()
{
local rel_filepath
Expand All @@ -906,8 +901,8 @@ is_firmware_file_zephyr()
{
local firmware_path znum

firmware_path=$(fw_relfilepath_from_klogs) ||
die 'Firmware path not found.'
{ firmware_path=$(fw_relfilepath) && test -r /lib/firmware/"$firmware_path"; } ||
die "Firmware path ${firmware_path} not found."

znum=$(strings "/lib/firmware/$firmware_path" | grep -c -i zephyr)
test "$znum" -gt 10
Expand Down

0 comments on commit a74f994

Please sign in to comment.