Time to flash is now - but how?

Need to flash the L5 (so they say).

I’ve looked through many posts related to flashing, the docs, wiki, and read all the Flash Utility Post-Installation issues and need to flash, irregardless of the scary stuff.

QUESTION:
Where are the dload and flashing instructions?

TIA
~s

3 Likes

I already provided the same post to you in your other threads, so you are simply going to need to read and execute it.

3 Likes

That part of it should only be necessary if you don’t have a reasonable distro already running on a desktop / laptop. Hence, for example, if your starting point is “only Windows:face_vomiting: then you would indeed need to download PureOS for x86 and use Windows to “burn” that to a flash drive in order to do a Live Boot in order to do the whole reflash of the Librem 5.

On the other hand, if you already have a current e.g. Ubuntu version running on a desktop / laptop then you can use that directly.

I believe that @Sharon has a working desktop / laptop running a Debian-family distro.

Whatever distro you have, it will need a working git command and a working uuu command.

And you’ll need a good internet connection, since the download of the Librem 5 disk image is up to around 4 GB.

First of all, if you have anything worth saving on the Librem 5 as it is now then save it (e.g. copy some stuff from the main disk to the µSD card that you may have in the Librem 5). In fact, I chose also to use Jumpdrive to image the entire Librem 5 before reflashing (just in case). However that then adds to your workload.

Secondly, the previously linked official documentation for “reflashing the phone” does the whole job. Downloads the needed disk image, plus a few other needed files, and then invokes the uuu command, which is the command that effects the actual flashing.

One thing that I think is missing from the official doco … it does not invite you to choose between the encrypted variant and the unencrypted variant. To make this choice, the command

./scripts/librem5-flash-image

should have either  --variant luks or  --variant plain added to the end of the command. If you make no choice, from wandering through the Python code, it looks as if it defaults to luks, which is a good safe private default but may not suit everyone. (On the other hand, it is relatively painful to change from plain to luks or from luks to plain after the fact - so this is a choice that you want to think about and make before you start.)

And one other thing … if you don’t do the “udev” thing that is mentioned in the instructions then you will need to precede the above command with sudo

So, for example,

sudo ./scripts/librem5-flash-image --variant luks

6 Likes

I have a desktop with PureOS on it.

Whomever wrote the docs for devs did the right thing - ignored newbies. The instructions are for the Devs because I’m sure they understand the lingo.

It begins with:

The Librem 5 gets reflashed from a separate 64-bit x86 computer running PureOS (or booted from the live PureOS disk).

Reflashing from that computer is as simple as installing the needed packages:

sudo apt install git python3-jenkins python3-tqdm uuu
Downloading the flashing scripts:

git clone Librem5 / librem5-flash-image · GitLab
And flashing the phone for Evergreen (mass-produced version)

If there is a how-to connect L5-to-desktop to flash L5 from the desktop, it evades my searches.

…Installing the needed packages:

Install them on what, the L5 or the desktop?

Were it says:

  • An appropriate version of the uuu tool.

How are we supposed to know what the "appropriate version is? Latest, whatever that is, or a serial or version number that it must marry up to?

Lastly, I’ve followed every possible lead I could find and trundles through dozens of links to something with links to something else with link… get the picture.

The How to is all over the map.
This is too discombobulated and abhorrent IMO. Too easy to get lost, and too much of the if this then that else

Just to get rid of the klutzy Low disk space - how to clean out garbage

I bet if Puri set up a service desk they could charge a fee to fix that stuff. Who has the time to read novels without a end, and research out what some of the techinese actually means.

There goes another day of my life I’ll never get back,. A Whole Day! :unamused:

3 Likes

I agree that purism-Instructions on how-to burn Gnu on Librem 5 is cheaper/unclear for babies.
Could be @amosbatto to have Permit to rewrite new instructions on how burning image in Librem 5?

Purism | amosbatto

:face_with_symbols_over_mouth:

6 Likes

This was mentioned earlier, but did anyone try booting from SD card and then using dd to write to the eMMC? I always hear about the uuu special tool requirement, but if I can boot from an SD card and then flash PureOS to the eMMC using the one single basic linux dd command, why wouldn’t I?

I know people say that dd is dangerous for novice users and typos could nuke your device, but as far as I know I never made any bad typos with dd and so I never had that problem.

Conceptual steps (maybe I should try these myself):

  1. Install PureOS for Librem5 on any SD card using any device
  2. Boot SD card on Librem5 so that the main eMMC is not in use, but shows up as a known device
  3. Use dd with the .img of PureOS byzantium as input file, and eMMC as destination file
  4. boot Librem 5 without SD card…

Is it this easy? Or if not, why not??

