Site Tools


Sidebar

Work

Projects Travel Singapore Socials (External)

projects:software:openwrt_custom_wireless-regdb

This is an old revision of the document!


OpenWrt Custom wireless-regdb

Motivation

As wireless-regdb has no maintainer at time of writing, it's unlikely that my Wi-Fi 6E regulatory updates for Singapore will propagate to Linux distributions anytime soon.

Thankfully, it is pretty straightforward to set up a functional Wi-Fi 6E network, as only the Access Point requires a regulatory update, while stations (clients) do not. This is because the regulatory framework restricts the initiation of radiation (beacons), while clients are free to connect to any frequency the hardware is able to receive beacons on (even if it cannot initiate radiation on that frequency).

Making a Custom wireless-regdb

Building a Custom wireless-regdb Package

The proper way to do this would be to create a new OpenWrt package with a different name, e.g. wireless-regdb-sg6e that provides wireless-regdb, but we just want quick and dirty hack for Wi-Fi 6E enablement while waiting for wireless-regdb's next release, we can just edit the existing wireless-regdb Makefile to pull from our Git repo with the changes we want.

  1. Clone OpenWrt source (adjust branch as needed, depending on what you're running):
    git clone --depth=1 --branch v23.05.0 https://github.com/openwrt/openwrt.git
  2. Choose the target architecture and device of your AP (the built package is actually generic/noarch, but this is required anyway):
    make menuconfig
  3. Build tools and toolchain (this will take ~30 min, depending on your CPU performance):
    make tools/install
    make toolchain/install
  4. Download the snippet below to your cloned OpenWrt repo and run git apply wireless-regdb-sg.patch (or just patch it by hand):
    wireless-regdb-sg.patch
    diff --git a/package/firmware/wireless-regdb/Makefile b/package/firmware/wireless-regdb/Makefile
    index dfff35f..2430532 100644
    --- a/package/firmware/wireless-regdb/Makefile
    +++ b/package/firmware/wireless-regdb/Makefile
    @@ -1,12 +1,13 @@
     include $(TOPDIR)/rules.mk
     
     PKG_NAME:=wireless-regdb
    -PKG_VERSION:=2023.09.01
     PKG_RELEASE:=1
     
    -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
    -PKG_SOURCE_URL:=@KERNEL/software/network/wireless-regdb/
    -PKG_HASH:=26d4c2a727cc59239b84735aad856b7c7d0b04e30aa5c235c4f7f47f5f053491
    +PKG_SOURCE_URL:=https://github.com/ndoo/wireless-regdb
    +PKG_SOURCE_PROTO:=git
    +PKG_SOURCE_DATE:=2023-09-03
    +PKG_SOURCE_VERSION:=ab7ed5625f21f9e9627eb71b213ea5098f25582a
    +PKG_MIRROR_HASH:=SKIP
     
     PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
     


    To use your own wireless-regdb repo, change the following variables:

    • PKG_SOURCE_URL - Git repo URL
    • PKG_SOURCE_VERSION - Git commit hash
    • PKG_SOURCE_DATE - Git commit date
  5. Download the custom wireless-regdb:
    make package/firmware/wireless-regdb/download V=s
  6. Fix the hash in the makefile:
    make package/firmware/wireless-regdb/check V=s FIXUP=1
  7. Build wireless-regdb:
    make package/firmware/wireless-regdb/compile
  8. Locate your freshly baked package:
    $ ls bin/packages/*/base/wireless-regdb*.ipk
    bin/packages/powerpc_8548/base/wireless-regdb_2023-09-03-ab7ed562-1_all.ipk

Installing your Custom wireless-regdb Package

  1. Copy the package to your AP:
    scp -O bin/packages/*/base/wireless-regdb*.ipk root@YOUR_ROUTER_IP:/tmp/
  2. Install the package on your AP:
    ssh root@YOUR_ROUTER_IP
    opkg install /tmp/wireless-regdb*.ipk
  3. Reboot your AP:
    ssh root@YOUR_ROUTER_IP
    reboot
  4. Try out your updated regulatory rules!

Notes

  • I tested this with an AsiaRF AW7916-NPD, which is relatively well-supported in OpenWrt with packages kmod-mt7915e kmod-mt7916-firmware
projects/software/openwrt_custom_wireless-regdb.1698674708.txt.gz · Last modified: 2023/10/30 14:05 by Andrew Yong