diff mbox series

[meta-swupdate,2/2] swupdate-image: remove sw-description copy

Message ID 20211104181848.4185983-3-adrian.freihofer@siemens.com
State Changes Requested
Headers show
Series fix build-time signing issues | expand

Commit Message

Adrian Freihofer Nov. 4, 2021, 6:18 p.m. UTC
Since the taskdeps should now be fixed in swudpate-common,
do_swupdate_copy_swdescription is redundant. do_unpack should be executed
whenever it is needed.

It will now use IMAGE_LINK_NAME instead of IMAGE_BASENAME. IMAGE_BASENAME
contains a timestamp which sporadically causes errors during creation. The
problem is that if the image files were created by a previous bitbake call
and bitbake skips the task of creating them again, swupdate fails when
searching for images with the current build job's timestamp in the file name.
In any case, the link points to the last available build.

Setting S to WORKDIR should not be necessary. It is the default from
bitbake.conf.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
---
 classes/swupdate-image.bbclass | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)
diff mbox series

Patch

diff --git a/classes/swupdate-image.bbclass b/classes/swupdate-image.bbclass
index d405fe1..d1a3403 100644
--- a/classes/swupdate-image.bbclass
+++ b/classes/swupdate-image.bbclass
@@ -10,27 +10,10 @@ 
 
 inherit swupdate-common.bbclass
 
-S = "${WORKDIR}/${PN}"
-
 SRC_URI += "file://sw-description"
-SWUPDATE_IMAGES += "${IMAGE_BASENAME}"
-
-python do_swupdate_copy_swdescription() {
-
-    import shutil
-
-    workdir = d.getVar('S', True)
-    image = d.getVar('IMAGE_BASENAME', True)
-    filespath = d.getVar('FILESPATH')
-    sw_desc_path = bb.utils.which(filespath, "sw-description")
-    shutil.copyfile(sw_desc_path, os.path.join(workdir, "sw-description"))
-
-    if d.getVarFlag("SWUPDATE_IMAGES_FSTYPES", image) is None:
-       bb.fatal("SWUPDATE_IMAGES_FSTYPES[%s] is not set !" % image)
-}
+SWUPDATE_IMAGES += "${IMAGE_LINK_NAME}"
 
-addtask swupdate_copy_swdescription before do_image_complete after do_unpack
-addtask swuimage after do_swupdate_copy_swdescription do_image_complete before do_build
+addtask swuimage after do_image_complete before do_build
 
 # Read all variables from sw-description file and add them to the vardeps of the do_swuimage task. Bitbake
 # cannot know that the do_swuimage task which evaluates the templated sw-description file needs to be executed