Skip to content

Commit

Permalink
lib.sh: simplify the check for firmware rtos
Browse files Browse the repository at this point in the history
We can acquire firmware path simply with journalctl,
and use it to check if firmware is using zephyr.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
  • Loading branch information
Chao Song committed Oct 24, 2022
1 parent d388738 commit 4de0925
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions case-lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -682,26 +682,10 @@ is_zephyr()

is_firmware_file_zephyr()
{
local firmware_name firmware_path znum platform
# get the FW name and path
# TODO: optimize this part after driver can expose the FW path to userspace via debugfs
if is_ipc4; then
firmware_name=dsp_basefw.bin
fw_mod_para=/sys/module/snd_sof_pci/parameters/fw_path
if [ -s "$fw_mod_para" ]; then
firmware_path=$(cat $fw_mod_para)
else
# # FIXME: the kernel driver should give us the FW path
# https://github.com/thesofproject/linux/issues/3867
die "Failed to get the IPC4 FW path."
fi
else # for IPC3
platform=$(sof-dump-status.py -p)
firmware_name=sof-$platform.ri
firmware_path=$(sof-dump-status.py -P)
fi
local firmware_path znum

znum=$(strings "/lib/firmware/$firmware_path/$firmware_name" | grep -c -i zephyr)
firmware_path=$(journalctl_cmd | grep "request_firmware" | awk -F ' ' '{print $(NF-1)}')
znum=$(strings "/lib/firmware/$firmware_path" | grep -c -i zephyr)
test "$znum" -gt 10
}

Expand Down

0 comments on commit 4de0925

Please sign in to comment.