diff --git a/android/README.md b/android/README.md new file mode 100644 index 0000000..6daf420 --- /dev/null +++ b/android/README.md @@ -0,0 +1,23 @@ +# Android / Termux + +Flow's Android VM path boots the same pinned Tiny Core CorePure64 guest used by normal `flow-kernel` QEMU runs. Android is only the QEMU host; there is no bootloader replacement, Android kernel modification, root requirement, or separate Flow kernel architecture. + +This path requires a 64-bit Termux installation. The current canonical guest is x86_64 CorePure64 and therefore runs through QEMU TCG on ARM64 Android. A native ARM64 guest should only be added when the canonical Tiny Core substrate and Flow target support it rather than creating a phone-only fork. + +From the repository root in Termux: + +```sh +bash android/setup-termux.sh +bash android/run.sh +``` + +`android/setup-termux.sh` enables the Termux X11 repository and installs the maintained `qemu-system-x86-64` package plus the tools used by `tinycore/fetch.sh`. `android/run.sh` then delegates directly to `tinycore/run.sh`, so image pinning, checksum verification, serial console behaviour, RAM configuration, and kernel command-line overrides stay identical to the normal Flow kernel path. + +The Tiny Core artifacts are cached under `build/tinycore` by default. Pass another build directory as the first argument to `android/run.sh` if needed. + +Useful overrides are the same as the canonical runner: + +```sh +FLOW_KERNEL_RAM=512M bash android/run.sh +FLOW_KERNEL_CMDLINE="debug" bash android/run.sh +``` diff --git a/android/run.sh b/android/run.sh new file mode 100644 index 0000000..e214720 --- /dev/null +++ b/android/run.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +BUILD="${1:-$ROOT/build/tinycore}" + +if ! command -v qemu-system-x86_64 >/dev/null 2>&1; then + echo "qemu-system-x86_64 is required. Run: bash android/setup-termux.sh" >&2 + exit 1 +fi + +export FLOW_KERNEL_RAM="${FLOW_KERNEL_RAM:-256M}" +exec bash "$ROOT/tinycore/run.sh" "$BUILD" diff --git a/android/setup-termux.sh b/android/setup-termux.sh new file mode 100644 index 0000000..b5a93b1 --- /dev/null +++ b/android/setup-termux.sh @@ -0,0 +1,31 @@ +#!/data/data/com.termux/files/usr/bin/bash +set -euo pipefail + +if [[ -z "${PREFIX:-}" || "$PREFIX" != *com.termux* ]]; then + echo "This setup script must run inside Termux." >&2 + exit 1 +fi + +arch="$(dpkg --print-architecture)" +case "$arch" in + aarch64|amd64) + ;; + *) + echo "flow-kernel Android VM support requires 64-bit Termux; got architecture: $arch" >&2 + exit 1 + ;; +esac + +pkg update -y +pkg install -y x11-repo +pkg install -y curl coreutils qemu-system-x86-64 + +for command_name in curl md5sum qemu-system-x86_64; do + if ! command -v "$command_name" >/dev/null 2>&1; then + echo "Termux setup completed but required command is missing: $command_name" >&2 + exit 1 + fi +done + +echo "Termux QEMU environment is ready." +echo "Run: bash android/run.sh"