1
0
mirror of https://git.yoctoproject.org/poky synced 2026-07-17 04:07:06 +00:00

wic: honor the SOURCE_DATE_EPOCH in case of updated fstab

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.

(From OE-Core rev: 99719a3712a88dce8450994d995803e126e49115)

Signed-off-by: Sergei Zhmylev <s.zhmylev@yadro.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Sergei Zhmylev
2022-10-21 17:56:22 +03:00
committed by Richard Purdie
parent 0cc7ac200d
commit 0ee936da2e
3 changed files with 10 additions and 2 deletions
+3
View File
@@ -149,6 +149,9 @@ class DirectPlugin(ImagerPlugin):
self.updated_fstab_path = os.path.join(self.workdir, "fstab")
with open(self.updated_fstab_path, "w") as f:
f.writelines(fstab_lines)
if os.getenv('SOURCE_DATE_EPOCH'):
fstab_time = int(os.getenv('SOURCE_DATE_EPOCH'))
os.utime(self.updated_fstab_path, (fstab_time, fstab_time))
def _full_path(self, path, name, extention):
""" Construct full file path to a file we generate. """