yocto - 如何简化 recipe-sysroot-native

标签 yocto

目录recipe-sysroot-native占用200M+磁盘空间,我发现它存在于每个WORKDIR中,我认为它们都有保存内容。拥有这么多副本是一种磁盘空间的浪费,而且可能会减慢构建时间。能不能放在一个固定的地方,每个WORKDIR通过符号链接(symbolic link)访问它??

最佳答案

staging.bbclass 中所述, recipe-sysrootrecipe-sysroot-native 中的文件并不总是副本。 Yocto 尝试创建指向实际文件的硬链接(hard link)(即仅增加对文件的引用计数)。

所以 recipe-sysrootrecipe-sysroot-native 中的所有文件都是指向磁盘中一个源文件的硬链接(hard link)。所以您的磁盘上没有任何重复的空间占用。

Here您可以看到 staging.bbclass 的实际实现,它会尝试创建硬链接(hard link),如果不允许,则会创建一个副本。

您始终可以使用 ls -i 查看文件的引用计数。

以下文字转自yocto mega meanual,

The second stage addresses recipes that want to use something from another recipe and declare a dependency on that recipe through the DEPENDS variable. The recipe will have a do_prepare_recipe_sysroot task and when this task executes, it creates the recipe-sysroot and recipe-sysroot-native in the recipe work directory (i.e. WORKDIR). The OpenEmbedded build system creates hard links to copies of the relevant files from sysroots-components into the recipe work directory.

Note: If hard links are not possible, the build system uses actual copies.

关于yocto - 如何简化 recipe-sysroot-native,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53331063/

相关文章:

python-3.x - 在 yocto 中为 Python 应用程序编写配方

linux - do_package : split_and_strip_files (arm-poky-linux-gnueabi-objcopy) fails 时出现问题

linux - yocto/bitbake 构建尝试将文件更改为 root 并失败

Yocto 中的 Python 3 在 Raspberry Pi 上非常慢

linux - 如何使用 Yocto 将文件部署到/boot 分区

linux - 使用SDK编译模块抛出警告消息: libelf-dev not found

linux - 如何列出所有用于使用 bitbake 构建特定包的 .bb 和 .bbappend 文件?

yocto - 如何在 Yocto 中使用最新的 oe-depends-dot

gcc - Yocto 元工具链 fatal error : stdio. h:没有这样的文件或目录

git - 无法在 ubuntu PC 中克隆 yocto poky repo