]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
common/rc: skip module file check if modules path does not exist
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tue, 25 Apr 2023 11:47:40 +0000 (20:47 +0900)
committerShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Mon, 22 May 2023 06:42:59 +0000 (15:42 +0900)
When all of the kernel modules are built-in, /lib/modules/*/kernel path
may not exist. In this case, check for the path results in failure. Skip
the check when the path does not exist.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
common/rc

index 21075767080f4f7a0ba45c9ab4457b8a0730086c..0488feb7c87061e67e1f51f05781e5617fa79516 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -36,6 +36,7 @@ _module_file_exists()
        local -i count
 
        libpath="/lib/modules/$(uname -r)/kernel"
+       [[ ! -d $libpath ]] && return 1
        count=$(find "$libpath" -name "$ko_underscore*" -o \
                     -name "$ko_hyphen*" | wc -l)
        ((count)) && return 0