diff mbox series

tests: reload correct regdb if possible/needed

Message ID 20220511150906.4051b1148844.I524d3475620985b77c7e5d01b4e882dd69540d65@changeid
State Accepted
Headers show
Series tests: reload correct regdb if possible/needed | expand

Commit Message

Johannes Berg May 11, 2022, 1:09 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

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 | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jouni Malinen Sept. 16, 2022, 7:18 p.m. UTC | #1
On Wed, May 11, 2022 at 03:09:06PM +0200, Johannes Berg wrote:
> 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.

Thanks, applied.
diff mbox series

Patch

diff --git a/tests/hwsim/vm/inside.sh b/tests/hwsim/vm/inside.sh
index c46c52477539..3fe37a6fddb5 100755
--- a/tests/hwsim/vm/inside.sh
+++ b/tests/hwsim/vm/inside.sh
@@ -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