From 1108e294abde6efc6def21f9c870e8f79b989eb8 Mon Sep 17 00:00:00 2001 From: limboemu Date: Sun, 9 May 2021 16:40:14 +0300 Subject: [PATCH] v5.1.0 fixed problem when importing machines no signalfd for better compatibility --- README.developers | 13 +++--- VERSION | 2 +- gradle.properties | 3 +- gradle/wrapper/gradle-wrapper.properties | 3 +- .../src/main/AndroidManifest.xml | 6 +-- limbo-android-lib/src/main/assets/CHANGELOG | 4 ++ .../android/limbo/main/LimboActivity.java | 2 + .../android/limbo/utils/FileUtils.java | 7 +-- .../src/main/jni/patches/qemu-5.1.0.patch | 44 ++++++++++++------- .../src/main/AndroidManifest.xml | 6 +-- .../src/main/AndroidManifest.xml | 6 +-- .../src/main/AndroidManifest.xml | 6 +-- 12 files changed, 62 insertions(+), 40 deletions(-) diff --git a/README.developers b/README.developers index 028e474d3..838923f20 100644 --- a/README.developers +++ b/README.developers @@ -19,7 +19,7 @@ https://github.com/limboemu/limbo Android device with Android OS 5.0 (Lollipop) and above Linux Desktop pc (Ubuntu prefered) Make sure you have the following packages installed, if not run: - sudo apt-get install make autoconf automake git python binutils libtool-bin pkg-config flex bison + sudo apt-get install make autoconf automake git python binutils libtool-bin pkg-config flex bison gettext =============================================================================== @@ -128,7 +128,7 @@ https://github.com/limboemu/limbo where: EABI is the Android device type (host arch): armeabi-v7a, arm64-v8a, x86, x86_64 - GUEST_ARCH is the Emulator type: x86_64-softmmu,aarch64-softmmu,sparc64-softmmu, ppc64-softmmu + GUEST_ARCH is the Emulator type: x86_64-softmmu,aarch64-softmmu,sparc64-softmmu,ppc64-softmmu ENABLE_DEBUG is 1 (optional) If you want to remove ALL previously compiled native objects and libraries: @@ -198,8 +198,11 @@ https://github.com/limboemu/limbo d. Build the Android apk for the corresponding guest using Android Studio. Make sure the *.so libraries are zipped in the final .apk + + e. To build from the command line instead of Android Studio: + ./gradlew assembleRelease - e. If you want to build the debugging version: + f. If you want to build the debugging version: Set variables in Config.java: debug = true; Modify android-config/android-limbo-config.mak and point to a configuration @@ -212,7 +215,7 @@ https://github.com/limboemu/limbo Important: From Android studio click Build> Rebuild Project and Run > Debug - f. To debug the native code for a particular guest: + g. To debug the native code for a particular guest: # for x86 guest and ARM64 phone: export BUILD_HOST=arm64-v8a @@ -239,7 +242,7 @@ https://github.com/limboemu/limbo To see stack (backtrace): bt =============================================================================== -6. Development +6. Development Notes a. Codes Changes for Android compatibility are in patch files marked with __ANDROID__ diff --git a/VERSION b/VERSION index c87731410..01fdd2d8f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -500.00 +501.00 diff --git a/gradle.properties b/gradle.properties index c880b30a1..26dc65176 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. -org.gradle.jvmargs=-Xmx1536m +org.gradle.jvmargs=-Xmx2000m # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit @@ -26,3 +26,4 @@ android.useDeprecatedNdk=true android.useAndroidX=true android.enableJetifier=true +org.gradle.jvmargs=-Xmx2000m diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d5e759dac..186b71557 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Tue Nov 24 15:56:50 EET 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip diff --git a/limbo-android-arm/src/main/AndroidManifest.xml b/limbo-android-arm/src/main/AndroidManifest.xml index 6fdf5e067..6f87599e0 100644 --- a/limbo-android-arm/src/main/AndroidManifest.xml +++ b/limbo-android-arm/src/main/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="50100" + android:versionName="5.1.0-arm" > @@ -80,4 +80,4 @@ - \ No newline at end of file + diff --git a/limbo-android-lib/src/main/assets/CHANGELOG b/limbo-android-lib/src/main/assets/CHANGELOG index bdbd4e146..dd3050001 100644 --- a/limbo-android-lib/src/main/assets/CHANGELOG +++ b/limbo-android-lib/src/main/assets/CHANGELOG @@ -1,3 +1,7 @@ +* Limbo v5.1.0 +Fixed issue with importing machines +No signalfd for better compatibility + * Limbo v5.0.0 Rebase with QEMU 5.1.0 Stability and less virtual disk corruptions diff --git a/limbo-android-lib/src/main/java/com/max2idea/android/limbo/main/LimboActivity.java b/limbo-android-lib/src/main/java/com/max2idea/android/limbo/main/LimboActivity.java index a0323208c..8db9b1e00 100644 --- a/limbo-android-lib/src/main/java/com/max2idea/android/limbo/main/LimboActivity.java +++ b/limbo-android-lib/src/main/java/com/max2idea/android/limbo/main/LimboActivity.java @@ -6418,6 +6418,8 @@ protected Void doInBackground(Void... arg0) { // Import displayImportFilePath = FileUtils.getFullPathFromDocumentFilePath(importFilePath); machines = FileUtils.getVMsFromFile(activity, importFilePath); + UIUtils.toastLong(LimboActivity.this, "Import machines: " + machines.size()); + if (machines == null) { return null; } diff --git a/limbo-android-lib/src/main/java/com/max2idea/android/limbo/utils/FileUtils.java b/limbo-android-lib/src/main/java/com/max2idea/android/limbo/utils/FileUtils.java index ea02d48f7..e97861c10 100644 --- a/limbo-android-lib/src/main/java/com/max2idea/android/limbo/utils/FileUtils.java +++ b/limbo-android-lib/src/main/java/com/max2idea/android/limbo/utils/FileUtils.java @@ -143,6 +143,7 @@ public static ArrayList getVMsFromFile(Context context, String importFi // Read machines from csv file try { // open the file for reading + Log.v("CSV Parser", "Import file: " + importFilePath); instream = getStreamFromFilePath(context, importFilePath); // if file the available for reading @@ -184,7 +185,7 @@ public static ArrayList getVMsFromFile(Context context, String importFi // Log.v("CSV Parser", "Line: " + line); // Parse - String machineAttr[] = line.split(","); + String machineAttr[] = line.split(",(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)", -1); Machine mach = new Machine(machineAttr[0]); for (int i = 0; i < machineAttr.length; i++) { String attr = null; @@ -294,13 +295,13 @@ else if (attrs.get(i).equals(MachineOpenHelper.ENABLE_KVM)) mach.enableKVM = Integer.parseInt(machineAttr[i].replace("\"", "")); } + Log.v("CSV Parser", "Adding Machine: " + mach.machinename); machines.add(mach); } } } catch (Exception ex) { - // print stack trace. - Log.v("Import", "Error:" + ex.getMessage()); + ex.printStackTrace(); } finally { try { diff --git a/limbo-android-lib/src/main/jni/patches/qemu-5.1.0.patch b/limbo-android-lib/src/main/jni/patches/qemu-5.1.0.patch index 95f039618..48fc846ba 100644 --- a/limbo-android-lib/src/main/jni/patches/qemu-5.1.0.patch +++ b/limbo-android-lib/src/main/jni/patches/qemu-5.1.0.patch @@ -1,6 +1,6 @@ diff -ru --no-dereference /tmp/qemu-5.1.0/accel/kvm/kvm-all.c ./accel/kvm/kvm-all.c --- /tmp/qemu-5.1.0/accel/kvm/kvm-all.c 2020-08-11 22:17:15.000000000 +0300 -+++ ./accel/kvm/kvm-all.c 2020-11-27 17:37:08.266482182 +0200 ++++ ./accel/kvm/kvm-all.c 2021-05-06 19:56:41.679845481 +0300 @@ -2015,7 +2015,12 @@ s->vmfd = -1; s->fd = qemu_open("/dev/kvm", O_RDWR); @@ -16,7 +16,7 @@ diff -ru --no-dereference /tmp/qemu-5.1.0/accel/kvm/kvm-all.c ./accel/kvm/kvm-al } diff -ru --no-dereference /tmp/qemu-5.1.0/configure ./configure --- /tmp/qemu-5.1.0/configure 2020-08-11 22:17:15.000000000 +0300 -+++ ./configure 2020-11-27 17:37:08.290482245 +0200 ++++ ./configure 2021-05-06 19:59:23.036717050 +0300 @@ -2501,7 +2501,8 @@ # pkg-config probe @@ -83,7 +83,19 @@ diff -ru --no-dereference /tmp/qemu-5.1.0/configure ./configure fi ########################################## -@@ -5526,7 +5535,8 @@ +@@ -4757,6 +4766,11 @@ + signalfd=yes + fi + ++#Limbo: Android x86_64 devices (at least emulator images) ++# have the headers but don't support SYS_signalfd ++# fortunately there is qemu_compat_signalfd ++signalfd=no ++ + # check if optreset global is declared by + optreset="no" + cat > $TMPC << EOF +@@ -5526,7 +5540,8 @@ int main(void) { return strchrnul(haystack, 'x') != &haystack[6]; } EOF if compile_prog "" "" ; then @@ -93,7 +105,7 @@ diff -ru --no-dereference /tmp/qemu-5.1.0/configure ./configure fi ######################################### -@@ -6066,6 +6076,7 @@ +@@ -6066,6 +6081,7 @@ ############################################### # Check if copy_file_range is provided by glibc have_copy_file_range=no @@ -101,7 +113,7 @@ diff -ru --no-dereference /tmp/qemu-5.1.0/configure ./configure cat > $TMPC << EOF #include int main(void) { -@@ -6074,7 +6085,8 @@ +@@ -6074,7 +6090,8 @@ } EOF if compile_prog "" "" ; then @@ -113,7 +125,7 @@ diff -ru --no-dereference /tmp/qemu-5.1.0/configure ./configure ########################################## diff -ru --no-dereference /tmp/qemu-5.1.0/include/qemu/osdep.h ./include/qemu/osdep.h --- /tmp/qemu-5.1.0/include/qemu/osdep.h 2020-08-11 22:17:15.000000000 +0300 -+++ ./include/qemu/osdep.h 2020-11-27 17:37:08.290482245 +0200 ++++ ./include/qemu/osdep.h 2021-05-06 19:56:41.695848806 +0300 @@ -36,6 +36,10 @@ #include "qemu/compiler.h" @@ -127,7 +139,7 @@ diff -ru --no-dereference /tmp/qemu-5.1.0/include/qemu/osdep.h ./include/qemu/os * that system header. diff -ru --no-dereference /tmp/qemu-5.1.0/include/ui/console.h ./include/ui/console.h --- /tmp/qemu-5.1.0/include/ui/console.h 2020-08-11 22:17:14.000000000 +0300 -+++ ./include/ui/console.h 2020-11-27 17:37:08.290482245 +0200 ++++ ./include/ui/console.h 2021-05-06 19:56:41.699849638 +0300 @@ -26,7 +26,13 @@ #define QEMU_CAPS_LOCK_LED (1 << 2) @@ -144,7 +156,7 @@ diff -ru --no-dereference /tmp/qemu-5.1.0/include/ui/console.h ./include/ui/cons /* Color number is match to standard vga palette */ diff -ru --no-dereference /tmp/qemu-5.1.0/Makefile ./Makefile --- /tmp/qemu-5.1.0/Makefile 2020-08-11 22:17:15.000000000 +0300 -+++ ./Makefile 2020-11-27 17:37:08.290482245 +0200 ++++ ./Makefile 2021-05-06 19:56:41.703850468 +0300 @@ -338,7 +338,8 @@ vhost-user-json-y = HELPERS-y = $(HELPERS) @@ -177,7 +189,7 @@ diff -ru --no-dereference /tmp/qemu-5.1.0/Makefile ./Makefile diff -ru --no-dereference /tmp/qemu-5.1.0/Makefile.target ./Makefile.target --- /tmp/qemu-5.1.0/Makefile.target 2020-08-11 22:17:15.000000000 +0300 -+++ ./Makefile.target 2020-11-27 17:56:48.228730852 +0200 ++++ ./Makefile.target 2021-05-06 19:56:41.711852131 +0300 @@ -18,6 +18,12 @@ QEMU_CFLAGS+=-iquote $(SRC_PATH)/include @@ -206,7 +218,7 @@ diff -ru --no-dereference /tmp/qemu-5.1.0/Makefile.target ./Makefile.target $(call quiet-command,SetFile -a C $@,"SETFILE","$(TARGET_DIR)$@") diff -ru --no-dereference /tmp/qemu-5.1.0/monitor/misc.c ./monitor/misc.c --- /tmp/qemu-5.1.0/monitor/misc.c 2020-08-11 22:17:15.000000000 +0300 -+++ ./monitor/misc.c 2020-11-27 17:37:08.298482266 +0200 ++++ ./monitor/misc.c 2021-05-06 19:56:41.715852962 +0300 @@ -1299,6 +1299,14 @@ { mon_fd_t *monfd; @@ -224,7 +236,7 @@ diff -ru --no-dereference /tmp/qemu-5.1.0/monitor/misc.c ./monitor/misc.c int fd; diff -ru --no-dereference /tmp/qemu-5.1.0/ui/console.c ./ui/console.c --- /tmp/qemu-5.1.0/ui/console.c 2020-08-11 22:17:15.000000000 +0300 -+++ ./ui/console.c 2020-11-27 17:37:08.314482307 +0200 ++++ ./ui/console.c 2021-05-06 19:56:41.715852962 +0300 @@ -38,6 +38,10 @@ #define DEFAULT_BACKSCROLL 512 #define CONSOLE_CURSOR_PERIOD 500 @@ -238,7 +250,7 @@ diff -ru --no-dereference /tmp/qemu-5.1.0/ui/console.c ./ui/console.c uint8_t bgcol:4; diff -ru --no-dereference /tmp/qemu-5.1.0/ui/sdl2-2d.c ./ui/sdl2-2d.c --- /tmp/qemu-5.1.0/ui/sdl2-2d.c 2020-08-11 22:17:15.000000000 +0300 -+++ ./ui/sdl2-2d.c 2020-11-27 17:37:08.330482349 +0200 ++++ ./ui/sdl2-2d.c 2021-05-06 19:56:41.723854625 +0300 @@ -125,6 +125,12 @@ surface_width(new_surface), surface_height(new_surface)); @@ -254,7 +266,7 @@ diff -ru --no-dereference /tmp/qemu-5.1.0/ui/sdl2-2d.c ./ui/sdl2-2d.c void sdl2_2d_refresh(DisplayChangeListener *dcl) diff -ru --no-dereference /tmp/qemu-5.1.0/ui/sdl2.c ./ui/sdl2.c --- /tmp/qemu-5.1.0/ui/sdl2.c 2020-08-11 22:17:15.000000000 +0300 -+++ ./ui/sdl2.c 2020-11-27 17:37:08.342482380 +0200 ++++ ./ui/sdl2.c 2021-05-06 19:56:41.727855456 +0300 @@ -89,7 +89,16 @@ surface_width(scon->surface), surface_height(scon->surface), @@ -307,7 +319,7 @@ diff -ru --no-dereference /tmp/qemu-5.1.0/ui/sdl2.c ./ui/sdl2.c fprintf(stderr, "Could not initialize SDL(%s) - exiting\n", diff -ru --no-dereference /tmp/qemu-5.1.0/ui/vnc.c ./ui/vnc.c --- /tmp/qemu-5.1.0/ui/vnc.c 2020-08-11 22:17:15.000000000 +0300 -+++ ./ui/vnc.c 2020-11-27 17:37:08.346482390 +0200 ++++ ./ui/vnc.c 2021-05-06 19:56:41.739857949 +0300 @@ -51,8 +51,19 @@ #include "qemu/cutils.h" #include "io/dns-resolver.h" @@ -330,7 +342,7 @@ diff -ru --no-dereference /tmp/qemu-5.1.0/ui/vnc.c ./ui/vnc.c static const struct timeval VNC_REFRESH_LOSSY = { 2, 0 }; diff -ru --no-dereference /tmp/qemu-5.1.0/util/Makefile.objs ./util/Makefile.objs --- /tmp/qemu-5.1.0/util/Makefile.objs 2020-08-11 22:17:15.000000000 +0300 -+++ ./util/Makefile.objs 2020-11-27 17:37:08.346482390 +0200 ++++ ./util/Makefile.objs 2021-05-06 19:56:41.743858781 +0300 @@ -39,7 +39,8 @@ util-obj-y += range.o util-obj-y += stats64.o @@ -343,7 +355,7 @@ diff -ru --no-dereference /tmp/qemu-5.1.0/util/Makefile.objs ./util/Makefile.obj dbus.o-cflags = $(GIO_CFLAGS) diff -ru --no-dereference /tmp/qemu-5.1.0/util/qemu-openpty.c ./util/qemu-openpty.c --- /tmp/qemu-5.1.0/util/qemu-openpty.c 2020-08-11 22:17:15.000000000 +0300 -+++ ./util/qemu-openpty.c 2020-11-27 17:37:08.346482390 +0200 ++++ ./util/qemu-openpty.c 2021-05-06 19:56:41.743858781 +0300 @@ -111,6 +111,9 @@ } #endif diff --git a/limbo-android-ppc/src/main/AndroidManifest.xml b/limbo-android-ppc/src/main/AndroidManifest.xml index 2e283213e..e7590c8d1 100644 --- a/limbo-android-ppc/src/main/AndroidManifest.xml +++ b/limbo-android-ppc/src/main/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="50100" + android:versionName="5.1.0-ppc" > @@ -81,4 +81,4 @@ - \ No newline at end of file + diff --git a/limbo-android-sparc/src/main/AndroidManifest.xml b/limbo-android-sparc/src/main/AndroidManifest.xml index dee26d998..84023a261 100644 --- a/limbo-android-sparc/src/main/AndroidManifest.xml +++ b/limbo-android-sparc/src/main/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="50100" + android:versionName="5.1.0-sparc" > @@ -81,4 +81,4 @@ - \ No newline at end of file + diff --git a/limbo-android-x86/src/main/AndroidManifest.xml b/limbo-android-x86/src/main/AndroidManifest.xml index 7c217f346..ec4edafcb 100644 --- a/limbo-android-x86/src/main/AndroidManifest.xml +++ b/limbo-android-x86/src/main/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="50100" + android:versionName="5.1.0-x86" > @@ -85,4 +85,4 @@ - \ No newline at end of file +