From 15aa98b7e39716aae0d94eca16cfd1843cfa5c21 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Tue, 16 Dec 2025 13:12:20 +0000 Subject: [PATCH 1/2] support: Exec hardware specific scripts from /etc/support.d Allow particular boards or platforms install hardware specific scripts in /etc/support.d, via the usual /usr/share/product logic, which are then run by /sbin/support and included in the resulting bundle. This lets us collect hardware specific information, e.g., SoC-specific error counters, without /sbin/support needing to know about all the nitty gritty details. --- src/bin/support | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/bin/support b/src/bin/support index 5c7f840e..eb85201a 100755 --- a/src/bin/support +++ b/src/bin/support @@ -383,6 +383,17 @@ cmd_collect() collect system/netstat.txt ss -tunlp fi + for script in $(find "/etc/support.d" -type f -executable 2>/dev/null | sort); do + echo "[$(date -Iseconds)] Running ${script}..." >> "${EXEC_LOG}" 2>&1 + + if "${script}" "${COLLECT_DIR}" >> "${EXEC_LOG}" 2>&1; then + echo "[$(date -Iseconds)] Success: ${script}" >> "${EXEC_LOG}" 2>&1 + else + exit_code=$? + echo "[$(date -Iseconds)] Failed (exit ${exit_code}): ${script}" >> "${EXEC_LOG}" 2>&1 + fi + done + # Completion timestamp in log echo "" >> "${EXEC_LOG}" echo "Completed: $(date -Iseconds)" >> "${EXEC_LOG}" From 8ae018baaee677f81a662bf74cd3d4075452d8aa Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Tue, 16 Dec 2025 13:16:38 +0000 Subject: [PATCH 2/2] support: cn913x: Collect DRAM ECC status On platforms based on CN913{0,1,2}, collect all ECC related counters so that we know if any correctable errors have been encountered since the most recent boot. --- .../etc/support.d/50-marvell-cn913x.sh | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 board/aarch64/rootfs/usr/share/product/marvell,armada-ap807/etc/support.d/50-marvell-cn913x.sh diff --git a/board/aarch64/rootfs/usr/share/product/marvell,armada-ap807/etc/support.d/50-marvell-cn913x.sh b/board/aarch64/rootfs/usr/share/product/marvell,armada-ap807/etc/support.d/50-marvell-cn913x.sh new file mode 100755 index 00000000..0aa3168e --- /dev/null +++ b/board/aarch64/rootfs/usr/share/product/marvell,armada-ap807/etc/support.d/50-marvell-cn913x.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e + +ecc_stat() +{ + local chan= + local base= + + for chan in 0 1; do + base=$((0xf0020360 + 0x200 * chan)) + + echo "DRAM Channel $chan ECC Status" + echo -n " Log config: "; devmem $((base + 0x0)) 32 + echo -n " 1b errors: "; devmem $((base + 0x4)) 32 + echo -n " Info 0: "; devmem $((base + 0x8)) 32 + echo -n " Info 1: "; devmem $((base + 0xc)) 32 + echo + done +} + +[ -n "$1" ] || { echo "usage: $0 OUT-DIR"; exit 1; } +work="$1"/marvell-cn913x +mkdir -p "${work}" + +ecc_stat >"${work}"/ecc-stat