mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 12:59:02 +02:00
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>
This commit is contained in:
parent
7b3828259c
commit
36b9f4f3d0
|
@ -310,7 +310,10 @@ class PartitionedImage():
|
|||
# all partitions (in bytes)
|
||||
self.ptable_format = ptable_format # Partition table format
|
||||
# Disk system identifier
|
||||
self.identifier = random.SystemRandom().randint(1, 0xffffffff)
|
||||
if os.getenv('SOURCE_DATE_EPOCH'):
|
||||
self.identifier = random.Random(int(os.getenv('SOURCE_DATE_EPOCH'))).randint(1, 0xffffffff)
|
||||
else:
|
||||
self.identifier = random.SystemRandom().randint(1, 0xffffffff)
|
||||
|
||||
self.partitions = partitions
|
||||
self.partimages = []
|
||||
|
|
Loading…
Reference in New Issue
Block a user