refine doc
This commit is contained in:
59
README.md
59
README.md
@@ -1,8 +1,8 @@
|
|||||||
English | [简体中文](zh/)
|
English | [简体中文](zh/)
|
||||||
|
|
||||||
# ReDroid
|
# ReDroid
|
||||||
**ReDroid** (Remote Android) is a GPU accelerated AIC (Android In Container) solution. You can boot many
|
**ReDroid** (*Re*mote an*Droid*) is a GPU accelerated AIC (Android In Container) solution. You can boot many
|
||||||
instances in Linux host or any Linux container envrionments (`Docker`, `K8S`, `LXC` etc.).
|
instances in Linux host (`Docker`, `K8S` etc.).
|
||||||
*ReDroid* supports both arm64 and amd64 architectures. You can connect to *ReDroid* througth
|
*ReDroid* supports both arm64 and amd64 architectures. You can connect to *ReDroid* througth
|
||||||
`scrcpy` or `adb shell`. *ReDroid* is suitable for Cloud Gaming, VDI / VMI (Virtual Mobile Infurstrure),
|
`scrcpy` or `adb shell`. *ReDroid* is suitable for Cloud Gaming, VDI / VMI (Virtual Mobile Infurstrure),
|
||||||
Automation Test and more.
|
Automation Test and more.
|
||||||
@@ -22,38 +22,44 @@ Tested Platforms:
|
|||||||
- Alibaba Cloud Linux 2 (amd64)
|
- Alibaba Cloud Linux 2 (amd64)
|
||||||
- Alibaba Cloud Linux 3 (amd64 / arm64) with `podman-docker`
|
- Alibaba Cloud Linux 3 (amd64 / arm64) with `podman-docker`
|
||||||
- WSL 2 (Ubuntu) (amd64)
|
- WSL 2 (Ubuntu) (amd64)
|
||||||
|
- CentOS (amd64*, arm64*)
|
||||||
|
- OpenEuler 20.03 (amd64, arm64*)
|
||||||
|
|
||||||
|
\* means need customized kernel
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
*ReDroid* runs on modern linux (kernel 4.14+), and require some Android specific modules (binder, ashmem etc.)
|
*ReDroid* runs on modern linux (kernel 4.14+), and require some Android specific modules (binder, ashmem etc.)
|
||||||
check [kernel modules](https://github.com/remote-android/redroid-modules) to install these required kernel modules.
|
check [kernel modules](https://github.com/remote-android/redroid-modules) to install these required kernel modules.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# start and connect via `scrcpy` (Performance boost, *recommended*)
|
# start and connect via `scrcpy`
|
||||||
docker run -itd --rm --memory-swappiness=0 --privileged \
|
docker run -itd --rm --memory-swappiness=0 --privileged \
|
||||||
-v ~/data:/data \
|
--pull always \
|
||||||
-p 5555:5555 \
|
-v ~/data:/data \
|
||||||
redroid/redroid:10.0.0-latest
|
-p 5555:5555 \
|
||||||
|
redroid/redroid:9.0.0-latest
|
||||||
|
|
||||||
adb connect <IP>:5555
|
adb connect <IP>:5555
|
||||||
scrcpy --serial <IP>:5555
|
scrcpy --serial <IP>:5555
|
||||||
|
|
||||||
## explains:
|
## explains:
|
||||||
|
## --pull always -- be sure to use the latest image
|
||||||
## -v ~/data:/data -- mount data partition
|
## -v ~/data:/data -- mount data partition
|
||||||
## -p 5555:5555 -- 5555 for adb connect, you can run `adb connect <IP>`
|
## -p 5555:5555 -- 5555 for adb connect, you can run `adb connect <IP>`
|
||||||
|
|
||||||
# start with VNC support (rebuild with `vncserver` module)
|
# start with VNC support (NEED rebuild with `vncserver` module)
|
||||||
docker run -itd --rm --memory-swappiness=0 --privileged \
|
docker run -itd --rm --memory-swappiness=0 --privileged \
|
||||||
-v ~/data:/data \
|
-v ~/data:/data \
|
||||||
-p 5900:5900 -p 5555:5555 \
|
-p 5900:5900 -p 5555:5555 \
|
||||||
<image> redroid.vncserver=1
|
<image> redroid.vncserver=1
|
||||||
|
|
||||||
## explains:
|
## explains:
|
||||||
## -p 5900:5900 -- 5900 for VNC connect, you can connect via VncViewer with <IP>:5900
|
## -p 5900:5900 -- connect by VncViewer via <IP>:5900
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Start Params
|
## Start Params
|
||||||
required params (already added in image args)
|
required params (already added in docker image)
|
||||||
- qemu=1
|
- qemu=1
|
||||||
- androidboot.hardware=redroid
|
- androidboot.hardware=redroid
|
||||||
|
|
||||||
@@ -62,30 +68,38 @@ display params
|
|||||||
- redroid.height=1280
|
- redroid.height=1280
|
||||||
- redroid.fps=15
|
- redroid.fps=15
|
||||||
- ro.sf.lcd_density=320
|
- ro.sf.lcd_density=320
|
||||||
|
- redroid.enable_built_in_display=[0|1]
|
||||||
VNC server
|
- redroid.overlayfs=[0|1]
|
||||||
- redroid.vncserver=[0|1]
|
|
||||||
|
|
||||||
GPU accelerating
|
GPU accelerating
|
||||||
*ReDroid* use mesa3d to accelerate 3D rendering.
|
*ReDroid* use mesa3d to accelerate 3D rendering.
|
||||||
|
Currently tested paltforms:
|
||||||
|
- AMD (arm64, amd64 with `amdgpu` driver)
|
||||||
|
- Intel (amd64 with `i915` driver)
|
||||||
|
- virtio-gpu (vendor agnostic, arm64 and amd64)
|
||||||
|
|
||||||
|
params:
|
||||||
|
- redroid.gpu.mode=[auto|host|guest]
|
||||||
|
- redroid.gpu.node=[/dev/dri/renderDxxx]
|
||||||
- qemu.gles.vendor=mesa
|
- qemu.gles.vendor=mesa
|
||||||
- ro.hardware.gralloc=gbm
|
- ro.hardware.gralloc=gbm
|
||||||
|
|
||||||
|
VNC server (NEED rebuild with `vncserver` module)
|
||||||
|
- redroid.vncserver=[0|1]
|
||||||
|
|
||||||
Virtual WiFi (Experiment in ReDroid 10, *build broken, fix soon*)
|
Virtual WiFi (Experiment in ReDroid 10, *build broken, fix soon*)
|
||||||
- ro.kernel.qemu.wifi=1
|
- ro.kernel.qemu.wifi=1
|
||||||
Virtual WiFi is still under development, make sure `mac80211_hwsim` exist (`modprobe mac80211_hwsim`).
|
Virtual WiFi is still under development, make sure `mac80211_hwsim` exist (`modprobe mac80211_hwsim`).
|
||||||
checkout `redroid-10-wifi` in `vendor/redroid` and `redroid-10.0.0` in `device/generic/goldfish` to make
|
checkout `redroid-10-wifi` in `vendor/redroid` and `redroid-10.0.0` in `device/generic/goldfish` to make
|
||||||
your build. run `docker exec <container> ip r add default via 192.168.232.1 dev wlan0`
|
your build. run `docker exec <container> ip r add default via 192.168.232.1 dev wlan0`
|
||||||
|
|
||||||
you can override system props prefixed with `qemu.` or `ro.`. for example, you can set `ro.secure=0`, then
|
NOTE: you can override system props prefixed with `qemu.` or `ro.`. for example, you can set `ro.secure=0`, then
|
||||||
you can get root adb shell by default.
|
you can get root adb shell by default.
|
||||||
|
|
||||||
## Deployment
|
## Deployment
|
||||||
*ReDroid* support different deploy methods, check [Deploy](./deploy.md) for more details.
|
*ReDroid* support different deploy methods, check [Deploy](./deploy.md) for more details.
|
||||||
- Docker
|
- Docker (podman)
|
||||||
- K8S
|
- K8S
|
||||||
- virsh-lxc / lxd (Planned)
|
|
||||||
- kata-runtime (microVM, Planned)
|
|
||||||
- Package Manager (Planned)
|
- Package Manager (Planned)
|
||||||
|
|
||||||
## Native Bridge
|
## Native Bridge
|
||||||
@@ -121,10 +135,11 @@ Contributing is always welcome (especially the `HAL` part). check [Contributing]
|
|||||||
|
|
||||||
## Workarounds
|
## Workarounds
|
||||||
- Kernel 5.7+, need enable `binderfs` / `ashmem`
|
- Kernel 5.7+, need enable `binderfs` / `ashmem`
|
||||||
|
- `redroid` require `pid_max` less than 65535, or else may run into problems. Change in host OS, or add `pid_max` separation support in PID namespace
|
||||||
- SElinux is disabled in *ReDroid*; possible enabled with [selinuxns POC](http://namei.org/presentations/selinux_namespacing_lca2018.pdf)
|
- SElinux is disabled in *ReDroid*; possible enabled with [selinuxns POC](http://namei.org/presentations/selinux_namespacing_lca2018.pdf)
|
||||||
- sdcardfs currently not implemented, use `fuse` instead; may need run `modprobe fuse` first in some OS (AmazonLinux2?)
|
- sdcardfs currently not implemented, use `fuse` instead; may need run `modprobe fuse` first in some OS (AmazonLinux2 ?)
|
||||||
- CGroups errors ignored; some cgroups path not same with generic linux, and some (`stune` for example) not supported
|
- CGroups errors ignored; some (`stune` for example) not supported in generic linux.
|
||||||
- `procfs` not fully seperated with host OS; community use `lxcfs` and some cloud vendor ([TencentOS](https://github.com/Tencent/TencentOS-kernel)) enhanced in their own kernel.
|
- `procfs` not fully seperated with host OS; Community use `lxcfs` and some cloud vendor ([TencentOS](https://github.com/Tencent/TencentOS-kernel)) enhanced in their own kernel.
|
||||||
- vintf verify disabled (since no kernel)
|
- vintf verify disabled (since no kernel)
|
||||||
|
|
||||||
## Contacts
|
## Contacts
|
||||||
|
|||||||
14
build.md
14
build.md
@@ -1,8 +1,8 @@
|
|||||||
# Build ReDroid
|
# Build ReDroid
|
||||||
|
|
||||||
## Get Source
|
## Get Source
|
||||||
- `repo init -u git@github.com:remote-android/platform_manifests.git -b [BRANCH] && repo sync -c`
|
- `repo init -u git@github.com:remote-android/platform_manifests.git -b [BRANCH] --depth=1 && repo sync -c`
|
||||||
BRANCH could be redroid-8.1.0, redroid-9.0.0, redroid-10.0.0, redroid-11.0.0 ...
|
BRANCH could be redroid-8.1.0, redroid-9.0.0, redroid-10.0.0, redroid-11.0.0 etc.
|
||||||
|
|
||||||
## Build
|
## Build
|
||||||
suggest build with [docker](./docker)
|
suggest build with [docker](./docker)
|
||||||
@@ -19,8 +19,8 @@ project prebuilts/clang/host/linux-x86/ (*** NO BRANCH ***)
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Run
|
## Run
|
||||||
1. `export BUILD_OUT=~/redroid_out`
|
1. create rootfs only image (Dev purpose): `cd $BUILD_OUT && sudo tar --xattrs -c -C root . | docker import -c 'ENTRYPOINT ["/init", "qemu=1", "androidboot.hardware=redroid"]' - redroid-dev`
|
||||||
2. create rootfs only image (Dev purpose): `cd $BUILD_OUT && sudo tar --xattrs -c -C root . | docker import -c 'ENTRYPOINT ["/init", "qemu=1", "androidboot.hardware=redroid"]' - redroid-dev`
|
2. run with rootfs only image: `docker run -v ~/data:/data -itd -p 5555:5555 --rm --memory-swappiness=0 --privileged -v $BUILD_OUT/system:/system -v $BUILD_OUT/vendor:/vendor redroid-dev`
|
||||||
3. run with rootfs only image: `docker run -v ~/data:/data -itd -p 5900:5900 -p 5555:5555 --rm --memory-swappiness=0 --privileged -v $BUILD_OUT/redroid_x86_64/system:/system -v $BUILD_OUT/redroid_x86_64/vendor:/vendor redroid-dev`
|
3. create full image: `cd $BUILD_OUT && sudo tar --xattrs -c system vendor -C root --exclude="system" --exclude="vendor" . | docker import -c 'ENTRYPOINT ["/init", "qemu=1", "androidboot.hardware=redroid"]' - redroid`
|
||||||
4. create full image: `cd $BUILD_OUT && sudo tar --xattrs -c system vendor -C root --exclude="system" --exclude="vendor" . | docker import -c 'ENTRYPOINT ["/init", "qemu=1", "androidboot.hardware=redroid"]' - redroid`
|
4. run with full image: `docker run -v ~/data:/data -itd -p 5555:5555 --rm --memory-swappiness=0 --privileged redroid`
|
||||||
5. run with full image: `docker run -v ~/data:/data -itd -p 5900:5900 -p 5555:5555 --rm --memory-swappiness=0 --privileged redroid`
|
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
# Contributing
|
# Contributing
|
||||||
|
|
||||||
|
TBD
|
||||||
|
|||||||
@@ -8,5 +8,6 @@ build *ReDroid*:
|
|||||||
- `lunch`
|
- `lunch`
|
||||||
- `m`
|
- `m`
|
||||||
|
|
||||||
sync build (required)
|
sync build (fix file owner / permission etc.)
|
||||||
- `export BUILD_OUT=~/redroid_out && ./sync.sh` (pasword same as `id -un`)
|
- `export BUILD_OUT=~/redroid_out && cd vendor/redroid && ./sync.sh` (pasword same as `id -un`)
|
||||||
|
|
||||||
|
|||||||
@@ -33,3 +33,4 @@ find /system \( -name 'libndk_translation*' -o -name '*arm*' -o -name 'ndk_trans
|
|||||||
Example: Patch libndk_translation in ReDroid 11
|
Example: Patch libndk_translation in ReDroid 11
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user