Pine64 Pinephone Pro
Manufacturer

Pine64

Name

Pinephone Pro

Identifier

pine64-pinephonepro

System Type

u-boot

SoC

rockchip-rk3399s

Architecture

aarch64-linux

Supports Stage-0

no

Source

Mobile NixOS repository

Builds

Device-specific notes

Platform Firmware

The only supported platform firmware configuration is to install Tow-Boot to SPI.

Installer

The installer can be downloaded and flashed to an SD card.

 $ dd if=mobile-nixos_pine64-pinephonepro_installer.img of=/dev/sdX bs=8M oflag=sync,direct status=progress

When using Tow-Boot, hold volume down during boot to boot from the SD card.

Follow the on-screen instructions to configure a basic system.

Usage notes

LED

In the default setup, the LED has been configured to show status information. Its colour or pattern can be used to infer the status.

During boot:

  • Green when the kernel initializes the LED driver

At any time after Linux booted:

  • The red LED will flash on panic

As it does not reset the other LED colours, it may flash green/yellow rather than off/red. If applications customize the LED status, it may flash in other patterns involving red.


Updating the boot image

Currently the boot partition must be updated manually.

Building the boot image

If this is required, the boot partition image can be built with the following command:

 $ nix-build <nixpkgs/nixos> --attr config.mobile.outputs.u-boot.boot-partition

Note that building locally on the device may be undesirable. In such cases, you can instantiate the the derivation and build it on another system.

 $ nix-instantiate <nixpkgs/nixos> --attr config.mobile.outputs.u-boot.boot-partition
/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-partition-mobile-nixos-boot.drv
 $ nix-copy-closure --to some-other-host /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-partition-mobile-nixos-boot.drv

On the other host:

 $ nix-build /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-partition-mobile-nixos-boot.drv

If you don’t have an aarch64-linux system to build the derivation, you should be able to instantiate a cross-compilable boot image this way:

 $ nix-instantiate --system x86_64-linux <nixpkgs/nixos> --attr config.mobile.outputs.u-boot.boot-partition
/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-partition-mobile-nixos-boot.drv

The build infra for Mobile NixOS will activate cross-compiling for the derivation. It can be copied to a standard x86_64-linux host and built there.

Flashing the boot image

The resulting image can be flashed (dd) to the appropriate partition. With the partition layout as made by the guided installer, this will be the fourth partition on the main storage.

Development notes

Note

The following sections only apply for development.

Building a full disk image

This platform uses the u-boot system-type. This means that a full disk image can be produced, and this full disk image flashed outright to the block device. That block device can be the internal eMMC or the SD card.

When using Tow-Boot, hold volume down during boot to boot from the SD card.

 $ nix-build --argstr device pine64-pinephonepro -A outputs.disk-image
 $ dd if=result of=/dev/mmcblkX bs=8M oflag=sync,direct status=progress

Building the boot partition

Building the full disk image may require a native AArch64 system.

The boot partition can be built, and then flashed on top of an existing Mobile NixOS boot partition.

This image will not be compatible with the boot partition created by the installer.

 $ nix-build --argstr device pine64-pinephonepro -A build.boot-partition
 $ dd if=result/mobile-nixos-boot.img of=/dev/mmcblkXpY bs=8M oflag=sync,direct status=progress