本文主要是介绍android6/7 system打包脚本,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1.android5打包system就是网站上常见的制作ROM必备的解包打包system脚本
指令如下:mkuserimg.sh -s out/target/product/$TARGET_PRODUCT/system out/target/product/$TARGET_PRODUCT/obj/PACKAGING/systemimage_intermediates/system.img ext4 system 3195826176 -D out/target/product/$TARGET_PRODUCT/system -L system out/target/product/$TARGET_PRODUCT/root/file_contexts
android 5之前未启用selinux,所以打包脚本会少-L 参数,大致和android 5相同
2.到android 6之后,android开启了system verify 签名,未经签名的image刷入不能开机,原因是system 挂载失败。
解决办法是修改分区挂载文件,去掉system的verify参数,高通平台为fstab.qcom
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1,discard wait,verify
或者按照android要求对system进行签名
查看log得到了打包脚本指令:python build/tools/releasetools/build_image.py out/target/product/$TARGET_PRODUCT/system out/target/product/$TARGET_PRODUCT/obj/PACKAGING/systemimage_intermediates/system_image_info.txt out/target/product/$TARGET_PRODUCT/system.img out/target/product/$TARGET_PRODUCT/system
LOG如下:
build_verity_tree -A aee087a5be3b982978c923f566a94613496b417f2af592639bc80d141e34dfe7
out/target/product/msm8953_64/system.img /tmp/tmpKyrn_A_verity_images/verity.img
system/extras/verity/build_verity_metadata.py 3195826176 /tmp/tmpKyrn_A_verity_images/verity_metadata.img
1a78a3588e5656dd06555d0e4324c930368ead38567b62bde728f930582e57a8
aee087a5be3b982978c923f566a94613496b417f2af592639bc80d141e34dfe7 /dev/block/bootdevice/by-name/system out/host/linux-
x86/bin/verity_signer build/target/product/security/verity.pk8
append2simg out/target/product/msm8953_64/system.img /tmp/tmpKyrn_A_verity_images/verity_metadata.img
append2simg out/target/product/msm8953_64/system.img /tmp/tmpKyrn_A_verity_images/verity.img
out/target/product/msm8953_64/system.img maxsize=3288637440 blocksize=135168 total=2734485724 reserve=33251328
根据log提取依赖的脚本和工具即可制作出打包签名版system.img
当然如果你有源码不用这么麻烦,直接make snod
但是有时候这还是很有用的。
这篇关于android6/7 system打包脚本的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!