summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--images/FIT.sh9
-rwxr-xr-xkbuild.sh11
2 files changed, 17 insertions, 3 deletions
diff --git a/images/FIT.sh b/images/FIT.sh
index 006baaf..46fe2ea 100644
--- a/images/FIT.sh
+++ b/images/FIT.sh
@@ -51,8 +51,6 @@ EOF
for dtb in ${dtbs[@]} ${dt_overlays[@]} ; do
local src=${dtb/:*/}
local dst=${dtb/*:/}
- dst=${dst/*\//}
-
local load=
if [ ! -z $fdtaddr ] ; then
@@ -60,10 +58,15 @@ EOF
addr=$(($addr+0x40000))
fi
+ if [[ ${src} != /* ]] ; then
+ src="$output_dir/arch/$arch/boot/dts/$src"
+ fi
+
+ dst=${dst/*\//}
cat <<EOF >> $kernel_its
fdt-$dst {
description = "Flattened Device Tree blob $dst";
- data = /incbin/("$output_dir/arch/$arch/boot/dts/$src");
+ data = /incbin/("$src");
type = "flat_dt";
arch = "$arch";
compression = "none";
diff --git a/kbuild.sh b/kbuild.sh
index 3f20151..d526aad 100755
--- a/kbuild.sh
+++ b/kbuild.sh
@@ -251,6 +251,11 @@ kernel_dtbs=
if [[ ${do_build[dt]} == 1 ]] ; then
for dtb in ${dtbs[@]} ; do
dtb=${dtb/:*/}
+
+ if [[ "${dtb}" == /* ]] ; then
+ continue
+ fi
+
kernel_dtbs="$kernel_dtbs $dtb"
done
fi
@@ -324,6 +329,12 @@ copy_dtbs() {
dst=$(basename $dst)
fi
+ # The destination should never be an absolute path.
+ if [[ "${dst}" == /* ]] ; then
+ echo "Error: DTB destination ${dtb} can't be absolute path"
+ exit 1
+ fi
+
mkdir -p $(dirname $dest_dir/$dst)
cp $output_dir/arch/${arch}/boot/dts/$src* $dest_dir/$dst
done