[PATCH] tests: hwsim: allow configuring MODULEDIR

Johannes Berg johannes at sipsolutions.net
Mon Jun 13 02:07:07 PDT 2022


From: Johannes Berg <johannes.berg at intel.com>

It can be useful to configure a different module directory,
so you don't need to install the kernel modules in the host
/lib/modules/ location. Allow configuring it in the config
file.

Signed-off-by: Johannes Berg <johannes.berg at intel.com>
---
 tests/hwsim/vm/inside.sh | 4 ++++
 tests/hwsim/vm/vm-run.sh | 1 +
 2 files changed, 5 insertions(+)

diff --git a/tests/hwsim/vm/inside.sh b/tests/hwsim/vm/inside.sh
index 3fe37a6fddb5..9c6a9572b8d8 100755
--- a/tests/hwsim/vm/inside.sh
+++ b/tests/hwsim/vm/inside.sh
@@ -45,6 +45,10 @@ fi
 
 mount --bind "$TESTDIR/vm/regdb/" /lib/firmware
 
+if [ "$MODULEDIR" != "" ] ; then
+	mount --bind $MODULEDIR /lib/modules
+fi
+
 # reload reg if (and only if) cfg80211.ko is already loaded
 iw reg reload || true
 
diff --git a/tests/hwsim/vm/vm-run.sh b/tests/hwsim/vm/vm-run.sh
index 7a0273ac4b06..defea43e8723 100755
--- a/tests/hwsim/vm/vm-run.sh
+++ b/tests/hwsim/vm/vm-run.sh
@@ -150,6 +150,7 @@ A+="mac80211_hwsim.dyndbg=+p "
 A+="init=$CMD "
 A+="testdir=$TESTDIR "
 A+="timewarp=$TIMEWARP "
+A+="MODULEDIR=$MODULEDIR "
 A+="TELNET=$TELNET_ARG "
 A+="EPATH=$EPATH "
 A+="ARGS=$argsfile "
-- 
2.36.1




More information about the Hostap mailing list