* [PATCH v2] wic: ensure generated disk system identifier is non-zero
@ 2017-07-28 14:20 Jonathan Liu
0 siblings, 0 replies; only message in thread
From: Jonathan Liu @ 2017-07-28 14:20 UTC (permalink / raw)
To: openembedded-core
Zero may be interpreted as no FAT serial number or no MBR signature.
Signed-off-by: Jonathan Liu <net147@gmail.com>
---
scripts/lib/wic/plugins/imager/direct.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index f20d8433f1..fe9b688ab0 100644
--- a/scripts/lib/wic/plugins/imager/direct.py
+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -297,7 +297,7 @@ class PartitionedImage():
# all partitions (in bytes)
self.ptable_format = ptable_format # Partition table format
# Disk system identifier
- self.identifier = int.from_bytes(os.urandom(4), 'little')
+ self.identifier = int.from_bytes(os.urandom(4), 'little') or 0xffffffff
self.partitions = partitions
self.partimages = []
--
2.13.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-07-28 14:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-28 14:20 [PATCH v2] wic: ensure generated disk system identifier is non-zero Jonathan Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox