ops: appliance boot — wait for cameras/LiveKit, power button powers off

This commit is contained in:
Hermes
2026-08-28 05:45:11 +00:00
parent b5a2fe6440
commit abeea6256c
7 changed files with 103 additions and 10 deletions
+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash
# Wait for udev to pin C920 nodes after boot. Never fail the unit:
# discovery can still run with whatever is present.
set -u
udevadm settle -t 20 || true
udevadm trigger --subsystem-match=video4linux --action=add || true
udevadm trigger --subsystem-match=sound --action=add || true
for _ in $(seq 1 45); do
n=$(ls -1 /dev/cam[0-9][0-9] 2>/dev/null | wc -l)
if [ "$n" -ge 1 ]; then
echo "wait-for-cameras: $n pinned /dev/camNN nodes"
exit 0
fi
sleep 1
done
echo "wait-for-cameras: none yet; starting anyway" >&2
exit 0