1SCHROOT-SETUP(5) Debian sbuild SCHROOT-SETUP(5)
2
3
4
6 schroot-setup - schroot chroot setup scripts
7
9 schroot uses scripts to set up and then clean up the chroot environ‐
10 ment. The directory /etc/schroot/setup.d contains scripts run when a
11 chroot is created and destroyed. Several environment variables are set
12 while the scripts are being run, which allows their behaviour to be
13 customised, depending upon, for example, the type of chroot in use.
14
15 The scripts are run in name order, like those run by init(8), by using
16 the same style of execution as run-parts(8).
17
18 The setup scripts are all invoked with two options:
19
20 1 The action to perform.
21
22 When a session is first started, the chroot is set up by running
23 the scripts in /etc/schroot/setup.d with the ‘setup-start’
24 option. When the session is ended, the scripts in /etc/sch‐
25 root/setup.d are run in reverse order with the ‘setup-stop’
26 option.
27
28 2 The chroot status.
29
30 This is either ‘ok’ if there are no problems, or ‘fail’ if some‐
31 thing went wrong. For example, particular actions may be
32 skipped on failure.
33
34 Note that the scripts should be idempotent. They must be idempotent
35 during the ‘setup-stop’ phase, because they may be run more than once,
36 for example on failure.
37
39 General variables
40 AUTH_USER
41 The username of the user the command in the chroot will run as.
42
43 HOST
44
45 HOST_OS
46
47 HOST_VENDOR
48
49 HOST_CPU
50 The host system architecture schroot is running upon. This may
51 be used to introduce architecture-specific behaviour into the
52 setup scripts where required. HOST is the GNU triplet for the
53 architecture, while HOST_OS, HOST_VENDOR and HOST_CPU are the
54 component parts of the triplet.
55
56 LIBEXEC_DIR
57 The directory under which helper programs are located.
58
59 MOUNT_DIR
60 The directory under which non-filesystem chroots are mounted
61 (e.g. block devices and LVM snapshots).
62
63 PID The process ID of the schroot process.
64
65 PLATFORM
66 The operating system platform schroot is running upon. This may
67 be used to introduce platform-specific behaviour into the setup
68 scripts where required. Note that the HOST variables are proba‐
69 bly what are required. In the context of schroot, the platform
70 is the supported configuration and behaviour for a given archi‐
71 tecture, and may be identical between different architectures.
72
73 SESSION_ID
74 The session identifier.
75
76 VERBOSE
77 Set to ‘quiet’ if only error messages should be printed, ‘nor‐
78 mal’ if other messages may be printed as well, and ‘verbose’ if
79 all messages may be printed. Previously called AUTH_VERBOSITY.
80
81 CHROOT_SESSION_CREATE
82 Set to ‘true’ if a session will be created, otherwise ‘false’.
83
84 CHROOT_SESSION_CLONE
85 Set to ‘true’ if a session will be cloned, otherwise ‘false’.
86
87 CHROOT_SESSION_PURGE
88 Set to ‘true’ if a session will be purged, otherwise ‘false’.
89
90 CHROOT_TYPE
91 The type of the chroot. This is useful for restricting a setup
92 task to particular types of chroot (e.g. only block devices or
93 LVM snapshots).
94
95 CHROOT_NAME
96 The name of the chroot. This is useful for restricting a setup
97 task to a particular chroot, or set of chroots.
98
99 CHROOT_DESCRIPTION
100 The description of the chroot.
101
102 CHROOT_MOUNT_LOCATION
103 The location to mount the chroot. It is used for mount point
104 creation and mounting.
105
106 CHROOT_LOCATION
107 The location of the chroot inside the mount point. This is to
108 allow multiple chroots on a single filesystem. Set for all
109 mountable chroot types.
110
111 CHROOT_PATH
112 The absolute path to the chroot. This is typically
113 CHROOT_MOUNT_LOCATION and CHROOT_LOCATION concatenated together.
114 This is the path which should be used to access the chroots.
115
116 Plain and directory chroot variables
117 These chroot types use only general variables.
118
119 File variables
120 CHROOT_FILE
121 The file containing the chroot files.
122
123 CHROOT_FILE_REPACK
124 Set to ‘true’ to repack the chroot into an archive file on end‐
125 ing a session, otherwise ‘false’.
126
127 Mountable chroot variables
128 These variables are only set for directly mountable chroot types.
129
130 CHROOT_MOUNT_DEVICE
131 The device to mount containing the chroot. mounting.
132
133 CHROOT_MOUNT_OPTIONS
134 Options to pass to mount(8).
135
136 CHROOT_LOCATION
137 The location of the chroot inside the mount point. This allows
138 the existence of multiple chroots on a single filesystem.
139
140 Filesystem union variables
141 CHROOT_UNION_TYPE
142 Union filesystem type.
143
144 CHROOT_UNION_MOUNT_OPTIONS
145 Union filesystem mount options.
146
147 CHROOT_UNION_OVERLAY_DIRECTORY
148 Union filesystem overlay directory (writable).
149
150 CHROOT_UNION_UNDERLAY_DIRECTORY
151 Union filesystem underlay directory (read-only).
152
153 Block device variables
154 CHROOT_DEVICE
155 The device containing the chroot root filesystem. This is usu‐
156 ally, but not necessarily, the device which will be mounted.
157 For example, an LVM snapshot this will be the original logical
158 volume.
159
160 LVM snapshot variables
161 CHROOT_LVM_SNAPSHOT_NAME
162 Snapshot name to pass to lvcreate(8).
163
164 CHROOT_LVM_SNAPSHOT_DEVICE
165 The name of the LVM snapshot device.
166
167 CHROOT_LVM_SNAPSHOT_OPTIONS
168 Options to pass to lvcreate(8).
169
171 Setup script configuration
172 The directory /etc/schroot/default contains the default settings used
173 by setup scripts.
174
175 config Main configuration file read by setup scripts. The format of
176 this file is described in schroot-script-config(5). This is the
177 default value for the script-config key. Note that this was
178 formerly named /etc/schroot/script-defaults. The following
179 files are referenced by default:
180
181 copyfiles
182 A list of files to copy into the chroot from the host system.
183 Note that this was formerly named /etc/schroot/copy‐
184 files-defaults.
185
186 fstab A file in the format decribed in fstab(5), used to mount
187 filesystems inside the chroot. The mount location is relative
188 to the root of the chroot. Note that this was formerly named
189 /etc/schroot/mount-defaults.
190
191 nssdatabases
192 System databases (as described in /etc/nsswitch.conf on
193 GNU/Linux systems) to copy into the chroot from the host. Note
194 that this was formerly named /etc/schroot/nssdatabases-defaults.
195
196 Setup scripts
197 The directory /etc/schroot/setup.d contains the chroot setup scripts.
198
199 00check
200 Print debugging diagnostics and perform basic sanity checking.
201
202 05file Unpack, clean up, and repack file-based chroots.
203
204 05fsunion
205 Create and remove union filesystems.
206
207 05lvm Create and remove LVM snapshots.
208
209 10mount
210 Mount and unmount filesystems.
211
212 15killprocs
213 Kill processes still running inside the chroot when ending a
214 session, which would prevent unmounting of filesystems and
215 cleanup of any other resources.
216
217 20copyfiles
218 Copy files from the host system into the chroot. Configure net‐
219 working by copying hosts and resolv.conf, for example.
220
221 20nssdatabases
222 Configure system databases by copying passwd, shadow, group etc.
223 into the chroot.
224
225 50chrootname
226 Set the chroot name (/etc/debian_chroot) in the chroot. This
227 may be used by the shell prompt to display the current chroot.
228
230 Roger Leigh.
231
233 Copyright © 2005-2010 Roger Leigh <rleigh@debian.org>
234
235 schroot is free software: you can redistribute it and/or modify it
236 under the terms of the GNU General Public License as published by the
237 Free Software Foundation, either version 3 of the License, or (at your
238 option) any later version.
239
241 schroot(1), fstab(5), schroot.conf(5), schroot-script-config(5),
242 run-parts(8).
243
244
245
246Version 1.4.10 22 Aug 2010 SCHROOT-SETUP(5)