Added some more dbug logs
This commit is contained in:
parent
4f61a3244a
commit
9de4f53b96
20
pishrink.sh
20
pishrink.sh
|
@ -159,16 +159,16 @@ trap cleanup ERR EXIT
|
|||
|
||||
#Gather info
|
||||
info "Gathering data"
|
||||
beforesize=$(ls -lh "$img" | cut -d ' ' -f 5)
|
||||
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')
|
||||
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)
|
||||
beforesize="$(ls -lh "$img" | cut -d ' ' -f 5)"
|
||||
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')"
|
||||
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)"
|
||||
|
||||
logVariables $LINENO tune2fs_output currentsize blocksize
|
||||
logVariables $LINENO beforesize parted_output partnum partstart tune2fs_output currentsize blocksize
|
||||
|
||||
#Check if we should make pi expand rootfs on next boot
|
||||
if [ "$should_skip_autoexpand" = false ]; then
|
||||
|
@ -264,7 +264,7 @@ if ! minsize=$(resize2fs -P "$loopback"); then
|
|||
exit -10
|
||||
fi
|
||||
minsize=$(cut -d ':' -f 2 <<< "$minsize" | tr -d ' ')
|
||||
logVariables $LINENO minsize
|
||||
logVariables $LINENO currentsize minsize
|
||||
if [[ $currentsize -eq $minsize ]]; then
|
||||
error $LINENO "Image already shrunk to smallest size"
|
||||
exit -11
|
||||
|
|
Loading…
Reference in New Issue