All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Sergey Zhmylev <s.zhmylev@yadro.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH v2] wic: honor the SOURCE_DATE_EPOCH in case of updated fstab
Date: Fri, 14 Oct 2022 08:41:43 +0200	[thread overview]
Message-ID: <Y0kEpyPCOGh/t0pl@mail.local> (raw)
In-Reply-To: <20221013164020.4125847-1-s.zhmylev@yadro.com>

Hi,

This caused:

https://autobuilder.yoctoproject.org/typhoon/#/builders/23/builds/6305/steps/13/logs/stdio

On 13/10/2022 19:40:20+0300, Sergey Zhmylev wrote:
> From: Sergei Zhmylev <s.zhmylev@yadro.com>
> 
> In case user requested to build a binary repeatable package,
> it's required to honor the SOURCE_DATE_EPOCH environment
> variable. So forcefully set mtime inside all the routines
> which modify fstab in case it is updated.
> 
> Signed-off-by: Sergei Zhmylev <s.zhmylev@yadro.com>
> ---
>  scripts/lib/wic/partition.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
> index e50871b8d7..cac1bab4dd 100644
> --- a/scripts/lib/wic/partition.py
> +++ b/scripts/lib/wic/partition.py
> @@ -291,6 +291,9 @@ class Partition():
>          if self.updated_fstab_path and self.has_fstab and not self.no_fstab_update:
>              debugfs_script_path = os.path.join(cr_workdir, "debugfs_script")
>              with open(debugfs_script_path, "w") as f:
> +                if os.getenv('SOURCE_DATE_EPOCH'):
> +                    fstab_time = int(os.getenv('SOURCE_DATE_EPOCH'))
> +                    f.write("set_current_time %s\n" % (fstab_time))
>                  f.write("cd etc\n")
>                  f.write("rm fstab\n")
>                  f.write("write %s fstab\n" % (self.updated_fstab_path))
> @@ -353,7 +356,7 @@ class Partition():
>          exec_native_cmd(mcopy_cmd, native_sysroot)
>  
>          if self.updated_fstab_path and self.has_fstab and not self.no_fstab_update:
> -            mcopy_cmd = "mcopy -i %s %s ::/etc/fstab" % (rootfs, self.updated_fstab_path)
> +            mcopy_cmd = "mcopy -m -i %s %s ::/etc/fstab" % (rootfs, self.updated_fstab_path)
>              exec_native_cmd(mcopy_cmd, native_sysroot)
>  
>          chmod_cmd = "chmod 644 %s" % rootfs
> -- 
> 2.37.2
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#171718): https://lists.openembedded.org/g/openembedded-core/message/171718
> Mute This Topic: https://lists.openembedded.org/mt/94308156/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 


-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


      reply	other threads:[~2022-10-14  6:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-13 16:40 [PATCH v2] wic: honor the SOURCE_DATE_EPOCH in case of updated fstab s.zhmylev
2022-10-14  6:41 ` Alexandre Belloni [this message]

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=Y0kEpyPCOGh/t0pl@mail.local \
    --to=alexandre.belloni@bootlin.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=s.zhmylev@yadro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.