gpt4 book ai didi

android - 生成安卓增量OTA包报错

转载 作者:太空宇宙 更新时间:2023-11-04 12:24:47 25 4
gpt4 key购买 nike

通过将我的自定义补丁应用到 AOSP 代码,我能够为我的开发板构建 Android 镜像。生成的二进制文件(比如说版本 1)工作正常。我对我的补丁做了一些改动,构建了最新的图像(比如说版本 2)。这也很好用。

通过运行 dist 命令,我有这些版本的相应 target_files

make dist 

有效的方法:

当我尝试在我的 Linux 机器(比如 PC-1)上生成增量 ota 包时,生成了 ota.zip 文件并且工作正常。

./build/tools/releasetools/ota_from_target_files -i ./version1_target_file.zip ./version2_target_file.zip oat_file_version_1_to_2.zip 
unzipping target target-files...
unzipping source target-files...
unable to load device-specific module; assuming none
Loading target...
Loading source...
2 diffs to compute
0.41 sec 316 / 307886 bytes ( 0.10%) system/etc/recovery-resource.dat
1.43 sec 1799 / 2521277 bytes ( 0.07%) system/priv-app/Calander.apk
building image from target_files BOOT...
building image from target_files BOOT...
building image from target_files RECOVERY...
building image from target_files RECOVERY...
boot target: 5414912 source: 5414912 diff: 1086759
boot image changed; including.
recovery image changed; including as patch from boot.
done.

什么不起作用:

同样在另一台 Linux PC(PC-1 除外)上尝试时,存在依赖性错误导致我的脚本失败。

./build/tools/releasetools/ota_from_target_files -i ./version1_target_file.zip ./version2_target_file.zip oat_file_version_1_to_2.zip 
unzipping target target-files...
unzipping source target-files...
unable to load device-specific module; assuming none
Loading target...
Loading source...
2 diffs to compute
[Errno 2] No such file or directory
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/ubuntu/otaPackageBuildTest/test/build/tools/releasetools/common.py", line 919, in worker
d.ComputePatch()
File "/home/ubuntu/otaPackageBuildTest/test/build/tools/releasetools/common.py", line 879, in ComputePatch
p = Run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
File "/home/ubuntu/otaPackageBuildTest/test/build/tools/releasetools/common.py", line 68, in Run
return subprocess.Popen(args, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
[Errno 2] No such file or directory
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/ubuntu/otaPackageBuildTest/test/build/tools/releasetools/common.py", line 919, in worker
d.ComputePatch()
File "/home/ubuntu/otaPackageBuildTest/test/build/tools/releasetools/common.py", line 879, in ComputePatch
p = Run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
File "/home/ubuntu/otaPackageBuildTest/test/build/tools/releasetools/common.py", line 68, in Run
return subprocess.Popen(args, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory


building image from target_files BOOT...
Traceback (most recent call last):
File "./build/tools/releasetools/ota_from_target_files", line 914, in <module>
main(sys.argv[1:])
File "./build/tools/releasetools/ota_from_target_files", line 899, in main
WriteIncrementalOTAPackage(input_zip, source_zip, output_zip)
File "./build/tools/releasetools/ota_from_target_files", line 605, in WriteIncrementalOTAPackage
OPTIONS.source_info_dict)
File "/home/ubuntu/otaPackageBuildTest/test/build/tools/releasetools/common.py", line 344, in GetBootableImage
info_dict))
File "/home/ubuntu/otaPackageBuildTest/test/build/tools/releasetools/common.py", line 281, in BuildBootableImage
p1 = Run(cmd, stdout=subprocess.PIPE)
File "/home/ubuntu/otaPackageBuildTest/test/build/tools/releasetools/common.py", line 68, in Run
return subprocess.Popen(args, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

问题:在新的 Linux PC 上生成增量 ota 文件所需的最小包是什么?

最佳答案

我会安装所有必要的 AOSP 库,如以下所述:https://source.android.com/source/initializing

对于 Ubuntu 14.04/16.04:

sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip

此外,有时它有助于传递主机架构(-p arg)和详细选项(-v)以从命令本身获取更多调试信息:

即.

./build/tools/releasetools/ota_from_target_files -v --block -p out/host/linux-x86 -k build/target/product/security/releasekey -i previous_signed_target_files.zip signed_target_files.zip incremental.zip

关于android - 生成安卓增量OTA包报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45078261/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com