Skip to main content

How to Install Linux on the PinePhone

·
Categories Smartphones Linux Phones
Tags PinePhone
Table of Contents

The PinePhone, released in 2019, ships with Manjaro ARM preinstalled. You do not need to unlock some bootloader nonsense before flashing a new system.

Because there are many mobile Linux distributions, I will use postmarketOS (Alpine Linux) as the example. Most Linux-based systems follow similar steps.

1. PinePhone Boot Process
#

The PinePhone bootloader uses U-boot. By default, it boots from the microSD card first, then the internal storage (eMMC). Booting from USB devices is not currently supported.

Installing to an SD card is definitely slower, but the upside is that you can keep swapping systems.

2. Install the System to an SD Card
#

Linux systems usually take less than 3GB, but for future use, the SD card should be at least 32GB.

First, prepare a tool that can write images to SD cards. For a graphical cross-platform option, there is balenaEtcher.

If your computer runs Linux, using the DD command is the fastest way. My computer runs Ubuntu 22.04.

  1. First download the PinePhone system image from the postmarketOS official site (Phosh interface).

  2. Decompress the .xz system image. You will get a .img image file.

xz --decompress 20220330-0453-postmarketOS-v21.12-phosh-17-pine64-pinephone.img.xz
  1. Insert the SD card into the computer with a card reader. Ubuntu should mount it automatically.

  2. Open a terminal in the directory containing the .img image file, then run lsblk to check the SD card mount point. For example, mine was at /media/ivon/Sandisk32GB:

    sdb      12:51   1  29.7G  0 disk /media/ivon/Sandisk32GB
  1. Unmount the SD card:
umount /media/ivon/Sandisk32GB
  1. Open a terminal in the directory containing the decompressed system image and flash the system. “if” is the system image file, and “of” is the target path.
sudo dd if=20220330-0453-postmarketOS-v21.12-phosh-17-pine64-pinephone.img of=/dev/sdc bs=4M status=progress conv=fsync
  1. After flashing finishes, eject the SD card, insert it into the PinePhone, boot it, and start using the PinePhone.

3. Install the System to the Phone’s Internal Storage
#

There are currently two ways to install the system to the phone’s eMMC. The first is to boot with “Tow-boot”, expose the internal storage as an SD card, then connect it to the computer and flash the system.

The second is to boot from the SD card, then run the dd command to flash the system image to the internal storage.

3.1. Use Tow-Boot
#

See: PinePhone: What Is the Tow-Boot Bootloader? How Do You Install It?

Tow-boot lets the phone’s internal storage appear as an SD card. Plug it into the computer and flash it like an SD card. Nice and boring, which is ideal.

3.2. Flash the System After Booting from the SD Card
#

  1. After booting from the SD card, use the browser on the phone to download the system image you want to flash, such as postmarketOS in this article.

  2. Use lsblk to check the eMMC path. It is usually at /dev/mmcblk2.

  3. Decompress the image file and use dd to flash it to the internal storage. “of” is the eMMC path.

dd if=20220330-0453-postmarketOS-v21.12-phosh-17-pine64-pinephone.img of=/dev/mmcblk2 bs=1M status=progress

4. Multiboot
#

Because the PinePhone boots from SD card by default, dual booting and distro hopping become very easy.

You can install one system on the SD card and another on the internal storage, then dual boot by inserting or removing the SD card.

If you want to install multiple systems on one SD card, see: User:Oogwaymaki/PinePhone Multiboot - PINE64 Wiki

5. Back Up the System
#

Unless you use encryption, backing up the PinePhone system is extremely easy.

See: Backing Up the PinePhone System and Data

6. References
#

Related


Thank you for reading. Public comments are not available on this website. I write to explore ideas honestly, not to chase social engagement or traffic. I would be glad to hear your thoughts after reading the article with care. If you found any errors, technical issues, or would like to share feedback, feel free to contact me via the email listed on the About page.