commit 4e8e1896cfbbec61ddeb5b48071ec51c2a65425029aa3f9490e5744516a37da6
| author | 斟酌 鵬兄 <tgckpg@gmail.com> |
| date | 2026-06-01T14:47:03Z |
| subject | Option to update the config without flashing the image again |
commit 4e8e1896cfbbec61ddeb5b48071ec51c2a65425029aa3f9490e5744516a37da6
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date: 2026-06-01T14:47:03Z
Option to update the config without flashing the image again
---
macos/flashusb.sh | 54 ++++++++++++++++++++++++++++--------------------------
1 file changed, 28 insertions(+), 26 deletions(-)
diff --git a/macos/flashusb.sh b/macos/flashusb.sh
index 430af9d..93e5d4e 100755
--- a/macos/flashusb.sh
+++ b/macos/flashusb.sh
@@ -239,34 +239,36 @@ 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."
-
-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" \
- | gunzip \
- | dd of="$TARGET_RAW_DISK" bs=4m
-
-log "Syncing writes..."
-sync
-
-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
- warn "Disk node did not reappear quickly. You may need to replug the drive."
+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 "Flashing image with progress..."
+ pv -s "$IMG_SIZE_BYTES" "$IMG" \
+ | gunzip \
+ | dd of="$TARGET_RAW_DISK" bs=4m
+
+ log "Syncing writes..."
+ sync
+
+ 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
+ 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
-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)"
if [ -n "$ENV_FILES" ]; then