mirror of
https://codeberg.org/mart-w/nixos-x13s.git
synced 2024-11-08 17:14:48 +01:00
fix: pd-mapper can't read zstd firmware files
nixos unstable and 24.05 switched to zstd compression for firmware files. Roll back to the previous setup of creating a package of the qcom firmware uncompressed, and patching pd-mapper. closes #14
This commit is contained in:
parent
3e183c4b98
commit
3a002c5a64
10
module.nix
10
module.nix
|
@ -2,6 +2,7 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
options,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
@ -40,7 +41,14 @@ in
|
|||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [ pkgs.efibootmgr ];
|
||||
environment.systemPackages = [
|
||||
pkgs.efibootmgr
|
||||
(x13sPackages.uncompressed-firmware.override {
|
||||
firmwareFilesList = lib.flatten options.hardware.firmware.definitions;
|
||||
})
|
||||
];
|
||||
|
||||
environment.pathsToLink = [ "/share/uncompressed-firmware" ];
|
||||
|
||||
hardware.enableAllFirmware = true;
|
||||
hardware.firmware = [ x13sPackages."x13s/extra-firmware" ];
|
||||
|
|
|
@ -27,4 +27,6 @@ rec {
|
|||
qrtr = pkgs.callPackage ./qrtr { };
|
||||
|
||||
"x13s/extra-firmware" = pkgs.callPackage ./extra-firmware.nix { };
|
||||
|
||||
uncompressed-firmware = pkgs.callPackage ./uncompressed-firmware.nix { };
|
||||
}
|
||||
|
|
|
@ -4,10 +4,10 @@ index 65c4b80..669d9a0 100644
|
|||
+++ b/pd-mapper.c
|
||||
@@ -194,7 +194,7 @@ static int pd_load_map(const char *file)
|
||||
}
|
||||
|
||||
|
||||
#ifndef ANDROID
|
||||
-#define FIRMWARE_BASE "/lib/firmware/"
|
||||
+#define FIRMWARE_BASE "/run/current-system/firmware/"
|
||||
+#define FIRMWARE_BASE "/run/current-system/sw/share/uncompressed-firmware/"
|
||||
#else
|
||||
#define FIRMWARE_BASE "/vendor/firmware/"
|
||||
#endif
|
||||
|
|
24
packages/uncompressed-firmware.nix
Normal file
24
packages/uncompressed-firmware.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
runCommand,
|
||||
buildEnv,
|
||||
firmwareFilesList ? [ ],
|
||||
}:
|
||||
runCommand "qcom-modem-uncompressed-firmware-share"
|
||||
{
|
||||
firmwareFiles = buildEnv {
|
||||
name = "qcom-modem-uncompressed-firmware";
|
||||
paths = firmwareFilesList;
|
||||
pathsToLink = [
|
||||
"/lib/firmware/rmtfs"
|
||||
"/lib/firmware/qcom"
|
||||
];
|
||||
};
|
||||
}
|
||||
''
|
||||
PS4=" $ "
|
||||
(
|
||||
set -x
|
||||
mkdir -p $out/share/
|
||||
ln -s $firmwareFiles/lib/firmware/ $out/share/uncompressed-firmware
|
||||
)
|
||||
''
|
Loading…
Reference in a new issue