How about this?
My environment is shown below.
kernel 2.6.28 base.
1st partition: dosfs -- kernel image and pictures. formatted by
mkdosfs command.
2nd partition: ext3 --- root file system.
This will mount the 1st partition only.
Sorry, hard cording.
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);
---
Regards,
Atsuo
http://ameblo.jp/nt21/entry-10264720967.html
On 5月12日, 午前3:11, twebb <[email protected]> wrote:
> On May 8, 7:43 pm, "Howard M. Harte" <[email protected]> wrote:
>
>
>
> > I also saw this problem. I'm not using the ADP1, so my hardware is
> > different. Anyway, modifying uevent.c in system/core/vold/vold.c to
> > use PHYSDEVICEPATH seems to work. Here is the patch, it is obviously
> > a hack, but it does seem to work.
>
> > --- a/vold/uevent.c
> > +++ b/vold/uevent.c
> > @@ -309,6 +309,7 @@ static int handle_block_event(struct uevent
> > *event)
>
> > truncate_sysfs_path(event->path, n, mediapath, sizeof
> > (mediapath));
>
> > + strncpy(mediapath, get_uevent_param(event, "PHYSDEVPATH"), 255);
> > if (!(media = media_lookup_by_path(mediapath, false))) {
> > #if DEBUG_UEVENT
> > LOG_VOL("No backend media found @ device path '%s'",
> > mediapath);
>
> > This is the vold.conf I'm using:
> > ## vold configuration file for the emulator/SDK
>
> > volume_sdcard {
> > ## This is the direct uevent device path to the SD slot on the
> > device
> > media_path /class/mmc_host/mmc0/
> > media_type mmc
> > mount_point /sdcard
> > ums_path /devices/platform/usb_mass_storage/lun0
>
> > }
>
> > -Howard
>
> I've tried this, plus a few other variations, but still no luck. Was
> there more to your hack? I still have issues with vold looking for...
> /sys/class/mmc_host/mmc0/mmc0:b368/block
> but target fs only has...
> /sys/class/mmc_host/mmc0/mmc0:b368/block:mmcblk0
> so mmc_bootstrap_mmcblk_partition() ends up failing because it doesn't
> find a "block" dir.
>
> Any ideas?
>
> twebb
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---