Skip to content

Instantly share code, notes, and snippets.

@jphastings
Created March 27, 2021 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jphastings/c45b765ba80ce265b0559ed14edfa149 to your computer and use it in GitHub Desktop.
Save jphastings/c45b765ba80ce265b0559ed14edfa149 to your computer and use it in GitHub Desktop.
Ensures the basic RPi firmware is in the given folder
#!/bin/sh
FIRMWAREURL="https://raw.githubusercontent.com/raspberrypi/firmware/master/boot/"
DIR="$1"
[ ! -d "${DIR}" ] && { echo "First argument should be a directory that exists"; exit 1; }
for firmware in LICENCE.broadcom bootcode.bin fixup.dat start.elf; do
firmware_dest="${DIR}/${firmware}";
if [ ! -f "${firmware_dest}" ]; then
echo "Downloading RPi firmware: ${firmware}";
curl --silent --output "${firmware_dest}" "${FIRMWAREURL}${firmware}";
fi;
done
echo "RPi firmware present"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment