替换了out/target/product里面system里面的很多文件,本来想make snod重打包img
error: ext4_allocate_best_fit_partial: failed to allocate 302 blocks, out of space?
error: failed to build out/target/product/generic_x86/system.img from out/target/product/generic_x86/system
Out of space? the tree size of out/target/product/generic_x86/system is (MB):
727 out/target/product/generic_x86/system
The max is 750 MB.
make: *** [snod] Error 1
#### make failed to build some targets (1 seconds) ####
网上百度谷歌搜了很多,都说简单修改 BoardConfig.mk system执行的大小就可以,但我重新source lunch make snod 还是一样的结果。
最后通过阅读 /build/core/Makefile文件发现。makesnod 命令是通过/build/tools/releasetools/build_image.py
生成的。
这个命令在源码编译的环境下需要三个参数。
参数一:system目录(就是手机里面system目录里面所有的文件)
参数二: 一个配置文件system_image_info.txt 这个环境变量是根据源码的环境变量设置的
大概位置out/target/product/generic_x86/obj/PACKAGING/systemimage_intermediates/system_image_info.txt
参数三:指定需要生成的文件 我们这里是system.img
将build_image.py system_image_info.txt文件放在源码根目录
修改system_image_info.txt
fs_type=ext4
system_size=802897920 #这里可以改成你需要的system大小
userdata_size=576716800
cache_fs_type=ext4
cache_size=69206016
selinux_fc=out/target/product/generic_x86/root/file_contexts
skip_fsck=true
执行
python build_image.py out/target/product/generic_x86/system/ system_image_info.txt system.img
Running: mkuserimg.sh out/target/product/generic_x86/system/ system.img ext4 system 802897920 out/target/product/generic_x86/root/file_contexts
make_ext4fs -T -1 -S out/target/product/generic_x86/root/file_contexts -l 802897920 -a system system.img out/target/product/generic_x86/system/
Creating filesystem with parameters:
Size: 802897920
Block size: 4096
Blocks per group: 32768
Inodes per group: 8176
Inode size: 256
Journal blocks: 3062
Label:
Blocks: 196020
Block groups: 6
Reserved block group size: 47
Created filesystem with 1462/49056 inodes and 130536/196020 blocks
成功。