diff mbox

tools/firmware: pass EXTRAVERSION to seabios build

Message ID 20170529075758.GA31939@aepfle.de (mailing list archive)
State New, archived
Headers show

Commit Message

Olaf Hering May 29, 2017, 7:57 a.m. UTC
On Fri, May 26, Ian Jackson wrote:

> This seems like a real problem which should be improved.  But maybe we
> should use Xen's EXTRAVERSION by default ?

After thinking about it, why does the tools build not just enforce a
fixed string? There is no point for scripts/buildversion.py to put
current time and buildhost into the binary. This breaks reproducible
builds. A simple, untested change like this should be enough:


Olaf

Comments

Wei Liu May 30, 2017, 11:33 a.m. UTC | #1
On Mon, May 29, 2017 at 09:57:58AM +0200, Olaf Hering wrote:
> On Fri, May 26, Ian Jackson wrote:
> 
> > This seems like a real problem which should be improved.  But maybe we
> > should use Xen's EXTRAVERSION by default ?
> 
> After thinking about it, why does the tools build not just enforce a
> fixed string? There is no point for scripts/buildversion.py to put
> current time and buildhost into the binary. This breaks reproducible
> builds. A simple, untested change like this should be enough:
> 
> diff --git a/tools/firmware/Makefile b/tools/firmware/Makefile
> index 8562f547bc..c2b5985dc7 100644
> --- a/tools/firmware/Makefile
> +++ b/tools/firmware/Makefile
> @@ -22,6 +22,8 @@ ovmf-dir:
>  seabios-dir:
>  	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(SEABIOS_UPSTREAM_URL) $(SEABIOS_UPSTREAM_REVISION) seabios-dir
>  	cp seabios-config seabios-dir/.config;
> +	rm -f seabios-dir/.version
> +	echo '$(SEABIOS_UPSTREAM_REVISION)' > seabios-dir/.version

Please consider adding a comment before this snippet saying this is for
reproducible build.

>  	$(MAKE) -C seabios-dir olddefconfig
>  
>  .PHONY: all
> @@ -35,7 +37,7 @@ ifeq ($(CONFIG_ROMBIOS),y)
>  	false ; \
>  	fi
>  endif
> -	$(MAKE) $(LD32BIT-y) CC=$(CC) PYTHON=$(PYTHON) subdirs-$@
> +	$(MAKE) $(LD32BIT-y) CC=$(CC) PYTHON=$(PYTHON) EXTRAVERSION="-Xen" subdirs-$@

Why is this needed?

>  
>  
>  .PHONY: install
> 
> Olaf
Wei Liu May 30, 2017, 11:40 a.m. UTC | #2
On Tue, May 30, 2017 at 12:33:15PM +0100, Wei Liu wrote:
> On Mon, May 29, 2017 at 09:57:58AM +0200, Olaf Hering wrote:
> > On Fri, May 26, Ian Jackson wrote:
> > 
> > > This seems like a real problem which should be improved.  But maybe we
> > > should use Xen's EXTRAVERSION by default ?
> > 
> > After thinking about it, why does the tools build not just enforce a
> > fixed string? There is no point for scripts/buildversion.py to put
> > current time and buildhost into the binary. This breaks reproducible
> > builds. A simple, untested change like this should be enough:
> > 
> > diff --git a/tools/firmware/Makefile b/tools/firmware/Makefile
> > index 8562f547bc..c2b5985dc7 100644
> > --- a/tools/firmware/Makefile
> > +++ b/tools/firmware/Makefile
> > @@ -22,6 +22,8 @@ ovmf-dir:
> >  seabios-dir:
> >  	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(SEABIOS_UPSTREAM_URL) $(SEABIOS_UPSTREAM_REVISION) seabios-dir
> >  	cp seabios-config seabios-dir/.config;
> > +	rm -f seabios-dir/.version
> > +	echo '$(SEABIOS_UPSTREAM_REVISION)' > seabios-dir/.version
> 
> Please consider adding a comment before this snippet saying this is for
> reproducible build.
> 
> >  	$(MAKE) -C seabios-dir olddefconfig
> >  
> >  .PHONY: all
> > @@ -35,7 +37,7 @@ ifeq ($(CONFIG_ROMBIOS),y)
> >  	false ; \
> >  	fi
> >  endif
> > -	$(MAKE) $(LD32BIT-y) CC=$(CC) PYTHON=$(PYTHON) subdirs-$@
> > +	$(MAKE) $(LD32BIT-y) CC=$(CC) PYTHON=$(PYTHON) EXTRAVERSION="-Xen" subdirs-$@
> 
> Why is this needed?
> 

