本文共 1828 字,大约阅读时间需要 6 分钟。
替换了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/systemOut of space? the tree size of out/target/product/generic_x86/system is (MB): 727 out/target/product/generic_x86/systemThe max is 750 MB.make: *** [snod] Error 1#### make failed to build some targets (1 seconds) ####
网上百度谷歌搜了很多,都说简单修改 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=ext4system_size=802897920 #这里可以改成你需要的system大小userdata_size=576716800cache_fs_type=ext4cache_size=69206016selinux_fc=out/target/product/generic_x86/root/file_contextsskip_fsck=true
执行
python build_image.py out/target/product/generic_x86/system/ system_image_info.txt system.imgRunning: mkuserimg.sh out/target/product/generic_x86/system/ system.img ext4 system 802897920 out/target/product/generic_x86/root/file_contextsmake_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: 47Created filesystem with 1462/49056 inodes and 130536/196020 blocks
成功。
转载地址:http://fvjvb.baihongyu.com/