内容
[DESCRIPTION]
在OTA升级过程中,在recovery mode中升级失败,从log显示如下:
16535552 bytes free on /cache (35660189 needed)
E:Error in /tmp/sideload/package.zip
(Status 7)
Update.zip is not correct
Installation aborted.
从log里面就可以看到,16535552 bytes free on /cache (35660189 needed)
这是因为:
差分升级的方式会从/system copy出要进行升級的档案至 /cache,然后打入patch后再copy回/system,
当要升級的档案大小超过/cache剩余空间,自然就无法完整copy.
以log来看,客户/cache只有30MB,他要升级的档案中最大的size为35660189 bytes,
这已经超过/cache的大小,无法copy过去.
这种情况建议做整包升级,整包升级不会做copy的动作。或者按照如下solution做临时解法:
修改build/tools/releasetools/ota_from_target_files文件,
在如下代码下增加一行。
Old:
common.ComputeDifferences(diffs)
for diff in diffs:
tf, sf, d = diff.GetPatch()
if d is None or len(d) > tf.size * OPTIONS.patch_threshold:
# patch is almost as big as the file; don't bother patching
tf.AddToZip(output_zip)
New
common.ComputeDifferences(diffs)
for diff in diffs:
tf, sf, d = diff.GetPatch()
if d is None or len(d) > tf.size * OPTIONS.patch_threshold: or sf.size > (30 * 1024 * 1024 * OPTIONS.patch_threshold):
# patch is almost as big as the file; don't bother patching
tf.AddToZip(output_zip)
,之后只需要拿整包target files重做出差分包.
|