Make do_image_complete wait for an earlier task


Mikko Murto
 

Hi,

I've created a task do_create_spdx that gets some data from packages after do_package. The task is currently added with `addtask do_create_spdx after do_package before do_packagedata` The data is then enriched and combined in do_image_complete by adding the combining function to IMAGE_POSTPROCESS_COMMAND. For the most part everything works as expected, but for some packages do_create_spdx does not complete in time for the combination step in do_image_complete. Is there a way for me force do_image_complete to wait for do_create_spdx to have been completed for all packages?

Best regards,
Mikko Murto


Richard Purdie
 

On Tue, 2021-05-18 at 06:15 +0000, Mikko Murto wrote:
Hi,

I've created a task do_create_spdx that gets some data from packages after 
do_package. The task is currently added with `addtask do_create_spdx after 
do_package before do_packagedata` The data is then enriched and combined in 
do_image_complete by adding the combining function to IMAGE_POSTPROCESS_COMMAND. 
For the most part everything works as expected, but for some packages 
do_create_spdx does not complete in time for the combination step in do_image_complete. 
Is there a way for me force do_image_complete to wait for do_create_spdx to have been 
completed for all packages?
This seems a little odd since image.bbclass has:

do_rootfs[recrdeptask] += "do_packagedata"

which means do_rootfs should only happen after all do_packagedata have run.
Your task is added before do_packagedata.
do_image and do_image_complete should run after do_rootfs.

I'm wondering if the issue is more to do with reuse of previous build artefacts where
sstate is involved. Does your added task account for sstate?

I've been giving some thought to SDPX and SBOM during our build process
so I am curious what you're doing, is the work public anywhere?

Cheers,

Richard