fix the calculation of the total new image size

This commit is contained in:
Simone Karin Lehmann 2018-03-13 22:23:31 +01:00 committed by Simone Karin Lehmann
parent 39de57246b
commit 9ec17c9c1d
1 changed files with 2 additions and 1 deletions

View File

@ -84,7 +84,8 @@ EOF2
sleep 1
#Truncate the file
endresult=$(($partnewsize + 1))
endresult=$(($newpartend * 512))
endresult=$(($endresult + 1))
dd if="$img" of="$img-shrinked.img" bs=512 count=$endresult
aftersize=$(ls -lh "$img-shrinked.img" | tr -s " " | cut -d " " -f 5)
rm -f "$img"