./scripts/librem5-flash-image --board devkit fails with ERROR No matching image found

Any idea how to resurrect my devkit? TIA!

1 Like

Welcome back to the Purism community forums. What I suggest is to manually download the image from Jenkins, extract its archive, then use the --skip-download and --dir arguments/flags to reference the image directory. You may need to use --stable as well to bypass the Jenkins API check.

https://arm01.puri.sm/job/Images/job/Image%20Build/17125/

1 Like

Thanks for the quick reply!
Downloading the image worked, but the script seems to insist on trying to download, even with and without --stable (plus --dir ~/Downloads/ plus --skip-download).
Maybe I just change the Python code.

1 Like

Btw. do I need a new u-boot, too? Mine is probably some years old :slight_smile:

1 Like

Probably, but I am not certain if the mainline build image is compatible with the devkit, so use the devkit build image instead:

https://arm01.puri.sm/job/u-boot_builds/job/uboot_devkit_build/94/

Use the --debug argument/flag with the other arguments/flags and provide its output.

1 Like
$ sudo ./scripts/librem5-flash-image --board devkit --debug --dir ~/librem5/ --skip-cleanup --skip-download
2024-05-30 15:39:15,546 INFO Looking for devkit luks byzantium image
2024-05-30 15:39:15,548 DEBUG Starting new HTTPS connection (1): arm01.puri.sm:443
2024-05-30 15:39:16,206 DEBUG https://arm01.puri.sm:443 "GET /api/json HTTP/1.1" 200 448
2024-05-30 15:39:16,233 DEBUG handle_other(): Handling: 200
2024-05-30 15:39:16,233 ERROR handle_other(): Mutual authentication failed
2024-05-30 15:39:16,238 DEBUG Starting new HTTPS connection (2): arm01.puri.sm:443
2024-05-30 15:39:16,787 DEBUG https://arm01.puri.sm:443 "GET /api/json HTTP/1.1" 200 448
2024-05-30 15:39:16,898 DEBUG https://arm01.puri.sm:443 "GET /crumbIssuer/api/json HTTP/1.1" 200 154
2024-05-30 15:39:17,011 DEBUG https://arm01.puri.sm:443 "GET /job/Images/job/Image%20Build/api/json?depth=0 HTTP/1.1" 200 1069
2024-05-30 15:39:17,014 DEBUG Starting new HTTPS connection (1): arm01.puri.sm:443
2024-05-30 15:39:17,554 DEBUG https://arm01.puri.sm:443 "GET /job/Images/job/Image%20Build/17136//api/json HTTP/1.1" 200 942
2024-05-30 15:39:17,564 DEBUG Starting new HTTPS connection (1): arm01.puri.sm:443
2024-05-30 15:39:18,068 DEBUG https://arm01.puri.sm:443 "GET /job/Images/job/Image%20Build/17135//api/json HTTP/1.1" 200 947
2024-05-30 15:39:18,073 DEBUG Starting new HTTPS connection (1): arm01.puri.sm:443
2024-05-30 15:39:18,608 DEBUG https://arm01.puri.sm:443 "GET /job/Images/job/Image%20Build/17134//api/json HTTP/1.1" 200 949
2024-05-30 15:39:18,613 DEBUG Starting new HTTPS connection (1): arm01.puri.sm:443
2024-05-30 15:39:19,181 DEBUG https://arm01.puri.sm:443 "GET /job/Images/job/Image%20Build/17133//api/json HTTP/1.1" 200 943
2024-05-30 15:39:19,187 DEBUG Starting new HTTPS connection (1): arm01.puri.sm:443
2024-05-30 15:39:19,725 DEBUG https://arm01.puri.sm:443 "GET /job/Images/job/Image%20Build/17132//api/json HTTP/1.1" 200 948
2024-05-30 15:39:19,729 DEBUG Starting new HTTPS connection (1): arm01.puri.sm:443
2024-05-30 15:39:20,241 DEBUG https://arm01.puri.sm:443 "GET /job/Images/job/Image%20Build/17131//api/json HTTP/1.1" 200 969
2024-05-30 15:39:20,248 DEBUG Starting new HTTPS connection (1): arm01.puri.sm:443
2024-05-30 15:39:20,754 DEBUG https://arm01.puri.sm:443 "GET /job/Images/job/Image%20Build/17130//api/json HTTP/1.1" 200 950
2024-05-30 15:39:20,758 DEBUG Starting new HTTPS connection (1): arm01.puri.sm:443
2024-05-30 15:39:21,280 DEBUG https://arm01.puri.sm:443 "GET /job/Images/job/Image%20Build/17129//api/json HTTP/1.1" 200 951
2024-05-30 15:39:21,284 DEBUG Starting new HTTPS connection (1): arm01.puri.sm:443
2024-05-30 15:39:21,818 DEBUG https://arm01.puri.sm:443 "GET /job/Images/job/Image%20Build/17128//api/json HTTP/1.1" 200 948
2024-05-30 15:39:21,822 DEBUG Starting new HTTPS connection (1): arm01.puri.sm:443
2024-05-30 15:39:22,363 DEBUG https://arm01.puri.sm:443 "GET /job/Images/job/Image%20Build/17127//api/json HTTP/1.1" 200 949
2024-05-30 15:39:22,366 DEBUG Starting new HTTPS connection (1): arm01.puri.sm:443
2024-05-30 15:39:22,901 DEBUG https://arm01.puri.sm:443 "GET /job/Images/job/Image%20Build/17126//api/json HTTP/1.1" 200 946
2024-05-30 15:39:22,908 DEBUG Starting new HTTPS connection (1): arm01.puri.sm:443
2024-05-30 15:39:23,392 DEBUG https://arm01.puri.sm:443 "GET /job/Images/job/Image%20Build/17125//api/json HTTP/1.1" 200 945
2024-05-30 15:39:23,397 DEBUG Starting new HTTPS connection (1): arm01.puri.sm:443
2024-05-30 15:39:23,934 DEBUG https://arm01.puri.sm:443 "GET /job/Images/job/Image%20Build/17124//api/json HTTP/1.1" 200 945
2024-05-30 15:39:23,938 DEBUG Starting new HTTPS connection (1): arm01.puri.sm:443
2024-05-30 15:39:24,470 DEBUG https://arm01.puri.sm:443 "GET /job/Images/job/Image%20Build/17123//api/json HTTP/1.1" 200 968
2024-05-30 15:39:24,476 DEBUG Starting new HTTPS connection (1): arm01.puri.sm:443
2024-05-30 15:39:24,979 DEBUG https://arm01.puri.sm:443 "GET /job/Images/job/Image%20Build/17122//api/json HTTP/1.1" 200 949
2024-05-30 15:39:24,985 DEBUG Starting new HTTPS connection (1): arm01.puri.sm:443
2024-05-30 15:39:25,480 DEBUG https://arm01.puri.sm:443 "GET /job/Images/job/Image%20Build/17121//api/json HTTP/1.1" 200 945
2024-05-30 15:39:25,487 DEBUG Starting new HTTPS connection (1): arm01.puri.sm:443
2024-05-30 15:39:25,993 DEBUG https://arm01.puri.sm:443 "GET /job/Images/job/Image%20Build/17120//api/json HTTP/1.1" 200 949
2024-05-30 15:39:25,997 DEBUG Starting new HTTPS connection (1): arm01.puri.sm:443
2024-05-30 15:39:26,555 DEBUG https://arm01.puri.sm:443 "GET /job/Images/job/Image%20Build/17119//api/json HTTP/1.1" 200 951
2024-05-30 15:39:26,561 DEBUG Starting new HTTPS connection (1): arm01.puri.sm:443
2024-05-30 15:39:27,142 DEBUG https://arm01.puri.sm:443 "GET /job/Images/job/Image%20Build/17118//api/json HTTP/1.1" 200 950
2024-05-30 15:39:27,149 DEBUG Starting new HTTPS connection (1): arm01.puri.sm:443
2024-05-30 15:39:27,700 DEBUG https://arm01.puri.sm:443 "GET /job/Images/job/Image%20Build/17117//api/json HTTP/1.1" 200 941
2024-05-30 15:39:27,704 ERROR No matching image found
1 Like

