qubes-linux-template-builder/cleanup_image

31 lines
398 B
Plaintext
Raw Normal View History

2010-09-17 16:08:12 +00:00
#!/bin/sh
export IMG=$1
2010-09-17 16:08:12 +00:00
. ./builder_setup
2012-01-03 21:33:20 +00:00
set -e
2010-09-17 16:08:12 +00:00
if ! [ $# -eq 1 ]; then
echo "usage $0 <img_file_name>"
exit 1
fi
if ! [ -f $IMG ]; then
echo $IMG does not exist
exit 1
fi
ls -als $IMG
mount -o loop $IMG mnt || exit 1
export INSTALLDIR=`pwd`/mnt/
2012-01-03 21:33:20 +00:00
echo "--> Cleaning up image file..."
$SCRIPTSDIR/09_cleanup.sh
2012-01-03 21:33:20 +00:00
2012-06-06 00:54:10 +00:00
echo "--> Compacting image file..."
fstrim mnt/
2010-09-17 16:08:12 +00:00
umount mnt
ls -als $IMG