xref: /openbmc/openbmc/poky/documentation/dev-manual/disk-space.rst (revision 517393d903089f921915530ffa689a7a1d113420)
1*517393d9SAndrew Geissler.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
2*517393d9SAndrew Geissler
3*517393d9SAndrew GeisslerConserving Disk Space
4*517393d9SAndrew Geissler*********************
5*517393d9SAndrew Geissler
6*517393d9SAndrew GeisslerConserving Disk Space During Builds
7*517393d9SAndrew Geissler===================================
8*517393d9SAndrew Geissler
9*517393d9SAndrew GeisslerTo help conserve disk space during builds, you can add the following
10*517393d9SAndrew Geisslerstatement to your project's ``local.conf`` configuration file found in
11*517393d9SAndrew Geisslerthe :term:`Build Directory`::
12*517393d9SAndrew Geissler
13*517393d9SAndrew Geissler   INHERIT += "rm_work"
14*517393d9SAndrew Geissler
15*517393d9SAndrew GeisslerAdding this statement deletes the work directory used for
16*517393d9SAndrew Geisslerbuilding a recipe once the recipe is built. For more information on
17*517393d9SAndrew Geissler"rm_work", see the :ref:`ref-classes-rm-work` class in the
18*517393d9SAndrew GeisslerYocto Project Reference Manual.
19*517393d9SAndrew Geissler
20*517393d9SAndrew GeisslerPurging Duplicate Shared State Cache Files
21*517393d9SAndrew Geissler==========================================
22*517393d9SAndrew Geissler
23*517393d9SAndrew GeisslerAfter multiple build iterations, the Shared State (sstate) cache can contain
24*517393d9SAndrew Geisslerduplicate cache files for a given package, while only the most recent one
25*517393d9SAndrew Geissleris likely to be reusable. The following command purges all but the
26*517393d9SAndrew Geisslernewest sstate cache file for each package::
27*517393d9SAndrew Geissler
28*517393d9SAndrew Geissler   sstate-cache-management.sh --remove-duplicated --cache-dir=build/sstate-cache
29*517393d9SAndrew Geissler
30*517393d9SAndrew GeisslerThis command will ask you to confirm the deletions it identifies.
31*517393d9SAndrew Geissler
32*517393d9SAndrew Geissler.. note::
33*517393d9SAndrew Geissler
34*517393d9SAndrew Geissler   The duplicated sstate cache files of one package must have the same
35*517393d9SAndrew Geissler   architecture, which means that sstate cache files with multiple
36*517393d9SAndrew Geissler   architectures are not considered as duplicate.
37*517393d9SAndrew Geissler
38*517393d9SAndrew GeisslerRun ``sstate-cache-management.sh`` for more details about this script.
39*517393d9SAndrew Geissler
40