All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/firmware: pass EXTRAVERSION to seabios build
@ 2017-05-26 12:41 Olaf Hering
  2017-05-26 14:04 ` Ian Jackson
  0 siblings, 1 reply; 10+ messages in thread
From: Olaf Hering @ 2017-05-26 12:41 UTC (permalink / raw)
  To: xen-devel; +Cc: Wei Liu, Olaf Hering, Ian Jackson

Having a fixed version string in the seabios binary is cumbersome:
 - it is required to write something to '.version' in the toplevel
   directory of seabios-dir-remove.
 - it is required to pass EXTRAVERSION= to make.

The latter is impossible without this change. For some reason an 'export
EXTRAVERSION=something' prior to 'make tools' is not sufficient. It has
to be passed in as cmdline option to make.

Add a make variable SEABIOS_EXTRAVERSION= and pass it to make.
Allow changing the default via the environment.
Document the new variable in INSTALL.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 INSTALL                 | 2 ++
 tools/firmware/Makefile | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/INSTALL b/INSTALL
index 58359da380..96245505d7 100644
--- a/INSTALL
+++ b/INSTALL
@@ -279,6 +279,8 @@ CHECKPOLICY=
 Use clang instead of GCC.
 clang=y
 
+The version string of the built-in seabios can be adjusted with:
+SEABIOS_EXTRAVERSION=
 
 Systemd support
 ===============
diff --git a/tools/firmware/Makefile b/tools/firmware/Makefile
index 8562f547bc..fcc9754b08 100644
--- a/tools/firmware/Makefile
+++ b/tools/firmware/Makefile
@@ -5,6 +5,8 @@ include $(XEN_ROOT)/tools/Rules.mk
 TARGET      := hvmloader/hvmloader
 INST_DIR := $(DESTDIR)$(XENFIRMWAREDIR)
 
+SEABIOS_EXTRAVERSION ?= "-prebuilt.xen.org"
+
 SUBDIRS-y :=
 SUBDIRS-$(CONFIG_OVMF) += ovmf-dir
 SUBDIRS-$(CONFIG_SEABIOS) += seabios-dir
@@ -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=$(SEABIOS_EXTRAVERSION) subdirs-$@
 
 
 .PHONY: install

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] tools/firmware: pass EXTRAVERSION to seabios build
  2017-05-26 12:41 [PATCH] tools/firmware: pass EXTRAVERSION to seabios build Olaf Hering
@ 2017-05-26 14:04 ` Ian Jackson
  2017-05-29  7:57   ` Olaf Hering
  0 siblings, 1 reply; 10+ messages in thread
From: Ian Jackson @ 2017-05-26 14:04 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Wei Liu, xen-devel

Olaf Hering writes ("[PATCH] tools/firmware: pass EXTRAVERSION to seabios build"):
> Having a fixed version string in the seabios binary is cumbersome:
>  - it is required to write something to '.version' in the toplevel
>    directory of seabios-dir-remove.
>  - it is required to pass EXTRAVERSION= to make.

I can't quite parse this, but:

> The latter is impossible without this change. For some reason an 'export
> EXTRAVERSION=something' prior to 'make tools' is not sufficient. It has
> to be passed in as cmdline option to make.

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

> +SEABIOS_EXTRAVERSION ?= "-prebuilt.xen.org"

I think this is a rather odd default value.  This image is precisely
not prebuild, for example.  Also I don't think a domain name is really
the right thing here.

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] tools/firmware: pass EXTRAVERSION to seabios build
  2017-05-26 14:04 ` Ian Jackson
@ 2017-05-29  7:57   ` Olaf Hering
  2017-05-30 11:33     ` Wei Liu
  0 siblings, 1 reply; 10+ messages in thread
From: Olaf Hering @ 2017-05-29  7:57 UTC (permalink / raw)
  To: Ian Jackson; +Cc: Wei Liu, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1192 bytes --]

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
 	$(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

Olaf

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] tools/firmware: pass EXTRAVERSION to seabios build
  2017-05-29  7:57   ` Olaf Hering
@ 2017-05-30 11:33     ` Wei Liu
  2017-05-30 11:40       ` Wei Liu
  0 siblings, 1 reply; 10+ messages in thread
From: Wei Liu @ 2017-05-30 11:33 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Wei Liu, Ian Jackson, xen-devel

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



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] tools/firmware: pass EXTRAVERSION to seabios build
  2017-05-30 11:33     ` Wei Liu
@ 2017-05-30 11:40       ` Wei Liu
  2017-05-30 12:25         ` Olaf Hering
  0 siblings, 1 reply; 10+ messages in thread
From: Wei Liu @ 2017-05-30 11:40 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Wei Liu, Ian Jackson, xen-devel

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.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] tools/firmware: pass EXTRAVERSION to seabios build
  2017-05-30 11:40       ` Wei Liu
@ 2017-05-30 12:25         ` Olaf Hering
  2017-05-30 12:46           ` Wei Liu
  0 siblings, 1 reply; 10+ messages in thread
From: Olaf Hering @ 2017-05-30 12:25 UTC (permalink / raw)
  To: Wei Liu; +Cc: Ian Jackson, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 267 bytes --]

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

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] tools/firmware: pass EXTRAVERSION to seabios build
  2017-05-30 12:25         ` Olaf Hering
@ 2017-05-30 12:46           ` Wei Liu
  2017-05-30 14:24             ` Olaf Hering
  0 siblings, 1 reply; 10+ messages in thread
From: Wei Liu @ 2017-05-30 12:46 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian Jackson, Wei Liu, xen-devel

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



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] tools/firmware: pass EXTRAVERSION to seabios build
  2017-05-30 12:46           ` Wei Liu
@ 2017-05-30 14:24             ` Olaf Hering
  2017-05-30 14:35               ` Wei Liu
  0 siblings, 1 reply; 10+ messages in thread
From: Olaf Hering @ 2017-05-30 14:24 UTC (permalink / raw)
  To: Wei Liu; +Cc: Ian Jackson, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 295 bytes --]

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

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] tools/firmware: pass EXTRAVERSION to seabios build
  2017-05-30 14:24             ` Olaf Hering
@ 2017-05-30 14:35               ` Wei Liu
  2017-05-30 14:46                 ` Olaf Hering
  0 siblings, 1 reply; 10+ messages in thread
From: Wei Liu @ 2017-05-30 14:35 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian Jackson, Wei Liu, xen-devel

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.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] tools/firmware: pass EXTRAVERSION to seabios build
  2017-05-30 14:35               ` Wei Liu
@ 2017-05-30 14:46                 ` Olaf Hering
  0 siblings, 0 replies; 10+ messages in thread
From: Olaf Hering @ 2017-05-30 14:46 UTC (permalink / raw)
  To: Wei Liu; +Cc: Ian Jackson, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 224 bytes --]

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

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-05-30 14:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-26 12:41 [PATCH] tools/firmware: pass EXTRAVERSION to seabios build Olaf Hering
2017-05-26 14:04 ` Ian Jackson
2017-05-29  7:57   ` Olaf Hering
2017-05-30 11:33     ` Wei Liu
2017-05-30 11:40       ` Wei Liu
2017-05-30 12:25         ` Olaf Hering
2017-05-30 12:46           ` Wei Liu
2017-05-30 14:24             ` Olaf Hering
2017-05-30 14:35               ` Wei Liu
2017-05-30 14:46                 ` Olaf Hering

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.