Message ID | 20220819093920.84992-2-shinichiro.kawasaki@wdc.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | fix module check issues | expand |
On 8/19/22 02:39, Shin'ichiro Kawasaki wrote: > The helper function _have_driver() checks availability of the specified > driver, or module, regardless whether it is loadable or not. When the > driver is loadable, it loads the module for checking, but does not > unload it. This makes following test cases fail. Reviewed-by: Bart Van Assche <bvanassche@acm.org>
diff --git a/common/rc b/common/rc index 01df6fa..5b34c60 100644 --- a/common/rc +++ b/common/rc @@ -30,9 +30,10 @@ _have_root() { _have_driver() { - local modname="${1/-/_}" + local modname="${1//-/_}" - if [ ! -d "/sys/module/${modname}" ] && ! modprobe -q "${modname}"; then + if [ ! -d "/sys/module/${modname}" ] && + ! modprobe -qn "${modname}"; then SKIP_REASONS+=("driver ${modname} is not available") return 1 fi