diff options
-rw-r--r-- | Makefile.android | 6 | ||||
-rw-r--r-- | qemu-options.hx | 3 | ||||
-rw-r--r-- | vl-android.c | 27 |
3 files changed, 33 insertions, 3 deletions
diff --git a/Makefile.android b/Makefile.android index f4c8374..779653c 100644 --- a/Makefile.android +++ b/Makefile.android @@ -658,9 +658,6 @@ CORE_MISC_SOURCES = vl-android.c \ android/hw-events.c \ android/hw-control.c \ android/console.c \ - android/avd/hw-config.c \ - android/avd/info.c \ - android/utils/ini.c \ android/hw-sensors.c \ ifeq ($(HOST_ARCH),x86) @@ -737,6 +734,9 @@ UI_AND_CORE_SOURCES = osdep.c \ android/utils/tempfile.c \ android/utils/timezone.c \ android/utils/mapfile.c \ + android/avd/hw-config.c \ + android/avd/info.c \ + android/utils/ini.c \ # include the Zlib sources # diff --git a/qemu-options.hx b/qemu-options.hx index 41a16e7..03e3be2 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1627,4 +1627,7 @@ DEF("android-gui", HAS_ARG, QEMU_OPTION_android_gui, \ "-android-gui width=<width>,height=<height>,bpp=<bits per pixel>" " width, height, and bits per pixel for the graphic console\n") +DEF("android-hw", HAS_ARG, QEMU_OPTION_android_hw, \ + "-android-hw <file> read hardware initialization from ini file\n") + #endif diff --git a/vl-android.c b/vl-android.c index c09d8a7..fa32b79 100644 --- a/vl-android.c +++ b/vl-android.c @@ -54,6 +54,7 @@ #include "android/hw-qemud.h" #include "android/hw-kmsg.h" #include "android/charmap.h" +#include "android/globals.h" #include "targphys.h" #include <unistd.h> @@ -340,6 +341,9 @@ char* op_charmap_file = NULL; /* Framebuffer dimensions, passed with -android-gui option. */ char* android_op_gui = NULL; +/* Path to hardware initialization file passed with -android-hw option. */ +char* android_op_hwini = NULL; + extern int android_display_width; extern int android_display_height; extern int android_display_bpp; @@ -5010,6 +5014,9 @@ int main(int argc, char **argv, char **envp) #endif CPUState *env; int show_vnc_port = 0; +#ifdef CONFIG_STANDALONE_CORE + IniFile* hw_ini = NULL; +#endif // CONFIG_STANDALONE_CORE init_clocks(); @@ -5802,6 +5809,10 @@ int main(int argc, char **argv, char **envp) case QEMU_OPTION_android_gui: android_op_gui = (char*)optarg; break; + + case QEMU_OPTION_android_hw: + android_op_hwini = (char*)optarg; + break; } } } @@ -5829,6 +5840,22 @@ int main(int argc, char **argv, char **envp) data_dir = CONFIG_QEMU_SHAREDIR; } +#ifdef CONFIG_STANDALONE_CORE + /* Initialize hardware configuration. */ + if (android_op_hwini) { + hw_ini = iniFile_newFromFile(android_op_hwini); + if (hw_ini == NULL) { + fprintf(stderr, "Could not find %s file.\n", android_op_hwini); + exit(1); + } + } else { + hw_ini = iniFile_newFromMemory("", 0); + } + + androidHwConfig_read(android_hw, hw_ini); + iniFile_free(hw_ini); +#endif // CONFIG_STANDALONE_CORE + #if defined(CONFIG_KVM) && defined(CONFIG_KQEMU) if (kvm_allowed && kqemu_allowed) { fprintf(stderr, |