I need advise before I sale my Librem 5 - Edit : solved

I’d like to sell my Librem 5 Evergreen Europe version, which, it must be said, has seen very little use. I’d like to know :

  • how to delete my data and return it to factory settings.
  • In addition, I had encrypted the phone at startup. How can I ensure that the buyer can find a decrypted phone?

Thank you for your help.

1 Like

Follow these instructions:

In step 4, once you are ready to download and flash the Librem 5, use this command instead:

./scripts/librem5-flash-image --stable --variant plain
1 Like

Thank you very much, I really appreciate the link and your advise. I hope to do it quickly, I wish you a nice day !

1 Like

Hello @FranklyFlawless I have an issue : I am on Fedora so I cannot find instructions to install uuu. Do you have any information about this please ? thank you

I think something in the settings like “factory reset” option would be so much easier

1 Like

Create a Live USB with a Debian 12 ‘Bookworm’ image using balenaEtcher, boot it, then proceed to follow the aforementioned instructions:

It would but

  • for sure that will only work when the phone is actually working normally, and
  • as currently implemented, a GUI menu function isn’t really an option anyway.

To elaborate on the first point … if a customer installs some rogue package while “tinkering” and the result is that the phone won’t boot anymore then a “Reset to Factory Settings” GUI option would be completely useless. So there will always be a need for some kind of more robust but more difficult “reset” procedure.

To elaborate on the second point, you can’t trash the eMMC drive while you are booted from it. … One way that might work is … image a vanilla disk image to a µSD card, boot the phone from the µSD card, then image the vanilla disk image to the phone’s eMMC drive. That is, by booting from µSD card, you can then trash the eMMC drive.

Also,

The solution given in the first reply is only a safe choice if you had indeed encrypted the phone. If you were using the phone with an unencrypted disk then reflashing is not a safe choice. In my opinion, for this reason, if no other, it is desirable to use the phone encrypted (even if you use a short, useless LUKS passphrase).

1 Like

@irvinewade @FranklyFlawless

So I have followed the instructions exactly as the video and documentation. I have also used a live Debian USB.

1st attempt was unsuccessful :

Searching...
uuu (Universal Update Utility) for nxp imx chips -- lib1.4.193

Success 0    Failure 1                                                         
                                                                                
                                                                                
3:11     1/ 0 [Failure open usb device,Try sudo uuu  ] 

After searching in the threads, I’ve found that sudo shoud be used.

2nd attempt was destructive :
the Librem 5 is briked → bootloop and no possibility to get red LED (it becomes green after 1 second). The error message is :

user@debian:~/librem5-flash-image$ sudo ./scripts/librem5-flash-image --stable --variant plain
2025-01-31 16:26:20 INFO Looking for librem5r4 plain byzantium image
2025-01-31 16:26:21 INFO Found disk image Build "stable" 'Last stable librem5r4 build' from Tue Oct 22 20:00:28 2024
2025-01-31 16:26:22 INFO Found uboot Build 85 from Thu Aug 25 13:22:41 2022
2025-01-31 16:26:22 INFO Downloading to ./tmp_librem5-flash-image_qo3ng1jp
2025-01-31 16:26:23 INFO Downloading image from https://storage.puri.sm/librem5/images/byzantium/latest/librem5r4/plain/artifact/librem5r4.img.xz
                                                                                                       2025-01-31 16:28:22 INFO Calculating sha256sum of ./tmp_librem5-flash-image_qo3ng1jp/librem5r4.img       
2025-01-31 16:28:25 INFO Downloading uboot from https://arm01.puri.sm/job/u-boot_builds/job/uboot_librem5_build/85/artifact/output/uboot-librem5/u-boot-librem5.imx
                                                                                                        
            Enter the flashing mode by holding volume-up button while turning the phone on.

            If it's not detected, follow these steps:
            - Ensure that the phone is powered off
            - Turn all Hardware-Kill-Switches off
            - Unplug the USB cable if connected
            - Remove battery
            - Hold volume-up button
            - Insert the USB-C cable (red light blinks, no green light)
            - Reinsert the battery (red and green lights constantly on, the script will continue)
            - Release volume-up button

Searching...
uuu (Universal Update Utility) for nxp imx chips -- lib1.4.193

Success 0    Failure 1                                                                                 
                                                                                                        
                                                                                                        
3:11     3/ 5 [Bulk(W):LIBUSB_ERROR_TIMEOUT          ] FB: flash -raw2sparse all librem5r4.img          


2025-01-31 16:31:06 INFO Cleaning up.
Traceback (most recent call last):
  File "/home/user/librem5-flash-image/./scripts/librem5-flash-image", line 546, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/user/librem5-flash-image/./scripts/librem5-flash-image", line 529, in main
    flash_image(uuu_target, args.debug)
  File "/home/user/librem5-flash-image/./scripts/librem5-flash-image", line 359, in flash_image
    subprocess.check_call(['uuu', uuu_target])
  File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['uuu', './tmp_librem5-flash-image_qo3ng1jp/flash_librem5r4.lst']' returned non-zero exit status 255.

You can imagine how annoyed I am that, after following the instructions, I have an inert object and I have probably wasted around $500 because it lacks a “factory reset” function (on encrypted Android, you can factory reset).

