]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
baremetal-image: fix broken symlink in do_rootfs
authorDavide Gardenal <davidegarde2000@gmail.com>
Mon, 6 Jun 2022 10:51:42 +0000 (12:51 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 7 Jun 2022 20:11:57 +0000 (21:11 +0100)
If IMAGE_LINK_NAME and IMAGE_MANIFEST are equal
don't create a link otherwise it will create it
to itself.

Signed-off-by: Davide Gardenal <davide.gardenal@huawei.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/baremetal-image.bbclass

index 81f5e5e93d1d3d38a9e4e54c822a1d237dfc3a76..cb9e250350084171e32e9a5bbc1d010c1e88083d 100644 (file)
@@ -47,9 +47,10 @@ python do_rootfs(){
     Path(manifest_name).touch()
     if os.path.exists(manifest_name) and link_name:
         manifest_link = deploy_dir + "/" + link_name + ".manifest"
-        if os.path.lexists(manifest_link):
-            os.remove(manifest_link)
-        os.symlink(os.path.basename(manifest_name), manifest_link)
+        if manifest_link != manifest_name:
+            if os.path.lexists(manifest_link):
+                os.remove(manifest_link)
+            os.symlink(os.path.basename(manifest_name), manifest_link)
     # A lot of postprocess commands assume the existence of rootfs/etc
     sysconfdir = d.getVar("IMAGE_ROOTFS") + d.getVar('sysconfdir')
     bb.utils.mkdirhier(sysconfdir)