mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-20 19:16:11 +00:00
nixos/device-tree: preprocess overlays before compiling
Run the device tree overlays through the preprocessor before compiling it, as is done in the kernel. This helps make overlays easier to understand, and improves compatibility with those found in the wild. I found the correct command line by running the kernel build with V=1, and then removing all the arguments related to dependency tracking.
This commit is contained in:
parent
8e4b3323d1
commit
754005bf48
@ -85,13 +85,14 @@ let
|
||||
|
||||
# Compile single Device Tree overlay source
|
||||
# file (.dts) into its compiled variant (.dtbo)
|
||||
compileDTS = name: f: pkgs.callPackage({ dtc }: pkgs.stdenv.mkDerivation {
|
||||
compileDTS = name: f: pkgs.callPackage({ stdenv, dtc }: stdenv.mkDerivation {
|
||||
name = "${name}-dtbo";
|
||||
|
||||
nativeBuildInputs = [ dtc ];
|
||||
|
||||
buildCommand = ''
|
||||
dtc -I dts ${f} -O dtb -@ -o $out
|
||||
$CC -E -nostdinc -I${getDev cfg.kernelPackage}/lib/modules/${cfg.kernelPackage.modDirVersion}/source/scripts/dtc/include-prefixes -undef -D__DTS__ -x assembler-with-cpp ${f} | \
|
||||
dtc -I dts -O dtb -@ -o $out
|
||||
'';
|
||||
}) {};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user