]> code.ossystems Code Review - openembedded-core.git/commitdiff
qemuboot.bbclass: Prevent creating a link loop
authorMike Looijmans <mike.looijmans@topic.nl>
Thu, 17 Aug 2017 13:43:18 +0000 (15:43 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 18 Aug 2017 11:35:56 +0000 (12:35 +0100)
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>
meta/classes/qemuboot.bbclass

index 86b306037fab8780e308718d0abfaf3aefbbd866..0e21fc9bdef758df4413cadd8c15d2661420c8a0 100644 (file)
@@ -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)
 }