Removed some checks

This commit is contained in:
framp 2018-08-19 22:05:28 +02:00
parent 8a0637b3da
commit db62822a42
1 changed files with 4 additions and 21 deletions

View File

@ -107,29 +107,11 @@ trap cleanup ERR EXIT
#Gather info
info "Gatherin data"
beforesize=$(ls -lh "$img" | cut -d ' ' -f 5)
logVariables $LINENO beforesize
if ! parted_output=$(parted -ms "$img" unit B print); then
rc=$?
error $LINENO "parted failed with rc $rc"
exit -6
fi
parted_output=$(tail -n 1 <<< $parted_output)
logVariables $LINENO parted_output
parted_output=$(parted -ms "$img" unit B print | tail -n 1)
partnum=$(echo "$parted_output" | cut -d ':' -f 1)
partstart=$(echo "$parted_output" | cut -d ':' -f 2 | tr -d 'B')
logVariables $LINENO partnum partstart
info "Mounting image"
if ! loopback=$(losetup -f --show -o $partstart "$img"); then
rc=$?
error $LINENO "losetup failed with rc $rc"
exit -7
fi
if ! tune2fs_output=$(tune2fs -l "$loopback"); then
error $LINENO "tunefs failed"
exit -8
fi
loopback=$(losetup -f --show -o $partstart "$img")
tune2fs_output=$(tune2fs -l "$loopback")
currentsize=$(echo "$tune2fs_output" | grep '^Block count:' | tr -d ' ' | cut -d ':' -f 2)
blocksize=$(echo "$tune2fs_output" | grep '^Block size:' | tr -d ' ' | cut -d ':' -f 2)
@ -285,6 +267,7 @@ if ! truncate -s $endresult "$img"; then
rc=$?
error $LINENO "trunate failed with rc $rc"
exit -16
fi
aftersize=$(ls -lh "$img" | cut -d ' ' -f 5)
logVariables $LINENO aftersize