SCHROOT-SETUP(5)
π SCHROOT-SETUP(5) β the schroot chroot setup scripts situation π
okay bestie, welcome to the schroot-setup manual page β¨ β it lives in the Debian sbuild neck of the woods and it's all about the lil scripts that set up (and then politely tear down) your chroot environment. no cap.
πΈ NAME πΈ
schroot-setup β schroot chroot setup scripts. that's it, that's the name π«Ά
β¨ DESCRIPTION β¨
so schroot uses scripts to set up the chroot environment and then clean up after itself. the directory /etc/schroot/setup.d is where these scripts live, and they get run whenever a chroot is created and destroyed. π
while the scripts are running, a whole bunch of environment variables get set, which lets you customise their behaviour depending on stuff like β for example β which type of chroot is in use. the way that it's customisable? obsessed. π
the scripts run in name order, exactly like the ones run by init(8), using the same style of execution as run-parts(8). periodt.
every setup script gets invoked with two options:
- The action to perform.
when a session is first started, the chroot gets set up by running the scripts in /etc/schroot/setup.d with the setup-start option. and when the session is ended, those same scripts in /etc/schroot/setup.d get run in reverse order with the setup-stop option. π¦
- The chroot status.
this is either ok if there are no problems, or fail if something went wrong. like, for example, particular actions may be skipped on failure. π
β οΈ bestie, listen: the scripts should be idempotent. they must be idempotent during the setup-stop phase, because they may be run more than once β for example on failure. not me warning you twice. π
π ENVIRONMENT π
π General variables
AUTH_USERβ the username of the user the command in the chroot will run as. πCHROOT_NAMEβ the chroot name. note that this is the name of the original chroot before session creation β you probably wantSESSION_IDinstead, bestie. fr fr.LIBEXEC_DIRβ the directory under which helper programs are located.MOUNT_DIRβ the directory under which non-filesystem chroots are mounted (e.g. block devices and LVM snapshots).PIDβ the process ID of the schroot process.PLATFORMβ the operating system platform schroot is running upon. this may be used to introduce platform-specific behaviour into the setup scripts where required. note that theHOSTvariables are probably what are actually required. in the context of schroot, the platform is the supported configuration and behaviour for a given architecture, and may be identical between different architectures. π€SESSION_IDβ the session identifier. this is the one you want, remember? πVERBOSEβ set toquietif only error messages should be printed,normalif other messages may be printed as well, andverboseif all messages may be printed. previously calledAUTH_VERBOSITY. (glow-up, honestly β¨)CHROOT_SESSION_CREATEβ set totrueif a session will be created, otherwisefalse.CHROOT_SESSION_CLONEβ set totrueif a session will be cloned, otherwisefalse.CHROOT_SESSION_PURGEβ set totrueif a session will be purged, otherwisefalse.CHROOT_SESSION_SOURCEβ set totrueif a session will be created from a source chroot, otherwisefalse.CHROOT_TYPEβ the type of the chroot. this is useful for restricting a setup task to particular types of chroot (e.g. only block devices or LVM snapshots). π§CHROOT_NAMEβ the name of the chroot. this is useful for restricting a setup task to a particular chroot, or set of chroots. (yes, it's here again β two different flavours of the same name, iconic behaviour honestly)CHROOT_ALIASβ the name of the alias used to select the chroot. this is useful for specialising a setup task based upon one of its alternative alias names, or the default chroot name. for example, it could be used to specify additional sources in/etc/apt/sources.list, such as astable-securityalias for astablechroot, or anexperimentalalias for anunstablechroot. π₯CHROOT_DESCRIPTIONβ the description of the chroot.CHROOT_MOUNT_LOCATIONβ the location to mount the chroot. it is used for mount point creation and mounting.CHROOT_LOCATIONβ the location of the chroot inside the mount point. this is to allow multiple chroots on a single filesystem. set for all mountable chroot types.CHROOT_PATHβ the absolute path to the chroot. this is typicallyCHROOT_MOUNT_LOCATIONandCHROOT_LOCATIONconcatenated together. this is the path which should be used to access the chroots. π
πΌ Plain and directory chroot variables
these chroot types use only general variables. simple, clean, minimal, we love her. π
π File variables
CHROOT_FILEβ the file containing the chroot files.CHROOT_FILE_REPACKβ set totrueto repack the chroot into an archive file on ending a session, otherwisefalse.
π Mountable chroot variables
these variables are only set for directly mountable chroot types.
CHROOT_MOUNT_DEVICEβ the device to mount containing the chroot.CHROOT_MOUNT_OPTIONSβ options to pass tomount(8).CHROOT_LOCATIONβ the location of the chroot inside the mount point. this allows the existence of multiple chroots on a single filesystem.
π¦ Filesystem union variables
CHROOT_UNION_TYPEβ union filesystem type.CHROOT_UNION_MOUNT_OPTIONSβ union filesystem mount options.CHROOT_UNION_OVERLAY_DIRECTORYβ union filesystem overlay directory (writable).CHROOT_UNION_UNDERLAY_DIRECTORYβ union filesystem underlay directory (read-only).
β Block device variables
CHROOT_DEVICEβ the device containing the chroot root filesystem. this is usually, but not necessarily, the device which will be mounted. for example, for a LVM snapshot this will be the original logical volume. π€―
π§ LVM snapshot variables
CHROOT_LVM_SNAPSHOT_NAMEβ snapshot name to pass tolvcreate(8).CHROOT_LVM_SNAPSHOT_DEVICEβ the name of the LVM snapshot device.CHROOT_LVM_SNAPSHOT_OPTIONSβ options to pass tolvcreate(8).
π Custom variables
custom keys set in schroot.conf will be uppercased and set in the environment as described in schroot.conf(5). main character energy for your own variables, honestly. π
π FILES π
π Setup script configuration
the directory /etc/schroot/default contains the default settings used by setup scripts.
configβ main configuration file read by setup scripts. the format of this file is described inschroot-script-config(5). this is the default value for thescript-configkey. note that this was formerly named/etc/schroot/script-defaults. the following files are referenced by default: πcopyfilesβ a list of files to copy into the chroot from the host system. note that this was formerly named/etc/schroot/copyfiles-defaults.fstabβ a file in the format described infstab(5), used to mount filesystems inside the chroot. the mount location is relative to the root of the chroot. note that this was formerly named/etc/schroot/mount-defaults.nssdatabasesβ system databases (as described in/etc/nsswitch.confon GNU/Linux systems) to copy into the chroot from the host. note that this was formerly named/etc/schroot/nssdatabases-defaults.
π οΈ Setup scripts
the directory /etc/schroot/setup.d contains the chroot setup scripts. say hi to the whole squad π
00checkβ print debugging diagnostics and perform basic sanity checking. the vibe check script. β05fileβ unpack, clean up, and repack file-based chroots.05fsunionβ create and remove union filesystems.05lvmβ create and remove LVM snapshots.10mountβ mount and unmount filesystems.15binfmtβ sets up the QEMU user emulator usingbinfmt-support. this permits a chroot for a different CPU architecture to be used transparently, providing an alternative to cross-compiling or whole-machine emulation. absolutely ate. π₯15killprocsβ kill processes still running inside the chroot when ending a session, which would prevent unmounting of filesystems and cleanup of any other resources. (sorry to those processes but it's necessary π)20copyfilesβ copy files from the host system into the chroot. configure networking by copyinghostsandresolv.conf, for example.20nssdatabasesβ configure system databases by copyingpasswd,shadow,groupetc. into the chroot.50chrootnameβ set the chroot name (/etc/debian_chroot) in the chroot. this may be used by the shell prompt to display the current chroot. π
π AUTHORS π
Roger Leigh. that's the one. π«Ά
π COPYRIGHT π
Copyright Β© 2005-2012 Roger Leigh <rleigh@codelibre.net>
schroot is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ποΈ
π SEE ALSO π
schroot(1), fstab(5), schroot.conf(5), schroot-script-config(5), run-parts(8).
and that's the whole page, bestie!! this is Version 1.6.13 from 14 Aug 2022 β go forth and set up chroots, you absolute icon π β¨πΈπ¦π
π¦ where this page comes from
- debian bookworm: schroot 1.6.13-3+b2 Β· GPL-3.0-or-later
- debian trixie: schroot 1.6.13-7 Β· GPL-3.0-or-later
- ubuntu noble: schroot 1.6.13-3build2 Β· GPL-3.0-or-later
- ubuntu questing: schroot 1.6.13-7build1
- ubuntu resolute: schroot 1.6.13-8 Β· GPL-3.0-or-later
- ubuntu stonking: schroot 1.6.13-8 Β· GPL-3.0-or-later
- Copyright Β© 2005-2010 Roger Leigh <rleigh@codelibre.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms