<li><spanclass="step-num">1</span> Set the reTerminal to <strong>boot mode</strong>: fit the <strong>eMMC disable</strong> jumper (e.g. J2 / nRPIBOOT).</li>
<divid="progressFill"class="progress-fill"></div>
<li><spanclass="step-num">2</span> Connect the reTerminal’s <strong>USB slave</strong> port to the Proxmox host. Power on. The device will appear in “Device detected” below; choose <strong>Backup</strong> or <strong>Deploy</strong>.</li>
<li><spanclass="step-num">3</span> When done, remove the jumper and power cycle so it boots from eMMC.</li>
<li><spanclass="step-num">1</span> Enable network boot on the CM4 (e.g. <code>BOOT_ORDER=0x21</code>) and ensure it can reach this server.</li>
<li><spanclass="step-num">2</span> Boot the device over the network with an environment that runs the <strong>provisioning client</strong> (register + poll for action). It will show under “Device detected (Network)”. Choose <strong>Backup</strong> or <strong>Deploy</strong>.</li>
<h2class="section-title">Devices waiting for action</h2>
</div>
<pid="pendingHint"style="color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 0.75rem;">When a device is detected (USB boot mode or network boot), it will appear below. Choose <strong>Backup</strong> to save its eMMC to a file, or <strong>Deploy</strong> to write the golden image to it.</p>
<divid="pendingDevices"></div>
<divid="pendingDevices"></div>
<pid="noPending"class="empty-state"style="display:none;">No device waiting. Connect a reTerminal in USB boot mode, or ensure a network-booted device has registered.</p>
<pid="noPending"class="empty-msg"style="display:none;">No devices. Connect reTerminal in USB boot mode or register over network.</p>
<li><spanclass="num">1</span> Set reTerminal to <strong>boot mode</strong> (eMMC disable jumper, e.g. J2 / nRPIBOOT).</li>
<li><spanclass="num">2</span> Connect <strong>USB slave</strong> to the host and power on. The device appears above; choose <strong>Backup</strong> or <strong>Deploy</strong>.</li>
<li><spanclass="num">3</span> When done, remove the jumper and power cycle to boot from eMMC.</li>
</ol>
<pclass="help-sub">Network boot</p>
<olclass="steps-list">
<li><spanclass="num">1</span> Enable network boot (e.g. <codestyle="background:var(--bg-tertiary);padding:0.15rem 0.35rem;border-radius:4px;">BOOT_ORDER=0x21</code>) and ensure the device can reach this server.</li>
<li><spanclass="num">2</span> Boot with the provisioning client; it will show above. Choose <strong>Backup</strong> or <strong>Deploy</strong>.</li>
</ol>
</div>
</div>
<divid="status"class="status-box idle">
</details>
<divclass="status-phase">Idle</div>
<divclass="status-message">Waiting for reTerminal in boot mode.</div>
fetch('/api/status').then(function(r){returnr.json();}).then(renderStatus).catch(function(){renderStatus({phase:'error',message:'Could not load status.'});});
.then(r=>r.json())
}
.then(renderStatus)
functionfetchPending(){
.catch(()=>renderStatus({phase:'error',message:'Could not load status.'}));
# Automatic eMMC provisioning for reTerminal DM4 (CM4)
# eMMC provisioning for reTerminal DM4 (CM4)
This guide covers:
This guide covers:
1.**Auto-flash**: When the reTerminal is switched to boot mode (eMMC disable jumper) and connected via USB to a provisioning host, the host automatically deploys a golden image to the CM4 eMMC.
1.**USB boot mode**: When the reTerminal is in boot mode (eMMC disable jumper) and connected via USB, the host runs **rpiboot** to expose the eMMC, then the **dashboard** shows "Device connected (USB)". You choose **Backup** or **Deploy** in the portal — there is no auto-flash; the action runs only after your choice.
2.**Backup**: When a device is detected (USB or network), the dashboard asks you to choose **Backup** or **Deploy**. Backup saves the device eMMC to a timestamped file in `backups/`.
2.**Network boot**: If the device boots over the network and runs the **provisioning client** (see `network-client/`), it registers with the dashboard and appears as "Device (Network)"; you then choose Backup or Deploy. Deploy streams the golden image to the device; Backup uploads the device eMMC to the server.
3.**Network**: If the device boots over the network and runs the **provisioning client** (see `network-client/`), it registers with the dashboard and appears as "Device (Network)"; you then choose Backup or Deploy. Deploy streams the golden image to the device; Backup uploads the device eMMC to the server.
3.**Cloud-init**: The golden image can include cloud-init so each device configures itself on first boot (hostname, network, packages, kiosk setup).
4.**Cloud-init**: The golden image includes cloud-init so each device configures itself on first boot (hostname, network, packages, kiosk setup).
---
---
## Part 1: Auto-flash when reTerminal is in boot mode
## Part 1: USB boot mode — detect device, choose Backup or Deploy in portal
### How it works
### How it works
- reTerminal has an **eMMC disable** jumper (see reTerminal docs; often “J2” or “nRPIBOOT”). When the jumper is fitted, the CM4 boots in **USB device mode** and waits for `rpiboot` from the host.
- reTerminal has an **eMMC disable** jumper (see reTerminal docs; often “J2” or “nRPIBOOT”). When the jumper is fitted, the CM4 boots in **USB device mode** and waits for `rpiboot` from the host.
- You connect the reTerminal’s **USB slave** port to a **provisioning PC** (Linux).
- You connect the reTerminal’s **USB slave** port to a **provisioning PC** (Linux).
- **udev** detects the Raspberry Pi Foundation USB device (vendor `2b8e`) and runs a trigger script.
- **udev** detects the Raspberry Pi Foundation USB device (vendor `2b8e`) and runs a trigger script.
- The trigger starts a**flash job** that:
- The trigger starts the**provisioning script** that:
1. Runs **rpiboot** (from the `usbboot` project). The CM4 then exposes its eMMC as a USB mass-storage device.
1. Runs **rpiboot** (from the `usbboot` project). The CM4 then exposes its eMMC as a USB mass-storage device.
2.After `rpiboot` exits, finds the new block device (eMMC) and writes your **golden image** to it with `dd`.
2.Finds the new block device (eMMC) and writes status so the **dashboard** shows "Device connected (USB boot mode). Choose Backup or Deploy in the dashboard."
- You remove the jumper and power cycle; the reTerminal boots from eMMC and runs **cloud-init** on first boot.
3.**Waits for your choice in the portal** — no automatic flash. When you click **Backup** or **Deploy** in the dashboard, the script runs that action (dd backup or dd deploy).
- You remove the jumper and power cycle; the reTerminal boots from eMMC and can run **cloud-init** on first boot.
### Provisioning host setup (Linux)
### Provisioning host setup (Linux)
@@ -45,7 +45,7 @@ sudo cp rpiboot /opt/usbboot/
- Or use a different path and set `GOLDEN_IMAGE` when installing the script (see below).
- Or use a different path and set `GOLDEN_IMAGE` when installing the script (see below).
#### 3. Install the auto-flash script and trigger
#### 3. Install the provisioning script and trigger
```bash
```bash
# From this repo (chromium-setup/emmc-provisioning/host/)
# From this repo (chromium-setup/emmc-provisioning/host/)
To disable auto-flash, remove that file: `sudo rm /etc/cm4-provisioning/enabled`.
To disable provisioning (no device detection), remove that file: `sudo rm /etc/cm4-provisioning/enabled`.
#### 6. Optional: pass environment into the flash job
#### 6. Optional: pass environment into the provisioning job
If you use `/opt/cm4-provisioning/env`, update the trigger so the flash script sees those variables. For example change `/usr/local/bin/cm4-flash-trigger.sh` to:
If you use `/opt/cm4-provisioning/env`, update the trigger so the flash script sees those variables. For example change `/usr/local/bin/cm4-flash-trigger.sh` to:
# Auto-flash CM4 eMMC when reTerminal is connected in boot mode (eMMC disable jumper).
# Provision CM4 eMMC when reTerminal is connected in boot mode (eMMC disable jumper).
# Run this from udev or a systemd service when Raspberry Pi USB boot device (2b8e) is detected.
# On USB boot device (2b8e) detection: run rpiboot to expose eMMC, then wait for the user
# Requires: usbboot (rpiboot) built, golden image at GOLDEN_IMAGE path.
# to choose Backup or Deploy in the portal — no auto-flash; action runs only after portal choice.
# Run this from udev or a systemd service. Requires: usbboot (rpiboot) built, golden image for deploy.
set -e
set -e
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.