Installation guide for PinePhone operating systems.
pine64.org
wiki.pine64.org

postmarketOS

postmarketos.org
wiki.postmarketos.org

We are sick of not receiving updates shortly after buying new phones. Sick of the walled gardens deeply integrated into Android and iOS. That's why we are developing a sustainable, privacy and security focused free software mobile OS that is modeled after traditional Linux distributions. With privilege separation in mind. Let's keep our devices useful and safe until they physically break!

 

SD CARD

 

Install pmbootstrap

pikaur -S pmbootstrap

 

pmbootstrap init

pmbootstrap init

 

Path

Location of the 'work' path. Multiple chroots (native, device arch, device rootfs) will be created in there.

Default:

Work path [/home/dan/.local/var/pmbootstrap]:

 

Device vendor

Choose your target device vendor (either an existing one, or a new one for porting).

Vendor [samsung]: pine64

 

Device codename
Device codename : pinephone

 

Device proprietary components

This is totally up to you.
Check our post.

Enable this package? (y/n) [y]: 

 

User
Username [user]: dan

 

User interfaces

Choose your favourite interface.

Available user interfaces (11): 
* none: No graphical environment
* hildon: (X11) Lightweight GTK+2 UI (optimized for single-touch touchscreens) (DISABLED FOR ARMHF, ARMV7!)
* i3wm: (X11) Tiling WM (keyboard required)
* kodi: (Wayland) 10-foot UI useful on TV's
* mate: (X11) MATE Desktop Environment, fork of GNOME2 (stylus recommended)
* phosh: (Wayland) Mobile UI developed for the Librem 5
* plasma-mobile: (Wayland) Mobile variant of KDE Plasma, optimized for touchscreen (slow without hardware acceleration!)
* plasma-mobile-extras: Plasma Mobile with more apps pre-installed (video and music players, pdf reader, etc.)
* shelli: Plain console with touchscreen gesture support
* sway: (Wayland) Tiling WM, drop-in replacement for i3wm (DOES NOT RUN WITHOUT HW ACCELERATION!)
* weston: (Wayland) Reference compositor (demo, not a phone interface)
* xfce4: (X11) Lightweight GTK+2 desktop (stylus recommended)
User interface [weston]: plasma-mobile

 

Build options

Just showing the options. You can type n.

Change them? (y/n) [n]: y
Jobs
Jobs [5]: 5
Cache

We use ccache to speed up building the same code multiple times. How much space should the ccache folder take up per architecture? After init is through, you can check the current usage with 'pmbootstrap stats'. Answer with 0 for infinite.

Ccache size [5G]: 5G

 

Additional packages

Additional packages that will be installed to rootfs. Specify them in a comma separated list (e.g.: vim,file) or "none"

Extra packages [none]: 

 

Timezone
Use this timezone instead of GMT? (y/n) [y]: y

 

Device hostname
Device hostname (short form, e.g. 'foo') [pine64-pinephone]: 

 

Done
WARNING:
The applications in the chroots do not get updated automatically.
Run pmbootstrap zap to delete all chroots once a day before working with pmbootstrap!
It only takes a few seconds, and all packages are cached.
Done!

 

Install on SD CARD

You might have to run it twice or more if you get an error.

