[meta-virtualization][PATCH 09/15] oci-image-tools: set go buildid to empty for improving reproducibility

<[email protected]>
Newsgroups org.yoctoproject.lists.meta-virtualization
Message-ID <[email protected]>
From: Changqing Li <[email protected]>

Signed-off-by: Changqing Li <[email protected]>
---
 .../0001-Makefile-add-EXTRA_LDFLAGS.patch     | 39 +++++++++++++++++++
 .../oci-image-tools/oci-image-tools_git.bb    |  5 ++-
 2 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 recipes-containers/oci-image-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch

diff --git a/recipes-containers/oci-image-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch b/recipes-containers/oci-image-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch
new file mode 100644
index 00000000..d946c342
--- /dev/null
+++ b/recipes-containers/oci-image-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch
@@ -0,0 +1,39 @@
+From 095e7a01a7d9f7a98650bc8a398daa291bf6d5d5 Mon Sep 17 00:00:00 2001
+From: Changqing Li <[email protected]>
+Date: Sun, 4 Jan 2026 17:24:31 +0800
+Subject: [PATCH] Makefile: add EXTRA_LDFLAGS
+
+add EXTRA_LDFLAGS to allow adding extra ldflags
+
+Upstream-Status: Submitted [https://github.com/opencontainers/image-tools/pull/243]
+
+Signed-off-by: Changqing Li <[email protected]>
+---
+ Makefile | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 1bfe021..8b92b93 100644
+--- a/Makefile
++++ b/Makefile
+@@ -4,6 +4,8 @@ BINDIR ?= $(DESTDIR)/usr/bin
+ COMMIT=$(shell git rev-parse HEAD 2> /dev/null || true)
+ EPOCH_TEST_COMMIT ?= $(shell git tag | tail -1)
+ 
++EXTRA_LDFLAGS ?= ""
++
+ default: all
+ 
+ help:
+@@ -27,7 +29,7 @@ check-license:
+ 
+ .PHONY: tool
+ tool:
+-	$(GO) build $(GOBUILDFLAGS) $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT}" -o oci-image-tool ./cmd/oci-image-tool
++	$(GO) build $(GOBUILDFLAGS) $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} ${EXTRA_LDFLAGS}" -o oci-image-tool ./cmd/oci-image-tool
+ 
+ 
+ all: tool man
+-- 
+2.34.1
+
diff --git a/recipes-containers/oci-image-tools/oci-image-tools_git.bb b/recipes-containers/oci-image-tools/oci-image-tools_git.bb
index 36026214..71b01a5b 100644
--- a/recipes-containers/oci-image-tools/oci-image-tools_git.bb
+++ b/recipes-containers/oci-image-tools/oci-image-tools_git.bb
@@ -5,7 +5,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
 
 SRC_URI = "git://github.com/opencontainers/image-tools.git;branch=master;protocol=https;destsuffix=git/src/github.com/opencontainers/image-tools \
            file://0001-config-make-Config.User-mapping-errors-a-warning.patch \
-           file://0001-tool-respect-GO-and-GOBUILDFLAGS-when-building.patch"
+           file://0001-tool-respect-GO-and-GOBUILDFLAGS-when-building.patch \
+           file://0001-Makefile-add-EXTRA_LDFLAGS.patch"
 
 SRCREV = "11f9988298305d36f64248a6ee55318e60bf170b"
 PV = "1.0.0-rc3+git"
@@ -38,6 +39,8 @@ do_compile() {
 
 	export GOBUILDFLAGS="-trimpath"
 
+    export EXTRA_LDFLAGS="-buildid="
+
 	cd ${S}
 
 	oe_runmake tool
-- 
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.