From 66728c99fd1d78580091e594021592d53043d854 Mon Sep 17 00:00:00 2001 From: "Diaz de Grenu, Jose" Date: Tue, 25 Oct 2016 12:59:58 +0200 Subject: [PATCH] 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 --- meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo b/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo index 3a2c1b27e..1f024d502 100755 --- a/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo +++ b/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo @@ -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)"