Applied PROGRESS_DISPLAY to creating blank image

This commit is contained in:
zador-blood-stained
2015-12-18 15:26:54 +03:00
parent fc7be04f3b
commit 48c8953cb8

View File

@@ -36,15 +36,13 @@ ROOTSTART=$(($BOOTSTART+($BOOTSIZE*2048)))
BOOTEND=$(($ROOTSTART-1))
# Create image file
while read line;do
[[ "$line" =~ "records out" ]] &&
echo "$(( ${line%+*}*100/$SDSIZE +1 ))" | dialog --backtitle "$backtitle" --title "Creating blank image ($SDSIZE Mb), please wait ..." --gauge "" 5 70
done< <( dd if=/dev/zero of=$DEST/cache/tmprootfs.raw bs=1M count=$SDSIZE 2>&1 &
pid=$!
sleep 1
while kill -USR1 $pid 2>/dev/null;do
sleep 1
done )
if [ "$OUTPUT_DIALOG" = "yes" ]; then
(pv -n -s $SDSIZE -S /dev/zero | dd status=none of=$DEST/cache/tmprootfs.raw) 2>&1 \
| dialog --backtitle "$backtitle" --title "Creating blank image ($SDSIZE Mb), please wait ..." --gauge "" 5 70
else
pv -p -b -r -s $SDSIZE -S /dev/zero | dd status=none of=$DEST/cache/tmprootfs.raw
fi
# Find first available free device
LOOP=$(losetup -f)