aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Looijmans <mike.looijmans@topic.nl>2017-08-17 15:43:18 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-18 12:35:56 +0100
commitf46652e77f467861dc68c3a8e54f27d08659222d (patch)
tree76895c860bf503e5dae8479d2f70cce7e53c87b8
parent5a59a6997f41e606d088e3e86812de56f72f543b (diff)
downloadopenembedded-core-contrib-f46652e77f467861dc68c3a8e54f27d08659222d.tar.gz
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 <mike.looijmans@topic.nl> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/qemuboot.bbclass7
1 files changed, 4 insertions, 3 deletions
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)
}