What I meant was: this is passing EXTRAVERSION to all subdir targets,
which seems unnecessary to me. And you already specified a version
string for seabios.
Olaf Hering May 30, 2017, 12:25 p.m. UTC | #3
On Tue, May 30, Wei Liu wrote:

> What I meant was: this is passing EXTRAVERSION to all subdir targets,
> which seems unnecessary to me. And you already specified a version
> string for seabios.

True, but scripts/buildversion.py insists on --extra 'whatever'.

Olaf
Wei Liu May 30, 2017, 12:46 p.m. UTC | #4
On Tue, May 30, 2017 at 02:25:11PM +0200, Olaf Hering wrote:
> On Tue, May 30, Wei Liu wrote:
> 
> > What I meant was: this is passing EXTRAVERSION to all subdir targets,
> > which seems unnecessary to me. And you already specified a version
> > string for seabios.
> 
> True, but scripts/buildversion.py insists on --extra 'whatever'.
> 

In that case, can you confine such hackery to be seabios only?

> Olaf
Olaf Hering May 30, 2017, 2:24 p.m. UTC | #5
On Tue, May 30, Wei Liu wrote:

> In that case, can you confine such hackery to be seabios only?

Is it worth the hassle? It seems only ipxe would recognize the
EXTRAVERSION. And how would I actually limit it to seabios? Something
like "make $(filter-out subdir-seabios-dir, subdirs-$@)"?

Olaf
Wei Liu May 30, 2017, 2:35 p.m. UTC | #6
On Tue, May 30, 2017 at 04:24:18PM +0200, Olaf Hering wrote:
> On Tue, May 30, Wei Liu wrote:
> 
> > In that case, can you confine such hackery to be seabios only?
> 
> Is it worth the hassle? It seems only ipxe would recognize the
> EXTRAVERSION. And how would I actually limit it to seabios? Something
> like "make $(filter-out subdir-seabios-dir, subdirs-$@)"?
> 

No, what I meant was something like:

subdirs-seabios-dir: EXTRAVERSION=XXX

Limit it to the one that needs the environment variable -- seabios or
ipxe.
Olaf Hering May 30, 2017, 2:46 p.m. UTC | #7
On Tue, May 30, Wei Liu wrote:

> subdirs-seabios-dir: EXTRAVERSION=XXX
> Limit it to the one that needs the environment variable -- seabios or
> ipxe.

Ok, I will try it. Last time I looked environment did not work.


Olaf
diff mbox

Patch

diff --git a/tools/firmware/Makefile b/tools/firmware/Makefile
index 8562f547bc..c2b5985dc7 100644
--- a/tools/firmware/Makefile
+++ b/tools/firmware/Makefile
@@ -22,6 +22,8 @@  ovmf-dir:
 seabios-dir:
 	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(SEABIOS_UPSTREAM_URL) $(SEABIOS_UPSTREAM_REVISION) seabios-dir
 	cp seabios-config seabios-dir/.config;
+	rm -f seabios-dir/.version
+	echo '$(SEABIOS_UPSTREAM_REVISION)' > seabios-dir/.version
 	$(MAKE) -C seabios-dir olddefconfig
 
 .PHONY: all
@@ -35,7 +37,7 @@  ifeq ($(CONFIG_ROMBIOS),y)
 	false ; \
 	fi
 endif
-	$(MAKE) $(LD32BIT-y) CC=$(CC) PYTHON=$(PYTHON) subdirs-$@
+	$(MAKE) $(LD32BIT-y) CC=$(CC) PYTHON=$(PYTHON) EXTRAVERSION="-Xen" subdirs-$@
 
 
 .PHONY: install