]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man7/development.7
MFH
[FreeBSD/FreeBSD.git] / share / man / man7 / development.7
1 .\" Copyright (c) 2018 Edward Tomasz Napierala <trasz@FreeBSD.org>
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd June 23, 2020
28 .Dt DEVELOPMENT 7
29 .Os
30 .Sh NAME
31 .Nm development
32 .Nd introduction to
33 .Fx
34 development process
35 .Sh DESCRIPTION
36 .Fx
37 development is split into three major suprojects: doc, ports, and src.
38 Doc is the documentation, such as the
39 .Fx
40 Handbook.
41 To read more, see:
42 .Pp
43 .Lk https://www.FreeBSD.org/doc/en/books/fdp-primer/
44 .Pp
45 Ports, described further in
46 .Xr ports 7 ,
47 are the way to build, package, and install third party software.
48 To read more, see:
49 .Pp
50 .Lk https://www.FreeBSD.org/doc/en/books/porters-handbook/
51 .Pp
52 The last one, src, revolves around the source code for the base system,
53 consisting of the kernel, and the libraries and utilities commonly called
54 the world.
55 .Pp
56 The Committer's Guide, describing topics relevant to all committers,
57 can be found at:
58 .Pp
59 .Lk https://www.FreeBSD.org/doc/en/articles/committers-guide/
60 .Pp
61 .Fx
62 src development takes place in the CURRENT branch in Subversion,
63 located at:
64 .Pp
65 .Lk https://svn.FreeBSD.org/base/head
66 .Pp
67 There is also a read-only GitHub mirror at:
68 .Pp
69 .Lk https://github.com/freebsd/freebsd
70 .Pp
71 Changes are first committed to CURRENT and then usually merged back
72 to STABLE.
73 Every few years the CURRENT branch is renamed to STABLE, and a new
74 CURRENT is branched, with an incremented major version number.
75 Releases are then branched off STABLE and numbered with consecutive minor
76 numbers.
77 .Pp
78 Layout of the source tree is described in
79 .Xr hier 7 .
80 Build instructions can be found in
81 .Xr build 7
82 and
83 .Xr release 7 .
84 Kernel programming interfaces (KPIs) are documented in section 9
85 manual pages; use
86 .Ql "apropos -s 9 ."
87 for a list.
88 Regression test suite is described in
89 .Xr tests 7 .
90 For coding conventions, see
91 .Xr style 9 .
92 .Pp
93 To ask questions regarding development, use the mailing lists,
94 such as freebsd-arch@ and freebsd-hackers@:
95 .Pp
96 .Lk https://lists.FreeBSD.org
97 .Pp
98 To get your patches integrated into the main
99 .Fx
100 repository use Phabricator;
101 it is a code review tool that allows other developers to review the changes,
102 suggest improvements, and, eventually, allows them to pick up the change and
103 commit it:
104 .Pp
105 .Lk https://reviews.FreeBSD.org
106 .Pp
107 To check the latest
108 .Fx
109 build and test status of CURRENT and STABLE branches,
110 the continuous integration system is at:
111 .Pp
112 .Lk https://ci.FreeBSD.org
113 .Pp
114 .Sh EXAMPLES
115 Check out the CURRENT branch, build it, and install, overwriting the current
116 system:
117 .Bd -literal -offset indent
118 svnlite co https://svn.FreeBSD.org/base/head src
119 cd src
120 make -sj8 buildworld buildkernel installkernel
121 shutdown -r now
122 .Ed
123 .Pp
124 After reboot:
125 .Bd -literal -offset indent
126 cd src
127 make -j8 installworld
128 reboot
129 .Ed
130 .Pp
131 Rebuild and reinstall a single piece of userspace, in this
132 case
133 .Xr ls 1 :
134 .Bd -literal -offset indent
135 cd src/bin/ls
136 make clean all install
137 .Ed
138 .Pp
139 Quickly rebuild and reinstall the kernel, only recompiling the files
140 changed since last build; note that this will only work if the full kernel
141 build has been completed in the past, not on a fresh source tree:
142 .Bd -literal -offset indent
143 cd src
144 make -sj8 kernel KERNFAST=1
145 .Ed
146 .Pp
147 To rebuild parts of
148 .Fx
149 for another CPU architecture,
150 first prepare your source tree by building the cross-toolchain:
151 .Bd -literal -offset indent
152 cd src
153 make -sj8 toolchain TARGET_ARCH=armv6
154 .Ed
155 .Pp
156 Afterwards, to build and install a single piece of userspace, use:
157 .Bd -literal -offset indent
158 cd src/bin/ls
159 make buildenv TARGET_ARCH=armv6
160 make clean all install DESTDIR=/clients/arm
161 .Ed
162 .Pp
163 Likewise, to quickly rebuild and reinstall the kernel, use:
164 .Bd -literal -offset indent
165 cd src
166 make buildenv TARGET_ARCH=armv6
167 make -sj8 kernel KERNFAST=1 DESTDIR=/clients/arm
168 .Ed
169 .Sh SEE ALSO
170 .Xr svnlite 1 ,
171 .Xr witness 4 ,
172 .Xr build 7 ,
173 .Xr hier 7 ,
174 .Xr ports 7 ,
175 .Xr release 7 ,
176 .Xr locking 9 ,
177 .Xr style 9
178 .Sh HISTORY
179 The
180 .Nm
181 manual page was originally written by
182 .An Matthew Dillon Aq Mt dillon@FreeBSD.org
183 and first appeared
184 in
185 .Fx 5.0 ,
186 December 2002.
187 It was since extensively modified by
188 .An Eitan Adler Aq Mt eadler@FreeBSD.org
189 to reflect the repository conversion from
190 .Xr cvs 1
191 to
192 .Xr svn 1 .
193 It was rewritten from scratch by
194 .An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org
195 for
196 .Fx 12.0 .