Multi-user external storage support.
Move FUSE daemon to secure mount point, and relax /storage access
now that sdcard_r is enforced using private bind mounts in zygote.
Bug: 6925012
Change-Id: I9bcb51ea80ee634e509c32272656f3f280849cce
diff --git a/init.smdk5250.rc b/init.smdk5250.rc
index fb90eae..397d565 100644
--- a/init.smdk5250.rc
+++ b/init.smdk5250.rc
@@ -1,16 +1,21 @@
import init.smdk5250.usb.rc
-on early-init
+on init
+ mkdir /mnt/secure/sdcard0 0700 root root
+
export EXTERNAL_STORAGE /storage/sdcard0
- mkdir /storage 0050 system sdcard_r
- mkdir /storage/sdcard0 0000 system system
+ mkdir /storage 0711 root root
+ mkdir /storage/sdcard0 0000 root root
symlink /storage/sdcard0 /sdcard
symlink /storage/sdcard0 /mnt/sdcard
+ # Save bugreports as owner
+ export BUGREPORT_WRITE_PATH /mnt/secure/sdcard0/0
+ export BUGREPORT_READ_PATH /storage/sdcard0
+
on post-fs-data
- # we will remap this as /storage/sdcard with the sdcard fuse tool
mkdir /data/media 0770 media_rw media_rw
- chown media_rw media_rw /data/media
+
setprop vold.post_fs_data_done 1
on boot
@@ -45,8 +50,6 @@
group root
oneshot
-# create virtual SD card at /storage/sdcard, based on the /data/media directory
-# daemon will drop to user/group system/media_rw after initializing
-# underlying files in /data/media will be created with user and group media_rw (1023)
-service sdcard /system/bin/sdcard /data/media /storage/sdcard0 1023 1023
+# virtual sdcard daemon running as media_rw (1023)
+service sdcard /system/bin/sdcard /data/media /mnt/secure/sdcard0 1023 1023
class late_start