Use numbers for your user password. This is the same password for your lock screen, which contains only numbers.
pmbootstrap install --sdcard=/dev/mmcblk0
[08:40:05] *** (1/5) PREPARE NATIVE CHROOT ***  
[08:40:06] *** (2/5) CREATE DEVICE ROOTFS ("pine64-pinephone") ***  
[08:40:13] (rootfs_pine64-pinephone) install postmarketos-base device-pine64-pinephone device-pine64-pinephone-nonfree-firmware postmarketos-ui-phosh  
[08:41:40] (rootfs_pine64-pinephone) write /etc/os-release  
[08:41:40] WARNING: aarch64 package 'polkit' installed version 0.116-r1 is newer, than the version in the repositories: 0.116-r0 See also: <https:>  
[08:41:40] (rootfs_pine64-pinephone) install  
[08:41:43] (rootfs_pine64-pinephone) install  
[08:41:47] (rootfs_pine64-pinephone) mkinitfs postmarketos-allwinner  
[08:41:51]  *** SET LOGIN PASSWORD FOR: 'dan' ***  
New password:  
Retype new password:   
passwd: password updated successfully  
[08:53:24] NOTE: No valid keymap specified for device  
[08:53:26] *** (3/5) PREPARE INSTALL BLOCKDEVICE ***  
[08:53:27] (native) mount /dev/install (host: /dev/mmcblk0)  
[08:53:27] EVERYTHING ON /dev/mmcblk0 WILL BE ERASED! CONTINUE? (y/n) [n]: y  
[08:53:48] (native) partition /dev/install (boot: 69M, root: the rest)  
[08:53:48] (native) format /dev/installp2  
[08:54:13] (native) mount /dev/installp2 to /mnt/install  
[08:54:13] (native) format /dev/installp1 (boot, ext2), mount to /mnt/install/boot  
[08:54:14] *** (4/5) FILL INSTALL BLOCKDEVICE ***  
[08:54:14] (native) copy rootfs_pine64-pinephone to /mnt/install/  
[08:55:04] Embed firmware u-boot/pine64-lts/u-boot-sunxi-with-spl.bin in the SD card image at offset 8 with step size 1024  
[08:55:42] *** (5/5) FLASHING TO DEVICE ***  
[08:55:42] Run the following to flash your installation to the target device:  
[08:55:42] * pmbootstrap flasher flash_kernel  
[08:55:42]   Flashes the kernel + initramfs to your device:  
[08:55:42]   /home/dan/Software/pmbootstrap/chroot_rootfs_pine64-pinephone/boot  
[08:55:42] * If the above steps do not work, you can also create symlinks to the generated files with 'pmbootstrap export' and flash outside of pmbootstrap.  
[08:55:42] NOTE: chroot is still active (use 'pmbootstrap shutdown' as necessary)  
[08:55:42] Done  

pmbootstrap shutdown

pmbootstrap shutdown

That's it. Put the SD CARD in your phone.

 

eMMC

To install on eMMC, you must first install it on a SD CARD or:

 

  1. FEL mode:

Installing postmarketOS on the eMMC directly from a computer via FEL is also supported. This requires the user to enable FEL mode, the boot-tools to mount the eMMC as mass storage are currently however not compatible.

 

  1. Serial console:

The PinePhone has a serial port in the headphone connector, it's activated by the 6th contact on the dipswitch. If the switch is on then the headphone connector is in audio mode, if it's off then it's in UART mode.

The uart is 115200n8

The pinout for the serial connector on the headphone jack is:

  • Tip: RX
  • Ring: TX
  • Sleeve: GND

The serial connection is 3.3V

You can also buy the debug cable from PINE64 Store The store cable uses a 4 ring plug, as seen in the PDF, but a 3 ring plug works just as well.

 

Source: wiki.postmarketos.org

 

SSH

SSH into your phone:

ssh user@ip

 

Packages

 

Update system and pkgs

sudo apk update && sudo apk upgrade

 

Necessary pkgs

sudo apk add pmbootstrap python3 coreutils procps git

 

pmbootstrap init

pmbootstrap init

 

Path

Location of the 'work' path. Multiple chroots (native, device arch, device rootfs) will be created in there.

Work path [/home/dan/.local/var/pmbootstrap]:

 

Device vendor

Choose your target device vendor (either an existing one, or a new one for porting).

Vendor [samsung]: pine64

 

Device codename
Device codename : pinephone

 

Device proprietary components

This is totally up to you.
Check 'PinePhone Shipping & Misconceptions'.

Enable this package? (y/n) [y]: 

 

User
Username [user]: dan

 

User interfaces

Choose your favourite interface.

