1 .TH AUR-CHROOT 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 .BI \-D " DIR" "\fR,\fP \-\-directory=" DIR
64 The base directory for containers. This directory usually contains a
66 subdirectory that serves as template for user containers (named after
75 parameter is specified to
77 the user container has a random name and is removed on build
81 .BI \-C " FILE" "\fR,\fP \-\-pacman\-conf=" FILE
84 file used inside the container. Defaults to
85 .IR /usr/share/devtools/pacman\-extra.conf .
87 This file is read with
91 repositories for bind mounting. (See
92 .BR "Accessing a local repository")
95 .BI \-M " FILE" "\fR,\fP \-\-makepkg\-conf=" FILE
98 file used inside the container. Defaults to devtools'
99 .IR makepkg\-<machine>.conf .
103 Arguments (comma-separated) to be passed to
108 .BR "makechrootpkg \-c" .
112 Additional (comma-separated)
116 A default list of arguments can be listed with
117 .BR "makechrootpkg \-\-help" .
121 Bind a directory read-only to the container.
122 .RB ( makechrootpkg " " \-D )
126 Bind a directory read-write to the container.
127 .RB ( makechrootpkg " " \-d )
131 Print the path to the container template
132 .RI ( $directory/root ).
135 .BR \-x ", " \-\-suffix
138 in the pacman configuration
139 .BR /usr/share/devtools/pacman\-<suffix>.conf .
142 A full path may be specified with
143 .BR \-\-pacman\-conf .
146 Packages are placed in the directory set in
148 If unset, the current directory
153 .BR "makechrootpkg \-h" .
156 .SS Building with makechrootpkg
157 Changes to the pacman database are
159 propagated from the container to the local system. Packages must be
160 installed and updated separately, typically through
161 .BI "pacman \-Syu " package_name\fR.
163 Package conflicts inside the container must be resolved manually, as
166 .B "makepkg \-\-noconfirm \-s"
167 internally. For example, to replace
172 .B "arch\-nspawn /var/lib/aurbuild/root pacman \-S gcc\-multilib"
175 .SS Accessing a local repository
176 To install packages from the local repository (for example, on
177 dependency resolution with
179 the container requires read access to the host directory where it is
180 located. This is ensured through a (read-write)
182 In particular, paths to
184 repositories are passed to
195 .SS Avoiding password prompts
197 must be run as a regular user as of version 4.2, with privileged
204 can not run directly as root. To avoid password prompts,
206 can be used instead. For example, if
210 user, create the following sudoers policy:
213 archie ALL = (root) NOPASSWD: SETENV: /usr/bin/makechrootpkg
214 archie ALL = (root) NOPASSWD: /usr/bin/mkarchroot, /usr/bin/arch-nspawn
217 Should the rule only apply to specific hosts, replace
222 .SS Using ccache and distcc
224 .BR "Building with makechrootpkg" ,
225 install the required packages:
228 # aur chroot --update ccache distcc
231 Ensure write access to
233 directories on the host:
236 # aur chroot --build --bind /home/_ccache:/build/.ccache
241 options may be set in a specified (\-M)
243 file. See GitHub issue #334 for details.
245 .SS Building for a different architecture
246 To build packages for a different architecture, prepend
252 The target architecture must be supported both by the host (run
253 .B "setarch \-\-list"
254 for an approximation), and have a matching
257 .B /usr/share/devtools
259 .I /usr/share/devtools/makepkg\-i686.conf
263 Building for other CPU architectures may be done through
265 .UR https://www.qemu.org/docs/master/user/index.html
269 .SS Devtools limitations
271 is not checked for existing packages when building with
273 This happens because packages are built to the
275 path inside the container, and moved afterward to
277 on the host. Checking for existing packages must thus be done
279 .BR "makepkg \-\-packagelist" .
281 GPG signing packages with
283 is not possible inside the container as the necessary environment
284 variables are not set (see
285 .UR https://lists.archlinux.org/pipermail/arch-projects/2016-May/004341.html
288 Signing packages should thus be done in the host environment e.g. with
289 .BR "aur\-build \-\-sign" .
296 .BR "makechrootpkg \-h" )
297 can be extended but not overriden. In particular, package conflicts
298 can not solved interactively.
299 .RB ( "makepkg \-\-noconfirm" )
302 will unconditionally modify the supplied
304 to copy mirrors (and other settings) from the host (see
308 for details.) Furthermore, repositories must be configured explicitly
309 in this configuration file, and not part of a separate file configured
320 .BR makepkg.conf (5),
325 .MT https://github.com/AladW
329 .\" vim: set textwidth=72: