]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
common: Use sysfs instead of modinfo for _have_module_param()
authorLogan Gunthorpe <logang@deltatee.com>
Wed, 17 Jul 2019 17:12:58 +0000 (11:12 -0600)
committerOmar Sandoval <osandov@osandov.com>
Mon, 29 Jul 2019 17:13:14 +0000 (10:13 -0700)
Using modinfo fails if the given module is built-in.

Instead, if the module is already in the kernel, check for the
parameter in sysfs.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
common/rc

index a487cc69026c903a82e92a56bc4c5f338f6e1176..41aee3aaa735d3572a5b8f4d9cb0155208757438 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -48,6 +48,12 @@ _have_modules() {
 }
 
 _have_module_param() {
+       if [ -d "/sys/module/$1" ]; then
+               if [ -e "/sys/module/$1/parameters/$2" ]; then
+                       return 0
+               fi
+       fi
+
        if ! modinfo -F parm -0 "$1" | grep -q -z "^$2:"; then
                SKIP_REASON="$1 module does not have parameter $2"
                return 1