5

I am trying to build cyanogenmod, but the build fails with the following. My drive on /mnt has plenty of space, however the root-partition where /tmp resides has less space, so I assume this happens while writing a temporary file.

Therefore I would like to redirect the temporary directory for this to somewhere under /mnt as well, how can I do this in cyanogenmod/Android build system? I tried setting TMP and TEMP but they don't seem to have any effect.

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'

Update: I found a workaround by editing /mnt/android/system/build/tools/releasetools/common.py and setting a temp-dir manually with something like tmpdir = tempfile.mkdtemp(dir='/mnt/tmp') at line 1299, according to documentation mkdtemp should use TMP and TEMP, however that seems to not have worked for me here! Python is at version 2.7.6.

centic
  • 15,565
  • 9
  • 68
  • 125

1 Answers1

0

To set the TMPDIR environment variable, specify a directory that is accessible to the user ID that runs the replication or publishing programs. Ensure that files cannot be deleted by other user IDs. For example, the following command specifies the /home/repldba/tempfiles/ directory: export TMPDIR=/home/repldba/tempfiles/

Laxman N
  • 1
  • 2