Installing Mobian (Android devices)

This guide covers installing Mobian on the OnePlus 6/6T and the Xiaomi Pocophone F1. See the devices page for the full list of supported devices.

Obtain the Image

Pre-built Images

We recommend downloading pre-built images for installation. They are released weekly, normally on Sundays. The image files for your device will be packed in a file named mobian-<device>-phosh-YYYYMMDD.tar.gz and can be found here:

  • OnePlus 6/6T: since 2023-01-15 only Audio is broken (older versions: known as broken (no Wifi, sometimes no Bluetooth): 20221120, 20221127; known as ok: 20221002)
  • Pocophone F1: since 2023-01-15 only Audio is broken (older versions: known as broken (no Wifi, no Cellular, sometimes no Bluetooth): 20221113, 20221030, 20221016 ; known as ok: 20221002, 20220925)

Building from Debos Recipes

You can build the image yourself using the debos recipes. If you build the image yourself, the produced image file will be not be zipped (i.e. named mobian-<device>-phosh-YYYYMMDD.*.img) and there is no need to unzip the archive.

Preparing the Device

As you would do before installing a custom Android ROM, the bootloader needs to be unlocked. The exact procedure varies depending on the device you own, so we suggest you search the Internet for an unlock guide aimed at your specific device.

We also recommend that you upgrade Android to the latest available version and install all system updates before installing Mobian.

See postmarketOS' installation guide for unlocking bootloader of OnePlus 6 or OnePlus 6T

Flashing the Image to the Target Device

WARNING: Flashing Mobian to your device will wipe your Android installation! Please install a recovery software such as TWRP and make sure you understand how to recover your system before proceeding.

Those devices being Android smartphones in the first place, they have secure boot enabled, meaning we can't replace their bootloader and need to rely on Android tools in order to flash Mobian.

In practice, this means we can't flash a single image file, and the downloaded tarball will contain:

  • an Android bootimg containing the kernel, device-tree and initramfs named mobian-<device>-phosh-YYYYMMDD.boot-<variant>.img
  • an image for the system partition (new since 2023) named mobian-<device>-phosh-YYYYMMDD.boot.img
  • an F2FS-formatted rootfs (using Android's sparse image format) named mobian-<device>-phosh-YYYYMMDD.rootfs.img

As these devices have several variants, which differ only by the device-tree they need, and the DT being part of the bootimg, we provide one bootimg for each variant. You have to flash the one matching your device:

  • OnePlus 6: enchilada
  • OnePlus 6T: fajita
  • Pocophone F1: use the beryllium-tianma variant first; if the touchscreen doesn't react to swipes, then switch to the beryllium-ebbg variant. If you know your display variant, you can pick this directly.

Once you have extracted those files from the tarball, boot your device into Fastboot mode, connect it to your computer using a USB cable and run the following commands to install Mobian:

fastboot flash boot mobian-<device>-phosh-YYYYMMDD.boot-<variant>.img
fastboot flash system mobian-<device>-phosh-YYYYMMDD.boot.img
fastboot -S 100M flash userdata mobian-<device>-phosh-YYYYMMDD.rootfs.img
fastboot erase dtbo

If all steps above succeeded, reboot your phone.

Notes:

  • If the device becomes unresponsive after a fastboot command succeeded, power it off and boot into fastboot mode again, then execute the remaining commands.
  • The OnePlus 6/6T has an A/B partition scheme. In order to select which slot you want to flash Mobian to, you can run the following command before any other fastboot command:
fastboot --set-active=[a|b]

Installing to an SD Card

The installation above is to the internal memory (UFS). There can be many reasons why you want to install to an SD card (if you have a Pocophone F1):

  • You want to swap an installation between different phones.
  • The installation to internal memory might be broken. This was the case for the Pocophone F1 in the past.
  • For old versions: The UFS implementation might be broken for your combination of kernel and device and lead to IO errors.

Before proceeding you must have installed the same version to the internal memory, as described above, but flashing the rootfs.img should be left out (can lead to confusion with the root image that will be installed to the SD card). The steps for installing to an SD card (recommended at least 16 GB):

  • On a PC, add a partition number 1 with filesystem ext4 to your SD card.
  • Convert the root image from sparse to non-sparse format: simg2img mobian-<device>-phosh-YYYYMMDD.rootfs.img mobian-<device>-phosh-YYYYMMDD.rootfs.raw
  • Write the .raw file to partition 1, determine which letter you should use as N in sdN1 to access the mentioned SD card: sudo dd if=mobian-<device>-phosh-YYYYMMDD.rootfs.raw of=/dev/sdN1 bs=1M status=progress
  • Move the SD card from the PC to the phone.
  • Start the phone.