diff options
author | Sergei Zhmylev <s.zhmylev@yadro.com> | 2022-10-21 17:56:22 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-10-26 12:28:39 +0100 |
commit | 0ee936da2eaf3b5581864d94c9091ca59db1f8bd (patch) | |
tree | 0a2da97a8797dbf4f34bc0156187e4600d62179c /scripts/lib/wic/plugins/imager/direct.py | |
parent | 0cc7ac200d8c8bbdb6b5ed037ab2cd705338d446 (diff) | |
download | poky-0ee936da2eaf3b5581864d94c9091ca59db1f8bd.tar.gz |
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>
Diffstat (limited to 'scripts/lib/wic/plugins/imager/direct.py')
-rw-r--r-- | scripts/lib/wic/plugins/imager/direct.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py index 6faa16bf9b..58965b75da 100644 --- a/scripts/lib/wic/plugins/imager/direct.py +++ b/scripts/lib/wic/plugins/imager/direct.py | |||
@@ -149,6 +149,9 @@ class DirectPlugin(ImagerPlugin): | |||
149 | self.updated_fstab_path = os.path.join(self.workdir, "fstab") | 149 | self.updated_fstab_path = os.path.join(self.workdir, "fstab") |
150 | with open(self.updated_fstab_path, "w") as f: | 150 | with open(self.updated_fstab_path, "w") as f: |
151 | f.writelines(fstab_lines) | 151 | f.writelines(fstab_lines) |
152 | if os.getenv('SOURCE_DATE_EPOCH'): | ||
153 | fstab_time = int(os.getenv('SOURCE_DATE_EPOCH')) | ||
154 | os.utime(self.updated_fstab_path, (fstab_time, fstab_time)) | ||
152 | 155 | ||
153 | def _full_path(self, path, name, extention): | 156 | def _full_path(self, path, name, extention): |
154 | """ Construct full file path to a file we generate. """ | 157 | """ Construct full file path to a file we generate. """ |