Reflashing the Phone¶
This guide describes how to reflash the system image on your Librem 5 phone from another computer, hereinafter referred to as the workstation, using a USB-A to USB-C cable. Unless otherwise stated, all shell commands are executed on the workstation, not on the phone.
Overview¶
To erase the existing image on the internal eMMC and install a new image, you need to download the following items:
- An appropriate version of the
uuu
tool.- Scripts from the librem5-flash-image repository.
Then you will need to run the flashing script to reflash the phone’s system software.
These steps are covered in the sections below.
Download the Flashing Scripts¶
Files from the librem5-flash-image repository are responsible for downloading the image files and transferring them to the phone. Other scripts are used to help with building tools.
In a terminal, clone the librem5-flash-image repository before proceeding.
In order to do this, you will need to have the git command available. You can see whether that command is available by using the shell command which git and if you get no output then you don’t have that command available and you should first do
sudo apt install git
then, as the git command is (now) available, proceed with:
git clone https://source.puri.sm/Librem5/librem5-flash-image.git
The librem5-flash-image
directory will be created. Make this directory the current directory:
cd librem5-flash-image
You are now ready to install uuu
.
Install uuu¶
Note
The uuu
tool requires a 64-bit host to run and is packaged as an amd64
binary.
Note
For Ubuntu, enable the Universe repository to install uuu
: sudo add-apt-repository universe
If you are using PureOS, Debian, or a recent Ubuntu derivative, install uuu
by opening a terminal and entering the following command:
sudo apt install uuu
Flash the Image¶
You should now be ready to flash a new image.
This will erase the contents of the phone’s eMMC, including user data.
First, check that everything is ready:
- Check that the
librem5-flash-image
directory is the current directory.- Make sure you have installed all python dependencies
sudo apt build-dep .
- Install the udev rules
sudo ./scripts/librem5-flash-image --udev
Run the following script to download and flash the latest image. By default, the script will assume it’s flashing Evergreen; however, you can pass in the different version to the --board
option. Use librem5r2
for Birch and Chestnut series phones, librem5r3
for Dogwood.
$ ./scripts/librem5-flash-image --stable
Once the script downloads the image, you’ll be prompted to attach the Librem 5 for flashing. The phone itself will not provide an indication of the boot mode – the script will simply continue once you follow these steps:
- Ensure that the phone is switched off.
- Turn all Hardware-Kill-Switches off i.e. switches in the powered off / disabled / towards the bottom of the phone position
- 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
Note
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.
The purpose of operating the Hardware Kill Switches in this procedure is to keep the power consumption as low as possible, in order to maximize the chances of a successful boot even with a deeply depleted battery and under-powered USB source. It is entirely possible that this procedure will work even if you do not operate the kill switches as described.
Successful output will look something like this:
uuu (Universal Update Utility) for nxp imx chips -- libpureos/1.2.91+0git6b465-62-g9c56e46
Success 1 Failure 0
Remove the USB C cable and hold down the power button for 15-18 seconds to reset the phone.
Your phone should now be running the latest image.