Rockie's Android porting Guide (4) -- add SD card to your system Rockie Cheng Andorid use vold to manage SD card and it is easy to use. But I meet into troubles and finally find that the real problem is in the Linux kernel. Thanks to the android mail list. Part I (kernel) (1) make sure thus Kernel configuration in MMC driver Config_mmc = y # Config_mmc_debug is not set Config_mmc_unsafe_resume = y # Config_mmc_embedded_sdio is not set Config_mmc_paranoid_sd_init = y # # MMC/SD Card Drivers # Config_mmc_block = y Config_mmc_block_bounce = y # Config_mmc_block_paranoid_resume is not set # Config_sdio_uart is not set # Config_mmc_test is not set # # MMC/SD host controller drivers # Config_mmc_sdhci = y (2) disable this option General setup-> Create deprecated sysfs layout for older userspace tools Before I did this, vold showed a lot of trouble. And, my media_path is not right Media_path/devices/platform/s3c-sdhci.0/mmc_host: mmc0 <-- my path before turn off that option Media_path/devices/platforms/s3c-sdhci.0/mmc_host/mmc0 <-- this is the right one Vold may be unhappy to accept my old path, and it didn't work. D/vold (42): accepted connection from framework D/vold (42): dispatch_cmd (send_ums_status ): D/vold (42): dispatch_cmd (mount_volume:/sdcard ): E/vold (42): cannot start volume '/sdcard' (volume is not bound) D/mountlistener (59): handleevent volume_nomedia:/sdcard D/mountlistener (59): handleevent ums_disabled D/mountlistener (59): handleevent ums_disconnected (3) rebuild your Linux Kernel Part II (Android system) (1) creat a vold. conf in build/target/board/idea6410 # Vold configuration file for idea6410 Volume_sdcard { # This is the direct uevent device path to the SD slot on the device Media_path/devices/platform/s3c-sdhci.0/mmc_host/mmc0 Media_type MMC Mount_point/sdcard Ums_path/devices/platform/usb_mass_storage/lun0 } (2) Add those below to androidboard. mk Include $ (clear_vars) Local_module_class: = etc Local_module: = vold. conf Local_src_files: = $ (local_module) Include $ (build_prebuilt) (3) rebuild the system and check init. RC Service vold/system/bin/vold Socket vold stream 0660 root Mount (4) enjoy D/vold (42): accepted connection from framework D/vold (42): dispatch_cmd (send_ums_status ): D/vold (42): dispatch_cmd (mount_volume:/sdcard ): I/vold (42): Evaluating Dev '/devices/platform/s3c-sdhci.0/mmc_host/mmc0/mmc0: e624/block/mmcblk0' for mountable filesystems for'/sdcard' D/mountlistener (61): handleevent volume_unmounted:/sdcard D/mountlistener (61): handleevent ums_disabled D/mountlistener (61): handleevent ums_disconnected D/mountlistener (61): handleevent volume_checking:/sdcard Rockie Cheng |