From 06189293f4942720d98f382672423395d6c07ed2 Mon Sep 17 00:00:00 2001 From: Arturo Buzarra Date: Tue, 6 Oct 2020 14:04:05 +0200 Subject: [PATCH] sysinfo: fix error on devices without SOC revision in their device tree Commit cbb38440 ("meta-digi-dey: sysinfo: Add chip revision sysinfo output") introduced a new script variable to determine the SOC revision of the module. However this entry only is available on the CC8X platforms. This commit checks if the entry exist and then tries to read it to avoid unexpected issues with devices without this entry. https://jira.digi.com/browse/DEL-7263 Signed-off-by: Arturo Buzarra --- meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo b/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo index e99f88e50..956d09aee 100755 --- a/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo +++ b/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo @@ -297,7 +297,7 @@ BOARD_VARIANT="$(cat /proc/device-tree/digi,hwid,variant | tr -d '\0')" BOARD_SN="$(cat /proc/device-tree/digi,hwid,sn | tr -d '\0')" BOARD_VERSION="$(cat /proc/device-tree/digi,carrierboard,version | tr -d '\0')" BOARD_ID="$(cat /proc/device-tree/digi,carrierboard,id | tr -d '\0')" -SOC_REV="$(cat /proc/device-tree/cpus/rev | tr -d '\0')" +[ -e "/proc/device-tree/cpus/rev" ] && SOC_REV="$(cat /proc/device-tree/cpus/rev | tr -d '\0')" if grep -qs '\' /proc/device-tree/compatible; then MCA_NODE="/sys/bus/i2c/devices/0-007e"