From 8537e0555c828a27fda7b4e1f9191ab94cc827e1 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Fri, 15 Feb 2019 21:42:10 +0000 Subject: 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. This is a backport from devel of: commit 11fd3197d21f94b491ccfc1da6d38b14060e62d7 Author: Luca Boccassi 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 Signed-off-by: Luca Boccassi Signed-off-by: Peter Jones --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2cd20ac6..b9a5ccf7 100644 --- 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)," \ < $< > $@ -- cgit v1.2.3