summary refs log tree commit diff
path: root/pkgs/os-specific/linux/firmware
diff options
context:
space:
mode:
authorrnhmjoj <rnhmjoj@inventati.org>2023-06-23 14:21:02 +0200
committerrnhmjoj <rnhmjoj@inventati.org>2023-06-23 14:39:07 +0200
commitcc065fe18a566677be6b2b45954be0b4cef33c61 (patch)
treeafbb7672ce5b4b2d77924fee08f3cf9b0efd0c2e /pkgs/os-specific/linux/firmware
parent4ae814f720030aab86dfd6f4372a57da54da8427 (diff)
downloadnixpkgs-cc065fe18a566677be6b2b45954be0b4cef33c61.tar
nixpkgs-cc065fe18a566677be6b2b45954be0b4cef33c61.tar.gz
nixpkgs-cc065fe18a566677be6b2b45954be0b4cef33c61.tar.bz2
nixpkgs-cc065fe18a566677be6b2b45954be0b4cef33c61.tar.lz
nixpkgs-cc065fe18a566677be6b2b45954be0b4cef33c61.tar.xz
nixpkgs-cc065fe18a566677be6b2b45954be0b4cef33c61.tar.zst
nixpkgs-cc065fe18a566677be6b2b45954be0b4cef33c61.zip
ath9k-htc-blobless-firmware: use name expected by the kernel
The kernel asks for the firmware with the version string in the filename[1], so
it's not easy to load the "blobs" from this package.
With this change you can just add the package with a `lib.hiPrio` to
`hardware.firmware` and it will be loaded correctly.

Note: I used symlinks instead of simply renaming the files in order to not
introduce a breaking change.
Diffstat (limited to 'pkgs/os-specific/linux/firmware')
-rw-r--r--pkgs/os-specific/linux/firmware/ath9k/default.nix11
1 files changed, 9 insertions, 2 deletions
diff --git a/pkgs/os-specific/linux/firmware/ath9k/default.nix b/pkgs/os-specific/linux/firmware/ath9k/default.nix
index 28da48c31cd..ab342d68c13 100644
--- a/pkgs/os-specific/linux/firmware/ath9k/default.nix
+++ b/pkgs/os-specific/linux/firmware/ath9k/default.nix
@@ -9,9 +9,13 @@
 , enableUnstable ? false
 }:
 
+let
+  stableVersion = "1.4.0";
+in
+
 stdenv.mkDerivation (finalAttrs: {
   pname = "ath9k-htc-blobless-firmware";
-  version = if enableUnstable then "unstable-2022-05-22" else "1.4.0";
+  version = if enableUnstable then "unstable-2022-05-22" else stableVersion;
 
   src = fetchFromGitHub ({
     owner = "qca";
@@ -61,7 +65,10 @@ stdenv.mkDerivation (finalAttrs: {
 
   installPhase = ''
     runHook preInstall
-    install -Dt $out/lib/firmware/ath9k_htc/ target_firmware/*.fw
+    install -Dt "$out/lib/firmware/ath9k_htc/" target_firmware/*.fw
+    # make symlinks so that firmware will be automatically found
+    ln -s htc_7010.fw "$out/lib/firmware/ath9k_htc/htc_7010-${stableVersion}.fw"
+    ln -s htc_9271.fw "$out/lib/firmware/ath9k_htc/htc_9271-${stableVersion}.fw"
     runHook postInstall
   '';