aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorAntoine Fontaine <antoine.fontaine@epfl.ch>2020-03-11 01:17:11 +0100
committerLeo <thinkabit.ukim@gmail.com>2020-03-10 22:05:29 -0300
commitdb71e0d805feea2bfc6082ecf0155ec3b5b4a80c (patch)
tree1309ceff8fcf86e502f5b1c76f9fa879d0ceb423 /testing
parent161ec9fdf23c35dbcc8a05b78f98788e1d7684d5 (diff)
downloadaports-db71e0d805feea2bfc6082ecf0155ec3b5b4a80c.tar.bz2
aports-db71e0d805feea2bfc6082ecf0155ec3b5b4a80c.tar.xz
testing/anbox: fix issues
* give even more time to start, because Android is visibly quite long to start on a phone * backport the input chmod patch, it unbreaks touch input on some devices * ignore wayland env vars, as they aren't actually working
Diffstat (limited to 'testing')
-rw-r--r--testing/anbox/APKBUILD8
-rw-r--r--testing/anbox/anbox-launch.sh24
-rw-r--r--testing/anbox/give-more-time-to-start.patch2
-rw-r--r--testing/anbox/input-chmod.patch32
4 files changed, 57 insertions, 9 deletions
diff --git a/testing/anbox/APKBUILD b/testing/anbox/APKBUILD
index a958246224..75fc1c7886 100644
--- a/testing/anbox/APKBUILD
+++ b/testing/anbox/APKBUILD
@@ -4,7 +4,7 @@
# Maintainer:
pkgname=anbox
pkgver=0_git20200303
-pkgrel=1
+pkgrel=2
_commit="3ed2e6d5c360d57b6aa61386e279adf3ff155ded"
_cpu_features_commit="b5c271c53759b2b15ff91df19bd0b32f2966e275"
pkgdesc="Android in a box"
@@ -45,6 +45,7 @@ source="
anbox-container-manager.initd
anbox.confd
musl-fixes.patch
+ input-chmod.patch
fix-gtest-use.patch
give-more-time-to-start.patch
anbox-launch.sh
@@ -114,7 +115,8 @@ c0ec9b603cec2cc9049923e15ef50c85806bc0a0ffe57b63348631061aeddb73c1eca910b25696cf
5a8e76fd636670bdfcbf45c290c06f9399df7831af121e0a6238cc5d7d57d6f7036bca2d457c07f3f694df6f7a574a4e5ace6b1ad3a5e17a68fd638a299faa99 anbox-container-manager.initd
6a3bc88142c5287ec54d481a4788eceb7772d9974af950b5286ce63a49d05d9d49fce5ba1d02b4b1c9893896fd4ba218fd4d39b8e640bdd61ad196b5d5c9a021 anbox.confd
401669509e05eb586ad40fc9e8f4284b52183f06c60e87bf4e923be165a72f10263daf226db7fd610ef6ff25d09abd140ca2d59187e2d1b85a0bd6ae887dd944 musl-fixes.patch
+bc7fc34cd2cfde57e674c8bce5b1f7fd297bd54ed32e16a7ac197fc36a23993ea468d5e0508fde9be4c1b72e04557b988b6b54e34cc2a52d96bbdf27af777ee7 input-chmod.patch
cb9e11cff5cbc03dbb9f69e3600f1cb8cbff0ef896ea5fc665e41a0556a9c57164cf3cf7b422e229c515af10894817e5b797aba5be7ead6aa05d6a024e7c2e50 fix-gtest-use.patch
-4f4439a0f991a77a157464280fd9d43fcff1319effc9bdd235fc61f16c3fbef59d8585ae363326179dd4b1f71e4d206498844361d1418846eb42c5a0d40db33b give-more-time-to-start.patch
-d88bc45b681b6ed318279ee4485ae0d47fd648f207722c094906b61c74d7c373762cdaba890fa577467da99204681cd502051071ee61b2c1c555732e403b4e15 anbox-launch.sh
+67fc97d5274dec6240937981dbd41ae307bc0a77b54ad7200b187423a8184e848a1b8f983cf4b8f17d88b9d77213b06a8e17ba0c80f226f6755a1ae4acbd53ae give-more-time-to-start.patch
+921d69e28a2f63a6eaccdfbd6f53173d2e0c59dd650dd83c0d8f816b5f23f1ba61abb393b0cf5e48d80ce363df4f3e609de34a4e5a73c2b520dba96b76eda0c9 anbox-launch.sh
bc3bec88f271484ef66afb862e517b614568270a4047e400995f73b08ce05cb4faa18a746db161711ec91ef125f0063127e4027699921302406405bbb778583d anbox.desktop"
diff --git a/testing/anbox/anbox-launch.sh b/testing/anbox/anbox-launch.sh
index d843669ce6..ce5286a8df 100644
--- a/testing/anbox/anbox-launch.sh
+++ b/testing/anbox/anbox-launch.sh
@@ -1,9 +1,23 @@
#!/bin/sh
-#if [ -z "$(ps aux | grep 'anbox session-manager' | grep -v grep)" ]; then
-# anbox session-manager &
-# sleep 5s
-#fi
+# https://gitlab.com/postmarketOS/pmaports/-/issues/479
+# EGL_PLATFORM=wayland is broken on desktop as
+# Anbox require PBuffer support but Wayland EGL
+# doesn't provide it. Unsetting this value
+# unbreaks Anbox on e.g. Plasma Mobile.
+if [ "$EGL_PLATFORM" = wayland ]; then
+ export EGL_PLATFORM
+ unset EGL_PLATFORM
+fi
-# We let Anbox autostart the session manager as this provides a splash-screen
+# This breaks Anbox display if EGL_PLATFORM is not
+# set to wayland. Since EGL_PLATFORM is never set
+# to wayland, let's unset SDL_VIDEODRIVER if it is.
+if [ "$SDL_VIDEODRIVER" = wayland ]; then
+ export SDL_VIDEODRIVER
+ unset SDL_VIDEODRIVER
+fi
+
+# We let Anbox autostart the session manager as this
+# provides a splash-screen
anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity
diff --git a/testing/anbox/give-more-time-to-start.patch b/testing/anbox/give-more-time-to-start.patch
index fb90ae13e8..55e65407e4 100644
--- a/testing/anbox/give-more-time-to-start.patch
+++ b/testing/anbox/give-more-time-to-start.patch
@@ -7,7 +7,7 @@ This patch gives more breathing room.
namespace {
constexpr unsigned int max_session_mgr_wait_attempts{10};
-const std::chrono::seconds session_mgr_wait_interval{5};
-+const std::chrono::seconds session_mgr_wait_interval{25};
++const std::chrono::seconds session_mgr_wait_interval{60};
constexpr unsigned int max_dbus_service_wait_attempts{10};
const std::chrono::seconds dbus_service_wait_interval{5};
diff --git a/testing/anbox/input-chmod.patch b/testing/anbox/input-chmod.patch
new file mode 100644
index 0000000000..7d540a65e5
--- /dev/null
+++ b/testing/anbox/input-chmod.patch
@@ -0,0 +1,32 @@
+being upstreamed here: https://github.com/anbox/anbox/pull/1381
+
+diff --git a/src/anbox/input/device.cpp b/src/anbox/input/device.cpp
+index 130ae1d..eb63ecc 100644
+--- a/src/anbox/input/device.cpp
++++ b/src/anbox/input/device.cpp
+@@ -38,6 +38,10 @@ std::shared_ptr<Device> Device::create(
+ sp->connector_ = std::make_shared<network::PublishedSocketConnector>(
+ path, runtime, delegate_connector);
+
++ // FIXME: currently creating the socket creates it with the rights of
++ // the user we're running as. As this one is mapped into the container
++ ::chmod(path.c_str(), S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
++
+ return sp;
+ }
+
+diff --git a/src/anbox/input/manager.cpp b/src/anbox/input/manager.cpp
+index eacdd8b..f5d44ea 100644
+--- a/src/anbox/input/manager.cpp
++++ b/src/anbox/input/manager.cpp
+@@ -26,7 +26,9 @@
+ namespace anbox {
+ namespace input {
+ Manager::Manager(const std::shared_ptr<Runtime> &runtime) : runtime_(runtime) {
+- utils::ensure_paths({SystemConfiguration::instance().input_device_dir()});
++ const auto dir = SystemConfiguration::instance().input_device_dir();
++ utils::ensure_paths({dir});
++ ::chmod(dir.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
+ }
+
+ Manager::~Manager() {}