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
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.