From b19d7b379d5daba31ac6a50af99bb4cf26fbaf40 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 10 Sep 2019 14:14:24 +0100 Subject: [PATCH] rpi-eeprom-update: -h should not require vcgencmd More the checkDependencies call to after the options parsing so that -h can be run for help2man. --- rpi-eeprom-update | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/rpi-eeprom-update b/rpi-eeprom-update index 60e3dcd..1c3dc09 100755 --- a/rpi-eeprom-update +++ b/rpi-eeprom-update @@ -181,6 +181,13 @@ getLatestCriticalUpdate() { } checkDependencies() { + CPU_VER="$(vcgencmd otp_dump | grep 30: | cut -c8)" + + if [ "${CPU_VER}" != "3" ]; then + # Not a BCM2711, no EEPROMs to update. + exit ${EXIT_SUCCESS} + fi + if [ ! -d "${FIRMWARE_IMAGE_DIR}" ]; then die "Bootloader critical updates directory ${FIRMWARE_IMAGE_DIR} not found." fi @@ -368,15 +375,6 @@ FILE_UPDATE="" MACHINE_OUTPUT="" JSON_OUTPUT="no" -CPU_VER="$(vcgencmd otp_dump | grep 30: | cut -c8)" - -if [ "${CPU_VER}" != "3" ]; then - # Not a BCM2711, no EEPROMs to update. - exit 0 -fi - -checkDependencies - while getopts adhf:m:j option; do case "${option}" in a) AUTO_UPDATE=1 @@ -397,6 +395,7 @@ while getopts adhf:m:j option; do esac done +checkDependencies removePreviousUpdates if [ -n "${AUTO_UPDATE}" ]; then if vcgencmd bootloader_config | grep FREEZE_VERSION=1; then