From e204b1f4eb418181c93e93a6cb75d44b24280910 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Sat, 9 Nov 2019 03:39:53 +0000 Subject: [PATCH] use lspci if available instead of vl805. Avoid calling vl805 twice. --- rpi-eeprom-update | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rpi-eeprom-update b/rpi-eeprom-update index 84f91de..2f6cabb 100755 --- a/rpi-eeprom-update +++ b/rpi-eeprom-update @@ -388,8 +388,13 @@ getVL805CurrentVersion() # root then treat the version as unknown and skip VLI updates. VL805_CURRENT_VERSION="" if [ "$(id -u)" = "0" ]; then - if vl805 | grep -q "VL805 FW version"; then - VL805_CURRENT_VERSION=$(vl805 | grep "VL805 FW version" | awk '{print $4}') + if command -v lspci >/dev/null; then + vlver="$(lspci -d 1106:3483 -xxx | awk '/^50:/ { print "VL805 FW version: " $5 $4 $3 $2 }')" + else + vlver="$(vl805 | grep "VL805 FW version")" + fi + if [ -n "${vlver}" ]; then + VL805_CURRENT_VERSION="${vlver#*: }" fi fi }