xref: /freebsd/share/man/man7/development.7 (revision 2541dcaf4430a7d732c73b8f9190791e85c79b1c)
1bdfc6e62SEdward Tomasz Napierala.\" Copyright (c) 2018 Edward Tomasz Napierala <trasz@FreeBSD.org>
25ecb12e3SWarner Losh.\"
35ecb12e3SWarner Losh.\" Redistribution and use in source and binary forms, with or without
45ecb12e3SWarner Losh.\" modification, are permitted provided that the following conditions
55ecb12e3SWarner Losh.\" are met:
65ecb12e3SWarner Losh.\" 1. Redistributions of source code must retain the above copyright
75ecb12e3SWarner Losh.\"    notice, this list of conditions and the following disclaimer.
85ecb12e3SWarner Losh.\" 2. Redistributions in binary form must reproduce the above copyright
95ecb12e3SWarner Losh.\"    notice, this list of conditions and the following disclaimer in the
105ecb12e3SWarner Losh.\"    documentation and/or other materials provided with the distribution.
115ecb12e3SWarner Losh.\"
12bdfc6e62SEdward Tomasz Napierala.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
135ecb12e3SWarner Losh.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
145ecb12e3SWarner Losh.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15bdfc6e62SEdward Tomasz Napierala.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
165ecb12e3SWarner Losh.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
175ecb12e3SWarner Losh.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
185ecb12e3SWarner Losh.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
195ecb12e3SWarner Losh.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
205ecb12e3SWarner Losh.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
215ecb12e3SWarner Losh.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
225ecb12e3SWarner Losh.\" SUCH DAMAGE.
236ed033beSMatthew Dillon.\"
246ed033beSMatthew Dillon.\" $FreeBSD$
256ed033beSMatthew Dillon.\"
26*2541dcafSLi-Wen Hsu.Dd August 18, 2022
276ed033beSMatthew Dillon.Dt DEVELOPMENT 7
286ed033beSMatthew Dillon.Os
296ed033beSMatthew Dillon.Sh NAME
306ed033beSMatthew Dillon.Nm development
315596cb94SEdward Tomasz Napierala.Nd introduction to
325596cb94SEdward Tomasz Napierala.Fx
335596cb94SEdward Tomasz Napieraladevelopment process
346ed033beSMatthew Dillon.Sh DESCRIPTION
3548096bb3SMatthew Dillon.Fx
36b578d2a7SCeri Daviesdevelopment is split into three major subprojects: doc, ports, and src.
375596cb94SEdward Tomasz NapieralaDoc is the documentation, such as the
385596cb94SEdward Tomasz Napierala.Fx
395596cb94SEdward Tomasz NapieralaHandbook.
40bdfc6e62SEdward Tomasz NapieralaTo read more, see:
416ed033beSMatthew Dillon.Pp
42*2541dcafSLi-Wen Hsu.Lk https://docs.FreeBSD.org/en/books/fdp-primer/
436ed033beSMatthew Dillon.Pp
44bdfc6e62SEdward Tomasz NapieralaPorts, described further in
45bdfc6e62SEdward Tomasz Napierala.Xr ports 7 ,
46bdfc6e62SEdward Tomasz Napieralaare the way to build, package, and install third party software.
47bdfc6e62SEdward Tomasz NapieralaTo read more, see:
486ed033beSMatthew Dillon.Pp
49*2541dcafSLi-Wen Hsu.Lk https://docs.FreeBSD.org/en/books/porters-handbook/
506ed033beSMatthew Dillon.Pp
51bdfc6e62SEdward Tomasz NapieralaThe last one, src, revolves around the source code for the base system,
52bdfc6e62SEdward Tomasz Napieralaconsisting of the kernel, and the libraries and utilities commonly called
53bdfc6e62SEdward Tomasz Napieralathe world.
5448096bb3SMatthew Dillon.Pp
55bdfc6e62SEdward Tomasz NapieralaThe Committer's Guide, describing topics relevant to all committers,
56bdfc6e62SEdward Tomasz Napieralacan be found at:
576ed033beSMatthew Dillon.Pp
58*2541dcafSLi-Wen Hsu.Lk https://docs.freebsd.org/en/articles/committers-guide/
596ed033beSMatthew Dillon.Pp
605596cb94SEdward Tomasz Napierala.Fx
61d28cbb79SEdward Tomasz Napieralasrc development takes place in the project-hosted
62d28cbb79SEdward Tomasz NapieralaGit repository, located at:
636ed033beSMatthew Dillon.Pp
64d28cbb79SEdward Tomasz Napierala.Lk https://git.FreeBSD.org/src.git
656ed033beSMatthew Dillon.Pp
66d28cbb79SEdward Tomasz NapieralaThe push URL is:
67bdfc6e62SEdward Tomasz Napierala.Pp
68d28cbb79SEdward Tomasz Napierala.Lk ssh://git@gitrepo.FreeBSD.org/src.git
69bdfc6e62SEdward Tomasz Napierala.Pp
708ef03ce6SEvgeniy KhramtsovThere is also a list of public, read-only Git mirrors at:
71d28cbb79SEdward Tomasz Napierala.Pp
72*2541dcafSLi-Wen Hsu.Lk https://docs.FreeBSD.org/en/books/handbook/mirrors/#external-mirrors
73d28cbb79SEdward Tomasz Napierala.Pp
74d28cbb79SEdward Tomasz NapieralaThe
75d28cbb79SEdward Tomasz Napierala.Ql main
76d28cbb79SEdward Tomasz NapieralaGit branch represents CURRENT;
77d28cbb79SEdward Tomasz Napieralaall changes are first committed to CURRENT and then usually cherry-picked
78d28cbb79SEdward Tomasz Napieralaback to STABLE, which refers to Git branches such as
79d28cbb79SEdward Tomasz Napierala.Ql stable/13 .
8053844d3eSLi-Wen HsuEvery few years a new STABLE is branched from CURRENT,
8153844d3eSLi-Wen Hsuwith an incremented major version number.
825596cb94SEdward Tomasz NapieralaReleases are then branched off STABLE and numbered with consecutive minor
835596cb94SEdward Tomasz Napieralanumbers.
84bdfc6e62SEdward Tomasz Napierala.Pp
85bdfc6e62SEdward Tomasz NapieralaLayout of the source tree is described in
86bdfc6e62SEdward Tomasz Napierala.Xr hier 7 .
87d09cfd27SEdward Tomasz NapieralaBuild instructions can be found in
88bdfc6e62SEdward Tomasz Napierala.Xr build 7
89c201414fSRuslan Ermilovand
90bdfc6e62SEdward Tomasz Napierala.Xr release 7 .
91b920f69bSEdward Tomasz NapieralaKernel programming interfaces (KPIs) are documented in section 9
92b920f69bSEdward Tomasz Napieralamanual pages; use
93f41ad4eaSEdward Tomasz Napierala.Ql "apropos -s 9 ."
949c08ba77SEdward Tomasz Napieralafor a list.
959c08ba77SEdward Tomasz NapieralaRegression test suite is described in
969c08ba77SEdward Tomasz Napierala.Xr tests 7 .
97bdfc6e62SEdward Tomasz NapieralaFor coding conventions, see
98bdfc6e62SEdward Tomasz Napierala.Xr style 9 .
996ed033beSMatthew Dillon.Pp
100bdfc6e62SEdward Tomasz NapieralaTo ask questions regarding development, use the mailing lists,
101bdfc6e62SEdward Tomasz Napieralasuch as freebsd-arch@ and freebsd-hackers@:
1026ed033beSMatthew Dillon.Pp
1037e89a7e3SEdward Tomasz Napierala.Lk https://lists.FreeBSD.org
1046ed033beSMatthew Dillon.Pp
1055596cb94SEdward Tomasz NapieralaTo get your patches integrated into the main
1065596cb94SEdward Tomasz Napierala.Fx
1075596cb94SEdward Tomasz Napieralarepository use Phabricator;
108bdfc6e62SEdward Tomasz Napieralait is a code review tool that allows other developers to review the changes,
109bdfc6e62SEdward Tomasz Napieralasuggest improvements, and, eventually, allows them to pick up the change and
110bdfc6e62SEdward Tomasz Napieralacommit it:
1116ed033beSMatthew Dillon.Pp
1127e89a7e3SEdward Tomasz Napierala.Lk https://reviews.FreeBSD.org
1135af5819dSLi-Wen Hsu.Pp
1145af5819dSLi-Wen HsuTo check the latest
1155af5819dSLi-Wen Hsu.Fx
1165af5819dSLi-Wen Hsubuild and test status of CURRENT and STABLE branches,
1175af5819dSLi-Wen Hsuthe continuous integration system is at:
1185af5819dSLi-Wen Hsu.Pp
1195af5819dSLi-Wen Hsu.Lk https://ci.FreeBSD.org
1205af5819dSLi-Wen Hsu.Pp
121bdfc6e62SEdward Tomasz Napierala.Sh EXAMPLES
122bdfc6e62SEdward Tomasz NapieralaCheck out the CURRENT branch, build it, and install, overwriting the current
123bdfc6e62SEdward Tomasz Napieralasystem:
1245596cb94SEdward Tomasz Napierala.Bd -literal -offset indent
125d28cbb79SEdward Tomasz Napieralagit clone https://git.FreeBSD.org/src.git src
1265596cb94SEdward Tomasz Napieralacd src
1275167a1a7SEdward Tomasz Napieralamake -sj8 buildworld buildkernel installkernel
12803840eefSMateusz Piotrowskishutdown -r now
1295596cb94SEdward Tomasz Napierala.Ed
1306ed033beSMatthew Dillon.Pp
131bdfc6e62SEdward Tomasz NapieralaAfter reboot:
1325596cb94SEdward Tomasz Napierala.Bd -literal -offset indent
1335596cb94SEdward Tomasz Napieralacd src
1345596cb94SEdward Tomasz Napieralamake -j8 installworld
1352bd42f2fSMateusz Piotrowskireboot
1365596cb94SEdward Tomasz Napierala.Ed
137873a1193SEdward Tomasz Napierala.Pp
138873a1193SEdward Tomasz NapieralaRebuild and reinstall a single piece of userspace, in this
139873a1193SEdward Tomasz Napieralacase
140873a1193SEdward Tomasz Napierala.Xr ls 1 :
141873a1193SEdward Tomasz Napierala.Bd -literal -offset indent
142873a1193SEdward Tomasz Napieralacd src/bin/ls
143873a1193SEdward Tomasz Napieralamake clean all install
144873a1193SEdward Tomasz Napierala.Ed
145f1d1d6f6SEdward Tomasz Napierala.Pp
146f1d1d6f6SEdward Tomasz NapieralaQuickly rebuild and reinstall the kernel, only recompiling the files
147f1d1d6f6SEdward Tomasz Napieralachanged since last build; note that this will only work if the full kernel
148f1d1d6f6SEdward Tomasz Napieralabuild has been completed in the past, not on a fresh source tree:
149f1d1d6f6SEdward Tomasz Napierala.Bd -literal -offset indent
150f1d1d6f6SEdward Tomasz Napieralacd src
1515167a1a7SEdward Tomasz Napieralamake -sj8 kernel KERNFAST=1
152f1d1d6f6SEdward Tomasz Napierala.Ed
153a3c733b2SEdward Tomasz Napierala.Pp
154a3c733b2SEdward Tomasz NapieralaTo rebuild parts of
155a3c733b2SEdward Tomasz Napierala.Fx
156a3c733b2SEdward Tomasz Napieralafor another CPU architecture,
157a3c733b2SEdward Tomasz Napieralafirst prepare your source tree by building the cross-toolchain:
158a3c733b2SEdward Tomasz Napierala.Bd -literal -offset indent
159a3c733b2SEdward Tomasz Napieralacd src
160e03813c3SEdward Tomasz Napieralamake -sj8 toolchain TARGET_ARCH=aarch64
161a3c733b2SEdward Tomasz Napierala.Ed
162a3c733b2SEdward Tomasz Napierala.Pp
163a3c733b2SEdward Tomasz NapieralaAfterwards, to build and install a single piece of userspace, use:
164a3c733b2SEdward Tomasz Napierala.Bd -literal -offset indent
165a3c733b2SEdward Tomasz Napieralacd src/bin/ls
166e03813c3SEdward Tomasz Napieralamake buildenv TARGET_ARCH=aarch64
167a3c733b2SEdward Tomasz Napieralamake clean all install DESTDIR=/clients/arm
168a3c733b2SEdward Tomasz Napierala.Ed
169a3c733b2SEdward Tomasz Napierala.Pp
170a3c733b2SEdward Tomasz NapieralaLikewise, to quickly rebuild and reinstall the kernel, use:
171a3c733b2SEdward Tomasz Napierala.Bd -literal -offset indent
172a3c733b2SEdward Tomasz Napieralacd src
173e03813c3SEdward Tomasz Napieralamake buildenv TARGET_ARCH=aarch64
174a3c733b2SEdward Tomasz Napieralamake -sj8 kernel KERNFAST=1 DESTDIR=/clients/arm
175a3c733b2SEdward Tomasz Napierala.Ed
1766ed033beSMatthew Dillon.Sh SEE ALSO
177d28cbb79SEdward Tomasz Napierala.Xr git 1 ,
178bdfc6e62SEdward Tomasz Napierala.Xr witness 4 ,
179c89927b8SChristian Brueffer.Xr build 7 ,
180bdfc6e62SEdward Tomasz Napierala.Xr hier 7 ,
181375409b4SEdward Tomasz Napierala.Xr ports 7 ,
1828347fe67SChristian Brueffer.Xr release 7 ,
1830dfb59abSMateusz Piotrowski.Xr tests 7 ,
184bdfc6e62SEdward Tomasz Napierala.Xr locking 9 ,
185bdfc6e62SEdward Tomasz Napierala.Xr style 9
1866ed033beSMatthew Dillon.Sh HISTORY
1876ed033beSMatthew DillonThe
1886ed033beSMatthew Dillon.Nm
1896ed033beSMatthew Dillonmanual page was originally written by
190a63d6c94SBaptiste Daroussin.An Matthew Dillon Aq Mt dillon@FreeBSD.org
1916ed033beSMatthew Dillonand first appeared
1926ed033beSMatthew Dillonin
19348096bb3SMatthew Dillon.Fx 5.0 ,
1946ed033beSMatthew DillonDecember 2002.
1951fce71e4SEitan AdlerIt was since extensively modified by
196a63d6c94SBaptiste Daroussin.An Eitan Adler Aq Mt eadler@FreeBSD.org
1971fce71e4SEitan Adlerto reflect the repository conversion from
198abfa92deSMateusz Piotrowski.Lk https://www.nongnu.org/cvs/ CVS
1991fce71e4SEitan Adlerto
200abfa92deSMateusz Piotrowski.Lk https://subversion.apache.org/ Subversion .
201bdfc6e62SEdward Tomasz NapieralaIt was rewritten from scratch by
202bdfc6e62SEdward Tomasz Napierala.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org
203bdfc6e62SEdward Tomasz Napieralafor
204bdfc6e62SEdward Tomasz Napierala.Fx 12.0 .
205