summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorDavide Gardenal <davidegarde2000@gmail.com>2022-05-04 10:39:04 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-05-12 16:44:06 +0100
commitc5580a0571e399a0ef5869beb4eb208acf8ae721 (patch)
tree7da6f7bc691595c2475c72b7b3801a5f756bb84e /meta/classes
parentdd08692cac01ca397864342f1bddedf1cac61b42 (diff)
downloadpoky-c5580a0571e399a0ef5869beb4eb208acf8ae721.tar.gz
rootfs-postcommands: fix symlinks where link and output path are equal
When creating the manifest and the testdata.json links, if the link name is equal to the output name the link is not created, otherwise it is. This prevents a link-to-self in the first case. (From OE-Core rev: e69a1533dfb8ceb5b91610f2ab8b3da575fcc36e) 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 bed63756c56f296ff3d5a7eef66e978bd19f1008) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/rootfs-postcommands.bbclass14
1 files changed, 8 insertions, 6 deletions
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index 7b92df69c5..63e716c955 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -267,9 +267,10 @@ python write_image_manifest () {
267 267
268 if os.path.exists(manifest_name) and link_name: 268 if os.path.exists(manifest_name) and link_name:
269 manifest_link = deploy_dir + "/" + link_name + ".manifest" 269 manifest_link = deploy_dir + "/" + link_name + ".manifest"
270 if os.path.lexists(manifest_link): 270 if manifest_link != manifest_name:
271 os.remove(manifest_link) 271 if os.path.lexists(manifest_link):
272 os.symlink(os.path.basename(manifest_name), manifest_link) 272 os.remove(manifest_link)
273 os.symlink(os.path.basename(manifest_name), manifest_link)
273} 274}
274 275
275# Can be used to create /etc/timestamp during image construction to give a reasonably 276# Can be used to create /etc/timestamp during image construction to give a reasonably
@@ -339,9 +340,10 @@ python write_image_test_data() {
339 340
340 if os.path.exists(testdata_name) and link_name: 341 if os.path.exists(testdata_name) and link_name:
341 testdata_link = os.path.join(deploy_dir, "%s.testdata.json" % link_name) 342 testdata_link = os.path.join(deploy_dir, "%s.testdata.json" % link_name)
342 if os.path.lexists(testdata_link): 343 if testdata_link != testdata_name:
343 os.remove(testdata_link) 344 if os.path.lexists(testdata_link):
344 os.symlink(os.path.basename(testdata_name), testdata_link) 345 os.remove(testdata_link)
346 os.symlink(os.path.basename(testdata_name), testdata_link)
345} 347}
346write_image_test_data[vardepsexclude] += "TOPDIR" 348write_image_test_data[vardepsexclude] += "TOPDIR"
347 349