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 <arturo.buzarra@digi.com>
This commit is contained in:
Arturo Buzarra 2020-10-06 14:04:05 +02:00 committed by Francisco Gil Martinez
parent aad9e045cd
commit 06189293f4
1 changed files with 1 additions and 1 deletions

View File

@ -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 '\<digi,ccimx6ul\>' /proc/device-tree/compatible; then
MCA_NODE="/sys/bus/i2c/devices/0-007e"