From 3d4a340305bb3d4d147a8600fbd601b53c1b482a Mon Sep 17 00:00:00 2001 From: "Aaron D. Lee" Date: Thu, 8 Jan 2026 12:30:39 -0500 Subject: [PATCH] Add prompt for filesystem expansion in wizard Show current size and ask user before expanding, matching the style of other wizard prompts. Co-Authored-By: Claude Opus 4.5 --- rpi/first-boot-wizard.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/rpi/first-boot-wizard.sh b/rpi/first-boot-wizard.sh index 8f1fe47..0038c6c 100755 --- a/rpi/first-boot-wizard.sh +++ b/rpi/first-boot-wizard.sh @@ -60,19 +60,28 @@ gum confirm "Ready to begin setup?" || exit 0 clear gum style \ --foreground 212 --bold \ - "Expanding filesystem..." + "Step 0: Expand Filesystem" echo "" # Get current and total size ROOT_DEV=$(findmnt -n -o SOURCE /) CURRENT_SIZE=$(df -h / | awk 'NR==2 {print $2}') -gum style --foreground 245 "Current size: $CURRENT_SIZE" +TOTAL_SIZE=$(lsblk -b -d -o SIZE $(echo "$ROOT_DEV" | sed 's/[0-9]*$//') 2>/dev/null | tail -1 | awk '{printf "%.0fG", $1/1024/1024/1024}') -# Run resize2fs with a spinner -gum spin --spinner dot --title "Expanding to fill SD card..." -- sudo resize2fs "$ROOT_DEV" 2>/dev/null +gum style --foreground 245 "\ +The filesystem is currently $CURRENT_SIZE but your SD card may be larger. +Expanding will use all available space on the SD card." +echo "" +gum style --foreground 245 "Current: $CURRENT_SIZE" +echo "" -NEW_SIZE=$(df -h / | awk 'NR==2 {print $2}') -gum style --foreground 82 "✓ Expanded to: $NEW_SIZE" +if gum confirm "Expand filesystem to fill SD card?" --default=true; then + gum spin --spinner dot --title "Expanding filesystem..." -- sudo resize2fs "$ROOT_DEV" 2>/dev/null + NEW_SIZE=$(df -h / | awk 'NR==2 {print $2}') + gum style --foreground 82 "✓ Expanded to: $NEW_SIZE" +else + gum style --foreground 214 "→ Skipped (you can run 'sudo resize2fs $ROOT_DEV' later)" +fi sleep 1 # =============================================================================