qubes-linux-template-builder/cleanup_image
Marek Marczykowski-Górecki c7bbdbf51c Use full path for tools normally in /sbin
Do not rely on Fedora-specific setting - having /sbin in PATH also for
normal user. This allows to build templates on Debian.
2018-03-10 02:03:59 +01:00

25 lines
334 B
Bash
Executable File

#!/bin/sh
export INSTALLDIR=$1
. ./builder_setup
set -e
if ! [ $# -eq 1 ]; then
echo "usage $0 <mount_point>"
exit 1
fi
if ! [ -d $INSTALLDIR ]; then
echo $INSTALLDIR does not exist
exit 1
fi
echo "--> Cleaning up image file..."
$SCRIPTSDIR/09_cleanup.sh
echo "--> Compacting image file..."
/sbin/fstrim -v "$INSTALLDIR"