I’m running Gentoo with a portable backup git, pkg registry and s3 bucket on a repurposed Pixel 6 android phone

I simply needed a portable wifi hotspot. And now I also put Forgejo on it. And once I realized I already had a fully capable Linux kernel in my pocket, things escalated.

We can connect to the phone at a place with bad connection and share code through the phone. So this was the best solution with the hardware I already owned. Plus I can emerge Gentoo packages for a handwarmer.

Stack:

  • Google Pixel 6
    • Google Tensor G1 (8 core) (infamous for thermal throttling)
    • From those 8 cores:
      • 2x Cortex-X1 (High performance cores in bursts because 🔥)
      • 2x Cortex-A76 (Mid performance that can do longer tasks)
      • 4x Cortex-A55 (Effeciency cores)
    • 8GB RAM
    • 128GB flash storage
    • Wifi Hotspot capabilities built-in.
  • Rooted with Magisk
  • LineageOS (willing to try others)
  • Patched LineageOS Android kernel (with some settings activated)
  • Stage 3 Gentoo user space that I just copy pasted into /data/gentoo/ that is hosting:
    • a tailscale entrypoint for remote team members
    • a Git server (Forgejo)
    • a package registry (for downloading common utilities)
    • an S3-compatible storage endpoint (instead of a file folder)

This is my very first Gentoo experience. I chose Gentoo because I wanted to build all the services in the most efficient way possible so that running Forgejo wouldn't drain the battery faster than it would charge. Nor did I wanted the Cortex cores to thermal throttle. So I just stripped away all the things I didn't need from all packages and kept everything as minimal and feature rich as possible.

Originally I tried to put Forgejo in the Terminal Debian VM that comes with stock Android 13+. But that just felt way too ephemeral and sandboxed for a real production server. And a VM carries way too much overhead. Then I also tried postmarketOS. But that was just very WIP it doesn't have the right screen firmware to make it work yet.

So I rooted a phone I already owned, put custom roms and kernels on it. Then unpacked a stage 3 Gentoo rootfs into #/data/gentoo then chrooting into that rootfs to spawn a glorious Gentoo shell.

And from there it's just a long time building packages. and when it was ready. We started putting all the common software libraries on there. So that we could always have a reliable place to pull software from.

Leave a Reply