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-05 21:17:36 +0100
commit3fe41b9b46e4bb34c0c751426053472823315f60 (patch)
treededfc65c35928a6c3047bee7d5be8b53646fbf69 /meta/classes
parent934627728dc94d86d48cd6e17e555457dc06309e (diff)
downloadpoky-3fe41b9b46e4bb34c0c751426053472823315f60.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: bed63756c56f296ff3d5a7eef66e978bd19f1008) 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')
-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 9b6824043c..d302c23cf4 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