diff options
author | K900 <me@0upti.me> | 2022-08-20 22:42:13 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-20 22:42:13 +0300 |
commit | 175f140b8b57d784dccc4969c346dd31154e5e37 (patch) | |
tree | 95cf4b4ba75f9924ca953474cc0fbdd55d45bdf4 /nixos/modules/hardware | |
parent | 303121f35f8812983a9f72406ded883294e9948a (diff) | |
parent | 5f45f2506d196a5bc969bd7da9ed6511a4764854 (diff) |
Merge pull request #187252 from K900/kernel-sanity
linux: assorted build cleanups
Diffstat (limited to 'nixos/modules/hardware')
-rw-r--r-- | nixos/modules/hardware/device-tree.nix | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/nixos/modules/hardware/device-tree.nix b/nixos/modules/hardware/device-tree.nix index 55852776220d3..4ce3a3e6c6af3 100644 --- a/nixos/modules/hardware/device-tree.nix +++ b/nixos/modules/hardware/device-tree.nix @@ -56,23 +56,6 @@ let }; }; - # this requires kernel package - dtbsWithSymbols = pkgs.stdenv.mkDerivation { - name = "dtbs-with-symbols"; - inherit (cfg.kernelPackage) src nativeBuildInputs depsBuildBuild; - patches = map (patch: patch.patch) cfg.kernelPackage.kernelPatches; - buildPhase = '' - patchShebangs scripts/* - substituteInPlace scripts/Makefile.lib \ - --replace 'DTC_FLAGS += $(DTC_FLAGS_$(basetarget))' 'DTC_FLAGS += $(DTC_FLAGS_$(basetarget)) -@' - make ${pkgs.stdenv.hostPlatform.linux-kernel.baseConfig} ARCH="${pkgs.stdenv.hostPlatform.linuxArch}" - make dtbs ARCH="${pkgs.stdenv.hostPlatform.linuxArch}" - ''; - installPhase = '' - make dtbs_install INSTALL_DTBS_PATH=$out/dtbs ARCH="${pkgs.stdenv.hostPlatform.linuxArch}" - ''; - }; - filterDTBs = src: if isNull cfg.filter then "${src}/dtbs" else @@ -83,6 +66,8 @@ let | xargs -0 cp -v --no-preserve=mode --target-directory $out --parents ''; + filteredDTBs = filterDTBs cfg.kernelPackage; + # Compile single Device Tree overlay source # file (.dts) into its compiled variant (.dtbo) compileDTS = name: f: pkgs.callPackage({ stdenv, dtc }: stdenv.mkDerivation { @@ -197,7 +182,7 @@ in }; hardware.deviceTree.package = if (cfg.overlays != []) - then pkgs.deviceTree.applyOverlays (filterDTBs dtbsWithSymbols) (withDTBOs cfg.overlays) - else (filterDTBs cfg.kernelPackage); + then pkgs.deviceTree.applyOverlays filteredDTBs (withDTBOs cfg.overlays) + else filteredDTBs; }; } |