From 390b4b85e13a1abdc85ddafbe09858ab4341a904 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Fri, 29 Nov 2019 12:45:33 +0000 Subject: [PATCH] vcgencmd: Use cpuinfo instead of otp_dump On a 64-bit beta kernel a hang in vcgencmd otp_dump was observed blocking rpi-eeprom-update and apt. Since there is another method for obtaining the board Revision that should never block use that instead. --- rpi-eeprom-update | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/rpi-eeprom-update b/rpi-eeprom-update index 2f6cabb..9936005 100755 --- a/rpi-eeprom-update +++ b/rpi-eeprom-update @@ -224,17 +224,18 @@ getBootloaderUpdateVersion() { } 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)" - - if [ "${CPU_VER}" != "3" ]; then + rev="$(sed -n '/^Revision/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo)" + if [ $(((0x$rev >> 23) & 1)) -ne 0 ] && [ $(((0x$rev >> 12) & 15)) -eq 3 ]; then + echo "BCM2711 detected" + else # Not a BCM2711, no EEPROMs to update. exit ${EXIT_SUCCESS} fi + if ! command -v vcgencmd > /dev/null; then + die "vcgencmd not found. On Debian, try installing the libraspberrypi-bin package." + fi + if [ ! -d "${FIRMWARE_IMAGE_DIR}" ]; then die "EEPROM updates directory ${FIRMWARE_IMAGE_DIR} not found." fi