From a74f994c382aacb4a32ffc9ac1a5a5ba5302b8d8 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Mon, 22 Jul 2024 15:18:49 -0700 Subject: [PATCH] case-lib/lib.sh: switch is_firmware_file_zephyr() to fw_relfilepath() Faster and more flexible. Signed-off-by: Marc Herbert --- case-lib/lib.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/case-lib/lib.sh b/case-lib/lib.sh index 184ea617..94886bbc 100644 --- a/case-lib/lib.sh +++ b/case-lib/lib.sh @@ -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 @@ -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