2018-06-09 15:35:18 +08:00
|
|
|
[![Build Status](https://travis-ci.org/anbox/anbox-modules.svg?branch=master)](https://travis-ci.org/anbox/anbox-modules)
|
2018-06-08 23:29:53 +08:00
|
|
|
|
2018-06-08 23:17:43 +08:00
|
|
|
# Anbox Kernel Modules
|
|
|
|
|
|
|
|
This repository contains the kernel modules necessary to run the Anbox
|
|
|
|
Android container runtime. They're split out of the original Anbox
|
|
|
|
repository to make packaging in various Linux distributions easier.
|
2018-06-22 20:56:45 +08:00
|
|
|
|
|
|
|
# Install Instruction
|
|
|
|
|
|
|
|
You need to have `dkms` and linux-headers on your system. You can install them by
|
|
|
|
`sudo apt install dkms` or `sudo yum install dkms` (`dkms` is available in epel repo
|
|
|
|
for CentOS).
|
|
|
|
|
|
|
|
Package name for linux-headers varies on different distributions, e.g.
|
|
|
|
`linux-headers-generic` (Ubuntu), `linux-headers-amd64` (Debian),
|
|
|
|
`kernel-devel` (CentOS, Fedora), `kernel-default-devel` (openSUSE).
|
|
|
|
|
2020-03-04 17:25:36 +08:00
|
|
|
|
|
|
|
You can either run `./INSTALL.sh` script to automate the installation steps or follow them manually below:
|
|
|
|
|
2018-06-22 20:56:45 +08:00
|
|
|
* First install the configuration files:
|
|
|
|
|
|
|
|
```
|
2023-04-18 13:46:36 +08:00
|
|
|
sudo cp anbox.conf /etc/modules-load.d/
|
|
|
|
sudo cp 99-anbox.rules /lib/udev/rules.d/
|
2018-06-22 20:56:45 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
* Then copy the module sources to `/usr/src/`:
|
|
|
|
|
|
|
|
```
|
2023-04-18 13:46:36 +08:00
|
|
|
sudo cp -rT ashmem /usr/src/anbox-ashmem-1
|
|
|
|
sudo cp -rT binder /usr/src/anbox-binder-1
|
2018-06-22 20:56:45 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
* Finally use `dkms` to build and install:
|
|
|
|
|
|
|
|
```
|
2023-04-18 13:46:36 +08:00
|
|
|
sudo dkms install anbox-ashmem/1
|
|
|
|
sudo dkms install anbox-binder/1
|
2018-06-22 20:56:45 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
You can verify by loading these modules and checking the created devices:
|
|
|
|
|
|
|
|
```
|
2023-04-18 13:46:36 +08:00
|
|
|
sudo modprobe ashmem_linux
|
|
|
|
sudo modprobe binder_linux
|
|
|
|
lsmod | grep -e ashmem_linux -e binder_linux
|
|
|
|
ls -alh /dev/binder /dev/ashmem
|
2018-06-22 20:56:45 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
You are expected to see output like:
|
|
|
|
|
|
|
|
```
|
2018-07-12 21:38:08 +08:00
|
|
|
binder_linux 114688 0
|
|
|
|
ashmem_linux 16384 0
|
2018-06-22 20:56:45 +08:00
|
|
|
crw-rw-rw- 1 root root 10, 55 Jun 19 16:30 /dev/ashmem
|
|
|
|
crw-rw-rw- 1 root root 511, 0 Jun 19 16:30 /dev/binder
|
2022-10-30 13:07:38 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
# Uninstall Instructions
|
|
|
|
|
|
|
|
ou can either run `./UNINSTALL.sh` script to automate the installation steps or follow them manually below:
|
|
|
|
|
|
|
|
* First use dkms to remove the modules:
|
|
|
|
|
|
|
|
```
|
2023-04-18 13:46:36 +08:00
|
|
|
sudo dkms remove anbox-ashmem/1
|
|
|
|
sudo dkms remove anbox-binder/1
|
2022-10-30 13:07:38 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
* Then remove the module sources from /usr/src/:
|
|
|
|
|
|
|
|
```
|
2023-04-18 13:46:36 +08:00
|
|
|
sudo rm -rf /usr/src/anbox-ashmem-1
|
|
|
|
sudo rm -rf /usr/src/anbox-binder-1
|
2022-10-30 13:07:38 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
* Finally remove the configuration files:
|
|
|
|
|
|
|
|
```
|
2023-04-18 13:46:36 +08:00
|
|
|
sudo rm -f /etc/modules-load.d/anbox.conf
|
|
|
|
sudo rm -f /lib/udev/rules.d/99-anbox.rules
|
2022-10-30 13:07:38 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
You must then restart your device. You can then verify modules were removed by trying to load the modules and checking the created devices:
|
|
|
|
|
|
|
|
```
|
2023-04-18 13:46:36 +08:00
|
|
|
sudo modprobe ashmem_linux
|
|
|
|
sudo modprobe binder_linux
|
|
|
|
lsmod | grep -e ashmem_linux -e binder_linux
|
|
|
|
ls -alh /dev/binder /dev/ashmem
|
2022-10-30 13:07:38 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
You are expected to see output like:
|
|
|
|
|
|
|
|
```
|
|
|
|
modprobe: FATAL: Module ashmem_linux not found in directory /lib/modules/6.0.2-76060002-generic
|
|
|
|
modprobe: FATAL: Module binder_linux not found in directory /lib/modules/6.0.2-76060002-generic
|
|
|
|
ls: cannot access '/dev/binder': No such file or directory
|
|
|
|
ls: cannot access '/dev/ashmem': No such file or directory
|
2023-04-18 13:46:36 +08:00
|
|
|
```
|