HN 표시: Proroot – Android용 제로 오버헤드 proot 대체
hackernews
|
|
📦 오픈소스
#android
#linux
#proroot
#rootless
#showhn
원문 출처: hackernews · Genesis Park에서 요약 및 분석
요약
루팅 없이 안드로이드 환경에서 glibc 기반의 리눅스 사용자 공간을 구동할 수 있는 'proroot'가 소개되었습니다. 기존 proot 도구가 시스템 콜 호출마다 ptrace를 사용하여 발생시키던 수많은 컨텍스트 스위칭 오버헤드를 `LD_PRELOAD` 방식과 이진 패치(Binary Patching)를 통해 제로(0) 수준으로 획기적으로 줄였습니다. 이를 통해 안드로이드 8.0 이상 기기에서 Node.js, Python, Chromium 등을 매우 빠르고 원활하게 실행할 수 있으며, 소스코드 수정 및 재배포는 제한된 독점 라이선스로 제공됩니다.
본문
__ ____ _________ _________ ____/ /_ / __ \/ ___/ __ \/ ___/ __ \/ __ / __/ / /_/ / / / /_/ / / / /_/ / /_/ / /_ / .___/_/ \____/_/ \____/\__,_/\__/ /_/ Rootless Linux runtime for Android. Run full glibc Linux userspace — Node.js, Python, Git, Chromium — inside Android apps. No root required. A drop-in replacement for proot with zero ptrace overhead. proot intercepts every syscall via ptrace — 2 context switches each time. On a phone running a Node.js server with Chromium, that's millions of wasted cycles. proroot takes a different approach: proot: App ──ptrace──▶ Kernel ──ptrace──▶ Handler ──ptrace──▶ Kernel ──▶ Done ↑ 2 context switches per syscall proroot: App ──LD_PRELOAD──▶ translate() ──SVC──▶ Kernel ──▶ Done ↑ 0 context switches, in-process path translation ┌──────────────────────────────────────────────────────┐ │ Guest Process (Node.js / Chromium / Python / Git) │ │ │ │ ┌────────────────────────────────────────────────┐ │ │ │ libproroot-runtime.so (LD_PRELOAD) │ │ │ │ │ │ │ │ ┌─────────────┐ ┌──────────────────────────┐ │ │ │ │ │ PLT Wrapper │ │ Binary Patching │ │ │ │ │ │ │ │ │ │ │ │ │ │ openat() │ │ svc #0 → bl trampoline │ │ │ │ │ │ stat() │ │ (catches glibc-internal │ │ │ │ │ │ execve() │ │ raw syscalls too) │ │ │ │ │ │ dlopen() │ │ │ │ │ │ │ │ connect() │ └──────────────────────────┘ │ │ │ │ └──────┬──────┘ │ │ │ │ ▼ │ │ │ │ translate_path(guest → host) │ │ │ │ ▼ │ │ │ │ raw_syscall6(SVC #0) ─────────────────────▶ Kernel │ │ │ │ │ │ ┌──────────────────────────────────────────┐ │ │ │ │ │ Signal Handlers │ │ │ │ │ │ SIGSYS → seccomp accept→accept4 │ │ │ │ │ │ SIGTRAP → Chrome BRK → NOP patch │ │ │ │ │ │ SIGILL → NOP fallback → LR return │ │ │ │ │ └──────────────────────────────────────────┘ │ │ │ └────────────────────────────────────────────────┘ │ └──────────────────────────────────────────────────────┘ jniLibs/arm64-v8a/ ├── libproroot.so Launcher (NDK/bionic) ├── libproroot-runtime.so LD_PRELOAD runtime (glibc) ├── libproroot-bridge.so Child exec trampoline (NDK static) └── libldlinux.so glibc dynamic linker (LGPL-2.1) Download all 4 .so files from Releases and place them in jniLibs/arm64-v8a/ . - Android 8.0+ (API 26) - arm64-v8a - Ubuntu arm64 rootfs with glibc libproroot.so -r -w /root --link2symlink /usr/local/bin/node server.js | Variable | Description | |---|---| PROROOT_LIB_PATH | Path to runtime .so (auto-detected) | PROROOT_LINKER_PATH | Path to glibc ld.so (auto-detected) | PROROOT_TRAMPOLINE_PATH | Path to bridge binary (auto-detected) | PROROOT_VERBOSE=1 | Debug logging | PROROOT_GUEST_EXE | Guest path for /proc/self/exe emulation | - Node.js 24 + npm - Python 3.12 - Git 2.43 - Chromium headless_shell 131 (Playwright) - curl, wget, OpenSSL 3.0 Proprietary. Free to use in your projects. Redistribution of modified binaries is not permitted. libldlinux.so is derived from GNU C Library and is licensed under LGPL-2.1.
Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.
공유