Open GoogleCodeExporter opened 8 years ago
seeing as 1.0 used mountd and now 1.5 uses vold:
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
}
and this fails mostly but its a start, wich leads to...
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);
---
wich brought me to...
For that we require to disable a sysfs_deprecated flag and to have the
following patches included on the android framework:
- http://review.omapzoom.org/Gerrit#change,346
- http://review.omapzoom.org/Gerrit#change,345
Signed-off-by: Leed Aguilar <leed.aguilar@ti.com>
---
arch/arm/configs/omap_zoom2_android_defconfig | 14 ++++++++++----
drivers/serial/omap-serial.c | 17 +++++++----------
2 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/arch/arm/configs/omap_zoom2_android_defconfig
b/arch/arm/configs/omap_zoom2_android_defconfig
index 2202868..a0834d3 100644
--- a/arch/arm/configs/omap_zoom2_android_defconfig
+++ b/arch/arm/configs/omap_zoom2_android_defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.27.10-omap1
-# Mon May 4 11:07:27 2009
+# Thu May 14 17:55:05 2009
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -53,8 +53,7 @@ CONFIG_FAIR_GROUP_SCHED=y
# CONFIG_RT_GROUP_SCHED is not set
CONFIG_USER_SCHED=y
# CONFIG_CGROUP_SCHED is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
# CONFIG_RELAY is not set
# CONFIG_NAMESPACES is not set
CONFIG_BLK_DEV_INITRD=y
--
1.6.0
Original comment by george.e...@gmail.com
on 21 Jul 2009 at 5:08
Original issue reported on code.google.com by
kofi1...@gmail.com
on 15 Jul 2009 at 2:52