summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Liu <net147@gmail.com>2017-07-29 00:45:27 +1000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-30 08:46:20 +0100
commit408c65613acb2b4e9a57e86905abf61b2284d54c (patch)
tree1264e951851bd10b851bc1630ec18398629e6f1e
parent3582f6fc011482f3e9a05592226e3c0ee09f2943 (diff)
downloadpoky-408c65613acb2b4e9a57e86905abf61b2284d54c.tar.gz
wic: ensure generated disk system identifier is non-zero
Zero may be interpreted as no MBR signature present and another partitioning program might install a new MBR signature. (From OE-Core rev: f53b5555d6eaa171bc5882cfee807cf62576862d) Signed-off-by: Jonathan Liu <net147@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/wic/plugins/imager/direct.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index 0a65a9c58d..51bdd3a984 100644
--- a/scripts/lib/wic/plugins/imager/direct.py
+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -303,7 +303,7 @@ class PartitionedImage():
303 # all partitions (in bytes) 303 # all partitions (in bytes)
304 self.ptable_format = ptable_format # Partition table format 304 self.ptable_format = ptable_format # Partition table format
305 # Disk system identifier 305 # Disk system identifier
306 self.identifier = int.from_bytes(os.urandom(4), 'little') 306 self.identifier = int.from_bytes(os.urandom(4), 'little') or 0xffffffff
307 307
308 self.partitions = partitions 308 self.partitions = partitions
309 self.partimages = [] 309 self.partimages = []