summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-06-17 00:36:38 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-06-17 00:39:25 +0300
commit1b9133e66ab3a75e5b81ca6746a5fb9d608b800a (patch)
tree7776a3ef9ef6aefdcc47410adf2aa97e30cde47e
parent88e32bab5084efff7bda0247e4d1a9ab50dd7a71 (diff)
kbuild: Support directory names in DTB destinations
The kbuild.sh script strips the directory name from the DTB destination. This is correct when no destination is specified explicitly, as we want to strip the directory name of the source for arm64 platforms where DT sources are stored in per-vendor directories. However, in some cases, we want to store the DTB in a sub-directory. A common use case is Raspberry Pi platforms that store overlays in an overlays/ subdirectory. Make this possible by stripping the directory name only when the destination is implicit. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rwxr-xr-xkbuild.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/kbuild.sh b/kbuild.sh
index c548718..3f20151 100755
--- a/kbuild.sh
+++ b/kbuild.sh
@@ -316,8 +316,15 @@ copy_dtbs() {
for dtb in ${dtbs[@]} ; do
local src=${dtb/:*/}
local dst=${dtb/*:/}
- dst=${dst/*\//}
+ # If a destination is explicitly specified, don't strip
+ # directory name. This can be used for instance to store .dtbo
+ # files in an overlays/ subdirectory.
+ if ! echo ${dtb} | grep -q ':' ; then
+ dst=$(basename $dst)
+ fi
+
+ mkdir -p $(dirname $dest_dir/$dst)
cp $output_dir/arch/${arch}/boot/dts/$src* $dest_dir/$dst
done
}