Enhance the dashboard API with new endpoints for managing DHCP network boot options, allowing devices to enable or disable network boot via POST requests. Update the device action handling to include a 'reboot' action, specifically for network devices. Modify the home.html template to display the current state of network boot and provide a button for disabling it. Update provisioning scripts to disable network boot after deployment or backup completion, ensuring devices boot from eMMC on the next startup. Improve user feedback and error handling throughout the changes.
Network provisioning client
When a reTerminal (or any Pi) has network boot enabled and boots over the network, it can register with the provisioning dashboard and then perform Deploy (pull golden image and write to eMMC) or Backup (read eMMC and upload to the server) when you choose the action in the dashboard.
Flow
- Device boots (e.g. from NFS or a minimal netboot root).
- Run provisioning-client.sh with
PROVISIONING_SERVERset to the dashboard URL (e.g.http://<LXC-IP>:5000). - The script registers (MAC + IP) and polls
GET /api/device-action-poll?mac=.... - In the dashboard, the device appears under "Device detected (Network)". You click Backup or Deploy.
- The device gets the action from the next poll: Deploy → it downloads
GET /api/golden-imageand runsdd of=/dev/mmcblk0. Backup → it runsdd if=/dev/mmcblk0and POSTs toPOST /api/backup-upload?mac=....
Usage on the device
export PROVISIONING_SERVER=http://192.168.1.10:5000 # dashboard URL
./provisioning-client.sh
- EMMC_DEV: override eMMC block device (default
/dev/mmcblk0).
The device must have network access to the dashboard and (for deploy) the dashboard must have golden.img in its provisioning directory.
Integrating into a netboot environment
- Add this script to your netboot root (e.g. NFS-mounted filesystem or initramfs).
- Run it from a first-boot or default login script so that when the device boots from the network it registers and waits for an action. Optionally run it as a systemd service that starts after network is up.