添加 /mnt/sdcard

如果要添加 emulated sdcard ,需要一下几个内容修改:


1. patch:

diff --git a/init.rc b/init.rc
index bd6c22e..3a55e6a 100755
--- a/init.rc
+++ b/init.rc
@@ -184,11 +184,15 @@ on post-fs-data
     # create directory for DRM plug-ins
     mkdir /data/drm 0774 drm drm

+    # we will remap this as /mnt/sdcard with the sdcard fuse tool
+    mkdir /data/media 0775 media_rw media_rw
+    chown media_rw media_rw /data/media
+
     # If there is no fs-post-data action in the init..rc file, you
     # must uncomment this line, otherwise encrypted filesystems
     # won't work.
     # Set indication (checked by vold) that we have finished this action
-    #setprop vold.post_fs_data_done 1
+    setprop vold.post_fs_data_done 1

     chown system system /sys/class/android_usb/android0/f_mass_storage/lun/file
     chmod 0660 /sys/class/android_usb/android0/f_mass_storage/lun/file
@@ -509,3 +513,9 @@ service iprenew_eth0 /system/bin/dhcpcd -n
     disabled
     oneshot

+# create virtual SD card at /mnt/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 1023 1023
+    class late_start
+
diff --git a/kem.mk b/kem.mk
index bd72276..c836943 100755
--- a/kem.mk
+++ b/kem.mk
@@ -6,6 +6,8 @@ PRODUCT_PACKAGES := \
     VisualizationWallpapers \
     librs_jni

+PRODUCT_CHARACTERISTICS := tablet,nosdcard
+
 DEVICE_PACKAGE_OVERLAYS := \
     device/stm/kem/overlay

diff --git a/overlay/frameworks/base/core/res/res/xml/storage_list.xml b/overlay/frameworks/base/core/res/res/xml/storage_list.xml
new file mode 100644
index 0000000..043530d
--- /dev/null
+++ b/overlay/frameworks/base/core/res/res/xml/storage_list.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+    
+

2. kernel config

需要 CONFIG_FUSE_FS=y

3. 添加 external/exfat/*

这些加了以后,就可以用 df 或 mount


查看有没有 /mnt/sdcard.

有就是成功了。








你可能感兴趣的:(SDIO_EMMC)