summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorJonathan Liu <net147@gmail.com>2013-10-02 10:47:11 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-10-04 18:26:50 +0100
commitd299444adcc02b9a40ba0651059d0ba283108231 (patch)
tree757910d09e3a8e5e3da8bf7595fe9fbee04eee57 /meta/classes
parent104166c804e9068d85ccdaa887a33df72c8aeb85 (diff)
downloadpoky-d299444adcc02b9a40ba0651059d0ba283108231.tar.gz
boot-directdisk: avoid loop in MBR disk signature generation
Instead of looping until the generated signature is non-zero, just return 'ffffffff' if it's zero. This avoids an infinite loop if the generated signature is always zero. (From OE-Core rev: 34c74ba45c04efc2dd998545bf7a31d7b06a0ee0) 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>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/boot-directdisk.bbclass9
1 files changed, 5 insertions, 4 deletions
diff --git a/meta/classes/boot-directdisk.bbclass b/meta/classes/boot-directdisk.bbclass
index 0f64b44f87..55357283ac 100644
--- a/meta/classes/boot-directdisk.bbclass
+++ b/meta/classes/boot-directdisk.bbclass
@@ -148,11 +148,12 @@ python do_bootdirectdisk() {
148def generate_disk_signature(): 148def generate_disk_signature():
149 import uuid 149 import uuid
150 150
151 while True: 151 signature = str(uuid.uuid4())[:8]
152 signature = str(uuid.uuid4())[:8]
153 152
154 if signature != '00000000': 153 if signature != '00000000':
155 return signature 154 return signature
155 else:
156 return 'ffffffff'
156 157
157def validate_disk_signature(d): 158def validate_disk_signature(d):
158 import re 159 import re