mirror of
https://git.yoctoproject.org/poky
synced 2026-09-12 15:49:36 +02: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: 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>
This commit is contained in:
committed by
Richard Purdie
parent
03a7c1df50
commit
7a31cf96eb
@@ -293,6 +293,11 @@ class Partition():
|
||||
f.write("cd etc\n")
|
||||
f.write("rm fstab\n")
|
||||
f.write("write %s fstab\n" % (self.updated_fstab_path))
|
||||
if os.getenv('SOURCE_DATE_EPOCH'):
|
||||
fstab_time = int(os.getenv('SOURCE_DATE_EPOCH'))
|
||||
for time in ["atime", "mtime", "ctime"]:
|
||||
f.write("set_inode_field fstab %s %s\n" % (time, hex(fstab_time)))
|
||||
f.write("set_inode_field fstab %s_extra 0\n" % (time))
|
||||
debugfs_cmd = "debugfs -w -f %s %s" % (debugfs_script_path, rootfs)
|
||||
exec_native_cmd(debugfs_cmd, native_sysroot)
|
||||
|
||||
@@ -352,7 +357,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
|
||||
|
||||
Reference in New Issue
Block a user