Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4af9d5d
Fix compilation of binder and ashmem on kernel 5.7 and later
choff Mar 8, 2021
443f984
Compile fixes for kernel >= 5.8
choff Mar 8, 2021
6ddae19
Another compile fix for kernel >= 5.8
choff Mar 8, 2021
0338a34
Update binder to the latest version
choff Sep 26, 2021
516144c
Compile fixes for kernels 5.11, 5.12 & 5.13
choff Oct 29, 2021
b0c3c5a
compilation fix for kernel 5.15.2
modscleo4 Nov 13, 2021
8148a16
sync with android binder.c
modscleo4 Nov 23, 2021
2699623
patches for 5.18 kernel
Etaash-mathamsetty May 25, 2022
6844495
Patches for kernel 5.19
Thesola10 Aug 8, 2022
2325d6f
Fixed page fault by matching in-tree binder behavior
Thesola10 Aug 9, 2022
cd66055
Fix build on 6.0 kernel
arenekosreal Oct 15, 2022
42335c6
Fix build on 6.1 kernel
arenekosreal Dec 24, 2022
ab8278c
Add TASK_FREEZABLE
arenekosreal Jan 29, 2023
a961389
fix for kernel 6.1
munix9 Jan 30, 2023
ae26ba2
Create UNINSTALL.sh script and update README.md
SonarBeserk Oct 30, 2022
44dc351
Update README.md
Krishnakumar59 Apr 18, 2023
abead1d
Fixes for kernel 6.3+
Thesola10 May 5, 2023
205c803
Fix build for kernel 6.6
arenekosreal Nov 1, 2023
41fe6db
Fix build for 6.6
Nov 23, 2023
084d199
Added conditional matching for kernels >= 6.3.0
Dec 3, 2023
13a93a4
Fix for kernel 6.7+
ssfdust Jan 6, 2024
44e5ba7
Fixes for kernel 6.8
ssfdust Jan 24, 2024
b558310
removed obsolete name="%k", added binder symlink (#1)
PuspenduBanerjee Apr 1, 2024
dcd52bf
Added packaging guide and compat fix
PuspenduBanerjee Apr 2, 2024
2c06452
updated doc to update changelog from git commits
PuspenduBanerjee Apr 2, 2024
ee4c25f
fix creation of all 3 anbox modules symlinks: anbox-binder anbox-hwbi…
May 26, 2024
355b6d8
Fix for kernel 6.13+
llyyr Mar 4, 2025
2da60cf
Fix for kernel 6.14+
llyyr Mar 4, 2025
7e31e5d
Remove ashmem
llyyr Mar 5, 2025
1434f1e
fix for kernel 6.16
munix9 Aug 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.ko
*.mod
*.mod.c
*.o
*.order
*.symvers
*.swp
.*.cmd
.tmp_versions
3 changes: 1 addition & 2 deletions 99-anbox.rules
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
KERNEL=="ashmem", NAME="%k", MODE="0666"
KERNEL=="binder*", NAME="%k", MODE="0666"
KERNEL=="*binder", MODE="0666", SYMLINK+="anbox-%k"
11 changes: 4 additions & 7 deletions INSTALL.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@
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
# Then copy the module source to /usr/src/:
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

# Verify by loading these modules and checking the created devices:
sudo modprobe ashmem_linux
# Verify by loading the module and checking the created device:
sudo modprobe binder_linux
lsmod | grep -e ashmem_linux -e binder_linux
ls -alh /dev/binder /dev/ashmem
lsmod | grep -e binder_linux
ls -alh /dev/binder
76 changes: 58 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[![Build Status](https://travis-ci.org/anbox/anbox-modules.svg?branch=master)](https://travis-ci.org/anbox/anbox-modules)
# Anbox Kernel Module

# Anbox Kernel Modules

This repository contains the kernel modules necessary to run the Anbox
This repository contains the kernel module 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.

Expand All @@ -22,38 +20,80 @@ You can either run `./INSTALL.sh` script to automate the installation steps or f
* First install the configuration files:

```
$ sudo cp anbox.conf /etc/modules-load.d/
$ sudo cp 99-anbox.rules /lib/udev/rules.d/
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
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
sudo dkms install anbox-binder/1
```

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

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

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
```
```

# 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 module:

```
sudo dkms remove anbox-binder/1
```

* Then remove the module sources from /usr/src/:

```
sudo rm -rf /usr/src/anbox-binder-1
```

* Finally remove the configuration files:

```
sudo rm -f /etc/modules-load.d/anbox.conf
sudo rm -f /lib/udev/rules.d/99-anbox.rules
```

You must then restart your device. You can then verify module was removed by trying to load the module and checking the created device:

```
sudo modprobe binder_linux
lsmod | grep -e binder_linux
ls -alh /dev/binder
```

You are expected to see output like:

```
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
```

# Packaging:
## Debian/Ubuntu:
```
sudo apt-get install devscripts dh-dkms -y
git log --pretty=" -%an<%ae>:%aI - %s" > ./debian/changelog
debuild -i -us -uc -b
ls -lrt ../anbox-modules-dkms_*.deb
```
37 changes: 37 additions & 0 deletions UNINSTALL.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash

# First use dkms to remove the module:
sudo dkms remove anbox-binder/1

# Then remove the module sources from /usr/src/:
sudo rm -rf /usr/src/anbox-binder-1

# Finally remove the configuration files:
sudo rm -f /etc/modules-load.d/anbox.conf
sudo rm -f /lib/udev/rules.d/99-anbox.rules

# Verify remove by trying to load the modules and checking the created devices:
failed_checks=0
if sudo modprobe binder_linux > /dev/null 2>&1; then
failed_checks=1
else
failed_checks=0
fi

if lsmod | grep -e binder_linux > /dev/null 2>&1; then
failed_checks=1
else
failed_checks=0
fi

if ls -alh /dev/binder > /dev/null 2>&1; then
failed_checks=1
else
failed_checks=0
fi

if [ $failed_checks == 1 ]; then
echo "Please restart your device and rerun this script to verify changes"
else
echo "Modules not installed"
fi
1 change: 0 additions & 1 deletion anbox.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
ashmem_linux
binder_linux
18 changes: 0 additions & 18 deletions ashmem/Makefile

This file was deleted.

Loading