Fix SD card flashing progress display
- Remove pv (showed read progress, not write progress) - Use dd status=progress for actual write progress - Reduce block size to 1M (better for slow SD cards) - Remove conv=fsync (sync at end instead, faster) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -278,29 +278,16 @@ echo ""
|
|||||||
echo -e "${GREEN}Flashing image to $SELECTED...${NC}"
|
echo -e "${GREEN}Flashing image to $SELECTED...${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Flash with dd (optionally with pv for progress)
|
# Flash with dd (status=progress shows actual write progress)
|
||||||
if [ "$HAS_PV" = true ]; then
|
echo -e "${YELLOW}Flashing (this may take several minutes for SD cards)...${NC}"
|
||||||
echo -e "${YELLOW}Flashing with progress...${NC}"
|
if [ "$COMPRESSED" = true ]; then
|
||||||
if [ "$COMPRESSED" = true ]; then
|
case "$COMP_TYPE" in
|
||||||
case "$COMP_TYPE" in
|
xz) xzcat "$IMAGE" | sudo dd of="$SELECTED" bs=1M status=progress ;;
|
||||||
xz) pv "$IMAGE" | xzcat | sudo dd of="$SELECTED" bs=4M conv=fsync 2>/dev/null ;;
|
zst) zstdcat "$IMAGE" | sudo dd of="$SELECTED" bs=1M status=progress ;;
|
||||||
zst) pv "$IMAGE" | zstdcat | sudo dd of="$SELECTED" bs=4M conv=fsync 2>/dev/null ;;
|
gz) zcat "$IMAGE" | sudo dd of="$SELECTED" bs=1M status=progress ;;
|
||||||
gz) pv "$IMAGE" | zcat | sudo dd of="$SELECTED" bs=4M conv=fsync 2>/dev/null ;;
|
esac
|
||||||
esac
|
|
||||||
else
|
|
||||||
pv "$IMAGE" | sudo dd of="$SELECTED" bs=4M conv=fsync 2>/dev/null
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo -e "${YELLOW}Flashing (install pv for progress bar)...${NC}"
|
sudo dd if="$IMAGE" of="$SELECTED" bs=1M status=progress
|
||||||
if [ "$COMPRESSED" = true ]; then
|
|
||||||
case "$COMP_TYPE" in
|
|
||||||
xz) xzcat "$IMAGE" | sudo dd of="$SELECTED" bs=4M conv=fsync status=progress ;;
|
|
||||||
zst) zstdcat "$IMAGE" | sudo dd of="$SELECTED" bs=4M conv=fsync status=progress ;;
|
|
||||||
gz) zcat "$IMAGE" | sudo dd of="$SELECTED" bs=4M conv=fsync status=progress ;;
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
sudo dd if="$IMAGE" of="$SELECTED" bs=4M conv=fsync status=progress
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
Reference in New Issue
Block a user