pd-mapper is now in-kernel

This commit is contained in:
Adam Stephens 2024-07-29 22:33:01 -04:00
parent e6d95a3a60
commit 8e16dc9e6a
No known key found for this signature in database
6 changed files with 1 additions and 121 deletions

View file

@ -41,27 +41,11 @@ in
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [
pkgs.efibootmgr
(x13sPackages.uncompressed-firmware.override {
firmwareFilesList = lib.flatten options.hardware.firmware.definitions;
})
];
environment.pathsToLink = [ "/share/uncompressed-firmware" ];
environment.systemPackages = [ pkgs.efibootmgr ];
hardware.enableAllFirmware = true;
hardware.firmware = [ x13sPackages."x13s/extra-firmware" ];
systemd.services.pd-mapper = {
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${lib.getExe x13sPackages.pd-mapper}";
Restart = "always";
};
};
boot = {
loader.efi.canTouchEfiVariables = true;
loader.systemd-boot.enable = lib.mkDefault true;

View file

@ -21,10 +21,5 @@ rec {
defconfig = "johan_defconfig";
};
pd-mapper = pkgs.callPackage ./pd-mapper { inherit qrtr; };
qrtr = pkgs.callPackage ./qrtr { };
"x13s/extra-firmware" = pkgs.callPackage ./extra-firmware.nix { };
uncompressed-firmware = pkgs.callPackage ./uncompressed-firmware.nix { };
}

View file

@ -1,36 +0,0 @@
{
stdenv,
lib,
fetchFromGitHub,
qrtr,
xz,
}:
stdenv.mkDerivation {
pname = "pd-mapper";
version = "unstable-2023-09-01";
buildInputs = [
qrtr
xz
];
src = fetchFromGitHub {
owner = "andersson";
repo = "pd-mapper";
rev = "10997ba7c43a3787a40b6b1b161408033e716374";
hash = "sha256-qGrYNoPCxtdpTdbkSmB39+6/pSXml96Aul8b9opF9Lc=";
};
patches = [ ./pd-mapper-firmware-path.diff ];
installFlags = [ "prefix=$(out)" ];
meta = with lib; {
description = "Qualcomm PD mapper";
homepage = "https://github.com/andersson/pd-mapper";
license = licenses.bsd3;
mainProgram = "pd-mapper";
platforms = platforms.aarch64;
};
}

View file

@ -1,13 +0,0 @@
diff --git a/pd-mapper.c b/pd-mapper.c
index 65c4b80..669d9a0 100644
--- a/pd-mapper.c
+++ 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/sw/share/uncompressed-firmware/"
#else
#define FIRMWARE_BASE "/vendor/firmware/"
#endif

View file

@ -1,26 +0,0 @@
{
stdenv,
lib,
fetchFromGitHub,
}:
stdenv.mkDerivation {
pname = "qrtr";
version = "unstable-2023-01-17";
src = fetchFromGitHub {
owner = "andersson";
repo = "qrtr";
rev = "d0d471c96e7d112fac6f48bd11f9e8ce209c04d2";
hash = "sha256-KF0gCBRw3BDJdK1s+dYhHkokVTHwRFO58ho0IwHPehc=";
};
installFlags = [ "prefix=$(out)" ];
meta = with lib; {
description = "QMI IDL compiler";
homepage = "https://github.com/andersson/qrtr";
license = licenses.bsd3;
platforms = platforms.aarch64;
};
}

View file

@ -1,24 +0,0 @@
{
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
)
''