DaSunWarman 阅读(29) 评论(0)

一、Android7.0 MTK方案 编译OTA升级包时报错,如下

Could not append verity data!: error: file_write: incomplete write
Failed to write sparse file
Traceback (most recent call last):
  File "./build/tools/releasetools/add_img_to_target_files", line 376, in 
    main(sys.argv[1:])
  File "./build/tools/releasetools/add_img_to_target_files", line 370, in main
    AddImagesToTargetFiles(args[0])
  File "./build/tools/releasetools/add_img_to_target_files", line 313, in AddImagesToT
argetFiles
    AddSystem(output_zip, recovery_img=recovery_image, boot_img=boot_image)
  File "./build/tools/releasetools/add_img_to_target_files", line 70, in AddSystem
    block_list=block_list)
  File "./build/tools/releasetools/add_img_to_target_files", line 78, in BuildSystem
    return CreateImage(input_dir, info_dict, "system", block_list=block_list)
  File "./build/tools/releasetools/add_img_to_target_files", line 151, in CreateImage
    assert succ, "build " + what + ".img image failed"
AssertionError: build system.img image failed

二、解决办法

敲命令 df –h,如下:

df -h
Filesystem                            Size  Used Avail Use% Mounted on
udev                                   32G  4.0K   32G   1% /dev
tmpfs                                 6.3G   52M  6.3G   1% /run
/dev/dm-1                              12G  9.2G  1.8G  85% /
none                                  4.0K     0  4.0K   0% /sys/fs/cgroup
none                                  5.0M     0  5.0M   0% /run/lock
none                                   32G   80K   32G   1% /run/shm

根目录只剩下1.8G的可用空间。而编译OTA包时,很多中间文件会存到 /tmp目录下,1.8G不够用,从而导致编译错误。

根本解决办法当然是增加 /tmp 所在分区的空间

临时解决办法:

cd /tmp

rm –rf *

删掉/tmp目录下的文件,清出空间,再进行编译。