[Miscellaneous Android Development] agismaniax:
I still use Bruno Martin's MTK Tools to unpack/repack after the compilation. :good:

I only take the ramdisk-recovery.cpio from the OUT_DIR folder, extract it, edit/change/remove some files, repack with stock/custom kernel to achieve smallest recovery.img size.

Configuration for ZTE N986 with single partition (/data/media)

BoardConfig.mk

USE_CAMERA_STUB := true

# inherit from the proprietary version
-include vendor/ZTE/N986/BoardConfigVendor.mk

TARGET_ARCH := arm
TARGET_NO_BOOTLOADER := true
TARGET_BOARD_PLATFORM := unknown
TARGET_CPU_ABI := armeabi-v7a
TARGET_CPU_ABI2 := armeabi
TARGET_ARCH_VARIANT := armv7-a-neon
TARGET_CPU_VARIANT := cortex-a7
TARGET_CPU_SMP := true
ARCH_ARM_HAVE_TLS_REGISTER := true

TARGET_BOOTLOADER_BOARD_NAME := N986

BOARD_KERNEL_CMDLINE := 8F02V1.0.5B01
BOARD_KERNEL_BASE := 0x10000000
BOARD_KERNEL_PAGESIZE := 2048

# fix this up by examining /proc/mtd on a running device
BOARD_BOOTIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_USERDATAIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_FLASH_BLOCK_SIZE := 131072

TARGET_PREBUILT_KERNEL := device/ZTE/N986/kernel

BOARD_HAS_NO_SELECT_BUTTON := true

#Philz Touch build flags for MTK
TARGET_USE_CUSTOM_LUN_FILE_PATH := "/sys/devices/platform/mt_usb/gadget/lun%d/file"
TARGET_COMMON_NAME := N986
BOARD_USE_MTK_LAYOUT := true
BOARD_MTK_BOOT_LABEL := "/bootimg"
BOARD_USE_NTFS_3G := false
TARGET_SCREEN_HEIGHT := 1280
TARGET_SCREEN_WIDTH := 720
BRIGHTNESS_SYS_FILE := "/sys/class/leds/lcd-backlight/brightness"

recovery.fstab

# mount point	fstype device	[device2]
/dev/bootimg /bootimg emmc defaults defaults
/dev/recovery /recovery emmc defaults defaults
/dev/uboot /uboot emmc defaults defaults
/emmc@android /system ext4 ro,noatime wait
/emmc@cache /cache ext4 noatime,nosuid,nodev,noauto_da_alloc wait
/emmc@usrdata /data ext4 noatime,nosuid,nodev,noauto_da_alloc wait,encryptable=footer
/dev/block/mmcblk1p1 /sdcard vfat defaults defaults

UPDATE:

I'm still confused with the correlation between recovery.fstab, fstab.<device_id>, init and vold managed mount point. I only found the differences between recovery.fstab v1 and v2 in this post. Could you describe it a little bit?

I'm testing this fstab with kitkat kernel and it's working fine.

recovery.fstab

# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK

/dev/bootimg /bootimg emmc defaults defaults
/dev/recovery /recovery emmc defaults defaults
/dev/uboot /uboot emmc defaults defaults
/emmc@android /system ext4 ro,noatime wait
/emmc@cache /cache ext4 noatime,nosuid,nodev,noauto_da_alloc wait
/emmc@usrdata /data ext4 noatime,nosuid,nodev,noauto_da_alloc wait,encryptable=footer
/emmc@fat /emmc vfat defaults defaults
/dev/block/mmcblk1p1 /sdcard vfat defaults defaults

# VOLD mount points (Ref taken from Lenovo S939 KitKat 4.4.2)
# vold managed volumes for generic MTK
#/devices/platform/mtk-sd.0/mmc_host auto vfat defaults voldmanaged=sdcard0:emmc@fat,noemulatedsd
#/devices/platform/mtk-sd.1/mmc_host auto vfat defaults voldmanaged=sdcard1:auto

fstab.goldfish

# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK

/dev/block/mtdblock0 /system ext4 ro,barrier=1	wait
/dev/block/mtdblock1 /data ext4 noatime,nosuid,nodev,barrier=1,nomblk_io_submit wait,check
/dev/block/mtdblock2 /cache ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait,check
#/devices/platform/mtk-sd.0/mmc_host auto vfat defaults voldmanaged=sdcard0:emmc@fat,noemulatedsd
#/devices/platform/mtk-sd.1/mmc_host auto vfat defaults voldmanaged=sdcard1:auto