From 9e349305a34e69817b5a9d9eebc1973413adf9ce Mon Sep 17 00:00:00 2001 From: Jose Diaz de Grenu Date: Tue, 19 Mar 2019 12:14:27 +0100 Subject: [PATCH] sysinfo: add device tree used to the report The device-tree being used on a system is a very important piece of information to debug issues. On a host machine, dtc can be used to reconstruct the DTS used from the /proc/device-tree folder structure. While on it, remove extra white lines at the beginning and end. Signed-off-by: Jose Diaz de Grenu --- meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo b/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo index 5ae651040..1f85877fb 100755 --- a/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo +++ b/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo @@ -287,8 +287,7 @@ if [ -d "$IOEXP_NODE" ]; then fi DATE="$(date "+%Y%m%d%H%M%S")" -FILE="/tmp/sysinfo-${DEY_VERSION}-${BOARD_SN}-${DATE}.txt" -printf "\n\n" +REPORT_PATH="/tmp/sysinfo-${DEY_VERSION}-${BOARD_SN}-${DATE}" ( echo "-------------------------------------" @@ -307,9 +306,10 @@ printf "\n\n" [ -n "${MCA_VERSION}" ] && echo "|| MCA | ${MCA_VERSION}" [ -n "${IOEXP_VERSION}" ] && echo "|| I/O Expander | ${IOEXP_VERSION}" printf "\n\n" -) | tee ${FILE} +) | tee "${REPORT_PATH}.txt" -make_report >> ${FILE} -gzip ${FILE} -echo "Report generated in ${FILE}.gz" -printf "\n\n" +make_report >> "${REPORT_PATH}.txt" +tar -zhcf "${REPORT_PATH}.tar.gz" -C $(dirname ${REPORT_PATH}) $(basename "${REPORT_PATH}.txt") /proc/device-tree 2> /dev/null +echo "Report generated in ${REPORT_PATH}.tar.gz" + +rm -rf "${REPORT_PATH}.txt"