Skip to contentSkip to conversation

wic: ensure generated disk system identifier is non-zero

PATCH Superseded Jonathan Liu 1 participant 1 message Jul 28, 2017

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 wic: ensure generated disk system identifier is non-zero

Zero may be interpreted as no FAT serial number or no MBR signature.

---
 scripts/lib/wic/plugins/imager/direct.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/lib/wic/plugins/imager/direct.py +1 -1
index f20d8433f1..fe9b688ab0 100644
@@ -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 = []
Signature · 1 line
2.13.2