From 15aa98b7e39716aae0d94eca16cfd1843cfa5c21 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Tue, 16 Dec 2025 13:12:20 +0000 Subject: [PATCH] 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}"