mirror of
https://abf.rosa.ru/djam/anbox.git
synced 2025-02-23 15:42:49 +00:00
Use a separate binder FS to avoid potential confclits with something else, try to work on kernels of different configuration
This commit is contained in:
parent
0810d99547
commit
12c99571b8
3 changed files with 31 additions and 7 deletions
|
@ -1,17 +1,19 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Anbox Container Manager
|
Description=Anbox Container Manager
|
||||||
Documentation=man:anbox(1)
|
Documentation=man:anbox(1)
|
||||||
# TODO: add dependency from lxc
|
|
||||||
After=network.target
|
After=network.target
|
||||||
Wants=network.target
|
Wants=network.target
|
||||||
ConditionPathExists=/var/lib/anbox/android.img
|
ConditionPathExists=/var/lib/anbox/android.img
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStartPre=/sbin/modprobe ashmem_linux
|
# More datailed log of /usr/bin/anbox
|
||||||
ExecStartPre=/sbin/modprobe binder_linux
|
Environment=ANBOX_LOG_LEVEL=debug
|
||||||
|
# Some kernels may have this functionality build it, not as modules
|
||||||
|
ExecStartPre=/usr/share/anbox/anbox-load-kernel-modules.sh
|
||||||
ExecStartPre=/usr/share/anbox/anbox-bridge.sh start
|
ExecStartPre=/usr/share/anbox/anbox-bridge.sh start
|
||||||
ExecStart=/usr/bin/anbox container-manager --daemon --privileged --data-path=/var/lib/anbox
|
ExecStart=/usr/bin/anbox container-manager --daemon --privileged --data-path=/var/lib/anbox
|
||||||
ExecStopPost=/usr/share/anbox/anbox-bridge.sh stop
|
ExecStopPost=/usr/share/anbox/anbox-bridge.sh stop
|
||||||
|
ExecStopPost=umount /var/lib/anbox/binderfs0
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
19
anbox-load-kernel-modules.sh
Executable file
19
anbox-load-kernel-modules.sh
Executable file
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -xuef
|
||||||
|
|
||||||
|
device=/var/lib/anbox/binderfs0
|
||||||
|
|
||||||
|
if findmnt "$device" ; then
|
||||||
|
echo "$device is already mounted, exiting"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Some kernels may have these separate modules,
|
||||||
|
# some may have functionality built in
|
||||||
|
modprobe binder_linux 2>/dev/null || :
|
||||||
|
modprobe ashmem_linux 2>/dev/null || :
|
||||||
|
|
||||||
|
mount -t binder binder "$device"
|
||||||
|
|
||||||
|
[ -e /dev/ashmem ]
|
11
anbox.spec
11
anbox.spec
|
@ -4,18 +4,19 @@
|
||||||
Summary: Android in a box
|
Summary: Android in a box
|
||||||
Name: anbox
|
Name: anbox
|
||||||
Version: 0.0
|
Version: 0.0
|
||||||
Release: 0.git%{commit_short}.2
|
Release: 0.git%{commit_short}.6
|
||||||
License: GPLv3
|
License: GPLv3
|
||||||
Group: Emulators
|
Group: Emulators
|
||||||
Url: https://anbox.io
|
Url: https://anbox.io
|
||||||
Source0: https://github.com/anbox/anbox/archive/%{commit}.tar.gz?/%{name}-%{commit}.tar.gz
|
Source0: https://github.com/anbox/anbox/archive/%{commit}.tar.gz?/%{name}-%{commit}.tar.gz
|
||||||
|
|
||||||
# Additional stuff from Debian
|
# Additional stuff, based on stuff from Debian package
|
||||||
Source10: anbox-container-manager.service
|
Source10: anbox-container-manager.service
|
||||||
Source11: org.anbox.service
|
Source11: org.anbox.service
|
||||||
Source12: anbox.desktop
|
Source12: anbox.desktop
|
||||||
Source13: anbox.1
|
Source13: anbox.1
|
||||||
Source14: README.ROSA
|
Source14: README.ROSA
|
||||||
|
Source15: anbox-load-kernel-modules.sh
|
||||||
|
|
||||||
# Patches from Debian
|
# Patches from Debian
|
||||||
Patch0001: 0001-fix-spelling-errors-in-external-libraries.patch
|
Patch0001: 0001-fix-spelling-errors-in-external-libraries.patch
|
||||||
|
@ -38,7 +39,6 @@ BuildRequires: cmake(CpuFeatures)
|
||||||
BuildRequires: pkgconfig(dri)
|
BuildRequires: pkgconfig(dri)
|
||||||
BuildRequires: pkgconfig(dbus-1)
|
BuildRequires: pkgconfig(dbus-1)
|
||||||
BuildRequires: pkgconfig(libcap)
|
BuildRequires: pkgconfig(libcap)
|
||||||
# TODO: lxc v2 is very old, update it to v4
|
|
||||||
BuildRequires: pkgconfig(lxc)
|
BuildRequires: pkgconfig(lxc)
|
||||||
# build of tests is disabled in %%prep, but headers are needed
|
# build of tests is disabled in %%prep, but headers are needed
|
||||||
BuildRequires: pkgconfig(gmock)
|
BuildRequires: pkgconfig(gmock)
|
||||||
|
@ -95,6 +95,7 @@ See %{_docdir}/anbox/README.ROSA for more information.
|
||||||
%{_mandir}/man1/anbox.1*
|
%{_mandir}/man1/anbox.1*
|
||||||
%{_unitdir}/anbox-container-manager.service
|
%{_unitdir}/anbox-container-manager.service
|
||||||
%dir /var/lib/anbox
|
%dir /var/lib/anbox
|
||||||
|
%dir /var/lib/anbox/binderfs0
|
||||||
|
|
||||||
%post
|
%post
|
||||||
%systemd_post anbox-container-manager.service
|
%systemd_post anbox-container-manager.service
|
||||||
|
@ -124,6 +125,7 @@ cp %{SOURCE14} README.ROSA
|
||||||
-DCMAKE_INSTALL_LIBDIR=%{_libdir} \
|
-DCMAKE_INSTALL_LIBDIR=%{_libdir} \
|
||||||
-DANBOX_VERSION=%{version}-%{release} \
|
-DANBOX_VERSION=%{version}-%{release} \
|
||||||
-DANBOX_VERSION_SUFFIX=%{vendor} \
|
-DANBOX_VERSION_SUFFIX=%{vendor} \
|
||||||
|
-DBINDERFS_PATH=/var/lib/anbox/binderfs0 \
|
||||||
-DCMAKE_BUILD_TYPE=Release
|
-DCMAKE_BUILD_TYPE=Release
|
||||||
%make
|
%make
|
||||||
|
|
||||||
|
@ -135,6 +137,7 @@ install -m0644 -D %{SOURCE10} %{buildroot}%{_unitdir}/anbox-container-manager.se
|
||||||
install -m0644 -D %{SOURCE11} %{buildroot}%{_datadir}/dbus-1/services/org.anbox.service
|
install -m0644 -D %{SOURCE11} %{buildroot}%{_datadir}/dbus-1/services/org.anbox.service
|
||||||
install -m0644 -D %{SOURCE12} %{buildroot}%{_datadir}/applications/anbox.desktop
|
install -m0644 -D %{SOURCE12} %{buildroot}%{_datadir}/applications/anbox.desktop
|
||||||
install -m0644 -D %{SOURCE13} %{buildroot}%{_mandir}/man1/anbox.1
|
install -m0644 -D %{SOURCE13} %{buildroot}%{_mandir}/man1/anbox.1
|
||||||
|
install -m0755 -D %{SOURCE15} %{buildroot}%{_datadir}/anbox/anbox-load-kernel-modules.sh
|
||||||
install -m0755 -D scripts/anbox-bridge.sh %{buildroot}%{_datadir}/anbox/anbox-bridge.sh
|
install -m0755 -D scripts/anbox-bridge.sh %{buildroot}%{_datadir}/anbox/anbox-bridge.sh
|
||||||
install -m0755 -D scripts/anbox-shell.sh %{buildroot}%{_datadir}/anbox/anbox-shell.sh
|
install -m0755 -D scripts/anbox-shell.sh %{buildroot}%{_datadir}/anbox/anbox-shell.sh
|
||||||
mkdir -p %{buildroot}%{_bindir}
|
mkdir -p %{buildroot}%{_bindir}
|
||||||
|
@ -142,7 +145,7 @@ mkdir -p %{buildroot}%{_bindir}
|
||||||
ln -s %{_datadir}/anbox/anbox-shell.sh anbox-shell
|
ln -s %{_datadir}/anbox/anbox-shell.sh anbox-shell
|
||||||
ln -s %{_datadir}/anbox/anbox-bridge.sh anbox-bridge
|
ln -s %{_datadir}/anbox/anbox-bridge.sh anbox-bridge
|
||||||
)
|
)
|
||||||
mkdir -p %{buildroot}/var/lib/anbox
|
mkdir -p %{buildroot}/var/lib/anbox/binderfs0
|
||||||
# XXX Is it needed? Added by commit 4b033022eb318, but is not installed.
|
# XXX Is it needed? Added by commit 4b033022eb318, but is not installed.
|
||||||
install -m0644 -D src/anbox/dbus/gps.xml %{buildroot}%{_datadir}/dbus-1/interfaces/org.anbox.Gps.xml
|
install -m0644 -D src/anbox/dbus/gps.xml %{buildroot}%{_datadir}/dbus-1/interfaces/org.anbox.Gps.xml
|
||||||
# The same, do they have to be installed?
|
# The same, do they have to be installed?
|
||||||
|
|
Loading…
Add table
Reference in a new issue