#!/bin/sh -e

[ -n "$spt_dir" ] || spt_dir=/usr/share/spt3
. $spt_dir/init

Verbose "Packing chroot in squashfs"

chroot_install squashfsprogs

[ -n "$verbose" ] && EXTRAOPTS=-info || EXTRAOPTS=-no-progress
rm -f "$chroot/.image"
chroot_run \
	/sbin/mksquashfs \
	/ /.image $EXTRAOPTS -e /.image /.host /.in /.out /.fakedata /usr/lib*/*fakeroot* \
	|| Fatal "Unable to create squashfs image"

mkdir -p "$out_dir/$OUT/"
mv -f $chroot/.image "$out_dir/$OUT/$STAGENAME"
