Skip to contentSkip to conversation

tools/firmware: reproducible seabios build

PATCH Superseded Olaf Hering 2 participants 4 messages Jul 13, 2018 – Jul 18, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/firmware: reproducible seabios build

The buildsystem of seabios always includes the current time and the hostname into the resulting binary. To avoid that, it is required to have a file '.version' in the toplevel directory of seabios-dir-remote. And it is required to pass EXTRAVERSION= to make because its toplevel Makefile does not take EXTRAVERSION from environment.

Adjust the code to create a '.version' file with fixed content. Adjust the code to pass EXTRAVERSION down to make.

--

After commit 1233d253a4 ("firmware/seabios: fix build on systems with non GNU toolchains") this change is now hopefully non-controversial.

---
 tools/firmware/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/firmware/Makefile +3 -1
index 842b48c3d3..b11f1c5970 100644
@@ -30,6 +30,8 @@ seabios-dir:
 	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(SEABIOS_UPSTREAM_URL) $(SEABIOS_UPSTREAM_REVISION) seabios-dir
 	cp seabios-config seabios-dir/.config;
 	$(MAKE) -C seabios-dir olddefconfig CC=$(SEABIOSCC) LD=$(SEABIOSLD)
+	rm -f seabios-dir/.version
+	echo '$(SEABIOS_UPSTREAM_REVISION)' > seabios-dir/.version
 
 .PHONY: all
 all: $(SUBDIRS-y)
@@ -130,4 +132,4 @@ subtree-force-update-all:
 	$(MAKE) ovmf-dir-force-update
 
 subdir-all-seabios-dir: seabios-dir
-	$(MAKE) -C $< CC=$(SEABIOSCC) LD=$(SEABIOSLD) PYTHON=$(PYTHON) all;
+	$(MAKE) -C $< CC=$(SEABIOSCC) LD=$(SEABIOSLD) PYTHON=$(PYTHON) EXTRAVERSION="-Xen" all;

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#1 lore raw
Quoted 23 lines · Olaf Hering

The buildsystem of seabios always includes the current time and the hostname into the resulting binary. To avoid that, it is required to have a file '.version' in the toplevel directory of seabios-dir-remote. And it is required to pass EXTRAVERSION= to make because its toplevel Makefile does not take EXTRAVERSION from environment.

Adjust the code to create a '.version' file with fixed content. Adjust the code to pass EXTRAVERSION down to make.

--

After commit 1233d253a4 ("firmware/seabios: fix build on systems with non GNU toolchains") this change is now hopefully non-controversial.

---
 tools/firmware/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/firmware/Makefile +0 -0
index 842b48c3d3..b11f1c5970 100644

tools/firmware/Makefile seabios-dir: · line 33

Quoted 4 lines
tools/firmware/Makefile +1 -0
@@ -30,6 +30,8 @@ seabios-dir:
 	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(SEABIOS_UPSTREAM_URL) $(SEABIOS_UPSTREAM_REVISION) seabios-dir
 	cp seabios-config seabios-dir/.config;
 	$(MAKE) -C seabios-dir olddefconfig CC=$(SEABIOSCC) LD=$(SEABIOSLD)
+	rm -f seabios-dir/.version

There is no need to rm -f here because the following > will clear its content anyway.

tools/firmware/Makefile subtree-force-update-all: · line 135

Quoted 10 lines
tools/firmware/Makefile +2 -1
+	echo '$(SEABIOS_UPSTREAM_REVISION)' > seabios-dir/.version
 
 .PHONY: all
 all: $(SUBDIRS-y)
@@ -130,4 +132,4 @@ subtree-force-update-all:
 	$(MAKE) ovmf-dir-force-update
 
 subdir-all-seabios-dir: seabios-dir
-	$(MAKE) -C $< CC=$(SEABIOSCC) LD=$(SEABIOSLD) PYTHON=$(PYTHON) all;
+	$(MAKE) -C $< CC=$(SEABIOSCC) LD=$(SEABIOSLD) PYTHON=$(PYTHON) EXTRAVERSION="-Xen" all;

I would like you to define a SEABIOS_EXTRAVERSION somewhere (along side SEABIOSCC etc) instead of hardcoding -Xen here.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#2 lore raw

Am Wed, 18 Jul 2018 10:39:31 +0100
schrieb Wei Liu <[email protected]>:

Quoted 3 lines

tools/firmware/Makefile seabios-dir: · line 33

Quoted 1 line
tools/firmware/Makefile +1 -0
+	rm -f seabios-dir/.version  

There is no need to rm -f here because the following > will clear its content anyway.

The content of seabios-dir is coming from upstream, ".version" might be a symlink. Thats why I added this rm command.

Olaf

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#3 lore raw
Quoted 9 lines · Olaf Hering

Am Wed, 18 Jul 2018 10:39:31 +0100
schrieb Wei Liu <[email protected]>:

Quoted 3 lines

tools/firmware/Makefile seabios-dir: · line 33

Quoted 1 line
tools/firmware/Makefile +1 -0
+	rm -f seabios-dir/.version  

There is no need to rm -f here because the following > will clear its content anyway.

The content of seabios-dir is coming from upstream, ".version" might be a symlink. Thats why I added this rm command.

Oh, OK. Please leave the rm -f as-is then.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel