From 8e16dc9e6a71ff3cfe5050e52875cd3a365e719b Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Mon, 29 Jul 2024 22:33:01 -0400 Subject: [PATCH] pd-mapper is now in-kernel --- module.nix | 18 +--------- packages/default.nix | 5 --- packages/pd-mapper/default.nix | 36 ------------------- .../pd-mapper/pd-mapper-firmware-path.diff | 13 ------- packages/qrtr/default.nix | 26 -------------- packages/uncompressed-firmware.nix | 24 ------------- 6 files changed, 1 insertion(+), 121 deletions(-) delete mode 100644 packages/pd-mapper/default.nix delete mode 100644 packages/pd-mapper/pd-mapper-firmware-path.diff delete mode 100644 packages/qrtr/default.nix delete mode 100644 packages/uncompressed-firmware.nix diff --git a/module.nix b/module.nix index 314c8b5..1afe684 100644 --- a/module.nix +++ b/module.nix @@ -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; diff --git a/packages/default.nix b/packages/default.nix index af6821a..9e09493 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -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 { }; } diff --git a/packages/pd-mapper/default.nix b/packages/pd-mapper/default.nix deleted file mode 100644 index d0f4fde..0000000 --- a/packages/pd-mapper/default.nix +++ /dev/null @@ -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; - }; -} diff --git a/packages/pd-mapper/pd-mapper-firmware-path.diff b/packages/pd-mapper/pd-mapper-firmware-path.diff deleted file mode 100644 index 8e58e4d..0000000 --- a/packages/pd-mapper/pd-mapper-firmware-path.diff +++ /dev/null @@ -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 diff --git a/packages/qrtr/default.nix b/packages/qrtr/default.nix deleted file mode 100644 index 7dc6e44..0000000 --- a/packages/qrtr/default.nix +++ /dev/null @@ -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; - }; -} diff --git a/packages/uncompressed-firmware.nix b/packages/uncompressed-firmware.nix deleted file mode 100644 index 8fe5d3a..0000000 --- a/packages/uncompressed-firmware.nix +++ /dev/null @@ -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 - ) - ''