mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
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.
This commit is contained in:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user