Available user interfaces (11): 
* none: No graphical environment
* hildon: (X11) Lightweight GTK+2 UI (optimized for single-touch touchscreens) (DISABLED FOR ARMHF, ARMV7!)
* i3wm: (X11) Tiling WM (keyboard required)
* kodi: (Wayland) 10-foot UI useful on TV's
* mate: (X11) MATE Desktop Environment, fork of GNOME2 (stylus recommended)
* phosh: (Wayland) Mobile UI developed for the Librem 5
* plasma-mobile: (Wayland) Mobile variant of KDE Plasma, optimized for touchscreen (slow without hardware acceleration!)
* plasma-mobile-extras: Plasma Mobile with more apps pre-installed (video and music players, pdf reader, etc.)
* shelli: Plain console with touchscreen gesture support
* sway: (Wayland) Tiling WM, drop-in replacement for i3wm (DOES NOT RUN WITHOUT HW ACCELERATION!)
* weston: (Wayland) Reference compositor (demo, not a phone interface)
* xfce4: (X11) Lightweight GTK+2 desktop (stylus recommended)
User interface [weston]: plasma-mobile

 

Build options

Just showing the options. You can type n.

Change them? (y/n) [n]: y

 

Jobs
Jobs [5]: 5
Cache

We use ccache to speed up building the same code multiple times. How much space should the ccache folder take up per architecture? After init is through, you can check the current usage with 'pmbootstrap stats'. Answer with 0 for infinite.

Ccache size [5G]: 5G

 

Additional packages

Additional packages that will be installed to rootfs. Specify them in a comma separated list (e.g.: vim,file) or "none"

Extra packages [none]: 

 

Device hostname
Device hostname (short form, e.g. 'foo') [pine64-pinephone]: 

 

Done
WARNING:
The applications in the chroots do not get updated automatically.
Run pmbootstrap zap to delete all chroots once a day before working with pmbootstrap!
It only takes a few seconds, and all packages are cached.
Done!

 

Install on eMMC

You might have to run it twice or more if you get an error.

Use numbers for your user password. This is the same password for your lock screen, which contains only numbers.
"See also JumpDrive.
pmbootstrap install --sdcard=/dev/mmcblk2
[07:37:25] *** (1/5) PREPARE NATIVE CHROOT ***  
[07:37:50] *** (2/5) CREATE DEVICE ROOTFS ("pine64-pinephone") ***  
[07:40:46] WARNING: aarch64 package 'polkit' installed version 0.116-r1 is newer, than the version in the repositories: 0.116-r0 See also: <https:>  
[07:40:57] (rootfs_pine64-pinephone) install  
[07:41:09] WARNING: aarch64 package 'polkit' installed version 0.116-r1 is newer, than the version in the repositories: 0.116-r0 See also: <https:>  
[07:41:10] (rootfs_pine64-pinephone) install  
[07:41:15] (rootfs_pine64-pinephone) write /etc/os-release  
[07:41:19] WARNING: aarch64 package 'polkit' installed version 0.116-r1 is newer, than the version in the repositories: 0.116-r0 See also: <https:>  
[07:41:19] (rootfs_pine64-pinephone) install  
[07:41:27] (rootfs_pine64-pinephone) install  
[07:41:35] (rootfs_pine64-pinephone) mkinitfs postmarketos-allwinner  
[07:41:42]  *** SET LOGIN PASSWORD FOR: 'dan' ***  
New password:   
Retype new password:   
passwd: password updated successfully  
[14:44:05] NOTE: No valid keymap specified for device  
[14:44:09] *** (3/5) PREPARE INSTALL BLOCKDEVICE ***  
[14:44:13] (native) mount /dev/install (host: /dev/mmcblk2)  
[14:44:13] EVERYTHING ON /dev/mmcblk2 WILL BE ERASED! CONTINUE? (y/n) [n]: y  
[14:44:17] (native) partition /dev/install (boot: 71M, root: the rest)  
[14:44:17] (native) format /dev/installp2  
[14:44:32] (native) mount /dev/installp2 to /mnt/install  
[14:44:32] (native) format /dev/installp1 (boot, ext2), mount to /mnt/install/boot  
[14:44:33] *** (4/5) FILL INSTALL BLOCKDEVICE ***  
[14:44:33] (native) copy rootfs_pine64-pinephone to /mnt/install/  
[14:46:13] Embed firmware u-boot/pine64-lts/u-boot-sunxi-with-spl.bin in the SD card image at offset 8 with step size 1024  
[14:46:16] *** (5/5) FLASHING TO DEVICE ***  
[14:46:16] Run the following to flash your installation to the target device:  
[14:46:16] * pmbootstrap flasher flash_kernel  
[14:46:16]   Flashes the kernel + initramfs to your device:  
[14:46:16]   /home/dan/.local/var/pmbootstrap/chroot_rootfs_pine64-pinephone/boot  
[14:46:16] * If the above steps do not work, you can also create symlinks to the generated files with 'pmbootstrap export' and flash outside of pmbootstrap.  
[14:46:16] NOTE: chroot is still active (use 'pmbootstrap shutdown' as necessary)  
[14:46:16] Done  

