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

1. patch:

  1. diff--gita/init.rcb/init.rc
  2. indexbd6c22e..3a55e6a100755
  3. ---a/init.rc
  4. +++b/init.rc
  5. @@-184,11+184,15@@onpost-fs-data
  6. #createdirectoryforDRMplug-ins
  7. mkdir/data/drm0774drmdrm
  8. +#wewillremapthisas/mnt/sdcardwiththesdcardfusetool
  9. +mkdir/data/media0775media_rwmedia_rw
  10. +chownmedia_rwmedia_rw/data/media
  11. +
  12. #Ifthereisnofs-post-dataactionintheinit.<device>.rcfile,you
  13. #mustuncommentthisline,otherwiseencryptedfilesystems
  14. #won'twork.
  15. #Setindication(checkedbyvold)thatwehavefinishedthisaction
  16. -#setpropvold.post_fs_data_done1
  17. +setpropvold.post_fs_data_done1
  18. chownsystemsystem/sys/class/android_usb/android0/f_mass_storage/lun/file
  19. chmod0660/sys/class/android_usb/android0/f_mass_storage/lun/file
  20. @@-509,3+513,9@@serviceiprenew_eth0/system/bin/dhcpcd-n
  21. disabled
  22. oneshot
  23. +#createvirtualSDcardat/mnt/sdcard,basedonthe/data/mediadirectory
  24. +#daemonwilldroptouser/groupsystem/media_rwafterinitializing
  25. +#underlyingfilesin/data/mediawillbecreatedwithuserandgroupmedia_rw(1023)
  26. +#servicesdcard/system/bin/sdcard/data/media10231023
  27. +service sdcard /system/bin/sdcard /data/media /mnt/shell/emulated 1023 1023
  28. +classlate_start
  29. +
  30. diff--gita/device.mkb/device.mk
  31. indexbd72276..c836943100755
  32. ---a/device.mk
  33. +++b/device.mk
  34. @@-6,6+6,8@@PRODUCT_PACKAGES:=\
  35. VisualizationWallpapers\
  36. librs_jni
  37. +PRODUCT_CHARACTERISTICS += nosdcard
  38. +
  39. DEVICE_PACKAGE_OVERLAYS:=\
  40. device/stm/kem/overlay
  41. diff--gita/overlay/frameworks/base/core/res/res/xml/storage_list.xmlb/overlay/frameworks/base/core/res/res/xml/storage_list.xml
  42. newfilemode100644
  43. index0000000..043530d
  44. ---/dev/null
  45. +++b/overlay/frameworks/base/core/res/res/xml/storage_list.xml
  46. @@-0,0+1,41@@
  47. +<?xmlversion="1.0"encoding="utf-8"?>
  48. +<!--
  49. +**
  50. +**Copyright2011,TheAndroidOpenSourceProject
  51. +**
  52. +**LicensedundertheApacheLicense,Version2.0(the"License")
  53. +**youmaynotusethisfileexceptincompliancewiththeLicense.
  54. +**YoumayobtainacopyoftheLicenseat
  55. +**
  56. +**http://www.apache.org/licenses/LICENSE-2.0
  57. +**
  58. +**Unlessrequiredbyapplicablelaworagreedtoinwriting,software
  59. +**distributedundertheLicenseisdistributedonan"ASIS"BASIS,
  60. +**WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied.
  61. +**SeetheLicenseforthespecificlanguagegoverningpermissionsand
  62. +**limitationsundertheLicense.
  63. +*/
  64. +-->
  65. +
  66. +<!--The<device>elementshouldcontainoneormore<storage>elements.
  67. +Exactlyoneoftheseshouldhavetheattributeprimary="true".
  68. +Thisstoragewillbetheprimaryexternalstorageandshouldhavepath="/mnt/sdcard".
  69. +Eachstorageshouldhavebothapathanddescriptionattributeset.
  70. +Thefollowingbooleanattributesareoptional:
  71. +
  72. +primary:thisstorageistheprimaryexternalstorage
  73. +removable:thisisremovablestorage(forexample,arealSDcard)
  74. +emulated:thestorageisemulatedviatheFUSEsdcarddaemon
  75. +mtp-reserve:numberofmegabytesofstorageMTPshouldreserveforfreestorage
  76. +(usedforemulatedstoragethatissharedwithsystem'sdatapartition)
  77. +
  78. +Astorageshouldnothavebothemulatedandremovablesettotrue
  79. +-->
  80. +
  81. +<StorageListxmlns:android="http://schemas.android.com/apk/res/android">
  82. +<storage android:storageDescription="@string/storage_internal"
  83. +android:emulated="true"
  84. +android:mtpReserve="100"/>
  85. +</StorageList>


2. kernel config

需要 CONFIG_FUSE_FS=y

查看有没有 /mnt/sdcard:

开机后adb shell进去后df下即可

更多相关文章

  1. 如何将ADT(eclipse)开发工具锁定到LaucherPad启动器上
  2. 转Launcher研究之AndroidManifest.xml分析(二)
  3. Android(安卓)studio新建activity运行出错解决方法
  4. Android自定义弹窗进度条
  5. 解决Android(安卓)Studio 无法在线更新的问题
  6. 创建ListView的基本步骤
  7. android 显示pdf文件内容
  8. Android:TabWidget
  9. Android(安卓)新建文件夹、生成文件并向文件写入文本内容

随机推荐

  1. Android(安卓)Theme的设置
  2. textview设置文本每行的行间距
  3. 如何使用Android(安卓)Studio开发/调试An
  4. Android内存泄漏监测(MAT)及解决办法
  5. Android(安卓)2.2.2到Android(安卓)4.2.2
  6. android 使用xml selector设置按钮点击效
  7. android EditText 全面阐述
  8. Unbuntu下Android(安卓)studio报Unable t
  9. Android开发工具(Android(安卓)Studio)
  10. java引入Android(安卓)NinePatch技术的意