diff options
author | Sergei Zhmylev <s.zhmylev@yadro.com> | 2022-10-21 17:56:22 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-11-10 14:39:24 +0000 |
commit | 7a31cf96eb47049f4cefe6e7f1eaaad32db8730c (patch) | |
tree | 85c21710922f306d823fd8e5602a3b5f8d559604 /scripts/lib/wic/plugins/imager/direct.py | |
parent | 03a7c1df50e789b2d632042d29e15b4d76685696 (diff) | |
download | poky-7a31cf96eb47049f4cefe6e7f1eaaad32db8730c.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: 2671667f33d0eac1425db3fc4dff56d4eed1eb3c)
Signed-off-by: Sergei Zhmylev <s.zhmylev@yadro.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 99719a3712a88dce8450994d995803e126e49115)
Signed-off-by: Steve Sakoman <steve@sakoman.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 4d0b836ef6..685d19b30f 100644 --- a/scripts/lib/wic/plugins/imager/direct.py +++ b/scripts/lib/wic/plugins/imager/direct.py | |||
@@ -148,6 +148,9 @@ class DirectPlugin(ImagerPlugin): | |||
148 | self.updated_fstab_path = os.path.join(self.workdir, "fstab") | 148 | self.updated_fstab_path = os.path.join(self.workdir, "fstab") |
149 | with open(self.updated_fstab_path, "w") as f: | 149 | with open(self.updated_fstab_path, "w") as f: |
150 | f.writelines(fstab_lines) | 150 | f.writelines(fstab_lines) |
151 | if os.getenv('SOURCE_DATE_EPOCH'): | ||
152 | fstab_time = int(os.getenv('SOURCE_DATE_EPOCH')) | ||
153 | os.utime(self.updated_fstab_path, (fstab_time, fstab_time)) | ||
151 | 154 | ||
152 | def _full_path(self, path, name, extention): | 155 | def _full_path(self, path, name, extention): |
153 | """ Construct full file path to a file we generate. """ | 156 | """ Construct full file path to a file we generate. """ |