Skip to content

chore: bake rootAVD and use tar.gz storage for addon payloads#52

Merged
Shmayro merged 1 commit into
mainfrom
bake-rootavd-and-tarball-storage
May 29, 2026
Merged

chore: bake rootAVD and use tar.gz storage for addon payloads#52
Shmayro merged 1 commit into
mainfrom
bake-rootavd-and-tarball-storage

Conversation

@Shmayro
Copy link
Copy Markdown
Owner

@Shmayro Shmayro commented May 29, 2026

Drops the runtime git clone https://gitlab.com/newbit/rootAVD.git from install_root — the last external download in the rooting flow. While at it, switches ndk_translation from pre-extracted to the same shape so both addons store their upstream tar.gz verbatim at /opt/<name>.tar.gz and the install code extracts on demand.

Changes

Dockerfile

  • Replace the previous wget + tar -xzf -C /opt/ndk-translation with just wget -q -O /opt/ndk-translation.tar.gz — no build-time extraction.
  • New step that does the same for rootAVD: wget -q -O /opt/rootavd.tar.gz from gitlab.com/newbit/rootAVD.

first-boot.sh

  • install_root: drop git clone, extract /opt/rootavd.tar.gz to /tmp/rootavd with --strip-components=1, pushd /tmp/rootavd, run rootAVD.sh + Magisk env bootstrap there, rm -rf /tmp/rootavd at the end.
  • install_arm_translation wrapper: extract /opt/ndk-translation.tar.gz to /tmp/ndk-translation (with --strip-components=2 --wildcards '*/prebuilts/*' to flatten the github archive structure), call the appropriate _system or _magisk_module branch, clean up.
  • install_gapps: stage under /tmp/gapps/ instead of cwd-relative gapps-11/ — same pattern as the other two.
  • install_arm_translation_{system,magisk_module} and install_gapps_{system,magisk_module} now reference /tmp/<name>/... consistently.

Result

  • No runtime gitlab.com dependency for rooting (previously a full-history git clone ~84.7 MB → now a build-time ~12 MB tar.gz, Docker-layer-cached).
  • ~26 MB smaller image disk footprint after pull (/opt holds compressed .tar.gz instead of decompressed trees).
  • Lazy work: an addon that isn't enabled never gets extracted.
  • Symmetric install layout: install_root, install_arm_translation, and install_gapps all stage their payload under /tmp/<name>/.

Verified

Fresh tmp data dir, ROOT_SETUP=GAPPS_SETUP=ARM_TRANSLATION=1:

  • All four markers land
  • /data/adb/modules/ contains gapps + ndk_translation
  • adb shell getprop ro.product.cpu.abilistx86_64,x86,arm64-v8a,armeabi-v7a,armeabi
  • Google services visible at /system/priv-app/ (via Magisk overlay)
  • adb install /extras/v2rayNG_2.1.7_arm64-v8a.apk → Success

Drop the runtime `git clone https://gitlab.com/newbit/rootAVD.git` (the
last remaining external download for the rooting flow). The rootAVD
repo (rootAVD.sh + bundled Magisk.zip) is now downloaded as a tarball
at image build time. While at it, switch the existing ndk_translation
bake to the same shape so both addons store their upstream tar.gz
verbatim at /opt/<name>.tar.gz instead of pre-extracted trees.

install_root, install_arm_translation, and install_gapps all extract
their payload into /tmp/<name>/ at the top of the install, work from
there, and clean up at the end — same pattern across the three.

Why:
- No runtime gitlab.com dependency for rooting (previously 84.7 MB git
  clone with full history, now a ~12 MB tar.gz baked at build time).
- ~26 MB smaller image disk footprint after pull (the upstream tar.gz
  files are still LZMA/gzip-compressed in /opt; we only pay
  decompression on install).
- Lazy work: an addon that isn't enabled never gets extracted.
- Symmetric layout — install_root, install_arm_translation, and
  install_gapps all stage under /tmp/<name>/ now.

Verified end-to-end on a fresh AVD with ROOT_SETUP=GAPPS_SETUP=
ARM_TRANSLATION=1: all four markers land, /data/adb/modules/ contains
gapps and ndk_translation, ABI list advertises arm64-v8a, Google
services visible at /system/priv-app/ via Magisk overlay, and an
arm64-v8a-only APK installs cleanly.
@Shmayro Shmayro merged commit 376844e into main May 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant