xref: /freebsd/share/man/man7/development.7 (revision 0e4167514fe3894b288457f9c1edd8fb3237dfb8)
1f354ca73SAlexander Ziaee.\"-
2f354ca73SAlexander Ziaee.\" SPDX-License-Identifier: BSD-2-Clause
3f354ca73SAlexander Ziaee.\"
4bdfc6e62SEdward Tomasz Napierala.\" Copyright (c) 2018 Edward Tomasz Napierala <trasz@FreeBSD.org>
55ecb12e3SWarner Losh.\"
65ecb12e3SWarner Losh.\" Redistribution and use in source and binary forms, with or without
75ecb12e3SWarner Losh.\" modification, are permitted provided that the following conditions
85ecb12e3SWarner Losh.\" are met:
95ecb12e3SWarner Losh.\" 1. Redistributions of source code must retain the above copyright
105ecb12e3SWarner Losh.\"    notice, this list of conditions and the following disclaimer.
115ecb12e3SWarner Losh.\" 2. Redistributions in binary form must reproduce the above copyright
125ecb12e3SWarner Losh.\"    notice, this list of conditions and the following disclaimer in the
135ecb12e3SWarner Losh.\"    documentation and/or other materials provided with the distribution.
145ecb12e3SWarner Losh.\"
15bdfc6e62SEdward Tomasz Napierala.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
165ecb12e3SWarner Losh.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
175ecb12e3SWarner Losh.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18bdfc6e62SEdward Tomasz Napierala.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
195ecb12e3SWarner Losh.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
205ecb12e3SWarner Losh.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
215ecb12e3SWarner Losh.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
225ecb12e3SWarner Losh.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
235ecb12e3SWarner Losh.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
245ecb12e3SWarner Losh.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
255ecb12e3SWarner Losh.\" SUCH DAMAGE.
266ed033beSMatthew Dillon.\"
27*0e416751SAlexander Ziaee.Dd January 19, 2025
286ed033beSMatthew Dillon.Dt DEVELOPMENT 7
296ed033beSMatthew Dillon.Os
306ed033beSMatthew Dillon.Sh NAME
316ed033beSMatthew Dillon.Nm development
325596cb94SEdward Tomasz Napierala.Nd introduction to
335596cb94SEdward Tomasz Napierala.Fx
345596cb94SEdward Tomasz Napieraladevelopment process
356ed033beSMatthew Dillon.Sh DESCRIPTION
3648096bb3SMatthew Dillon.Fx
37b578d2a7SCeri Daviesdevelopment is split into three major subprojects: doc, ports, and src.
385596cb94SEdward Tomasz NapieralaDoc is the documentation, such as the
395596cb94SEdward Tomasz Napierala.Fx
405596cb94SEdward Tomasz NapieralaHandbook.
41bdfc6e62SEdward Tomasz NapieralaTo read more, see:
426ed033beSMatthew Dillon.Pp
432541dcafSLi-Wen Hsu.Lk https://docs.FreeBSD.org/en/books/fdp-primer/
446ed033beSMatthew Dillon.Pp
45bdfc6e62SEdward Tomasz NapieralaPorts, described further in
46bdfc6e62SEdward Tomasz Napierala.Xr ports 7 ,
47bdfc6e62SEdward Tomasz Napieralaare the way to build, package, and install third party software.
48bdfc6e62SEdward Tomasz NapieralaTo read more, see:
496ed033beSMatthew Dillon.Pp
502541dcafSLi-Wen Hsu.Lk https://docs.FreeBSD.org/en/books/porters-handbook/
516ed033beSMatthew Dillon.Pp
52bdfc6e62SEdward Tomasz NapieralaThe last one, src, revolves around the source code for the base system,
53bdfc6e62SEdward Tomasz Napieralaconsisting of the kernel, and the libraries and utilities commonly called
54bdfc6e62SEdward Tomasz Napieralathe world.
5548096bb3SMatthew Dillon.Pp
56bdfc6e62SEdward Tomasz NapieralaThe Committer's Guide, describing topics relevant to all committers,
57bdfc6e62SEdward Tomasz Napieralacan be found at:
586ed033beSMatthew Dillon.Pp
592541dcafSLi-Wen Hsu.Lk https://docs.freebsd.org/en/articles/committers-guide/
606ed033beSMatthew Dillon.Pp
615596cb94SEdward Tomasz Napierala.Fx
62d28cbb79SEdward Tomasz Napieralasrc development takes place in the project-hosted
63d28cbb79SEdward Tomasz NapieralaGit repository, located at:
646ed033beSMatthew Dillon.Pp
65d28cbb79SEdward Tomasz Napierala.Lk https://git.FreeBSD.org/src.git
666ed033beSMatthew Dillon.Pp
67d28cbb79SEdward Tomasz NapieralaThe push URL is:
68bdfc6e62SEdward Tomasz Napierala.Pp
69d28cbb79SEdward Tomasz Napierala.Lk ssh://git@gitrepo.FreeBSD.org/src.git
70bdfc6e62SEdward Tomasz Napierala.Pp
718ef03ce6SEvgeniy KhramtsovThere is also a list of public, read-only Git mirrors at:
72d28cbb79SEdward Tomasz Napierala.Pp
732541dcafSLi-Wen Hsu.Lk https://docs.FreeBSD.org/en/books/handbook/mirrors/#external-mirrors
74d28cbb79SEdward Tomasz Napierala.Pp
75d28cbb79SEdward Tomasz NapieralaThe
76d28cbb79SEdward Tomasz Napierala.Ql main
77d28cbb79SEdward Tomasz NapieralaGit branch represents CURRENT;
78d28cbb79SEdward Tomasz Napieralaall changes are first committed to CURRENT and then usually cherry-picked
79d28cbb79SEdward Tomasz Napieralaback to STABLE, which refers to Git branches such as
80d28cbb79SEdward Tomasz Napierala.Ql stable/13 .
8153844d3eSLi-Wen HsuEvery few years a new STABLE is branched from CURRENT,
8253844d3eSLi-Wen Hsuwith an incremented major version number.
835596cb94SEdward Tomasz NapieralaReleases are then branched off STABLE and numbered with consecutive minor
845596cb94SEdward Tomasz Napieralanumbers.
85bdfc6e62SEdward Tomasz Napierala.Pp
866028a565SMitchell HorneThe layout of the source tree is described in its
876028a565SMitchell Horne.Pa README.md
886028a565SMitchell Hornefile.
89d09cfd27SEdward Tomasz NapieralaBuild instructions can be found in
90bdfc6e62SEdward Tomasz Napierala.Xr build 7
91c201414fSRuslan Ermilovand
92bdfc6e62SEdward Tomasz Napierala.Xr release 7 .
93b920f69bSEdward Tomasz NapieralaKernel programming interfaces (KPIs) are documented in section 9
94b920f69bSEdward Tomasz Napieralamanual pages; use
95f354ca73SAlexander Ziaee.Ql apropos -s 9 \&.
969c08ba77SEdward Tomasz Napieralafor a list.
979c08ba77SEdward Tomasz NapieralaRegression test suite is described in
989c08ba77SEdward Tomasz Napierala.Xr tests 7 .
99bdfc6e62SEdward Tomasz NapieralaFor coding conventions, see
100bdfc6e62SEdward Tomasz Napierala.Xr style 9 .
1016ed033beSMatthew Dillon.Pp
102bdfc6e62SEdward Tomasz NapieralaTo ask questions regarding development, use the mailing lists,
103bdfc6e62SEdward Tomasz Napieralasuch as freebsd-arch@ and freebsd-hackers@:
1046ed033beSMatthew Dillon.Pp
1057e89a7e3SEdward Tomasz Napierala.Lk https://lists.FreeBSD.org
1066ed033beSMatthew Dillon.Pp
1075596cb94SEdward Tomasz NapieralaTo get your patches integrated into the main
1085596cb94SEdward Tomasz Napierala.Fx
1095596cb94SEdward Tomasz Napieralarepository use Phabricator;
110bdfc6e62SEdward Tomasz Napieralait is a code review tool that allows other developers to review the changes,
111bdfc6e62SEdward Tomasz Napieralasuggest improvements, and, eventually, allows them to pick up the change and
112bdfc6e62SEdward Tomasz Napieralacommit it:
1136ed033beSMatthew Dillon.Pp
1147e89a7e3SEdward Tomasz Napierala.Lk https://reviews.FreeBSD.org
1155af5819dSLi-Wen Hsu.Pp
1165af5819dSLi-Wen HsuTo check the latest
1175af5819dSLi-Wen Hsu.Fx
1185af5819dSLi-Wen Hsubuild and test status of CURRENT and STABLE branches,
1195af5819dSLi-Wen Hsuthe continuous integration system is at:
1205af5819dSLi-Wen Hsu.Pp
1215af5819dSLi-Wen Hsu.Lk https://ci.FreeBSD.org
122c2c6f08cSAlexander Ziaee.Sh FILES
123c2c6f08cSAlexander Ziaee.Bl -compact -tag -width "/usr/src/tools/tools/git/git-arc.sh"
124c2c6f08cSAlexander Ziaee.It Pa /usr/src/CONTRIBUTING.md
125c2c6f08cSAlexander Ziaee.Fx
126c2c6f08cSAlexander Ziaeecontribution guidelines
127c2c6f08cSAlexander Ziaee.It Pa /usr/src/tools/tools/git/git-arc.sh
128c2c6f08cSAlexander ZiaeePhabricator review tooling
129c2c6f08cSAlexander Ziaee.El
130bdfc6e62SEdward Tomasz Napierala.Sh EXAMPLES
131bdfc6e62SEdward Tomasz NapieralaCheck out the CURRENT branch, build it, and install, overwriting the current
132bdfc6e62SEdward Tomasz Napieralasystem:
1335596cb94SEdward Tomasz Napierala.Bd -literal -offset indent
134d28cbb79SEdward Tomasz Napieralagit clone https://git.FreeBSD.org/src.git src
1355596cb94SEdward Tomasz Napieralacd src
1365167a1a7SEdward Tomasz Napieralamake -sj8 buildworld buildkernel installkernel
13703840eefSMateusz Piotrowskishutdown -r now
1385596cb94SEdward Tomasz Napierala.Ed
1396ed033beSMatthew Dillon.Pp
140bdfc6e62SEdward Tomasz NapieralaAfter reboot:
1415596cb94SEdward Tomasz Napierala.Bd -literal -offset indent
1425596cb94SEdward Tomasz Napieralacd src
1435596cb94SEdward Tomasz Napieralamake -j8 installworld
1442bd42f2fSMateusz Piotrowskireboot
1455596cb94SEdward Tomasz Napierala.Ed
146873a1193SEdward Tomasz Napierala.Pp
147873a1193SEdward Tomasz NapieralaRebuild and reinstall a single piece of userspace, in this
148873a1193SEdward Tomasz Napieralacase
149873a1193SEdward Tomasz Napierala.Xr ls 1 :
150873a1193SEdward Tomasz Napierala.Bd -literal -offset indent
151873a1193SEdward Tomasz Napieralacd src/bin/ls
152873a1193SEdward Tomasz Napieralamake clean all install
153873a1193SEdward Tomasz Napierala.Ed
154f1d1d6f6SEdward Tomasz Napierala.Pp
155*0e416751SAlexander ZiaeeRebuild and reinstall a single loadable kernel module, in this case
156*0e416751SAlexander Ziaee.Xr sound 4 :
157*0e416751SAlexander Ziaee.Bd -literal -offset indent
158*0e416751SAlexander Ziaeecd src/sys/modules/sound
159*0e416751SAlexander Ziaeemake all install clean cleandepend KMODDIR=/boot/kernel
160*0e416751SAlexander Ziaee.Ed
161*0e416751SAlexander Ziaee.Pp
162f1d1d6f6SEdward Tomasz NapieralaQuickly rebuild and reinstall the kernel, only recompiling the files
163f1d1d6f6SEdward Tomasz Napieralachanged since last build; note that this will only work if the full kernel
164f1d1d6f6SEdward Tomasz Napieralabuild has been completed in the past, not on a fresh source tree:
165f1d1d6f6SEdward Tomasz Napierala.Bd -literal -offset indent
166f1d1d6f6SEdward Tomasz Napieralacd src
1675167a1a7SEdward Tomasz Napieralamake -sj8 kernel KERNFAST=1
168f1d1d6f6SEdward Tomasz Napierala.Ed
169a3c733b2SEdward Tomasz Napierala.Pp
170a3c733b2SEdward Tomasz NapieralaTo rebuild parts of
171a3c733b2SEdward Tomasz Napierala.Fx
172a3c733b2SEdward Tomasz Napieralafor another CPU architecture,
173a3c733b2SEdward Tomasz Napieralafirst prepare your source tree by building the cross-toolchain:
174a3c733b2SEdward Tomasz Napierala.Bd -literal -offset indent
175a3c733b2SEdward Tomasz Napieralacd src
176e03813c3SEdward Tomasz Napieralamake -sj8 toolchain TARGET_ARCH=aarch64
177a3c733b2SEdward Tomasz Napierala.Ed
178a3c733b2SEdward Tomasz Napierala.Pp
179a3c733b2SEdward Tomasz NapieralaAfterwards, to build and install a single piece of userspace, use:
180a3c733b2SEdward Tomasz Napierala.Bd -literal -offset indent
181a3c733b2SEdward Tomasz Napieralacd src/bin/ls
182e03813c3SEdward Tomasz Napieralamake buildenv TARGET_ARCH=aarch64
183a3c733b2SEdward Tomasz Napieralamake clean all install DESTDIR=/clients/arm
184a3c733b2SEdward Tomasz Napierala.Ed
185a3c733b2SEdward Tomasz Napierala.Pp
186a3c733b2SEdward Tomasz NapieralaLikewise, to quickly rebuild and reinstall the kernel, use:
187a3c733b2SEdward Tomasz Napierala.Bd -literal -offset indent
188a3c733b2SEdward Tomasz Napieralacd src
189e03813c3SEdward Tomasz Napieralamake buildenv TARGET_ARCH=aarch64
190a3c733b2SEdward Tomasz Napieralamake -sj8 kernel KERNFAST=1 DESTDIR=/clients/arm
191a3c733b2SEdward Tomasz Napierala.Ed
1926ed033beSMatthew Dillon.Sh SEE ALSO
193d28cbb79SEdward Tomasz Napierala.Xr git 1 ,
194bdfc6e62SEdward Tomasz Napierala.Xr witness 4 ,
195c89927b8SChristian Brueffer.Xr build 7 ,
196bdfc6e62SEdward Tomasz Napierala.Xr hier 7 ,
197375409b4SEdward Tomasz Napierala.Xr ports 7 ,
1988347fe67SChristian Brueffer.Xr release 7 ,
1990dfb59abSMateusz Piotrowski.Xr tests 7 ,
200bdfc6e62SEdward Tomasz Napierala.Xr locking 9 ,
201bdfc6e62SEdward Tomasz Napierala.Xr style 9
2026ed033beSMatthew Dillon.Sh HISTORY
2036ed033beSMatthew DillonThe
2046ed033beSMatthew Dillon.Nm
2056ed033beSMatthew Dillonmanual page was originally written by
206a63d6c94SBaptiste Daroussin.An Matthew Dillon Aq Mt dillon@FreeBSD.org
207f354ca73SAlexander Ziaeeand first appeared in
20848096bb3SMatthew Dillon.Fx 5.0 ,
2096ed033beSMatthew DillonDecember 2002.
2101fce71e4SEitan AdlerIt was since extensively modified by
211a63d6c94SBaptiste Daroussin.An Eitan Adler Aq Mt eadler@FreeBSD.org
2121fce71e4SEitan Adlerto reflect the repository conversion from
213abfa92deSMateusz Piotrowski.Lk https://www.nongnu.org/cvs/ CVS
2141fce71e4SEitan Adlerto
215abfa92deSMateusz Piotrowski.Lk https://subversion.apache.org/ Subversion .
216bdfc6e62SEdward Tomasz NapieralaIt was rewritten from scratch by
217bdfc6e62SEdward Tomasz Napierala.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org
218bdfc6e62SEdward Tomasz Napieralafor
219bdfc6e62SEdward Tomasz Napierala.Fx 12.0 .
220