[Miscellaneous Android Development] HypoTurtle:
Could be for FOTA I suppose... tried to look though /system/bin/fotabinder; but couldn't see much other than a reboot call.

/devices/platform/mt_usb is a usb device I believe (usb drive attached to microusb).

So for reference.

From boot.img

External SDcard

/dev/block/vold/179:129 /mnt/media_rw/sdcard0 vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=00

/mnt/media_rw/sdcard0 25.0G 4.2G 20.8G 32768

/storage/sdcard0 25.0G 4.2G 20.8G 32768

Internal SDcard (data/media)

/dev/fuse /storage/sdcard1 fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0

/data 12.5G 1.8G 10.7G 4096

/storage/sdcard1 12.5G 1.8G 10.6G 4096

These are set in ramdisk.

fstab (unsure if used for normal boot - but might be used by vold)

/devices/mtk-msdc.0/11230000.MSDC0 auto vfat defaults voldmanaged=sdcard0:emmc@intsd,noemulatedsd
/devices/mtk-msdc.0/11240000.MSDC1 auto vfat defaults voldmanaged=sdcard1:auto

Bits and pieces from .rc's

on post-fs-data

# we will remap this as /mnt/sdcard with the sdcard fuse tool
mkdir /data/media 0770 media_rw media_rw
chown media_rw media_rw /data/media

on init

export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
export LD_LIBRARY_PATH /vendor/lib:/system/lib:/custom/lib
export ANDROID_BOOTLOGO 1
export ANDROID_ROOT /system
export ANDROID_ASSETS /system/app
export ANDROID_DATA /data
export ANDROID_STORAGE /storage
export ASEC_MOUNTPOINT /mnt/asec
export LOOP_MOUNTPOINT /mnt/obb
export BOOTCLASSPATH /system/framework/core.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework2.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/webviewchromium.jar:/system/framework/mediatek-common.jar:/system/framework/mediatek-framework.jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephony-common.jar:/system/framework/mediatek-tablet.jar:/system/framework/dolby_ds.jar
export BOOTCLASSPATH_EX /system/framework/mediatek-op.jar

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

export EXTERNAL_STORAGE /storage/sdcard0

# Support legacy paths
symlink /storage/sdcard0 /sdcard
symlink /storage/sdcard0 /mnt/sdcard
symlink /storage/sdcard1 /mnt/sdcard2

on fs
mount_all /fstab
setprop ro.crypto.fuse_sdcard true

service sdcard /system/bin/sdcard -u 1023 -g 1023 -d /data/media /storage/sdcard0
class late_start

service fuse_sdcard0 /system/bin/sdcard -u 1023 -g 1023 -d /mnt/media_rw/sdcard0 /storage/sdcard0 <<<
class late_start <<<
disabled <<<
<<< These two are disabled
service fuse_sdcard1 /system/bin/sdcard -u 1023 -g 1023 -w 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1 <<<
class late_start <<<
disabled <<<

on boot
chown root /remount.sh <<<
chmod 700 /remount.sh <<< Not sure why this is here
exec /remount.sh <<<

service met_log_d /system/bin/met_log_d
class main
# Refer to http://source.android.com/devices/tech/storage/index.html
# It said, "Starting in Android 4.4, multiple external storage devices are surfaced to developers through
# Context.getExternalFilesDirs(), Context.getExternalCacheDirs(), and Context.getObbDirs().
# External storage devices surfaced through these APIs must be a semi-permanent part of the device (such as an SD card slot in a battery compartment).
# Developers expect data stored in these locations to be available over long periods of time."
# Therefore, if the target has the SD card slot in a battery compartment, we need to specify SECONDARY_STORAGE (*** UN-Comment the following command ***)
#
# export SECONDARY_STORAGE /storage/sdcard1

From recovery.img

init.rc

on init
export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
export ANDROID_ROOT /system
export ANDROID_DATA /data
export EXTERNAL_STORAGE /storage/sdcard0
export SECONDARY_STORAGE /storage/sdcard1

symlink /system/etc /etc
symlink /data/media/0 /storage/sdcard0

mkdir /mnt/media_rw/sdcard1 0700 media_rw media_rw
mkdir /storage/sdcard1 0700 root root
symlink /storage/sdcard1 /mnt/sdcard2

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

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

fstab (line probably not used by recovery)

/devices/platform/mtk-msdc.1/mmc_host/mmc1 auto auto defaults voldmanaged=sdcard1:auto