Anbox kernel modules
Go to file
Christian Hoff 4af9d5d591 Fix compilation of binder and ashmem on kernel 5.7 and later
On kernel 5.7 and later, kallsyms_lookup_name() can no longer be called from a kernel
module for reasons described here: https://lwn.net/Articles/813350/
As binder really needs to use kallsysms_lookup_name() to access some kernel
functions that otherwise wouldn't be accessible, KProbes are used on later
kernels to get the address of kallsysms_lookup_name(). The function is
afterwards used just as before. This is a very dirty hack though and the much
better solution would be if all the functions that are currently resolved
with kallsysms_lookup_name() would get an EXPORT_SYMBOL() annotation to
make them directly accessible to kernel modules.
2021-03-08 20:19:16 +01:00
ashmem Fix compilation of binder and ashmem on kernel 5.7 and later 2021-03-08 20:19:16 +01:00
binder Fix compilation of binder and ashmem on kernel 5.7 and later 2021-03-08 20:19:16 +01:00
debian Update changelog for release 12 and 13 2018-09-02 13:45:47 +02:00
scripts Update Travis configuration 2019-07-04 19:02:11 +09:00
.travis.yml travis: Add kernel v5.4 2020-01-01 20:29:30 +01:00
99-anbox.rules Import kernel module source from original Anbox repository 2018-06-08 17:20:21 +02:00
INSTALL.sh feat: add script that automates install steps 2020-03-04 10:23:32 +01:00
README.md docs: describe the purpose of the INSTALL.sh 2020-03-04 10:25:36 +01:00
anbox.conf Import kernel module source from original Anbox repository 2018-06-08 17:20:21 +02:00

README.md

Build Status

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.

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).

You can either run ./INSTALL.sh script to automate the installation steps or follow them manually below:

  • First install the configuration files:

    $ sudo cp anbox.conf /etc/modules-load.d/
    $ sudo cp 99-anbox.rules /lib/udev/rules.d/
    
  • Then copy the module sources to /usr/src/:

    $ sudo cp -rT ashmem /usr/src/anbox-ashmem-1
    $ sudo cp -rT binder /usr/src/anbox-binder-1
    
  • Finally use dkms to build and install:

    $ sudo dkms install anbox-ashmem/1
    $ sudo dkms install anbox-binder/1
    

You can verify by loading these modules and checking the created devices:

$ sudo modprobe ashmem_linux
$ sudo modprobe binder_linux
$ lsmod | grep -e ashmem_linux -e binder_linux
$ ls -alh /dev/binder /dev/ashmem

You are expected to see output like:

binder_linux          114688  0
ashmem_linux           16384  0
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