From: Davide Gardenal Date: Mon, 6 Jun 2022 10:51:42 +0000 (+0200) Subject: baremetal-image: fix broken symlink in do_rootfs X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~3932 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8fd1a37c38dbfc688d840d12c61d76f151f9f605;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git baremetal-image: fix broken symlink in do_rootfs 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 Signed-off-by: Luca Ceresoli Signed-off-by: Richard Purdie --- diff --git a/meta/classes/baremetal-image.bbclass b/meta/classes/baremetal-image.bbclass index 81f5e5e93d1..cb9e2503500 100644 --- a/meta/classes/baremetal-image.bbclass +++ b/meta/classes/baremetal-image.bbclass @@ -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)