]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Reload correct regdb if possible/needed
authorJohannes Berg <johannes.berg@intel.com>
Wed, 11 May 2022 13:09:06 +0000 (15:09 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 16 Sep 2022 18:13:20 +0000 (21:13 +0300)
If cfg80211 is built into the kernel, then it may/will have
loaded the regdb before we mount our own /lib/firmware. This
may result in using the wrong regulatory data. Fix this by
using iw to reload the regdb after mounting it.

Fixes: a29c2399a77a ("tests: Add regulatory database to VMs")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
tests/hwsim/vm/inside.sh

index c46c524775394fbb5e93cc3f15f4131c61cdc8a5..3fe37a6fddb56f088686b040b2efe2e4ea606ba1 100755 (executable)
@@ -45,6 +45,9 @@ fi
 
 mount --bind "$TESTDIR/vm/regdb/" /lib/firmware
 
+# reload reg if (and only if) cfg80211.ko is already loaded
+iw reg reload || true
+
 # create /dev entries we need
 mknod -m 660 /dev/ttyS0 c 4 64
 mknod -m 666 /dev/ptmx c 5 2