android 6.0 系統(tǒng):在make otapackage時,出現(xiàn)如下錯誤:
成都創(chuàng)新互聯(lián)公司-云計算及IDC服務提供商,涵蓋公有云、IDC機房租用、四川主機托管、等保安全、私有云建設等企業(yè)級互聯(lián)網(wǎng)基礎服務,咨詢電話:18982081108
unable to load device-specific module; assuming none
using prebuilt recovery.img from IMAGES...
using system.img from target-files
Traceback (most recent call last):
File "./build/tools/releasetools/ota_from_target_files", line 1719, in
main(sys.argv[1:])
File "./build/tools/releasetools/ota_from_target_files", line 1674, in main
WriteFullOTAPackage(input_zip, output_zip)
File "./build/tools/releasetools/ota_from_target_files", line 610, in WriteFullOTAPackage
system_tgt = GetImage("system", OPTIONS.input_tmp, OPTIONS.info_dict)
File "./build/tools/releasetools/ota_from_target_files", line 496, in GetImage
return sparse_img.SparseImage(path, mappath, clobbered_blocks)
File "/home/guofengwan/workspace/rdadroid-6.0/build/tools/releasetools/sparse_img.py", line 50, in __init__
raise ValueError("Magic should be 0xED26FF3A but is 0x%08X" % (magic,))
ValueError: Magic should be 0xED26FF3A but is 0x23494255
make: *** [out/target/product/etau-Lensun_R635D_8810P/etau-ota-eng.guofengwan.zip] Error 1
經過查看打包腳本的py代碼,分析出在build/core/Makefile中
@echo "Package OTA: $@"
$(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH MKBOOTIMG=$(MKBOOTIMG) \
./build/tools/releasetools/ota_from_target_files -v \
- --block \
加了這個block參數(shù)導致了對Magic的檢查,進而出現(xiàn)了錯誤,去掉此參數(shù)后,編譯通過,那么此參數(shù)的作用是什么呢?見如下文章,http://blog.csdn.net/huangyabin001/article/details/44871481
Android5.x及其之后的版本都可以使用模塊式OTA來保證每個設備使用相同的分區(qū)。模塊式OTA把整個分區(qū)作為一個文件并且生成一個二進制補丁,而不是對比每個文件生成對應的很多個補丁。
模塊式OTA升級的開關就是--block參數(shù)。