如果要添加 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.<device>.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
- +service sdcard /system/bin/sdcard /data/media /mnt/shell/emulated 1023 1023
- + class late_start
- +
- diff --git a/device.mk b/device.mk
- index bd72276..c836943 100755
- --- a/device.mk
- +++ b/device.mk
- @@ -6,6 +6,8 @@ PRODUCT_PACKAGES := \
- VisualizationWallpapers \
- librs_jni
- +PRODUCT_CHARACTERISTICS += 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 @@
- +<?xml version="1.0" encoding="utf-8"?>
- +<!--
- +**
- +** Copyright 2011, The Android Open Source Project
- +**
- +** Licensed under the Apache License, Version 2.0 (the "License")
- +** you may not use this file except in compliance with the License.
- +** You may obtain a copy of the License at
- +**
- +** http://www.apache.org/licenses/LICENSE-2.0
- +**
- +** Unless required by applicable law or agreed to in writing, software
- +** distributed under the License is distributed on an "AS IS" BASIS,
- +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- +** See the License for the specific language governing permissions and
- +** limitations under the License.
- +*/
- +-->
- +
- +<!-- The <device> element should contain one or more <storage> elements.
- + Exactly one of these should have the attribute primary="true".
- + This storage will be the primary external storage and should have path="/mnt/sdcard".
- + Each storage should have both a path and description attribute set.
- + The following boolean attributes are optional:
- +
- + primary: this storage is the primary external storage
- + removable: this is removable storage (for example, a real SD card)
- + emulated: the storage is emulated via the FUSE sdcard daemon
- + mtp-reserve: number of megabytes of storage MTP should reserve for free storage
- + (used for emulated storage that is shared with system's data partition)
- +
- + A storage should not have both emulated and removable set to true
- +-->
- +
- +<StorageList xmlns:android="http://schemas.android.com/apk/res/android">
- + <storage android:storageDescription="@string/storage_internal"
- + android:emulated="true"
- + android:mtpReserve="100" />
- +</StorageList>
2. kernel config
需要 CONFIG_FUSE_FS=y
查看有没有 /mnt/sdcard:
开机后adb shell进去后df下即可
相关推荐
最近在Android N 上 安装Apk时报错:android.os.FileUriExposedException: file:///storage/emulated/0/Download/appName-2.3.0.apk exposed beyond app through Intent.getData(),通过查找相关的资料终于找到了...
博客地址:http://blog.csdn.net/lowprofile_coding/article/details/48269011 1.获取扩展存储设备 2.获取sdcard2外部存储空间 3.获取可用的 EMMC 内部存储空间 4.获取其他外部存储可用空间 5.获取内部存储目录
MD2 基于Angular2的Material Design组件,指令和服务是手风琴,自动完成,芯片(标签),折叠,Colorpicker,数据表,Datepicker,Dialog(模块),菜单,多选,选择,选项卡,标签(芯片),Toast和工具提示。...
"/storage/emulated/0/Android/data/com.qd.videorecorder/video/VMS_1439866564822.jpg", "image/jpg"); bigfFile.ResumableUploadInBackground(new SaveCallback() { @Override public void...
* <p>ef: android中转换content://media/external/images/media/539163为/storage/emulated/0/DCIM/Camera/IMG_20160807_123123.jpg * 把content://media/external/images/media/X转换为file:///storage/sdcard0/...
#ro.sys.storage_type = emulated \ #for gms #PRODUCT_PROPERTY_OVERRIDES += \ # ro.sys.mutedrm=true \ # ro.adb.secure=1 PRODUCT_PROPERTY_OVERRIDES += \ ro.sf.lcd_density=213 \ ro.product.firmware=v...
#ro.sys.storage_type = emulated \ #for gms #PRODUCT_PROPERTY_OVERRIDES += \ # ro.sys.mutedrm=true \ # ro.adb.secure=1 PRODUCT_PROPERTY_OVERRIDES += \ ro.sf.lcd_density=213 \ ro.product.firmware=...
#ro.sys.storage_type = emulated \ #for gms #PRODUCT_PROPERTY_OVERRIDES += \ # ro.sys.mutedrm=true \ # ro.adb.secure=1 PRODUCT_PROPERTY_OVERRIDES += \ ro.sf.lcd_density=213 \ ro.product.firmware=v...
#ro.sys.storage_type = emulated \ #for gms #PRODUCT_PROPERTY_OVERRIDES += \ # ro.sys.mutedrm=true \ # ro.adb.secure=1 PRODUCT_PROPERTY_OVERRIDES += \ ro.sf.lcd_density=213 \ ro.product.firmware=v...
#ro.sys.storage_type = emulated \ #for gms #PRODUCT_PROPERTY_OVERRIDES += \ # ro.sys.mutedrm=true \ # ro.adb.secure=1 PRODUCT_PROPERTY_OVERRIDES += \ ro.sf.lcd_density=213 \ ro.product.firmware=v...