# just to fail
function fail() {
    echo -en "\a"; sleep 1; echo -en "\a"
	echo
	echo "======================================="
    echo "= something went wrong - aborting now ="
	echo "======================================="
	echo

    # cleaning up
    cd "$BASE"
    echo -en "Unmounting $MOUNTPOINT ...\t"
    umount "$MOUNTPOINT"                     2>/dev/null 1>/dev/null
	echo "Done"

    echo -en "Unmounting loop device ...\t"
    umount /dev/loop4                        2>/dev/null 1>/dev/null
	echo "Done"

    echo -en "Detaching loop device ...\t"
    losetup -d /dev/loop4                    2>/dev/null 1>/dev/null
	echo "Done"

    
    if test -d "$ROOTFS".compressed; then
		rm -r "$ROOTFS".compressed           2>/dev/null 1>/dev/null
    fi

    if test -d "$ROOTFS".uncompressed; then
		rm -rf "$ROOTFS"                     2>/dev/null 1>/dev/null
        mv "$ROOTFS".uncompressed "$ROOTFS"  2>/dev/null 1>/dev/null
    fi

    if test -f "$ROOTFS"/boot/boot.img; then
        rm "$ROOTFS"/boot/boot.img           2>/dev/null 1>/dev/null
    fi

    rm -f "$ROOTFS"/isolinux/*               2>/dev/null 1>/dev/null

    echo -en "Cleaning $TMPDIR ...\t\t"
    rm -rf "$TMPDIR"/*                       2>/dev/null 1>/dev/null
	echo "Done"

	echo 

    exit 1
}
