From 1f40eeff9e4b8f3a16d906626c6963d6bfbecc7e Mon Sep 17 00:00:00 2001 From: "Aaron D. Lee" Date: Sun, 4 Jan 2026 17:27:26 -0500 Subject: [PATCH] Add option to skip compression in pull-image.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use .img extension to skip zstd compression: ./pull-image.sh stegasoo.img Use .img.zst to compress (default behavior): ./pull-image.sh stegasoo.img.zst 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- rpi/pull-image.sh | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/rpi/pull-image.sh b/rpi/pull-image.sh index 4eec150..0eaa926 100755 --- a/rpi/pull-image.sh +++ b/rpi/pull-image.sh @@ -5,6 +5,7 @@ # # Usage: ./pull-image.sh [output-name] [device] # Output will be: stegasoo-rpi-YYYYMMDD.img.zst (or custom name) +# Use .img extension to skip compression: ./pull-image.sh foo.img # # If device is specified, skips auto-detection (useful for large drives) # @@ -40,9 +41,15 @@ else fi MANUAL_DEVICE="$2" -# Remove .zst extension for intermediate file -IMG_FILE="${OUTPUT%.zst}" -if [[ "$IMG_FILE" == "$OUTPUT" ]]; then +# Check if output ends in .img (skip compression) or .zst (compress) +SKIP_COMPRESS=false +if [[ "$OUTPUT" == *.img ]]; then + IMG_FILE="$OUTPUT" + SKIP_COMPRESS=true +elif [[ "$OUTPUT" == *.zst ]]; then + IMG_FILE="${OUTPUT%.zst}" +else + # No recognized extension, add .img.zst IMG_FILE="${OUTPUT}.img" OUTPUT="${OUTPUT}.img.zst" fi @@ -179,12 +186,18 @@ else fi echo "" -echo -e "${GREEN}[3/3]${NC} Compressing with zstd..." -pv "$IMG_FILE" | zstd -19 -T0 -q > "$OUTPUT" -rm -f "$IMG_FILE" +if [ "$SKIP_COMPRESS" = true ]; then + echo -e "${GREEN}[3/3]${NC} Skipping compression (.img output)" + FINAL_SIZE=$(du -h "$IMG_FILE" | awk '{print $1}') + OUTPUT="$IMG_FILE" +else + echo -e "${GREEN}[3/3]${NC} Compressing with zstd..." + pv "$IMG_FILE" | zstd -19 -T0 -q > "$OUTPUT" + rm -f "$IMG_FILE" + FINAL_SIZE=$(du -h "$OUTPUT" | awk '{print $1}') +fi echo "" -FINAL_SIZE=$(du -h "$OUTPUT" | awk '{print $1}') echo -e "${GREEN}╔═══════════════════════════════════════════════════════════════╗${NC}" echo -e "${GREEN}║ Image Complete! ║${NC}" echo -e "${GREEN}╚═══════════════════════════════════════════════════════════════╝${NC}"