summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorSergei Zhmylev <s.zhmylev@yadro.com>2022-10-13 14:03:45 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-10-26 12:28:39 +0100
commit36b9f4f3d06f074a872146588350fdd7936ec7f8 (patch)
tree4471a45fff6996fc75aa03d93419a5c16a12ee55 /scripts/lib
parent7b3828259c448563035f4b3ae84147a7856476ab (diff)
downloadpoky-36b9f4f3d06f074a872146588350fdd7936ec7f8.tar.gz
wic: implement binary repeatable disk identifiers
When SOURCE_DATE_EPOCH variable is set, binary repeatable build is expected. This commit implements reproducable disk identifiers in such a case using its value as a Random seed. (From OE-Core rev: 2c0c54e12169e76f16fb3398904bc897a9190397) 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')
-rw-r--r--scripts/lib/wic/plugins/imager/direct.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index da483daed5..6faa16bf9b 100644
--- a/scripts/lib/wic/plugins/imager/direct.py
+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -310,7 +310,10 @@ class PartitionedImage():
310 # all partitions (in bytes) 310 # all partitions (in bytes)
311 self.ptable_format = ptable_format # Partition table format 311 self.ptable_format = ptable_format # Partition table format
312 # Disk system identifier 312 # Disk system identifier
313 self.identifier = random.SystemRandom().randint(1, 0xffffffff) 313 if os.getenv('SOURCE_DATE_EPOCH'):
314 self.identifier = random.Random(int(os.getenv('SOURCE_DATE_EPOCH'))).randint(1, 0xffffffff)
315 else:
316 self.identifier = random.SystemRandom().randint(1, 0xffffffff)
314 317
315 self.partitions = partitions 318 self.partitions = partitions
316 self.partimages = [] 319 self.partimages = []