liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit e8d5e4c78844d1bf6e6ea096b03e4b422265f0df
parent b65a405a4349fd2731fad3eccb4c513662cdeb63
Author: Daniel Barlow <dan@telent.net>
Date:   Tue,  7 Mar 2023 21:32:21 +0000

move regulatory.db to wlan module

Diffstat:
Mdevices/gl-ar750/default.nix | 2--
Mdevices/gl-mt300a/default.nix | 4++--
Mmodules/wlan.nix | 17++++++++++++++++-
3 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/devices/gl-ar750/default.nix b/devices/gl-ar750/default.nix @@ -58,7 +58,6 @@ phases = ["installPhase"]; installPhase = '' mkdir -p $out/ath10k/QCA9887/hw1.0/ - cp ${pkgs.wireless-regdb}/lib/firmware/regulatory.db* $out/ blobdir=${firmwareBlobs}/QCA9887/hw1.0 cp $blobdir/10.2.4-1.0/firmware-5.bin_10.2.4-1.0-00047 $out/ath10k/QCA9887/hw1.0/firmware-5.bin cp $blobdir/board.bin $out/ath10k/QCA9887/hw1.0/ @@ -120,7 +119,6 @@ filesystem = dir { lib = dir { firmware = dir { - "regulatory.db" = symlink "${firmware}/regulatory.db"; ath10k = dir { QCA9887 = symlink "${firmware}/ath10k/QCA9887"; "cal-pci-0000:00:00.0.bin" = symlink "${ath10k_cal_data}/.outputs/data"; diff --git a/devices/gl-mt300a/default.nix b/devices/gl-mt300a/default.nix @@ -13,8 +13,8 @@ description = '' WiFi on this device is provided by the rt2800soc module. It - expects firmware to be present in the "???" MTD partition, so - - assuming we want to use the wireless - we need to build MTD + expects firmware to be present in the "factory" MTD partition, so + - assuming we want to use the wireless - we need to build MTD support into the kernel even if we're using TFTP root ''; diff --git a/modules/wlan.nix b/modules/wlan.nix @@ -2,9 +2,24 @@ let inherit (lib) mkEnableOption mkOption types isDerivation hasAttr ; inherit (pkgs.pseudofile) dir symlink; - inherit (pkgs) busybox; + inherit (pkgs) stdenv busybox wireless-regdb; + regulatory = stdenv.mkDerivation { + name = "regulatory.db"; + phases = ["installPhase"]; + installPhase = '' + mkdir -p $out + cp ${wireless-regdb}/lib/firmware/regulatory.db $out/ + ''; + }; in { config = { + filesystem = dir { + lib = dir { + firmware = dir { + "regulatory.db" = symlink "${regulatory}/regulatory.db"; + }; + }; + }; kernel = rec { config = { # Most of this is necessary infra to allow wireless stack/