Turning Mobile Phones into Linux System with postmarketOS

posted Originally published at journal.manoedinata.com 2 min read

I have two unused Samsung phones lying around, those are Samsung Galaxy J4 (2018, codenamed j4lte) and Samsung Galaxy A51 (2019, codenamed a51). For some time, I’ve been planning to make use of these phones. I was like, “I spent money on these, there’s no way I’ll let these phones be neglected in my drawer.”

The Goal

My main goal is to turn them into small home servers, which I can access anywhere in my house. Simply put, I want these phones to act as my experiment systems, as well as small servers with 24x7 uptime, plus the ability to self-host productivity applications like Stirling-PDF and Vikunja.

Sounds overwhelming? Yes, it is. But bear with me, it will be a fun side project.

Android? Nope.

Though I could just install Android ROMs, root them with Magisk or KernelSU, and use e.g. Termux, it’s not fully efficient. Android is resource-heavy, and generally not ideal for this kind of stuff.

So… what is the most suitable OS for this?

Say Hi to postmarketOS!

After some sort of research, I found postmarketOS project, and since then, things have changed.

postmarketOS (abbreviated as pmOS) is an operating system primarily for smartphones, based on the Alpine Linux distribution. Unlike many other projects porting conventional Linux distributions to Android phones, postmarketOS does not use the Android build system or userspace. This way, Alpine runs 100% on the phone, without virtualization, emulation, or whatever that is people use to run Linux on Android.

Also, each phone has only one unique package, and flashable installation images are generated using its installation tool called pmbootstrap.

Ain’t that cool?

Porting

The birth of postmarketOS project is a gamechanger. PostmarketOS has a community where people, in a collaborative spirit, try to bring Linux to various devices. Thanks to this, I was able to port postmarketOS onto one of these devices. What I expected to be a full messy steps to do, was done only on 2 days, assuming that I have no prior knowledge about pmbootstrap.

Samsung Galaxy J4 (j4lte)

The first device I ported onto is Samsung Galaxy J4. It has Exynos 7570 SoC, brutally similar to Exynos 7870. It’s safe to say that Exynos 7570 is the lower spec of Exynos 7870. Though Samsung did modify some parts, but still, they were like siblings. With that, I could use Exynos 7870 configurations as references.

Also, there’s an existing port for Samsung Galaxy Xcover4 (2017, codenamed xcover4lte), which uses Exynos 7570. I could just copy over the xcover4lte device & kernel configurations, rename it to j4lte, adjust some values, and voila! Things couldn’t have been more easier :D

Samsung Galaxy A51

What about A51? Its SoC (Exynos 9611) should be similar to an existing port of Samsung Galaxy S9 (Exynos 9810), but it uses dynamic partitions, so I need some time to understand the ideal partition layout for pmOS. I could use a hand as well. Probably use someone’s device configuration for it.

What’s Next?

Now that I got postmarketOS ported on my J4, I can proceed to setup this as a home server. The next thing I would do is to run Docker. I will discuss it further in the next post.

If you read this far, tweet to the author to show them you care. Tweet a Thanks

Really cool project—love the idea of reviving old phones like this! Curious, how’s the performance of postmarketOS on the J4 so far, especially with heavier tasks like Docker?

Hi, thanks for checking in! Since it runs natively, the performance is quite shocking. Well, obviously it isn't as fast as PC nowadays, but it could handle running multiple containers smoothly! I ran an AdGuardHome server and Vikunja instance (with Docker), and both of them ran with minimum delay. Just make sure the RAM is sufficient, since J4 only got 2GB of RAM so you'll need zram or swap.

Honestly, more than what I expected from a 7 years old phone.

Amazing project!

More Posts

Linux vs Windows Which Operating System is Best?

Dewan Codes - Jan 15

Hack WiFi using Kali Linux

nitinkumar30 - May 10

Unlocking the Power of Linux Device Drivers

ByteHackr - Nov 3, 2024

Automation periodically tasks with CRON job scheduler

xinitd - Jan 13

There is no Internet? Public Wi-Fi Networking Issues with Captive Portal Pages

Ingo Steinke - Dec 4, 2024
chevron_left