summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/firmware/fw_lib.sh
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-06-11 15:26:26 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-18 10:11:22 +0300
commit108ae07c50363d0768a4c2bb7454a717fd36af52 (patch)
tree641771fdfd6e8b67498c047871e4fa595ceb6f19 /tools/testing/selftests/firmware/fw_lib.sh
parent82fd7a8142a10b8eb41313074b3859d82c0857dc (diff)
downloadlinux-108ae07c50363d0768a4c2bb7454a717fd36af52.tar.xz
selftests: firmware: Add compressed firmware tests
This patch adds the test cases for checking compressed firmware load. Two more cases are added to fw_filesystem.sh: - Both a plain file and an xz file are present, and load the former - Only an xz file is present, and load without '.xz' suffix The tests are enabled only when CONFIG_FW_LOADER_COMPRESS is enabled and xz program is installed. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/firmware/fw_lib.sh')
-rwxr-xr-xtools/testing/selftests/firmware/fw_lib.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/testing/selftests/firmware/fw_lib.sh b/tools/testing/selftests/firmware/fw_lib.sh
index 1cbb12e284a6..f236cc295450 100755
--- a/tools/testing/selftests/firmware/fw_lib.sh
+++ b/tools/testing/selftests/firmware/fw_lib.sh
@@ -50,6 +50,7 @@ check_setup()
{
HAS_FW_LOADER_USER_HELPER="$(kconfig_has CONFIG_FW_LOADER_USER_HELPER=y)"
HAS_FW_LOADER_USER_HELPER_FALLBACK="$(kconfig_has CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y)"
+ HAS_FW_LOADER_COMPRESS="$(kconfig_has CONFIG_FW_LOADER_COMPRESS=y)"
PROC_FW_IGNORE_SYSFS_FALLBACK="0"
PROC_FW_FORCE_SYSFS_FALLBACK="0"
@@ -84,6 +85,12 @@ check_setup()
fi
OLD_FWPATH="$(cat /sys/module/firmware_class/parameters/path)"
+
+ if [ "$HAS_FW_LOADER_COMPRESS" = "yes" ]; then
+ if ! which xz 2> /dev/null > /dev/null; then
+ HAS_FW_LOADER_COMPRESS=""
+ fi
+ fi
}
verify_reqs()