2 Likes
  1. Turn the Librem 5 off.
  2. Follow the instructions on your desktop with PureOS on it using Terminal.
  3. When the script starts mentioning about the Librem 5, follow its corresponding instructions until all steps are completed.
1 Like

It’s there in the guide:
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

    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

In the section “Download the Flashing Scripts,” copy and paste the indicated commands into the command line on your computer, then execute.

I agree, the inclusion of the word “appropriate” is confusing. If you can install uuu with sudo apt install uuu, then it should work.

I agree. Note that this process does require reading, however, whether it’s in the guide, or reproduced right here.

LMAO. That would be a loooooooong one. :rofl:

P.S. The Overview is just that. It’s telling you what you are going to do in the next section of the guide, starting with “Download the Flashing Scripts.” You just need to copy, paste, and execute the commands in your computer’s terminal.

3 Likes

@Sharon , if you have any specific questions as you’re going through the process, ask them here, and someone will explain.

2 Likes

At the beginning of the developer’s documentation for reflashing the phone, there is a link to Purism’s blog post on how to do that. It is more concise than the developer’s documentation. Also, comparing the post to the documentation helped me clarify some parts of the documentation. The post also includes a video of the whole reflashing process. The video helped me to understand some parts by looking at how they paste the commands, manipulate the phone, and the expected output of the commands.

4 Likes

Regarding re-flashing L5

For me, it’s hard because the instructions assume end user knows how to install to a SD, and what little I think I know, I doubt I have the tools to run a cable to SD.


Your step guide is something many here understand but I am the very small minority (of 1?) who is trying to learn,

  1. Is that the SD that came w/ it, or the one the retailer put in it, or, do we purchase a special one, and where does it go? I know there is a mini-slot that the provider put in there. Is there room for another?
    (☋) I know there is room, and already have 64G in it. It took me a while to figure out how to - now then, how to access it.

  2. Somehow, we install PureOS on a SD card using, say a laptop.
    What’s a “eMMC” and how would we know it’s not in use but shows up as a device. How do we ask it if it’s in use?

  3. How is “dd” used with a .img? Where do we find “dd:” and where does the image come from?
    Too, It looks like we we need to input commands, I take it using the L5 keypad?

  4. Without a SD card, or deleting anything on SD, will that not disable what the mobile provider put in? :thinking:


There you have my “Or if not, why not’”
No one need to take the time to answer. I’ll just use PureOS on a dektop and burn to a USB stick and boot that - maybe. The SIM(?) card that’s in there has mobile setup by the mobile provider - do not want to use that card if I can. Too, the mobile provider just announced we need to update our mobile card and I’m still backing up stuff like photos and especially, pics attached to Chats before the dreaded flashing.


~s

3 Likes

More misunderstood stuff. I have nothing against reading, never meant to imply that. But I’ve had several good folk take the time to provide links which I read. And, something like ‘Use uuu to…’ I need to look up uuu, and most every other command. I looked up eMMC verses SSD, and the use term SD. Now wonder why a eMMC is even in it.

I mentioned before that it seems most people have years of experience, and is a hobby of sorts. People that have the time to leap over the geekinese and such.

If I had my druthers, I’d take it to shop and pay them to do it. But I don’t know of any who are capable.

I must put this aside -again, and read more.
~s

2 Likes
4 Likes

To be absolutely clear: install on the desktop.

Bear in mind that these instructions have to work even when you have completely broken your Librem 5 install and it is not even possible to install anything on the Librem 5.

Hence, in order to reflash, while the Librem 5 must be connected via USB cable to your host computer at the right step in the process, nothing is done by you on the Librem 5. All the commands / software steps are done on the host computer.

Might be a good approach if you can boot from an SD card. However in the worst case where you have completely scrozzled the content of your eMMC drive, my understanding is that you won’t be able to boot from an SD card. So there still needs to be a procedure to recover from the worst case - and that involves a host computer.

If you do decide to have a go with a procedure involving using an SD card, bear in mind that a typical Linux install can’t mount two file systems simultaneously with the same UUID. Using the procedure that you wrote, you will end up with the same UUID on the SD card and the eMMC drive. While that may not ever be a problem, you should give consideration to changing the UUID on the eMMC drive (new random) immediately after using dd to write the disk image to the eMMC drive.

Another step of course involves changing the master encryption key if using the LUKS variant of the disk image, again new random, but of course that always applies i.e. whether reflashing from host or trying your approach of going via SD card.

2 Likes

I’ve rewritten the instructions from @david.hamner’s video here in more direct language in a few simple steps. See if this helps.

Flashing the Librem 5 (Evergreen version)

