Skip to content

Instantly share code, notes, and snippets.

@krisk0
Created April 12, 2024 08:40
Show Gist options
  • Save krisk0/8874f18318c2b8c50ef63c9db4f214ef to your computer and use it in GitHub Desktop.
Save krisk0/8874f18318c2b8c50ef63c9db4f214ef to your computer and use it in GitHub Desktop.
compile u-boot .dts found in dir arch/arm/dts
#!/bin/bash
src=`realpath $1`
uboot_base=`dirname $src`/../../..
uboot_base=`realpath $uboot_base`
echo $uboot_base
pre=/tmp/pre.dts
tgt=${src%.dts}.dtb
cd $uboot_base
oo="
-nostdinc
-Iinclude
-x assembler-with-cpp
"
cc -E $oo -o $pre $src || exit
dtc -O dtb -o $tgt -b 0 $pre
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment