User:Maffblaster/Drafts/Schroot

From Gentoo Wiki
Jump to:navigation Jump to:search
Resources

schroot is a utility to securely enter and execute commands in a chroot environment.

Installation

USE flags

USE flags for dev-util/schroot Utility to execute commands in a chroot environment

+dchroot Enables the building of a wrapper named "dchroot", replacing sys-apps/dchroot
btrfs Enable support for chroots using btrfs snapshots
debug Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
doc Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
lvm Enable support for chroots using LVM snapshots
nls Add Native Language Support (using gettext - GNU locale utilities)
pam Add support for PAM (Pluggable Authentication Modules) - DANGEROUS to arbitrarily flip
test Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently)
zfs Enable support for chroots using ZFS shapshots/clones

Emerge

root #emerge --ask dev-util/schroot

Configuration

Environment variables

Files

  • /etc/schroot/schroot.conf - Global (system wide) configuration file.
  • /etc/schroot/chroot.d - A directory for additional chroot definitions. See the schroot man page for more details.
  • /etc/schroot/setup.d - The global setup script directory.
  • /etc/pam.d/schroot - A global PAM configuration directory.


Usage

Invocation

user $schroot --help
Usage:
  schroot  [OPTION…] [COMMAND] — run command or shell in a chroot

Actions:
  -h [ --help ]                   Show help options
  -V [ --version ]                Print version information
  -l [ --list ]                   List available chroots
  -i [ --info ]                   Show information about selected chroots
  --config                        Dump configuration of selected chroots
  --location                      Print location of selected chroots

General options:
  -q [ --quiet ]                  Show less output
  -v [ --verbose ]                Show more output

Chroot selection:
  -c [ --chroot ] arg             Use specified chroot
  -a [ --all ]                    Select all chroots and active sessions
  --all-chroots                   Select all chroots
  --all-sessions                  Select all active sessions
  --all-source-chroots            Select all source chroots
  --exclude-aliases               Do not include aliases

Chroot environment:
  -d [ --directory ] arg          Directory to use
  -s [ --shell ] arg              Shell to use as login shell
  -u [ --user ] arg               Username (default current user)
  -p [ --preserve-environment ]   Preserve user environment
  -o [ --option ] arg             Set option

Session actions:
  --automatic-session             Begin, run and end a session automatically
                                  (default)
  -b [ --begin-session ]          Begin a session; returns a session ID
  --recover-session               Recover an existing session
  -r [ --run-session ]            Run an existing session
  -e [ --end-session ]            End an existing session

Session options:
  -n [ --session-name ] arg       Session name (defaults to an automatically
                                  generated name)
  -f [ --force ]                  Force operation, even if it fails

Removal

Unmerge

root #emerge --ask --depclean --verbose dev-util/schroot

See also

External resources