These instructions are for the Evergreen version only, not the earlier development models. All data and downloaded apps will be erased, so back up any files you want to keep to either the micro-SD card or some other separate drive. Make note of any apps you will want to reinstall later.

On a computer running PureOS 10 byzantium or later, or Ubuntu 22.04 LTS jammy or later, or Debian 11 bullseye or later, or another Linux distribution that is based on those releases or later, and…

with the Librem 5 not yet attached:

1- Open the terminal, copy and paste the following to the command line, then press Enter to execute:

sudo apt install git python3-jenkins python3-tqdm uuu

That installs the needed python dependencies (Python is a programming language), and the uuu package: “Universal Update Utility.”

2- Now copy and paste the following to the command line, then press Enter to execute:

git clone https://source.puri.sm/Librem5/librem5-flash-image.git

That creates a directory (i.e. folder) on your computer, called “librem5-flash-image” and downloads the available flashing scripts to it. (Git is used by software developers to coordinate their work and keep track of changes in a software project.)

3- Now copy and paste the following to the command line, then press Enter to execute:

cd librem5-flash-image

That puts you inside the librem5-flash-image directory so that you can run the following commands. (“cd” is a terminal command meaning change to directory x.) Stay in this directory.

4- Now copy and paste only one of the following to the command line, then press Enter to execute:

(If you don’t want to bother with luks encryption, use:)

sudo ./scripts/librem5-flash-image --variant plain

(If you do want to use luks to encrypt the Librem 5:)

sudo ./scripts/librem5-flash-image --variant luks

That downloads the chosen OS image (disk image) and verifies the integrity of the download, and creates the needed .lst file, whereupon it executes uuu to flash the disk image to the Librem 5.

5- Once the scripts download has finished, follow the on-screen prompt 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. With the USB-A end of the cable attached to the computer, next:

    Ensure that the phone is switched off.

    Turn all Hardware-Kill-Switches off

    Remove battery

    Hold volume-up

    Insert the USB-C cable into the Librem 5: (red light blinks, no green light)

    Reinsert the battery: (red light is constantly on, the script will continue)

    Release volume-up

Note: 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.

In the terminal, you should see output similar to this, but not exactly the same:

uuu (Universal Update Utility) for nxp imx chips -- libpureos/1.2.91+0git6b465-62-g9c56e46

Success 1 Failure 0

6- 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 stable image.

EDIT: The package librem5-flash-image is now available from the latest Ubuntu-based repositories for direct install, and includes all dependencies. However, as it may necessitate alterations to the above steps, and no official instructions have been made available yet, the new procedure will be left for another time.

11 Likes

Minor suggested edits:

In step 2 …

downloads the available OS images to it

The git clone only downloads scripts. No OS images are downloaded I believe. (Hence this step is quite quick.)

In step 4 …

That downloads the scripts for flashing the OS image.

I believe that actually does the following job of:

  • downloading the chosen OS image (disk image)
  • verifying the download (do SHA256 and compare with the value from another file that gets downloaded, a small metadata file)
  • creating an additional file that is needed in order to use uuu (the .lst file)
  • and finally executes uuu to flash the disk image to the Librem 5.

(but doesn’t download any scripts)

On a s…l…o…w… internet connection, that can make the timing tricky - since the download could take a very long time and then suddenly uuu is running on the host computer and wanting you to connect the Librem 5 via USB cable and meanwhile you have wandered off to do something else.


I did submit a merge request to improve this doco a little. I think that MR may have stalled. However from that discussion it emerged, as you already know, that if you are really using a recent Ubuntu-based Linux distro, you don’t need the git clone at all because the script (package librem5-flash-image) is actually available in the distro’s repo and with correct dependencies that will install automatically. In other words, Purism has managed to upstream the needed script.

So this is both a good thing and a bad thing. It’s a good thing because potentially things get simpler. It’s a bad thing because potentially the instructions get less simple as they try to cover both customers who are using a suitable (recent) distro - and those who aren’t. :wink:

4 Likes

Fixed. Thanks for clarifying!

I’ll add a comment about the git command possibly not being needed.

2 Likes

It’s actually steps 1 and 2 that may not be needed. So you really need a Step 0. Install that package.

If it works (package exists) then skip Step 1 and 2. If it doesn’t work then do Steps 1 and 2

… but … steps 3 and 4 will be different too, I would guess, because the script location and directory location will be different.

I think you can see why the MR has stalled. :wink:

3 Likes

Just tested sudo apt install librem5-flash-image on my latest updated system. It succeeds, installs dependencies, etc., but does not create a directory called librem5-flash-image. Maybe step 4 is no longer needed? (Check above; I’m in the process of renumbering the steps.)

1 Like