Skip to content

Instantly share code, notes, and snippets.

@atomicstack
Last active May 6, 2025 12:36
Show Gist options
  • Select an option

  • Save atomicstack/9c43e452c4b7cefb37c1e78f65b0b1fa to your computer and use it in GitHub Desktop.

Select an option

Save atomicstack/9c43e452c4b7cefb37c1e78f65b0b1fa to your computer and use it in GitHub Desktop.
a one-liner to fetch the latest revisions of /boot/*.{elf,dat} in the RPi firmware repository (because it's a 14GB repo and cloning takes forever, and we're only interested in ~20MB of data). requires the command line utils wget and jq
wget --base=https://github.com/raspberrypi/firmware/raw/master/ -i <( wget -qO- https://github.com/raspberrypi/firmware/raw/master/boot/ | grep 'react-app.embeddedData' | perl -nE 's{\s+<script[^>]+>}{}; s{</script>}{}; say' | jq -r '.payload.tree.items[].path | select(test("(elf|dat)$"))' )
@timrhaynes
Copy link
Copy Markdown

This no longer works, and generates errors such as:
.......
,"/raspberrypi/firmware/branches/fetch_and_merge/master?discard_changes=true":{"post":"-KuOtqs9-1Xg9xIcG2zce2hhhkuZUIX81if433BCOtsbDbgri0DKxt8GkgE7WaH64FPNOZsXc0JmBW6lSx3S5g"}}},"title":"firmware/boot: Bad port number.
--2023-08-29 16:33:55-- http://at/
Resolving at (at)... failed: No such host is known. .
wget: unable to resolve host address 'at'
--2023-08-29 16:33:57-- http://master/
Resolving master (master)... failed: No such host is known. .
wget: unable to resolve host address 'master'
--2023-08-29 16:34:00-- http://xn--uba/
Resolving xn--uba (xn--uba)... failed: No such host is known. .
wget: unable to resolve host address 'xn--uba'
--2023-08-29 16:34:03-- http://raspberrypi/firmware%22%7D
Resolving raspberrypi (raspberrypi)... failed: No such host is known. .
wget: unable to resolve host address 'raspberrypi'

Any chance you could provide a quick fix? Would hate to download that 14GB repo! Thank you

@atomicstack
Copy link
Copy Markdown
Author

atomicstack commented Aug 29, 2023

Looks like GitHub now returns JSON where it previously returned HTML. I've added a new revision that uses wget+jq to extract the relevant URLs.

@atomicstack
Copy link
Copy Markdown
Author

Updated again to deal with embedded JSON

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment