diff options
Diffstat (limited to 'documentation/dev-manual/disk-space.rst')
-rw-r--r-- | documentation/dev-manual/disk-space.rst | 34 |
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 | ||
29 | After multiple build iterations, the Shared State (sstate) cache can contain | 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 | 30 | duplicate cache files for a given package, consuming a substantial amount of |
31 | is likely to be reusable. The following command purges all but the | 31 | disk space. However, only the most recent cache files are likeky to be reusable. |
32 | newest sstate cache file for each package:: | ||
33 | 32 | ||
34 | sstate-cache-management.sh --remove-duplicated --cache-dir=build/sstate-cache | 33 | The following command is a quick way to purge all the cache files which |
34 | haven't been used for a least a specified number of days:: | ||
35 | 35 | ||
36 | This command will ask you to confirm the deletions it identifies. | 36 | find build/sstate-cache -type f -mtime +$DAYS -delete |
37 | 37 | ||
38 | .. note:: | 38 | The above command relies on the fact that BitBake touches the sstate cache |
39 | files 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 | 41 | You could use ``-atime`` instead of ``-mtime`` if the partition isn't mounted |
41 | architecture, which means that sstate cache files with multiple | 42 | with the ``noatime`` option for a read only cache. |
42 | architectures are not considered as duplicate. | ||
43 | 43 | ||
44 | For more advanced needs, OpenEmbedded-Core also offers a more elaborate | ||
45 | command. It has the ability to purge all but the newest cache files on each | ||
46 | architecture, and also to remove files that it considers unreachable by | ||
47 | exploring a set of build configurations. However, this command | ||
48 | requires a full build environment to be available and doesn't work well | ||
49 | covering multiple releases. It won't work either on limited environments | ||
50 | such as BSD based NAS:: | ||
51 | |||
52 | sstate-cache-management.sh --remove-duplicated --cache-dir=build/sstate-cache | ||
53 | |||
54 | This command will ask you to confirm the deletions it identifies. | ||
44 | Run ``sstate-cache-management.sh`` for more details about this script. | 55 | Run ``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. | ||