Skip to content

Commit

Permalink
v5.1.0
Browse files Browse the repository at this point in the history
fixed problem when importing machines
no signalfd for better compatibility
  • Loading branch information
limboemu committed May 9, 2021
1 parent e94b081 commit 1108e29
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 40 deletions.
13 changes: 8 additions & 5 deletions README.developers
Original file line number Diff line number Diff line change
Expand Up @@ -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

===============================================================================

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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__

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
500.00
501.00
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,3 +26,4 @@ android.useDeprecatedNdk=true

android.useAndroidX=true
android.enableJetifier=true
org.gradle.jvmargs=-Xmx2000m
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions limbo-android-arm/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.limbo.emu.main.arm"
android:installLocation="auto"
android:versionCode="50000"
android:versionName="5.0.0-arm" >
android:versionCode="50100"
android:versionName="5.1.0-arm" >

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Expand Down Expand Up @@ -80,4 +80,4 @@

</application>

</manifest>
</manifest>
4 changes: 4 additions & 0 deletions limbo-android-lib/src/main/assets/CHANGELOG
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ public static ArrayList<Machine> 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
Expand Down Expand Up @@ -184,7 +185,7 @@ public static ArrayList<Machine> 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;
Expand Down Expand Up @@ -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 {
Expand Down
44 changes: 28 additions & 16 deletions limbo-android-lib/src/main/jni/patches/qemu-5.1.0.patch
Original file line number Diff line number Diff line change
@@ -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);
Expand All @@ -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

Expand Down Expand Up @@ -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 <getopt.h>
optreset="no"
cat > $TMPC << EOF
@@ -5526,7 +5540,8 @@
int main(void) { return strchrnul(haystack, 'x') != &haystack[6]; }
EOF
if compile_prog "" "" ; then
Expand All @@ -93,15 +105,15 @@ 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
+
cat > $TMPC << EOF
#include <unistd.h>
int main(void) {
@@ -6074,7 +6085,8 @@
@@ -6074,7 +6090,8 @@
}
EOF
if compile_prog "" "" ; then
Expand All @@ -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"
Expand All @@ -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)

Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand All @@ -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));
Expand All @@ -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),
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions limbo-android-ppc/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.limbo.emu.main.ppc"
android:installLocation="auto"
android:versionCode="50000"
android:versionName="5.0.0-ppc" >
android:versionCode="50100"
android:versionName="5.1.0-ppc" >


<uses-permission android:name="android.permission.INTERNET" />
Expand Down Expand Up @@ -81,4 +81,4 @@

</application>

</manifest>
</manifest>
6 changes: 3 additions & 3 deletions limbo-android-sparc/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.limbo.emu.main.sparc"
android:installLocation="auto"
android:versionCode="50000"
android:versionName="5.0.0-sparc" >
android:versionCode="50100"
android:versionName="5.1.0-sparc" >

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Expand Down Expand Up @@ -81,4 +81,4 @@

</application>

</manifest>
</manifest>
6 changes: 3 additions & 3 deletions limbo-android-x86/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.limbo.emu.main"
android:installLocation="auto"
android:versionCode="50000"
android:versionName="5.0.0-x86" >
android:versionCode="50100"
android:versionName="5.1.0-x86" >

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Expand Down Expand Up @@ -85,4 +85,4 @@

</application>

</manifest>
</manifest>

0 comments on commit 1108e29

Please sign in to comment.