summaryrefslogtreecommitdiffstats
path: root/documentation/dev-manual
diff options
context:
space:
mode:
authorMichael Opdenacker <michael.opdenacker@bootlin.com>2023-08-11 11:03:40 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-08-30 15:54:59 +0100
commitdabc3dc087217c514d70c48d4fb083652f5fcf27 (patch)
treec9dced41d6511683f97660db4761d31b41c19361 /documentation/dev-manual
parent9bf8250a403e046a0cbd4bea7113b03b33b27cc0 (diff)
downloadpoky-dabc3dc087217c514d70c48d4fb083652f5fcf27.tar.gz
dev-manual: disk-space: mention faster "find" command to trim sstate cache
[YOCTO #15182] (From yocto-docs rev: 6fd067639e7d6ae87bda9ea8795ebf54b8827056) Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Reported-by: Yoann CONGAL <yoann.congal@smile.fr> Reported-by: Randy MacLeod <randy.macleod@windriver.com> Reported-by: Josef Holzmayr <jester@theyoctojester.info> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/dev-manual')
-rw-r--r--documentation/dev-manual/disk-space.rst34
1 files changed, 25 insertions, 9 deletions
diff --git a/documentation/dev-manual/disk-space.rst b/documentation/dev-manual/disk-space.rst
index c63591cc7a..a84bef4511 100644
--- a/documentation/dev-manual/disk-space.rst
+++ b/documentation/dev-manual/disk-space.rst
@@ -27,19 +27,35 @@ Purging Duplicate Shared State Cache Files
27========================================== 27==========================================
28 28
29After multiple build iterations, the Shared State (sstate) cache can contain 29After multiple build iterations, the Shared State (sstate) cache can contain
30duplicate cache files for a given package, while only the most recent one 30duplicate cache files for a given package, consuming a substantial amount of
31is likely to be reusable. The following command purges all but the 31disk space. However, only the most recent cache files are likeky to be reusable.
32newest sstate cache file for each package::
33 32
34 sstate-cache-management.sh --remove-duplicated --cache-dir=build/sstate-cache 33The following command is a quick way to purge all the cache files which
34haven't been used for a least a specified number of days::
35 35
36This command will ask you to confirm the deletions it identifies. 36 find build/sstate-cache -type f -mtime +$DAYS -delete
37 37
38.. note:: 38The above command relies on the fact that BitBake touches the sstate cache
39files as it accesses them, when it has write access to the cache.
39 40
40 The duplicated sstate cache files of one package must have the same 41You could use ``-atime`` instead of ``-mtime`` if the partition isn't mounted
41 architecture, which means that sstate cache files with multiple 42with the ``noatime`` option for a read only cache.
42 architectures are not considered as duplicate.
43 43
44For more advanced needs, OpenEmbedded-Core also offers a more elaborate
45command. It has the ability to purge all but the newest cache files on each
46architecture, and also to remove files that it considers unreachable by
47exploring a set of build configurations. However, this command
48requires a full build environment to be available and doesn't work well
49covering multiple releases. It won't work either on limited environments
50such as BSD based NAS::
51
52 sstate-cache-management.sh --remove-duplicated --cache-dir=build/sstate-cache
53
54This command will ask you to confirm the deletions it identifies.
44Run ``sstate-cache-management.sh`` for more details about this script. 55Run ``sstate-cache-management.sh`` for more details about this script.
45 56
57.. note::
58
59 As this command is much more cautious and selective, removing only cache files,
60 it will execute much slower than the simple ``find`` command described above.
61 Therefore, it may not be your best option to trim huge cache directories.