Linux on a smartphone with PostmarketOS
Open Call
The mobile Linux distribution PostmarketOS is a fork of Alpine Linux that supports around a dozen user interfaces.
Mobile Linux operating systems have experienced an enormous upswing in recent years due to the development of Linux smartphones like the PinePhone and the Librem 5. Around two dozen Linux smartphones exist today, and you can find the 15 most important operating systems on the ISO of a multi-distro demo known as Megi's multi-boot image [1]. Fragmentation in the mobile Linux operating system niche is high, but there is also some cross-fertilization in the scene.
The incentive is the desire to counter the duopoly of Android and iOS with something that open source enthusiasts can use without hesitation. The goal is also about sustainability. Frugal users believe that mobile devices need to be supported for ten or more years, instead of dropping out of the update process after two years, as is usually the case with Android, and ending up as hazardous waste. Mainlining [2] is an important keyword here – the term refers to the process of replacing the supplied kernel with a kernel that corresponds as closely as possible to the mainline kernel at kernel.org.
At the center of this development is the open source project PostmarketOS (PMOS) [3], founded in 2017 as a fork of the minimalist Alpine Linux distribution [4]. PMOS supports several user interfaces (Figure 1), including KDE Plasma Mobile, Unity 8 (the UI now known as Lomiri), Purism's GTK-based Wayland Phosh interface developed for Librem 5, the tiling compositor Sway, the Suckless-based Sxmo, Gnome, Mate, and Xfce4. Devices like the PinePhone or the Librem 5 run a mainline kernel out of the box, but the intent is for all Android devices with PMOS to operate with a mainline kernel in the long run, if possible.
PMOS is best known for supporting the PinePhone and Librem 5 phones, but the PMOS community supports 14 devices at various stages of usability. These devices include the Nokia N900, Wileyfox Swift, OnePlus 6, BQ Aquaris X5, and Pine64's PineTab tablet. In addition, around 300 devices are capable of booting from a PMOS image; around 90 of them already have mainline support. As soon as maintainers can be found for these devices, they will be promoted to the rank of community projects. The developers maintain a list of all supported devices in the project's wiki [5].
Recently, PMOS developers have also been working on making the distribution available for smartwatches. To achieve this smartwatch support, they are integrating the user interface of AsteroidOS [6], which was developed specifically for smartwatches and is based on Qt 5 and QML. Here, too, the main aim is to take the fight to proprietary devices for the wrist, which often have even shorter-lived software support than smartphones, by offering an operating system with long-term support. AsteroidOS currently supports a total of 16 smartwatches [7].
Quick Install
For less tech-savvy contemporaries, installing an Android ROM like LineageOS on an Android cell phone is still an error-prone endeavor, even after years of development. The new swarm of Linux smartphones simplifies this process considerably. First, you transfer the image to an SD card with the Linux dd
command or a tool like USBImager. After removing the back of the PinePhone, you insert the card into the slot above the SIM card and boot from there. This is more or less the same as testing the Live version of a distribution for the desktop from a USB stick. The aforementioned multi-boot ISO, which combines 15 distributions for testing on an SD card, is a good option.
Once you have stored the multi-boot ISO on the SD card and inserted it into the PinePhone or other supported device, you will see a selection menu after startup that lists the available user interfaces, including five PMOS variants with Plasma Desktop, Plasma Mobile, Phosh, Gnome, and Sxmo (Figure 2). You can navigate through the options with the volume rocker and invoke the selected interface with the Start button. At the very top of the selection, you will possibly find a previously installed distribution in the fixed internal eMMC memory. At the bottom, you can activate a private mode that disables wireless support, the camera, and the microphone for the test.
This ISO offers the fastest starting point for getting to know PMOS in its entirety on the PinePhone or other supported smartphone. If you prefer to test the different variants individually or have already decided on an interface, you can find detailed instructions and reports on the PMOS wiki describing what already works with the interface and what will take some time [8].
The distributions gathered on the multi-boot ISO are meant for testing, not for installation. The images of the individual distributions offer some advantages. One benefit is that you can create a more up-to-date image of your desired interface, because you design the image yourself using pmbootstrap
[9], which is part of PMOS. And this method automatically expands the root filesystem to the entire available space on the SD card. In addition, you can store a public key for SSH directly on the system if it is on the Linux PC on which pmbootstrap
is running.
If you are experimenting with PMOS, you need to be aware that the project is entering uncharted territory and that the distribution is still under development; a first stable version was released in early July 2021. However, in combination with the inexpensive PinePhone, it makes for an ideal experimental field to familiarize yourself with the new Linux phone niche. If you keep that in mind, there is nothing standing in the way of an installation on the PinePhone's internal eMMC memory card. You can install directly via pmbootstrap
or transfer PMOS from a booted SD card to the eMMC with Jumpdrive [10].
PinePhone
PinePhone's development stagnated for quite some time with the suspend feature, or rather, the inability to wake up from it early enough when a call comes in. The problem has now been fixed, so you can use hibernation mode and answer calls on the first ring. This also ensures an acceptable runtime.
In addition, the camera was an unusable component for a long time, since it lacked an app capable of taking pictures. PMOS developer Martijn Braam, who is enthusiastic about photography, remedied this with his Megapixels app. Developed for PMOS, it now enjoys widespread use on other mobile distributions. Braam described the journey in a series of four blog entries [11]. He also wrote an implementation of Gnome Tweaks for PMOS, which goes by the name of postmarketOS Tweaks [12].
Listing 1 summarizes the commands you use to put PMOS on an SD card, which you then boot on the PinePhone. The PIN you are prompted for at startup time and the passwords for user and root are 1111
for Megi's multi-boot ISO. For a user-designed image, you can set these details during the bootstrap process.
Listing 1
Installing PMOS on an SD Card
### Install Python-Pip3 on the PC ### Debian: $ sudo apt install git python3-pip ### Fedora: $ sudo dnf install git python3-pip ### Install Pmbootstrap: $ pip3 install --user pmbootstrap ### Create an environment: $ pmbootstrap init ### Release Channel: stable or edge ### Choose a vendor: pine64 ### Codename: pinephone ### Define timezone, name etc. ### Copy SSH key if needed ### Start installation. Before doing so run ### fdisk -l to check if mmcblk0 ### is the right device $ pmbootstrap install --sdcard=/dev/mmcblk0 ###
You can install additional packages using the Alpine package manager, apk
. For example, to install Braam's photo app, use sudo apk add megapixels
. Alpine does not use systemd, but rather RC as an init program. Enable SSH by typing sudo rc-service sshd start
. To enable SSH at every reboot, run the sudo rc-update add sshd
command. As usual, you will find the IP address of the PinePhone needed for SSH with the ifconfig
or ip a
commands.
We found the Librem 5 interface Phosh to be the most likely to show PMOS in its best light. The version from Megi's ISO shipped with kernel 5.13-rc4. In addition to the telephony app, the chat module Chatty, and the contacts app, and the Firefox browser, you'll find some familiar Gnome programs, such as Files, Software, Settings, Terminal, and Tweaks (Figure 3). A Welcome menu explains the various gestures.
We post-installed Gnome Screenshot, Gnome Maps, and htop in our lab, and all of them work. However, due to the PinePhone's low-powered hardware, things are quite slow. And not all apps fit the form factor perfectly as of yet, which means that you have to rotate the device through 90 degrees to access the buttons for some actions.
Conclusions and Outlook
All told, PostmarketOS's current features will not be enough for many wanting to use the PinePhone as their sole daily companion. This hesitancy is partly due to the limited hardware and partly due to the early stage of development for PMOS itself.
Many users are longing for a Linux PC in their pockets, and the fact that it is taking so long is a disappointment for many enthusiasts. But you have to remember that the community is just now laying the foundations for – hopefully sustainable – long-term development.
Infos
- Megi's image: https://xnux.eu/p-boot-demo/
- Mainlining: https://wiki.postmarketos.org/wiki/Mainlining
- PostmarketOS: https://en.wikipedia.org/wiki/PostmarketOS
- Alpine Linux: https://www.alpinelinux.org/
- PMOS supported devices: https://wiki.postmarketos.org/wiki/Devices
- AsteroidOS: https://asteroidos.org/
- AsteroidOS supported smartwatches: https://asteroidos.org/install/
- PMOS interfaces: https://wiki.postmarketos.org/wiki/User-Interfaces
- pmbootstrap: https://wiki.postmarketos.org/wiki/Installing_pmbootstrap
- Jumpdrive: https://github.com/dreemurrs-embedded/Jumpdrive
- Megapixels: https://blog.brixit.nl/pinephone-camera-pt4/
- postmarketOS Tweaks: https://gitlab.com/postmarketOS/postmarketos-tweaks
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Fedora 41 Released with New Features
If you're a Fedora fan or just looking for a Linux distribution to help you migrate from Windows, Fedora 41 might be just the ticket.
-
AlmaLinux OS Kitten 10 Gives Power Users a Sneak Preview
If you're looking to kick the tires of AlmaLinux's upstream version, the developers have a purrfect solution.
-
Gnome 47.1 Released with a Few Fixes
The latest release of the Gnome desktop is all about fixing a few nagging issues and not about bringing new features into the mix.
-
System76 Unveils an Ampere-Powered Thelio Desktop
If you're looking for a new desktop system for developing autonomous driving and software-defined vehicle solutions. System76 has you covered.
-
VirtualBox 7.1.4 Includes Initial Support for Linux kernel 6.12
The latest version of VirtualBox has arrived and it not only adds initial support for kernel 6.12 but another feature that will make using the virtual machine tool much easier.
-
New Slimbook EVO with Raw AMD Ryzen Power
If you're looking for serious power in a 14" ultrabook that is powered by Linux, Slimbook has just the thing for you.
-
The Gnome Foundation Struggling to Stay Afloat
The foundation behind the Gnome desktop environment is having to go through some serious belt-tightening due to continued financial problems.
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.