nixos/hardware/device-tree: use symbols from the exact kernel package
This commit is contained in:
parent
846d001fb8
commit
907b497d7e
@ -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;
|
||||
};
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ let
|
||||
kernelConf.target
|
||||
"vmlinux" # for "perf" and things like that
|
||||
] ++ optional isModular "modules"
|
||||
++ optional buildDTBs "dtbs"
|
||||
++ optionals buildDTBs ["dtbs" "DTC_FLAGS=-@"]
|
||||
++ extraMakeFlags;
|
||||
|
||||
installFlags = [
|
||||
|
Loading…
Reference in New Issue
Block a user