昨日に引き続き、 SDカードを認識させる為に、更にいろいろと修正した。
(昨日のものではまったく足りなかった。)
stableではないのであろうが、汎用性なさすぎだし、しまいにはデバッグ文でクラッシュする始末。
以下は現時点のvoldに対応する為の関連するパッチで、昨日の分も含まれる。
カーネルは2.6.28で、元が元なので、修正もハードコディングになってしまったが、これでもう、コマンドでマウントする必要はない。
尚、SDカードは、1番目のパーティションをmkdosfsコマンドで作成しており、2番目のパーティションをext3のrootファイルシステムにしている為、1番目のパーティションしか見ないようにしてある。


diff --git a/vold/blkdev.c b/vold/blkdev.c
index 3167507..fa0cb61 100644
--- a/vold/blkdev.c
+++ b/vold/blkdev.c
@@ -301,6 +301,9 @@ int blkdev_get_num_pending_partitions(blkdev_t *blk)
struct blkdev_list *list_scan = list_root;
int num = blk->nr_parts;

+ if (!num && (blk->type == blkdev_partition))
+ return num;
+
if (blk->type != blkdev_disk)
return -EINVAL;

diff --git a/vold/mmc.c b/vold/mmc.c
index 0f08964..b7be9f5 100644
--- a/vold/mmc.c
+++ b/vold/mmc.c
@@ -85,7 +85,8 @@ static int mmc_bootstrap_controller(char *sysfs_path)
if ((!strcmp(de->d_name, "uevent")) ||
(!strcmp(de->d_name, "subsystem")) ||
(!strcmp(de->d_name, "device")) ||
- (!strcmp(de->d_name, "power"))) {
+ (!strcmp(de->d_name, "power")) ||
+ (!strcmp(de->d_name, "slot_name"))) {
continue;
}

@@ -170,8 +171,8 @@ static int mmc_bootstrap_card(char *sysfs_path)
* Check for block drivers
*/
char block_devpath[255];
- sprintf(tmp, "%s/block", devpath);
- sprintf(filename, "/sys%s/block", devpath);
+ sprintf(tmp, "%s/block:mmcblk0", devpath);
+ sprintf(filename, "/sys%s/block:mmcblk0", devpath);
if (!access(filename, F_OK)) {
if (mmc_bootstrap_block(tmp)) {
LOGE("Error bootstrapping block @ %s", tmp);
@@ -203,9 +204,30 @@ static int mmc_bootstrap_block(char *devpath)

if (de->d_name[0] == '.')
continue;
- sprintf(tmp, "%s/%s", devpath, de->d_name);
+
+ if ((!strcmp(de->d_name, "uevent")) ||
+ (!strcmp(de->d_name, "dev")) ||
+ (!strcmp(de->d_name, "subsystem")) ||
+ (!strcmp(de->d_name, "device")) ||
+ (!strcmp(de->d_name, "range")) ||
+ (!strcmp(de->d_name, "ext_range")) ||
+ (!strcmp(de->d_name, "removable")) ||
+ (!strcmp(de->d_name, "ro")) ||
+ (!strcmp(de->d_name, "size")) ||
+ (!strcmp(de->d_name, "capability")) ||
+ (!strcmp(de->d_name, "stat")) ||
+ (!strcmp(de->d_name, "power")) ||
+ (!strcmp(de->d_name, "holders")) ||
+ (!strcmp(de->d_name, "slaves")) ||
+ (!strcmp(de->d_name, "queue")) ||
+ (!strcmp(de->d_name, "bdi"))) {
+ continue;
+ }
+
+ sprintf(tmp, "%s/%s", devpath, de->d_name);
if (mmc_bootstrap_mmcblk(tmp))
LOGE("Error bootstraping mmcblk @ %s", tmp);
+ break;
}
closedir(d);
return 0;
diff --git a/vold/uevent.c b/vold/uevent.c
index cfb5786..6eb88d3 100644
--- a/vold/uevent.c
+++ b/vold/uevent.c
@@ -301,7 +301,7 @@ static int handle_block_event(struct uevent *event)
} else if (!strcmp(get_uevent_param(event, "DEVTYPE"), "disk"))
n = 2;
else if (!strcmp(get_uevent_param(event, "DEVTYPE"), "partition"))
- n = 3;
+ n = 2;
else {
LOGE("Bad blockdev type '%s'", get_uevent_param(event, "DEVTYPE"));
return -EINVAL;
diff --git a/vold/volmgr_vfat.c b/vold/volmgr_vfat.c
index 344a166..5856a99 100644
--- a/vold/volmgr_vfat.c
+++ b/vold/volmgr_vfat.c
@@ -125,7 +125,7 @@ int vfat_mount(blkdev_t *dev, volume_t *vol, boolean safe_mode)
}

#if VFAT_DEBUG
- LOG_VOL("vfat_mount(%s, %d:%d): mount rc = %d", dev->major,k dev->minor,
+ LOG_VOL("vfat_mount(%d:%d, %s): mount rc = %d", dev->major, dev->minor,
vol->mount_point, rc);
#endif
free (devpath);