2015-04-09 16:57:41 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# This chroot script uses xbps-uchroot(8).
|
|
|
|
#
|
|
|
|
readonly MASTERDIR="$1"
|
|
|
|
readonly DISTDIR="$2"
|
|
|
|
readonly HOSTDIR="$3"
|
|
|
|
readonly EXTRA_ARGS="$4"
|
2015-04-09 17:30:28 +00:00
|
|
|
shift 4
|
2015-04-09 16:57:41 +00:00
|
|
|
|
|
|
|
if ! command -v xbps-uchroot >/dev/null 2>&1; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2015-04-09 17:30:28 +00:00
|
|
|
if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then
|
|
|
|
echo "$0 MASTERDIR/DISTDIR not set"
|
2015-04-09 16:57:41 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2015-04-09 17:30:28 +00:00
|
|
|
exec xbps-uchroot $EXTRA_ARGS -D $DISTDIR ${HOSTDIR:+-H $HOSTDIR} $MASTERDIR $@
|