From: venkata.pyla@toshiba-tsip.com
To: isar-users@googlegroups.com
Cc: venkata pyla <venkata.pyla@toshiba-tsip.com>,
jan.kiszka@siemens.com, kazuhiro3.hayashi@toshiba.co.jp,
dinesh.kumar@toshiba-tsip.com, felix.moessbauer@siemens.com
Subject: [PATCH] wic:rootfs-u-boot.py: Set timestamps for newly updated files
Date: Wed, 6 Dec 2023 19:57:47 +0530 [thread overview]
Message-ID: <20231206142747.14117-1-venkata.pyla@toshiba-tsip.com> (raw)
From: venkata pyla <venkata.pyla@toshiba-tsip.com>
The u-boot rootfs image is not reproducible because the
`update-u-boot-script` is creating new files with build timestamps,
whereas the rootfs files timestamps are set to SOURCE_DATE_EPOCH during
do_rootfs_finalize task and so for set the timestamps for the newly
updated files.
Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
---
meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py b/meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py
index 93600dc2..b7011775 100644
--- a/meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py
+++ b/meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py
@@ -106,6 +106,15 @@ class RootfsUBootPlugin(RootfsPlugin):
rm_cmd = "rm -f %s/usr/bin/%s" % (real_rootfs_dir, qemu_static)
exec_cmd(rm_cmd)
+ # For reproducibility set the time stamp of newly updated files
+ if os.getenv('SOURCE_DATE_EPOCH'):
+ sde_time = int(os.getenv('SOURCE_DATE_EPOCH'))
+ os.utime(u_boot_script, (sde_time, sde_time))
+ os.utime(os.path.join(real_rootfs_dir, "boot/boot.scr"),
+ (sde_time, sde_time))
+ os.utime(os.path.join(real_rootfs_dir, "tmp"),
+ (sde_time, sde_time))
+
RootfsPlugin.do_prepare_partition(part, source_params, cr, cr_workdir,
oe_builddir, bootimg_dir, kernel_dir,
krootfs_dir, native_sysroot)
--
2.20.1
next reply other threads:[~2023-12-06 14:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-06 14:27 venkata.pyla [this message]
2023-12-07 0:53 ` Jan Kiszka
2023-12-14 7:15 ` Uladzimir Bely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231206142747.14117-1-venkata.pyla@toshiba-tsip.com \
--to=venkata.pyla@toshiba-tsip.com \
--cc=dinesh.kumar@toshiba-tsip.com \
--cc=felix.moessbauer@siemens.com \
--cc=isar-users@googlegroups.com \
--cc=jan.kiszka@siemens.com \
--cc=kazuhiro3.hayashi@toshiba.co.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox