sysinfo: read U-Boot from the device tree
This allows to correctly read the U-Boot version when using encrypted images. Leave the current implementation as a fallback, in case the system is using an old U-Boot which does not populate the device tree property. https://jira.digi.com/browse/DEL-3025 Signed-off-by: Diaz de Grenu, Jose <Jose.DiazdeGrenu@digi.com>
This commit is contained in:
parent
2405428230
commit
66728c99fd
|
|
@ -188,9 +188,12 @@ make_report(){
|
|||
|
||||
DISTRO="$(sed -ne 's,DISTRO = \(.*\)$,\1,g;T;p' /etc/build)"
|
||||
DEY_VERSION="$(sed -ne 's,DISTRO_VERSION = \(.*\)$,\1,g;T;p' /etc/build)"
|
||||
UBOOT_PARTITION="/dev/mmcblk0boot0"
|
||||
[ -c "/dev/mtd0" ] && UBOOT_PARTITION="/dev/mtd0"
|
||||
UBOOT_VERSION="$(strings ${UBOOT_PARTITION} | grep -m 1 dub | cut -d' ' -f2)"
|
||||
UBOOT_VERSION="$(cat /proc/device-tree/digi,uboot,version 2>/dev/null)"
|
||||
if [ -z "${UBOOT_VERSION}" ]; then
|
||||
UBOOT_PARTITION="/dev/mmcblk0boot0"
|
||||
[ -c "/dev/mtd0" ] && UBOOT_PARTITION="/dev/mtd0"
|
||||
UBOOT_VERSION="$(strings ${UBOOT_PARTITION} | grep -m 1 dub | cut -d' ' -f2)"
|
||||
fi
|
||||
MACHINE="$(cat /proc/device-tree/digi,machine,name)"
|
||||
BOARD_VARIANT="$(cat /proc/device-tree/digi,hwid,variant)"
|
||||
BOARD_SN="$(cat /proc/device-tree/digi,hwid,sn)"
|
||||
|
|
|
|||
Loading…
Reference in New Issue