]> git.proxmox.com Git - efi-boot-shim.git/commitdiff
Makefile: use fixed build host if SOURCE_DATE_EPOCH is defined
authorLuca Boccassi <bluca@debian.org>
Fri, 15 Feb 2019 21:42:10 +0000 (21:42 +0000)
committerJavier Martinez Canillas <javier@dowhile0.org>
Tue, 16 Feb 2021 08:12:48 +0000 (09:12 +0100)
If SOURCE_DATE_EPOCH is defined then we can be reasonably sure the
user wants the build to be fully reproducible, so use a fixed string.
In case of a cross build, using uname -s -m -p -i o will still report
the host's kernel architecture, which will trip some CIs like
Debian's.

This is a backport from devel of:

  commit 11fd3197d21f94b491ccfc1da6d38b14060e62d7
  Author: Luca Boccassi <bluca@debian.org>
  Date:   Fri Feb 15 21:42:10 2019 +0000

      Makefile: use fixed build host if SOURCE_DATE_EPOCH is defined

      If SOURCE_DATE_EPOCH is defined then we can be reasonably sure the
      user wants the build to be fully reproducible, so use a fixed string.
      In case of a cross build, using uname -s -m -p -i o will still report
      the host's kernel architecture, which will trip some CIs like
      Debian's.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Peter Jones <pjones@redhat.com>
Makefile

index 2cd20ac6a1bc0b2687df51df64fccaf6755843de..b9a5ccf7aa22377b05985f11bd711e3001a89f2e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -47,6 +47,12 @@ ifneq ($(origin ENABLE_HTTPBOOT), undefined)
        SOURCES += httpboot.c include/httpboot.h
 endif
 
+ifeq ($(SOURCE_DATE_EPOCH),)
+       UNAME=$(shell uname -s -m -p -i -o)
+else
+       UNAME=buildhost
+endif
+
 SOURCES = $(foreach source,$(ORIG_SOURCES),$(TOPDIR)/$(source)) version.c
 MOK_SOURCES = $(foreach source,$(ORIG_MOK_SOURCES),$(TOPDIR)/$(source))
 FALLBACK_SRCS = $(foreach source,$(ORIG_FALLBACK_SRCS),$(TOPDIR)/$(source))
@@ -67,7 +73,7 @@ shim_cert.h: shim.cer
 
 version.c : $(TOPDIR)/version.c.in
        sed     -e "s,@@VERSION@@,$(VERSION)," \
-               -e "s,@@UNAME@@,$(shell uname -s -m -p -i -o)," \
+               -e "s,@@UNAME@@,$(UNAME)," \
                -e "s,@@COMMIT@@,$(COMMIT_ID)," \
                < $< > $@