summaryrefslogtreecommitdiffstats
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-18 16:34:40 +0100
commitef1df297f15390010089970a5616f0883732ba29 (patch)
tree5c7100aabb8c47cfb2537d7d6a54f9b55d4f45bd
parentff7a7dec9bde8fe3eb1e345e14b7d690d4db59f6 (diff)
downloadpoky-ef1df297f15390010089970a5616f0883732ba29.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: fb4672a8b4090d0ea9b7931d1b04bccf7a81548c) 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> (cherry picked from commit 8fd1a37c38dbfc688d840d12c61d76f151f9f605) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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)