diff options
author | Ayan Kumar Halder | 2021-12-17 15:56:26 +0000 |
---|---|---|
committer | Stefano Stabellini | 2021-12-17 15:21:50 -0800 |
commit | cd949669b6f905839a49b18a89d4d1bc7304a8b4 (patch) | |
tree | 8ebaa8d31d0247fd3bd8854d3619705b1b6fe543 | |
parent | 7379d0b05b11519ecbe586017939ed1b0a6871c4 (diff) |
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 <ayankuma@xilinx.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
-rw-r--r-- | scripts/common | 12 |
1 files changed, 10 insertions, 2 deletions
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 |