-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuname.patch
32 lines (29 loc) · 1.15 KB
/
uname.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Author: Luca Boccassi <[email protected]>
Description: 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.
Forwarded: https://github.com/rhboot/shim/pull/169
--- a/Makefile
+++ b/Makefile
@@ -46,6 +46,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))
@@ -66,7 +72,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)," \
< $< > $@