Meh, AOSP 7.1 requires symlink to /cache to /data/cache. Not to mention at 99 percent of build, I got a error to define partition size.

BuildImage: in_dir = /media/daedroza/workspace/CyanogenMod-14.X/out/target/product/yuga/cache, out_file = /media/daedroza/workspace/CyanogenMod-14.X/out/target/product/yuga/cache.img
Traceback (most recent call last):
  File "./build/tools/releasetools/", line 699, in <module>
  File "./build/tools/releasetools/", line 692, in main
    if not BuildImage(in_dir, image_properties, out_file, target_out):
  File "./build/tools/releasetools/", line 402, in BuildImage
KeyError: 'partition_size'

Now you can use parted to define the size. The Tetsuo way is -

adb push /tmp
cd /tmp
chmod +x sdparted/*
cp sdparted/* /sbin
parted /dev/block/mmcblk0 print free,all
blockdev --getsize64 /dev/block/mmcblk0p3

Another way, that I used before Tetsuo taught me this -

df -t
dd if='/dev/block/mmcblk0p3' of='/storage/ext_sdcard/1.img'
cd /storage/ext_sdcard && ls -l

‘dd’ prints the value in getsize64 after the transfer is successful. Thanks to Adrian and Tetsuo for all the knowledge :)