博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
android源码编译system.img文件重打包
阅读量:2344 次
发布时间:2019-05-10

本文共 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.img

Running:  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/

你可能感兴趣的文章
Spring Boot 整合Servlet
查看>>
Spring Boot 整合Filter
查看>>
nginx 安装
查看>>
ngnix 详解
查看>>
IDEA创建spring boot项目
查看>>
IDEA安装插件
查看>>
HttpClient-02连接管理
查看>>
数据库连接池-配置 wallfilter问题解决-UncategorizedSQLException
查看>>
java根据文件流判断文件类型(后缀名)
查看>>
js常用操作事件
查看>>
linux 安装mysql
查看>>
利用SQL语句查询数据库中所有表
查看>>
ActiveMQ 安装
查看>>
java可变参数
查看>>
spring 简述
查看>>
HttpClient-03Http状态管理
查看>>
spring cloud 启动报错-must be declared as an @AliasFor [serviceId], not [name].
查看>>
常用软件下载地址
查看>>
修改spring boot 启动logo
查看>>
spring boot-启动及配置文件
查看>>