Android 10上刷机使用了super.img,差分包多了dynamic_partitions_op_list,大致查询了下是新增了动态分区,从编译到生成差分包都做了一些修改,本次先整理大致分析,对这个更新点有初步的认识
一、编译方面
1.super.img的生成
通过编译的log可以看到,super.img的生成
make
build/make/core/Makefile
# If BOARD_BUILD_SUPER_IMAGE_BY_DEFAULT is set, super.img is built from images in the
# $(PRODUCT_OUT) directory, and is built to $(PRODUCT_OUT)/super.img. Also, it will
# be built for non-dist builds. This is useful for devices that uses super.img directly, e.g.
# virtual devices.
ifeq (true,$(BOARD_BUILD_SUPER_IMAGE_BY_DEFAULT))
$(INSTALLED_SUPERIMAGE_TARGET): $(INSTALLED_SUPERIMAGE_DEPENDENCIES)
$(call pretty,"Target super fs image for debug: $@")
$(call build-superimage-target,$(INSTALLED_SUPERIMAGE_TARGET),\
$(call intermediates-dir-for,PACKAGING,superimage_debug)/misc_info.txt)
编译log [100% 1686/1686] Target super fs image for debug: out/target/product/k61v1_64_bsp/super.img 2020-01-06 16:14:22 - build_super_image.py - INFO : Building super image from info dict... 2020-01-06 16:14:22 - sparse_img.py - INFO : Total of 370303 4096-byte output blocks in 21 input chunks. 2020-01-06 16:14:22 - sparse_img.py - INFO : Total of 383438 4096-byte output blocks in 19 input chunks. 2020-01-06 16:14:22 - sparse_img.py - INFO : Total of 83534 4096-byte output blocks in 11 input chunks. 2020-01-06 16:14:22 - common.py - INFO : Running: "lpmake --metadata-size 65536 --super-name super --metadata-slots 2 --device super:4294967296 --group main:4292870144 --partition product:readonly:1516761088:main --image product=out/target/product/k61v1_64_bsp/product.img --partition system:readonly:1570562048:main --image system=out/target/product/k61v1_64_bsp/system.img --partition vendor:readonly:342155264:main --image vendor=out/target/product/k61v1_64_bsp/vendor.img --sparse --output out/target/product/k61v1_64_bsp/super.img" 2020-01-06 16:15:34 - common.py - INFO : lpmake I 01-06 16:14:22 697 697 builder.cpp:937] [liblp]Partition product will resize from 0 bytes to 1

本文深入探讨了Android10中引入的动态分区机制,详细分析了super.img的生成过程,包括编译阶段的参数设置与差分包的生成逻辑。通过对super.img的解包,揭示了动态分区在设备上的具体布局。
最低0.47元/天 解锁文章
2万+

被折叠的 条评论
为什么被折叠?



