PinePhone - Instructions for creating a PureOS image for PinePhone

Instructions for creating a PureOS Image for PinePhone by mozzwald

You will need u-boot-tools package for your distro and it helps to have binfmt and qemu packages for chrooting to the image. Paths and devices may be different on your system. Always verify before blindly copying and pasting commands.

Make a new working directory

mkdir ~/purepp
cd ~/purepp

Download and extract PinePhone phosh image (check for newer releases if you like)

wget https://images.postmarketos.org/pinephone/pine-pinephone-20200218-phosh.img.xz
unxz -d pine-pinephone-20200218-phosh.img.xz

Download and extract PureOS Librem 5 image (check for newer releases if you like)

wget http://downloads.pureos.net/amber/phone/gnome/librem5/2020-02-25/librem5.img.xz
unxz -d librem5.img.xz

Make temporary dirs for mounting images

mkdir pmos-boot pmos-root pureos-boot pureos-root

List used loop devices

losetup -a

List all loop devices

The remaining commands should be run with sudo or as root user (sudo su)

Pick an unused loop device (5 in my case) and mount pmOS image with partitions

Pick an unused loop device (6 in my case) and mount PureOS image with partitions

Get pmOS PinePhone bootloader

Put pmOS PinePhone bootloader on PureOS image

Mount partitions

Copy PinePhone kernel & dtb to PureOS image

Copy PinePhone modules to PureOS image

Copy PinePhone firmware to PureOS image

Make u-boot initramfs from PureOS initramfs

Get uboot-script

Compile uboot script

Put helper files into rootfs

If you have binfmt setup for arm64/aarch64 then you can chroot and enable modem service and do whatever else you want. Otherwise this needs done after bootup

Unmount disk images

Copy the new image to SD card

Optionally resize PureOS Root partition on SD card

Put in PinePhone and boot. WIN!

Last updated