mirror of
https://github.com/raspberrypi/rpi-eeprom.git
synced 2026-01-20 21:13:36 +08:00
Merge branch 'master' into debian/buster
This commit is contained in:
@@ -14,7 +14,8 @@ This documentation will be merged into the main bootloader documents after the b
|
|||||||
Network boot requires a TFTP and NFS server to be configured. See [Network boot server tutorial](https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/net_tutorial.md)
|
Network boot requires a TFTP and NFS server to be configured. See [Network boot server tutorial](https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/net_tutorial.md)
|
||||||
|
|
||||||
Additional notes:-
|
Additional notes:-
|
||||||
* The VideoCore firmware (start4.elf) must be updated to the latest rpi-update version in order to get the Pi4 network drivers.
|
* The VideoCore firmware (start4.elf and fixup4.dat) must be updated to the latest rpi-update version in order to get the Pi4 network drivers.
|
||||||
|
* The latest VideoCore firmware can be downloaded directly from the [rpi-update GitHub repo](https://github.com/Hexxeh/rpi-update)
|
||||||
* The MAC address on the Pi4 is programmed at manufacture and is not derived from the serial number.
|
* The MAC address on the Pi4 is programmed at manufacture and is not derived from the serial number.
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -43,7 +44,7 @@ sudo echo FIRMWARE_RELEASE_STATUS="beta" > /etc/default/rpi-eeprom-update
|
|||||||
Network boot is not enabled by default in the bootloader. To enable it the bootloader configuration file must be edited.
|
Network boot is not enabled by default in the bootloader. To enable it the bootloader configuration file must be edited.
|
||||||
```
|
```
|
||||||
# Extract the configuration file
|
# Extract the configuration file
|
||||||
cp /lib/firmware/raspberrypi/beta/pieeprom-2019-09-23.bin pieeprom.bin
|
cp /lib/firmware/raspberrypi/bootloader/beta/pieeprom-2019-09-23.bin pieeprom.bin
|
||||||
rpi-eeprom-config pieeprom.bin > bootconf.txt
|
rpi-eeprom-config pieeprom.bin > bootconf.txt
|
||||||
|
|
||||||
# Enable network boot
|
# Enable network boot
|
||||||
|
|||||||
@@ -62,6 +62,15 @@ class BootloaderImage(object):
|
|||||||
|
|
||||||
struct.pack_into('>L', self._bytes, hdr_offset + 4, new_len)
|
struct.pack_into('>L', self._bytes, hdr_offset + 4, new_len)
|
||||||
struct.pack_into(("%ds" % len(new_config_bytes)), self._bytes, hdr_offset + 4 + FILE_HDR_LEN, new_config_bytes)
|
struct.pack_into(("%ds" % len(new_config_bytes)), self._bytes, hdr_offset + 4 + FILE_HDR_LEN, new_config_bytes)
|
||||||
|
|
||||||
|
# If the new config is smaller than the old config then set any old
|
||||||
|
# data which is now unused to all ones (erase value)
|
||||||
|
pad_start = hdr_offset + 4 + FILE_HDR_LEN + len(new_config_bytes)
|
||||||
|
pad = 0
|
||||||
|
while pad < (length - len(new_config_bytes)):
|
||||||
|
struct.pack_into('B', self._bytes, pad_start + pad, 0xff)
|
||||||
|
pad = pad + 1
|
||||||
|
|
||||||
if self._out is not None:
|
if self._out is not None:
|
||||||
self._out.write(self._bytes)
|
self._out.write(self._bytes)
|
||||||
self._out.close()
|
self._out.close()
|
||||||
|
|||||||
@@ -4,19 +4,61 @@ set -e
|
|||||||
|
|
||||||
script_dir="$(cd "$(dirname "$0")" && pwd)"
|
script_dir="$(cd "$(dirname "$0")" && pwd)"
|
||||||
die() {
|
die() {
|
||||||
|
echo "ERROR"
|
||||||
echo "$@" >&2
|
echo "$@" >&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
TMP_CONFIG=""
|
TMP_CONFIG=""
|
||||||
TMP_EEPROM=""
|
TMP_EEPROM=""
|
||||||
|
TMP_EEPROM2=""
|
||||||
cleanup() {
|
cleanup() {
|
||||||
rm -f "${TMP_CONFIG}" -f "${TMP_EEPROM}"
|
rm -f "${TMP_CONFIG}" -f "${TMP_EEPROM}" "${TMP_EEPROM2}"
|
||||||
TMP_CONFIG=""
|
TMP_CONFIG=""
|
||||||
TMP_EEPROM=""
|
TMP_EEPROM=""
|
||||||
|
TMP_EEPROM2=""
|
||||||
}
|
}
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
check_reduce_size()
|
||||||
|
{
|
||||||
|
# Verify that unused bytes are set to 0xff if the size of the config file is reduced.
|
||||||
|
echo "check_update $1 $2"
|
||||||
|
|
||||||
|
image="${script_dir}/$1"
|
||||||
|
conf="${script_dir}/$2"
|
||||||
|
|
||||||
|
# Check that the production config file can be read correctly
|
||||||
|
image_md5="$(md5sum "${image}" | awk '{print $1}')"
|
||||||
|
TMP_CONFIG="$(mktemp)"
|
||||||
|
|
||||||
|
# Generate a new EEPROM with larger config file
|
||||||
|
cp -f "${conf}" "${TMP_CONFIG}"
|
||||||
|
echo "Add some random text to the config file" >> "${TMP_CONFIG}"
|
||||||
|
|
||||||
|
TMP_EEPROM="$(mktemp)"
|
||||||
|
"${script_dir}/../rpi-eeprom-config" \
|
||||||
|
"${image}" \
|
||||||
|
--config "${TMP_CONFIG}" \
|
||||||
|
--out "${TMP_EEPROM}"
|
||||||
|
|
||||||
|
# Check that the new image is different
|
||||||
|
actual_md5="$(md5sum "${TMP_EEPROM}" | awk '{print $1}')"
|
||||||
|
[ "${image_md5}" != "${actual_md5}" ] || die "EEPROM images should be different"
|
||||||
|
|
||||||
|
# Re-apply the original configuration and make sure the image is the same
|
||||||
|
TMP_EEPROM2="$(mktemp)"
|
||||||
|
"${script_dir}/../rpi-eeprom-config" \
|
||||||
|
"${TMP_EEPROM}" \
|
||||||
|
--config "${conf}" \
|
||||||
|
--out "${TMP_EEPROM2}"
|
||||||
|
|
||||||
|
# Check that applying the EEPROM config file again gets back to the original image
|
||||||
|
actual_md5="$(md5sum "${TMP_EEPROM2}" | awk '{print $1}')"
|
||||||
|
[ "${image_md5}" = "${actual_md5}" ] || die "Image should be the same as original"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
check_loopback()
|
check_loopback()
|
||||||
{
|
{
|
||||||
echo "check_update $1 $2"
|
echo "check_update $1 $2"
|
||||||
@@ -30,7 +72,7 @@ check_loopback()
|
|||||||
[ "${actual_md5}" = "${expected_md5}" ] || die "Config-read: checksum mismatch"
|
[ "${actual_md5}" = "${expected_md5}" ] || die "Config-read: checksum mismatch"
|
||||||
|
|
||||||
# Check that overwriting the config section produces an identical binary
|
# Check that overwriting the config section produces an identical binary
|
||||||
TMP_EEPROM=$(mktemp)
|
TMP_EEPROM="$(mktemp)"
|
||||||
"${script_dir}/../rpi-eeprom-config" \
|
"${script_dir}/../rpi-eeprom-config" \
|
||||||
"${image}" \
|
"${image}" \
|
||||||
--config "${conf}" \
|
--config "${conf}" \
|
||||||
@@ -73,3 +115,6 @@ cleanup
|
|||||||
|
|
||||||
check_update "../firmware/critical/pieeprom-2019-07-15.bin" "pieeprom-2019-07-15-freeze.bin" "bootconf-2019-07-15-freeze.txt"
|
check_update "../firmware/critical/pieeprom-2019-07-15.bin" "pieeprom-2019-07-15-freeze.bin" "bootconf-2019-07-15-freeze.txt"
|
||||||
cleanup
|
cleanup
|
||||||
|
|
||||||
|
check_reduce_size "../firmware/critical/pieeprom-2019-05-10.bin" "bootconf-2019-05-10.txt"
|
||||||
|
cleanup
|
||||||
|
|||||||
Reference in New Issue
Block a user