summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorvenkata pyla <venkata.pyla@toshiba-tsip.com>2023-12-18 10:00:30 +0530
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-12-21 10:38:30 +0000
commitbc8ca0bacc913aea7fe16982f04074f36e61f800 (patch)
tree6ecc57b7702c63ed0280d860d2b0f7cf6f063333 /scripts/lib
parent16a3fde3fa77b12792d70b201c07a98e05ada492 (diff)
downloadpoky-bc8ca0bacc913aea7fe16982f04074f36e61f800.tar.gz
wic: use E2FSPROGS_FAKE_TIME and hash_seed to generate reproducible ext4 images
E2FSPROGS_FAKE_TIME: sets fixed times for the inodes in the file system. hash_seed: creates reproducible directory indexes in the file system. Reference commit in e2fsprogs: e1f7100643a46456be107b33098f6034b0835e6d (From OE-Core rev: bb822ab75de0020572058090439b93cc56bbf7e0) Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/wic/partition.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index b1a2306dd1..795707ec5d 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -284,6 +284,20 @@ class Partition():
284 284
285 extraopts = self.mkfs_extraopts or "-F -i 8192" 285 extraopts = self.mkfs_extraopts or "-F -i 8192"
286 286
287 if os.getenv('SOURCE_DATE_EPOCH'):
288 sde_time = int(os.getenv('SOURCE_DATE_EPOCH'))
289 if pseudo:
290 pseudo = "export E2FSPROGS_FAKE_TIME=%s;%s " % (sde_time, pseudo)
291 else:
292 pseudo = "export E2FSPROGS_FAKE_TIME=%s; " % sde_time
293
294 # Set hash_seed to generate deterministic directory indexes
295 namespace = uuid.UUID("e7429877-e7b3-4a68-a5c9-2f2fdf33d460")
296 if self.fsuuid:
297 namespace = uuid.UUID(self.fsuuid)
298 hash_seed = str(uuid.uuid5(namespace, str(sde_time)))
299 extraopts += " -E hash_seed=%s" % hash_seed
300
287 label_str = "" 301 label_str = ""
288 if self.label: 302 if self.label:
289 label_str = "-L %s" % self.label 303 label_str = "-L %s" % self.label