xref: /freebsd/share/man/man7/release.7 (revision 745f30641cc4f6c4ef9726edc2e8777cf867424e)
1afb33690SMurray Stokely.\" Copyright (c) 2002 Murray Stokely <murray@FreeBSD.org>
2afb33690SMurray Stokely.\" All rights reserved.
3de26e0adSMurray Stokely.\"
4de26e0adSMurray Stokely.\" Redistribution and use in source and binary forms, with or without
5de26e0adSMurray Stokely.\" modification, are permitted provided that the following conditions
6de26e0adSMurray Stokely.\" are met:
7de26e0adSMurray Stokely.\" 1. Redistributions of source code must retain the above copyright
8de26e0adSMurray Stokely.\"    notice, this list of conditions and the following disclaimer.
9de26e0adSMurray Stokely.\" 2. Redistributions in binary form must reproduce the above copyright
10de26e0adSMurray Stokely.\"    notice, this list of conditions and the following disclaimer in the
11de26e0adSMurray Stokely.\"    documentation and/or other materials provided with the distribution.
12de26e0adSMurray Stokely.\"
13de26e0adSMurray Stokely.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
14de26e0adSMurray Stokely.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15de26e0adSMurray Stokely.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16de26e0adSMurray Stokely.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
17de26e0adSMurray Stokely.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18de26e0adSMurray Stokely.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19de26e0adSMurray Stokely.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20de26e0adSMurray Stokely.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21de26e0adSMurray Stokely.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22de26e0adSMurray Stokely.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23de26e0adSMurray Stokely.\" SUCH DAMAGE.
24de26e0adSMurray Stokely.\"
25de26e0adSMurray Stokely.\" $FreeBSD$
26de26e0adSMurray Stokely.\"
27*745f3064SMark Johnston.Dd February 8, 2022
28de26e0adSMurray Stokely.Dt RELEASE 7
29de26e0adSMurray Stokely.Os
30de26e0adSMurray Stokely.Sh NAME
31de26e0adSMurray Stokely.Nm release
32afb33690SMurray Stokely.Nd "release building infrastructure"
33de26e0adSMurray Stokely.Sh DESCRIPTION
34de26e0adSMurray Stokely.Fx
35de26e0adSMurray Stokelyprovides a complete build environment suitable for users to make
36de26e0adSMurray Stokelyfull releases of the
37de26e0adSMurray Stokely.Fx
38994c71f0SMurray Stokelyoperating system.
39de26e0adSMurray StokelyAll of the tools necessary to build a release are available from the
40feacd98eSNathan Whitehorn.Fx
41feacd98eSNathan Whitehornsource code repository in
42de26e0adSMurray Stokely.Pa src/release .
4355c9a224SEd MasteA complete release can be built with only a single command,
44eee69fccSMurray Stokelyincluding the creation of ISO images suitable for burning to CD-ROM,
4555c9a224SEd Mastememory stick images, and a network install directory.
46de26e0adSMurray StokelyThis command is aptly named
47afb33690SMurray Stokely.Dq Li "make release" .
48de26e0adSMurray Stokely.Pp
49e8423d00SNathan WhitehornFor some users, it may be desirable to provide an absolutely clean
50e8423d00SNathan Whitehornbuild environment, with no local modifications to the source tree or to
51e8423d00SNathan Whitehorn.Xr make.conf 5 ,
52e8423d00SNathan Whitehornand with clean checkouts of specific versions of the doc, src, and ports
53ebe27856SGlen Barbertrees.
54ebe27856SGlen BarberFor this purpose, a script
55ebe27856SGlen Barber.Pq Pa src/release/release.sh
56e8423d00SNathan Whitehornis provided to automate these checkouts and then execute
57e8423d00SNathan Whitehorn.Dq Li "make release"
58e8423d00SNathan Whitehornin a clean
59e8423d00SNathan Whitehorn.Xr chroot 8 .
60e8423d00SNathan Whitehorn.Pp
61de26e0adSMurray StokelyBefore attempting to build a release, the user is expected to be
62994c71f0SMurray Stokelyfamiliar with the contents of
63de26e0adSMurray Stokely.Xr build 7 ,
6447280c4bSRuslan Ermilovand should have experience upgrading systems from source.
65e8423d00SNathan Whitehorn.Pp
66de26e0adSMurray StokelyThe release build process requires that
67de26e0adSMurray Stokely.Pa /usr/obj
68de26e0adSMurray Stokelybe populated with the output of
69d408a341SNathan Whitehorn.Dq Li "make buildworld"
70d408a341SNathan Whitehornand
71d408a341SNathan Whitehorn.Dq Li "make buildkernel" .
72e8423d00SNathan WhitehornThis is necessary to provide the object files for the release or, when
73e8423d00SNathan Whitehornusing
74ebe27856SGlen Barber.Pa release.sh ,
75e8423d00SNathan Whitehornso that the object files for a complete system can be installed into a clean
76de26e0adSMurray Stokely.Xr chroot 8
77ebe27856SGlen Barberenvironment.
78ebe27856SGlen Barber.Pp
79ebe27856SGlen BarberIf the target release build is for a different architecture or machine type,
80ebe27856SGlen Barberthe
81ebe27856SGlen Barber.Va TARGET
82ebe27856SGlen Barberand
83ebe27856SGlen Barber.Va TARGET_ARCH
84ebe27856SGlen Barbervariables must be used.
85ebe27856SGlen BarberSee the supported
86ebe27856SGlen Barber.Fa release.conf
87ebe27856SGlen Barbervariables for more information.
88ebe27856SGlen Barber.Pp
89e8423d00SNathan WhitehornThe release procedure on some architectures may also require that the
90994c71f0SMurray Stokely.Xr md 4
91994c71f0SMurray Stokely(memory disk) device driver be present in the kernel
92ebe27856SGlen Barber.Pq either by being compiled in or available as a module .
93de26e0adSMurray Stokely.Pp
94de26e0adSMurray StokelyThis document does not cover source code management, quality
95de26e0adSMurray Stokelyassurance, or other aspects of the release engineering process.
96e8423d00SNathan Whitehorn.Sh CLEAN RELEASE GENERATION
97ebe27856SGlen BarberOfficial releases of
98ebe27856SGlen Barber.Fx
9955c9a224SEd Masteare produced in a clean environment to
100e8423d00SNathan Whitehornensure consistency between the versions of the src, ports, and doc trees
101ebe27856SGlen Barberand to avoid contamination from the host system
102ebe27856SGlen Barber.Po such as local patches, changes
103e8423d00SNathan Whitehornto
104e8423d00SNathan Whitehorn.Xr make.conf 5 ,
105ebe27856SGlen Barberetc.
106ebe27856SGlen Barber.Pc .
107ebe27856SGlen BarberThis is accomplished using the wrapper script
108ebe27856SGlen Barber.Pa src/release/release.sh .
109e8423d00SNathan Whitehorn.Pp
110ebe27856SGlen Barber.Ic release.sh
111ebe27856SGlen Barber.Op Fl c Ar release.conf
112e8423d00SNathan Whitehorn.Pp
113ebe27856SGlen Barber.Ic release.sh
114ebe27856SGlen Barberchecks out the
115ebe27856SGlen Barber.Li src/ ,
116ebe27856SGlen Barber.Li ports/ ,
117ebe27856SGlen Barberand
118ebe27856SGlen Barber.Li doc/
119ebe27856SGlen Barbertrees to
120ebe27856SGlen Barber.Va CHROOTDIR ,
121ebe27856SGlen Barberthen calls
122ebe27856SGlen Barber.Dq Li "make buildworld"
123ebe27856SGlen Barberand
124e8423d00SNathan Whitehorn.Dq Li "make installworld"
125e8423d00SNathan Whitehornto generate a
126e8423d00SNathan Whitehorn.Xr chroot 8
127ebe27856SGlen Barberenvironment.
128ebe27856SGlen BarberNext,
129e8423d00SNathan Whitehorn.Dq Li "make release"
130ebe27856SGlen Barberis run within the
131e8423d00SNathan Whitehorn.Xr chroot 8
132e8423d00SNathan Whitehornenvironment and places the result in
133ebe27856SGlen Barber.Pa $CHROOTDIR/R .
134e8423d00SNathan Whitehorn.Pp
135ebe27856SGlen BarberThe optional
136ebe27856SGlen Barber.Fa release.conf
137ebe27856SGlen Barberconfiguration file supports the following variables:
138ebe27856SGlen Barber.Bl -tag -width Ev
139ebe27856SGlen Barber.It Va CHROOTDIR
140ebe27856SGlen BarberThe directory within which the release will be built.
141e0436612SGlen Barber.It Va CHROOT_MAKEENV
142e0436612SGlen BarberAdditional
143e0436612SGlen Barber.Xr make 1
144e0436612SGlen Barberarguments to pass through, which directly affect the
145e0436612SGlen Barbertuning of the build chroot.
146de415e66SAlan Somers.It Va NOGIT
147de415e66SAlan SomersDo not explicitly require the
148de415e66SAlan Somers.Xr git 1
149de415e66SAlan Somersport to be installed.
150f695e960SDaniel Ebdrup Jensen.It Va GITROOT
151ebe27856SGlen BarberThe
152f695e960SDaniel Ebdrup Jensen.Xr git 1
153ebe27856SGlen Barberhost used to check out the various trees.
154ebe27856SGlen BarberDefaults to
155f695e960SDaniel Ebdrup Jensen.Pa https://git.FreeeBSD.org .
156ebe27856SGlen Barber.It Va SRCBRANCH
157ebe27856SGlen BarberThe
158ebe27856SGlen Barber.Li src/
159ebe27856SGlen Barberbranch to use.
160ebe27856SGlen BarberDefaults to
161f695e960SDaniel Ebdrup Jensen.Fl b Va main .
162ebe27856SGlen Barber.It Va PORTBRANCH
163ebe27856SGlen BarberThe
164ebe27856SGlen Barber.Li ports/
165ebe27856SGlen Barberbranch to use.
166ebe27856SGlen BarberDefaults to
167bda59883SGlen Barber.Va head/@rHEAD .
168ebe27856SGlen Barber.It Va TARGET
169bc1af85cSGlen BarberThe target machine type for cross-building a release.
170ebe27856SGlen Barber.It Va TARGET_ARCH
171bc1af85cSGlen BarberThe target machine architecture for cross-building a release.
172ebe27856SGlen Barber.Pp
173ebe27856SGlen BarberFor the supported list of
174ebe27856SGlen Barber.Va TARGET
175ebe27856SGlen Barberand
176ebe27856SGlen Barber.Va TARGET_ARCH
177ebe27856SGlen Barbercombinations, consult the output of
178ebe27856SGlen Barber.Dq make targets
179ebe27856SGlen Barberas documented in
180ebe27856SGlen Barber.Xr build 7 .
181ebe27856SGlen Barber.It Va KERNEL
182ebe27856SGlen BarberThe target kernel configuration to use.
183ebe27856SGlen BarberDefaults to
184ebe27856SGlen Barber.Va GENERIC .
185ebe27856SGlen BarberMultiple
186ebe27856SGlen Barber.Va KERNEL
187ebe27856SGlen Barberentries may be specified.
188ebe27856SGlen Barber.It Va MAKE_CONF
189ebe27856SGlen BarberThe
190ebe27856SGlen Barber.Xr make.conf 5
191ebe27856SGlen Barberto use for the release build.
192ebe27856SGlen BarberDefaults to
193ebe27856SGlen Barber.Fa /dev/null
194ebe27856SGlen Barberto prevent polluting the release with local system changes.
195ebe27856SGlen Barber.It Va SRC_CONF
196ebe27856SGlen BarberThe
197ebe27856SGlen Barber.Xr src.conf 5
198ebe27856SGlen Barberto use for the release build.
199ebe27856SGlen BarberDefaults to
200ebe27856SGlen Barber.Fa /dev/null
201ebe27856SGlen Barberto prevent polluting the release with local system changes.
202ebe27856SGlen Barber.It Va MAKE_FLAGS
203ebe27856SGlen BarberAdditional flags to pass to
204ebe27856SGlen Barber.Xr make 1 .
205ebe27856SGlen Barber.It Va WORLD_FLAGS
206ebe27856SGlen BarberAdditional flags to pass to
207e8423d00SNathan Whitehorn.Xr make 1
208ebe27856SGlen Barberduring the
209ebe27856SGlen Barber.Dq buildworld
210ebe27856SGlen Barberphase.
211ebe27856SGlen BarberDefaults to setting the number of
212de17cbccSHiroki Sato.Xr make 1
213ebe27856SGlen Barberjobs
214ebe27856SGlen Barber.Pq Ar -j
215bc1af85cSGlen Barberto the number of CPUs available on a SMP-capable system.
216ebe27856SGlen Barber.It Va KERNEL_FLAGS
217ebe27856SGlen BarberAdditional flags to pass to
218ebe27856SGlen Barber.Xr make 1
219ebe27856SGlen Barberduring the
220ebe27856SGlen Barber.Dq buildkernel
221ebe27856SGlen Barberphase.
222ebe27856SGlen BarberDefaults to setting the number of
223ebe27856SGlen Barber.Xr make 1
224ebe27856SGlen Barberjobs
225ebe27856SGlen Barber.Pq Ar -j
226bc1af85cSGlen Barberto half the number of CPUs available on a SMP-capable system.
227ebe27856SGlen Barber.It Va NOPORTS
228ebe27856SGlen BarberSet to a non-empty value to skip the
229ebe27856SGlen Barber.Li ports/
230ebe27856SGlen Barbertree checkout.
231ebe27856SGlen BarberWhen set,
232ebe27856SGlen Barber.Va NOPORTS
233ebe27856SGlen Barberwill prevent the
234ebe27856SGlen Barber.Fa ports.txz
235ebe27856SGlen Barberdistribution package from being created.
236f7f650c7SGlen Barber.It Va WITH_DVD
237f7f650c7SGlen BarberSet to a non-empty value to include the
238f7f650c7SGlen Barber.Cm dvdrom
239f7f650c7SGlen Barbertarget.
240cbc0e08aSGlen Barber.It Va WITH_COMPRESSED_IMAGES
241cbc0e08aSGlen BarberSet to a non-empty value to compress the release images with
24255af5cf1SGlen Barber.Xr xz 1 .
243cbc0e08aSGlen BarberThe original
244cbc0e08aSGlen Barber.Pq uncompressed
245cbc0e08aSGlen Barberimages are not removed.
2467a07bd46SGlen Barber.It Va XZ_THREADS Pq Vt int
2477a07bd46SGlen BarberSet to the number of threads
2487a07bd46SGlen Barber.Xr xz 1
2497a07bd46SGlen Barbershould use when compressing images.
2507a07bd46SGlen BarberBy default,
2517a07bd46SGlen Barber.Va XZ_THREADS
252a79d18b7SGlen Barberis set to
253a79d18b7SGlen Barber.Va 0 ,
254a79d18b7SGlen Barberwhich uses all available cores on the system.
2559bb84a63SGlen Barber.It Va VCSCMD
2569bb84a63SGlen BarberThe command run to obtain the source trees.
2579bb84a63SGlen BarberDefaults to
258f695e960SDaniel Ebdrup Jensen.Qq Cm git clone Fl q .
259e0436612SGlen Barber.It Va CHROOTBUILD_SKIP
260e0436612SGlen BarberIf defined, the
261e0436612SGlen Barber.Li buildworld ,
262e0436612SGlen Barber.Li installworld ,
263e0436612SGlen Barberand
264e0436612SGlen Barber.Li distribution
265e0436612SGlen Barberstages of the
266e0436612SGlen Barber.Xr chroot 8
267e0436612SGlen Barberbuild environment setup are skipped.
268e0436612SGlen BarberThis is intended solely for cases where the
269e0436612SGlen Barber.Xr chroot 8
270e0436612SGlen Barberuserland are provided by alternate means.
2713e64b4c5SGlen Barber.It Va SRC_UPDATE_SKIP
2723e64b4c5SGlen BarberSet to a non-empty value to prevent checkout or update of
2733e64b4c5SGlen Barber.Fa /usr/src
2743e64b4c5SGlen Barberwithin the
2753e64b4c5SGlen Barber.Xr chroot 8 .
2763e64b4c5SGlen BarberThis is intended for use only when
2773e64b4c5SGlen Barber.Fa /usr/src
2783e64b4c5SGlen Barberis expected to exist by alternative means.
2793e64b4c5SGlen Barber.It Va PORTS_UPDATE_SKIP
2803e64b4c5SGlen BarberSet to a non-empty value to prevent checkout or update of
2813e64b4c5SGlen Barber.Fa /usr/ports
2823e64b4c5SGlen Barberwithin the
2833e64b4c5SGlen Barber.Xr chroot 8 .
2843e64b4c5SGlen BarberThis is intended for use only when
2853e64b4c5SGlen Barber.Fa /usr/ports
2863e64b4c5SGlen Barberis expected to exist by alternative means.
287e0436612SGlen Barber.El
288e0436612SGlen Barber.Sh EMBEDDED BUILDS
289e0436612SGlen BarberThe following
290e0436612SGlen Barber.Fa release.conf
291e0436612SGlen Barbervariables are relevant only to release builds for embedded systems:
292e0436612SGlen Barber.Bl -tag -width Ev
293e0436612SGlen Barber.It Va EMBEDDEDBUILD
294e0436612SGlen BarberSet to a non-null value to enable functionality for embedded device
295e0436612SGlen Barberrelease builds.
296e0436612SGlen Barber.Pp
297e0436612SGlen BarberWhen set,
298e0436612SGlen Barber.Va WITH_DVD
299f695e960SDaniel Ebdrup Jensenis unset.
300e0436612SGlen BarberAdditionally,
30120772e47SGlen Barber.Va EMBEDDED_TARGET
302e0436612SGlen Barberand
30320772e47SGlen Barber.Va EMBEDDED_TARGET_ARCH
304e0436612SGlen Barbermust also be defined.
305e0436612SGlen BarberWhen the build environment is created,
306e0436612SGlen Barber.Fa release.sh
307e0436612SGlen Barberruns a separate build script located in an architecture-specific
308e0436612SGlen Barberdirectory in
30920772e47SGlen Barber.Pa src/release/${EMBEDDED_TARGET}/ .
310e0436612SGlen Barber.It Va EMBEDDEDPORTS
311e0436612SGlen BarberSet to the list of any ports that are required for the target device
312e0436612SGlen Barberin the format of
313e0436612SGlen Barber.Fa category/port .
314e0436612SGlen BarberThe
315e0436612SGlen Barber.Fa devel/subversion
316e0436612SGlen Barberport is built by default.
31720772e47SGlen Barber.It Va EMBEDDED_TARGET
31820772e47SGlen BarberWhen set, its value is passed to
31920772e47SGlen Barber.Xr make 1
32020772e47SGlen Barberto set the
32120772e47SGlen Barber.Va TARGET
32220772e47SGlen Barber.Pq value of Cm uname Fl m
32320772e47SGlen Barberto cross build the target userland.
32420772e47SGlen Barber.It Va EMBEDDED_TARGET_ARCH
32520772e47SGlen BarberWhen set, its value is passed to
32620772e47SGlen Barber.Xr make 1
32720772e47SGlen Barberto set the
32820772e47SGlen Barber.Va TARGET_ARCH
32920772e47SGlen Barber.Pq value of Cm uname Fl p
33020772e47SGlen Barberto cross build the target userland.
331e8423d00SNathan Whitehorn.El
332a8c229a5SGlen Barber.Sh VIRTUAL MACHINE DISK IMAGES
333a8c229a5SGlen BarberThe following
334a8c229a5SGlen Barber.Fa release.conf
335a8c229a5SGlen Barbervariables are relevant only to virtual machine disk image builds:
336a8c229a5SGlen Barber.Bl -tag -width Ev
337a8c229a5SGlen Barber.It Va WITH_VMIMAGES
338a8c229a5SGlen BarberSet to a non-null value to build virtual machine disk images as part
339a8c229a5SGlen Barberof the release build.
340a8c229a5SGlen Barber.Va WITH_VMIMAGES
34141ad38efSMark Johnstonmay also be specified as an environment variable passed to
342a8c229a5SGlen Barber.Xr make 1 .
343a8c229a5SGlen Barber.It Va WITH_COMPRESSED_VMIMAGES
344a8c229a5SGlen BarberSet to a non-null value to compress the virtual machine disk images with
345a8c229a5SGlen Barber.Xr xz 1
346a8c229a5SGlen Barberas part of the
347a8c229a5SGlen Barber.Cm install
348a8c229a5SGlen Barber.Xr make 1
349a8c229a5SGlen Barbertarget.
350a8c229a5SGlen BarberNote that compressing virtual machine disk images may take a very long
351a8c229a5SGlen Barbertime on some systems.
352a8c229a5SGlen Barber.It Va VMBASE
353a8c229a5SGlen BarberSet to change the name of the resulting virtual machine disk image file.
354a8c229a5SGlen BarberThe default value is
355a8c229a5SGlen Barber.Va vm .
356a8c229a5SGlen Barber.It Va VMSIZE
357a8c229a5SGlen BarberSet to change the size of the virtual machine disk capacity.
358a8c229a5SGlen BarberThe default value is
359fa04db47SGlen Barber.Va 20g .
360a8c229a5SGlen BarberSee
361fa04db47SGlen Barber.Xr makefs 8
362a8c229a5SGlen Barberfor valid values.
363a8c229a5SGlen Barber.Pp
364a8c229a5SGlen BarberVirtual machine disk images are, by default, created as sparse images.
365a8c229a5SGlen BarberWhen
366a8c229a5SGlen Barber.Va WITH_COMPRESSED_VMIMAGES
367a8c229a5SGlen Barberis used, the resulting files compressed with
368a8c229a5SGlen Barber.Xr xz 1
369a8c229a5SGlen Barbercompress to roughly the same size, regardless of the specified disk image
370a8c229a5SGlen Barbersize.
371a8c229a5SGlen Barber.It Va VMFORMATS
372a8c229a5SGlen BarberSet to the target virtual disk image format(s) to create.
373a8c229a5SGlen BarberBy default, the
374a8c229a5SGlen Barber.Va vhdf , Va vmdk , Va qcow2 ,
375a8c229a5SGlen Barberand
376a8c229a5SGlen Barber.Va raw
377a8c229a5SGlen Barberformats are created.
378a8c229a5SGlen BarberSee
379a8c229a5SGlen Barber.Xr mkimg 1
380*745f3064SMark Johnstonfor valid format values.
381a8c229a5SGlen Barber.El
38285311c29SGlen Barber.Pp
38385311c29SGlen BarberFor a list of supported
38485311c29SGlen Barber.Va VMFORMATS
38585311c29SGlen Barbervalues
38685311c29SGlen Barber.Pq including cloud hosting provider formats
38785311c29SGlen Barberalong with a brief description, run:
38885311c29SGlen Barber.Bd -literal -offset indent
38985311c29SGlen Barbercd /usr/src
39085311c29SGlen Barbermake -C release list-vmtargets
39185311c29SGlen Barber.Ed
392b513fff0SGlen Barber.Sh CLOUD HOSTING MACHINE IMAGES
393b513fff0SGlen BarberThe
394b513fff0SGlen Barber.Fx
395b513fff0SGlen Barberrelease build tools support building virtual machine images for various
396b513fff0SGlen Barbercloud hosting providers, each with their own specific configuration to
397b513fff0SGlen Barberinclude support for each hosting provider by default.
398b513fff0SGlen Barber.Pp
399b513fff0SGlen BarberThe following
400b513fff0SGlen Barber.Xr make 1
401b513fff0SGlen Barberenvironment variables are supported:
402b513fff0SGlen Barber.Bl -tag -width Ev
403b513fff0SGlen Barber.It Va CLOUDWARE
404b513fff0SGlen BarberSet to a list of one or more cloud hosting providers, enclosed in quotes.
405b513fff0SGlen BarberRequires
406b513fff0SGlen Barber.Va WITH_CLOUDWARE
407b513fff0SGlen Barberto also be set.
408b513fff0SGlen Barber.It Va WITH_CLOUDWARE
409b513fff0SGlen BarberSet to a non-empty value to enable building virtual machine images
410b513fff0SGlen Barberfor various cloud hosting providers.
411b513fff0SGlen BarberRequires
412b513fff0SGlen Barber.Va CLOUDWARE
413b513fff0SGlen Barberto also be set.
414b513fff0SGlen Barber.El
415b513fff0SGlen Barber.Pp
416b513fff0SGlen BarberAdditionally, the
417b513fff0SGlen Barber.Va CLOUDWARE
418b513fff0SGlen Barberand
419b513fff0SGlen Barber.Va WITH_CLOUDWARE
420b513fff0SGlen Barbervariables can be added to
421b513fff0SGlen Barber.Pa release.conf ,
422b513fff0SGlen Barberand used in conjunction with
423b513fff0SGlen Barber.Pa release.sh .
424b513fff0SGlen Barber.Pp
425b513fff0SGlen BarberFor a list of supported
426b513fff0SGlen Barber.Va CLOUDWARE
427b513fff0SGlen Barbervalues, run:
428b513fff0SGlen Barber.Bd -literal -offset indent
429b513fff0SGlen Barbercd /usr/src
430b513fff0SGlen Barbermake -C release list-cloudware
431b513fff0SGlen Barber.Ed
432e8423d00SNathan Whitehorn.Sh MAKEFILE TARGETS
433de26e0adSMurray StokelyThe release makefile
434994c71f0SMurray Stokely.Pq Pa src/release/Makefile
435de26e0adSMurray Stokelyis fairly abstruse.
436de26e0adSMurray StokelyMost developers will only be concerned with the
437afb33690SMurray Stokely.Cm release
438299a8b95SNathan Whitehornand
439299a8b95SNathan Whitehorn.Cm install
440299a8b95SNathan Whitehorntargets.
441994c71f0SMurray Stokely.\" XXX: Some sort of introduction to this list?  All the others have one.
442e8423d00SNathan Whitehorn.Bl -tag -width ".Cm packagesystem"
443afb33690SMurray Stokely.It Cm release
444e8423d00SNathan WhitehornMeta-target to build all release media and distributions applicable to this
445299a8b95SNathan Whitehornplatform.
446299a8b95SNathan Whitehorn.It Cm install
447299a8b95SNathan WhitehornCopy all produced release media to
448299a8b95SNathan Whitehorn.Pa ${DESTDIR} .
449e8423d00SNathan Whitehorn.It Cm cdrom
450de17cbccSHiroki SatoBuilds installation CD-ROM images.
451de17cbccSHiroki SatoThis may require the
452e8423d00SNathan Whitehorn.Xr md 4
453e8423d00SNathan Whitehorn(memory disk) device driver be present in the kernel
454de17cbccSHiroki Sato(either by being compiled in or available as a module).
455de17cbccSHiroki SatoThis target produces files called
456ebe27856SGlen Barber.Pa disc1.iso
457299a8b95SNathan Whitehornand
458299a8b95SNathan Whitehorn.Pa bootonly.iso
459e8423d00SNathan Whitehornas its output.
460d7cfbadbSGlen Barber.It Cm dvdrom
461d7cfbadbSGlen BarberBuilds installation DVD-ROM images.
462d7cfbadbSGlen BarberThis may require the
463d7cfbadbSGlen Barber.Xr md 4
464d7cfbadbSGlen Barber(memory disk) device driver be present in the kernel
465d7cfbadbSGlen Barber(either by being compiled in or available as a module).
466d7cfbadbSGlen BarberThis target produces the
467d7cfbadbSGlen Barber.Pa dvd1.iso
468d7cfbadbSGlen Barberfile as its output.
469e8423d00SNathan Whitehorn.It Cm memstick
470e8423d00SNathan WhitehornBuilds an installation memory stick image named
471ebe27856SGlen Barber.Pa memstick.img .
472de17cbccSHiroki SatoNot applicable on all platforms.
473de17cbccSHiroki SatoRequires that the
474e8423d00SNathan Whitehorn.Xr md 4
475ebe27856SGlen Barber.Pq memory disk
476ebe27856SGlen Barberdevice driver be present in the kernel
477ebe27856SGlen Barber.Pq either by being compiled in or available as a module .
47816fb00c1SGlen Barber.It Cm mini-memstick
47916fb00c1SGlen BarberSimilar to
48016fb00c1SGlen Barber.Cm memstick ,
48116fb00c1SGlen Barberwith the exception that the installation distribution sets
48216fb00c1SGlen Barberare not included.
483e8423d00SNathan Whitehorn.It Cm ftp
484e8423d00SNathan WhitehornCreates a directory named
485e8423d00SNathan Whitehorn.Pa ftp
486e8423d00SNathan Whitehorncontaining the distribution files used in network installations
487e8423d00SNathan Whitehornand suitable for upload to an FTP mirror.
488a8c229a5SGlen Barber.It Cm vm-image
489a8c229a5SGlen BarberCreates virtual machine disk images in various formats.
490a8c229a5SGlen BarberThe
491a8c229a5SGlen Barber.Cm vm-image
492a8c229a5SGlen Barbertarget requires the
493a8c229a5SGlen Barber.Va WITH_VMIMAGES
494a8c229a5SGlen Barber.Xr make 1
49541ad38efSMark Johnstonenvironment variable to be set to a non-null value.
496b513fff0SGlen Barber.It Cm vm-cloudware
497b513fff0SGlen BarberBuilds
498b513fff0SGlen Barber.Fx
499b513fff0SGlen Barbervirtual machine images for various cloud hosting providers.
500b513fff0SGlen BarberSee
501b513fff0SGlen Barber.Qq CLOUD HOSTING MACHINE IMAGES
502b513fff0SGlen Barberfor implementation details.
503b513fff0SGlen Barber.It Cm list-cloudware
504b513fff0SGlen BarberDisplays the list of valid
505b513fff0SGlen Barber.Va CLOUDWARE
506b513fff0SGlen Barbervalues.
50785311c29SGlen Barber.It Cm list-vmtargets
50885311c29SGlen BarberDisplays the list of valid
50985311c29SGlen Barber.Va VMFORMAT
51085311c29SGlen Barberand
51185311c29SGlen Barber.Va CLOUDWARE
51285311c29SGlen Barbervalues.
513de26e0adSMurray Stokely.El
514de26e0adSMurray Stokely.Pp
515e8423d00SNathan WhitehornMajor subtargets called by targets above:
516e8423d00SNathan Whitehorn.Bl -tag -width ".Cm packagesystem"
517e8423d00SNathan Whitehorn.It Cm packagesystem
518ebe27856SGlen BarberGenerates all the distribution archives
519ebe27856SGlen Barber.Pq base, kernel, ports, doc
520e8423d00SNathan Whitehornapplicable on this platform.
52147176cacSGlen Barber.It Cm disc1
522e8423d00SNathan WhitehornBuilds a bootable installation system containing all the distribution files
523e8423d00SNathan Whitehornpackaged by the
524e8423d00SNathan Whitehorn.Cm packagesystem
525e8423d00SNathan Whitehorntarget, and suitable for imaging by the
526d7cfbadbSGlen Barber.Cm cdrom ,
527d7cfbadbSGlen Barber.Cm dvdrom
528e8423d00SNathan Whitehornand
529e8423d00SNathan Whitehorn.Cm memstick
530e8423d00SNathan Whitehorntargets.
531e8423d00SNathan Whitehorn.It Cm reldoc
532994c71f0SMurray StokelyBuilds the release documentation.
533994c71f0SMurray StokelyThis includes the release notes,
534ebe27856SGlen Barberhardware guide, and installation instructions.
535ebe27856SGlen BarberOther documentation, such as the Handbook,
536ebe27856SGlen Barberis built during the
537e8423d00SNathan Whitehorn.Cm base.txz
538e8423d00SNathan Whitehorntarget invoked by
539e8423d00SNathan Whitehorn.Cm packagesystem .
540de26e0adSMurray Stokely.El
541de26e0adSMurray Stokely.Sh ENVIRONMENT
542de26e0adSMurray StokelyOptional variables:
543de17cbccSHiroki Sato.Bl -tag -width ".Ev TARGET_ARCH"
544de17cbccSHiroki Sato.It Ev OSRELEASE
5452e67e6ffSGlen BarberOptional base name for generated media images when invoking the
5462e67e6ffSGlen Barber.Cm install
5472e67e6ffSGlen Barbertarget
5482e67e6ffSGlen Barber.Pq e.g., FreeBSD-12.1-RELEASE-amd64 .
549de17cbccSHiroki SatoDefaults to the output of
550de17cbccSHiroki Sato.Ic `uname -s`-`uname -r`-`uname -p`
551de17cbccSHiroki Satowithin the chroot.
552de17cbccSHiroki Sato.It Ev WORLDDIR
553ebe27856SGlen BarberLocation of a directory containing the src tree.
554ebe27856SGlen BarberBy default, the directory
555e8423d00SNathan Whitehornabove the one containing the makefile
556e8423d00SNathan Whitehorn.Pq Pa src .
557de17cbccSHiroki Sato.It Ev PORTSDIR
558ebe27856SGlen BarberLocation of a directory containing the ports tree.
559ebe27856SGlen BarberBy default,
560e8423d00SNathan Whitehorn.Pa /usr/ports .
561e8423d00SNathan WhitehornIf it is unset or cannot be found, ports will not be included in the release.
562de17cbccSHiroki Sato.It Ev NOPORTS
563e8423d00SNathan WhitehornIf defined, the Ports Collection will be omitted from the release.
564de17cbccSHiroki Sato.It Ev NOSRC
565e8423d00SNathan WhitehornIf set, do not include system source code in the release.
566de17cbccSHiroki Sato.It Ev TARGET
56725923b97SRuslan ErmilovThe target hardware platform.
56825923b97SRuslan ErmilovThis is analogous to the
56925923b97SRuslan Ermilov.Dq Nm uname Fl m
57025923b97SRuslan Ermilovoutput.
57125923b97SRuslan ErmilovThis is necessary to cross-build some target architectures.
5722f6a7e42SEnji CooperFor example, cross-building for ARM64 machines requires
5732f6a7e42SEnji Cooper.Ev TARGET_ARCH Ns = Ns Li aarch64
57425923b97SRuslan Ermilovand
5752f6a7e42SEnji Cooper.Ev TARGET Ns = Ns Li arm64 .
576e8423d00SNathan WhitehornIf not set,
577de17cbccSHiroki Sato.Ev TARGET
578e8423d00SNathan Whitehorndefaults to the current hardware platform.
579de17cbccSHiroki Sato.It Ev TARGET_ARCH
580e8423d00SNathan WhitehornThe target machine processor architecture.
581e8423d00SNathan WhitehornThis is analogous to the
582e8423d00SNathan Whitehorn.Dq Nm uname Fl p
583e8423d00SNathan Whitehornoutput.
584e8423d00SNathan WhitehornSet this to cross-build for a different architecture.
585e8423d00SNathan WhitehornIf not set,
586de17cbccSHiroki Sato.Ev TARGET_ARCH
587e8423d00SNathan Whitehorndefaults to the current machine architecture, unless
588de17cbccSHiroki Sato.Ev TARGET
589e8423d00SNathan Whitehornis also set, in which case it defaults to the appropriate
590e8423d00SNathan Whitehornvalue for that platform.
591e8423d00SNathan WhitehornTypically, one only needs to set
592de17cbccSHiroki Sato.Ev TARGET .
593de26e0adSMurray Stokely.El
594de26e0adSMurray Stokely.Sh FILES
59582f39c10SGlen Barber.Bl -tag -compact -width Pa
596de26e0adSMurray Stokely.It Pa /usr/doc/Makefile
597de26e0adSMurray Stokely.It Pa /usr/doc/share/mk/doc.project.mk
598de26e0adSMurray Stokely.It Pa /usr/ports/Mk/bsd.port.mk
599de26e0adSMurray Stokely.It Pa /usr/ports/Mk/bsd.sites.mk
600de26e0adSMurray Stokely.It Pa /usr/share/examples/etc/make.conf
601de26e0adSMurray Stokely.It Pa /usr/src/Makefile
602de26e0adSMurray Stokely.It Pa /usr/src/Makefile.inc1
603de26e0adSMurray Stokely.It Pa /usr/src/release/Makefile
604b513fff0SGlen Barber.It Pa /usr/src/release/Makefile.vm
605ebe27856SGlen Barber.It Pa /usr/src/release/release.sh
606ebe27856SGlen Barber.It Pa /usr/src/release/release.conf.sample
607b513fff0SGlen Barber.It Pa /usr/src/release/tools/*.conf
608b513fff0SGlen Barber.It Pa /usr/src/release/tools/vmimage.subr
609de26e0adSMurray Stokely.El
610de26e0adSMurray Stokely.Sh EXAMPLES
611e8423d00SNathan WhitehornThe following sequence of commands can be used to build a
612e8423d00SNathan Whitehorn.Dq "-CURRENT snapshot":
613de26e0adSMurray Stokely.Bd -literal -offset indent
614de26e0adSMurray Stokelycd /usr
615ef1a1fc7SDaniel Ebdrup Jensengit clone -b main https://git.freebsd.org/src.git src
616de26e0adSMurray Stokelycd src
617d408a341SNathan Whitehornmake buildworld buildkernel
618de26e0adSMurray Stokelycd release
6192e67e6ffSGlen Barbermake obj
6208ef63d0dSNathan Whitehornmake release
6218ef63d0dSNathan Whitehornmake install DESTDIR=/var/freebsd-snapshot
622de26e0adSMurray Stokely.Ed
623de26e0adSMurray Stokely.Pp
624299a8b95SNathan WhitehornAfter running these commands, all produced distribution files (tarballs
625299a8b95SNathan Whitehornfor FTP, CD-ROM images, etc.) are available in the
626299a8b95SNathan Whitehorn.Pa /var/freebsd-snapshot
627de26e0adSMurray Stokelydirectory.
628de26e0adSMurray Stokely.Pp
629994c71f0SMurray StokelyThe following sequence of commands can be used to build a
6301bcf2f1aSMurray Stokely.Dq "-CURRENT snapshot"
631e8423d00SNathan Whitehornin a clean environment, including ports and documentation:
632de26e0adSMurray Stokely.Bd -literal -offset indent
6335af5af75SGleb Smirnoffcd /usr/src/release
634ebe27856SGlen Barbersh release.sh
635ebe27856SGlen Barber.Ed
636ebe27856SGlen Barber.Pp
637ebe27856SGlen BarberOptionally, a configuration file can be used customize the release build,
638ebe27856SGlen Barbersuch as the subversion revision to use, the branch of the subversion tree for
639ebe27856SGlen Barber.Li src/ ,
640ebe27856SGlen Barber.Li ports/ ,
641ebe27856SGlen Barberand
642ebe27856SGlen Barber.Li doc/ .
643ebe27856SGlen Barber.Bd -literal -offset indent
644ebe27856SGlen Barbercd /usr/src/release
645ebe27856SGlen Barbersh release.sh -c $HOME/release.conf
646de26e0adSMurray Stokely.Ed
647e8423d00SNathan Whitehorn.Pp
6480e976a76SGlen BarberConfiguration files specific to various supported embedded systems, such as
6490e976a76SGlen Barberthe Raspberry Pi, exist in the directory corresponding to the
6500e976a76SGlen Barber.Va TARGET
6510e976a76SGlen Barber.Xr make 1
6520e976a76SGlen Barbervariable.
6530e976a76SGlen BarberFor example, to build an image for the Raspberry Pi:
6540e976a76SGlen Barber.Bd -literal -offset indent
6550e976a76SGlen Barbercd /usr/src/release
6560e976a76SGlen Barbersh release.sh -c arm/RPI-B.conf
6570e976a76SGlen Barber.Ed
6580e976a76SGlen Barber.Pp
6590e976a76SGlen BarberTo build an image for the Raspberry Pi 3:
6600e976a76SGlen Barber.Bd -literal -offset indent
6610e976a76SGlen Barbercd /usr/src/release
6620e976a76SGlen Barbersh release.sh -c arm64/RPI3.conf
6630e976a76SGlen Barber.Ed
6640e976a76SGlen Barber.Pp
665e8423d00SNathan WhitehornAfter running these commands, all prepared release files are available in the
666ebe27856SGlen Barber.Pa /scratch
667e8423d00SNathan Whitehorndirectory.
668ebe27856SGlen BarberThe target directory can be changed by specifying the
669ebe27856SGlen Barber.Va CHROOTDIR
670ebe27856SGlen Barbervariable in
671ebe27856SGlen Barber.Li release.conf .
672f695e960SDaniel Ebdrup Jensen.Sh COMPATIBILITY
673f695e960SDaniel Ebdrup JensenThe reldoc target was removed in commit f61e92ca5a23, and
674f695e960SDaniel Ebdrup Jensen.Ev DOCDIR ,
675f695e960SDaniel Ebdrup Jensen.Ev DOCBRANCH ,
676f695e960SDaniel Ebdrup Jensen.Ev DOC_UPDATE_SKIP ,
677f695e960SDaniel Ebdrup Jensenand
678f695e960SDaniel Ebdrup Jensen.Ev NODOC
679f695e960SDaniel Ebdrup Jensenare therefore no longer supported.
680de26e0adSMurray Stokely.Sh SEE ALSO
681de26e0adSMurray Stokely.Xr cc 1 ,
682f695e960SDaniel Ebdrup Jensen.Xr git 1 Pq Pa ports/devel/git ,
683de26e0adSMurray Stokely.Xr install 1 ,
684de26e0adSMurray Stokely.Xr make 1 ,
685*745f3064SMark Johnston.Xr mkimg 1 ,
686de26e0adSMurray Stokely.Xr uname 1 ,
687afb33690SMurray Stokely.Xr md 4 ,
688de26e0adSMurray Stokely.Xr make.conf 5 ,
689de26e0adSMurray Stokely.Xr build 7 ,
690de26e0adSMurray Stokely.Xr ports 7 ,
691afb33690SMurray Stokely.Xr chroot 8 ,
692f5178c4fSMurray Stokely.Xr mtree 8 ,
693f5178c4fSMurray Stokely.Xr sysctl 8
694994c71f0SMurray Stokely.Rs
6951bcf2f1aSMurray Stokely.%T "FreeBSD Release Engineering"
696c1a14887SCeri Davies.%U https://docs.freebsd.org/en/articles/freebsd-releng/
697994c71f0SMurray Stokely.Re
698994c71f0SMurray Stokely.Rs
6991bcf2f1aSMurray Stokely.%T "FreeBSD Developers' Handbook"
700c1a14887SCeri Davies.%U https://docs.freebsd.org/en/books/developers-handbook/
701994c71f0SMurray Stokely.Re
702de26e0adSMurray Stokely.Sh HISTORY
703de26e0adSMurray Stokely.Fx
704de26e0adSMurray Stokely1.x
7051bcf2f1aSMurray Stokelyused a manual checklist, compiled by
7061bcf2f1aSMurray Stokely.An Rod Grimes ,
7071bcf2f1aSMurray Stokelyto produce a release.
708de26e0adSMurray StokelyApart from being incomplete, the list put a lot of specific demands on
709de26e0adSMurray Stokelyavailable file systems and was quite torturous to execute.
710de26e0adSMurray Stokely.Pp
711994c71f0SMurray StokelyAs part of the
712994c71f0SMurray Stokely.Fx 2.0
713994c71f0SMurray Stokelyrelease engineering effort, significant
714de26e0adSMurray Stokelyeffort was spent getting
715de26e0adSMurray Stokely.Pa src/release/Makefile
716de26e0adSMurray Stokelyinto a shape where it could at least automate most of the tediousness
717de26e0adSMurray Stokelyof building a release in a sterile environment.
718de26e0adSMurray Stokely.Pp
719e8423d00SNathan WhitehornFor the
720e8423d00SNathan Whitehorn.Fx 9.0
721e8423d00SNathan Whitehornrelease,
722e8423d00SNathan Whitehorn.Pa src/release/Makefile
723e8423d00SNathan Whitehornwas overhauled and the wrapper script
724e8423d00SNathan Whitehorn.Pa src/release/generate-release.sh
725e8423d00SNathan Whitehornintroduced to support the introduction of a new installer.
726e8423d00SNathan Whitehorn.Pp
727ebe27856SGlen BarberFor the
728ebe27856SGlen Barber.Fx 9.2
729ebe27856SGlen Barberrelease,
730ebe27856SGlen Barber.Pa src/release/release.sh
731ebe27856SGlen Barberwas introduced to support per-build configuration files.
732ebe27856SGlen Barber.Pa src/release/release.sh
733ebe27856SGlen Barberis heavily based on the
734ebe27856SGlen Barber.Pa src/release/generate-release.sh
735ebe27856SGlen Barberscript.
736ebe27856SGlen Barber.Pp
737594ca9baSTom RhodesAt near 1000 revisions spread over multiple branches, the
738f695e960SDaniel Ebdrup Jensen.Xr git 1
739994c71f0SMurray Stokelylog of
740994c71f0SMurray Stokely.Pa src/release/Makefile
741994c71f0SMurray Stokelycontains a vivid historical record of some
742de26e0adSMurray Stokelyof the hardships release engineers go through.
743de26e0adSMurray Stokely.Sh AUTHORS
744de26e0adSMurray Stokely.Pa src/release/Makefile
745afb33690SMurray Stokelywas originally written by
746afb33690SMurray Stokely.An -nosplit
747afb33690SMurray Stokely.An Rod Grimes ,
748afb33690SMurray Stokely.An Jordan Hubbard ,
749afb33690SMurray Stokelyand
750afb33690SMurray Stokely.An Poul-Henning Kamp .
751ebe27856SGlen Barber.Pp
752ebe27856SGlen BarberThis manual page was originally written by
753a63d6c94SBaptiste Daroussin.An Murray Stokely Aq Mt murray@FreeBSD.org .
754ebe27856SGlen Barber.Pp
755ebe27856SGlen BarberIt was updated by
756a63d6c94SBaptiste Daroussin.An Nathan Whitehorn Aq Mt nwhitehorn@FreeBSD.org
757ebe27856SGlen Barberto include the
758ebe27856SGlen Barber.Fa generate-release.sh
759ebe27856SGlen Barberscript used for the
760ebe27856SGlen Barber.Fx 9.0
761ebe27856SGlen Barberrelease cycle.
762ebe27856SGlen Barber.Pp
763ebe27856SGlen BarberIt was later updated by
764a63d6c94SBaptiste Daroussin.An Glen Barber Aq Mt gjb@FreeBSD.org
765ebe27856SGlen Barberto include the
766ebe27856SGlen Barber.Fa release.sh
767ebe27856SGlen Barberscript used for the
768ebe27856SGlen Barber.Fx 9.2
769ebe27856SGlen Barberrelease cycle.
770