Message ID | 20240702182325.2904421-3-raymond.mao@linaro.org |
---|---|
State | Changes Requested |
Delegated to: | Tom Rini |
Headers | show |
Series | Integrate MbedTLS v3.6 LTS with U-Boot | expand |
On Tue, Jul 02, 2024 at 11:22:38AM -0700, Raymond Mao wrote: > lib/mbedtls/update-mbedtls-subtree.sh is a wrapper of git subtree > commands. > Usage from U-Boot top directory, run: > > $ ./lib/mbedtls/update-mbedtls-subtree.sh pull <release-tag> > $ ./lib/mbedtls/update-mbedtls-subtree.sh pick <commit-id> > > Signed-off-by: Raymond Mao <raymond.mao@linaro.org> > --- > Changes in v2 > - Initial patch. > Changes in v3 > - None. > Changes in v4 > - Minor fix and move the script into tools dir. > > tools/update-mbedtls-subtree.sh | 47 +++++++++++++++++++++++++++++++++ > 1 file changed, 47 insertions(+) > create mode 100755 tools/update-mbedtls-subtree.sh Given how amazingly close this is to dts/update-dts-subtree.sh and also the lwIP version, can you and Jerome please co-ordinate on a short series that you can then both depend on a pre-req that makes, I don't know, tools/update-git-subtree.sh and that script takes upstream URI and whatever else would be needed so that all 3 of our "update or cherry-pick from a git subtree" scripts call that and are more or less one line scripts themselves? Thanks.
On 7/2/24 22:56, Tom Rini wrote: > On Tue, Jul 02, 2024 at 11:22:38AM -0700, Raymond Mao wrote: > >> lib/mbedtls/update-mbedtls-subtree.sh is a wrapper of git subtree >> commands. >> Usage from U-Boot top directory, run: >> >> $ ./lib/mbedtls/update-mbedtls-subtree.sh pull <release-tag> >> $ ./lib/mbedtls/update-mbedtls-subtree.sh pick <commit-id> >> >> Signed-off-by: Raymond Mao <raymond.mao@linaro.org> >> --- >> Changes in v2 >> - Initial patch. >> Changes in v3 >> - None. >> Changes in v4 >> - Minor fix and move the script into tools dir. >> >> tools/update-mbedtls-subtree.sh | 47 +++++++++++++++++++++++++++++++++ >> 1 file changed, 47 insertions(+) >> create mode 100755 tools/update-mbedtls-subtree.sh > > Given how amazingly close this is to dts/update-dts-subtree.sh and also > the lwIP version, can you and Jerome please co-ordinate on a short > series that you can then both depend on a pre-req that makes, I don't > know, tools/update-git-subtree.sh and that script takes upstream URI and > whatever else would be needed so that all 3 of our "update or > cherry-pick from a git subtree" scripts call that and are more or less > one line scripts themselves? Thanks. Sounds like a good idea :) Raymond, FYI the lwIP series is at [1]. I will make sure I CC you on the next iteration BTW ;-). All the information about the subtree is in the cover letter and that's basically: $ git subtree add --squash --prefix lib/lwip/lwip \ https://git.savannah.gnu.org/git/lwip.git STABLE-2_2_0_RELEASE [1] https://lore.kernel.org/u-boot/3c2b8a90-1d4d-41ac-a15a-0d3b2a7d2a57@linaro.org/T/ Thanks,
Hi Tom, On Tue, 2 Jul 2024 at 16:57, Tom Rini <trini@konsulko.com> wrote: > On Tue, Jul 02, 2024 at 11:22:38AM -0700, Raymond Mao wrote: > > > lib/mbedtls/update-mbedtls-subtree.sh is a wrapper of git subtree > > commands. > > Usage from U-Boot top directory, run: > > > > $ ./lib/mbedtls/update-mbedtls-subtree.sh pull <release-tag> > > $ ./lib/mbedtls/update-mbedtls-subtree.sh pick <commit-id> > > > > Signed-off-by: Raymond Mao <raymond.mao@linaro.org> > > --- > > Changes in v2 > > - Initial patch. > > Changes in v3 > > - None. > > Changes in v4 > > - Minor fix and move the script into tools dir. > > > > tools/update-mbedtls-subtree.sh | 47 +++++++++++++++++++++++++++++++++ > > 1 file changed, 47 insertions(+) > > create mode 100755 tools/update-mbedtls-subtree.sh > > Given how amazingly close this is to dts/update-dts-subtree.sh and also > the lwIP version, can you and Jerome please co-ordinate on a short > series that you can then both depend on a pre-req that makes, I don't > know, tools/update-git-subtree.sh and that script takes upstream URI and > whatever else would be needed so that all 3 of our "update or > cherry-pick from a git subtree" scripts call that and are more or less > one line scripts themselves? Thanks. > > I agree. This is a good idea. I can make a prerequisite patch to merge these 3 scripts. Regards, Raymond
Hi Jerome, On Wed, 3 Jul 2024 at 03:16, Jerome Forissier <jerome.forissier@linaro.org> wrote: > > > On 7/2/24 22:56, Tom Rini wrote: > > On Tue, Jul 02, 2024 at 11:22:38AM -0700, Raymond Mao wrote: > > > >> lib/mbedtls/update-mbedtls-subtree.sh is a wrapper of git subtree > >> commands. > >> Usage from U-Boot top directory, run: > >> > >> $ ./lib/mbedtls/update-mbedtls-subtree.sh pull <release-tag> > >> $ ./lib/mbedtls/update-mbedtls-subtree.sh pick <commit-id> > >> > >> Signed-off-by: Raymond Mao <raymond.mao@linaro.org> > >> --- > >> Changes in v2 > >> - Initial patch. > >> Changes in v3 > >> - None. > >> Changes in v4 > >> - Minor fix and move the script into tools dir. > >> > >> tools/update-mbedtls-subtree.sh | 47 +++++++++++++++++++++++++++++++++ > >> 1 file changed, 47 insertions(+) > >> create mode 100755 tools/update-mbedtls-subtree.sh > > > > Given how amazingly close this is to dts/update-dts-subtree.sh and also > > the lwIP version, can you and Jerome please co-ordinate on a short > > series that you can then both depend on a pre-req that makes, I don't > > know, tools/update-git-subtree.sh and that script takes upstream URI and > > whatever else would be needed so that all 3 of our "update or > > cherry-pick from a git subtree" scripts call that and are more or less > > one line scripts themselves? Thanks. > > Sounds like a good idea :) > > Raymond, FYI the lwIP series is at [1]. I will make sure I CC you on the > next iteration BTW ;-). All the information about the subtree is in the > cover letter and that's basically: > > $ git subtree add --squash --prefix lib/lwip/lwip \ > https://git.savannah.gnu.org/git/lwip.git STABLE-2_2_0_RELEASE > > [1] > https://lore.kernel.org/u-boot/3c2b8a90-1d4d-41ac-a15a-0d3b2a7d2a57@linaro.org/T/ > > Thanks. I will send the patch and keep you in CC. Regards, Raymond
diff --git a/tools/update-mbedtls-subtree.sh b/tools/update-mbedtls-subtree.sh new file mode 100755 index 00000000000..0a98a4d6e82 --- /dev/null +++ b/tools/update-mbedtls-subtree.sh @@ -0,0 +1,47 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright 2024 Linaro Ltd. +# +# Usage: from the top level U-Boot source tree, run: +# $ ./tools/update-mbedtls-subtree.sh pull <release-tag> +# $ ./tools/update-mbedtls-subtree.sh pick <commit-id> +# +# The script will pull changes from MbedTLS repo into U-Boot +# as a subtree located as <U-Boot>/lib/mbedtls/external/mbedtls 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 MbedTLS repo [1] into lib/mbedtls/external/mbedtls + +[1] https://github.com/Mbed-TLS/mbedtls.git +EOF +) + +remote_add_and_fetch() { + if [ -z "$(git remote get-url mbedtls_upstream 2>/dev/null)" ]; then + echo "Warning: Script automatically adds new git remote via:" + echo " git remote add mbedtls_upstream \\" + echo " https://github.com/Mbed-TLS/mbedtls.git" + git remote add mbedtls_upstream \ + https://github.com/Mbed-TLS/mbedtls.git + fi + git fetch mbedtls_upstream master +} + +if [ "$1" = 'pull' ]; then + remote_add_and_fetch + git subtree pull --prefix lib/mbedtls/external/mbedtls mbedtls_upstream \ + "$2" --squash -m "${merge_commit_msg}" +elif [ "$1" = 'pick' ]; then + remote_add_and_fetch + git cherry-pick -x --strategy=subtree \ + -Xsubtree=lib/mbedtls/external/mbedtls/ "$2" +else + echo "usage: $0 <op> <ref>" + echo " <op> pull or pick" + echo " <ref> release tag [pull] or commit id [pick]" +fi
lib/mbedtls/update-mbedtls-subtree.sh is a wrapper of git subtree commands. Usage from U-Boot top directory, run: $ ./lib/mbedtls/update-mbedtls-subtree.sh pull <release-tag> $ ./lib/mbedtls/update-mbedtls-subtree.sh pick <commit-id> Signed-off-by: Raymond Mao <raymond.mao@linaro.org> --- Changes in v2 - Initial patch. Changes in v3 - None. Changes in v4 - Minor fix and move the script into tools dir. tools/update-mbedtls-subtree.sh | 47 +++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 tools/update-mbedtls-subtree.sh