diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-18 17:39:49 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-18 17:39:49 -0700 |
commit | f614d64d4b4dfcd20c77ac3ccf2d9c9090a49303 (patch) | |
tree | 2ef9420b1592cde2cdc1bc82fdf1464fdd6f86a8 | |
parent | e037fd7e193ecccbb5c0888e49f6d58c224bc11d (diff) | |
download | core-f614d64d4b4dfcd20c77ac3ccf2d9c9090a49303.tar.gz core-f614d64d4b4dfcd20c77ac3ccf2d9c9090a49303.tar.bz2 core-f614d64d4b4dfcd20c77ac3ccf2d9c9090a49303.zip |
auto import from //branches/cupcake_rel/...@140373
-rw-r--r-- | fastboot/fastboot.c | 1 | ||||
-rw-r--r-- | rootdir/etc/init.goldfish.rc | 4 | ||||
-rw-r--r-- | rootdir/init.rc | 1 | ||||
-rw-r--r-- | vold/blkdev.c | 8 | ||||
-rwxr-xr-x | vold/format.c | 15 | ||||
-rw-r--r-- | vold/logwrapper.c | 2 | ||||
-rw-r--r-- | vold/misc.c | 6 | ||||
-rw-r--r-- | vold/uevent.c | 4 | ||||
-rw-r--r-- | vold/vold.h | 2 | ||||
-rw-r--r-- | vold/volmgr.c | 2 |
10 files changed, 24 insertions, 21 deletions
diff --git a/fastboot/fastboot.c b/fastboot/fastboot.c index e220dbeab..498b4a6a3 100644 --- a/fastboot/fastboot.c +++ b/fastboot/fastboot.c @@ -138,6 +138,7 @@ int match_fastboot(usb_ifc_info *info) { if(!(vendor_id && (info->dev_vendor == vendor_id)) && (info->dev_vendor != 0x18d1) && + (info->dev_vendor != 0x0451) && (info->dev_vendor != 0x0bb4)) return -1; if(info->ifc_class != 0xff) return -1; if(info->ifc_subclass != 0x42) return -1; diff --git a/rootdir/etc/init.goldfish.rc b/rootdir/etc/init.goldfish.rc index 96480f3e8..569555c65 100644 --- a/rootdir/etc/init.goldfish.rc +++ b/rootdir/etc/init.goldfish.rc @@ -39,9 +39,7 @@ service goldfish-setup /system/etc/init.goldfish.sh oneshot service qemud /system/bin/qemud - socket qemud_gsm stream 666 - socket qemud_gps stream 666 - socket qemud_control stream 666 + socket qemud stream 666 oneshot # -Q is a special logcat option that forces the diff --git a/rootdir/init.rc b/rootdir/init.rc index a0d6c545d..ef7c28b46 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -138,6 +138,7 @@ on boot chown system system /sys/class/leds/keyboard-backlight/brightness chown system system /sys/class/leds/lcd-backlight/brightness chown system system /sys/class/leds/button-backlight/brightness + chown system system /sys/class/leds/jogball-backlight/brightness chown system system /sys/class/leds/red/brightness chown system system /sys/class/leds/green/brightness chown system system /sys/class/leds/blue/brightness diff --git a/vold/blkdev.c b/vold/blkdev.c index 981d0f282..316750760 100644 --- a/vold/blkdev.c +++ b/vold/blkdev.c @@ -134,8 +134,12 @@ int blkdev_refresh(blkdev_t *blk) struct dos_partition part; int part_no = blk->minor -1; - dos_partition_dec(block + DOSPARTOFF + part_no * sizeof(struct dos_partition), &part); - blk->part_type = part.dp_typ; + if (part_no < 4) { + dos_partition_dec(block + DOSPARTOFF + part_no * sizeof(struct dos_partition), &part); + blk->part_type = part.dp_typ; + } else { + LOGW("Skipping partition %d", part_no); + } } out: diff --git a/vold/format.c b/vold/format.c index dd0515cf7..3383949f0 100755 --- a/vold/format.c +++ b/vold/format.c @@ -37,15 +37,14 @@ int format_partition(blkdev_t *part, char *type) devpath = blkdev_get_devpath(part); if (!strcmp(type, FORMAT_TYPE_FAT32)) { - char *args[7]; + char *args[6]; args[0] = MKDOSFS_PATH; - args[1] = "-F 32"; - args[2] = "-c 32"; - args[3] = "-n 2"; - args[4] = "-O android"; - args[5] = devpath; - args[6] = NULL; - rc = logwrap(6, args); + args[1] = "-c 32"; + args[2] = "-n 2"; + args[3] = "-O android"; + args[4] = devpath; + args[5] = NULL; + rc = logwrap(5, args); } else { char *args[7]; args[0] = MKE2FS_PATH; diff --git a/vold/logwrapper.c b/vold/logwrapper.c index 25d22819b..2900f2e2b 100644 --- a/vold/logwrapper.c +++ b/vold/logwrapper.c @@ -93,7 +93,7 @@ void child(int argc, char* argv[]) { argv_child[argc] = NULL; // XXX: PROTECT FROM VIKING KILLER - if (execvp(argv_child[0], argv_child)) { + if (execv(argv_child[0], argv_child)) { LOG(LOG_ERROR, "logwrapper", "executing %s failed: %s", argv_child[0], strerror(errno)); exit(-1); diff --git a/vold/misc.c b/vold/misc.c index 951414c63..0f8f61e0f 100644 --- a/vold/misc.c +++ b/vold/misc.c @@ -59,11 +59,11 @@ bail: close(fd); return buffer; } -char *truncate_sysfs_path(char *path, int num_elements_to_remove, char *buffer) +char *truncate_sysfs_path(char *path, int num_elements_to_remove, char *buffer, int buffer_size) { int i; - strcpy(buffer, path); + strncpy(buffer, path, buffer_size); for (i = 0; i < num_elements_to_remove; i++) { char *p = &buffer[strlen(buffer)-1]; @@ -81,7 +81,7 @@ char *read_sysfs_var(char *buffer, size_t maxlen, char *devpath, char *var) char *p; ssize_t sz; - sprintf(filename, "/sys%s/%s", devpath, var); + snprintf(filename, sizeof(filename), "/sys%s/%s", devpath, var); p = read_file(filename, &sz); p[(strlen(p) - 1)] = '\0'; strncpy(buffer, p, maxlen); diff --git a/vold/uevent.c b/vold/uevent.c index d16f3157f..cfb5786c6 100644 --- a/vold/uevent.c +++ b/vold/uevent.c @@ -239,9 +239,9 @@ static char *get_uevent_param(struct uevent *event, char *param_name) static int handle_powersupply_event(struct uevent *event) { char *ps_type = get_uevent_param(event, "POWER_SUPPLY_TYPE"); - char *ps_cap = get_uevent_param(event, "POWER_SUPPLY_CAPACITY"); if (!strcasecmp(ps_type, "battery")) { + char *ps_cap = get_uevent_param(event, "POWER_SUPPLY_CAPACITY"); int capacity = atoi(ps_cap); if (capacity < 5) @@ -307,7 +307,7 @@ static int handle_block_event(struct uevent *event) return -EINVAL; } - truncate_sysfs_path(event->path, n, mediapath); + truncate_sysfs_path(event->path, n, mediapath, sizeof(mediapath)); if (!(media = media_lookup_by_path(mediapath, false))) { #if DEBUG_UEVENT diff --git a/vold/vold.h b/vold/vold.h index 0876bec93..4ff690a3b 100644 --- a/vold/vold.h +++ b/vold/vold.h @@ -89,7 +89,7 @@ int volmgr_bootstrap(void); int switch_bootstrap(void); void *read_file(char *filename, ssize_t *_size); -char *truncate_sysfs_path(char *path, int num_elements_to_remove, char *buffer); +char *truncate_sysfs_path(char *path, int num_elements_to_remove, char *buffer, int buffer_size); char *read_sysfs_var(char *buffer, size_t maxlen, char *devpath, char *var); void ums_hostconnected_set(boolean connected); diff --git a/vold/volmgr.c b/vold/volmgr.c index 7c4c07796..17c9a4932 100644 --- a/vold/volmgr.c +++ b/vold/volmgr.c @@ -43,7 +43,7 @@ static volume_t *vol_root = NULL; static boolean safe_mode = true; static struct volmgr_fstable_entry fs_table[] = { - { "ext3", ext_identify, ext_check, ext_mount , true }, +// { "ext3", ext_identify, ext_check, ext_mount , true }, { "vfat", vfat_identify, vfat_check, vfat_mount , false }, { NULL, NULL, NULL, NULL , false} }; |