主题 : froyo 不知道如何挂载SDCARD。郁闷了 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 22084
精华: 0
发帖: 23
金钱: 120 两
威望: 24 点
贡献值: 0 点
综合积分: 46 分
注册时间: 2010-05-26
最后登录: 2012-05-24
楼主  发表于: 2010-07-07 17:16

 froyo 不知道如何挂载SDCARD。郁闷了

我修改了/system/etc/vold.fstab 但没有任何效果。。。在froyo中,有人自动挂载SDCARD成功么?

另外,如果我手动挂载 mount -t vfat /dev/block/mmcblk0p1 /mnt/sdcard 可以在终端访问,但系统却不能知道这是SDCARD,还是认为我没插入SDCARD
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2010-07-07 17:26
我修改了/system/etc/vold.fstab 但没有任何效果

的确,没人知道你是怎么修改的
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 22084
精华: 0
发帖: 23
金钱: 120 两
威望: 24 点
贡献值: 0 点
综合积分: 46 分
注册时间: 2010-05-26
最后登录: 2012-05-24
2楼  发表于: 2010-07-07 17:29
嘿嘿,贴出来vold.fstab

## Vold 2.0 Generic fstab
## - San Mehat (san@android.com)
##

#######################
## Regular device mount
##
## Format: dev_mount <label> <mount_point> <part> <sysfs_path1...>
## label        - Label for the volume
## mount_point  - Where the volume will be mounted
## part         - Partition # (1 based), or 'auto' for first usable partition.
## <sysfs_path> - List of sysfs paths to source devices
######################

## Example of a standard sdcard mount for the emulator / Dream
# Mounts the first usable partition of the specified device
#dev_mount sdcard /mnt/sdcard auto /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1
#dev_mount sdcard /mnt/sdcard auto /class/mmc_host/mmc0
dev_mount sdcard /mnt/sdcard auto /devices/platform/pxa-sdh.1/mmc_host/mmc0

## Example of a dual card setup
# dev_mount left_sdcard  /sdcard1  auto /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1
# dev_mount right_sdcard /sdcard2  auto /devices/platform/goldfish_mmc.1 /devices/platform/msm_sdcc.3/mmc_host/mmc1

## Example of specifying a specific partition for mounts
# dev_mount sdcard /sdcard 2 /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
3楼  发表于: 2010-07-07 17:35
dev_mount sdcard /mnt/sdcard auto /devices/platform/pxa-sdh.1/mmc_host/mmc0

也许你可以看看/sys/devices/platform/pxa-sdh.1/mmc_host/mmc0是不是对应你的/dev/mmcblk0, 如果是的话,恐怕你就得看看logcat的输出里"Vold"打头的部分了, SD卡的管理是由vold负责的。源代码在system/core/vold目录下。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 22084
精华: 0
发帖: 23
金钱: 120 两
威望: 24 点
贡献值: 0 点
综合积分: 46 分
注册时间: 2010-05-26
最后登录: 2012-05-24
4楼  发表于: 2010-07-07 17:50
引用第3楼kasim于2010-07-07 17:35发表的  :

也许你可以看看/sys/devices/platform/pxa-sdh.1/mmc_host/mmc0是不是对应你的/dev/mmcblk0, 如果是的话,恐怕你就得看看logcat的输出里"Vold"打头的部分了, SD卡的管理是由vold负责的。源代码在system/core/vold目录下。


在/sys/devices/platform/pxa-sdh.1/mmc_host:mmc0/ 下可以看到
mmc0:1234 ,我拔出sdcard,此项会消失。应该对应了我的sdcard。是这样验证么?

对于vold在logcat的输出,只有可怜的两句
I/Vold  ( 846):Vold 1.0 starting
D/Vold  (845): Vold 2.1 (the revenge) firing up
D/Vold (845): volumn sdcard state changing -1 (Initializing)  -> 0 (No-Media)

悲剧的是,我在froyo的源码找不到 system/core/vold,android 2.1中有这个system/core/vold,现在搜索下是否放别的地方了
级别: 新手上路
UID: 22084
精华: 0
发帖: 23
金钱: 120 两
威望: 24 点
贡献值: 0 点
综合积分: 46 分
注册时间: 2010-05-26
最后登录: 2012-05-24
5楼  发表于: 2010-07-07 17:52
找到了VOLD位置了。。froyo换位置了,vold放在/system/vold,先读读源码看看
级别: 新手上路
UID: 22084
精华: 0
发帖: 23
金钱: 120 两
威望: 24 点
贡献值: 0 点
综合积分: 46 分
注册时间: 2010-05-26
最后登录: 2012-05-24
6楼  发表于: 2010-07-09 10:02
通过DUBG VOLD,终于解决问题了。。先总结一下:

开始我尝试使用1.6版本的mountd,通过把1。6的mountd源码弄到2。2上,抛弃VOLD,使用MOUNTD,虽然在终端下可以挂载(和mount手动挂载没区别),但ANDROID 仍然不认为那是SDCARD,看来只能还是得使用VOLD,毕竟MOUNTD是ANDROID抛弃了的东西。

VOLD的源码放在 /system/vold。拷贝到XP下,我使用SOURCE INSIGHT认真读了一次,没什么头绪。于是只能通过打印DEUBG,发现在VOLD读取和传入<PART>后明显区别,当选择使用auto不能检测到SDCARD插入,而我指定1分区,就能挂载上。。终于有结果了,总结下来,供后面的朋友参考,以免浪费太多时间

dev_mount sdcard /mnt/sdcard 1 /devices/platform/pxa-sdh.1/mmc_host/mmc0

另外,注意编译内核时,把General Setup -> Create deprecated sysfs layout for older userspace tools取消掉,否则可能影响到VOLD检测SDCARD
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
7楼  发表于: 2010-07-09 11:41
不错,恭喜问题解决
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 22084
精华: 0
发帖: 23
金钱: 120 两
威望: 24 点
贡献值: 0 点
综合积分: 46 分
注册时间: 2010-05-26
最后登录: 2012-05-24
8楼  发表于: 2010-07-09 11:44
引用第7楼kasim于2010-07-09 11:41发表的  :
不错,恭喜问题解决


多得版主提点。等我把问题都解决了,有时间我会把一些心得整理出来,虽然开发板不是2440,但很多东西都大同小异的,希望后来人不走那么多弯路。