1 .TH AUR-CHROOT 1 2022-03-04 AURUTILS
3 aur\-chroot \- build pacman packages with systemd-nspawn
21 .BR systemd\-nspawn (1)
26 .BR \-B ", " \-\-build
27 Build a package inside the container with
31 was run at least once.
34 .BR \-U ", " \-\-update
37 copy of the container with
42 Create a new container with
46 package group is installed to the container.
48 If the host architecture is
52 is set in the pacman configuration (see
53 .BR \-\-pacman\-conf ),
56 package group is also installed.
58 If packages or package groups are listed on the command-line, these
59 are installed instead of the above.
63 Print the path to the container template
64 .RI ( $directory/root ).
68 .BI \-D " DIR" "\fR,\fP \-\-directory=" DIR
69 The base directory for containers. Defaults to
70 .BI /var/lib/aurbuild/ <machine> \fR.
71 This directory usually contains a
73 subdirectory that serves as template for user containers (named after
82 parameter is specified to
84 the user container has a random name and is removed on build
88 .BI \-C " FILE" "\fR,\fP \-\-pacman\-conf=" FILE
91 file used inside the container. When unspecified, the following files
94 .BI /etc/aurutils/pacman-<suffix>.conf
96 .BI /etc/aurutils/pacman-<machine>.conf
98 .BI /usr/share/devtools/pacman.conf.d/<suffix>.conf
100 .BI /usr/share/devtools/pacman.conf.d/aurutils\-<machine>.conf
104 is optional and specified with the
106 option. The component
110 The resulting file is read with
114 repositories for bind mounting. (See
115 .BR "Accessing a local repository")
118 Care should be taken when copying the configuration from
119 .BR /etc/pacman.conf ,
120 because certain directives (e.g.
122 may cause issues in the container.
124 It is recommended to use
126 .B /usr/share/devtools/pacman.conf.d/extra.conf
128 .B /usr/share/devtools/pacman.conf.d/multilib.conf
129 instead and make the necessary adjustments. Due to devtools limitations, any
130 desired repositories should be configured explicitly in this copy.
133 .BI \-M " FILE" "\fR,\fP \-\-makepkg\-conf=" FILE
136 file used inside the container. When unspecified, the following files
137 are checked in order:
139 .BI /etc/aurutils/makepkg-<suffix>.conf
141 .BI /etc/aurutils/makepkg-<machine>.conf
143 .BI /usr/share/devtools/makepkg.conf.d/<suffix>.conf
145 .BI /usr/share/devtools/makepkg.conf.d/<machine>.conf
147 .SS makechrootpkg options
149 .BI \-\-cargs= ARGS "\fR,\fP \-\-makechrootpkg\-args=" ARGS
150 Arguments (comma-separated) to be passed to
155 .BR "makechrootpkg \-cu" .
158 .BI \-\-margs= ARGS "\fR,\fP \-\-makepkg\-args=" ARGS
159 Additional (comma-separated)
165 arguments can be listed with
166 .BR "makechrootpkg \-\-help" .
170 Bind a directory read-only to the container.
171 .RB ( makechrootpkg " " \-D )
175 Bind a directory read-write to the container.
176 .RB ( makechrootpkg " " \-d )
182 on the built package.
185 .BR \-N ", " \-\-namcap
188 on the built package.
191 .BR \-T ", " \-\-temp
192 Build in a temporary container. (\fBmakechrootpkg \-T\fR) Temporary
193 means that the user container has a random name and is removed on
200 instance as the specified user. (\fBmakechrootpkg \-U\fR)
205 The agent used to elevate commands. If unset,
207 is used. When running
209 the following variables should be preserved:
214 By default, these variables are preserved with
215 .BR "sudo \-\-preserve-env" ,
221 .BR /usr/bin/makechrootpkg .
229 The contents of this variable are ignored and replaced with
230 .IR /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin .
233 The directory where packages are placed. If unset, the current directory
238 .BR "makechrootpkg \-h" .
241 .SS Building with makechrootpkg
242 Changes to the pacman database are
244 propagated from the container to the local system. Packages must be
245 installed and updated separately, typically through
246 .BI "pacman \-Syu " package_name\fR.
248 Package conflicts inside the container must be resolved manually, as
251 .B "makepkg \-\-noconfirm \-s"
252 internally. For example, to replace
257 .B "arch\-nspawn /var/lib/aurbuild/<machine>/root pacman \-S gcc\-multilib"
260 .SS Accessing a local repository
261 To install packages from the local repository (for example, on
262 dependency resolution with
264 the container requires read access to the host directory where it is
265 located. This is ensured through a (read-write)
267 In particular, paths to
269 repositories are passed to
280 .SS Avoiding password prompts
282 must be run as a regular user as of version 4.2, with privileged
289 can not run directly as root. To avoid password prompts,
291 can be used instead. For example, if
295 user, create the following sudoers policy:
298 archie ALL = (root) NOPASSWD: SETENV: /usr/bin/makechrootpkg
299 archie ALL = (root) NOPASSWD: /usr/bin/mkarchroot, /usr/bin/arch-nspawn
302 Should the rule only apply to specific hosts, replace
313 .I /usr/bin/makechrootpkg
315 .IR "NOPASSWD: ALL" .
317 .SS Using ccache and distcc
319 .BR "Building with makechrootpkg" ,
320 install the required packages:
323 # aur chroot --update ccache distcc
326 Ensure write access to
328 directories on the host:
331 # aur chroot --build --bind /home/_ccache:/build/.ccache
336 options may be set in a specified (\-M)
338 file. See GitHub issue #334 for details.
340 .SS Building for a different architecture
341 To build packages for a different architecture, prepend
347 The target architecture must be supported both by the host (run
348 .B "setarch \-\-list"
349 for an approximation), and have a matching
352 .B /usr/share/devtools
354 .I /usr/share/devtools/makepkg\-i686.conf
358 Building for other CPU architectures may be done through
360 .UR https://www.qemu.org/docs/master/user/index.html
366 is not checked for existing packages when building with
368 This happens because packages are built to the
370 path inside the container, and moved afterward to
372 on the host. Checking for existing packages must thus be done
374 .BR "makepkg \-\-packagelist" .
376 GPG signing packages with
378 is not possible inside the container as the necessary environment
379 variables are not set (see
380 .UR https://lists.archlinux.org/pipermail/arch-projects/2016-May/004341.html
383 Signing packages should thus be done in the host environment e.g. with
384 .BR "aur\-build \-\-sign" .
391 .BR "makechrootpkg \-h" )
392 can be extended but not overridden. In particular, package conflicts
393 can not solved interactively.
394 .RB ( "makepkg \-\-noconfirm" )
397 will unconditionally modify the supplied
399 to copy mirrors (and other settings) from the host (see
403 for details.) Furthermore, repositories must be configured explicitly
404 in this configuration file, and not part of a separate file configured
415 .BR makepkg.conf (5),
420 .MT https://github.com/AladW
424 .\" vim: set textwidth=72: