summaryrefslogtreecommitdiffstats
path: root/meta/classes/baremetal-image.bbclass
diff options
context:
space:
mode:
authorDavide Gardenal <davidegarde2000@gmail.com>2022-06-06 12:51:42 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-06-07 21:21:54 +0100
commite55d15d2fbdadc41e860293eba203c829718aa1b (patch)
tree07fc9790374d633c2885f701e07421a4a9e312df /meta/classes/baremetal-image.bbclass
parent137c0a740471370f9129cb499c7025b4ebefe515 (diff)
downloadpoky-e55d15d2fbdadc41e860293eba203c829718aa1b.tar.gz
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. (From OE-Core rev: 8fd1a37c38dbfc688d840d12c61d76f151f9f605) 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>
Diffstat (limited to 'meta/classes/baremetal-image.bbclass')
-rw-r--r--meta/classes/baremetal-image.bbclass7
1 files changed, 4 insertions, 3 deletions
diff --git a/meta/classes/baremetal-image.bbclass b/meta/classes/baremetal-image.bbclass
index 81f5e5e93d..cb9e250350 100644
--- a/meta/classes/baremetal-image.bbclass
+++ b/meta/classes/baremetal-image.bbclass
@@ -47,9 +47,10 @@ python do_rootfs(){
47 Path(manifest_name).touch() 47 Path(manifest_name).touch()
48 if os.path.exists(manifest_name) and link_name: 48 if os.path.exists(manifest_name) and link_name:
49 manifest_link = deploy_dir + "/" + link_name + ".manifest" 49 manifest_link = deploy_dir + "/" + link_name + ".manifest"
50 if os.path.lexists(manifest_link): 50 if manifest_link != manifest_name:
51 os.remove(manifest_link) 51 if os.path.lexists(manifest_link):
52 os.symlink(os.path.basename(manifest_name), manifest_link) 52 os.remove(manifest_link)
53 os.symlink(os.path.basename(manifest_name), manifest_link)
53 # A lot of postprocess commands assume the existence of rootfs/etc 54 # A lot of postprocess commands assume the existence of rootfs/etc
54 sysconfdir = d.getVar("IMAGE_ROOTFS") + d.getVar('sysconfdir') 55 sysconfdir = d.getVar("IMAGE_ROOTFS") + d.getVar('sysconfdir')
55 bb.utils.mkdirhier(sysconfdir) 56 bb.utils.mkdirhier(sysconfdir)