diff mbox series

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

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

Commit Message

Shin'ichiro Kawasaki April 17, 2023, 12:47 p.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>
---
 common/rc | 1 +
 1 file changed, 1 insertion(+)

Comments

Chaitanya Kulkarni April 18, 2023, 8:09 p.m. UTC | #1
On 4/17/23 05:47, Shin'ichiro Kawasaki wrote:
> 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>
> ---
>

Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck
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