mirror of
https://github.com/raspberrypi/rpi-eeprom.git
synced 2026-01-21 06:13:33 +08:00
Merge branch 'master' into debian/buster
This commit is contained in:
@@ -20,6 +20,7 @@ ENABLE_VL805_UPDATES=${ENABLE_VL805_UPDATES:-1}
|
|||||||
USE_FLASHROM=${USE_FLASHROM:-0}
|
USE_FLASHROM=${USE_FLASHROM:-0}
|
||||||
RECOVERY_BIN=${RECOVERY_BIN:-${FIRMWARE_ROOT}/${FIRMWARE_RELEASE_STATUS}/recovery.bin}
|
RECOVERY_BIN=${RECOVERY_BIN:-${FIRMWARE_ROOT}/${FIRMWARE_RELEASE_STATUS}/recovery.bin}
|
||||||
BOOTFS=${BOOTFS:-/boot}
|
BOOTFS=${BOOTFS:-/boot}
|
||||||
|
VCMAILBOX=${VCMAILBOX:-/opt/vc/bin/vcmailbox}
|
||||||
|
|
||||||
EXIT_SUCCESS=0
|
EXIT_SUCCESS=0
|
||||||
EXIT_UPDATE_REQUIRED=1
|
EXIT_UPDATE_REQUIRED=1
|
||||||
@@ -161,7 +162,7 @@ applyUpdate() {
|
|||||||
if [ -f "${BOOTLOADER_UPDATE_IMAGE}" ]; then
|
if [ -f "${BOOTLOADER_UPDATE_IMAGE}" ]; then
|
||||||
# Bootloader EEPROM chip-select is muxed with audio pin so disable audio
|
# Bootloader EEPROM chip-select is muxed with audio pin so disable audio
|
||||||
# LDO first to avoid sending noise to analog audio.
|
# LDO first to avoid sending noise to analog audio.
|
||||||
/opt/vc/bin/vcmailbox 0x00030056 4 4 0 > /dev/null || true
|
"${VCMAILBOX}" 0x00030056 4 4 0 > /dev/null || true
|
||||||
dtparam audio=off
|
dtparam audio=off
|
||||||
|
|
||||||
# Switch the SPI pins to boot EEPROM
|
# Switch the SPI pins to boot EEPROM
|
||||||
@@ -176,7 +177,7 @@ applyUpdate() {
|
|||||||
|
|
||||||
dtparam -R spi-gpio40-45
|
dtparam -R spi-gpio40-45
|
||||||
dtparam audio=on
|
dtparam audio=on
|
||||||
/opt/vc/bin/vcmailbox 0x00030056 4 4 1 > /dev/null || true
|
${VCMAILBOX} 0x00030056 4 4 1 > /dev/null || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "${VL805_UPDATE_IMAGE}" ]; then
|
if [ -f "${VL805_UPDATE_IMAGE}" ]; then
|
||||||
@@ -223,6 +224,10 @@ getBootloaderUpdateVersion() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
checkDependencies() {
|
checkDependencies() {
|
||||||
|
if ! command -v vcgencmd > /dev/null; then
|
||||||
|
die "vcgencmd not found. On Debian, try installing the libraspberrypi-bin package."
|
||||||
|
fi
|
||||||
|
|
||||||
CPU_VER="$(vcgencmd otp_dump | grep 30: | cut -c8)"
|
CPU_VER="$(vcgencmd otp_dump | grep 30: | cut -c8)"
|
||||||
|
|
||||||
if [ "${CPU_VER}" != "3" ]; then
|
if [ "${CPU_VER}" != "3" ]; then
|
||||||
@@ -231,27 +236,39 @@ checkDependencies() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d "${FIRMWARE_IMAGE_DIR}" ]; then
|
if [ ! -d "${FIRMWARE_IMAGE_DIR}" ]; then
|
||||||
die "Bootloader updates directory ${FIRMWARE_IMAGE_DIR} not found."
|
die "EEPROM updates directory ${FIRMWARE_IMAGE_DIR} not found."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! command -v vl805 -h > /dev/null 2>&1; then
|
if ! command -v vl805 > /dev/null; then
|
||||||
die "vl805 command not found"
|
die "vl805 command not found. On Debian, try reinstalling the rpi-eeprom package."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if vcgencmd bootloader_config | grep -qi "Command not registered"; then
|
if vcgencmd bootloader_config | grep -qi "Command not registered"; then
|
||||||
die "vcgencmd: 'bootloader_config' command not supported. Please update VC firmware and reboot."
|
die "vcgencmd: 'bootloader_config' command not supported. Please update VC firmware and reboot."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! command -v sha256sum > /dev/null 2>&1; then
|
if ! command -v sha256sum > /dev/null; then
|
||||||
die "sha256sum not found. On Debian, try installing the coreutilities package"
|
die "sha256sum not found. On Debian, try installing the coreutilities package"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! command -v flashrom > /dev/null 2>&1; then
|
if ! command -v flashrom > /dev/null && [ "${USE_FLASHROM}" = 1 ]; then
|
||||||
[ "${USE_FLASHROM}" = 0 ] || die "flashrom not found. On Debian, try installing the flashrom package."
|
die "flashrom not found. On Debian, try installing the flashrom package."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${USE_FLASHROM}" = 0 ]; then
|
if [ ! -x "${VCMAILBOX}" ] && [ "${USE_FLASHROM}" = 1 ]; then
|
||||||
[ -f "${RECOVERY_BIN}" ] || die "${RECOVERY_BIN} not found."
|
die "vcmailbox not found. On Debian, try installing the libraspberrypi-bin package."
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! command -v dtparam > /dev/null && [ "${USE_FLASHROM}" = 1 ]; then
|
||||||
|
die "dtparam not found. On Debian, try installing the libraspberrypi-bin package."
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! command -v dtoverlay > /dev/null && [ "${USE_FLASHROM}" = 1 ]; then
|
||||||
|
die "dtoverlay not found. On Debian, try installing the libraspberrypi-bin package."
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${USE_FLASHROM}" = 0 ] && [ ! -f "${RECOVERY_BIN}" ]; then
|
||||||
|
die "${RECOVERY_BIN} not found."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -322,10 +339,25 @@ EOF
|
|||||||
|
|
||||||
printVersions()
|
printVersions()
|
||||||
{
|
{
|
||||||
echo "BOOTLOADER"
|
if [ "${ACTION_UPDATE_BOOTLOADER}" = 1 ]; then
|
||||||
|
echo "BOOTLOADER: update required"
|
||||||
|
else
|
||||||
|
echo "BOOTLOADER: up-to-date"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "CURRENT: $(date -u "-d@${BOOTLOADER_CURRENT_VERSION}") (${BOOTLOADER_CURRENT_VERSION})"
|
echo "CURRENT: $(date -u "-d@${BOOTLOADER_CURRENT_VERSION}") (${BOOTLOADER_CURRENT_VERSION})"
|
||||||
echo " LATEST: $(date -u "-d@${BOOTLOADER_UPDATE_VERSION}") (${BOOTLOADER_UPDATE_VERSION})"
|
echo " LATEST: $(date -u "-d@${BOOTLOADER_UPDATE_VERSION}") (${BOOTLOADER_UPDATE_VERSION})"
|
||||||
echo "VL805"
|
|
||||||
|
if [ "${ACTION_UPDATE_VL805}" = 1 ]; then
|
||||||
|
echo "VL805: update required"
|
||||||
|
else
|
||||||
|
if [ "$(id -u)" = "0" ]; then
|
||||||
|
echo "VL805: up-to-date"
|
||||||
|
else
|
||||||
|
echo "VL805: version unknown. Try sudo rpi-eeprom-update"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
echo "CURRENT: ${VL805_CURRENT_VERSION}"
|
echo "CURRENT: ${VL805_CURRENT_VERSION}"
|
||||||
echo " LATEST: ${VL805_UPDATE_VERSION}"
|
echo " LATEST: ${VL805_UPDATE_VERSION}"
|
||||||
}
|
}
|
||||||
@@ -424,9 +456,9 @@ checkAndApply()
|
|||||||
echo "*** INSTALLING EEPROM UPDATES ***"
|
echo "*** INSTALLING EEPROM UPDATES ***"
|
||||||
printVersions
|
printVersions
|
||||||
applyUpdate
|
applyUpdate
|
||||||
echo "Bootloader and/or VL805 EEPROM update pending. Please reboot to apply the update."
|
echo "EEPROM updates pending. Please reboot to apply the update."
|
||||||
else
|
else
|
||||||
echo "Bootloader and VL805 EEPROMs are up to date. $(date -d@${BOOTLOADER_CURRENT_VERSION})"
|
printVersions
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -473,7 +505,6 @@ checkVersion()
|
|||||||
write_status_info "EXIT_UPDATE_REQUIRED"
|
write_status_info "EXIT_UPDATE_REQUIRED"
|
||||||
exit ${EXIT_UPDATE_REQUIRED}
|
exit ${EXIT_UPDATE_REQUIRED}
|
||||||
else
|
else
|
||||||
echo "Bootloader EEPROM is up to date"
|
|
||||||
printVersions
|
printVersions
|
||||||
write_status_info "EXIT_SUCCESS"
|
write_status_info "EXIT_SUCCESS"
|
||||||
exit ${EXIT_SUCCESS}
|
exit ${EXIT_SUCCESS}
|
||||||
|
|||||||
Reference in New Issue
Block a user