[Miscellaneous Android Development] :
Modify required ramdisk files - Kitkat.

Kitkat:

Open editor, then open in one window dumchar_info.txt (the one you've got earlier), the fstab file, init.usb.rc, meta.init.rc, any init file with ssd in name from boot ramdisk and default.prop from recovery ramdisk, and in another window recovery.fstab from carliv's ramdisk/etc folder, fstab.mt65nn, default.prop and init.rc also from carliv's ramdisk.

Check and compare both default.prop and make same modifications as for jellybean.

Stock:

#
# ADDITIONAL_DEFAULT_PROPERTIES
#
ro.secure=1
ro.allow.mock.location=0
persist.mtk.aee.aed=on
ro.debuggable=0
ro.adb.secure=1
persist.sys.usb.config=mtp
persist.service.acm.enable=0
ro.mount.fs=EXT4
ro.persist.partition.support=no
# begin build properties
# autogenerated by buildinfo.sh
ro.build.id=KOT49H
ro.build.display.id=VIBEUI_V2.0_1437_7.14.1_ST_P780
ro.build.version.incremental=VIBEUI_V2.0_1437_7.14.1_ST_P780
ro.custom.build.version=VIBEUI_V2.0_1437_7.14.1_ST_P780
ro.build.version.sdk=19
ro.build.version.codename=REL
ro.build.version.release=4.4.2
ro.build.date=Wed Sep 3 05:55:18 CST 2014
ro.build.date.utc=1409694918
ro.build.type=user
ro.build.user=buildslave
ro.build.host=xmws54
ro.build.tags=release-keys
[COLOR="Blue"]ro.product.model[/COLOR]=[COLOR="Red"]Lenovo P780[/COLOR]
[COLOR="Blue"]ro.product.brand[/COLOR]=[COLOR="Red"]Lenovo[/COLOR]
[COLOR="Blue"]ro.product.name[/COLOR]=[COLOR="Red"]prada[/COLOR]
[COLOR="Blue"]ro.product.device[/COLOR]=[COLOR="Red"]P780[/COLOR]
[COLOR="Blue"]ro.product.board[/COLOR]=[COLOR="Red"]prada[/COLOR]
ro.product.cpu.abi=armeabi-v7a
ro.product.cpu.abi2=armeabi
[COLOR="Blue"]ro.product.manufacturer[/COLOR]=[COLOR="Red"]LENOVO[/COLOR]
ro.product.locale.language=zh
ro.product.locale.region=CN
ro.wifi.channels=
[COLOR="Blue"]ro.board.platform[/COLOR]=
# ro.build.product is obsolete; use ro.product.device
[COLOR="Blue"]ro.build.product[/COLOR]=[COLOR="Red"]P780[/COLOR]
# Do not try to parse ro.build.description or .fingerprint
ro.build.description=prada-user 4.4.2 KOT49H VIBEUI_V2.0_1437_7.14.1_ST_P780 dev-keys
ro.build.fingerprint=[COLOR="Red"]Lenovo[/COLOR]/[COLOR="Red"]prada[/COLOR]/[COLOR="Red"]P780[/COLOR]:4.4.2/KOT49H/VIBEUI_V2.0_1437_7.14.1_ST_P780.:user/release-keys
ro.build.flavor=
ro.build.characteristics=default
# end build properties

# begin mediatek build properties
ro.mediatek.version.release=ALPS.KK1.MP5.V1
ro.mediatek.platform=MT6589
ro.mediatek.chip_ver=S01
ro.mediatek.version.branch=KK1.MP5
ro.mediatek.version.sdk=2
# end mediatek build properties
#
# from out/target/product/prada/obj/CUSTGEN/config/system.prop
#
#
# system.prop for generic sdk
#
.........
[COLOR="Red"]ro.product.ota.model=LenovoP780_ROM_ST_KK[/COLOR]
......
dalvik.vm.stack-trace-file=/data/anr/traces.txt

and Carliv:

#
# ADDITIONAL_DEFAULT_PROPERTIES
#
ro.secure=0
ro.allow.mock.location=1
persist.mtk.aee.aed=on
ro.debuggable=1
persist.service.acm.enable=0
persist.sys.usb.config=mass_storage,adb
ro.bootloader.mode=download
ro.mount.fs=EXT4
# begin build properties
# autogenerated by buildinfo.sh
ro.build.id=KTU84Q
ro.build.display.id=cm_[COLOR="Red"]new[/COLOR]-eng 4.4.4 KTU84Q 347d7427a4 test-keys
ro.build.version.incremental=347d7427a4
ro.build.version.sdk=19
ro.build.version.codename=REL
ro.build.version.release=4.4.4
ro.build.date=Tue Dec 9 16:23:16 EET 2014
ro.build.date.utc=0
ro.build.type=eng
ro.build.user=carliv
ro.build.host=max
ro.build.tags=test-keys
[COLOR="Blue"]ro.product.brand[/COLOR]=[COLOR="Red"]mtk[/COLOR]
[COLOR="Blue"]ro.product.name[/COLOR]=cm_[COLOR="Red"]new[/COLOR]
[COLOR="Blue"]ro.product.board[/COLOR]=
ro.product.cpu.abi=armeabi-v7a
ro.product.cpu.abi2=armeabi
[COLOR="Blue"]ro.product.manufacturer[/COLOR]=[COLOR="Red"]mtk[/COLOR]
ro.product.locale.language=en
ro.product.locale.region=US
ro.wifi.channels=
[COLOR="Blue"]ro.board.platform[/COLOR]=[COLOR="Red"]mt6582[/COLOR]
# ro.build.product is obsolete; use ro.product.device
[COLOR="Blue"]ro.build.product[/COLOR]=[COLOR="Red"]new[/COLOR]
[COLOR="Blue"]ro.product.model[/COLOR]=[COLOR="Red"]new[/COLOR]
[COLOR="Blue"]ro.product.device[/COLOR]=[COLOR="Red"]new[/COLOR]
# Do not try to parse ro.build.description or .fingerprint
ro.build.description=cm_[COLOR="Red"]new[/COLOR]-eng 4.4.4 KTU84Q 347d7427a4 test-keys
ro.build.fingerprint=[COLOR="Red"]mtk[/COLOR]/cm_[COLOR="Red"]new[/COLOR]/[COLOR="Red"]new[/COLOR]:4.4.4/KTU84Q/347d7427a4:eng/test-keys
ro.build.characteristics=default
[COLOR="Blue"]ro.cm.device[/COLOR]=[COLOR="Red"]new[/COLOR]
# end build properties
#
# from device/mtk/new/system.prop
#
#
# system.prop for new
#

#
# ADDITIONAL_BUILD_PROPERTIES
#
ro.rommanager.developerid=cyanogenmod
ro.com.google.clientidbase=android-google
keyguard.no_require_sim=true
ro.url.legal=http://www.google.com/intl/%s/mobile/android/basic/phone-legal.html
ro.url.legal.android_privacy=http://www.google.com/intl/%s/mobile/android/basic/privacy.html
ro.com.android.wifi-watchlist=GoogleGuest
ro.setupwizard.enterprise_mode=1
ro.com.android.dateformat=MM-dd-yyyy
ro.com.android.dataroaming=false
ro.build.selinux=1
persist.sys.dalvik.multithread=false
persist.sys.dun.override=0
persist.sys.root_access=1
ro.cm.version=11-20141209-UNOFFICIAL-[COLOR="Red"]new[/COLOR]
ro.cm.releasetype=UNOFFICIAL
ro.modversion=11-20141209-UNOFFICIAL-[COLOR="Red"]new[/COLOR]
ro.cmlegal.url=http://www.cyanogenmod.org/docs/privacy
persist.sys.recovery_update=false
ro.cm.display.version=11-20141209-UNOFFICIAL-[COLOR="Red"]new[/COLOR]
ro.config.notification_sound=Argon.ogg
ro.config.alarm_alert=Hassium.ogg
ro.config.ringtone=Orion.ogg
ro.carrier=unknown
ro.ril.hsxpa=1
ro.ril.gprsclass=10
ro.adb.qemud=1
persist.sys.dalvik.vm.lib=libdvm.so
ro.kernel.android.checkjni=1
net.bt.name=Android
dalvik.vm.stack-trace-file=/data/anr/traces.txt

Compare recovery.fstab with fstab and dumchar file, and also with fstab.mt65nn. If there are any modifications make them, but usually if your device is emmc too only one thing you have to modify: the paths for voldmanaged sdcards. In boot fstab those paths are not correct, don't work for recovery, and you need to find correct path right in your phone with a root explorer.

Stock recovery.fstab, can't be used:

boot	/boot emmc defaults defaults
/dev/block/mmcblk0p2 /cache ext4 defaults defaults
/dev/block/mmcblk0p3 /data ext4 defaults defaults
misc	/misc emmc defaults defaults
recovery	/recovery emmc defaults defaults
/dev/block/mmcblk0p4 /sdcard vfat defaults defaults
/dev/block/mmcblk0p6 /system ext4 defaults defaults

Stock fstab, wrong sdcards paths:

# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
# 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

/emmc@usrdata /data ext4 noatime,nosuid,nodev,noauto_da_alloc wait,check,encryptable=footer
/emmc@protect_f /protect_f ext4 noatime,nosuid,nodev,noauto_da_alloc wait,check
/emmc@protect_s /protect_s ext4 noatime,nosuid,nodev,noauto_da_alloc wait,check
[COLOR="Red"]/devices/platform/mtk-msdc.0/mmc_host[/COLOR] auto vfat defaults voldmanaged=sdcard0:emmc@fat,[COLOR="Red"]noemulatedsd[/COLOR]
[COLOR="Red"]/devices/platform/mtk-msdc.1/mmc_host[/COLOR] auto vfat defaults voldmanaged=sdcard1:auto

#lenovo-sw yexh1 2014_03_19 add for usbotg sdcard2
/devices/platform/mt_usb/sda auto vfat defaults voldmanaged=usbotg:auto
/devices/platform/mt_usb/sdb auto vfat defaults voldmanaged=usbotg1:auto
#lenovo-sw yexh1 2014_03_19 add for usbotg sdcard2,end

Carliv fstab.mt65nn, this will work

# 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

#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>

/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@protect_f /protect_f ext4 noatime,nosuid,nodev,noauto_da_alloc wait,check
/emmc@protect_s /protect_s ext4 noatime,nosuid,nodev,noauto_da_alloc wait,check

# vold-managed volumes
[COLOR="Blue"]/devices/platform/mtk-msdc.0/mmc_host/mmc0[/COLOR] auto auto defaults voldmanaged=sdcard1:8
[COLOR="Blue"]/devices/platform/mtk-msdc.1/mmc_host/mmc1[/COLOR] auto auto defaults voldmanaged=sdcard0:auto

/dev/bootimg /boot emmc defaults defaults
/dev/nvram /nvram emmc defaults defaults
/dev/recovery /recovery emmc defaults defaults
/dev/uboot /uboot emmc defaults defaults
/dev/misc /misc emmc defaults defaults

and carliv 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

#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>

/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

# vold-managed volumes
/devices/platform/mtk-msdc.0/mmc_host/mmc0 auto auto defaults voldmanaged=sdcard1:8,
/devices/platform/mtk-msdc.1/mmc_host/mmc1 auto auto defaults voldmanaged=sdcard0:auto

/dev/bootimg /boot emmc defaults defaults
/dev/nvram /nvram emmc defaults defaults
/dev/recovery /recovery emmc defaults defaults
/dev/uboot /uboot emmc defaults defaults
/dev/misc /misc emmc defaults defaults

Also, if you use any label after sdcardn:auto, it won't work (ex. noemulatedsd, nonremovablesd). Copy same things from recovery.fstab to fstab.mt65nn, if there are some changes. In fstab.mt65nn there are two more partitions, protect_f and protect_s, or other for custapck phones.

# 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
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/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
[COLOR="Red"]/emmc@protect_f /protect_f ext4 noatime,nosuid,nodev,noauto_da_alloc wait,check
/emmc@protect_s /protect_s ext4 noatime,nosuid,nodev,noauto_da_alloc wait,check[/COLOR]
# vold-managed volumes
/devices/platform/mtk-msdc.0/mmc_host/mmc0 auto auto defaults voldmanaged=sdcard0:8
/devices/platform/mtk-msdc.1/mmc_host/mmc1 auto auto defaults voldmanaged=sdcard1:auto
/devices/platform/mt_usb/sda/sda1 auto auto defaults voldmanaged=usbotg:auto
/dev/bootimg /boot emmc defaults defaults
/dev/nvram /nvram emmc defaults defaults
/dev/recovery /recovery emmc defaults defaults
/dev/uboot /uboot emmc defaults defaults
/dev/misc /misc emmc defaults defaults

# 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

#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>

/emmc@android /system ext4 ro,noatime wait
[COLOR="Red"]/emmc@custpack /custpack ext4 noatime,nosuid,nodev,noauto_da_alloc wait[/COLOR]
/emmc@cache /cache ext4 noatime,nosuid,nodev,noauto_da_alloc wait
/emmc@usrdata /data ext4 noatime,nosuid,nodev,noauto_da_alloc wait,encryptable=footer
[COLOR="Red"]/emmc@mobile_info /mobile_info ext4 noatime,nosuid,nodev,noauto_da_alloc wait,check[/COLOR]

# vold-managed volumes
/devices/platform/mtk-msdc.0/mmc_host/mmc0 auto auto defaults voldmanaged=sdcard0:8,
/devices/platform/mtk-msdc.1/mmc_host/mmc1 auto auto defaults voldmanaged=sdcard1:auto

/dev/bootimg /boot emmc defaults defaults
/dev/nvram /nvram emmc defaults defaults
/dev/recovery /recovery emmc defaults defaults
/dev/uboot /uboot emmc defaults defaults
/dev/misc /misc emmc defaults defaults

If the phone has Ubifs file system, set the paths according to dumchar only for mtd partitions, not ubifs.

# 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

#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>

/ubi@system /system ubifs ro,noatime wait
/ubi@cache /cache ubifs noatime,nosuid,nodev,noauto_da_alloc wait
/ubi@userdata /data ubifs noatime,nosuid,nodev,noauto_da_alloc wait,encryptable=footer

# vold-managed volumes
/devices/platform/mtk-msdc.0/mmc_host/mmc0 auto auto defaults voldmanaged=sdcard0:8,
/devices/platform/mtk-msdc.1/mmc_host/mmc1 auto auto defaults voldmanaged=sdcard1:auto

/dev/mtd/mtd6 /boot mtd defaults defaults
/dev/mtd/mtd2 /nvram mtd defaults defaults
/dev/mtd/mtd7 /recovery mtd defaults defaults
/dev/mtd/mtd5 /uboot mtd defaults defaults
/dev/mtd/mtd9 /misc mtd defaults defaults

Last step, focus on init.rc on one side and the other rc files from boot on the other side. You have to check sdcards setup as bellow.

on early-init
# Apply strict SELinux checking of PROT_EXEC on mmap/mprotect calls.
write /sys/fs/selinux/checkreqprot 0

# Set the security context for the init process.
# This should occur before anything else (e.g. ueventd) is started.
setcon u:r:init:s0

start ueventd
start healthd

on init
export PATH /sbin:/system/bin
export ANDROID_ROOT /system
export ANDROID_DATA /data
[COLOR="Red"] export EXTERNAL_STORAGE /storage/sdcard0
export SECONDARY_STORAGE /storage/sdcard1[/COLOR]

symlink /system/etc /etc

mkdir /boot
mkdir /recovery
mkdir /sdcard
mkdir /internal_sd
mkdir /external_sd
mkdir /sd-ext
mkdir /datadata
mkdir /sdcard2
mkdir /system
mkdir /cache
mkdir /data
mount tmpfs tmpfs /tmp

chown root shell /tmp
chmod 0775 /tmp

# See storage config details at http://source.android.com/tech/storage/
mkdir /mnt 0775 root system
mkdir /storage 0050 root sdcard_r
mount tmpfs tmpfs /storage mode=0050,uid=0,gid=1028

[COLOR="Red"]mkdir /mnt/media_rw/sdcard0 0700 media_rw media_rw
mkdir /mnt/media_rw/sdcard1 0700 media_rw media_rw
mkdir /storage/sdcard0 0700 root root
mkdir /storage/sdcard1 0700 root root[/COLOR]

[COLOR="Red"] symlink /storage/sdcard0 /sdcard
symlink /storage/sdcard0 /mnt/sdcard
symlink /storage/sdcard1 /sdcard2
symlink /storage/sdcard1 /mnt/sdcard2[/COLOR]

mkdir /mnt/shell 0700 shell shell

# Directory for putting things only root should see.
mkdir /mnt/secure 0700 root root

# Create private mountpoint so we can MS_MOVE from staging
mount tmpfs tmpfs /mnt/secure mode=0700,uid=0,gid=0

# Directory for staging bindmounts
mkdir /mnt/secure/staging 0700 root root

# Fuse public mount points.
mkdir /mnt/fuse 0700 root system
mount tmpfs tmpfs /mnt/fuse mode=0775,gid=1000

on fs
mkdir /dev/usb-ffs 0770 shell shell
mkdir /dev/usb-ffs/adb 0770 shell shell
mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000

write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor [COLOR="Red"]0BB4[/COLOR]
write /sys/class/android_usb/android0/idProduct [COLOR="Red"]0C03[/COLOR]
write /sys/class/android_usb/android0/f_ffs/aliases adb
write /sys/class/android_usb/android0/functions [COLOR="Red"]mass_storage,adb[/COLOR]
write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
write /sys/class/android_usb/android0/iProduct ${ro.product.model}
write /sys/class/android_usb/android0/iSerial ${ro.serialno}

on boot
ifup lo
hostname localhost
domainname localdomain

class_start default

on property:sys.powerctl=*
powerctl ${sys.powerctl}

service ueventd /sbin/ueventd
critical
seclabel u:r:ueventd:s0

service healthd /sbin/healthd -n
critical
seclabel u:r:healthd:s0

service recovery /sbin/recovery
seclabel u:r:recovery:s0

service setup_adbd /sbin/setup_adbd
oneshot

service adbd /sbin/adbd --root_seclabel=u:r:su:s0 --device_banner=recovery
disabled
socket adbd stream 660 system system
seclabel u:r:adbd:s0

service vold /sbin/minivold
socket vold stream 0660 root mount
ioprio be 2
seclabel u:r:recovery:s0

[COLOR="Red"]# virtual sdcard daemon running as media_rw (1023)
service fuse_sdcard0 /system/bin/sdcard -u 1023 -g 1023 -w 1023 -d /mnt/media_rw/sdcard0 /storage/sdcard0
class late_start
disabled

# virtual sdcard daemon running as media_rw (1023)
service fuse_sdcard1 /system/bin/sdcard -u 1023 -g 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1
class late_start
disabled[/COLOR]

# setup_adbd will start adb once it has checked the keys
on property:service.adb.root=1
write /sys/class/android_usb/android0/enable 0
restart adbd
write /sys/class/android_usb/android0/enable 1

on property:sys.storage.ums_enabled=1
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idProduct [COLOR="Red"]0C03[/COLOR]
write /sys/class/android_usb/android0/functions [COLOR="Red"]mass_storage,adb[/COLOR]
write /sys/class/android_usb/android0/enable 1

on property:sys.storage.ums_enabled=0
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idProduct [COLOR="Red"]0C01[/COLOR]
write /sys/class/android_usb/android0/functions [COLOR="Red"]adb[/COLOR]
write /sys/class/android_usb/android0/enable ${service.adb.root}

In above example I highlighted all parts you need to focus on. Here there is something inportant: for sdcard services, give "other(world)" read/write permissions only for external sdcard. In my example that is sdcard0 because I use a modified fstab in my phone, with external sdcard as main sdcard. The CWM for kitkat takes as main sdcard the "sdcard0" by default. You can change that in fstab, by setting /storage/sdcard0 as sdcard1 and /storage/sdcard1 as sdcard0 - this is what I did.

service fuse_sdcard0 /system/bin/sdcard -u 1023 -g 1023[COLOR="Red"] -w 1023[/COLOR] -d /mnt/media_rw/sdcard0 /storage/sdcard0
class late_start
disabled

# virtual sdcard daemon running as media_rw (1023)
service fuse_sdcard1 /system/bin/sdcard -u 1023 -g 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1
class late_start
disabled

Usualy all informations are in the init file with ssd in name, and you can double check them in meta.init.rc.

Also you can find what sdcards you have in your phone by typing this in a terminal or command prompt through adb:

adb shell
env | grep sdcard

For vendor and product id check init.usb.rc.

Possible sdcards setups:

1. noemulated:

on early-init
# Apply strict SELinux checking of PROT_EXEC on mmap/mprotect calls.
write /sys/fs/selinux/checkreqprot 0

# Set the security context for the init process.
# This should occur before anything else (e.g. ueventd) is started.
setcon u:r:init:s0

start ueventd
start healthd

on init
export PATH /sbin:/system/bin
export ANDROID_ROOT /system
export ANDROID_DATA /data
[COLOR="Red"] export EXTERNAL_STORAGE /storage/sdcard0
export SECONDARY_STORAGE /storage/sdcard1[/COLOR]

symlink /system/etc /etc

mkdir /boot
mkdir /recovery
mkdir /sdcard
mkdir /internal_sd
mkdir /external_sd
mkdir /sd-ext
mkdir /datadata
[COLOR="Red"]mkdir /sdcard2[/COLOR]
mkdir /system
mkdir /cache
mkdir /data
mount tmpfs tmpfs /tmp

chown root shell /tmp
chmod 0775 /tmp

# See storage config details at http://source.android.com/tech/storage/
mkdir /mnt 0775 root system
mkdir /storage 0050 root sdcard_r
mount tmpfs tmpfs /storage mode=0050,uid=0,gid=1028

[COLOR="Red"]mkdir /mnt/media_rw/sdcard0 0700 media_rw media_rw
mkdir /mnt/media_rw/sdcard1 0700 media_rw media_rw
mkdir /storage/sdcard0 0700 root root
mkdir /storage/sdcard1 0700 root root[/COLOR]

[COLOR="Red"] symlink /storage/sdcard0 /sdcard
symlink /storage/sdcard0 /mnt/sdcard
symlink /storage/sdcard1 /sdcard2
symlink /storage/sdcard1 /mnt/sdcard2[/COLOR]

mkdir /mnt/shell 0700 shell shell

# Directory for putting things only root should see.
mkdir /mnt/secure 0700 root root

# Create private mountpoint so we can MS_MOVE from staging
mount tmpfs tmpfs /mnt/secure mode=0700,uid=0,gid=0

# Directory for staging bindmounts
mkdir /mnt/secure/staging 0700 root root

# Fuse public mount points.
mkdir /mnt/fuse 0700 root system
mount tmpfs tmpfs /mnt/fuse mode=0775,gid=1000

on fs
mkdir /dev/usb-ffs 0770 shell shell
mkdir /dev/usb-ffs/adb 0770 shell shell
mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000

write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor [COLOR="Red"]0BB4[/COLOR]
write /sys/class/android_usb/android0/idProduct [COLOR="Red"]0C03[/COLOR]
write /sys/class/android_usb/android0/f_ffs/aliases adb
write /sys/class/android_usb/android0/functions [COLOR="Red"]mass_storage,adb[/COLOR]
write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
write /sys/class/android_usb/android0/iProduct ${ro.product.model}
write /sys/class/android_usb/android0/iSerial ${ro.serialno}

on boot
ifup lo
hostname localhost
domainname localdomain

class_start default

on property:sys.powerctl=*
powerctl ${sys.powerctl}

service ueventd /sbin/ueventd
critical
seclabel u:r:ueventd:s0

service healthd /sbin/healthd -n
critical
seclabel u:r:healthd:s0

service recovery /sbin/recovery
seclabel u:r:recovery:s0

service setup_adbd /sbin/setup_adbd
oneshot

service adbd /sbin/adbd --root_seclabel=u:r:su:s0 --device_banner=recovery
disabled
socket adbd stream 660 system system
seclabel u:r:adbd:s0

service vold /sbin/minivold
socket vold stream 0660 root mount
ioprio be 2
seclabel u:r:recovery:s0

[COLOR="Red"]# virtual sdcard daemon running as media_rw (1023)
service fuse_sdcard0 /system/bin/sdcard -u 1023 -g 1023 -w 1023 -d /mnt/media_rw/sdcard0 /storage/sdcard0
class late_start
disabled

# virtual sdcard daemon running as media_rw (1023)
service fuse_sdcard1 /system/bin/sdcard -u 1023 -g 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1
class late_start
disabled[/COLOR]

# setup_adbd will start adb once it has checked the keys
on property:service.adb.root=1
write /sys/class/android_usb/android0/enable 0
restart adbd
write /sys/class/android_usb/android0/enable 1

on property:sys.storage.ums_enabled=1
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idProduct [COLOR="Red"]0C03[/COLOR]
write /sys/class/android_usb/android0/functions [COLOR="Red"]mass_storage,adb[/COLOR]
write /sys/class/android_usb/android0/enable 1

on property:sys.storage.ums_enabled=0
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idProduct [COLOR="Red"]0C01[/COLOR]
write /sys/class/android_usb/android0/functions [COLOR="Red"]adb[/COLOR]
write /sys/class/android_usb/android0/enable ${service.adb.root}