Skip to content

Commit 15aa98b

Browse files
committed
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.
1 parent 2aeeadb commit 15aa98b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/bin/support

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,17 @@ cmd_collect()
383383
collect system/netstat.txt ss -tunlp
384384
fi
385385

386+
for script in $(find "/etc/support.d" -type f -executable 2>/dev/null | sort); do
387+
echo "[$(date -Iseconds)] Running ${script}..." >> "${EXEC_LOG}" 2>&1
388+
389+
if "${script}" "${COLLECT_DIR}" >> "${EXEC_LOG}" 2>&1; then
390+
echo "[$(date -Iseconds)] Success: ${script}" >> "${EXEC_LOG}" 2>&1
391+
else
392+
exit_code=$?
393+
echo "[$(date -Iseconds)] Failed (exit ${exit_code}): ${script}" >> "${EXEC_LOG}" 2>&1
394+
fi
395+
done
396+
386397
# Completion timestamp in log
387398
echo "" >> "${EXEC_LOG}"
388399
echo "Completed: $(date -Iseconds)" >> "${EXEC_LOG}"

0 commit comments

Comments
 (0)