Purism Librem5 (purism-librem5): Difference between revisions
add backup/restore instructions with ddrescue |
mNo edit summary |
||
Line 103: | Line 103: | ||
In order to flash the postmarketOS image to the Librem 5, locate the bock device exposed to the host computer via JumpDrive: | In order to flash the postmarketOS image to the Librem 5, locate the bock device exposed to the host computer via JumpDrive: | ||
<syntaxhighlight lang="shell-session"> | <syntaxhighlight lang="shell-session"> | ||
$ lsblk -o name,size,model,vendor | $ lsblk -o name,size,model,vendor |grep JumpDriv | ||
sdb 29.1G e_eMMC JumpDri | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 09:07, 2 March 2021
![]() | |
Manufacturer | Purism |
---|---|
Name | Librem 5 |
Codename | purism-librem5 |
Released | 2019 |
Hardware | |
Chipset | Emcraft NXP i.MX8M |
CPU | 4x 1.5 GHz Cortex-A53 |
GPU | Vivante GC7000Lite |
Display | 1440x720 |
Storage | 32 GB eMMC |
Memory | 3 GB |
Architecture | aarch64 |
Software | |
Original software | PureOS |
postmarketOS | |
Category | community |
Pre-built images | yes |
Flashing |
Works |
---|---|
USB Networking |
Works |
Internal storage |
No data |
SD card |
No data |
Battery |
Works |
Screen |
Works |
Touchscreen |
Works |
Multimedia | |
3D Acceleration |
Works |
Audio |
Works |
Camera |
No data |
Camera Flash |
No data |
Connectivity | |
WiFi |
Works |
Bluetooth |
Works |
GPS |
Works |
NFC |
No data |
Modem | |
Calls |
Works |
SMS |
Works |
Mobile data |
Works |
Miscellaneous | |
FDE |
Works |
USB OTG |
Partial |
HDMI/DP |
No data |
Sensors | |
Accelerometer |
Works |
Magnetometer |
No data |
Ambient Light |
No data |
Proximity |
No data |
Hall Effect |
No data |
Haptics |
No data |
Barometer |
No data |
Contributors
Installation
From pre-built image (easy method)
Official images of postmarketOS for the Librem 5 are built at least every week. Currently the device is only supported on the edge
branch of postmarketOS.
This method requires the uuu
application is installed on the host computer. <uuu> is NXP's image deploy tool, and may be found in some distros in a package named mfgtools
.
Download the right image
- Branch (more):
- edge: bleeding edge version (has latest features, but may break more often).
- User interface
- Phosh: Purism's GTK based phone interface (more)
- Plasma Mobile: KDE's Plasma based phone interface (more)
- (Note that more interfaces are available, build your own image with pmbootstrap if interested)
- Pick the latest image by its date
- Choose the regular image, or the installer image
- Graphical Installer:
- Ends in
-installer.img.xz
- Recommended for a proper installation.
- Encrypting your installation is possible
- Passwords for user and SSH are set during installation (and SSH can be disabled)
- Ends in
- Regular image:
- Ends in
.img.xz
- An installation of postmarketOS with defaults for passwords and no full disk encryption
- The login is
user
with password147147
- sshd is currently enabled by default! (build.postmarketos.org#85)
- Not recommended, unless looking for a quick way to try out postmarketOS
- Ends in
- Graphical Installer:
Download JumpDrive
Grab the latest purism-librem5.tar.xz
image from the JumpDrive release page
JumpDrive 0.7 is the first version to support the Librem 5 |
Extract it, and you should see something similar:
$ tar xf purism-librem5.tar.xz
$ ls
boot-purism-librem5.sh dtbs initramfs-purism-librem5.gz kernel-librem5.gz purism-librem5.lst purism-librem5.tar.xz u-boot-librem5.bin
Run JumpDrive
Place the Librem 5 into #Flash Mode.
Use the helper script from the JumpDrive release to flash the Librem 5:
$ ./boot-purism-librem5.sh
uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.4.72-0-g8e9e189
Success 1 Failure 0
3:2 10/10 [Done ] FB: Done
Flash to EMMC
In order to flash the postmarketOS image to the Librem 5, locate the bock device exposed to the host computer via JumpDrive:
$ lsblk -o name,size,model,vendor |grep JumpDriv
sdb 29.1G e_eMMC JumpDri
In the example above, the /dev/sdc
is the EMMC device on the Librem 5.
WARNING: Triple check you have selected the right block device when performing the next step!! |
$ xzcat 20210217-0609-postmarketOS-edge-phosh-6-purism-librem5-installer.img.xz | sudo dd of=/dev/DRIVE status=progress bs=1M oflag=direct iflag=fullblock
4277141504 bytes (4.3 GB, 4.0 GiB) copied, 194 s, 22.0 MB/s
4093+0 records in
4093+0 records out
4291821568 bytes (4.3 GB, 4.0 GiB) copied, 200.427 s, 21.4 MB/s
Remove the usb cable and power cycle the phone to boot into the postmarketOS installer.
With pmbootstrap (Advanced)
Use pmbootstrap to build a customized image. Consult the installation guide for details.
$ pmbootstrap init # vendor: purism, device: librem5
$ pmbootstrap install... # add --fde for full disk encryption
Place the device into #Flash Mode, then flash it with:
$ pmbootstrap flasher flash_rootfs
Flash Mode
To place the Librem 5 info flashing mode, perform the following:
- Ensure that the phone is switched off.
- Turn all Hardware-Kill-Switches off
- Remove battery
- Hold volume-up
- Insert the USB-c cable: (red light blinks, no green light)
- Reinsert the battery: (red light is constantly on, the script will continue)
- Release volume-up
Some USB-C cables may need to be plugged into the phone with a particular orientation. If the instructions above do not appear to work, try flipping the USB-C end of the cable over and replugging it into the phone. |
These directions were gathered from Purism's documentation, refer to it for additional details/troubleshooting.
OpenPGP Smartcard
In order to use the OpenPGP smartcard reader, most Librem 5 phones will need to have the reader firmware upgraded. The firmware can be built from source, but Purism has created a helper script to download/flash the firmware. In order to run this script on Alpine Linux / postmarketOS, these patches should be applied: https://source.puri.sm/angus.ainslie/ttxs-firmware/-/merge_requests/3/diffs
Running the script should result in the following if it is successful:
$ ./scripts/stm_reflash.sh
Connecting to source.puri.sm (178.63.173.204:443)
saving to '/tmp/tmp.FLFPGo/ttxs.bin'
ttxs.bin 100% |********************************************************************************************************************************************************************| 9096 0:00:00 ETA
'/tmp/tmp.FLFPGo/ttxs.bin' saved
2a5f7172591d76ae3177b0ccd94f70d67597e4a7 /tmp/tmp.FLFPGo/ttxs.bin
0
1
1
stm32flash 0.6
http://stm32flash.sourceforge.net/
Using Parser : Raw BINARY
Interface serial_posix: 57600 8E1
Version : 0x31
Option 1 : 0x00
Option 2 : 0x00
Device ID : 0x0435 (STM32L43xxx/44xxx)
- RAM : Up to 48KiB (12544b reserved by bootloader)
- Flash : Up to 256KiB (size first sector: 1x2048)
- Option RAM : 16b
- System RAM : 28KiB
Write to memory
Erasing memory
Wrote address 0x08002388 (100.00%) Done.
0
0
1
Reboot the phone after upgrading the firmware.
The next step depends on a package that is not yet available, see: https://gitlab.com/postmarketOS/pmaports/-/merge_requests/1993 |
There's a package in the postmarketOS aports repo that enables/installs everything required to use a smartcard on this device: sudo apk add device-purism-librem5-smartcard
. Reboot after installing this package for the first time.
For more information, including some examples of how to generate keys and push existing keys to the smart card using gpg
, see Purism's Librem Key manual: https://docs.puri.sm/Librem_Key/Getting_Started/User_Manual.html
eMMC Backup / Restore
This section describes one method of backing up the eMMC and restoring that backup. postmarketOS, like many other Linux distros, can work with any number of backup/restore solutions (e.g. rsnapshot, and so on). This particular method uses JumpDrive and ddrescue
, and therefore is out-of-band from postmarketOS (or any distro) on the eMMC. An entire copy of the eMMC will be produced, with full disk encryption preserved if it is enabled.
The steps to prepare the Librem 5 are the same for backing up and restoring a disk backup:
- #Download JumpDrive
- Place the device into #Flash Mode
- #Boot JumpDrive
ddrescure
is needed on the host PC. See the ddrescue
manpage for information on additional parameters you might want to use.
Identify the Librem 5 eMMC disk using lsblk. The following options make it relatively easy to identify the correct disk, but check multiple times that you have the correct drive!
$ lsblk -o name,size,model,vendor |grep JumpDriv
sdb 29.1G e_eMMC JumpDri
Backup
Run ddrescue
. Specifying a map file is recommended so that the process can be resumed if it is interrupted.
# ddrescue -v -d -r3 /dev/sdb L5_pmOS_20210210.disk L5_pmOS_20210210.disk.map
...
Restore
Make sure you have the correct target drive before proceeding. ddrescure will overwrite the drive! You have been warned! |
The backup image can be restored with ddrescue
:
# ddrescue -f ~/L5_pmOS_20210210.disk /dev/sdb ddrescue_restore.log
...
Known Issues
For an ever-up-to-date list of issues, see issues in gitlab with the device-purism-librem5 label
- Suspend/resume is not supported on the Librem 5, this is an upstream issue and not specific to postmarketOS.