Skip to content

Commit 3b952e9

Browse files
committed
make-release: Add a script for generating Raspberry Pi Imager releases
Create an EEPROM update zip files for use with the Raspberry Pi Imager. The Raspberry Pi Imager JSON will soon be updated to support the 3 different boot priority choices offered by raspi-config.
1 parent 8c9c145 commit 3b952e9

File tree

9 files changed

+120
-0
lines changed

9 files changed

+120
-0
lines changed

imager/README.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Raspberry Pi 4 EEPROM bootloader rescue image
2+
*********************************************
3+
4+
The Raspberry Pi4 has a small EEPROM used to store the bootloader.
5+
6+
This rescue image reverts the bootloader EEPROM to factory default settings.
7+
8+
This rescue image also updates the USB 3.0 (VL805) firmware to the latest
9+
version (138a1) with better full-speed Isochronous endpoint support.
10+
11+
To re-flash the EEPROM(s)
12+
13+
1. Unzip the contents of this zip file to a blank FAT formatted SD-SDCARD.
14+
2. Power off the Raspberry Pi
15+
3. Insert the sd-card.
16+
4. Power on Raspberry Pi
17+
5. Wait at least 10 seconds.
18+
19+
This easiest method for creating and formatting the SD-CARD is to use the
20+
Raspberry Pi Imager from https://raspberrypi.org/downloads
21+
22+
If successful, the green LED light will blink rapidly (forever), otherwise
23+
an error pattern will be displayed.
24+
25+
If a HDMI display is attached then screen will display green for success
26+
or red if failure a failure occurs.
27+
28+
N.B. This image is not a bootloader it simply replaces the on-board bootloader.

imager/boot-conf-default.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[all]
2+
BOOT_UART=0
3+
WAKE_ON_GPIO=1
4+
ENABLE_SELF_UPDATE=1
5+
BOOT_ORDER=0xf41
6+

imager/boot-conf-network.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[all]
2+
BOOT_UART=0
3+
WAKE_ON_GPIO=1
4+
ENABLE_SELF_UPDATE=1
5+
BOOT_ORDER=0xf21
6+

imager/boot-conf-sd.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[all]
2+
BOOT_UART=0
3+
WAKE_ON_GPIO=1
4+
ENABLE_SELF_UPDATE=1
5+
BOOT_ORDER=0xf41
6+

imager/boot-conf-usb.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[all]
2+
BOOT_UART=0
3+
WAKE_ON_GPIO=1
4+
ENABLE_SELF_UPDATE=1
5+
BOOT_ORDER=0xf14
6+

imager/make-release

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/bin/sh
2+
3+
# Generates three variants of the rpi-eeprom-recovery.zip file for
4+
# SD, USB and NETWORK priority matching the raspi-config options.
5+
6+
set -e
7+
8+
script_dir=$(cd "$(dirname "$0")" && pwd)
9+
tmp_dir=""
10+
11+
die() {
12+
echo "$@" >&2
13+
exit 1
14+
}
15+
16+
cleanup() {
17+
if [ -d "${tmp_dir}" ]; then
18+
rm -rf "${tmp_dir}"
19+
fi
20+
tmp_dir=""
21+
}
22+
23+
gen_release() {
24+
config="${1}"
25+
out="${2}"
26+
27+
[ -f "${config}" ] || die "File not found \"${config}\""
28+
29+
(
30+
tmp_dir="$(mktemp -d)"
31+
cd "${tmp_dir}"
32+
cp "${script_dir}/vl805.bin" .
33+
cp "${script_dir}/README.txt" .
34+
sha256sum vl805.bin | awk '{print $1}' > vl805.sig
35+
36+
"${script_dir}/../rpi-eeprom-config" \
37+
--config "${script_dir}/${config}" --out pieeprom.bin \
38+
"${script_dir}/pieeprom.bin" || die "Failed to create update EEPROM config with \"${config}\""
39+
sha256sum pieeprom.bin | awk '{print $1}' > pieeprom.sig
40+
echo "Creating ${out}"
41+
zip "${out}" *
42+
)
43+
}
44+
45+
usage() {
46+
cat <<EOF
47+
make-release <tag>
48+
49+
Example tag "2020-09-03-vl805-000138a1"
50+
EOF
51+
exit
52+
}
53+
54+
trap cleanup EXIT
55+
tag="${1}"
56+
[ -n "${tag}" ] || usage
57+
release_dir="${script_dir}/release"
58+
rm -rf "${release_dir}"
59+
mkdir "${release_dir}"
60+
61+
# Build the different boot priority flavours
62+
gen_release boot-conf-default.txt "${release_dir}/rpi-boot-eeprom-recovery-${tag}.zip"
63+
gen_release boot-conf-sd.txt "${release_dir}/rpi-boot-eeprom-recovery-${tag}-sd.zip"
64+
gen_release boot-conf-usb.txt "${release_dir}/rpi-boot-eeprom-recovery-${tag}-usb.zip"
65+
gen_release boot-conf-network.txt "${release_dir}/rpi-boot-eeprom-recovery-${tag}-network.zip"

imager/pieeprom.bin

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../firmware/critical/pieeprom-2020-09-03.bin

imager/recovery.bin

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../firmware/critical/recovery.bin

imager/vl805.bin

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../firmware/critical/vl805-000138a1.bin

0 commit comments

Comments
 (0)