mirror of
https://github.com/CyberMind-FR/secubox-deb.git
synced 2026-07-29 22:07:24 +00:00
The previous build had two gadget services enabled at boot:
- secubox-eye-gadget.service: ExecStartPre=modprobe dwc2 + libcomposite
- secubox-otg-gadget.service: ExecStartPre=modprobe libcomposite + usb_f_*
(NO dwc2 — relied on eye-gadget loading it first)
When PR #175 disabled secubox-eye-gadget at boot (to stop the UDC conflict),
nobody loaded dwc2 anymore. systemd-modules-load reads /etc/modules but the
order of dwc2 load vs the otg-gadget service start window was tight — and
on the rpiz the journal showed no successful gadget enumeration after the
PR #175 image deployed.
Defensive fix in two places:
1. secubox-otg-gadget.service: prepend ExecStartPre=/sbin/modprobe dwc2.
Drop the ConditionPathIsDirectory=/sys/class/udc gate so the service
actually runs and can load dwc2 if it isn't loaded yet (the path is a
sysfs dir that exists when its parent /sys/class is mounted — it was
harmless, but removing it makes the chain self-bootstrapping).
2. secubox-otg-gadget.sh check_prerequisites(): also modprobe dwc2 (in
case the service is invoked manually by an operator), then poll
/sys/class/udc for up to 5s waiting for the BCM USB controller to
bind asynchronously. Diagnostic message updated to point at the two
places to check (dtoverlay + /etc/modules) if no UDC ever shows up.
|
||
|---|---|---|
| .. | ||
| secubox-otg-gadget.sh | ||
| secubox-otg-host-up.sh | ||