Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1 | .. SPDX-License-Identifier: CC-BY-SA-2.0-UK |
| 2 | |
| 3 | Conserving Disk Space |
| 4 | ********************* |
| 5 | |
| 6 | Conserving Disk Space During Builds |
| 7 | =================================== |
| 8 | |
| 9 | To help conserve disk space during builds, you can add the following |
| 10 | statement to your project's ``local.conf`` configuration file found in |
| 11 | the :term:`Build Directory`:: |
| 12 | |
| 13 | INHERIT += "rm_work" |
| 14 | |
| 15 | Adding this statement deletes the work directory used for |
| 16 | building a recipe once the recipe is built. For more information on |
| 17 | "rm_work", see the :ref:`ref-classes-rm-work` class in the |
| 18 | Yocto Project Reference Manual. |
| 19 | |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 20 | When you inherit this class and build a ``core-image-sato`` image for a |
| 21 | ``qemux86-64`` machine from an Ubuntu 22.04 x86-64 system, you end up with a |
| 22 | final disk usage of 22 Gbytes instead of &MIN_DISK_SPACE; Gbytes. However, |
| 23 | &MIN_DISK_SPACE_RM_WORK; Gbytes of initial free disk space are still needed to |
| 24 | create temporary files before they can be deleted. |
| 25 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 26 | Purging Duplicate Shared State Cache Files |
| 27 | ========================================== |
| 28 | |
| 29 | After multiple build iterations, the Shared State (sstate) cache can contain |
| 30 | duplicate cache files for a given package, while only the most recent one |
| 31 | is likely to be reusable. The following command purges all but the |
| 32 | newest sstate cache file for each package:: |
| 33 | |
| 34 | sstate-cache-management.sh --remove-duplicated --cache-dir=build/sstate-cache |
| 35 | |
| 36 | This command will ask you to confirm the deletions it identifies. |
| 37 | |
| 38 | .. note:: |
| 39 | |
| 40 | The duplicated sstate cache files of one package must have the same |
| 41 | architecture, which means that sstate cache files with multiple |
| 42 | architectures are not considered as duplicate. |
| 43 | |
| 44 | Run ``sstate-cache-management.sh`` for more details about this script. |
| 45 | |