From patchwork Tue Jul 2 18:22:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raymond Mao X-Patchwork-Id: 1955551 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=rVu7NC9c; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WDBCf68qbz1xpN for ; Wed, 3 Jul 2024 04:25:02 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 53C0987D0A; Tue, 2 Jul 2024 20:25:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="rVu7NC9c"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E5A2987C86; Tue, 2 Jul 2024 20:24:59 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 884288874F for ; Tue, 2 Jul 2024 20:24:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=raymond.mao@linaro.org Received: by mail-qt1-x832.google.com with SMTP id d75a77b69052e-446340c6608so33840511cf.1 for ; Tue, 02 Jul 2024 11:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719944696; x=1720549496; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=G6WwdYlRiyXEUHkDqj0ZB2LeTSqBJNO+5VBwNtWPsrQ=; b=rVu7NC9cKkWxUEAWLzZeKnSJV2klrRG1fyqa89ROjKGNgRQgKPt9cgRhdQq731Vnd1 rwWYUTYFbtt+WYTGE0RqSN2Iii8tGt+GjfV1P6HwVMNk8rAnbKAeTDuZW3OAlEuBZTSB NYo6InB9D0UfckBzBjDhqjuegu2HjlnnD9SjYRnuYE/lTPPBmhGPILGFrOWRNOU7YmZp vQA6+s5ckd1kS6A4M0Y8aKfhSyP5anamf1euO/U25nwisQLgzKQchZw4LcRl9E0HZHmi roiT4QGvDhl7sQulxRd00N3N4TkKJD1YneTiXMgxosFprvtKh65zAYQlDgsLnoUrqzs9 /zWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719944696; x=1720549496; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G6WwdYlRiyXEUHkDqj0ZB2LeTSqBJNO+5VBwNtWPsrQ=; b=rCW01gSfh327g0jDIsfE/UvwHHLxp3NV4ClkiYbb8wpgQgn/kd2Y/QjGfYiJ0UAnhH 8bxyKvMglgDxhYNmurQo0Z/VIQUBzn/6z+dspyvg6HpapKcuWxvra/cfjz4E1jzKlPep 1GLs6rZQ2yQH9UyMbRdIImZoxWeDYq4nDqGBbtrEmPpo6htfXnqGX5N2xsmCl9GkHXi5 bO74oQdLghBms/YoXpmi51/zsqB/0pUs9sJrkPRs9dko5sH3ciDZoJnW/CrgVedzAs3u 82joI+xbQAHpleMxoBN7v+xuzQTOk8hXOGG9Z218O2702a6vXy+J9aQRYYXvfdlkkHxE fy2Q== X-Gm-Message-State: AOJu0YwVR17zaytD+Gjc19Jiu8D5joshQoJ1/ALJLaRlJOo6L+DGaMRR /yl8vvGDp6MaCkg0ckYkJwhDqsKKurryCnfZ1msFFKM+qo5xqGdByPS9vuIQa8Cx/xsTraVyega Z X-Google-Smtp-Source: AGHT+IFvSWd5sEEnhC4m/jVemtSDZ0lijGVkq/Ju6EEHt3ATZ8B1MvPr6t7qED9/aF6+SElJYHTY4g== X-Received: by 2002:ac8:5f82:0:b0:440:51af:2977 with SMTP id d75a77b69052e-44662e53925mr120692571cf.59.1719944696221; Tue, 02 Jul 2024 11:24:56 -0700 (PDT) Received: from ubuntu.localdomain (pool-174-114-184-37.cpe.net.cable.rogers.com. [174.114.184.37]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-446514b613dsm43316351cf.84.2024.07.02.11.24.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 11:24:55 -0700 (PDT) From: Raymond Mao To: u-boot@lists.denx.de Cc: manish.pandey2@arm.com, Raymond Mao , Tom Rini , Stefan Bosch , Mario Six , Andy Shevchenko , Michal Simek , Tuomas Tynkkynen , Simon Glass , Ilias Apalodimas , Leo Yu-Chi Liang , Andrejs Cainikovs , Marek Vasut , Sean Anderson , Jesse Taube , Bryan Brattlof , "Leon M. Busch-George" , Igor Opaniuk , Sergei Antonov , Ilya Lukin <4.shket@gmail.com>, Heinrich Schuchardt , Alper Nebi Yasak , Abdellatif El Khlifi , AKASHI Takahiro , Alexander Gendin , Bin Meng , Eddie James , Oleksandr Suvorov Subject: [PATCH v4 02/29] mbedtls: Add script to update MbedTLS subtree Date: Tue, 2 Jul 2024 11:22:38 -0700 Message-Id: <20240702182325.2904421-3-raymond.mao@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240702182325.2904421-1-raymond.mao@linaro.org> References: <20240702182325.2904421-1-raymond.mao@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean 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 $ ./lib/mbedtls/update-mbedtls-subtree.sh pick Signed-off-by: Raymond Mao --- 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 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 +# $ ./tools/update-mbedtls-subtree.sh pick +# +# The script will pull changes from MbedTLS repo into U-Boot +# as a subtree located as /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 " + echo " pull or pick" + echo " release tag [pull] or commit id [pick]" +fi