aboutsummaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
Diffstat (limited to 'android')
-rw-r--r--android/avd/hardware-properties.ini2
-rw-r--r--android/avd/hw-config-defs.h2
-rw-r--r--android/cmdline-options.h1
-rw-r--r--android/help.c1
-rw-r--r--android/main.c24
5 files changed, 26 insertions, 4 deletions
diff --git a/android/avd/hardware-properties.ini b/android/avd/hardware-properties.ini
index 396b364..3093b16 100644
--- a/android/avd/hardware-properties.ini
+++ b/android/avd/hardware-properties.ini
@@ -85,7 +85,7 @@ abstract = Maximum vertical camera pixels
# GPS support
name = hw.gps
type = boolean
-default = no
+default = yes
abstract = GPS support
description = Whether there is a GPS in the device.
diff --git a/android/avd/hw-config-defs.h b/android/avd/hw-config-defs.h
index d5ecae6..fd85bf2 100644
--- a/android/avd/hw-config-defs.h
+++ b/android/avd/hw-config-defs.h
@@ -83,7 +83,7 @@ HWCFG_INT(
HWCFG_BOOL(
hw_gps,
"hw.gps",
- "no",
+ "yes",
"GPS support",
"Whether there is a GPS in the device.")
diff --git a/android/cmdline-options.h b/android/cmdline-options.h
index e38b081..c57ed10 100644
--- a/android/cmdline-options.h
+++ b/android/cmdline-options.h
@@ -68,6 +68,7 @@ CFG_PARAM( image, "<file>", "obsolete, use -system <file> instead" )
CFG_PARAM( init_data, "<file>", "initial data image (default <system>/userdata.img" )
CFG_PARAM( initdata, "<file>", "same as '-init-data <file>'" )
CFG_PARAM( data, "<file>", "data image (default <datadir>/userdata-qemu.img" )
+CFG_PARAM( partition_size, "<size>", "system/data partition size in MBs" )
CFG_PARAM( cache, "<file>", "cache partition image (default is temporary file)" )
CFG_FLAG ( no_cache, "disable the cache partition" )
CFG_FLAG ( nocache, "same as -no-cache" )
diff --git a/android/help.c b/android/help.c
index 92531d9..ae4dbc0 100644
--- a/android/help.c
+++ b/android/help.c
@@ -1293,6 +1293,7 @@ help_tcpdump(stralloc_t *out)
#define help_no_window NULL
#define help_version NULL
#define help_memory NULL
+#define help_partition_size NULL
typedef struct {
const char* name;
diff --git a/android/main.c b/android/main.c
index de7cb66..a9fa17e 100644
--- a/android/main.c
+++ b/android/main.c
@@ -1711,6 +1711,7 @@ int main(int argc, char **argv)
int shell_serial = 0;
int dns_count = 0;
unsigned cachePartitionSize = 0;
+ unsigned defaultPartitionSize = 0x4200000;
AndroidHwConfig* hw;
@@ -2252,6 +2253,24 @@ int main(int argc, char **argv)
args[n++] = "-initrd";
args[n++] = (char*) avdInfo_getImageFile(android_avdInfo, AVD_IMAGE_RAMDISK);
+ if (opts->partition_size) {
+ char* end;
+ long size = strtol(opts->partition_size, &end, 0);
+ long maxSize = LONG_MAX / (1024*1024);
+ long defaultMB = (defaultPartitionSize + (512*1024)) / (1024*1024);
+
+ if (size < 0 || *end != 0) {
+ derror( "-partition-size must be followed by a positive integer" );
+ exit(1);
+ }
+ if (size < defaultMB || size > maxSize) {
+ derror( "partition-size (%d) must be between %dMB and %dMB",
+ size, defaultMB, maxSize );
+ exit(1);
+ }
+ defaultPartitionSize = size * 1024*1024;
+ }
+
{
const char* filetype = "file";
@@ -2259,7 +2278,7 @@ int main(int argc, char **argv)
filetype = "initfile";
bufprint(tmp, tmpend,
- "system,size=0x4200000,%s=%s", filetype,
+ "system,size=0x%x,%s=%s", defaultPartitionSize, filetype,
avdInfo_getImageFile(android_avdInfo, AVD_IMAGE_INITSYSTEM));
args[n++] = "-nand";
@@ -2267,7 +2286,8 @@ int main(int argc, char **argv)
}
bufprint(tmp, tmpend,
- "userdata,size=0x4200000,file=%s",
+ "userdata,size=0x%x,file=%s",
+ defaultPartitionSize,
avdInfo_getImageFile(android_avdInfo, AVD_IMAGE_USERDATA));
args[n++] = "-nand";