1

Is it possible to run rm_work tasks on already built recipes? After using up all the disc space I realized too late that INHERIT += "rm_work" is missing in my local.conf file and I do not want to start over after building 50% of the recipes (~4 hours in my case).

I could probably delete the tmp folder and start over, as there is still SSTATE cache available, but I would like to know a better way, solution like bitbake -c rm_work <my-image> or similar to do the job and free up some space.

1
  • Well if you want to delete tmp ( which you should in your case ), then just do it. Cause whatever option you are talking about that will also do similar. And adding rm_work is not going to save a lot of space, its only the staging files use to prepare the root image are going to clean up. Commented Jul 5 at 7:35

1 Answer 1

0

In that case, I normally rm -rf tmp/work directory, if one does not need the logs. do_rm_work does basically the same: it removes everything inside each recipe's work directory except the logs.

However, in other configurations this might break the build, so be careful.

AFAIK, you would achieve the same by running bitbake -c rm_work for all recipes that were build until now. Running bitbake -c rm_work <my-image> only removes the work folder for the image recipe, but not its dependencies.

Compilation contributes most to build time and its results are stored inside sstate-cache directory. So removing the work directory won't slow you down significantly. Consider using a sstate-cache mirror if you need 4 hours to build and don't have much disk space. It's a game changer. Here's a bootlin tutorial or the Yocto wiki on how to do it.

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you for your answer. After removing the work directory, some packages failed to access some files from it, during do_package_write_ipk, or ca-certificates_20211016.bb:do_compile. We also use sstate-cache mirror, but in this case it was a build of updated sources etc. so did not hit that cache.
Bummer, I'm sorry! For us this works normally, I'm not sure where your setup differs. I adapt the answer.
Maybe -c cleanall those recipes? Or rebuild their dependencies only? Though, letting it run over night again with rm_work is probably easiest.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.