Unmount /system on exit

This commit is contained in:
Kamil Trzcinski 2016-10-05 13:02:09 +02:00
parent 8125d652e1
commit ae44572c41

View file

@ -44,6 +44,9 @@ if ! ${BB} mount -t ext4 -o ro,barrier=1 ${DISK}p2 /system; then
exit 2
fi
# Umount system
trap "${BB} umount /system" EXIT
# Nothing to do?
if /system/bin/resize2fs ${DISK_PART} 2>&1 | ${BB} grep "Nothing to do"; then
echo "Disk is already resized"
@ -59,4 +62,6 @@ if ! /system/bin/resize2fs ${DISK_PART}; then
exit 3
fi
/sbin/busybox sync
echo "Disk is resized"