A month ago, I showed you in my article CAP in the pocket: Developing Java Applications on your Phone (a more concise version), how to run a CAP development environment on your phone. In this week’s short blog post, I use a different angle. I wanted to see whether I could run SAP’s Garden Linux on my phone.
If you’re waiting for my CPU time profiler blog post, it’ll come soon (hopefully on Monday).
Garden Linux is a Debian GNU/Linux derivate that aims to provide small, auditable Linux images for most cloud providers (e.g. AWS, Azure, GCP etc.) and bare-metal machines. Garden Linux is the best Linux for Gardener nodes. Garden Linux provides great possibilities for customizing that is made by a highly customizable feature set to fit your needs.
gardenlinux.io
TL;DR: Yes, you can install it. And it works somewhat.

Installation
Let me tell you now how this all works. Of course, it uses proot-distro running in Termux (see previous article). Multiple distributions are available, but sadly, no Garden Linux. But we can easily add our own. We only need a proper tar.xz file. We can get bare-metal Gardener releases from GitHub Releases.
But there is a problem, the downloadable tar.xz files are a collection of files, xzipped together:
metal-gardener_prod-arm64-1877.0-ddd04088.manifest metal-gardener_prod-arm64-1877.0-ddd04088.manifest.log metal-gardener_prod-arm64-1877.0-ddd04088.raw metal-gardener_prod-arm64-1877.0-ddd04088.raw.log metal-gardener_prod-arm64-1877.0-ddd04088.release metal-gardener_prod-arm64-1877.0-ddd04088.release.log metal-gardener_prod-arm64-1877.0-ddd04088.tar metal-gardener_prod-arm64-1877.0-ddd04088.tar.log
But we’re only interested in metal-gardener_prod-arm64-1877.0-ddd04088.tar
. I extracted and xzed the file for you. You can find it at http://mostlynerdless.de/files/metal.1877.tar.xz.
Now we can create a distro file for Garden Linux in our Termux shell:
cd "$PREFIX/etc/proot-distro" cat <<EOF > garden.sh DISTRO_NAME="Garden Linux" DISTRO_COMMENT="Stable release." TARBALL_URL['aarch64']="http://mostlynerdless.de/files/metal.1877.tar.xz" TARBALL_SHA256['aarch64']="b358d7f933709f52937a84784d745d33a98f470714ab082029c2602c16153b2f" EOF
This allows us to install Garden Linux via:
proot-distro install garden
Now we can launch it via
proot-distro login garden
But we need to fix some locale issues before proceeding:
apt install -y locales nano /etc/locale.gen # uncomment this line (remove the # at the beginning): en_US.UTF-8 UTF-8 update-locale LANG=en_US.UTF-8
Now you have a proper Garden Linux running locally on your phone.
Sadly, I didn’t find a way to install VSCode (double free error message) properly, so you can’t directly use it for CAP development. However, you can, of course, install and run SapMachine (the best JDK):

Try it out and have some fun with it. Feel free to tell me interesting use cases; I’ll happily feature them in a follow-up.
Conclusion
It’s fun to explore what modern smartphones are capable of. They become a more and more capable playground and eventually a working environment to work on the go.
See you in a few days for a profiling-related blog post.