To save disk space, the PetaLinux tools deletes all build artifacts at the end of the build process. If you want to keep them
for debugging or to help you develop a patch, you can add the following line to the
RM_WORK_EXCLUDE += "recipe"
recipe must be substituted with a valid recipe name such as the following:
If you want to preserve the build artifacts of more than one component, you can append the recipe names, separated by spaces, for example, to preserve the kernel sources and the FSBL:
RM_WORK_EXCLUDE += "linux-xlnx fsbl"
Alternatively you can add a line for each:
RM_WORK_EXCLUDE += "linux-xlnx" RM_WORK_EXCLUDE += "fsbl"
You can also preserve the sources of custom applications, kernel modules, packages, etc, just by using their names. For example, to preserve the sources for a custom application called “myapp”, as well as Busybox and Glibc, add this line:
RM_WORK_EXCLUDE += "myapp busybox glibc"
How to keep ALL build artifacts
The setting that makes PetaLinux tools delete build artifacts in the first place is contained in the
INHERIT += "rm_work"
If you want to keep all build artifacts, just add the following line to the
INHERIT_remove = "rm_work"
Where to find the build artifacts
In general, you will find the build artifacts in
build/tmp/work/. Digging deeper, you’ll find the
various components in these directories:
|Sources||Build artifacts location|
In the above paths, you must replace
<name> with the Yocto machine name given to your PetaLinux project. The Yocto
machine name is the value of
CONFIG_YOCTO_MACHINE_NAME in the
How to delete the build artifacts
Finally, you can clean the project and delete the build artifacts by running this command:
petalinux-build -x mrproper