Skip to content

Instantly share code, notes, and snippets.

@atomicstack
Last active August 29, 2023 22:56
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save atomicstack/9c43e452c4b7cefb37c1e78f65b0b1fa to your computer and use it in GitHub Desktop.
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/tree/master/boot | jq -r '.payload.tree.items[].path | select(test("(elf|dat)$"))' )
@timrhaynes
Copy link

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

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