<commit_before>.Dd April 20, 2014
.Dt XBPS-UCHROOT 8
.Sh NAME
.Nm xbps-uchroot
.Nd XBPS utility to chroot and bind mount with linux namespaces
.Sh SYNOPSYS
.Nm xbps-uchroot
.Op OPTIONS
.Ar CHROOTDIR
.Ar COMMAND
.Op ARGS
.Sh DESCRIPTION
The
.Nm
utility allows users to chroot and bind mount required pseudo-filesystems
(/dev, /proc and /sys) in the target
.Ar CHROOTDIR
to execute
.Ar COMMAND .
The
.Nm
utility uses by default Linux namespaces to isolate IPC, PIDs and mounts to
the calling process. If running in a OpenVZ container, these namespace features
are simply disabled.
.Sh OPTIONS
.Bl -tag -width -x
.It Fl D Ar dir
Specifies a full path to a directory that will be bind mounted at
.Ar CHROOTDIR/void-packages .
.It Fl H Ar dir
Specifies a full path to a directory that will be bind mounted at
.Ar CHROOTDIR/host .
.It Fl S Ar dir
Specifies a full path to a directory to allow shm functionality to be used
in the target
.Ar CHROOTDIR/dir .
If your system uses
.Sy /dev/shm
use it, otherwise use
.Sy /run/shm .
.It Fl O
Setups a temporary directory mounted on tmpfs and then creates an overlay layer
(via overlayfs) with the lowerdir set to CHROOTDIR. Useful to create a temporary
tree that does not preserve changes in CHROOTDIR.
.It Fl o Ar opts
Arguments passed to the tmpfs mount, if the
.Fl O
option is specified.
This expects the same arguments that are accepted as options in tmpfs, as explained in
.Xr mount 8 .
.El
.Sh SECURITY
The
.Nm
executable must be setgid to function properly and shall only be executable by a specific
group to avoid security issues (4750).
.Sh NOTES
The
.Nm
utility uses Linux specific features (namespaces) and it's not meant to be portable to
other Operating Systems. The following kernel options must be enabled:
.Pp
.Bl -tag -width CONFIG_NAMESPACES -compact -offset indent
.It Sy CONFIG_NAMESPACES
.It Sy CONFIG_IPC_NS
.It Sy CONFIG_PID_NS
.It Sy CONFIG_UTS_NS
.It Sy CONFIG_OVERLAY_FS
.El
.Sh SEE ALSO
.Xr xbps.d 5 ,
.Xr xbps-checkvers 8 ,<commit_msg>xbps-uchroot.8: document -t and detail -o.<commit_after>.Dd April 27, 2014
.Dt XBPS-UCHROOT 8
.Sh NAME
.Nm xbps-uchroot
.Nd XBPS utility to chroot and bind mount with linux namespaces
.Sh SYNOPSYS
.Nm xbps-uchroot
.Op OPTIONS
.Ar CHROOTDIR
.Ar COMMAND
.Op ARGS
.Sh DESCRIPTION
The
.Nm
utility allows users to chroot and bind mount required pseudo-filesystems
(/dev, /proc and /sys) in the target
.Ar CHROOTDIR
to execute
.Ar COMMAND .
The
.Nm
utility uses by default Linux namespaces to isolate IPC, PIDs and mounts to
the calling process. If running in a OpenVZ container, these namespace features
are simply disabled.
.Sh OPTIONS
.Bl -tag -width -x
.It Fl D Ar dir
Specifies a full path to a directory that will be bind mounted at
.Ar CHROOTDIR/void-packages .
.It Fl H Ar dir
Specifies a full path to a directory that will be bind mounted at
.Ar CHROOTDIR/host .
.It Fl S Ar dir
Specifies a full path to a directory to allow shm functionality to be used
in the target
.Ar CHROOTDIR/dir .
If your system uses
.Sy /dev/shm
use it, otherwise use
.Sy /run/shm .
.It Fl O
Setups a temporary directory and then creates an overlay layer (via overlayfs)
with the lowerdir set to CHROOTDIR. Useful to create a temporary tree that does not
preserve changes in CHROOTDIR.
.It Fl o Ar opts
Arguments passed to the tmpfs mount, if the
.Fl O
and
.Fl t
options are specified.
This expects the same arguments that are accepted as options in tmpfs, as explained in
.Xr mount 8 .
.It Fl t
This makes the temporary directory to be mounted in tmpfs, so that everything is stored
in RAM. Note that this is only useful if used with the
.Fl O
option (overlayfs).
.El
.Sh SECURITY
The
.Nm
executable must be setgid to function properly and shall only be executable by a specific
group to avoid security issues (4750).
.Sh NOTES
The
.Nm
utility uses Linux specific features (namespaces) and it's not meant to be portable to
other Operating Systems. The following kernel options must be enabled:
.Pp
.Bl -tag -width CONFIG_NAMESPACES -compact -offset indent
.It Sy CONFIG_NAMESPACES
.It Sy CONFIG_IPC_NS
.It Sy CONFIG_PID_NS
.It Sy CONFIG_UTS_NS
.It Sy CONFIG_OVERLAY_FS
.El
.Sh SEE ALSO
.Xr xbps.d 5 ,
.Xr xbps-checkvers 8 ,
{'fraction_non_alphanumeric': 0.053307948595906714, 'fraction_numerical': 0.006901475487862923, 'mean_word_length': 3.6908482142857144, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6118738', 'n_tokens_mistral': 1403, 'n_tokens_neox': 1325, 'n_words': 705}