If it does not work, just use dd:

sudo dd if=/dev/mmcblk0 of=/dev/mmcblk2 bs=4M
sudo parted /dev/mmcblk2p2 resizepart 1 100% might necessary.

 

Turn off your phone

poweroff

That's it. Remove the SD CARD and start your phone.

 

Ubuntu Touch

ubports.com

Ubuntu Touch is made and maintained by the UBports Community. A group of volunteers and passionate people across the world. With Ubuntu Touch we offer a truly unique mobile experience - an alternative to the current most popular operating systems on the market. We believe that everyone is free to use, study, share and improve all software created by the foundation without restrictions. Whenever possible, everything is distributed under free and open source licenses endorsed by the Free Software Foundation, the Open Source Initiative.

Ubuntu Touch is a mobile version of the Ubuntu operating system for mobile devices. However, unlike other 'flavors' of Ubuntu, it is more accurately an extract of parts of Ubuntu. It is adapted to run naturally in a mobile, touch-screen environment but is also capable of functioning as a desktop computer while in "desktop mode". This aforementioned converging of environments from device to device is where the term "Convergence" originates. You can find more technical details on our github page.

 

SD CARD

 

Downloads

Download the rootfs (img.gz) and extract it.

 

Flash the image

You can use Etcher or the following command:

sudo dd bs=4M if=~/Downloads/ubuntu-touch-pinephone.img of=/dev/mmcblk0

Resize SD CARD

sudo parted /dev/mmcblk0 resizepart 1 100% && sudo resize2fs -p /dev/mmcblk0p1

That's it. Put the SD CARD in your phone.

 

eMMC

To install on eMMC, you must first install it on a SD CARD and also copy the ubuntu-touch-pinephone.img to you SD CARD.

Or:
Same as postmarketOS

"See also JumpDrive.
 

Flash the image

sudo dd bs=4M if=~/ubuntu-touch-pinephone.img of=/dev/mmcblk2

 

Resize eMMC

sudo parted /dev/mmcblk2 resizepart 1 100%

 

Turn off your phone

sudo shutdown now

That's it. Remove the SD CARD and start your phone.

 

JumpDrive

Download latest .img and flash it with Etcher.

Detailed Usage Instructions

  1. Download the Jumpdrive image
  2. Flash the Jumpdrive image to a micro SD card
  3. Boot the PinePhone from the Jumpdrive micro SD card
  4. Connect the PinePhone to your computer using USB-A -> USB-C cable
  5. Flash the exposed (mounted) PinePhone drive with a chosen OS image
  6. Once the flashing process is complete, disconnect the PinePhone from your PC, power it down and remove the Jumpdrive SD card
  7. The process is now finished, and you can boot from eMMC

Jumpdrive also acts as a rescue image in case if you messed up your installation. To do so, you can telnet to 172.16.42.1, mount rootfs and fix it!

Resize file system

If you flash a 4G img distro (ie. phosh+debian) to your eemc, your eemc will only have a 3.7G partition on it. To use the entire 14.7G on the eemc, run the following commands:

  1. sudo cfdisk /dev/sdX
  2. Change to [Resize] in the ncurses program, resize the 3.7G partition to 14.7G, and [Write]
  3. sudo resize2fs /dev/sdXY

Replace X with your drive's name. Replace Y with the paritition you resized in cfdisk.

Source: wiki.pine64.org