diff options
author | Mike Looijmans <mike.looijmans@topic.nl> | 2017-08-17 15:43:18 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-18 23:46:37 +0100 |
commit | 322985be2367cdbeda6ede9d54f18ddd9b73a4da (patch) | |
tree | d00b164c3b994b77af8c25237cca7cd557e529ca /meta/classes/qemuboot.bbclass | |
parent | 1f033e444289ca24da60503f74f4228a64b34d65 (diff) | |
download | poky-322985be2367cdbeda6ede9d54f18ddd9b73a4da.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.
(From OE-Core rev: f46652e77f467861dc68c3a8e54f27d08659222d)
Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/qemuboot.bbclass')
-rw-r--r-- | meta/classes/qemuboot.bbclass | 7 |
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() { | |||
114 | with open(qemuboot, 'w') as f: | 114 | with open(qemuboot, 'w') as f: |
115 | cf.write(f) | 115 | cf.write(f) |
116 | 116 | ||
117 | if os.path.lexists(qemuboot_link): | 117 | if qemuboot_link != qemuboot: |
118 | os.remove(qemuboot_link) | 118 | if os.path.lexists(qemuboot_link): |
119 | os.symlink(os.path.basename(qemuboot), qemuboot_link) | 119 | os.remove(qemuboot_link) |
120 | os.symlink(os.path.basename(qemuboot), qemuboot_link) | ||
120 | } | 121 | } |