It’s just like my experience with Purism: a huge frustration and disappointment considering the promises of the initial campaign I’d enthusiastically taken part in.

Anyway, if anyone would be so kind as to help me out of this big problem, I’d be very grateful, thank you.

2 Likes

I don’t know how much this helps but I find that if I try to solve a technical problem frustrated I miss avenues for advancement.

I once purchased a bricked microsoft zune, one of the old hard drive models and it took me years to unbrick it. Finally I changed the index files to think my computer was the official microsoft update location and filled the file with the software the zune should have had before it was bricked.

2 Likes

sudo is not required if you create the documented udev rules:

The LIBUSB_ERROR_TIMEOUT is likely due to a faulty USB cable, so use a different one instead:

1 Like

:sunny: :tada::tada::tada: !!!

After listening to your advice (including changing the cable and connecting the phone to the PC’s USB 2 port), it finally worked and I now have an original image, and the phone is decrypted, so the potential new owner will be able to encrypt it.

Thanks for your help. Note that sudo was really necessary despite the command proposed earlier (see the code at the bottom of the post). I think the Purism team should give it a try and update the documentation if necessary (if sudo is required).

And really, an option for resetting the phone is essential: holding down the volume-up button while plugging in a USB cable, then having to put a battery back in without releasing, I don’t think that’s reasonable.

Anyway, a huge thank you for your help!!!

user@debian:~/librem5-flash-image$ sudo ./scripts/librem5-flash-image --udev && ./scripts/librem5-flash-image --stable --variant plain
2025-02-01 13:34:51 INFO Udev rules '/etc/udev/rules.d/70-librem5-flash-image.rules' updated. You can now flash without root permissions.
2025-02-01 13:34:51 INFO Looking for librem5r4 plain byzantium image
2025-02-01 13:34:52 INFO Found disk image Build "stable" 'Last stable librem5r4 build' from Tue Oct 22 20:00:28 2024
2025-02-01 13:34:55 INFO Found uboot Build 85 from Thu Aug 25 13:22:41 2022
2025-02-01 13:34:55 INFO Downloading to ./tmp_librem5-flash-image_458zaqq5
2025-02-01 13:34:56 INFO Downloading image from https://storage.puri.sm/librem5/images/byzantium/latest/librem5r4/plain/artifact/librem5r4.img.xz
Download:  10%|███▉                                   | 91209728/896986412 [00:14<01:45, 7665871.64it/s]^C2025-02-01 13:35:11 ERROR CTRL-C pressed.       | 534237589/4500000256 [00:12<00:07, 560383184.73it/s]
                                                                                                       2025-02-01 13:35:11 INFO Cleaning up.                                                                    
user@debian:~/librem5-flash-image$ 
user@debian:~/librem5-flash-image$ 
user@debian:~/librem5-flash-image$ sudo ./scripts/librem5-flash-image --udev
2025-02-01 13:35:17 INFO Udev rules '/etc/udev/rules.d/70-librem5-flash-image.rules' already present
user@debian:~/librem5-flash-image$ 
user@debian:~/librem5-flash-image$ 
user@debian:~/librem5-flash-image$ ./scripts/librem5-flash-image --stable --variant plain
2025-02-01 13:35:26 INFO Looking for librem5r4 plain byzantium image
2025-02-01 13:35:27 INFO Found disk image Build "stable" 'Last stable librem5r4 build' from Tue Oct 22 20:00:28 2024
2025-02-01 13:35:28 INFO Found uboot Build 85 from Thu Aug 25 13:22:41 2022
2025-02-01 13:35:28 INFO Downloading to ./tmp_librem5-flash-image_f_gehslh
2025-02-01 13:35:29 INFO Downloading image from https://storage.puri.sm/librem5/images/byzantium/latest/librem5r4/plain/artifact/librem5r4.img.xz
                                                                                                       2025-02-01 13:37:32 INFO Calculating sha256sum of ./tmp_librem5-flash-image_f_gehslh/librem5r4.img       
2025-02-01 13:37:35 INFO Downloading uboot from https://arm01.puri.sm/job/u-boot_builds/job/uboot_librem5_build/85/artifact/output/uboot-librem5/u-boot-librem5.imx
                                                                                                        
            Enter the flashing mode by holding volume-up button while turning the phone on.

            If it's not detected, follow these steps:
            - Ensure that the phone is powered off
            - Turn all Hardware-Kill-Switches off
            - Unplug the USB cable if connected
            - Remove battery
            - Hold volume-up button
            - Insert the USB-C cable (red light blinks, no green light)
            - Reinsert the battery (red and green lights constantly on, the script will continue)
            - Release volume-up button

Searching...
uuu (Universal Update Utility) for nxp imx chips -- lib1.4.193

Success 1    Failure 0                                                                                 
                                                                                                        
                                                                                                        
3:2      5/ 5 [Done                                  ] FB: Done                                         


Flashing complete.
2025-02-01 13:59:25 INFO Cleaning up.
user@debian:~/librem5-flash-image$ 

1 Like

Technically sudo is required to install the udev rules, but not for running the script itself: