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.
This commit is contained in:
rnhmjoj 2023-06-23 14:21:02 +02:00
parent 4ae814f720
commit cc065fe18a
No known key found for this signature in database
GPG key ID: BFBAF4C975F76450

View file

@ -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
'';