diff mbox series

[blktests,v2,1/6] common/rc: skip module file check if modules path does not exist

Message ID 20230425114745.376322-2-shinichiro@fastmail.com
State New
Headers show
Series [blktests,v2,1/6] common/rc: skip module file check if modules path does not exist | expand

Commit Message

Shin'ichiro Kawasaki April 25, 2023, 11:47 a.m. UTC
From: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>

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.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
---
 common/rc | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/common/rc b/common/rc
index af4c0b1..f67b434 100644
--- 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