Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whilei/9cbc2650a854b2e86061714d27e13022 to your computer and use it in GitHub Desktop.
Save whilei/9cbc2650a854b2e86061714d27e13022 to your computer and use it in GitHub Desktop.
Prerequisites
=============
- One Pinephone braveheart edition
- A micro SIM card or Nano sim with micro adapter
- A micro SD card (tested with SanDisk Ultra microSDXC UHS-1 64G)
- A 5V power adapter with regular usb connector (15 Watts recommended. 5V/3 amp)
- A Linux desktop/laptop to prepare the SD card (laptop used in this tutorial)
Preparation
===========
* Open your pine64 box
* Remove the phone from the plastic holder
* Remove packaging & screen protector
* Remove the backcover by putting your nail under the backcover corner indent and pull carefully
* Carefully remove the battery. Do NOT use anything sharp to do so. The battery is fragile
* Remove the plastic strip
* Insert your micro SIM card, reinsert battery and put the phone flat on a table
* Connect the red usbc cable to the adapter and power the phone on
PostMarketOS self-test build boots....
* Run all self-tests to verify correct working of all parts.
- The modem says Status OK (Not registered)
- SIM test does not work, unless you have a sim in there without pin
- Flash to eMMC test failed, but that's ok I suppose
* Shut down the phone afterwards.
SD Card setup
=============
Prepare the SD card. The goal is to boot from SD and from there flash to EMMC.
First install the PostmarketOS bootstrap tool on your laptop:
pip3 install --user pmbootstrap
pmbootstrap init
> Work path [/home/user/pine64-pinephone]
> Vendor [pine64]
> Device codename [pinephone]
> Enable this package? (y/n) [y]
> Username [user]
> User interface [plasma-mobile-extras]
> Change them? (y/n) [n]
> Extra packages [none]
> Use this timezone instead of GMT? (y/n) [y]
> Device hostname (short form, e.g. 'foo') [pinephone]
> Would you like to copy your SSH public keys to the device? (y/n) [y]
> Zap existing chroots to apply configuration? (y/n) [y]
Make sure the SD card is NOT mounted
pmbootstrap install --sdcard=/dev/mmcblk0
> New password: ****
> ...
> [19:25:42] Flashes the kernel + initramfs to your device:
> [19:25:42] /home/user/pine64-pinephone/chroot_rootfs_pine64-pinephone/boot
> [19:25: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.
> [19:25:42] NOTE: chroot is still active (use 'pmbootstrap shutdown' as necessary)
> [19:25:42] Done
Boot from SD Card
=================
* Remove the battery
* Insert the SD card (On top of the SIM card)
* Gently put the phone on the table
* Boot the phone. It should boot PostmarketOS with Plasma mobile.
* Connect the phone with USB to the laptop
Install to EMMC
===============
There are several KDE plasma mobile builds. Here are instructions
for KDE Neon(Ubuntu), PostmarketOS (Alpine) and Manjaro (Archlinux/Manjaro)
KDE Neon
--------
# See https://docs.plasma-mobile.org/
wget https://images.plasma-mobile.org/pinephone/plasma-mobile-neon-20191213-160054.img.gz
xz -d pine-pinephone-20200118-plasma.img.xz
scp pine-pinephone-20200118-plasma.img user@172.16.42.1:~
* Copy the image to the phone's emmc from the terminal:
dd if=pine-pinephone-20200118-plasma.img of=/dev/mmcblk2 bs=4M
# Reboot without the sdcard
KDE should start, although with a unresponsive UI(missing Mali driver?)
Laptop:
$ sudo sysctl net.ipv4.ip_forward=1
$ sudo iptables -P FORWARD ACCEPT
# The 3 parts of the USB network, ending with 0
$ sudo iptables -A POSTROUTING -t nat -j MASQUERADE -s 10.15.19.0/24
# SSH into the phone:
$ ssh phablet@10.15.19.82 # pw:1234
Phone:
# The IP of the USB network interface on your laptop
$ sudo route add default gw 10.15.19.100
$ echo nameserver 8.8.8.8 | sudo tee /etc/resolv.conf
$ sudo apt-get update
# Takes an hour or so...
$ sudo apt-get upgrade
* Reboot
Info:
-> KDE Plasma 5.18.80
-> KDE Frameworks 5.67.0
-> Kernel Version 5.4.0-pine64
- Mali driver should work now
- Touch should properly work now (try adjusting brightness with the slider)
# Connect to wifi
* nmcli dev wifi con "ssid" password "password"
Manjaro
-------
# See https://forum.manjaro.org/t/manjaro-arm-alpha3-for-pinephone-and-pinetab/120761
$ wget https://osdn.net/projects/manjaro-arm/storage/pinephone/plasma-mobile/alpha3/Manjaro-ARM-plasma-mobile-pinephone-alpha3.img.xz
$ xz -d Manjaro-ARM-plasma-mobile-pinephone-alpha3.img.xz
$ scp Manjaro-ARM-plasma-mobile-pinephone-alpha3.img user@172.16.42.1:~
$ ssh user@172.16.42.1
$ sudo dd if=Manjaro-ARM-plasma-mobile-pinephone-alpha3.img of=/dev/mmcblk2 bs=4M
# Power down, take out the SIM card and reboot.
PostmarketOS
------------
$ wget https://images.postmarketos.org/pinephone/pine-pinephone-20200118-plasma.img.xz
Resources
=========
https://linux-sunxi.org/CSI
https://linux-sunxi.org/Mali_binary_driver
http://linux-sunxi.org/PinePhone
Phonecalls
==========
See https://megous.com/dl/tmp/modem.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment