mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-22 04:44:46 +00:00
dts: Add script to uprev dts/upstream subtree
dts/update-dts-subtree.sh is just a wrapper around git subtree commands. Usage from the top level U-Boot source tree, run: $ ./dts/update-dts-subtree.sh pull <release-tag> $ ./dts/update-dts-subtree.sh pick <commit-id> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
This commit is contained in:
parent
e3a9829c87
commit
b841ca6ae6
1 changed files with 48 additions and 0 deletions
48
dts/update-dts-subtree.sh
Executable file
48
dts/update-dts-subtree.sh
Executable file
|
@ -0,0 +1,48 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# SPDX-License-Identifier: GPL-2.0+
|
||||||
|
#
|
||||||
|
# Copyright 2024 Linaro Ltd.
|
||||||
|
#
|
||||||
|
# Usage: from the top level U-Boot source tree, run:
|
||||||
|
# $ ./dts/update-dts-subtree.sh pull <release-tag>
|
||||||
|
# $ ./dts/update-dts-subtree.sh pick <commit-id>
|
||||||
|
#
|
||||||
|
# The script will pull changes from devicetree-rebasing repo into U-Boot
|
||||||
|
# as a subtree located as <U-Boot>/dts/upstream sub-directory. It will
|
||||||
|
# automatically create a squash/merge commit listing the commits imported.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
merge_commit_msg=$(cat << EOF
|
||||||
|
Subtree merge tag '$2' of devicetree-rebasing repo [1] into dts/upstream
|
||||||
|
|
||||||
|
[1] https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git/
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
remote_add_and_fetch() {
|
||||||
|
if ! git remote get-url devicetree-rebasing 2>/dev/null
|
||||||
|
then
|
||||||
|
echo "Warning: Script automatically adds new git remote via:"
|
||||||
|
echo " git remote add devicetree-rebasing \\"
|
||||||
|
echo " https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git"
|
||||||
|
git remote add devicetree-rebasing \
|
||||||
|
https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git
|
||||||
|
fi
|
||||||
|
git fetch devicetree-rebasing master
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "$1" = "pull" ]
|
||||||
|
then
|
||||||
|
remote_add_and_fetch
|
||||||
|
git subtree pull --prefix dts/upstream devicetree-rebasing \
|
||||||
|
"$2" --squash -m "${merge_commit_msg}"
|
||||||
|
elif [ "$1" = "pick" ]
|
||||||
|
then
|
||||||
|
remote_add_and_fetch
|
||||||
|
git cherry-pick -x --strategy=subtree -Xsubtree=dts/upstream/ "$2"
|
||||||
|
else
|
||||||
|
echo "usage: $0 <op> <ref>"
|
||||||
|
echo " <op> pull or pick"
|
||||||
|
echo " <ref> release tag [pull] or commit id [pick]"
|
||||||
|
fi
|
Loading…
Add table
Reference in a new issue