#!/bin/bash
#=============================================================================#
# Run cpio in aptbox
#=============================================================================#
# Requires:
#	hasher by Dmitry V. Levin (ldv)
#	cpio
#=============================================================================#
# (C) Denis Smirnov <mithraen@freesource.info>					  12.06.2006  #
#=============================================================================#
set +e

WORKDIR=`realpath $1`; shift
chroot="$WORKDIR/chroot/"

cp -a `which cpio` $chroot/.host/
cp -a /usr/share/mithraen-spt-utils/cpio.sh $chroot/.host/

hsh-run "$WORKDIR"  --rooter -- /.host/cpio.sh "$@"
