public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: venkata.pyla@toshiba-tsip.com, isar-users@googlegroups.com
Cc: kazuhiro3.hayashi@toshiba.co.jp, dinesh.kumar@toshiba-tsip.com,
	felix.moessbauer@siemens.com
Subject: Re: [PATCH] wic:rootfs-u-boot.py: Set timestamps for newly updated files
Date: Thu, 7 Dec 2023 09:53:46 +0900	[thread overview]
Message-ID: <c2eb930c-da7a-40bc-93ac-193d38183caa@siemens.com> (raw)
In-Reply-To: <20231206142747.14117-1-venkata.pyla@toshiba-tsip.com>

On 06.12.23 22:27, venkata.pyla@toshiba-tsip.com wrote:
> 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)

Good catch! Looks fine to me.

Thanks,
Jan

-- 
Siemens AG, Technology
Linux Expert Center


  reply	other threads:[~2023-12-07  0:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-06 14:27 venkata.pyla
2023-12-07  0:53 ` Jan Kiszka [this message]
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=c2eb930c-da7a-40bc-93ac-193d38183caa@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=dinesh.kumar@toshiba-tsip.com \
    --cc=felix.moessbauer@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=kazuhiro3.hayashi@toshiba.co.jp \
    --cc=venkata.pyla@toshiba-tsip.com \
    /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