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.\" 25962c2a49SLi-Wen Hsu.Dd August 6, 2023 26de26e0adSMurray Stokely.Dt RELEASE 7 27de26e0adSMurray Stokely.Os 28de26e0adSMurray Stokely.Sh NAME 29de26e0adSMurray Stokely.Nm release 30afb33690SMurray Stokely.Nd "release building infrastructure" 31de26e0adSMurray Stokely.Sh DESCRIPTION 32de26e0adSMurray Stokely.Fx 33de26e0adSMurray Stokelyprovides a complete build environment suitable for users to make 34de26e0adSMurray Stokelyfull releases of the 35de26e0adSMurray Stokely.Fx 36994c71f0SMurray Stokelyoperating system. 37de26e0adSMurray StokelyAll of the tools necessary to build a release are available from the 38feacd98eSNathan Whitehorn.Fx 39feacd98eSNathan Whitehornsource code repository in 40de26e0adSMurray Stokely.Pa src/release . 4155c9a224SEd MasteA complete release can be built with only a single command, 42eee69fccSMurray Stokelyincluding the creation of ISO images suitable for burning to CD-ROM, 4355c9a224SEd Mastememory stick images, and a network install directory. 44de26e0adSMurray StokelyThis command is aptly named 45afb33690SMurray Stokely.Dq Li "make release" . 46de26e0adSMurray Stokely.Pp 47e8423d00SNathan WhitehornFor some users, it may be desirable to provide an absolutely clean 48e8423d00SNathan Whitehornbuild environment, with no local modifications to the source tree or to 49e8423d00SNathan Whitehorn.Xr make.conf 5 , 50e8423d00SNathan Whitehornand with clean checkouts of specific versions of the doc, src, and ports 51ebe27856SGlen Barbertrees. 52ebe27856SGlen BarberFor this purpose, a script 53ebe27856SGlen Barber.Pq Pa src/release/release.sh 54e8423d00SNathan Whitehornis provided to automate these checkouts and then execute 55e8423d00SNathan Whitehorn.Dq Li "make release" 56e8423d00SNathan Whitehornin a clean 57e8423d00SNathan Whitehorn.Xr chroot 8 . 58e8423d00SNathan Whitehorn.Pp 59de26e0adSMurray StokelyBefore attempting to build a release, the user is expected to be 60994c71f0SMurray Stokelyfamiliar with the contents of 61de26e0adSMurray Stokely.Xr build 7 , 6247280c4bSRuslan Ermilovand should have experience upgrading systems from source. 63e8423d00SNathan Whitehorn.Pp 64de26e0adSMurray StokelyThe release build process requires that 65de26e0adSMurray Stokely.Pa /usr/obj 66de26e0adSMurray Stokelybe populated with the output of 67d408a341SNathan Whitehorn.Dq Li "make buildworld" 68d408a341SNathan Whitehornand 69d408a341SNathan Whitehorn.Dq Li "make buildkernel" . 70e8423d00SNathan WhitehornThis is necessary to provide the object files for the release or, when 71e8423d00SNathan Whitehornusing 72ebe27856SGlen Barber.Pa release.sh , 73e8423d00SNathan Whitehornso that the object files for a complete system can be installed into a clean 74de26e0adSMurray Stokely.Xr chroot 8 75ebe27856SGlen Barberenvironment. 76ebe27856SGlen Barber.Pp 77ebe27856SGlen BarberIf the target release build is for a different architecture or machine type, 78ebe27856SGlen Barberthe 79ebe27856SGlen Barber.Va TARGET 80ebe27856SGlen Barberand 81ebe27856SGlen Barber.Va TARGET_ARCH 82ebe27856SGlen Barbervariables must be used. 83ebe27856SGlen BarberSee the supported 84ebe27856SGlen Barber.Fa release.conf 85ebe27856SGlen Barbervariables for more information. 86ebe27856SGlen Barber.Pp 87e8423d00SNathan WhitehornThe release procedure on some architectures may also require that the 88994c71f0SMurray Stokely.Xr md 4 89994c71f0SMurray Stokely(memory disk) device driver be present in the kernel 90ebe27856SGlen Barber.Pq either by being compiled in or available as a module . 91de26e0adSMurray Stokely.Pp 92de26e0adSMurray StokelyThis document does not cover source code management, quality 93de26e0adSMurray Stokelyassurance, or other aspects of the release engineering process. 94e8423d00SNathan Whitehorn.Sh CLEAN RELEASE GENERATION 95ebe27856SGlen BarberOfficial releases of 96ebe27856SGlen Barber.Fx 9755c9a224SEd Masteare produced in a clean environment to 98e8423d00SNathan Whitehornensure consistency between the versions of the src, ports, and doc trees 99ebe27856SGlen Barberand to avoid contamination from the host system 100ebe27856SGlen Barber.Po such as local patches, changes 101e8423d00SNathan Whitehornto 102e8423d00SNathan Whitehorn.Xr make.conf 5 , 103ebe27856SGlen Barberetc. 104ebe27856SGlen Barber.Pc . 105ebe27856SGlen BarberThis is accomplished using the wrapper script 106ebe27856SGlen Barber.Pa src/release/release.sh . 107e8423d00SNathan Whitehorn.Pp 108ebe27856SGlen Barber.Ic release.sh 109ebe27856SGlen Barber.Op Fl c Ar release.conf 110e8423d00SNathan Whitehorn.Pp 111ebe27856SGlen Barber.Ic release.sh 112ebe27856SGlen Barberchecks out the 113ebe27856SGlen Barber.Li src/ , 114ebe27856SGlen Barber.Li ports/ , 115ebe27856SGlen Barberand 116ebe27856SGlen Barber.Li doc/ 117ebe27856SGlen Barbertrees to 118ebe27856SGlen Barber.Va CHROOTDIR , 119ebe27856SGlen Barberthen calls 120ebe27856SGlen Barber.Dq Li "make buildworld" 121ebe27856SGlen Barberand 122e8423d00SNathan Whitehorn.Dq Li "make installworld" 123e8423d00SNathan Whitehornto generate a 124e8423d00SNathan Whitehorn.Xr chroot 8 125ebe27856SGlen Barberenvironment. 126ebe27856SGlen BarberNext, 127e8423d00SNathan Whitehorn.Dq Li "make release" 128ebe27856SGlen Barberis run within the 129e8423d00SNathan Whitehorn.Xr chroot 8 130e8423d00SNathan Whitehornenvironment and places the result in 131ebe27856SGlen Barber.Pa $CHROOTDIR/R . 132e8423d00SNathan Whitehorn.Pp 133ebe27856SGlen BarberThe optional 134ebe27856SGlen Barber.Fa release.conf 135ebe27856SGlen Barberconfiguration file supports the following variables: 136ebe27856SGlen Barber.Bl -tag -width Ev 137ebe27856SGlen Barber.It Va CHROOTDIR 138ebe27856SGlen BarberThe directory within which the release will be built. 139e0436612SGlen Barber.It Va CHROOT_MAKEENV 140e0436612SGlen BarberAdditional 141e0436612SGlen Barber.Xr make 1 142e0436612SGlen Barberarguments to pass through, which directly affect the 143e0436612SGlen Barbertuning of the build chroot. 144de415e66SAlan Somers.It Va NOGIT 145de415e66SAlan SomersDo not explicitly require the 146de415e66SAlan Somers.Xr git 1 147de415e66SAlan Somersport to be installed. 148f695e960SDaniel Ebdrup Jensen.It Va GITROOT 149ebe27856SGlen BarberThe 150f695e960SDaniel Ebdrup Jensen.Xr git 1 151ebe27856SGlen Barberhost used to check out the various trees. 152ebe27856SGlen BarberDefaults to 153*a3d5dec4SDoug Rabson.Pa https://git.FreeBSD.org . 154ebe27856SGlen Barber.It Va SRCBRANCH 155ebe27856SGlen BarberThe 156ebe27856SGlen Barber.Li src/ 157ebe27856SGlen Barberbranch to use. 158ebe27856SGlen BarberDefaults to 159f695e960SDaniel Ebdrup Jensen.Fl b Va main . 160ebe27856SGlen Barber.It Va PORTBRANCH 161ebe27856SGlen BarberThe 162ebe27856SGlen Barber.Li ports/ 163ebe27856SGlen Barberbranch to use. 164ebe27856SGlen BarberDefaults to 165bda59883SGlen Barber.Va head/@rHEAD . 166ebe27856SGlen Barber.It Va TARGET 167bc1af85cSGlen BarberThe target machine type for cross-building a release. 168ebe27856SGlen Barber.It Va TARGET_ARCH 169bc1af85cSGlen BarberThe target machine architecture for cross-building a release. 170ebe27856SGlen Barber.Pp 171ebe27856SGlen BarberFor the supported list of 172ebe27856SGlen Barber.Va TARGET 173ebe27856SGlen Barberand 174ebe27856SGlen Barber.Va TARGET_ARCH 175ebe27856SGlen Barbercombinations, consult the output of 176ebe27856SGlen Barber.Dq make targets 177ebe27856SGlen Barberas documented in 178ebe27856SGlen Barber.Xr build 7 . 179ebe27856SGlen Barber.It Va KERNEL 180ebe27856SGlen BarberThe target kernel configuration to use. 181ebe27856SGlen BarberDefaults to 182ebe27856SGlen Barber.Va GENERIC . 183ebe27856SGlen BarberMultiple 184ebe27856SGlen Barber.Va KERNEL 185ebe27856SGlen Barberentries may be specified. 186ebe27856SGlen Barber.It Va MAKE_CONF 187ebe27856SGlen BarberThe 188ebe27856SGlen Barber.Xr make.conf 5 189ebe27856SGlen Barberto use for the release build. 190ebe27856SGlen BarberDefaults to 191ebe27856SGlen Barber.Fa /dev/null 192ebe27856SGlen Barberto prevent polluting the release with local system changes. 193ebe27856SGlen Barber.It Va SRC_CONF 194ebe27856SGlen BarberThe 195ebe27856SGlen Barber.Xr src.conf 5 196ebe27856SGlen Barberto use for the release build. 197ebe27856SGlen BarberDefaults to 198ebe27856SGlen Barber.Fa /dev/null 199ebe27856SGlen Barberto prevent polluting the release with local system changes. 200ebe27856SGlen Barber.It Va MAKE_FLAGS 201ebe27856SGlen BarberAdditional flags to pass to 202ebe27856SGlen Barber.Xr make 1 . 203ebe27856SGlen Barber.It Va WORLD_FLAGS 204ebe27856SGlen BarberAdditional flags to pass to 205e8423d00SNathan Whitehorn.Xr make 1 206ebe27856SGlen Barberduring the 207ebe27856SGlen Barber.Dq buildworld 208ebe27856SGlen Barberphase. 209ebe27856SGlen BarberDefaults to setting the number of 210de17cbccSHiroki Sato.Xr make 1 211ebe27856SGlen Barberjobs 212ebe27856SGlen Barber.Pq Ar -j 213bc1af85cSGlen Barberto the number of CPUs available on a SMP-capable system. 214ebe27856SGlen Barber.It Va KERNEL_FLAGS 215ebe27856SGlen BarberAdditional flags to pass to 216ebe27856SGlen Barber.Xr make 1 217ebe27856SGlen Barberduring the 218ebe27856SGlen Barber.Dq buildkernel 219ebe27856SGlen Barberphase. 220ebe27856SGlen BarberDefaults to setting the number of 221ebe27856SGlen Barber.Xr make 1 222ebe27856SGlen Barberjobs 223ebe27856SGlen Barber.Pq Ar -j 224bc1af85cSGlen Barberto half the number of CPUs available on a SMP-capable system. 225ebe27856SGlen Barber.It Va NOPORTS 226ebe27856SGlen BarberSet to a non-empty value to skip the 227ebe27856SGlen Barber.Li ports/ 228ebe27856SGlen Barbertree checkout. 229ebe27856SGlen BarberWhen set, 230ebe27856SGlen Barber.Va NOPORTS 231ebe27856SGlen Barberwill prevent the 232ebe27856SGlen Barber.Fa ports.txz 233ebe27856SGlen Barberdistribution package from being created. 234f7f650c7SGlen Barber.It Va WITH_DVD 235f7f650c7SGlen BarberSet to a non-empty value to include the 236f7f650c7SGlen Barber.Cm dvdrom 237f7f650c7SGlen Barbertarget. 238cbc0e08aSGlen Barber.It Va WITH_COMPRESSED_IMAGES 239cbc0e08aSGlen BarberSet to a non-empty value to compress the release images with 24055af5cf1SGlen Barber.Xr xz 1 . 241cbc0e08aSGlen BarberThe original 242cbc0e08aSGlen Barber.Pq uncompressed 243cbc0e08aSGlen Barberimages are not removed. 2447a07bd46SGlen Barber.It Va XZ_THREADS Pq Vt int 2457a07bd46SGlen BarberSet to the number of threads 2467a07bd46SGlen Barber.Xr xz 1 2477a07bd46SGlen Barbershould use when compressing images. 2487a07bd46SGlen BarberBy default, 2497a07bd46SGlen Barber.Va XZ_THREADS 250a79d18b7SGlen Barberis set to 251a79d18b7SGlen Barber.Va 0 , 252a79d18b7SGlen Barberwhich uses all available cores on the system. 2539bb84a63SGlen Barber.It Va VCSCMD 2549bb84a63SGlen BarberThe command run to obtain the source trees. 2559bb84a63SGlen BarberDefaults to 256f695e960SDaniel Ebdrup Jensen.Qq Cm git clone Fl q . 257e0436612SGlen Barber.It Va CHROOTBUILD_SKIP 258e0436612SGlen BarberIf defined, the 259e0436612SGlen Barber.Li buildworld , 260e0436612SGlen Barber.Li installworld , 261e0436612SGlen Barberand 262e0436612SGlen Barber.Li distribution 263e0436612SGlen Barberstages of the 264e0436612SGlen Barber.Xr chroot 8 265e0436612SGlen Barberbuild environment setup are skipped. 266e0436612SGlen BarberThis is intended solely for cases where the 267e0436612SGlen Barber.Xr chroot 8 268e0436612SGlen Barberuserland are provided by alternate means. 2693e64b4c5SGlen Barber.It Va SRC_UPDATE_SKIP 2703e64b4c5SGlen BarberSet to a non-empty value to prevent checkout or update of 2713e64b4c5SGlen Barber.Fa /usr/src 2723e64b4c5SGlen Barberwithin the 2733e64b4c5SGlen Barber.Xr chroot 8 . 2743e64b4c5SGlen BarberThis is intended for use only when 2753e64b4c5SGlen Barber.Fa /usr/src 2763e64b4c5SGlen Barberis expected to exist by alternative means. 2773e64b4c5SGlen Barber.It Va PORTS_UPDATE_SKIP 2783e64b4c5SGlen BarberSet to a non-empty value to prevent checkout or update of 2793e64b4c5SGlen Barber.Fa /usr/ports 2803e64b4c5SGlen Barberwithin the 2813e64b4c5SGlen Barber.Xr chroot 8 . 2823e64b4c5SGlen BarberThis is intended for use only when 2833e64b4c5SGlen Barber.Fa /usr/ports 2843e64b4c5SGlen Barberis expected to exist by alternative means. 285e0436612SGlen Barber.El 286e0436612SGlen Barber.Sh EMBEDDED BUILDS 287e0436612SGlen BarberThe following 288e0436612SGlen Barber.Fa release.conf 289e0436612SGlen Barbervariables are relevant only to release builds for embedded systems: 290e0436612SGlen Barber.Bl -tag -width Ev 291e0436612SGlen Barber.It Va EMBEDDEDBUILD 292e0436612SGlen BarberSet to a non-null value to enable functionality for embedded device 293e0436612SGlen Barberrelease builds. 294e0436612SGlen Barber.Pp 295e0436612SGlen BarberWhen set, 296e0436612SGlen Barber.Va WITH_DVD 297f695e960SDaniel Ebdrup Jensenis unset. 298e0436612SGlen BarberAdditionally, 29920772e47SGlen Barber.Va EMBEDDED_TARGET 300e0436612SGlen Barberand 30120772e47SGlen Barber.Va EMBEDDED_TARGET_ARCH 302e0436612SGlen Barbermust also be defined. 303e0436612SGlen BarberWhen the build environment is created, 304e0436612SGlen Barber.Fa release.sh 305e0436612SGlen Barberruns a separate build script located in an architecture-specific 306e0436612SGlen Barberdirectory in 30720772e47SGlen Barber.Pa src/release/${EMBEDDED_TARGET}/ . 308e0436612SGlen Barber.It Va EMBEDDEDPORTS 309e0436612SGlen BarberSet to the list of any ports that are required for the target device 310e0436612SGlen Barberin the format of 311e0436612SGlen Barber.Fa category/port . 31220772e47SGlen Barber.It Va EMBEDDED_TARGET 31320772e47SGlen BarberWhen set, its value is passed to 31420772e47SGlen Barber.Xr make 1 31520772e47SGlen Barberto set the 31620772e47SGlen Barber.Va TARGET 31720772e47SGlen Barber.Pq value of Cm uname Fl m 31820772e47SGlen Barberto cross build the target userland. 31920772e47SGlen Barber.It Va EMBEDDED_TARGET_ARCH 32020772e47SGlen BarberWhen set, its value is passed to 32120772e47SGlen Barber.Xr make 1 32220772e47SGlen Barberto set the 32320772e47SGlen Barber.Va TARGET_ARCH 32420772e47SGlen Barber.Pq value of Cm uname Fl p 32520772e47SGlen Barberto cross build the target userland. 326e8423d00SNathan Whitehorn.El 327a8c229a5SGlen Barber.Sh VIRTUAL MACHINE DISK IMAGES 328a8c229a5SGlen BarberThe following 329a8c229a5SGlen Barber.Fa release.conf 330a8c229a5SGlen Barbervariables are relevant only to virtual machine disk image builds: 331a8c229a5SGlen Barber.Bl -tag -width Ev 332a8c229a5SGlen Barber.It Va WITH_VMIMAGES 333a8c229a5SGlen BarberSet to a non-null value to build virtual machine disk images as part 334a8c229a5SGlen Barberof the release build. 335a8c229a5SGlen Barber.Va WITH_VMIMAGES 33641ad38efSMark Johnstonmay also be specified as an environment variable passed to 337a8c229a5SGlen Barber.Xr make 1 . 338a8c229a5SGlen Barber.It Va WITH_COMPRESSED_VMIMAGES 339a8c229a5SGlen BarberSet to a non-null value to compress the virtual machine disk images with 340a8c229a5SGlen Barber.Xr xz 1 341a8c229a5SGlen Barberas part of the 342a8c229a5SGlen Barber.Cm install 343a8c229a5SGlen Barber.Xr make 1 344a8c229a5SGlen Barbertarget. 345a8c229a5SGlen BarberNote that compressing virtual machine disk images may take a very long 346a8c229a5SGlen Barbertime on some systems. 347a8c229a5SGlen Barber.It Va VMBASE 348a8c229a5SGlen BarberSet to change the name of the resulting virtual machine disk image file. 349a8c229a5SGlen BarberThe default value is 350a8c229a5SGlen Barber.Va vm . 351a8c229a5SGlen Barber.It Va VMSIZE 352a8c229a5SGlen BarberSet to change the size of the virtual machine disk capacity. 353a8c229a5SGlen BarberThe default value is 354fa04db47SGlen Barber.Va 20g . 355a8c229a5SGlen BarberSee 356fa04db47SGlen Barber.Xr makefs 8 357a8c229a5SGlen Barberfor valid values. 358a8c229a5SGlen Barber.Pp 359a8c229a5SGlen BarberVirtual machine disk images are, by default, created as sparse images. 360a8c229a5SGlen BarberWhen 361a8c229a5SGlen Barber.Va WITH_COMPRESSED_VMIMAGES 362a8c229a5SGlen Barberis used, the resulting files compressed with 363a8c229a5SGlen Barber.Xr xz 1 364a8c229a5SGlen Barbercompress to roughly the same size, regardless of the specified disk image 365a8c229a5SGlen Barbersize. 36689585511SMark Johnston.It Va VMFS 36732ae9a6bSColin Percival(Deprecated.) 36832ae9a6bSColin PercivalSet to specify which of the filesystem(s) listed in 36932ae9a6bSColin Percival.Va VMFSLIST 37032ae9a6bSColin Percivalis linked to the historical non-filesystem-labelled file name. 37189585511SMark JohnstonValid values are 37289585511SMark Johnston.Va ufs 37389585511SMark Johnstonand 37489585511SMark Johnston.Va zfs . 37589585511SMark JohnstonThe default value is 37689585511SMark Johnston.Va ufs . 37732ae9a6bSColin Percival.It Va VMFSLIST 37832ae9a6bSColin PercivalSet to specify the list of file system types to build images for. 37932ae9a6bSColin PercivalValid values are one or both of 38032ae9a6bSColin Percival.Va ufs 38132ae9a6bSColin Percivaland 38232ae9a6bSColin Percival.Va zfs . 38332ae9a6bSColin PercivalThe default value is 38432ae9a6bSColin Percival.Va ufs zfs . 385a8c229a5SGlen Barber.It Va VMFORMATS 386a8c229a5SGlen BarberSet to the target virtual disk image format(s) to create. 387a8c229a5SGlen BarberBy default, the 388a8c229a5SGlen Barber.Va vhdf , Va vmdk , Va qcow2 , 389a8c229a5SGlen Barberand 390a8c229a5SGlen Barber.Va raw 391a8c229a5SGlen Barberformats are created. 392a8c229a5SGlen BarberSee 393a8c229a5SGlen Barber.Xr mkimg 1 394745f3064SMark Johnstonfor valid format values. 395a8c229a5SGlen Barber.El 39685311c29SGlen Barber.Pp 39785311c29SGlen BarberFor a list of supported 39885311c29SGlen Barber.Va VMFORMATS 39985311c29SGlen Barbervalues 40085311c29SGlen Barber.Pq including cloud hosting provider formats 40185311c29SGlen Barberalong with a brief description, run: 40285311c29SGlen Barber.Bd -literal -offset indent 40385311c29SGlen Barbercd /usr/src 40485311c29SGlen Barbermake -C release list-vmtargets 40585311c29SGlen Barber.Ed 406b513fff0SGlen Barber.Sh CLOUD HOSTING MACHINE IMAGES 407b513fff0SGlen BarberThe 408b513fff0SGlen Barber.Fx 409b513fff0SGlen Barberrelease build tools support building virtual machine images for various 410b513fff0SGlen Barbercloud hosting providers, each with their own specific configuration to 411b513fff0SGlen Barberinclude support for each hosting provider by default. 412b513fff0SGlen Barber.Pp 413b513fff0SGlen BarberThe following 414b513fff0SGlen Barber.Xr make 1 415b513fff0SGlen Barberenvironment variables are supported: 416b513fff0SGlen Barber.Bl -tag -width Ev 417b513fff0SGlen Barber.It Va CLOUDWARE 418b513fff0SGlen BarberSet to a list of one or more cloud hosting providers, enclosed in quotes. 419b513fff0SGlen BarberRequires 420b513fff0SGlen Barber.Va WITH_CLOUDWARE 421b513fff0SGlen Barberto also be set. 422b513fff0SGlen Barber.It Va WITH_CLOUDWARE 423b513fff0SGlen BarberSet to a non-empty value to enable building virtual machine images 424b513fff0SGlen Barberfor various cloud hosting providers. 425b513fff0SGlen BarberRequires 426b513fff0SGlen Barber.Va CLOUDWARE 427b513fff0SGlen Barberto also be set. 428b513fff0SGlen Barber.El 429b513fff0SGlen Barber.Pp 430b513fff0SGlen BarberAdditionally, the 431b513fff0SGlen Barber.Va CLOUDWARE 432b513fff0SGlen Barberand 433b513fff0SGlen Barber.Va WITH_CLOUDWARE 434b513fff0SGlen Barbervariables can be added to 435b513fff0SGlen Barber.Pa release.conf , 436b513fff0SGlen Barberand used in conjunction with 437b513fff0SGlen Barber.Pa release.sh . 438b513fff0SGlen Barber.Pp 439b513fff0SGlen BarberFor a list of supported 440b513fff0SGlen Barber.Va CLOUDWARE 441b513fff0SGlen Barbervalues, run: 442b513fff0SGlen Barber.Bd -literal -offset indent 443b513fff0SGlen Barbercd /usr/src 444b513fff0SGlen Barbermake -C release list-cloudware 445b513fff0SGlen Barber.Ed 446e8423d00SNathan Whitehorn.Sh MAKEFILE TARGETS 447de26e0adSMurray StokelyThe release makefile 448994c71f0SMurray Stokely.Pq Pa src/release/Makefile 449de26e0adSMurray Stokelyis fairly abstruse. 450de26e0adSMurray StokelyMost developers will only be concerned with the 451afb33690SMurray Stokely.Cm release 452299a8b95SNathan Whitehornand 453299a8b95SNathan Whitehorn.Cm install 454299a8b95SNathan Whitehorntargets. 455994c71f0SMurray Stokely.\" XXX: Some sort of introduction to this list? All the others have one. 456e8423d00SNathan Whitehorn.Bl -tag -width ".Cm packagesystem" 457afb33690SMurray Stokely.It Cm release 458e8423d00SNathan WhitehornMeta-target to build all release media and distributions applicable to this 459299a8b95SNathan Whitehornplatform. 460299a8b95SNathan Whitehorn.It Cm install 461299a8b95SNathan WhitehornCopy all produced release media to 462299a8b95SNathan Whitehorn.Pa ${DESTDIR} . 463e8423d00SNathan Whitehorn.It Cm cdrom 464de17cbccSHiroki SatoBuilds installation CD-ROM images. 465de17cbccSHiroki SatoThis may require the 466e8423d00SNathan Whitehorn.Xr md 4 467e8423d00SNathan Whitehorn(memory disk) device driver be present in the kernel 468de17cbccSHiroki Sato(either by being compiled in or available as a module). 469de17cbccSHiroki SatoThis target produces files called 470ebe27856SGlen Barber.Pa disc1.iso 471299a8b95SNathan Whitehornand 472299a8b95SNathan Whitehorn.Pa bootonly.iso 473e8423d00SNathan Whitehornas its output. 474d7cfbadbSGlen Barber.It Cm dvdrom 475d7cfbadbSGlen BarberBuilds installation DVD-ROM images. 476d7cfbadbSGlen BarberThis may require the 477d7cfbadbSGlen Barber.Xr md 4 478d7cfbadbSGlen Barber(memory disk) device driver be present in the kernel 479d7cfbadbSGlen Barber(either by being compiled in or available as a module). 480d7cfbadbSGlen BarberThis target produces the 481d7cfbadbSGlen Barber.Pa dvd1.iso 482d7cfbadbSGlen Barberfile as its output. 483e8423d00SNathan Whitehorn.It Cm memstick 484e8423d00SNathan WhitehornBuilds an installation memory stick image named 485ebe27856SGlen Barber.Pa memstick.img . 486de17cbccSHiroki SatoNot applicable on all platforms. 487de17cbccSHiroki SatoRequires that the 488e8423d00SNathan Whitehorn.Xr md 4 489ebe27856SGlen Barber.Pq memory disk 490ebe27856SGlen Barberdevice driver be present in the kernel 491ebe27856SGlen Barber.Pq either by being compiled in or available as a module . 49216fb00c1SGlen Barber.It Cm mini-memstick 49316fb00c1SGlen BarberSimilar to 49416fb00c1SGlen Barber.Cm memstick , 49516fb00c1SGlen Barberwith the exception that the installation distribution sets 49616fb00c1SGlen Barberare not included. 497e8423d00SNathan Whitehorn.It Cm ftp 498e8423d00SNathan WhitehornCreates a directory named 499e8423d00SNathan Whitehorn.Pa ftp 500e8423d00SNathan Whitehorncontaining the distribution files used in network installations 501e8423d00SNathan Whitehornand suitable for upload to an FTP mirror. 502a8c229a5SGlen Barber.It Cm vm-image 503a8c229a5SGlen BarberCreates virtual machine disk images in various formats. 504a8c229a5SGlen BarberThe 505a8c229a5SGlen Barber.Cm vm-image 506a8c229a5SGlen Barbertarget requires the 507a8c229a5SGlen Barber.Va WITH_VMIMAGES 508a8c229a5SGlen Barber.Xr make 1 50941ad38efSMark Johnstonenvironment variable to be set to a non-null value. 510b513fff0SGlen Barber.It Cm vm-cloudware 511b513fff0SGlen BarberBuilds 512b513fff0SGlen Barber.Fx 513b513fff0SGlen Barbervirtual machine images for various cloud hosting providers. 514b513fff0SGlen BarberSee 515b513fff0SGlen Barber.Qq CLOUD HOSTING MACHINE IMAGES 516b513fff0SGlen Barberfor implementation details. 517b513fff0SGlen Barber.It Cm list-cloudware 518b513fff0SGlen BarberDisplays the list of valid 519b513fff0SGlen Barber.Va CLOUDWARE 520b513fff0SGlen Barbervalues. 52185311c29SGlen Barber.It Cm list-vmtargets 52285311c29SGlen BarberDisplays the list of valid 52396bc40f4SMark Johnston.Va VMFORMATS 52485311c29SGlen Barberand 52585311c29SGlen Barber.Va CLOUDWARE 52685311c29SGlen Barbervalues. 527de26e0adSMurray Stokely.El 528de26e0adSMurray Stokely.Pp 529e8423d00SNathan WhitehornMajor subtargets called by targets above: 530e8423d00SNathan Whitehorn.Bl -tag -width ".Cm packagesystem" 531e8423d00SNathan Whitehorn.It Cm packagesystem 532ebe27856SGlen BarberGenerates all the distribution archives 533ebe27856SGlen Barber.Pq base, kernel, ports, doc 534e8423d00SNathan Whitehornapplicable on this platform. 53547176cacSGlen Barber.It Cm disc1 536e8423d00SNathan WhitehornBuilds a bootable installation system containing all the distribution files 537e8423d00SNathan Whitehornpackaged by the 538e8423d00SNathan Whitehorn.Cm packagesystem 539e8423d00SNathan Whitehorntarget, and suitable for imaging by the 540d7cfbadbSGlen Barber.Cm cdrom , 541d7cfbadbSGlen Barber.Cm dvdrom 542e8423d00SNathan Whitehornand 543e8423d00SNathan Whitehorn.Cm memstick 544e8423d00SNathan Whitehorntargets. 545e8423d00SNathan Whitehorn.It Cm reldoc 546994c71f0SMurray StokelyBuilds the release documentation. 547994c71f0SMurray StokelyThis includes the release notes, 548ebe27856SGlen Barberhardware guide, and installation instructions. 549ebe27856SGlen BarberOther documentation, such as the Handbook, 550ebe27856SGlen Barberis built during the 551e8423d00SNathan Whitehorn.Cm base.txz 552e8423d00SNathan Whitehorntarget invoked by 553e8423d00SNathan Whitehorn.Cm packagesystem . 554de26e0adSMurray Stokely.El 555de26e0adSMurray Stokely.Sh ENVIRONMENT 556de26e0adSMurray StokelyOptional variables: 557de17cbccSHiroki Sato.Bl -tag -width ".Ev TARGET_ARCH" 558de17cbccSHiroki Sato.It Ev OSRELEASE 5592e67e6ffSGlen BarberOptional base name for generated media images when invoking the 5602e67e6ffSGlen Barber.Cm install 5612e67e6ffSGlen Barbertarget 5622e67e6ffSGlen Barber.Pq e.g., FreeBSD-12.1-RELEASE-amd64 . 563de17cbccSHiroki SatoDefaults to the output of 564de17cbccSHiroki Sato.Ic `uname -s`-`uname -r`-`uname -p` 565de17cbccSHiroki Satowithin the chroot. 566de17cbccSHiroki Sato.It Ev WORLDDIR 567ebe27856SGlen BarberLocation of a directory containing the src tree. 568ebe27856SGlen BarberBy default, the directory 569e8423d00SNathan Whitehornabove the one containing the makefile 570e8423d00SNathan Whitehorn.Pq Pa src . 571de17cbccSHiroki Sato.It Ev PORTSDIR 572ebe27856SGlen BarberLocation of a directory containing the ports tree. 573ebe27856SGlen BarberBy default, 574e8423d00SNathan Whitehorn.Pa /usr/ports . 575e8423d00SNathan WhitehornIf it is unset or cannot be found, ports will not be included in the release. 576de17cbccSHiroki Sato.It Ev NOPORTS 577e8423d00SNathan WhitehornIf defined, the Ports Collection will be omitted from the release. 578de17cbccSHiroki Sato.It Ev NOSRC 579e8423d00SNathan WhitehornIf set, do not include system source code in the release. 580de17cbccSHiroki Sato.It Ev TARGET 58125923b97SRuslan ErmilovThe target hardware platform. 58225923b97SRuslan ErmilovThis is analogous to the 58325923b97SRuslan Ermilov.Dq Nm uname Fl m 58425923b97SRuslan Ermilovoutput. 58525923b97SRuslan ErmilovThis is necessary to cross-build some target architectures. 5862f6a7e42SEnji CooperFor example, cross-building for ARM64 machines requires 5872f6a7e42SEnji Cooper.Ev TARGET_ARCH Ns = Ns Li aarch64 58825923b97SRuslan Ermilovand 5892f6a7e42SEnji Cooper.Ev TARGET Ns = Ns Li arm64 . 590e8423d00SNathan WhitehornIf not set, 591de17cbccSHiroki Sato.Ev TARGET 592e8423d00SNathan Whitehorndefaults to the current hardware platform. 593de17cbccSHiroki Sato.It Ev TARGET_ARCH 594e8423d00SNathan WhitehornThe target machine processor architecture. 595e8423d00SNathan WhitehornThis is analogous to the 596e8423d00SNathan Whitehorn.Dq Nm uname Fl p 597e8423d00SNathan Whitehornoutput. 598e8423d00SNathan WhitehornSet this to cross-build for a different architecture. 599e8423d00SNathan WhitehornIf not set, 600de17cbccSHiroki Sato.Ev TARGET_ARCH 601e8423d00SNathan Whitehorndefaults to the current machine architecture, unless 602de17cbccSHiroki Sato.Ev TARGET 603e8423d00SNathan Whitehornis also set, in which case it defaults to the appropriate 604e8423d00SNathan Whitehornvalue for that platform. 605e8423d00SNathan WhitehornTypically, one only needs to set 606de17cbccSHiroki Sato.Ev TARGET . 607de26e0adSMurray Stokely.El 608de26e0adSMurray Stokely.Sh FILES 60982f39c10SGlen Barber.Bl -tag -compact -width Pa 610de26e0adSMurray Stokely.It Pa /usr/doc/Makefile 611de26e0adSMurray Stokely.It Pa /usr/doc/share/mk/doc.project.mk 612de26e0adSMurray Stokely.It Pa /usr/ports/Mk/bsd.port.mk 613de26e0adSMurray Stokely.It Pa /usr/ports/Mk/bsd.sites.mk 614de26e0adSMurray Stokely.It Pa /usr/share/examples/etc/make.conf 615de26e0adSMurray Stokely.It Pa /usr/src/Makefile 616de26e0adSMurray Stokely.It Pa /usr/src/Makefile.inc1 617de26e0adSMurray Stokely.It Pa /usr/src/release/Makefile 618b513fff0SGlen Barber.It Pa /usr/src/release/Makefile.vm 619ebe27856SGlen Barber.It Pa /usr/src/release/release.sh 620ebe27856SGlen Barber.It Pa /usr/src/release/release.conf.sample 621b513fff0SGlen Barber.It Pa /usr/src/release/tools/*.conf 622b513fff0SGlen Barber.It Pa /usr/src/release/tools/vmimage.subr 623de26e0adSMurray Stokely.El 624de26e0adSMurray Stokely.Sh EXAMPLES 625e8423d00SNathan WhitehornThe following sequence of commands can be used to build a 626e8423d00SNathan Whitehorn.Dq "-CURRENT snapshot": 627de26e0adSMurray Stokely.Bd -literal -offset indent 628de26e0adSMurray Stokelycd /usr 629ef1a1fc7SDaniel Ebdrup Jensengit clone -b main https://git.freebsd.org/src.git src 630de26e0adSMurray Stokelycd src 631d408a341SNathan Whitehornmake buildworld buildkernel 632de26e0adSMurray Stokelycd release 6332e67e6ffSGlen Barbermake obj 6348ef63d0dSNathan Whitehornmake release 6358ef63d0dSNathan Whitehornmake install DESTDIR=/var/freebsd-snapshot 636de26e0adSMurray Stokely.Ed 637de26e0adSMurray Stokely.Pp 638299a8b95SNathan WhitehornAfter running these commands, all produced distribution files (tarballs 639299a8b95SNathan Whitehornfor FTP, CD-ROM images, etc.) are available in the 640299a8b95SNathan Whitehorn.Pa /var/freebsd-snapshot 641de26e0adSMurray Stokelydirectory. 642de26e0adSMurray Stokely.Pp 643994c71f0SMurray StokelyThe following sequence of commands can be used to build a 6441bcf2f1aSMurray Stokely.Dq "-CURRENT snapshot" 645e8423d00SNathan Whitehornin a clean environment, including ports and documentation: 646de26e0adSMurray Stokely.Bd -literal -offset indent 6475af5af75SGleb Smirnoffcd /usr/src/release 648ebe27856SGlen Barbersh release.sh 649ebe27856SGlen Barber.Ed 650ebe27856SGlen Barber.Pp 651d3d60927SMateusz PiotrowskiOptionally, a configuration file can be used to customize the release build: 652ebe27856SGlen Barber.Bd -literal -offset indent 653ebe27856SGlen Barbercd /usr/src/release 654ebe27856SGlen Barbersh release.sh -c $HOME/release.conf 655de26e0adSMurray Stokely.Ed 656e8423d00SNathan Whitehorn.Pp 6570e976a76SGlen BarberConfiguration files specific to various supported embedded systems, such as 6580e976a76SGlen Barberthe Raspberry Pi, exist in the directory corresponding to the 6590e976a76SGlen Barber.Va TARGET 6600e976a76SGlen Barber.Xr make 1 6610e976a76SGlen Barbervariable. 6620e976a76SGlen BarberFor example, to build an image for the Raspberry Pi: 6630e976a76SGlen Barber.Bd -literal -offset indent 6640e976a76SGlen Barbercd /usr/src/release 6650e976a76SGlen Barbersh release.sh -c arm/RPI-B.conf 6660e976a76SGlen Barber.Ed 6670e976a76SGlen Barber.Pp 6680e976a76SGlen BarberTo build an image for the Raspberry Pi 3: 6690e976a76SGlen Barber.Bd -literal -offset indent 6700e976a76SGlen Barbercd /usr/src/release 6710e976a76SGlen Barbersh release.sh -c arm64/RPI3.conf 6720e976a76SGlen Barber.Ed 6730e976a76SGlen Barber.Pp 674e8423d00SNathan WhitehornAfter running these commands, all prepared release files are available in the 675ebe27856SGlen Barber.Pa /scratch 676e8423d00SNathan Whitehorndirectory. 677ebe27856SGlen BarberThe target directory can be changed by specifying the 678ebe27856SGlen Barber.Va CHROOTDIR 679ebe27856SGlen Barbervariable in 680ebe27856SGlen Barber.Li release.conf . 681f695e960SDaniel Ebdrup Jensen.Sh COMPATIBILITY 682f695e960SDaniel Ebdrup JensenThe reldoc target was removed in commit f61e92ca5a23, and 683f695e960SDaniel Ebdrup Jensen.Ev DOCDIR , 684f695e960SDaniel Ebdrup Jensen.Ev DOCBRANCH , 685f695e960SDaniel Ebdrup Jensen.Ev DOC_UPDATE_SKIP , 686f695e960SDaniel Ebdrup Jensenand 687f695e960SDaniel Ebdrup Jensen.Ev NODOC 688f695e960SDaniel Ebdrup Jensenare therefore no longer supported. 689de26e0adSMurray Stokely.Sh SEE ALSO 690de26e0adSMurray Stokely.Xr cc 1 , 691f695e960SDaniel Ebdrup Jensen.Xr git 1 Pq Pa ports/devel/git , 692de26e0adSMurray Stokely.Xr install 1 , 693de26e0adSMurray Stokely.Xr make 1 , 694745f3064SMark Johnston.Xr mkimg 1 , 695de26e0adSMurray Stokely.Xr uname 1 , 696afb33690SMurray Stokely.Xr md 4 , 697de26e0adSMurray Stokely.Xr make.conf 5 , 698de26e0adSMurray Stokely.Xr build 7 , 699de26e0adSMurray Stokely.Xr ports 7 , 700afb33690SMurray Stokely.Xr chroot 8 , 701f5178c4fSMurray Stokely.Xr mtree 8 , 702f5178c4fSMurray Stokely.Xr sysctl 8 703994c71f0SMurray Stokely.Rs 7041bcf2f1aSMurray Stokely.%T "FreeBSD Release Engineering" 705c1a14887SCeri Davies.%U https://docs.freebsd.org/en/articles/freebsd-releng/ 706994c71f0SMurray Stokely.Re 707994c71f0SMurray Stokely.Rs 7081bcf2f1aSMurray Stokely.%T "FreeBSD Developers' Handbook" 709c1a14887SCeri Davies.%U https://docs.freebsd.org/en/books/developers-handbook/ 710994c71f0SMurray Stokely.Re 711de26e0adSMurray Stokely.Sh HISTORY 712de26e0adSMurray Stokely.Fx 713de26e0adSMurray Stokely1.x 7141bcf2f1aSMurray Stokelyused a manual checklist, compiled by 7151bcf2f1aSMurray Stokely.An Rod Grimes , 7161bcf2f1aSMurray Stokelyto produce a release. 717de26e0adSMurray StokelyApart from being incomplete, the list put a lot of specific demands on 718de26e0adSMurray Stokelyavailable file systems and was quite torturous to execute. 719de26e0adSMurray Stokely.Pp 720994c71f0SMurray StokelyAs part of the 721994c71f0SMurray Stokely.Fx 2.0 722994c71f0SMurray Stokelyrelease engineering effort, significant 723de26e0adSMurray Stokelyeffort was spent getting 724de26e0adSMurray Stokely.Pa src/release/Makefile 725de26e0adSMurray Stokelyinto a shape where it could at least automate most of the tediousness 726de26e0adSMurray Stokelyof building a release in a sterile environment. 727de26e0adSMurray Stokely.Pp 728e8423d00SNathan WhitehornFor the 729e8423d00SNathan Whitehorn.Fx 9.0 730e8423d00SNathan Whitehornrelease, 731e8423d00SNathan Whitehorn.Pa src/release/Makefile 732e8423d00SNathan Whitehornwas overhauled and the wrapper script 733e8423d00SNathan Whitehorn.Pa src/release/generate-release.sh 734e8423d00SNathan Whitehornintroduced to support the introduction of a new installer. 735e8423d00SNathan Whitehorn.Pp 736ebe27856SGlen BarberFor the 737ebe27856SGlen Barber.Fx 9.2 738ebe27856SGlen Barberrelease, 739ebe27856SGlen Barber.Pa src/release/release.sh 740ebe27856SGlen Barberwas introduced to support per-build configuration files. 741ebe27856SGlen Barber.Pa src/release/release.sh 742ebe27856SGlen Barberis heavily based on the 743ebe27856SGlen Barber.Pa src/release/generate-release.sh 744ebe27856SGlen Barberscript. 745ebe27856SGlen Barber.Pp 746594ca9baSTom RhodesAt near 1000 revisions spread over multiple branches, the 747f695e960SDaniel Ebdrup Jensen.Xr git 1 748994c71f0SMurray Stokelylog of 749994c71f0SMurray Stokely.Pa src/release/Makefile 750994c71f0SMurray Stokelycontains a vivid historical record of some 751de26e0adSMurray Stokelyof the hardships release engineers go through. 752de26e0adSMurray Stokely.Sh AUTHORS 753de26e0adSMurray Stokely.Pa src/release/Makefile 754afb33690SMurray Stokelywas originally written by 755afb33690SMurray Stokely.An -nosplit 756afb33690SMurray Stokely.An Rod Grimes , 757afb33690SMurray Stokely.An Jordan Hubbard , 758afb33690SMurray Stokelyand 759afb33690SMurray Stokely.An Poul-Henning Kamp . 760ebe27856SGlen Barber.Pp 761ebe27856SGlen BarberThis manual page was originally written by 762a63d6c94SBaptiste Daroussin.An Murray Stokely Aq Mt murray@FreeBSD.org . 763ebe27856SGlen Barber.Pp 764ebe27856SGlen BarberIt was updated by 765a63d6c94SBaptiste Daroussin.An Nathan Whitehorn Aq Mt nwhitehorn@FreeBSD.org 766ebe27856SGlen Barberto include the 767ebe27856SGlen Barber.Fa generate-release.sh 768ebe27856SGlen Barberscript used for the 769ebe27856SGlen Barber.Fx 9.0 770ebe27856SGlen Barberrelease cycle. 771ebe27856SGlen Barber.Pp 772ebe27856SGlen BarberIt was later updated by 773a63d6c94SBaptiste Daroussin.An Glen Barber Aq Mt gjb@FreeBSD.org 774ebe27856SGlen Barberto include the 775ebe27856SGlen Barber.Fa release.sh 776ebe27856SGlen Barberscript used for the 777ebe27856SGlen Barber.Fx 9.2 778ebe27856SGlen Barberrelease cycle. 779