Merge branch 'master' into debian/bookworm

This commit is contained in:
Serge Schneider
2024-04-16 10:01:47 +01:00
6 changed files with 12 additions and 5 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +1,12 @@
# Raspberry Pi4 bootloader EEPROM release notes # Raspberry Pi4 bootloader EEPROM release notes
## 2024-04-15 - Fix tryboot mode in secure-boot - DEFAULT
* Promote the secure-boot fix to the DEFAULT release.
## 2024-04-15 - Fix tryboot mode in secure-boot - STABLE
* Fix an issue where the tryboot flag was being reset and lost during
the secure-boot initialization.
## 2024-01-22 - Fix issue boot.img end sector check - STABLE ## 2024-01-22 - Fix issue boot.img end sector check - STABLE
* See https://github.com/raspberrypi/rpi-eeprom/issues/521 * See https://github.com/raspberrypi/rpi-eeprom/issues/521

View File

@@ -50,8 +50,8 @@ check_key_set() {
} }
read_key() { read_key() {
out=READ_KEY="$(vcmailbox 0x00030081 $((8 + $ROW_COUNT * 4)) $((8 + $ROW_COUNT * 4)) $ROW_OFFSET $ROW_COUNT 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)" || die "Failed to read the current key from OTP" out=READ_KEY="$(vcmailbox 0x00030081 $((8 + ROW_COUNT * 4)) $((8 + ROW_COUNT * 4)) $ROW_OFFSET $ROW_COUNT 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)" || die "Failed to read the current key from OTP"
READ_KEY="$(echo "${out}" | sed 's/0x//g' | awk -v last=$((8 + $ROW_COUNT)) '{for(i=8;i<last;i++) printf $i; print ""}')" READ_KEY="$(echo "${out}" | sed 's/0x//g' | awk -v last=$((8 + ROW_COUNT)) '{for(i=8;i<last;i++) printf $i; print ""}')"
} }
write_key() { write_key() {
@@ -59,7 +59,7 @@ write_key() {
# Normalize formatting and check the length # Normalize formatting and check the length
key="$(echo "${key}" | tr 'A-Z' 'a-z')" key="$(echo "${key}" | tr 'A-Z' 'a-z')"
key="$(echo "${key}" | sed 's/[^a-f0-9]//g')" key="$(echo "${key}" | sed 's/[^a-f0-9]//g')"
[ "$(echo -n "${key}" | wc -c)" = $(($ROW_COUNT * 4 * 2)) ] || die "Invalid key parameter" [ "$(echo -n "${key}" | wc -c)" = $((ROW_COUNT * 4 * 2)) ] || die "Invalid key parameter"
count=0 count=0
key_params="" key_params=""
@@ -83,7 +83,7 @@ write_key() {
fi fi
fi fi
vcmailbox 0x38081 $((8 + $ROW_COUNT * 4)) $((8 + $ROW_COUNT * 4)) $ROW_OFFSET $ROW_COUNT ${key_params} || die "Failed to write key" vcmailbox 0x38081 $((8 + ROW_COUNT * 4)) $((8 + ROW_COUNT * 4)) $ROW_OFFSET $ROW_COUNT ${key_params} || die "Failed to write key"
read_key read_key
[ "${READ_KEY}" = "${key}" ] || die "Key readback check failed. ${out}" [ "${READ_KEY}" = "${key}" ] || die "Key readback check failed. ${out}"
} }
@@ -151,7 +151,7 @@ fi
if [ $ROW_OFFSET -lt 0 ]; then if [ $ROW_OFFSET -lt 0 ]; then
die "Offset too small" die "Offset too small"
fi fi
if [ ${ROW_OFFSET} -gt $(($MAX_ROW_COUNT - $ROW_COUNT)) ]; then if [ ${ROW_OFFSET} -gt $((MAX_ROW_COUNT - ROW_COUNT)) ]; then
die "Offset too big" die "Offset too big"
fi fi
if [ -z $(which vcmailbox) ]; then if [ -z $(which vcmailbox) ]; then