Option to update the config without flashing the image again
This commit is contained in:
+20
-18
@@ -239,33 +239,35 @@ log "Expected config partition after flash: $TARGET_CONFIG_PART"
|
||||
log "Target disk info:"
|
||||
diskutil info "$TARGET_DISK" || die "Unable to inspect target disk"
|
||||
|
||||
echo
|
||||
printf "Type 'YES' to continue: "
|
||||
read -r CONFIRM
|
||||
[ "$CONFIRM" = "YES" ] || die "Aborted."
|
||||
if ! [ "$1" == "config" ]; then
|
||||
echo
|
||||
printf "Type 'YES' to continue: "
|
||||
read -r CONFIRM
|
||||
[ "$CONFIRM" = "YES" ] || die "Aborted."
|
||||
|
||||
log "Unmounting target disk..."
|
||||
diskutil unmountDisk force "$TARGET_DISK" || die "Failed to unmount $TARGET_DISK"
|
||||
log "Unmounting target disk..."
|
||||
diskutil unmountDisk force "$TARGET_DISK" || die "Failed to unmount $TARGET_DISK"
|
||||
|
||||
log "Flashing image with progress..."
|
||||
pv -s "$IMG_SIZE_BYTES" "$IMG" \
|
||||
log "Flashing image with progress..."
|
||||
pv -s "$IMG_SIZE_BYTES" "$IMG" \
|
||||
| gunzip \
|
||||
| dd of="$TARGET_RAW_DISK" bs=4m
|
||||
|
||||
log "Syncing writes..."
|
||||
sync
|
||||
log "Syncing writes..."
|
||||
sync
|
||||
|
||||
log "Ejecting and re-reading disk..."
|
||||
diskutil eject "$TARGET_DISK" >/dev/null 2>&1 || true
|
||||
sleep 2
|
||||
log "Ejecting and re-reading disk..."
|
||||
diskutil eject "$TARGET_DISK" >/dev/null 2>&1 || true
|
||||
sleep 2
|
||||
|
||||
log "Waiting for disk to come back..."
|
||||
if ! wait_for_disk "$TARGET_DISK" 15; then
|
||||
log "Waiting for disk to come back..."
|
||||
if ! wait_for_disk "$TARGET_DISK" 15; then
|
||||
warn "Disk node did not reappear quickly. You may need to replug the drive."
|
||||
fi
|
||||
fi
|
||||
|
||||
log "Disk layout after flashing:"
|
||||
diskutil list "$TARGET_DISK" || warn "Could not list flashed disk yet"
|
||||
log "Disk layout after flashing:"
|
||||
diskutil list "$TARGET_DISK" || warn "Could not list flashed disk yet"
|
||||
fi
|
||||
|
||||
ENV_FILES="$(find "$SEARCH_DIR" -maxdepth 1 -type f -name '*.env' | sort || true)"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user