diff --git a/ap/80-regdomain.rules b/ap/80-regdomain.rules new file mode 100644 index 0000000..080dc39 --- /dev/null +++ b/ap/80-regdomain.rules @@ -0,0 +1,3 @@ +# Set wireless regulatory domain on boot +# Trigger when regulatory device appears +SUBSYSTEM=="regulatory", ACTION=="change", RUN+="/usr/sbin/iw reg set CA" diff --git a/ap/hostapd-regdomain.conf b/ap/hostapd-regdomain.conf new file mode 100644 index 0000000..5ffd2d5 --- /dev/null +++ b/ap/hostapd-regdomain.conf @@ -0,0 +1,4 @@ +# Ensure regdomain.service runs before hostapd +[Unit] +After=regdomain.service +Wants=regdomain.service diff --git a/ap/regdomain.service b/ap/regdomain.service index f9de904..638a543 100644 --- a/ap/regdomain.service +++ b/ap/regdomain.service @@ -1,9 +1,10 @@ [Unit] Description=Set wireless regulatory domain -After=network-pre.target -Before=NetworkManager.service +After=network-pre.target sysinit.target +Before=hostapd.service hostapd-2g.service NetworkManager.service [Service] Type=oneshot +RemainAfterExit=yes ExecStart=/usr/sbin/iw reg set CA [Install] WantedBy=multi-user.target diff --git a/deploy.sh b/deploy.sh index c3d676f..c0b42f1 100755 --- a/deploy.sh +++ b/deploy.sh @@ -116,9 +116,11 @@ fi echo "== access point ==" install_rendered ap/hostapd.conf /etc/hostapd/hostapd.conf install -D -m0644 ap/hostapd-restart.conf /etc/systemd/system/hostapd.service.d/restart.conf +install -D -m0644 ap/hostapd-regdomain.conf /etc/systemd/system/hostapd.service.d/regdomain.conf install -D -m0644 ap/default-hostapd /etc/default/hostapd install_rendered ap/hostapd-2g.conf /etc/hostapd/hostapd-2g.conf install_rendered ap/hostapd-2g.service /etc/systemd/system/hostapd-2g.service +install -D -m0644 ap/hostapd-regdomain.conf /etc/systemd/system/hostapd-2g.service.d/regdomain.conf install_rendered ap/11-van-ap-2g.network /etc/systemd/network/11-van-ap-2g.network install -D -m0644 ap/van-ap-watchdog-2g.service /etc/systemd/system/van-ap-watchdog-2g.service install -D -m0755 ap/van-ap-watchdog /usr/local/sbin/van-ap-watchdog @@ -139,6 +141,7 @@ install_rendered ap/van-ap-unmanaged.conf /etc/NetworkManager/conf.d/van-ap-un ln -sfn /dev/null /etc/systemd/network/zzzz-dracut-default.network install -D -m0644 ap/nftables.conf /etc/nftables.conf install -D -m0644 ap/regdomain.service /etc/systemd/system/regdomain.service +install -D -m0644 ap/80-regdomain.rules /etc/udev/rules.d/80-regdomain.rules install -D -m0644 ap/rtw89.conf /etc/modprobe.d/rtw89.conf install -D -m0644 ap/99-van-router.conf /etc/sysctl.d/99-van-router.conf