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 (mailing list archive)
State New, archived
Headers show
Series support built-in scsi_debug | 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(+)

Comments

Johannes Thumshirn May 23, 2023, 9:17 a.m. UTC | #1
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
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