android - 构建cyanogenmod时如何设置临时目录

标签 android python python-2.7 cyanogenmod temporary-directory

我正在尝试构建 cyanogenmod,但构建失败并显示以下内容。我在/mnt 上的驱动器有足够的空间,但是/tmp 所在的根分区空间较小,所以我假设这是在写入临时文件时发生的。

因此我也想将临时目录重定向到/mnt 下的某个地方,我该如何在 cyanogenmod/Android 构建系统中执行此操作?我尝试设置 TMPTEMP 但它们似乎没有任何效果。

Package OTA: /mnt/android/system/out/target/product/oneplus3/cm_oneplus3-ota-178d4560f4.zip
unzipping target target-files...
  running:  unzip -o -q /mnt/android/system/out/target/product/oneplus3/obj/PACKAGING/target_files_intermediates/cm_oneplus3-target_files-178d4560f4.zip -d /tmp/targetfiles-RM6VsH
--- target info ---
...
cache_size                = (int) 268435456
...
recovery_size             = (int) 67108864
...
userdata_size             = (int) 57436708864
(using device-specific extensions from target_files)
loaded device-specific extensions from /tmp/targetfiles-RM6VsH/META/releasetools.py
Warning: could not find RADIO/filesmap in <zipfile.ZipFile object at 0x2b4193f91fd0>.
using prebuilt recovery.img from BOOTABLE_IMAGES...
using system.img from target-files
Total of 770048 4096-byte output blocks in 2698 input chunks.
Generating digraph...
Finding vertex sequence...
Reversing backward edges...
  0/0 dependencies (0.00%) were violated; 0 source blocks stashed.
Improving vertex order...
Revising stash size...
  Total 0 blocks are packed as new blocks due to insufficient cache size.
Reticulating splines...
Traceback (most recent call last):
  File "./build/tools/releasetools/ota_from_target_files", line 1772, in <module>
    main(sys.argv[1:])
  File "./build/tools/releasetools/ota_from_target_files", line 1727, in main
    WriteFullOTAPackage(input_zip, output_zip)
  File "./build/tools/releasetools/ota_from_target_files", line 664, in WriteFullOTAPackage
    system_diff = common.BlockDifference("system", system_tgt, src=None)
  File "/mnt/android/system/build/tools/releasetools/common.py", line 1302, in __init__
    b.Compute(self.path)
  File "/mnt/android/system/build/tools/releasetools/blockimgdiff.py", line 299, in Compute
    self.ComputePatches(prefix)
  File "/mnt/android/system/build/tools/releasetools/blockimgdiff.py", line 618, in ComputePatches
    new_f.write(piece)
IOError: [Errno 28] No space left on device
make: *** [/mnt/android/system/out/target/product/oneplus3/cm_oneplus3-ota-178d4560f4.zip] Error 1
make: Leaving directory `/mnt/android/system'

更新:我通过编辑 /mnt/android/system/build/tools/releasetools/common.py 并手动设置临时目录找到了一个解决方法像第 1299 行的 tmpdir = tempfile.mkdtemp(dir='/mnt/tmp'),根据文档 mkdtemp 应该使用 TMPTEMP,但这似乎对我不起作用! Python 的版本为 2.7.6。

最佳答案

要设置 TMPDIR 环境变量,请指定运行复制或发布程序的用户 ID 可以访问的目录。确保文件不能被其他用户标识删除。 例如,以下命令指定/home/repldba/tempfiles/目录: 导出 TMPDIR=/home/repldba/tempfiles/

关于android - 构建cyanogenmod时如何设置临时目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38238463/

相关文章:

android - 防止 TabHost 选项卡更改?

android - 哪个才是真正的androidmanifest.xml?

android - 获取 TextView 中文本的大小

python - 如何在 Python 中制作 float ?

python - 使用 Python 转储 PostgreSQL 数据库模式

java - 为什么我得到默认值?

python - 如何使用 python 规范化原始音频文件

Python/MySQL-如何正确使用 %s 来计算行数

Pandas 对子字符串或正则表达式进行分组

python-2.7 - 将命令行参数传递给 selenium python webdriver 测试用例