From f46652e77f467861dc68c3a8e54f27d08659222d Mon Sep 17 00:00:00 2001 From: Mike Looijmans Date: Thu, 17 Aug 2017 15:43:18 +0200 Subject: 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 --- meta/classes/qemuboot.bbclass | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'meta/classes') 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) } -- cgit 1.2.3-korg