xbps-src: introduce support for multiple chroot implementations.
Available implementations at common/chroot-style/*.sh. Each .sh script there implements a chroot style to be able to chroot and bind mount with multiple utilities. The current supported list: - uunshare (uses xbps-uunshare(8)) - uchroot (uses xbps-uchroot(8)) - proot (uses proot, see http://proot.me) The XBPS_CHROOT_CMD can be set in etc/conf to use a specific implementation, and XBPS_CHROOT_CMD_ARGS to pass in additional arguments to the cmd.
This commit is contained in:
parent
d99b4f720d
commit
c7f21fd595
5 changed files with 93 additions and 39 deletions
22
common/chroot-style/uchroot.sh
Executable file
22
common/chroot-style/uchroot.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# This chroot script uses xbps-uchroot(8).
|
||||
#
|
||||
readonly MASTERDIR="$1"
|
||||
readonly DISTDIR="$2"
|
||||
readonly HOSTDIR="$3"
|
||||
readonly EXTRA_ARGS="$4"
|
||||
readonly COMMAND="$5"
|
||||
shift 5
|
||||
readonly COMMAND_ARGS="$@"
|
||||
|
||||
if ! command -v xbps-uchroot >/dev/null 2>&1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$MASTERDIR" -o -z "$DISTDIR" -o -z "$COMMAND" ]; then
|
||||
echo "$0 MASTERDIR/DISTDIR/COMMAND not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec xbps-uchroot $EXTRA_ARGS -D $DISTDIR ${HOSTDIR:+-H $HOSTDIR} $XBPS_MASTERDIR $COMMAND $COMMAND_ARGS
|
Loading…
Add table
Add a link
Reference in a new issue