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