android R制作OTA包时报错
有陣子沒搞android OTA了,今天在android R上編譯制作OTA包時,遇到個錯誤
2021-07-06 09:59:18 - ota_from_target_files.py - ERROR : ERROR: Traceback (most recent call last):File "./build/tools/releasetools/ota_from_target_files.py", line 2258, in <module>main(sys.argv[1:])File "./build/tools/releasetools/ota_from_target_files.py", line 2231, in mainsource_file=OPTIONS.incremental_source)File "./build/tools/releasetools/ota_from_target_files.py", line 1875, in GenerateAbOtaPackagepayload.Generate(target_file, source_file, additional_args)File "./build/tools/releasetools/ota_from_target_files.py", line 402, in Generateself._Run(cmd)File "./build/tools/releasetools/ota_from_target_files.py", line 378, in _Runcommon.RunAndCheckOutput(cmd)File "/home/xxx/test_r_1.0_dev_0616/android/build/make/tools/releasetools/common.py", line 281, in RunAndCheckOutputargs, proc.returncode, output)) ExternalError: Failed to run command '['brillo_update_payload', 'generate', '--payload', '/tmp/payload-Y3iphj.bin', '--target_image', 'mydist/test-target_files-eng.xxx.zip', '--max_timestamp', u'1625203656']' (exit code 134): Extracting images for full update. Detected .zip file, extracting Brillo image. Archive: mydist/test-target_files-eng.xxx.zipextracting: /tmp/TEMP.Bi62rL/META/ab_partitions.txt List of A/B partitions for DST_PARTITIONS: boot vendor Archive: mydist/test-target_files-eng.xxx.zipinflating: /tmp/TEMP.6KIdJ8/META/postinstall_config.txt Archive: mydist/test-target_files-eng.xxx.zipinflating: /tmp/TEMP.NTct9P/META/dynamic_partitions_info.txt Archive: mydist/test-target_files-eng.xxx.zip Archive: mydist/test-target_files-eng.xxx.zipinflating: /tmp/TEMP.PKjktt/IMAGES/boot.img inflating: /tmp/TEMP.suTDdE/IMAGES/vendor.img Extracted DST_PARTITIONS[boot]: 31457280 bytesConverting Android sparse image vendor.img to RAW. Archive: mydist/test-target_files-eng.xxx.zipinflating: /tmp/TEMP.IAnc1E/IMAGES/vendor.map Extracted DST_PARTITIONS[vendor]: 803246080 bytes Generating full update. Running delta_generator with args: --out_file=/tmp/payload-Y3iphj.bin --partition_names=boot:vendor --new_partitions=/tmp/boot.img.HGprkk:/tmp/vendor.img.k6S4Y3 --new_mapfiles=:/tmp/vendor.map.cUx0zu --major_version=2 --max_timestamp=1625203656 --new_postinstall_config_file=/tmp/postinstall_config.UQllAQ --dynamic_partition_info_file=/tmp/dynamic_partitions_info.hL5iTI [0706/095917.994946:ERROR:payload_generation_config.cc(192)] Cannot find partition system which is in jlq_dynamic_partitions_partition_list [0706/095917.995282:FATAL:generate_delta_main.cc(619)] Check failed: payload_config.target.ValidateDynamicPartitionMetadata(). /home/xxx/test_r_1.0_dev_0616/android/out/soong/host/linux-x86/bin/../lib64/libchrome.so(base::debug::StackTrace::StackTrace(unsigned long)+0x17) [0x7f40a8510b27] /home/xxx/test_r_1.0_dev_0616/android/out/soong/host/linux-x86/bin/../lib64/libchrome.so(logging::LogMessage::~LogMessage()+0x8a) [0x7f40a84a1d6a] /home/xxx/test_r_1.0_dev_0616/android/out/soong/host/linux-x86/bin/delta_generator(+0xb5ece) [0x565287ff5ece] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7f40a73f2840] /home/xxx/test_r_1.0_dev_0616/android/out/soong/host/linux-x86/bin/delta_generator(+0xb1ee9) [0x565287ff1ee9]/home/xxx/test_r_1.0_dev_0616/android/out/soong/host/linux-x86/bin/brillo_update_payload: line 625: 24190 Aborted (core dumped) "${GENERATOR}" "${GENERATOR_ARGS[@]}"上面報錯內容,重點應該是這句“Cannot find partition system which is in jlq_dynamic_partitions_partition_list”,這個問題怎么追查原因呢?得細看一下相關聯的內容。
從上報的common.py腳本來看,會檢查兩個內容“META/ab_partitions.txt ”和“META/dynamic_partitions_info.txt”,會check這兩個內容是否匹配。查看了一下,顯示ab_partitions.txt是boot vendor和dynamic_partitions.txt,這個是我們在BoardConfig.mk中的DYNAMIC_PARTITIONS_PARTITION_LIST值,我這里配置的是BOARD_xxx_DYNAMIC_PARTITIONS_PARTITION_LIST := system system_ext product vendor
這兩者不相等導致的報錯。
那疑問是這兩個txt是在哪里寫進內容的?查看到是build/make/core/Makefile中處理的
build/make/core/Makefile:4785: echo "$${part}" >> $(zip_root)/META/ab_partitions.txt; \ifeq ($(AB_OTA_UPDATER),true)@# When using the A/B updater, include the updater config files in the zip.$(hide) cp $(TOPDIR)system/update_engine/update_engine.conf $(zip_root)/META/update_engine_config.txt$(hide) for part in $(AB_OTA_PARTITIONS); do \echo "$${part}" >> $(zip_root)/META/ab_partitions.txt; \done$(hide) for conf in $(AB_OTA_POSTINSTALL_CONFIG); do \echo "$${conf}" >> $(zip_root)/META/postinstall_config.txt; \done很明顯,要查看AB_OTA_PARTITION了,然后開始查看BoardConfig中的AB_OTA_PARTITIONS的賦值
發現確實重復定義了AB_OTA_PARTITIONS,修正后問題得到解決。
總結
以上是生活随笔為你收集整理的android R制作OTA包时报错的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 傻X的陈天桥
- 下一篇: 剖析 .NET 托管提供程序