Skip to contentSkip to conversation

boot-directdisk: ensure generated MBR disk signature is non-zero

PATCH New Jonathan Liu 1 participant 1 message Sep 27, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 boot-directdisk: ensure generated MBR disk signature is non-zero

A zero MBR disk signature is generally seen as no signature and another partitioning program might install a new signature.

---
 meta/classes/boot-directdisk.bbclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/classes/boot-directdisk.bbclass +5 -1
index 4b9d7bd..8641e85 100644
@@ -148,7 +148,11 @@ python do_bootdirectdisk() {
 def generate_disk_signature():
     import uuid
 
-    return str(uuid.uuid4())[:8]
+    while True:
+        signature = str(uuid.uuid4())[:8]
+
+        if signature != '00000000':
+            return signature
 
 def validate_disk_signature(d):
     import re
Signature · 1 line
1.8.4