8f1520bd13
r270991, r271045: Enhancements related to compiling FDT data... - Use proper include path for dtc as well as cpp. - Call cpp with -P to avoid printing line markings. - Allow FDT_DTS_FILE to be a list, either in the makedtb target, or in a kernel config file. - Add the dts include directory to the -I list when doing arm builds. - Invoke make_dtb with MACHINE defined for cross building friendliness. - Allow the make_dtb script to work outside of a "make buildkernel" context by setting MACHINE from uname -m if it's not set already. - Use sh -c '...' to launch the dtb build scripts with env prepended, otherwise it tries to treat the env var stuff as a script file name.
25 lines
574 B
Bash
Executable File
25 lines
574 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
|
|
# Script generates dtb file ($3) from dts source ($2) in build tree S ($1)
|
|
S=$1
|
|
dts="$2"
|
|
dtb_path=$3
|
|
|
|
if [ -z "$dts" ]; then
|
|
echo "No DTS specified"
|
|
exit 1
|
|
fi
|
|
|
|
if [ -z "${MACHINE}" ]; then
|
|
MACHINE=$(uname -m)
|
|
fi
|
|
|
|
for d in ${dts}; do
|
|
dtb=${dtb_path}/`basename $d .dts`.dtb
|
|
echo "converting $d -> $dtb"
|
|
cpp -P -x assembler-with-cpp -I $S/gnu/dts/include -I $S/boot/fdt/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -include $d /dev/null |
|
|
dtc -O dtb -o $dtb -b 0 -p 1024 -i $S/boot/fdt/dts/${MACHINE} -i $S/gnu/dts/${MACHINE}
|
|
done
|