Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] boot-directdisk: ensure generated MBR disk signature is non-zero
@ 2013-09-27  1:30 Jonathan Liu
  0 siblings, 0 replies; only message in thread
From: Jonathan Liu @ 2013-09-27  1:30 UTC (permalink / raw)
  To: openembedded-core

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

Signed-off-by: Jonathan Liu <net147@gmail.com>
---
 meta/classes/boot-directdisk.bbclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta/classes/boot-directdisk.bbclass b/meta/classes/boot-directdisk.bbclass
index 4b9d7bd..8641e85 100644
--- a/meta/classes/boot-directdisk.bbclass
+++ b/meta/classes/boot-directdisk.bbclass
@@ -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
-- 
1.8.4



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-09-27  1:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-27  1:30 [PATCH] boot-directdisk: ensure generated MBR disk signature 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