# When reTerminal (CM4) is connected in USB boot mode (eMMC disable jumper),
# the device appears as either Raspberry Pi Foundation (2b8e) or Broadcom BCM2711 Boot (0a5c:2711).
# Trigger provisioning: run rpiboot, then wait for user to choose Backup or Deploy in the portal.
# Install: sudo cp 90-cm4-boot-mode.rules /etc/udev/rules.d/
#          sudo udevadm control --reload-rules

SUBSYSTEM=="usb", ATTR{idVendor}=="2b8e", ACTION=="add", \
  RUN+="/usr/local/bin/cm4-flash-trigger.sh"
SUBSYSTEM=="usb", ATTR{idVendor}=="0a5c", ATTR{idProduct}=="2711", ACTION=="add", \
  RUN+="/usr/local/bin/cm4-flash-trigger.sh"
