From patchwork Sat Oct 31 15:14:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?RnLDqWTDqXJpYyBQaWVycmV0?= X-Patchwork-Id: 11871471 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C7CAF61C for ; Sat, 31 Oct 2020 15:15:14 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 83CB52224A for ; Sat, 31 Oct 2020 15:15:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=qubes-os.org header.i=frederic.pierret@qubes-os.org header.b="FcdcVBgk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 83CB52224A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=qubes-os.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.16957.41738 (Exim 4.92) (envelope-from ) id 1kYsaU-0006qt-9T; Sat, 31 Oct 2020 15:14:38 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 16957.41738; Sat, 31 Oct 2020 15:14:38 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kYsaU-0006qk-5W; Sat, 31 Oct 2020 15:14:38 +0000 Received: by outflank-mailman (input) for mailman id 16957; Sat, 31 Oct 2020 15:14:36 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kYsaS-0006qP-8L for xen-devel@lists.xenproject.org; Sat, 31 Oct 2020 15:14:36 +0000 Received: from sender4-of-o57.zoho.com (unknown [136.143.188.57]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 9fef08cc-86a5-415a-9c64-964aed3b21bb; Sat, 31 Oct 2020 15:14:35 +0000 (UTC) Received: from localhost.localdomain (92.188.110.153 [92.188.110.153]) by mx.zohomail.com with SMTPS id 1604157261060530.2165278307001; Sat, 31 Oct 2020 08:14:21 -0700 (PDT) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kYsaS-0006qP-8L for xen-devel@lists.xenproject.org; Sat, 31 Oct 2020 15:14:36 +0000 X-Inumbo-ID: 9fef08cc-86a5-415a-9c64-964aed3b21bb Received: from sender4-of-o57.zoho.com (unknown [136.143.188.57]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 9fef08cc-86a5-415a-9c64-964aed3b21bb; Sat, 31 Oct 2020 15:14:35 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; t=1604157262; cv=none; d=zohomail.com; s=zohoarc; b=SJzQFa6rplIFNlFuqeX6Mn2B8ZGQZ2MoLnjSvnQ0EFgZh5FBAXvqJ+YAf1QP3bYeRQ4Le1Ls6ndaxHAj98uUQIMGJ7qmZ1+g+V0wggv1HZhJ5MZ+WcBIKsgjWSiX0JmU02nAkwZ/CtRJ1f++B6M+QcS2NP9o9h532RBlLi5LvoI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604157262; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=9aLrfxdEKAfK4nVPDcKmv48q+Kbtqnpq+yQnWMhB+SE=; b=Gmagl4JfeOcKxP1wPtLRBQwnluouqR74jLvOYhHEcAp+KGa3QSGxvFp8jtqi5nO9utvLA1DAlesL2H6iq84mPZ0yTxt4H4Nm7LFrUb40PofknnRWrV3lpZdelh4egvvcYo5Ml4TNfJP+hbE/b8XnxKcYxSyjKNbtKlw+jfbupts= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=qubes-os.org; spf=pass smtp.mailfrom=frederic.pierret@qubes-os.org; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1604157262; s=s; d=qubes-os.org; i=frederic.pierret@qubes-os.org; h=From:To:Cc:Message-ID:Subject:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type; bh=9aLrfxdEKAfK4nVPDcKmv48q+Kbtqnpq+yQnWMhB+SE=; b=FcdcVBgkzFZnqlwgpGr1142jiaQxdjAaZWHK9eAx1TzzgEpwpu5hj4vlFaBhoAx3 APEtfHXcRwR2bJvasLaDduK4OTvX0Fho8MaOVd//gBlEGHb2oB3DUFl6aBZ4f7Basli 5P5MjbIwebpCu/QdaT1It7Upe5H0wy4b9cPspYHw= Received: from localhost.localdomain (92.188.110.153 [92.188.110.153]) by mx.zohomail.com with SMTPS id 1604157261060530.2165278307001; Sat, 31 Oct 2020 08:14:21 -0700 (PDT) From: =?utf-8?q?Fr=C3=A9d=C3=A9ric_Pierret_=28fepitre=29?= To: xen-devel@lists.xenproject.org Cc: =?utf-8?q?Fr=C3=A9d=C3=A9ric_Pierret_=28fepitre=29?= , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Wei Liu , Ian Jackson , George Dunlap , Julien Grall , Stefano Stabellini Message-ID: <57423c6627e00fbc3f41d3f6be6ba1e15abb96fc.1604156731.git.frederic.pierret@qubes-os.org> Subject: [PATCH v1 1/2] Define build dates/time based on SOURCE_DATE_EPOCH Date: Sat, 31 Oct 2020 16:14:07 +0100 X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 X-ZohoMailClient: External It improves reproducibility if SOURCE_DATE_EPOCH is defined while building xen binary --- tools/firmware/hvmloader/Makefile | 4 ++++ tools/firmware/vgabios/Makefile | 4 ++++ xen/Makefile | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/tools/firmware/hvmloader/Makefile b/tools/firmware/hvmloader/Makefile index e980ce7c5f..923e3c8b9a 100644 --- a/tools/firmware/hvmloader/Makefile +++ b/tools/firmware/hvmloader/Makefile @@ -21,7 +21,11 @@ XEN_ROOT = $(CURDIR)/../../.. include $(XEN_ROOT)/tools/firmware/Rules.mk # SMBIOS spec requires format mm/dd/yyyy +ifneq ($(SOURCE_DATE_EPOCH),) +SMBIOS_REL_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+%m/%d/%Y" 2>/dev/null) +else SMBIOS_REL_DATE ?= $(shell date +%m/%d/%Y) +endif CFLAGS += $(CFLAGS_xeninclude) diff --git a/tools/firmware/vgabios/Makefile b/tools/firmware/vgabios/Makefile index 3284812fde..9b8b687a73 100644 --- a/tools/firmware/vgabios/Makefile +++ b/tools/firmware/vgabios/Makefile @@ -5,7 +5,11 @@ BCC = bcc AS86 = as86 RELEASE = `pwd | sed "s-.*/--"` +ifneq ($(SOURCE_DATE_EPOCH),) +VGABIOS_REL_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+%d %b %Y" 2>/dev/null) +else VGABIOS_REL_DATE ?= `date '+%d %b %Y'` +endif RELVERS = `pwd | sed "s-.*/--" | sed "s/vgabios//" | sed "s/-//"` VGABIOS_DATE = "-DVGABIOS_DATE=\"$(VGABIOS_REL_DATE)\"" diff --git a/xen/Makefile b/xen/Makefile index bf0c804d43..30b1847515 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -8,8 +8,13 @@ export XEN_FULLVERSION = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION) export XEN_WHOAMI ?= $(USER) export XEN_DOMAIN ?= $(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown])) +ifneq ($(SOURCE_DATE_EPOCH),) +export XEN_BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" 2>/dev/null) +export XEN_BUILD_TIME ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" +%T 2>/dev/null) +else export XEN_BUILD_DATE ?= $(shell LC_ALL=C date) export XEN_BUILD_TIME ?= $(shell LC_ALL=C date +%T) +endif export XEN_BUILD_HOST ?= $(shell hostname) # Best effort attempt to find a python interpreter, defaulting to Python 3 if