liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit af79e1e9e97b80b691099d51d3939fbe8193ed57
parent 1bd35a1edd9899e023c7fbcfa8ca38aa120e76a3
Author: Daniel Barlow <dan@telent.net>
Date:   Fri,  7 Oct 2022 00:19:29 +0100

build dtb (forgot to commit this file?)

Diffstat:
Akernel/dtb.nix | 24++++++++++++++++++++++++
1 file changed, 24 insertions(+), 0 deletions(-)

diff --git a/kernel/dtb.nix b/kernel/dtb.nix @@ -0,0 +1,24 @@ +{ + stdenv +, openwrt +, dtc +, kernel +}: +{ dts +}:let + includes = [ + "${openwrt}/target/linux/ath79/dts" + "${kernel}/include" + ]; + cppDtSearchFlags = builtins.concatStringsSep " " (map (f: "-I${f}") includes); + dtcSearchFlags = builtins.concatStringsSep " " (map (f: "-i${f}") includes); +in stdenv.mkDerivation { + name = "dtb"; + phases = [ "buildPhase" ]; + nativeBuildInputs = [ dtc ]; + buildPhase = '' + ${stdenv.cc.targetPrefix}cpp -nostdinc -x assembler-with-cpp ${cppDtSearchFlags} -undef -D__DTS__ -o dtb.tmp ${openwrt}/target/linux/ath79/dts/${dts} + dtc ${dtcSearchFlags} -I dts -O dtb -o $out dtb.tmp + test -e $out + ''; +}