From: Mike Looijmans Date: Thu, 17 Aug 2017 13:43:18 +0000 (+0200) Subject: qemuboot.bbclass: Prevent creating a link loop X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~20338 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f46652e77f467861dc68c3a8e54f27d08659222d;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.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 86b306037fa..0e21fc9bdef 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) }