Reflashing the Librem 5, Up-to-Date Tutorial

This was the original version of the script. The one referred to in the tutorial is the updated script that defaults to the LUKS variant.

Try using the --stable argument.

2 Likes

librem5-flash-image --stable

It’s not recognizing that argument - “unrecognized arguments: --stable”.

2 Likes

It works in PureOS 10.3 ‘Byzantium’:

librem5-flash-image --stable                         
2024-08-10 17:26:24 INFO Looking for librem5r4 plain byzantium image
2024-08-10 17:26:25 INFO Found disk image Build "stable" 'Last stable librem5r4 build' from Fri Jun 23 22:43:18 2023
2024-08-10 17:26:27 INFO Found uboot Build 85 from Thu Aug 25 06:22:41 2022
2024-08-10 17:26:27 INFO Downloading to ./tmp_librem5-flash-image_z_fckcxx
2024-08-10 17:26:27 INFO Downloading image from https://storage.puri.sm/librem5/images/byzantium/latest/librem5r4/plain/artifact/librem5r4.img.xz

Try using PureOS 10.3 on a USB drive.

2 Likes

Dang - more extra work than I hoped. I guess the script in the Ubuntu(?) repo is outdated.

I wonder if compiling it myself would be easier (ok, probably not)… we really shouldn’t need a specific distro to do this. :frowning:

2 Likes

There may be a workaround:

  1. Download the librem5r4 plain byzantium image:
https://storage.puri.sm/librem5/images/byzantium/latest/librem5r4/plain/artifact/librem5r4.img.xz
  1. Download uboot Build 85:
https://arm01.puri.sm/job/u-boot_builds/job/uboot_librem5_build/lastSuccessfulBuild/artifact/output/uboot-librem5/u-boot-librem5.imx
  1. Place them in the $HOME directory, then extract librem5r4.img.xz.
  2. Run this command:
librem5-flash-image --stable --skip-download --dir ~/
3 Likes

Thanks! There we go, that’s exactly what I was hoping to do but I couldn’t find the dang image to download. Ended up looking at a Jenkins server, a lot of recent broken builds, couldn’t find something that looked like stable and gave up!

Will I be able to find sha256 checksums to verify the downloads? (Since that’s what brought me here really!)

2 Likes

Yes, the librem5r4 plain byzantium image checksum is provided within meta.yml:

gitrev: afaabdbe43650b83744922353f86027cd555c474
image:
  size: 4500000256
  sha256sum: 6cfc1c2671a76baf3fc72ca611856143e3b74c969239ac8a695ce881a1467672

For uboot Build 85, the checksum is provided within u-boot-librem5-git.txt:

https://source.puri.sm/Librem5/uboot-imx.git
0c1162a11d5f9736edde7a30cf0085f3e0277b47
2 Likes

Yeah. Something appears wack here - it still doesn’t match the new download either (the .xz file OR the extracted .img which was failing earlier). Original error seems to be legit.

The timestamps of the file and checksum yml are are slightly different too. I think we need someone from Purism to look at this and find out what’s going on.

1 Like

@JCS

Okay, in the meantime, you can try using the actual latest image from April 2024:

https://storage.puri.sm/librem5/images/byzantium/2024.04/librem5r4/plain/artifact/librem5r4.img.xz

Contents of meta.yml:

gitrev: b44f37c67f402a59f721c56d904712650a535c5a
image:
  size: 4500000256
  sha256sum: 2d73bc8a2a8e01e425cfc773764d8d9dd96c91ad14d9f847d3df3f7642fe3965
3 Likes

Thanks that looks much better. I’m going to start a related thread in another forum for some commentary since otherwise it’ll veer way off topic.

3 Likes

I’ve updated the official instructions. They are now improved.

4 Likes

Two notes:

  1. Udev rules overflow past viewport on mobile.
  2. --stable argument can be removed.

2 Likes

It should work either way but it has been broken in the recent past either way (for different reasons) i.e. no guarantee that it will work either way. I’m assuming that the plain stable hash will be fixed sooner rather than later.

I decided that “stable” should be more “true to name” i.e. more likely to be stable and working. So I left it there.

(Technically speaking, I wasn’t the one who added that. It was added by A N Other between my first batch of changes and my second batch of changes.)

Unfortunate. But the reality is that you do need another computer in order to carry out this procedure and most people will be doing it on a desktop / laptop with a full size screen. You can’t carry out this procedure on the phone that you will be reflashing.

2 Likes

Okay, well here are alternative instructions for installing the udev rules:

  1. Open GNU Nano, then copy and save the udev rules:
sudo nano /etc/udev/rules.d/70-librem5-flash-image.rules
SUBSYSTEM!="usb", GOTO="librem5_devkit_rules_end"
# Devkit USB flash
ATTR{idVendor}=="1fc9", ATTR{idProduct}=="012b", GROUP+="plugdev", TAG+="uaccess"
ATTR{idVendor}=="0525", ATTR{idProduct}=="a4a5", GROUP+="plugdev", TAG+="uaccess"
ATTR{idVendor}=="0525", ATTR{idProduct}=="b4a4", GROUP+="plugdev", TAG+="uaccess"
ATTR{idVendor}=="316d", ATTR{idProduct}=="4c05", GROUP+="plugdev", TAG+="uaccess"
LABEL="librem5_devkit_rules_end"
  1. Reload the udev rules:
sudo udevadm control --reload-rules
2 Likes

I believe you don’t even need the udev rules if you prefix the use of the script when doing the actual reflash with sudo which is what I did.

2 Likes

Are you aware of any updated tutorials for making sure your firmware is all updated?

1 Like

You are already aware of it:

I am certain there are more unlisted firmware, but instructions for updating them to their latest versions on the Librem 5 are not available.

1 Like

Thank you. I could not build all of the dependencies from your previous helpful post. Therefore the “instructions” are incomplete or possibly inaccurate, from my perspective.

1 Like

Create a separate topic and I will address your issue.

1 Like

I am not aware of one. Unless you are actually experiencing a problem, it may not be a good idea to change firmware, particularly if you won’t be able to go backwards. In other words, your starting point would be to download the version that you currently have.

dos gave you two more.

I would be inclined to drop uboot off that list. Running the reflashing script should automatically get you the latest uboot and no further action is required.

The firmware jail is more complex if you have an original phone i.e. there is no firmware jail, and that isn’t the way to mess with the Redpine firmware. By contrast, if you have a phone that came with or was upgraded to a SparkLAN card then you have a firmware jail and that is the way to update the SparkLAN firmware. If you have an original phone then with care you may be able to create the firmware jail and make the necessary changes so that it is used with Redpine (but I haven’t bothered).

The BM818 firmware is only on that list theoretically, since Purism has not made any information public as to how you get an updated firmware file and how you get it into the modem.

So here would be my updated list:

  1. Smartcard Reader
  2. USB PD controller
  3. SparkLAN card (/ alternatively maybe the Redpine card if certain conditions are met)
  4. Touchscreen controller
  5. GNSS module

I have only tackled the first two on my phone.

1 Like