Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
334 views
in Technique[技术] by (71.8m points)

optimization - How to organise downloads & sstate_cache for Yocto builds?

I tend to build Yocto builds for various boards and versions(sumo, warrior, etc.,). To speedup the builds I use separate DL_DIR & SSTATE_DIR. The structure I followed is given below:

  • Single download dir for all the builds & boards (as most of the builds for different boards use same tool-chain)
  • Separate sstate cache dir for each board

enter image description here

My question is, Can I use single SSTATE_DIR to improve the performance and reducing the folder size? Have anyone tried it?

Suggestions and personal experiences are also appreciated.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can share DL_DIR among all build directories and Yocto versions. Those are just tarballs of sources.

You can share SSTATE_DIR among all build directories, though it is beneficial only for builds sharing the same Yocto version, otherwise no size or speed improvement at all. This makes sense because many native packages and "base" target packages of machines of the same architecture (in your case aarch64) are identical for said machines and will make use of the shared SSTATE_DIR. For non-matching cases, new entries will be added to your SSTATE_DIR. When you have different Yocto versions, some package recipes have been updated and most often glibc, binutils and gcc are updated. Those are the packages used by almost all other package recipes, which effectively makes it impossible to re-use sstate-cache from earlier (or later) Yocto versions for package recipes that haven't changed since the package recipes they depend on are part of the sstate-cache for said recipes. Also, the Yocto version is in the filename of a sstate-cache entry so anyway they'll be rebuilt.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...