一、问题描述和现象
编译时间长了后,docker会产生一些缓存,编译源码对磁盘有要求,如果磁盘空间不够了,将出现编译失败,现象如:
2024-03-19 03:47:12 - build_image_standalone.py - INFO : Script Version : 1.2
2024-03-19 03:47:12 - build_image_standalone.py - INFO : Starting up builds merge..
2024-03-19 03:47:12 - build_image_standalone.py - INFO : QSSI build path = /xxxxxxx/vendor/BP-CODE/LA.QSSI.13.0/LINUX/android
2024-03-19 03:47:12 - build_image_standalone.py - INFO : Target build path = /xxxxxxxxx/vendor/BP-CODE/LA.VENDOR.13.2.6/LINUX/android
2024-03-19 03:47:12 - build_image_standalone.py - INFO : Merged build path = /xxxxxxxxxxx/vendor/BP-CODE/LA.VENDOR.13.2.6/LINUX/android
-------------提示了空间不足-----------------
2024-03-19 03:47:12 - build_image_standalone.py - INFO : Free Space available on /tmp = 11.395771026611328G
2024-03-19 03:47:12 - build_image_standalone.py - ERROR : Not enough free space available on /tmp, aborting, min free space required = 24G !!
2024-03-19 03:47:12 - build_image_standalone.py - ERROR : Free up /tmp manually, and/or Increase it using: sudo mount -o remount,size=24G tmpfs /tmp
-------------提示了空间不足-----------------
2024-03-19 03:47:12 - build_image_standalone.py - ERROR : Or Alternatively, Use --no_tmp option while triggering build_image_standalone, to not use /tmp if it is a low RAM machine
[COMMAND]:source vendor/qcom/opensource/core-utils/build/build_recoveryimage.sh
start generate the recoveryimage.img
Traceback (most recent call last):
File "vendor/qcom/opensource/core-utils/build/recoveryplus.py", line 24, in <module>
sys.exit(main())
File "vendor/qcom/opensource/core-utils/build/recoveryplus.py", line 8, in main
otazip = zipfile.ZipFile(sys.argv[1], 'r')
File "/usr/lib/python3.8/zipfile.py", line 1251, in __init__
self.fp = io.open(file, filemode)
FileNotFoundError: [Errno 2] No such file or directory: 'out/dist/merged-qssi_kalama-ota.zip'
cp: cannot stat 'out/dist/merged-qssi_kalama-ota.zip': No such file or directory
Creating filesystem with parameters:
Size: 2147483648
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 8192
Label:
Blocks: 524288
Block groups: 16
Reserved block group size: 127
Created filesystem with 14/131072 inodes and 17197/524288 blocks
recoveryimage.img has been generated
在服务器种df -h查看结果,如下图,确实还只剩8.6G,编译要求至少24G
二、处理办法
清理docker缓存:
1、du -hs /var/lib/docker 查看docker占用情况
2、docker system df 查看docker缓存占用
3、docker system prune 清除docker缓存
4、docker system prune -a 彻底清除docker缓存