diff options
author | Jonathan Liu <net147@gmail.com> | 2013-09-27 01:30:10 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-09-30 22:11:58 +0100 |
commit | df18dc084e071b83d49ee42e706f203296599432 (patch) | |
tree | cf4d8167eae2e2396d86ea893caedd94baf7b661 | |
parent | cf2ebed2ff3e498b399a40d4dfba91d62d0a758b (diff) | |
download | poky-df18dc084e071b83d49ee42e706f203296599432.tar.gz |
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.
(From OE-Core rev: b6cafb1fcd6c168f8f4a4d2d5c74f3b425f156f3)
Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/boot-directdisk.bbclass | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/classes/boot-directdisk.bbclass b/meta/classes/boot-directdisk.bbclass index c58c6f0c53..0f64b44f87 100644 --- a/meta/classes/boot-directdisk.bbclass +++ b/meta/classes/boot-directdisk.bbclass | |||
@@ -148,7 +148,11 @@ python do_bootdirectdisk() { | |||
148 | def generate_disk_signature(): | 148 | def generate_disk_signature(): |
149 | import uuid | 149 | import uuid |
150 | 150 | ||
151 | return str(uuid.uuid4())[:8] | 151 | while True: |
152 | signature = str(uuid.uuid4())[:8] | ||
153 | |||
154 | if signature != '00000000': | ||
155 | return signature | ||
152 | 156 | ||
153 | def validate_disk_signature(d): | 157 | def validate_disk_signature(d): |
154 | import re | 158 | import re |