Add no-cache response header to dashboard for immediate visibility after deploys; enhance Proxmox monitoring documentation and update flash script to allow Backup without a golden image.
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
# When reTerminal (CM4) is connected in USB boot mode (eMMC disable jumper),
|
||||
# Raspberry Pi Foundation USB device appears (vendor 2b8e). Trigger provisioning:
|
||||
# run rpiboot to expose eMMC, then wait for user to choose Backup or Deploy in the portal.
|
||||
# No auto-flash — action runs only after portal choice.
|
||||
# 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
|
||||
# The trigger script starts the provisioning script via systemd so udev does not block.
|
||||
|
||||
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"
|
||||
|
||||
@@ -48,11 +48,9 @@ ACTION_REQUEST_FILE="${ACTION_REQUEST_FILE:-/var/lib/cm4-provisioning/action_req
|
||||
CURRENT_DEVICE_FILE="${CURRENT_DEVICE_FILE:-/var/lib/cm4-provisioning/current_device}"
|
||||
DEVICE_SOURCE_FILE="${DEVICE_SOURCE_FILE:-/var/lib/cm4-provisioning/device_source}"
|
||||
WAIT_TIMEOUT="${WAIT_TIMEOUT:-600}"
|
||||
# Golden image required for deploy
|
||||
# Golden image required only for Deploy; allow Backup without it
|
||||
if [[ ! -f "$GOLDEN_IMAGE" ]]; then
|
||||
log "Golden image not found (required for deploy): $GOLDEN_IMAGE"
|
||||
write_status "error" "Golden image not found" "null" "Golden image not found. Add golden.img for deploy."
|
||||
exit 1
|
||||
log "Golden image not found (Deploy will be unavailable): $GOLDEN_IMAGE"
|
||||
fi
|
||||
|
||||
RPIBOOT_BIN="$RPIBOOT_DIR/rpiboot"
|
||||
@@ -140,6 +138,12 @@ for (( i = 0; i < WAIT_TIMEOUT; i += 2 )); do
|
||||
write_status "error" "Backup failed" "null" "dd failed"
|
||||
fi
|
||||
elif [[ "$action" == "deploy" ]]; then
|
||||
if [[ ! -f "$GOLDEN_IMAGE" ]]; then
|
||||
log "Golden image not found; cannot deploy."
|
||||
write_status "error" "Deploy unavailable" "null" "Golden image not found. Add golden.img to /var/lib/cm4-provisioning/ for deploy."
|
||||
rm -f "$CURRENT_DEVICE_FILE" "$DEVICE_SOURCE_FILE" 2>/dev/null || true
|
||||
exit 1
|
||||
fi
|
||||
write_status "flashing" "Writing golden image…" "null"
|
||||
log "Flashing $GOLDEN_IMAGE to $target_dev..."
|
||||
if dd if="$GOLDEN_IMAGE" of="$target_dev" bs=4M status=progress conv=fsync 2>>"$LOG_FILE"; then
|
||||
|
||||
Reference in New Issue
Block a user