3 # This chroot script uses xbps-uchroot(1).
5 readonly MASTERDIR
="$1"
8 readonly EXTRA_ARGS
="$4"
13 # error messages in bold/red
14 [ -n "$NOCOLORS" ] ||
printf >&2 "\033[1m\033[31m"
15 printf "=> ERROR: %s\\n" "$@" >&2
16 [ -n "$NOCOLORS" ] ||
printf >&2 "\033[m"
19 readonly XBPS_UCHROOT_CMD
="$(command -v xbps-uchroot 2>/dev/null)"
21 if [ -z "$XBPS_UCHROOT_CMD" ]; then
22 msg_red
"could not find xbps-uchroot"
26 if ! [ -x "$XBPS_UCHROOT_CMD" ]; then
27 msg_red
"xbps-uchroot is not executable. Are you in the $(stat -c %G "$XBPS_UCHROOT_CMD") group?"
31 if [ -z "$MASTERDIR" ] ||
[ -z "$DISTDIR" ]; then
32 msg_red
"$0: MASTERDIR/DISTDIR not set"
36 exec xbps-uchroot
$EXTRA_ARGS -b $DISTDIR:/void-packages
${HOSTDIR:+-b $HOSTDIR:/host} -- $MASTERDIR $CMD $@