OTA升级就是我们常说的空中升级,有两种类型,分别是:Increment OTA(增量/差分)和Full OTA(整包)。OTA两种类型最大的区别莫过于他们的”出发点“(我们对两种不同升级包的创建,并使用它进行OTA升级)。我们创建整包时不需要old包,可以直接使用base包进行升级,因此整包一般用来升级整个固件【∞-> B】,而差分包一般用于两个特定的点【A->B】。
之前在很多别的安卓平台都用过ota升级功能,只要把recovery功能做好,包的制作都算很顺畅的,没想到这次使用intel的byt_t_crv2却遇到问题。刚开始看对熟悉的制作过错还是开心了一下,感觉一切都是这么熟悉顺利,没想到最后当头一棒。
gavin@gavin:/opt/source/boxs/mbox_r44b_base$ ./build/tools/releasetools/ota_from_target_files -i base.zip target.zip update.zip
unzipping target target-files...
using device-specific extensions in out/host/linux-x86/bin/releasetools.py
unzipping source target-files...
Loading target...
Loading source...
134 diffs to compute
12.69 sec 2099 / 12343030 bytes ( 0.02%) system/priv-app/Launcher2.apk
17.82 sec 201 / 17827460 bytes ( 0.00%) system/lib/libLLVM.so
10.09 sec 3759 / 11823472 bytes ( 0.03%) system/framework/framework-res.apk
6.87 sec 2096 / 11124408 bytes ( 0.02%) system/priv-app/Settings.apk
5.01 sec 184 / 9635736 bytes ( 0.00%) system/framework/framework.odex
3.13 sec 196 / 5750489 bytes ( 0.00%) system/lib/libchromium_net.so
1.75 sec 179 / 3790016 bytes ( 0.00%) system/framework/services.odex
2.51 sec 38445 / 5157670 bytes ( 0.75%) system/lib/libpac.so
1.31 sec 181 / 3240128 bytes ( 0.01%) system/framework/core.odex
2.10 sec 242 / 3701377 bytes ( 0.01%) system/framework/framework.jar
1.23 sec 184 / 2943552 bytes ( 0.01%) system/framework/core-libart.odex
1.24 sec 2117 / 2683967 bytes ( 0.08%) system/priv-app/TeleService.apk
0.62 sec 181 / 1665384 bytes ( 0.01%) system/framework/framework2.odex
0.92 sec 247 / 1854250 bytes ( 0.01%) system/lib/libbcc.so
0.53 sec 232 / 1549942 bytes ( 0.01%) system/framework/services.jar
0.56 sec 185 / 1509992 bytes ( 0.01%) system/framework/ext.odex
0.62 sec 2108 / 1473450 bytes ( 0.14%) system/priv-app/SystemUI.apk
0.54 sec 179 / 1397624 bytes ( 0.01%) system/framework/telephony-common.odex
0.49 sec 174 / 1378848 bytes ( 0.01%) system/framework/apache-xml.odex
0.58 sec 237 / 1234067 bytes ( 0.02%) system/framework/core-libart.jar
0.58 sec 237 / 1231861 bytes ( 0.02%) system/framework/core.jar
0.56 sec 238 / 1222968 bytes ( 0.02%) system/framework/ext.jar
0.41 sec 171 / 1118856 bytes ( 0.02%) system/framework/bouncycastle.odex
0.37 sec 2110 / 927942 bytes ( 0.23%) system/priv-app/Keyguard.apk
0.31 sec 194 / 816398 bytes ( 0.02%) system/lib/libwebrtc_audio_preprocessing.so
0.37 sec 2132 / 803260 bytes ( 0.27%) system/app/Bluetooth.apk
0.27 sec 173 / 772664 bytes ( 0.02%) system/framework/webviewchromium.odex
0.21 sec 229 / 605728 bytes ( 0.04%) system/framework/framework2.jar
0.21 sec 202 / 583415 bytes ( 0.03%) system/lib/libstagefright_soft_aacenc.so
0.19 sec 190 / 535777 bytes ( 0.04%) system/bin/mdnsd
0.27 sec 231 / 549364 bytes ( 0.04%) system/framework/apache-xml.jar
0.20 sec 232 / 527830 bytes ( 0.04%) system/framework/telephony-common.jar
0.18 sec 329 / 479243 bytes ( 0.07%) system/lib/libstagefright_soft_aacdec.so
0.17 sec 2068 / 474303 bytes ( 0.44%) system/app/PhotoTable.apk
0.15 sec 231 / 409338 bytes ( 0.06%) system/framework/bouncycastle.jar
0.13 sec 181 / 375376 bytes ( 0.05%) system/framework/conscrypt.odex
0.22 sec 2053 / 385517 bytes ( 0.53%) system/priv-app/ContactsProvider.apk
0.16 sec 2081 / 368686 bytes ( 0.56%) system/app/PackageInstaller.apk
0.20 sec 2120 / 354688 bytes ( 0.60%) system/app/DocumentsUI.apk
0.13 sec 233 / 290783 bytes ( 0.08%) system/framework/webviewchromium.jar
0.10 sec 173 / 266376 bytes ( 0.06%) system/framework/android.policy.odex
1.20 sec 674 / 237151 bytes ( 0.28%) system/etc/NOTICE.html.gz
0.13 sec 2065 / 220177 bytes ( 0.94%) system/priv-app/CalendarProvider.apk
0.08 sec 175 / 214200 bytes ( 0.08%) system/framework/okhttp.odex
0.11 sec 2064 / 192703 bytes ( 1.07%) system/app/SensorCal.apk
0.08 sec 176 / 189688 bytes ( 0.09%) system/framework/android.test.runner.odex
0.08 sec 174 / 171848 bytes ( 0.10%) system/framework/voip-common.odex
0.10 sec 2077 / 155251 bytes ( 1.34%) system/app/CertInstaller.apk
0.08 sec 230 / 145349 bytes ( 0.16%) system/framework/conscrypt.jar
0.07 sec 184 / 139845 bytes ( 0.13%) system/xbin/oprofiled
0.07 sec 2059 / 132654 bytes ( 1.55%) system/priv-app/InputDevices.apk
0.07 sec 2063 / 131903 bytes ( 1.56%) system/priv-app/BackupRestoreConfirmation.apk
2.46 sec 268841 / 296051 bytes ( 90.81%) system/media/bootanimation.zip
0.07 sec 172 / 130760 bytes ( 0.13%) system/framework/mms-common.odex
0.17 sec 2070 / 127300 bytes ( 1.63%) system/priv-app/SettingsProvider.apk
0.17 sec 2061 / 123680 bytes ( 1.67%) system/priv-app/MediaProvider.apk
0.05 sec 167 / 120584 bytes ( 0.14%) system/framework/monkey.odex
0.06 sec 174 / 115112 bytes ( 0.15%) system/framework/uiautomator.odex
0.08 sec 234 / 112611 bytes ( 0.21%) system/framework/android.policy.jar
0.08 sec 229 / 90315 bytes ( 0.25%) system/framework/okhttp.jar
0.06 sec 2051 / 89065 bytes ( 2.30%) system/app/TelephonyProvider.apk
0.07 sec 228 / 74045 bytes ( 0.31%) system/framework/android.test.runner.jar
0.06 sec 2038 / 69831 bytes ( 2.92%) system/app/KeyChain.apk
0.07 sec 231 / 68031 bytes ( 0.34%) system/framework/voip-common.jar
0.05 sec 2065 / 59456 bytes ( 3.47%) system/priv-app/VpnDialogs.apk
0.04 sec 170 / 59152 bytes ( 0.29%) system/framework/javax.obex.odex
0.05 sec 228 / 52464 bytes ( 0.43%) system/framework/mms-common.jar
0.04 sec 185 / 50745 bytes ( 0.36%) system/lib/libmdnssd.so
0.04 sec 174 / 49344 bytes ( 0.35%) system/framework/am.odex
0.05 sec 232 / 48970 bytes ( 0.47%) system/framework/monkey.jar
0.05 sec 2074 / 47889 bytes ( 4.33%) system/priv-app/Shell.apk
0.05 sec 226 / 46594 bytes ( 0.49%) system/framework/uiautomator.jar
0.05 sec 181 / 45348 bytes ( 0.40%) system/bin/debuggerd
0.04 sec 173 / 41824 bytes ( 0.41%) system/framework/pm.odex
0.04 sec 2050 / 40381 bytes ( 5.08%) system/app/HdmiSettings.apk
0.04 sec 169 / 34912 bytes ( 0.48%) system/framework/com.intel.camera.extensions.odex
0.03 sec 171 / 27688 bytes ( 0.62%) system/framework/core-junit.odex
0.06 sec 2078 / 31725 bytes ( 6.55%) system/app/VppSettings.apk
0.07 sec 171 / 26312 bytes ( 0.65%) system/framework/com.intel.security.service.sepmanager.odex
0.06 sec 2048 / 26214 bytes ( 7.81%) system/priv-app/ExternalStorageProvider.apk
0.05 sec 229 / 25677 bytes ( 0.89%) system/framework/javax.obex.jar
0.07 sec 163 / 22048 bytes ( 0.74%) system/framework/com.android.location.provider.odex
0.05 sec 168 / 21640 bytes ( 0.78%) system/framework/com.intel.multidisplay.odex
0.05 sec 2078 / 19704 bytes ( 10.55%) system/priv-app/DefaultContainerService.apk
0.05 sec 231 / 19315 bytes ( 1.20%) system/framework/am.jar
0.04 sec 167 / 18032 bytes ( 0.93%) system/framework/content.odex
0.04 sec 229 / 17499 bytes ( 1.31%) system/framework/pm.jar
0.03 sec 168 / 15472 bytes ( 1.09%) system/framework/bmgr.odex
0.06 sec 169 / 16926 bytes ( 1.00%) system/bin/rdnssd
41.36 sec 230 / 49638784 bytes ( 0.00%) system/lib/libwebviewchromium.so
0.04 sec 2040 / 14365 bytes ( 14.20%) system/priv-app/FusedLocation.apk
0.04 sec 228 / 12400 bytes ( 1.84%) system/framework/com.intel.camera.extensions.jar
0.04 sec 220 / 11711 bytes ( 1.88%) system/framework/core-junit.jar
0.05 sec 2045 / 10920 bytes ( 18.73%) system/app/UserDictionaryProvider.apk
0.05 sec 168 / 10832 bytes ( 1.55%) system/framework/svc.odex
0.05 sec 164 / 10800 bytes ( 1.52%) system/framework/com.android.media.remotedisplay.odex
0.04 sec 167 / 9552 bytes ( 1.75%) system/framework/input.odex
0.04 sec 166 / 9392 bytes ( 1.77%) system/framework/requestsync.odex
0.04 sec 164 / 9248 bytes ( 1.77%) system/framework/media_cmd.odex
0.04 sec 227 / 9209 bytes ( 2.46%) system/framework/com.intel.multidisplay.jar
0.04 sec 224 / 8963 bytes ( 2.50%) system/framework/com.intel.security.service.sepmanager.jar
0.04 sec 167 / 8576 bytes ( 1.95%) system/framework/settings.odex
0.04 sec 225 / 8507 bytes ( 2.64%) system/framework/com.android.location.provider.jar
0.04 sec 2048 / 8199 bytes ( 24.98%) system/priv-app/ProxyHandler.apk
0.04 sec 228 / 7716 bytes ( 2.95%) system/framework/content.jar
0.04 sec 167 / 7256 bytes ( 2.30%) system/framework/ime.odex
0.04 sec 2047 / 7148 bytes ( 28.64%) system/app/WAPPushManager.apk
0.04 sec 163 / 7080 bytes ( 2.30%) system/framework/wm.odex
0.06 sec 2040 / 6906 bytes ( 29.54%) system/priv-app/SharedStorageBackup.apk
0.04 sec 225 / 6683 bytes ( 3.37%) system/framework/bmgr.jar
0.05 sec 165 / 6536 bytes ( 2.52%) system/framework/com.android.future.usb.accessory.odex
0.04 sec 169 / 6328 bytes ( 2.67%) system/framework/com.intel.nfc.adapteraddon.odex
0.05 sec 198 / 6203 bytes ( 3.19%) system/lib/libbcc.sha1.so
0.04 sec 2036 / 5702 bytes ( 35.71%) system/priv-app/OneTimeInitializer.apk
0.04 sec 2029 / 5656 bytes ( 35.87%) system/app/PacProcessor.apk
0.04 sec 162 / 5504 bytes ( 2.94%) system/framework/bu.odex
0.05 sec 228 / 4703 bytes ( 4.85%) system/framework/input.jar
0.04 sec 226 / 4620 bytes ( 4.89%) system/framework/svc.jar
0.05 sec 229 / 4590 bytes ( 4.99%) system/framework/com.android.media.remotedisplay.jar
0.04 sec 228 / 4205 bytes ( 5.42%) system/framework/media_cmd.jar
0.05 sec 228 / 4247 bytes ( 5.37%) system/framework/requestsync.jar
0.04 sec 166 / 4200 bytes ( 3.95%) system/framework/com.intel.security.lib.sepdrmjni.odex
0.04 sec 226 / 4114 bytes ( 5.49%) system/framework/settings.jar
0.04 sec 2054 / 3688 bytes ( 55.69%) system/app/Provision.apk
0.04 sec 225 / 3411 bytes ( 6.60%) system/framework/wm.jar
0.04 sec 225 / 3373 bytes ( 6.67%) system/framework/ime.jar
0.04 sec 225 / 2925 bytes ( 7.69%) system/framework/com.intel.nfc.adapteraddon.jar
0.04 sec 226 / 2833 bytes ( 7.98%) system/framework/com.android.future.usb.accessory.jar
0.04 sec 223 / 2726 bytes ( 8.18%) system/framework/bu.jar
0.04 sec 208 / 2420 bytes ( 8.60%) system/build.prop
0.05 sec 223 / 1824 bytes ( 12.23%) system/framework/com.intel.security.lib.sepdrmjni.jar
0.04 sec 159 / 1800 bytes ( 8.83%) system/framework/com.intel.config.odex
0.04 sec 190 / 1309 bytes ( 14.51%) system/etc/security/otacerts.zip
0.03 sec 221 / 871 bytes ( 25.37%) system/framework/com.intel.config.jar
building image from target_files BOOT...Traceback (most recent call last): File "./build/tools/releasetools/ota_from_target_files", line 1057, inmain(sys.argv[1:])
File "./build/tools/releasetools/ota_from_target_files", line 1042, in main
WriteIncrementalOTAPackage(input_zip, source_zip, output_zip)
File "./build/tools/releasetools/ota_from_target_files", line 679, in WriteIncrementalOTAPackage
OPTIONS.source_info_dict)
File "/opt/source/boxs/mbox_r44b_base/build/tools/releasetools/common.py", line 344, in GetBootableImage
info_dict))
File "/opt/source/boxs/mbox_r44b_base/build/tools/releasetools/common.py", line 818, in __init__
self.size = len(data)
TypeError: object of type 'NoneType' has no len()
通过粗浅的python知识,知道这里是参数不对。根据提示打开build/tools/releasetools/ota_from_target_files文件研究了一会,参数安全就不是那么回事啊,驴头不对马嘴的,一切都对应不上的。打开百度搜到的也就是有个try的缩进不对,完成不是我要的家结果。
最后仔细研究整个包的制作过程,发现intel比较奇葩的地方是,他的所有包的校验都算用的自己定义的一套东西,
running: openssl pkcs8 -in ./vendor/intel/PRIVATE/cert/testkey.pk8 -inform DER -nocrypt
难道制作全包的时候使用也是自己的工具。带着试试看的心态,搜了一下ota_from_target_files
gavin@gavin:/opt/source/boxs/mbox_r44b_base$ find -name ota_from_target_files
./vendor/intel/hardware/libintelprov/releasetools/ota_from_target_files
./out/host/linux-x86/obj/EXECUTABLES/ota_from_target_files_intermediates/ota_from_target_files
./out/host/linux-x86/bin/ota_from_target_files
果然发现在./vendor/intel/hardware/libintelprov/releasetools/下有自己的东西,拿出来一用果然都应验了,增量包制作成功,完美的刷机成功了。虽说好奇害死猫,但是作为开发还是要脑洞打开,敢想敢干。