All of lore.kernel.org
 help / color / mirror / Atom feed
From: Devarsh Thakkar <devarsht@ti.com>
To: <meta-ti@lists.yoctoproject.org>, <praneeth@ti.com>
Cc: <nikhil.nd@ti.com>, <nsekhar@ti.com>, <devarsht@ti.com>,
	<vigneshr@ti.com>, Ryan Eatmon <reatmon@ti.com>, <a-m1@ti.com>,
	<nm@ti.com>
Subject: [meta-ti][dunfell][PATCH] u-boot-ti: Use SRCREV to get short commit ID
Date: Tue, 19 Apr 2022 21:17:34 +0530	[thread overview]
Message-ID: <20220419154734.6346-1-devarsht@ti.com> (raw)

Due to recent security update in git, we are
not able to fetch revision currently using existing method:
https://github.blog/2022-04-12-git-security-vulnerability-announced/

So instead, use the SRCREV to parse the short commit ID
and set the UBOOT_LOCALVERSION variable.

Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
---
 recipes-bsp/u-boot/u-boot-ti.inc | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/recipes-bsp/u-boot/u-boot-ti.inc b/recipes-bsp/u-boot/u-boot-ti.inc
index 231b7647..cc775e2e 100644
--- a/recipes-bsp/u-boot/u-boot-ti.inc
+++ b/recipes-bsp/u-boot/u-boot-ti.inc
@@ -1,14 +1,6 @@
 # UBOOT_LOCALVERSION can be set to add a tag to the end of the
 # U-boot version string.  such as the commit id
-def get_git_revision(p):
-    import subprocess
-
-    try:
-        return subprocess.Popen("git rev-parse HEAD 2>/dev/null ", cwd=p, shell=True, stdout=subprocess.PIPE, universal_newlines=True).communicate()[0].rstrip()
-    except OSError:
-        return None
-
-UBOOT_LOCALVERSION = "-g${@get_git_revision('${S}').__str__()[:10]}"
+UBOOT_LOCALVERSION = "-g${@d.getVar("SRCREV", False).__str__()[:10]}"
 
 UBOOT_SUFFIX ?= "img"
 SPL_BINARY ?= "MLO"
-- 
2.17.1



             reply	other threads:[~2022-04-19 17:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19 15:47 Devarsh Thakkar [this message]
2022-04-19 23:34 ` [meta-ti][dunfell][PATCH] u-boot-ti: Use SRCREV to get short commit ID Nishanth Menon
2022-04-27 14:20   ` Devarsh Thakkar
2022-04-27 14:43     ` Denys Dmytriyenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220419154734.6346-1-devarsht@ti.com \
    --to=devarsht@ti.com \
    --cc=a-m1@ti.com \
    --cc=meta-ti@lists.yoctoproject.org \
    --cc=nikhil.nd@ti.com \
    --cc=nm@ti.com \
    --cc=nsekhar@ti.com \
    --cc=praneeth@ti.com \
    --cc=reatmon@ti.com \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.