mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
Applied PROGRESS_DISPLAY to creating blank image
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user