From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail03.groups.io (mail03.groups.io [45.79.227.220]) by spool.mail.gandi.net (Postfix) with ESMTPS id D5441740048 for ; Fri, 12 Apr 2024 08:52:56 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=eiwgtnUT8ojMZbn/SetnHuxq/CRntGcGKxOsKGJlKmg=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe; s=20240206; t=1712911975; v=1; b=yGwcg79Kybp7c/mM4Ccrih6RWM3bmwkQ7a8NUzI7B1qRw8lBcoUUO9lETosyblxDDwEWBxL/ f/HQn4UFPGCljG8bMAxDGzkYgXoFq3qIJGmKbj7ihU5FPK9JvFu1EagTt3m9RbZrQXYvypEMbzB sToRUDaIGqMNvIcoIpDspwrbQ7keYve+x1lrRb/XchsIOmS8hY3eg/nfI7sWWgWwbw06Eq8CLJ9 zHNf8YqoyqIJTSlsBRLYqtpo9zebJke6llzfUgBlZY1dO3RHu77Sba/BZAOUoSDWY5ZjM6KEr5/ Wg6PRU6d6HpL+pAYzPcKxqQNjd3ip4pEYfUlNL6YPAt2Q== X-Received: by 127.0.0.2 with SMTP id 7SgCYY7687511xfZB9fsveHa; Fri, 12 Apr 2024 01:52:55 -0700 X-Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by mx.groups.io with SMTP id smtpd.web10.41320.1712906761308834900 for ; Fri, 12 Apr 2024 00:26:01 -0700 X-Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-6ece8991654so634058b3a.3 for ; Fri, 12 Apr 2024 00:26:01 -0700 (PDT) X-Gm-Message-State: Ik6Fwsxd71iSi1noPMH7qYZzx7686176AA= X-Google-Smtp-Source: AGHT+IHznMZDiU2YJknw9QDeHBwjsYDNT3r44BuCJM4y4W1bbypInoBi3nvLMMHb3yxQAei8SKNDWQ== X-Received: by 2002:a05:6a21:328d:b0:1a9:694b:e1f with SMTP id yt13-20020a056a21328d00b001a9694b0e1fmr2467770pzb.2.1712906760514; Fri, 12 Apr 2024 00:26:00 -0700 (PDT) X-Received: from linux-l9pv.suse ([124.11.22.254]) by smtp.gmail.com with ESMTPSA id x23-20020a056a000bd700b006e6b180d87asm2309759pfu.35.2024.04.12.00.25.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2024 00:26:00 -0700 (PDT) From: "Lee, Chun-Yi" X-Google-Original-From: "Lee, Chun-Yi" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Pete Batard , Chun-Yi Lee Subject: [edk2-devel] [PATCH] EmbeddedPkg/VirtualRealTimeClockLib: Support SOURCE_DATE_EPOCH Date: Fri, 12 Apr 2024 15:25:56 +0800 Message-Id: <20240412072556.30677-1-jlee@suse.com> Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Fri, 12 Apr 2024 01:52:54 -0700 Resent-From: joeyli.kernel@gmail.com Reply-To: devel@edk2.groups.io,joeyli.kernel@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=yGwcg79K; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.227.220 as permitted sender) smtp.mailfrom=bounce@groups.io From: Chun-Yi Lee RISC-V ovmf used VirtualRealTimeClockLib but the default epoch is a compilation time. It causes that the RISC-V ovmf binary image is NOT reproducible. This patch added the support of SOURCE_DATE_EPOCH by printenv command. If SOURCE_DATE_EPOCH be found then we use it as BUILD_EPOCH. Otherwise we run date command for setting BUILD_EPOCH. For distributions want a reproducible RISC-V ovmf image, they should export SOURCE_DATE_EPOCH environment variable before building ovmf. References: https://reproducible-builds.org/docs/source-date-epoch/ Cc: Pete Batard Cc: Ard Biesheuvel Signed-off-by: Chun-Yi Lee --- .../Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf b/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf index 5d0f867..285e880 100644 --- a/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf +++ b/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf @@ -34,4 +34,4 @@ # Current usage of this library expects GCC in a UNIX-like shell environment with the date command [BuildOptions] - GCC:*_*_*_CC_FLAGS = -DBUILD_EPOCH=`date +%s` + GCC:*_*_*_CC_FLAGS = -DBUILD_EPOCH=`printenv SOURCE_DATE_EPOCH || date +%s` -- 2.35.3 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117664): https://edk2.groups.io/g/devel/message/117664 Mute This Topic: https://groups.io/mt/105479031/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-