Mako: Fix sdcard permissions for native apps.
Native apps with UID other than SHELL can't access /sdcard even
with GID as SDCARD_RW becaue only SHELL has permission to read /mnt.
To fix this create a mount bind to fuse card.
Change-Id: Idaaf79f9bc5fa8eee9773535097a6b68017838c3
diff --git a/init.mako.rc b/init.mako.rc
index b6c6529..bcb36dc 100644
--- a/init.mako.rc
+++ b/init.mako.rc
@@ -23,6 +23,7 @@
# See storage config details at http://source.android.com/tech/storage/
mkdir /mnt/shell/emulated 0700 shell shell
mkdir /storage/emulated 0555 root root
+ mkdir /storage/emulated/legacy 0555 root root
# Set permissions for persist partition
mkdir /persist 0771 system system
@@ -36,7 +37,6 @@
symlink /storage/emulated/legacy /sdcard
symlink /storage/emulated/legacy /mnt/sdcard
symlink /storage/emulated/legacy /storage/sdcard0
- symlink /mnt/shell/emulated/0 /storage/emulated/legacy
# Setup custom emergency number list based on
# the MCC. This is needed by RIL.
@@ -374,6 +374,11 @@
service sdcard /system/bin/sdcard /data/media /mnt/shell/emulated 1023 1023
class late_start
+# Binding fuse mount point to /storage/emulated/legacy
+ on property:init.svc.sdcard=running
+ wait /mnt/shell/emulated/0
+ mount none /mnt/shell/emulated/0 /storage/emulated/legacy bind
+
service thermald /system/bin/thermald
class main