diff options
author | Luis R. Rodriguez <mcgrof@kernel.org> | 2018-03-10 06:14:43 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-03-14 19:49:24 +0100 |
commit | ef557787f4f04b62d7a50101154ffe1614b88a7a (patch) | |
tree | 6447e73fd7016ba57192346d926b835b9f9e64b7 /tools/testing/selftests/firmware/fw_fallback.sh | |
parent | 29a1c00ce1df8a75bea6e6a86876a10c8dcc2c59 (diff) | |
download | op-kernel-dev-ef557787f4f04b62d7a50101154ffe1614b88a7a.zip op-kernel-dev-ef557787f4f04b62d7a50101154ffe1614b88a7a.tar.gz |
test_firmware: enable custom fallback testing on limited kernel configs
When a kernel is not built with:
CONFIG_HAS_FW_LOADER_USER_HELPER_FALLBACK=y
We don't currently enable testing fw_fallback.sh. For kernels that
still enable the fallback mechanism, its possible to use the async
request firmware API call request_firmware_nowait() using the custom
interface to use the fallback mechanism, so we should be able to test
this but we currently cannot.
We can enable testing without CONFIG_HAS_FW_LOADER_USER_HELPER_FALLBACK=y
by relying on /proc/config.gz (CONFIG_IKCONFIG_PROC), if present. If you
don't have this we'll have no option but to rely on old heuristics for now.
We stuff the new kconfig_has() helper into our shared library as we'll
later expando on its use elsewhere.
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/firmware/fw_fallback.sh')
-rwxr-xr-x | tools/testing/selftests/firmware/fw_fallback.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/testing/selftests/firmware/fw_fallback.sh b/tools/testing/selftests/firmware/fw_fallback.sh index 755147a..bf85005 100755 --- a/tools/testing/selftests/firmware/fw_fallback.sh +++ b/tools/testing/selftests/firmware/fw_fallback.sh @@ -15,6 +15,7 @@ check_mods # These days no one enables CONFIG_FW_LOADER_USER_HELPER so check for that # as an indicator for CONFIG_FW_LOADER_USER_HELPER. HAS_FW_LOADER_USER_HELPER=$(if [ -d /sys/class/firmware/ ]; then echo yes; else echo no; fi) +HAS_FW_LOADER_USER_HELPER_FALLBACK=$(kconfig_has CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y) if [ "$HAS_FW_LOADER_USER_HELPER" = "yes" ]; then OLD_TIMEOUT=$(cat /sys/class/firmware/timeout) @@ -287,7 +288,10 @@ run_sysfs_custom_load_tests() fi } -run_sysfs_main_tests +if [ "$HAS_FW_LOADER_USER_HELPER_FALLBACK" = "yes" ]; then + run_sysfs_main_tests +fi + run_sysfs_custom_load_tests exit 0 |