Coder Social home page Coder Social logo

redroid-modules's Introduction

English | 简体中文

ReDroid Kernel Modules

This repository contains the kernel modules necessary to run ReDroid instances.

Currently, 4.14+ kernel is supported. Many Linux distributions already meet this requirement (Ubuntu 16.04+, AmazonLinux 2, Alibaba Cloud Linux 2 etc.). If you are using customized kernel, make sure the corresponding kernel headers are present in your system.

for kernel >= 5.7, please install either by building customized kernel or modprobe (Ubuntu etc.)

Build & Deploy

Manual

# Ubuntu 16.04 / 18.04 / 20.04
sudo apt-get install -y git kmod make gcc linux-headers-`uname -r`
sudo make # build kernel modules
sudo make install # build and install *unsigned* kernel modules

# Ubuntu 20.04+ (kernel 5.0+)
sudo modprobe ashmem_linux
sudo modprobe binder_linux devices=binder,hwbinder,vndbinder

# AmazonLinux2
git checkout origin/amazonlinux2
sudo yum install git kmod make "kernel-devel-uname-r == `uname -r`"
sudo make # build kernel modules
sudo make install # build and install *unsigned* kernel modules

# Alibaba Cloud Linux 2
git checkout origin/alibabalinux2
sudo yum install git kmod make "kernel-devel-uname-r == `uname -r`"
sudo make # build kernel modules
sudo make install # build and install *unsigned* kernel modules

# Alibaba Cloud Linux 3
git checkout origin/alibabalinux3
sudo yum install git kmod make "kernel-devel-uname-r == `uname -r`"
sudo make # build kernel modules
sudo make install # build and install *unsigned* kernel modules

# openEuler 20.03 / kernel 4.19
git checkout origin/openeuler2003
sudo yum install gcc kernel-devel
sudo KDIR=/usr/src/kernels/<VER> make install

# check modules status
lsmod | grep -e ashmem_linux -e binder_linux
# example output:
# binder_linux          147456  79
# ashmem_linux           16384  23

# we can also check like this
grep binder /proc/filesystems # output should like: nodev	binder
grep ashmem /proc/misc # output should like: 56 ashmem

Please refer the related docs if you want to sign these kernel modules.

DKMS

DKMS can help to automatically build and deploy kernel modules if kernel upgraded. 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.

Package name for linux-headers varies on different distributions, e.g. linux-headers-generic (Ubuntu), kernel-devel (AmazonLinux2)

# prepare config files
cp redroid.conf /etc/modules-load.d/ # auto load kernel modules after system boot
cp 99-redroid.rules /lib/udev/rules.d/ # change device node permissions

# prepare kernel modules source
cp -rT ashmem /usr/src/redroid-ashmem-1
cp -rT binder /usr/src/redroid-binder-1

# install via dkms
dkms install redroid-ashmem/1
dkms install redroid-binder/1

Docker

It's possible to make a script, add install these kernel moduels by docker

docker run --rm --cap-add CAP_SYS_MODULE --entrypoint /bin/bash NODE_OS -c "`curl -s <link>`"
# for example, if you are running under ubuntu 18.04, please change NODE_OS to *ubunut:18.04*

K8S

create overlay of your node OS, see deploy/k8s/overlays/ubuntu1804 as an example. then run kubectl apply -k <YOUR_OVERLAY_PATH>

Custom Kernel

If use custom kernel (5.0+), you can enable binderfs and ashmem configs; So the kernel modules in this repo are not needed any more.

redroid-modules's People

Contributors

zhouziyang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.