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 <Jose.DiazdeGrenu@digi.com>
This commit is contained in:
Jose Diaz de Grenu 2019-03-19 12:14:27 +01:00
parent 9b4aa277f3
commit 9e349305a3
1 changed files with 7 additions and 7 deletions

View File

@ -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"