Bitbake 构建消耗更多 space
Bitbake build consumes more space
我最近开始使用 Bitbake 来构建 Yocto。每次我构建时,它都会消耗更多 space,目前我 运行 磁盘用完 space。图像不会被覆盖。为每个构建创建一组带有时间戳的新文件。我已经从 build/tmp/deploy/images/ 中删除了旧文件。但它对磁盘空闲space没有太大影响。我可以从其他位置删除内容吗?
我在构建过程中观察到的错误是:
WARNING: The free space of source/build/tmp (/dev/sda4) is running low (0.999GB left)
ERROR: No new tasks can be executed since the disk space monitor action is "STOPTASKS"!
WARNING: The free space of source/build/sstate-cache (/dev/sda4) is running low (0.999GB left)
ERROR: No new tasks can be executed since the disk space monitor action is "STOPTASKS"!
WARNING: The free space of source/build/downloads (/dev/sda4) is running low (0.999GB left)
ERROR: No new tasks can be executed since the disk space monitor action is "STOPTASKS"!
请提出一些建议以避免此问题。
按有效性和修复的难易程度排序:
- 购买更多磁盘space: 将 $TMPDIR 放在它自己的 SSD 上有很大帮助并且消除了微观管理的需要。
- 删除 $TMPDIR (build/tmp): 旧图像、旧包和 workdirectories/sysroots 您当前未构建的 MACHINE相当多 space。您通常可以偶尔删除整个 $TMPDIR:只要您使用 sstate-cache,下一次构建应该仍然非常快。
- 删除 $SSTATE_DIR (build/sstate-cache): 如果你做了很多构建,sstate 本身会随着时间的推移而积累。删除目录是安全的,但下一次构建将花费很长时间,因为所有内容都将被重建。
- 删除 $DL_DIR (build/downloads): 如果你长时间使用构建目录(同时从 master 拉取更新或更改为更新的分支)过时的下载继续占用磁盘 space。请记住,删除目录将意味着重新下载所有内容。只查看最大的文件并删除旧版本可能是一种有用的折衷方案。
有一些官方的方法可以代替删除。
通过故意删除,您可能会强制进行不必要的构建和下载。构建的某些元素可能不受 bitbake 控制,您会发现自己处于无法以简单的方式重建这些项目的情况。
根据这些建议,您可以击败每个构建 yocto 规则的非书面 50GB:
检查您的 IMAGE_FSTYPES 变量。根据我的经验,删除这些文件的所有非 symlinks 或 symlinks 目标的图像是安全的。避免生成最后一个以避免破坏最后一个构建 link,以及任何与引导加载程序和配置文件相关的内容,因为它们很少会重新生成。
如果您要保留多个具有相同图层集的构建,那么您可以为构建使用一个通用的下载文件夹。
DL_DIR ?= "common_dir_across_all_builds/downloads/"
之后:
保持你的 /deploy 干净:
RM_OLD_IMAGE: Reclaims disk space by removing previously built versions of the same image from the images directory pointed to by the DEPLOY_DIR variable.Set this variable to "1" in your local.conf file to remove these images:
RM_OLD_IMAGE = "1"
IMAGE_FSTYPES Remove the image types that you do not plan to use, you can always enable a particular one when you need it:
IMAGE_FSTYPES_remove = "tar.bz2"
IMAGE_FSTYPES_remove = "rpi-sdimg"
IMAGE_FSTYPES_remove = "ext3"
对于/tmp/work,不需要所有配方的所有工作文件。您可以指定您对开发感兴趣的那些。
RM_WORK_EXCLUDE:
With rm_work enabled, this variable specifies a list of recipes whose work directories should not be removed. See the "rm_work.bbclass" section for more details.
INHERIT += "rm_work"
RM_WORK_EXCLUDE += "home-assistant widde"
我最近开始使用 Bitbake 来构建 Yocto。每次我构建时,它都会消耗更多 space,目前我 运行 磁盘用完 space。图像不会被覆盖。为每个构建创建一组带有时间戳的新文件。我已经从 build/tmp/deploy/images/ 中删除了旧文件。但它对磁盘空闲space没有太大影响。我可以从其他位置删除内容吗?
我在构建过程中观察到的错误是:
WARNING: The free space of source/build/tmp (/dev/sda4) is running low (0.999GB left)
ERROR: No new tasks can be executed since the disk space monitor action is "STOPTASKS"!
WARNING: The free space of source/build/sstate-cache (/dev/sda4) is running low (0.999GB left)
ERROR: No new tasks can be executed since the disk space monitor action is "STOPTASKS"!
WARNING: The free space of source/build/downloads (/dev/sda4) is running low (0.999GB left)
ERROR: No new tasks can be executed since the disk space monitor action is "STOPTASKS"!
请提出一些建议以避免此问题。
按有效性和修复的难易程度排序:
- 购买更多磁盘space: 将 $TMPDIR 放在它自己的 SSD 上有很大帮助并且消除了微观管理的需要。
- 删除 $TMPDIR (build/tmp): 旧图像、旧包和 workdirectories/sysroots 您当前未构建的 MACHINE相当多 space。您通常可以偶尔删除整个 $TMPDIR:只要您使用 sstate-cache,下一次构建应该仍然非常快。
- 删除 $SSTATE_DIR (build/sstate-cache): 如果你做了很多构建,sstate 本身会随着时间的推移而积累。删除目录是安全的,但下一次构建将花费很长时间,因为所有内容都将被重建。
- 删除 $DL_DIR (build/downloads): 如果你长时间使用构建目录(同时从 master 拉取更新或更改为更新的分支)过时的下载继续占用磁盘 space。请记住,删除目录将意味着重新下载所有内容。只查看最大的文件并删除旧版本可能是一种有用的折衷方案。
有一些官方的方法可以代替删除。
通过故意删除,您可能会强制进行不必要的构建和下载。构建的某些元素可能不受 bitbake 控制,您会发现自己处于无法以简单的方式重建这些项目的情况。
根据这些建议,您可以击败每个构建 yocto 规则的非书面 50GB:
检查您的 IMAGE_FSTYPES 变量。根据我的经验,删除这些文件的所有非 symlinks 或 symlinks 目标的图像是安全的。避免生成最后一个以避免破坏最后一个构建 link,以及任何与引导加载程序和配置文件相关的内容,因为它们很少会重新生成。
如果您要保留多个具有相同图层集的构建,那么您可以为构建使用一个通用的下载文件夹。
DL_DIR ?= "common_dir_across_all_builds/downloads/"
之后:
保持你的 /deploy 干净:
RM_OLD_IMAGE: Reclaims disk space by removing previously built versions of the same image from the images directory pointed to by the DEPLOY_DIR variable.Set this variable to "1" in your local.conf file to remove these images:
RM_OLD_IMAGE = "1"
IMAGE_FSTYPES Remove the image types that you do not plan to use, you can always enable a particular one when you need it:
IMAGE_FSTYPES_remove = "tar.bz2"
IMAGE_FSTYPES_remove = "rpi-sdimg"
IMAGE_FSTYPES_remove = "ext3"
对于/tmp/work,不需要所有配方的所有工作文件。您可以指定您对开发感兴趣的那些。
RM_WORK_EXCLUDE: With rm_work enabled, this variable specifies a list of recipes whose work directories should not be removed. See the "rm_work.bbclass" section for more details.
INHERIT += "rm_work"
RM_WORK_EXCLUDE += "home-assistant widde"