Add DHCP network boot management to API and UI
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.
This commit is contained in:
@@ -67,8 +67,9 @@ So the “netboot environment” is either:
|
||||
|
||||
- You open the dashboard at `http://10.20.50.1:5000` (or the LXC’s WAN IP if you’re not on the provisioning LAN).
|
||||
- Under **“Device detected (Network)”** you see the device (identified by MAC).
|
||||
- You click **Deploy** or **Backup**.
|
||||
- The dashboard sets the **action** (and URL/upload_url) for that MAC; the next **device-action-poll** returns it, and the client runs the corresponding dd + curl.
|
||||
- You click **Deploy**, **Backup**, or **Disable network boot**.
|
||||
- **Deploy** / **Backup**: the dashboard sets the action and URL; the client runs dd + curl, then calls **/api/action-done**, which **disables DHCP network-boot options** on the LXC so the device will boot from eMMC on the next reboot. No need to unplug ethernet.
|
||||
- **Disable network boot**: turns off DHCP options 66/67 (next-server, boot file) on the LXC. The DHCP server keeps running; devices just stop receiving netboot and will boot from local storage (eMMC) next time. Use this when you don't want to deploy or backup; the netbooted device can then reboot and boot from eMMC.
|
||||
|
||||
---
|
||||
|
||||
@@ -83,13 +84,14 @@ So the “netboot environment” is either:
|
||||
| Your choice | You → LXC | In dashboard: click Deploy or Backup for that device. |
|
||||
| Deploy | LXC → device | Client GETs image URL, streams to `dd of=/dev/mmcblk0`. |
|
||||
| Backup | Device → LXC | Client `dd if=/dev/mmcblk0` and POSTs to upload_url. |
|
||||
| After | reTerminal | Reboot; if you deployed, it can now boot from eMMC. |
|
||||
| After | Device → LXC | Client calls **POST /api/action-done**; server disables DHCP netboot options. |
|
||||
| After | reTerminal | Reboot; device boots from eMMC (no netboot advertised). |
|
||||
|
||||
---
|
||||
|
||||
## What you need in place
|
||||
|
||||
- **LXC**: eth1 = 10.20.50.1/24, dnsmasq (DHCP + TFTP on eth1), `/srv/tftpboot` with RPi 4 boot files, NAT for 10.20.50.0/24 via eth0. Dashboard running, `golden.img` present for Deploy.
|
||||
- **LXC**: eth1 = 10.20.50.1/24, dnsmasq (DHCP + TFTP on eth1; netboot options 66/67 in a separate snippet so they can be toggled), `/srv/tftpboot` with RPi 4 boot files, NAT for 10.20.50.0/24 via eth0. Toggle script **/opt/cm4-provisioning/toggle-network-boot-dhcp.sh** (enable/disable/status). Dashboard running, `golden.img` present for Deploy.
|
||||
See **NETWORK-BOOT-LXC.md** and **setup-network-boot-on-lxc.sh**.
|
||||
- **reTerminal**: EEPROM boot order = network first; Ethernet on 10.20.50.0/24; netboot environment that runs **provisioning-client.sh** with `PROVISIONING_SERVER=http://10.20.50.1:5000`.
|
||||
- **Netboot root**: Must provide network, curl, and the client script (NFS, initramfs, or custom root).
|
||||
|
||||
Reference in New Issue
Block a user