summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Opdenacker <michael.opdenacker@bootlin.com>2023-09-08 09:37:58 +0200
committerSteve Sakoman <steve@sakoman.com>2023-09-18 04:28:04 -1000
commit5c556073ac6e54314aa3fc210db040f3ab55105a (patch)
tree218b2c95b61bd45fabe449da31a6a62914e2a346
parentad9420b072896b6a58a571c8123bcb17a813a1e7 (diff)
downloadpoky-5c556073ac6e54314aa3fc210db040f3ab55105a.tar.gz
dev-manual: common-tasks: mention faster "find" command to trim sstate cache
[YOCTO #15182] (From yocto-docs rev: dd778676c946faa8702e8fcc9126ad9537e7a21e) 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: Steve Sakoman <steve@sakoman.com>
-rw-r--r--documentation/dev-manual/common-tasks.rst37
1 files changed, 27 insertions, 10 deletions
diff --git a/documentation/dev-manual/common-tasks.rst b/documentation/dev-manual/common-tasks.rst
index 6a527f0ef8..a2404e5f4e 100644
--- a/documentation/dev-manual/common-tasks.rst
+++ b/documentation/dev-manual/common-tasks.rst
@@ -6511,25 +6511,42 @@ building a recipe once the recipe is built. For more information on
6511Yocto Project Reference Manual. 6511Yocto Project Reference Manual.
6512 6512
6513Purging Duplicate Shared State Cache Files 6513Purging Duplicate Shared State Cache Files
6514------------------------------------------- 6514------------------------------------------
6515 6515
6516After multiple build iterations, the Shared State (sstate) cache can contain 6516After multiple build iterations, the Shared State (sstate) cache can contain
6517duplicate cache files for a given package, while only the most recent one 6517duplicate cache files for a given package, consuming a substantial amount of
6518is likely to be reusable. The following command purges all but the 6518disk space. However, only the most recent cache files are likeky to be reusable.
6519newest sstate cache file for each package::
6520 6519
6521 sstate-cache-management.sh --remove-duplicated --cache-dir=build/sstate-cache 6520The following command is a quick way to purge all the cache files which
6521haven't been used for a least a specified number of days::
6522 6522
6523This command will ask you to confirm the deletions it identifies. 6523 find build/sstate-cache -type f -mtime +$DAYS -delete
6524
6525The above command relies on the fact that BitBake touches the sstate cache
6526files as it accesses them, when it has write access to the cache.
6527
6528You could use ``-atime`` instead of ``-mtime`` if the partition isn't mounted
6529with the ``noatime`` option for a read only cache.
6524 6530
6525Note:: 6531For more advanced needs, OpenEmbedded-Core also offers a more elaborate
6532command. It has the ability to purge all but the newest cache files on each
6533architecture, and also to remove files that it considers unreachable by
6534exploring a set of build configurations. However, this command
6535requires a full build environment to be available and doesn't work well
6536covering multiple releases. It won't work either on limited environments
6537such as BSD based NAS::
6526 6538
6527 The duplicated sstate cache files of one package must have the same 6539 sstate-cache-management.sh --remove-duplicated --cache-dir=build/sstate-cache
6528 architecture, which means that sstate cache files with multiple
6529 architectures are not considered as duplicate.
6530 6540
6541This command will ask you to confirm the deletions it identifies.
6531Run ``sstate-cache-management.sh`` for more details about this script. 6542Run ``sstate-cache-management.sh`` for more details about this script.
6532 6543
6544.. note::
6545
6546 As this command is much more cautious and selective, removing only cache files,
6547 it will execute much slower than the simple ``find`` command described above.
6548 Therefore, it may not be your best option to trim huge cache directories.
6549
6533Working with Packages 6550Working with Packages
6534===================== 6551=====================
6535 6552