Enhance eMMC provisioning scripts and documentation: add troubleshooting section for device connection issues, update flash script to prevent concurrent runs, and improve logging. Adjust deployment scripts to verify presence of boot files in mass-storage-gadget.

This commit is contained in:
nearxos
2026-02-18 16:29:27 +02:00
parent ccdace36bc
commit f93d224e8b
9 changed files with 194 additions and 35 deletions

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# Called by udev when CM4 in boot mode is connected. Starts the provisioning script in the
# background (rpiboot + wait for portal Backup/Deploy choice). Install to /usr/local/bin/cm4-flash-trigger.sh
# Called by udev when CM4 in boot mode (0a5c:2711 or 2b8e) is connected.
# Start the flash service via systemd so it runs under systemd, not udev —
# otherwise udev kills the process when the device re-enumerates (first→second stage).
# --no-block: return immediately so udev doesn't wait; the service runs in the background.
FLASH_SCRIPT="${CM4_FLASH_SCRIPT:-/opt/cm4-provisioning/flash-emmc-on-connect.sh}"
exec systemd-run --no-block --unit=cm4-flash-once "$FLASH_SCRIPT"
systemctl --no-block start cm4-flash.service