#!/bin/bash
#=============================================================================#
#		Make squashfs image from fakeroot directory		      #
#=============================================================================#
# Requires:
#	hasher by Dmitry V. Levin (ldv)
#   mksquashfs utility from squashfsprogs package
#=============================================================================#
# (C) Denis Smirnov <mithraen@freesource.info>                    12.06.2006  #
#=============================================================================#
set +e

WORKDIR=`realpath $1`
touch "$2"
RESULT=`realpath $2`
chroot="$WORKDIR/chroot/"

cp -a /sbin/mksquashfs $chroot/.host/
cp -a /usr/share/mithraen-spt-utils/squashfs.sh $chroot/.host/

hsh-run "$WORKDIR"  --rooter -- /.host/squashfs.sh

cp -f "$WORKDIR/chroot/.altlinux.img" "$RESULT"
