auto import from //branches/cupcake_rel/...@140373
This commit is contained in:
parent
e037fd7e19
commit
f614d64d4b
10 changed files with 24 additions and 21 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue