summaryrefslogtreecommitdiff
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:25:05 +0100
commit34c74ba45c04efc2dd998545bf7a31d7b06a0ee0 (patch)
tree48f790cb89b78e0165ad2acbef0120792d40ba65
parentc0a8c5c07e0dd6f0ae302e9a4dcf7973e73e68e1 (diff)
downloadopenembedded-core-34c74ba45c04efc2dd998545bf7a31d7b06a0ee0.tar.gz
openembedded-core-34c74ba45c04efc2dd998545bf7a31d7b06a0ee0.tar.bz2
openembedded-core-34c74ba45c04efc2dd998545bf7a31d7b06a0ee0.zip
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. 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.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() {
def generate_disk_signature():
import uuid
- while True:
- signature = str(uuid.uuid4())[:8]
+ signature = str(uuid.uuid4())[:8]
- if signature != '00000000':
- return signature
+ if signature != '00000000':
+ return signature
+ else:
+ return 'ffffffff'
def validate_disk_signature(d):
import re