首页 > 解决方案 > Bitbake/Yocto 如何使用旧版本的旧版本下载来减少 Linux 构建时间

问题描述

嗨,我正在使用 yacto/bitbake 为 rasberry pi3 构建 Linux,有没有办法重新使用为先前构建下载的源代码/代码以减少整体下载时间,以便在我们创建新构建目录时不会再次获取它们。我知道有一个SSTATE_DIR变量local.conf可以根据先前构建的输出加速构建,但如果可能的话,我正在寻找减少下载时间的方法。

标签: linuxembedded-linuxbitbake

解决方案


与 for几乎相同SSTATE_DIR- 您需要在. 以下是一些文档:local.conflocal.conf

#
# Where to place downloads
#
# During a first build the system will download many different source code tarballs
# from various upstream projects. This can take a while, particularly if your network
# connection is slow. These are all stored in DL_DIR. When wiping and rebuilding you
# can preserve this directory to speed up this part of subsequent builds. This directory
# is safe to share between multiple builds on the same machine too.
#
# The default is a 'downloads' directory under TOPDIR which is the build directory.
#
DL_DIR = .....

您可以使用其他 Yocto 全局变量,DL_DIR例如TOPDIR。我的DL_DIR长相是这样的

DL_DIR = "${TOPDIR}/../downloads"

所以目录downloads位于build目录旁边。

更重要的是,如果您在同一台 PC 上有多个 Yocto 项目的克隆,您可以DL_DIR在它们之间共享。指定一些符号链接的路径DL_DIR也可以稳定工作......以防万一)


推荐阅读