[1/2] cibuilder.py: Add source_date_epoch to build configuration

Message ID 20221219144147.31245-2-venkata.pyla@toshiba-tsip.com
State Accepted, archived
Headers show
Series Test for verifiying reproducible images | expand

Commit Message

venkata.pyla@toshiba-tsip.com Dec. 19, 2022, 2:41 p.m. UTC
From: venkata pyla <venkata.pyla@toshiba-tsip.com>

This variable sets the SOURCE_DATE_EPOCH variable for the reproducible
builds check.

Importance of this vairable for the reproducible builds can find here [1]

[1] https://reproducible-builds.org/docs/source-date-epoch/

Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
---
 testsuite/cibuilder.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch

diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
index d5c83b2..956d795 100755
--- a/testsuite/cibuilder.py
+++ b/testsuite/cibuilder.py
@@ -54,7 +54,7 @@  class CIBuilder(Test):
 
     def configure(self, compat_arch=True, cross=None, debsrc_cache=False,
                   container=False, ccache=False, sstate=False, offline=False,
-                  gpg_pub_key=None, wic_deploy_parts=False, **kwargs):
+                  gpg_pub_key=None, wic_deploy_parts=False, source_date_epoch=None, **kwargs):
         # write configuration file and set bitbake_args
         # can run multiple times per test case
         self.check_init()
@@ -78,6 +78,7 @@  class CIBuilder(Test):
                       f'  sstate = {sstate}\n'
                       f'  gpg_pub_key = {gpg_pub_key}\n'
                       f'  wic_deploy_parts = {wic_deploy_parts}\n'
+                      f'  source_date_epoch = {source_date_epoch} \n'
                       f'===================================================')
 
         # determine bitbake_args
@@ -113,6 +114,8 @@  class CIBuilder(Test):
             if ccache:
                 f.write('USE_CCACHE = "1"\n')
                 f.write('CCACHE_TOP_DIR = "${TOPDIR}/ccache"\n')
+            if source_date_epoch:
+                f.write('SOURCE_DATE_EPOCH = "%s"\n' % source_date_epoch)
 
         # include ci_build.conf in local.conf
         with open(self.build_dir + '/conf/local.conf', 'r+') as f: