From cd949669b6f905839a49b18a89d4d1bc7304a8b4 Mon Sep 17 00:00:00 2001 From: Ayan Kumar Halder Date: Fri, 17 Dec 2021 15:56:26 +0000 Subject: Avoid making changes in the device trees from the repository One should copy the device tree to a temporary file and then make any change (so as to enable merging of multiple device trees). In this case, the change is to remove the marker (/dts-v1/;) from all the device trees except the first one to be merged. DTC expects the marker to be present only once. Also, i, j, tmpdts and file should be set to local. This will avoid name collision. Signed-off-by: Ayan Kumar Halder Reviewed-by: Stefano Stabellini Signed-off-by: Stefano Stabellini --- scripts/common | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'scripts/common') diff --git a/scripts/common b/scripts/common index f311ac5..cb8e0f9 100644 --- a/scripts/common +++ b/scripts/common @@ -90,7 +90,11 @@ function compile_merge_partial_dts() local repo=$(echo "$1" | awk '{print $1}') local dir=$(echo "$1" | awk '{print $2}') local tmp + local tmpdts local tmp_dtb_dir + local file + local i + local j if [[ "$repo" =~ .*@.*:.* ]] then @@ -136,14 +140,18 @@ function compile_merge_partial_dts() file=${devpath##*/} file="$repo"/"$dir"/"$file".dts - echo "/include/ \"$file\"" >> "$tmp" - # All the subsequent dts files should not have dts version mentioned if [ $j -gt 1 ] then + tmpdts=`mktemp` + cp "$file" "$tmpdts" + tmp_files+=($tmpdts) + file="$tmpdts" sed -i '/\/dts-v/d' "$file" fi + echo "/include/ \"$file\"" >> "$tmp" + j=$(( $j + 1 )) done -- cgit v1.2.3