From: Mike Looijmans Date: Thu, 17 Aug 2017 13:43:18 +0000 (+0200) Subject: qemuboot.bbclass: Prevent creating a link loop X-Git-Tag: 2017-10~552 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=f46652e77f467861dc68c3a8e54f27d08659222d;p=openembedded-core.git qemuboot.bbclass: Prevent creating a link loop When IMAGE_NAME and IMAGE_LINK_NAME are equal, do_write_qemuboot_conf will create a symlink that links to itself. Check if this is the case before creating the link. Signed-off-by: Mike Looijmans Signed-off-by: Richard Purdie --- diff --git a/meta/classes/qemuboot.bbclass b/meta/classes/qemuboot.bbclass index 86b306037f..0e21fc9bde 100644 --- a/meta/classes/qemuboot.bbclass +++ b/meta/classes/qemuboot.bbclass @@ -114,7 +114,8 @@ python do_write_qemuboot_conf() { with open(qemuboot, 'w') as f: cf.write(f) - if os.path.lexists(qemuboot_link): - os.remove(qemuboot_link) - os.symlink(os.path.basename(qemuboot), qemuboot_link) + if qemuboot_link != qemuboot: + if os.path.lexists(qemuboot_link): + os.remove(qemuboot_link) + os.symlink(os.path.basename(qemuboot), qemuboot_link) }