anbox-installer
anbox-installer copied to clipboard
Patch to skip ashmem and binder install if already exists
Simple patch for https://github.com/anbox/anbox/issues/91 I looked out the 'ppa:morphis/anbox-support' ppa and found it used only for dkms modules. So, if those already existst, ppa also can be skipped.
--- anbox-installer.original.sh 2017-04-14 21:35:19.045591097 +0800
+++ anbox-installer.sh 2017-04-14 21:49:36.809415343 +0800
@@ -145,20 +145,24 @@
EOF
fi
-sudo apt install -y software-properties-common linux-headers-generic
-sudo add-apt-repository -y 'ppa:morphis/anbox-support'
-sudo apt update
-sudo apt install -y anbox-modules-dkms
+if [ -c /dev/binder ] && [ -c /dev/ashmem ]; then
+ echo "Android binder and ashmem seems to be already enabled in kernel.";
+else
+ sudo apt install -y software-properties-common linux-headers-generic
+ sudo add-apt-repository -y 'ppa:morphis/anbox-support'
+ sudo apt update
+ sudo apt install -y anbox-modules-dkms
-if [ ! -e /etc/modules-load.d/anbox.conf ]; then
- sudo tee /etc/modules-load.d/anbox.conf &>/dev/null <<EOF
+ if [ ! -e /etc/modules-load.d/anbox.conf ]; then
+ sudo tee /etc/modules-load.d/anbox.conf &>/dev/null <<EOF
ashmem_linux
binder_linux
EOF
-fi
+ fi
-sudo modprobe binder_linux
-sudo modprobe ashmem_linux
+ sudo modprobe binder_linux
+ sudo modprobe ashmem_linux
+fi
if snap info anbox | grep -q "installed:" ; then
sudo snap refresh --edge anbox || true
Can you propose this as a proper PR?
I think this bug can be closed