[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH RFC 1/7] xen: Introduce XEN_COMPILE_POSIX_TIME



On Mon, Apr 30, 2018 at 09:56:38AM -0600, Jan Beulich wrote:
> >>> On 08.07.17 at 23:53, <daniel.kiper@xxxxxxxxxx> wrote:
> > We need the POSIX time to properly fill the TimeDateStamp field in the PE
> > header.
> >
> > Signed-off-by: Daniel Kiper <daniel.kiper@xxxxxxxxxx>
> > ---
> >  xen/Makefile                 |   14 ++++++++------
> >  xen/include/xen/compile.h.in |    1 +
> >  2 files changed, 9 insertions(+), 6 deletions(-)
> >
> > diff --git a/xen/Makefile b/xen/Makefile
> > index f6a6bc2..2424690 100644
> > --- a/xen/Makefile
> > +++ b/xen/Makefile
> > @@ -6,12 +6,13 @@ export XEN_EXTRAVERSION ?= -unstable$(XEN_VENDORVERSION)
> >  export XEN_FULLVERSION   = 
> > $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
> >  -include xen-version
> >
> > -export XEN_WHOAMI  ?= $(USER)
> > -export XEN_DOMAIN  ?= $(shell ([ -x /bin/dnsdomainname ] && 
> > /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo 
> > [unknown]))
> > -export XEN_BUILD_DATE      ?= $(shell LC_ALL=C date)
> > -export XEN_BUILD_TIME      ?= $(shell LC_ALL=C date +%T)
> > -export XEN_BUILD_HOST      ?= $(shell hostname)
> > -export XEN_CONFIG_EXPERT ?= n
> > +export XEN_WHOAMI          ?= $(USER)
> > +export XEN_DOMAIN          ?= $(shell ([ -x /bin/dnsdomainname ] && 
> > /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo 
> > [unknown]))
> > +export XEN_BUILD_DATE              ?= $(shell LC_ALL=C date)
> > +export XEN_BUILD_TIME              ?= $(shell LC_ALL=C date +%T)
> > +export XEN_BUILD_POSIX_TIME        ?= $(shell LC_ALL=C date +%s)
>
> If you run two independent commands anyway, I don't see why you need to
> obtain the POSIX time here. If you're really after the time stamps agreeing,
> then you should invoke date only once (strictly speaking this also applies to
> the DATE vs TIME invocation, but lets hope people sleep at midnight rather
> than building Xen).

If you wish I can fix this and feed the XEN_BUILD_DATE output into subsequent
date commands.

> > @@ -164,6 +165,7 @@ delete-unfresh-files:
> >  include/xen/compile.h: include/xen/compile.h.in .banner
> >     @sed -e 's/@@date@@/$(XEN_BUILD_DATE)/g' \
> >         -e 's/@@time@@/$(XEN_BUILD_TIME)/g' \
> > +       -e 's/@@posix_time@@/$(XEN_BUILD_POSIX_TIME)/g' \
>
> In order to fill a PE header, do you really need to make this available in
> compile.h?

Why not? I think that we should have all time related constants defined
in one place. Even if one of them is used just only once.

Daniel

PS Your comments come just in time. I am working on the second version
   of the patches.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.