Add --stable and see if that forces a URL redirection.

1 Like
$ sudo ./scripts/librem5-flash-image --board devkit --debug --dir ~/librem5 --skip-cleanup --skip-download --stable
[sudo] password for wmb: 
2024-05-30 17:39:05,580 INFO Looking for devkit luks byzantium image
2024-05-30 17:39:05,585 DEBUG Starting new HTTPS connection (1): storage.puri.sm:443
2024-05-30 17:39:06,366 DEBUG https://storage.puri.sm:443 "HEAD /librem5/images/byzantium/latest/devkit/luks/artifact/devkit.img.xz HTTP/1.1" 404 0
Traceback (most recent call last):
  File "/usr/local/src/purism/librem5-flash-image/./scripts/librem5-flash-image", line 538, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/src/purism/librem5-flash-image/./scripts/librem5-flash-image", line 464, in main
    image_ref = find_image(args.image_job, board, args.variant, args.dist, args.stable)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/src/purism/librem5-flash-image/./scripts/librem5-flash-image", line 273, in find_image
    return find_image_stable(board, variant, dist)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/src/purism/librem5-flash-image/./scripts/librem5-flash-image", line 262, in find_image_stable
    resp.raise_for_status()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://storage.puri.sm/librem5/images/byzantium/latest/devkit/luks/artifact/devkit.img.xz
1 Like

Installing the udev rules may help:

sudo ./scripts/librem5-flash-image --udev

From the librem5-flash-image documentation:

Reflashing the Phone

Other than this resource, wait until @dos provides an answer.

1 Like

I did this before. Now the script says (rightfully), that the udev rule file already does exist.

1 Like

Try executing the script without sudo and see if anything changes. Additionally, use --variant plain as the devkit image does not use LUKS. The script seems to require the image to be within a specific directory, so you can try moving it there.

mkdir -p /librem5/images/byzantium/latest/devkit/plain/artifact/
mv devkit.img.xz ~/librem5/images/byzantium/latest/devkit/plain/artifact/

This command assumes you downloaded the image to $HOME.

1 Like

Don’t know if this could help, but this howto Development Kits - How To Guides - Flashing the System Image talk about a librem5-devkit-flash-image. So a different script. Maybe it’s outdated.

2 Likes

Oh, I found my error. I missed the xz -d step!
Now, it seems to work.
Still flashing.

1 Like

Yeah, that’s outdated. Now one is a symlink to the other.

2 Likes

Hm, how long is the flash process supposed to run?
It looks like it were looping again and again over the same files?

EDIT: My twelve years old PC can probably not provide 900 mA on USB. Need to try next week with a modern one.

1 Like

Btw. to start flash, I had to comment out the code block of seven lines below Check available downloads upfront ...

1 Like

The script should immediately present this text:

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
2 Likes

It doesn’t do that if board == "devkit": (line 519)

2 Likes