Skip to content

Instantly share code, notes, and snippets.

@jphastings
Created March 27, 2021 13:35
Show Gist options
  • 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