qemuboot.bbclass: Prevent creating a link loop
PATCH 1/1 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 <[email protected]>
--- meta/classes/qemuboot.bbclass | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
meta/classes/qemuboot.bbclass +4 -3
@@ -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) }
Signature · 1 line
1.9.1