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:
@@ -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