-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #306 from timg236/make-release
make-release: Add a script for generating Raspberry Pi Imager releases
- Loading branch information
Showing
9 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Raspberry Pi 4 EEPROM bootloader rescue image | ||
********************************************* | ||
|
||
The Raspberry Pi4 has a small EEPROM used to store the bootloader. | ||
|
||
This rescue image reverts the bootloader EEPROM to factory default settings. | ||
|
||
This rescue image also updates the USB 3.0 (VL805) firmware to the latest | ||
version (138a1) with better full-speed Isochronous endpoint support. | ||
|
||
To re-flash the EEPROM(s) | ||
|
||
1. Unzip the contents of this zip file to a blank FAT formatted SD-SDCARD. | ||
2. Power off the Raspberry Pi | ||
3. Insert the sd-card. | ||
4. Power on Raspberry Pi | ||
5. Wait at least 10 seconds. | ||
|
||
This easiest method for creating and formatting the SD-CARD is to use the | ||
Raspberry Pi Imager from https://raspberrypi.org/downloads | ||
|
||
If successful, the green LED light will blink rapidly (forever), otherwise | ||
an error pattern will be displayed. | ||
|
||
If a HDMI display is attached then screen will display green for success | ||
or red if failure a failure occurs. | ||
|
||
N.B. This image is not a bootloader it simply replaces the on-board bootloader. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[all] | ||
BOOT_UART=0 | ||
WAKE_ON_GPIO=1 | ||
ENABLE_SELF_UPDATE=1 | ||
BOOT_ORDER=0xf41 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[all] | ||
BOOT_UART=0 | ||
WAKE_ON_GPIO=1 | ||
ENABLE_SELF_UPDATE=1 | ||
BOOT_ORDER=0xf21 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[all] | ||
BOOT_UART=0 | ||
WAKE_ON_GPIO=1 | ||
ENABLE_SELF_UPDATE=1 | ||
BOOT_ORDER=0xf41 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[all] | ||
BOOT_UART=0 | ||
WAKE_ON_GPIO=1 | ||
ENABLE_SELF_UPDATE=1 | ||
BOOT_ORDER=0xf14 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/bin/sh | ||
|
||
# Generates three variants of the rpi-eeprom-recovery.zip file for | ||
# SD, USB and NETWORK priority matching the raspi-config options. | ||
|
||
set -e | ||
|
||
script_dir=$(cd "$(dirname "$0")" && pwd) | ||
tmp_dir="" | ||
|
||
die() { | ||
echo "$@" >&2 | ||
exit 1 | ||
} | ||
|
||
cleanup() { | ||
if [ -d "${tmp_dir}" ]; then | ||
rm -rf "${tmp_dir}" | ||
fi | ||
tmp_dir="" | ||
} | ||
|
||
gen_release() { | ||
config="${1}" | ||
out="${2}" | ||
|
||
[ -f "${config}" ] || die "File not found \"${config}\"" | ||
|
||
( | ||
tmp_dir="$(mktemp -d)" | ||
cd "${tmp_dir}" | ||
cp "${script_dir}/vl805.bin" . | ||
cp "${script_dir}/README.txt" . | ||
sha256sum vl805.bin | awk '{print $1}' > vl805.sig | ||
|
||
"${script_dir}/../rpi-eeprom-config" \ | ||
--config "${script_dir}/${config}" --out pieeprom.bin \ | ||
"${script_dir}/pieeprom.bin" || die "Failed to create update EEPROM config with \"${config}\"" | ||
sha256sum pieeprom.bin | awk '{print $1}' > pieeprom.sig | ||
echo "Creating ${out}" | ||
zip "${out}" * | ||
) | ||
} | ||
|
||
usage() { | ||
cat <<EOF | ||
make-release <tag> | ||
Example tag "2020-09-03-vl805-000138a1" | ||
EOF | ||
exit | ||
} | ||
|
||
trap cleanup EXIT | ||
tag="${1}" | ||
[ -n "${tag}" ] || usage | ||
release_dir="${script_dir}/release" | ||
rm -rf "${release_dir}" | ||
mkdir "${release_dir}" | ||
|
||
# Build the different boot priority flavours | ||
gen_release boot-conf-default.txt "${release_dir}/rpi-boot-eeprom-recovery-${tag}.zip" | ||
gen_release boot-conf-sd.txt "${release_dir}/rpi-boot-eeprom-recovery-${tag}-sd.zip" | ||
gen_release boot-conf-usb.txt "${release_dir}/rpi-boot-eeprom-recovery-${tag}-usb.zip" | ||
gen_release boot-conf-network.txt "${release_dir}/rpi-boot-eeprom-recovery-${tag}-network.zip" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../firmware/critical/pieeprom-2020-09-03.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../firmware/critical/recovery.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../firmware/critical/vl805-000138a1.bin |