Files
reterminal-dm4/emmc-provisioning/host
nearxos 031e1c3415 Enhance provisioning documentation and scripts for improved network boot and DNS management</message>
<message>Add new documentation files for device DNS management via DHCP and dnsmasq configuration. Update cloud-init scripts to ensure proper handling of /etc/resolv.conf and DNS settings, allowing for seamless integration with file.server. Modify existing scripts to support dynamic LAN subnet configuration and improve overall network boot functionality. These changes enhance user experience and streamline the setup process for the CM4 eMMC provisioning service.
2026-03-04 19:15:38 +02:00
..

Host-side provisioning scripts

These files run on the provisioning host (e.g. the Proxmox host where the reTerminal is connected via USB).

File Purpose
flash-emmc-on-connect.sh Runs rpiboot, detects eMMC, waits for dashboard choice (Backup/Deploy), then runs dd. Install to /opt/cm4-provisioning/.
cm4-flash-trigger.sh Started by udev when USB device 2b8e is added. Launches the flash script via systemd-run. Install to /usr/local/bin/.
90-cm4-boot-mode.rules udev rule: on USB add (vendor 2b8e), run the trigger. Install to /etc/udev/rules.d/.

See ../docs/EMMC-PROVISIONING-GUIDE.md for full setup. The deploy script copies these into place on the Proxmox host and LXC.

Stuck “finalizing: Compressing image (xz)…” on the host

If the dashboard still shows that message, run on the host (e.g. ssh root@10.20.30.152):

# 1) See current status and whether build/xz is still running
PROV="${CM4_PROVISIONING_DIR:-/var/lib/cm4-provisioning}"
cat "$PROV/build_cloudinit_status.json"
ps aux | grep -E 'build-cloudinit|xz.*\.img' | grep -v grep

# 2a) If a build is still running and you want to cancel it
touch "$PROV/build_cloudinit_cancel"
# Script checks every 2s; after it exits, status will show "cancelled"

# 2b) If no build process is running but status is stuck, reset to idle
echo '{"phase":"idle","message":"","output_name":null,"error":null,"updated":'$(date +%s)'}' > "$PROV/build_cloudinit_status.json"

The status lives in build_cloudinit_status.json (host: $PROV_DIR/; dashboard: CM4_BUILD_STATUS_FILE or BASE_DIR/). You can refresh the dashboard or click Dismiss to clear the message (Dismiss force-clears even when stuck).