User:Dinominant/Gentoo on Android

Gentoo on Android
A common saying is the best camera is the one with you so therefore the best computer for Gentoo is the one with you. That is most likely your Android cell phone. Unfortunately most Android phones are locked in various ways and have further security/business policies which limit access/usability/repairability for users. This renders a typical installation via the Gentoo Handbook impossible.

As a software developer, special tools exist and additional access is required to debug and install software on Android. This will be used to deploy Gentoo allowing it for use as a development environment and other workflows.

Gentoo Linux can be installed on an updated and non-rooted Android device.

Prerequisites

 * A Linux host computer, preferably Gentoo Linux
 * QEMU
 * Android Studio
 * An Android cell phone (root access is not required). The Apple App Store explicitly bans emulators, so all Apple iOS devices are insufficient.

Host Computer Setup
The host computer will be used to prepare the aarch64 virtual machine since it is much faster than compilation on an actual cell phone. Then it will be transferred to the phone via adb.


 * 1) Setup QEmu on your computer.
 * 2) Hardware acceleration for guest virtual machines is not required.
 * 3) /etc/portage/package.use/qemu

Create the Virtual Machine

 * 1) This step is mostly automated and requires lots of time to compile software.
 * 2) Verify your host system has enough free space and sufficient power to complete this task
 * 3) It may take several days to compile everything.
 * 4) https://github.com/nathanshearer/gentooinstall
 * 5) https://github.com/nathanshearer/kernelseeds
 * 6) This step is important and will enable virtio and plan9 support. virio improves performance and plan9 allows guest VM read+write access to the Android host directories.
 * 7) emerge a kernel such as sys-kernel/gentoo-sources or sys-kernel/vanilla-sources
 * 8) Use an existing kernel config such as 5.4.109-aarch64 or generate a new one with
 * 9) Compile the kernel:
 * 1) Use an existing kernel config such as 5.4.109-aarch64 or generate a new one with
 * 2) Compile the kernel:

Upload and Start Gentoo

 * 1) Push files to /data/local/tmp
 * 2) adb shell into the phone and start the virtual machine!