[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 1/2] hvmloader: remove timestamp from smbios
On 03/02/15 15:54, Olaf Hering wrote: > Including a timestamp into the binary makes it impossible to get > reproducible binaries. Remove the timestamp because it carries no > valuable info. > > Signed-off-by: Olaf Hering <olaf@xxxxxxxxx> > Cc: Keir Fraser <keir@xxxxxxx> > Cc: Jan Beulich <jbeulich@xxxxxxxx> > Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> > Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> > Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx> > Cc: Ian Campbell <ian.campbell@xxxxxxxxxx> > Cc: Wei Liu <wei.liu2@xxxxxxxxxx> > --- I agree with the sentiment, but this is not how to do it. A release date is part of the SMBIOS spec, and the change below results in a malformed smbios table (stale p->release_date_str = 3; pointer) A better approach would be to derive the date from the commit date of HEAD, which would be consistent across rebuilds. ~Andrew > tools/firmware/hvmloader/Makefile | 1 - > tools/firmware/hvmloader/smbios.c | 8 -------- > 2 files changed, 9 deletions(-) > > diff --git a/tools/firmware/hvmloader/Makefile > b/tools/firmware/hvmloader/Makefile > index b759e81..b4cdaae 100644 > --- a/tools/firmware/hvmloader/Makefile > +++ b/tools/firmware/hvmloader/Makefile > @@ -88,7 +88,6 @@ all: subdirs-all > $(MAKE) hvmloader > > ovmf.o rombios.o seabios.o hvmloader.o: roms.inc > -smbios.o: CFLAGS += -D__SMBIOS_DATE__="\"$(shell date +%m/%d/%Y)\"" > > hvmloader: $(OBJS) acpi/acpi.a > $(LD) $(LDFLAGS_DIRECT) -N -Ttext $(LOADADDR) -o hvmloader.tmp $^ > diff --git a/tools/firmware/hvmloader/smbios.c > b/tools/firmware/hvmloader/smbios.c > index 4d3d692..f48465e 100644 > --- a/tools/firmware/hvmloader/smbios.c > +++ b/tools/firmware/hvmloader/smbios.c > @@ -381,7 +381,6 @@ smbios_type_0_init(void *start, const char *xen_version, > uint32_t xen_major_version, uint32_t xen_minor_version) > { > struct smbios_type_0 *p = (struct smbios_type_0 *)start; > - static const char *smbios_release_date = __SMBIOS_DATE__; > const char *s; > void *pts; > uint32_t length; > @@ -427,9 +426,6 @@ smbios_type_0_init(void *start, const char *xen_version, > strcpy((char *)start, s); > start += strlen(s) + 1; > > - strcpy((char *)start, smbios_release_date); > - start += strlen(smbios_release_date) + 1; > - > *((uint8_t *)start) = 0; > return start + 1; > } > @@ -789,7 +785,6 @@ static void * > smbios_type_22_init(void *start) > { > struct smbios_type_22 *p = (struct smbios_type_22 *)start; > - static const char *smbios_release_date = __SMBIOS_DATE__; > const char *s; > void *pts; > uint32_t length; > @@ -837,9 +832,6 @@ smbios_type_22_init(void *start) > strcpy((char *)start, s); > start += strlen(s) + 1; > > - strcpy((char *)start, smbios_release_date); > - start += strlen(smbios_release_date) + 1; > - > s = xenstore_read(HVM_XS_BATTERY_DEVICE_NAME, "XEN-VBAT"); > strcpy((char *)start, s); > start += strlen(s) + 1; _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |