mirror of
https://github.com/cjfranko/NTP-Timeturner.git
synced 2025-11-08 18:32:02 +00:00
refactor: switch PTP daemon to linuxptp/ptp4l; remove statime
Co-authored-by: aider (openai/gpt-5) <aider@aider.chat>
This commit is contained in:
parent
21e65d6125
commit
90cc95be21
2 changed files with 12 additions and 8 deletions
|
|
@ -28,17 +28,20 @@ if [ "${MOCK_TEENSY:-0}" = "1" ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
# Optionally start the PTP daemon (statime) for development
|
||||
# Optionally start a PTP daemon for development (prefer statime, fallback to ptp4l)
|
||||
if [ "${RUN_STATIME:-0}" = "1" ]; then
|
||||
echo "[entrypoint] Starting statime PTP daemon..." >&2
|
||||
IFACE="${PTP_INTERFACE:-eth0}"
|
||||
if command -v statime >/dev/null 2>&1; then
|
||||
IFACE="${PTP_INTERFACE:-eth0}"
|
||||
echo "[entrypoint] statime interface: ${IFACE}" >&2
|
||||
# Run statime in background; logs to container stderr/stdout
|
||||
echo "[entrypoint] Starting statime on ${IFACE}..." >&2
|
||||
statime -i "${IFACE}" &
|
||||
STATIME_PID=$!
|
||||
elif command -v ptp4l >/dev/null 2>&1; then
|
||||
echo "[entrypoint] Starting ptp4l on ${IFACE}..." >&2
|
||||
# -m prints messages to stdout; adjust args as needed for your environment
|
||||
ptp4l -i "${IFACE}" -m &
|
||||
PTP4L_PID=$!
|
||||
else
|
||||
echo "[entrypoint] statime not found on PATH" >&2
|
||||
echo "[entrypoint] No PTP daemon found (statime or ptp4l). Skipping." >&2
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue