From 4abaa46e1feeb25f4f6592f1a525c8ef6827ee1f Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Thu, 4 Jun 2020 09:53:05 -0700 Subject: [PATCH] rpi-eeprom-update: compare versions algebraically Use `-lt` rather than `\<` so that, for example, this: [ 2 -lt 17 ] is true (whereas with `\<` in place of `-lt` it's false). Also change an `=` comparison to `-eq` to be technically correct. Helped-by: Tim Gover Helped-by: MilhouseVH Signed-off-by: Kyle J. McKay --- rpi-eeprom-update | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpi-eeprom-update b/rpi-eeprom-update index fc9cfd5..f6238a6 100755 --- a/rpi-eeprom-update +++ b/rpi-eeprom-update @@ -272,7 +272,7 @@ checkDependencies() { BOARD_TYPE=$(((0x$BOARD_INFO >> 4) & 0xff)) BOARD_REVISION=$((0x$BOARD_INFO & 0xf)) - if [ ${BOARD_TYPE} = 17 ] && [ ${BOARD_REVISION} \< 4 ]; then + if [ ${BOARD_TYPE} -eq 17 ] && [ ${BOARD_REVISION} -lt 4 ]; then echo "Dedicated VL805 EEPROM detected" HAVE_VL805_EEPROM=1 else @@ -539,7 +539,7 @@ lookupVersionInfo() if [ "${HAVE_VL805_EEPROM}" = 1 ]; then getVL805UpdateVersion if [ -n "${VL805_CURRENT_VERSION}" ] && [ -n "${VL805_UPDATE_VERSION}" ]; then - if [ "${VL805_CURRENT_VERSION}" \< "${VL805_UPDATE_VERSION}" ]; then + if [ "$((0x${VL805_CURRENT_VERSION}))" -lt "$((0x${VL805_UPDATE_VERSION}))" ]; then ACTION_UPDATE_VL805=1 else VL805_UPDATE_IMAGE=""