1bdfc6e62SEdward Tomasz Napierala.\" Copyright (c) 2018 Edward Tomasz Napierala <trasz@FreeBSD.org> 2bdfc6e62SEdward Tomasz Napierala.\" All rights reserved. 35ecb12e3SWarner Losh.\" 45ecb12e3SWarner Losh.\" Redistribution and use in source and binary forms, with or without 55ecb12e3SWarner Losh.\" modification, are permitted provided that the following conditions 65ecb12e3SWarner Losh.\" are met: 75ecb12e3SWarner Losh.\" 1. Redistributions of source code must retain the above copyright 85ecb12e3SWarner Losh.\" notice, this list of conditions and the following disclaimer. 95ecb12e3SWarner Losh.\" 2. Redistributions in binary form must reproduce the above copyright 105ecb12e3SWarner Losh.\" notice, this list of conditions and the following disclaimer in the 115ecb12e3SWarner Losh.\" documentation and/or other materials provided with the distribution. 125ecb12e3SWarner Losh.\" 13bdfc6e62SEdward Tomasz Napierala.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND 145ecb12e3SWarner Losh.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 155ecb12e3SWarner Losh.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16bdfc6e62SEdward Tomasz Napierala.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 175ecb12e3SWarner Losh.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 185ecb12e3SWarner Losh.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 195ecb12e3SWarner Losh.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 205ecb12e3SWarner Losh.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 215ecb12e3SWarner Losh.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 225ecb12e3SWarner Losh.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 235ecb12e3SWarner Losh.\" SUCH DAMAGE. 246ed033beSMatthew Dillon.\" 256ed033beSMatthew Dillon.\" $FreeBSD$ 266ed033beSMatthew Dillon.\" 27a3c733b2SEdward Tomasz Napierala.Dd December 6, 2018 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 37bdfc6e62SEdward Tomasz Napieraladevelopment is split into three major suprojects: 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 43bdfc6e62SEdward Tomasz Napierala.Lk https://www.FreeBSD.org/doc/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 50bdfc6e62SEdward Tomasz Napierala.Lk https://www.FreeBSD.org/doc/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 59bdfc6e62SEdward Tomasz Napierala.Lk https://www.FreeBSD.org/doc/en/articles/committers-guide/ 606ed033beSMatthew Dillon.Pp 615596cb94SEdward Tomasz Napierala.Fx 625596cb94SEdward Tomasz Napieralasrc development takes place in the CURRENT branch in Subversion, 63bdfc6e62SEdward Tomasz Napieralalocated at: 646ed033beSMatthew Dillon.Pp 65f9b7620bSEdward Tomasz Napierala.Lk https://svn.FreeBSD.org/base/head 666ed033beSMatthew Dillon.Pp 67bdfc6e62SEdward Tomasz NapieralaThere is also a read-only GitHub mirror at: 68bdfc6e62SEdward Tomasz Napierala.Pp 69bdfc6e62SEdward Tomasz Napierala.Lk https://github.com/freebsd/freebsd 70bdfc6e62SEdward Tomasz Napierala.Pp 71bdfc6e62SEdward Tomasz NapieralaChanges are first committed to CURRENT and then usually merged back 72bdfc6e62SEdward Tomasz Napieralato STABLE. 73bdfc6e62SEdward Tomasz NapieralaEvery few years the CURRENT branch is renamed to STABLE, and a new 74bdfc6e62SEdward Tomasz NapieralaCURRENT is branched, with an incremented major version number. 755596cb94SEdward Tomasz NapieralaReleases are then branched off STABLE and numbered with consecutive minor 765596cb94SEdward Tomasz Napieralanumbers. 77bdfc6e62SEdward Tomasz Napierala.Pp 78bdfc6e62SEdward Tomasz NapieralaLayout of the source tree is described in 79bdfc6e62SEdward Tomasz Napierala.Xr hier 7 . 80d09cfd27SEdward Tomasz NapieralaBuild instructions can be found in 81bdfc6e62SEdward Tomasz Napierala.Xr build 7 82c201414fSRuslan Ermilovand 83bdfc6e62SEdward Tomasz Napierala.Xr release 7 . 84b920f69bSEdward Tomasz NapieralaKernel programming interfaces (KPIs) are documented in section 9 85b920f69bSEdward Tomasz Napieralamanual pages; use 865596cb94SEdward Tomasz Napierala.Ql "apropos -s 9 ''" 879c08ba77SEdward Tomasz Napieralafor a list. 889c08ba77SEdward Tomasz NapieralaRegression test suite is described in 899c08ba77SEdward Tomasz Napierala.Xr tests 7 . 90bdfc6e62SEdward Tomasz NapieralaFor coding conventions, see 91bdfc6e62SEdward Tomasz Napierala.Xr style 9 . 926ed033beSMatthew Dillon.Pp 93bdfc6e62SEdward Tomasz NapieralaTo ask questions regarding development, use the mailing lists, 94bdfc6e62SEdward Tomasz Napieralasuch as freebsd-arch@ and freebsd-hackers@: 956ed033beSMatthew Dillon.Pp 96*7e89a7e3SEdward Tomasz Napierala.Lk https://lists.FreeBSD.org 976ed033beSMatthew Dillon.Pp 985596cb94SEdward Tomasz NapieralaTo get your patches integrated into the main 995596cb94SEdward Tomasz Napierala.Fx 1005596cb94SEdward Tomasz Napieralarepository use Phabricator; 101bdfc6e62SEdward Tomasz Napieralait is a code review tool that allows other developers to review the changes, 102bdfc6e62SEdward Tomasz Napieralasuggest improvements, and, eventually, allows them to pick up the change and 103bdfc6e62SEdward Tomasz Napieralacommit it: 1046ed033beSMatthew Dillon.Pp 105*7e89a7e3SEdward Tomasz Napierala.Lk https://reviews.FreeBSD.org 106bdfc6e62SEdward Tomasz Napierala.Sh EXAMPLES 107bdfc6e62SEdward Tomasz NapieralaCheck out the CURRENT branch, build it, and install, overwriting the current 108bdfc6e62SEdward Tomasz Napieralasystem: 1095596cb94SEdward Tomasz Napierala.Bd -literal -offset indent 1105596cb94SEdward Tomasz Napieralasvnlite co https://svn.FreeBSD.org/base/head src 1115596cb94SEdward Tomasz Napieralacd src 1125167a1a7SEdward Tomasz Napieralamake -sj8 buildworld buildkernel installkernel 11303840eefSMateusz Piotrowskishutdown -r now 1145596cb94SEdward Tomasz Napierala.Ed 1156ed033beSMatthew Dillon.Pp 116bdfc6e62SEdward Tomasz NapieralaAfter reboot: 1175596cb94SEdward Tomasz Napierala.Bd -literal -offset indent 1185596cb94SEdward Tomasz Napieralacd src 1195596cb94SEdward Tomasz Napieralamake -j8 installworld 1202bd42f2fSMateusz Piotrowskireboot 1215596cb94SEdward Tomasz Napierala.Ed 122873a1193SEdward Tomasz Napierala.Pp 123873a1193SEdward Tomasz NapieralaRebuild and reinstall a single piece of userspace, in this 124873a1193SEdward Tomasz Napieralacase 125873a1193SEdward Tomasz Napierala.Xr ls 1 : 126873a1193SEdward Tomasz Napierala.Bd -literal -offset indent 127873a1193SEdward Tomasz Napieralacd src/bin/ls 128873a1193SEdward Tomasz Napieralamake clean all install 129873a1193SEdward Tomasz Napierala.Ed 130f1d1d6f6SEdward Tomasz Napierala.Pp 131f1d1d6f6SEdward Tomasz NapieralaQuickly rebuild and reinstall the kernel, only recompiling the files 132f1d1d6f6SEdward Tomasz Napieralachanged since last build; note that this will only work if the full kernel 133f1d1d6f6SEdward Tomasz Napieralabuild has been completed in the past, not on a fresh source tree: 134f1d1d6f6SEdward Tomasz Napierala.Bd -literal -offset indent 135f1d1d6f6SEdward Tomasz Napieralacd src 1365167a1a7SEdward Tomasz Napieralamake -sj8 kernel KERNFAST=1 137f1d1d6f6SEdward Tomasz Napierala.Ed 138a3c733b2SEdward Tomasz Napierala.Pp 139a3c733b2SEdward Tomasz NapieralaTo rebuild parts of 140a3c733b2SEdward Tomasz Napierala.Fx 141a3c733b2SEdward Tomasz Napieralafor another CPU architecture, 142a3c733b2SEdward Tomasz Napieralafirst prepare your source tree by building the cross-toolchain: 143a3c733b2SEdward Tomasz Napierala.Bd -literal -offset indent 144a3c733b2SEdward Tomasz Napieralacd src 145a3c733b2SEdward Tomasz Napieralamake -sj8 toolchain TARGET_ARCH=armv6 146a3c733b2SEdward Tomasz Napierala.Ed 147a3c733b2SEdward Tomasz Napierala.Pp 148a3c733b2SEdward Tomasz NapieralaAfterwards, to build and install a single piece of userspace, use: 149a3c733b2SEdward Tomasz Napierala.Bd -literal -offset indent 150a3c733b2SEdward Tomasz Napieralacd src/bin/ls 151a3c733b2SEdward Tomasz Napieralamake buildenv TARGET_ARCH=armv6 152a3c733b2SEdward Tomasz Napieralamake clean all install DESTDIR=/clients/arm 153a3c733b2SEdward Tomasz Napierala.Ed 154a3c733b2SEdward Tomasz Napierala.Pp 155a3c733b2SEdward Tomasz NapieralaLikewise, to quickly rebuild and reinstall the kernel, use: 156a3c733b2SEdward Tomasz Napierala.Bd -literal -offset indent 157a3c733b2SEdward Tomasz Napieralacd src 158a3c733b2SEdward Tomasz Napieralamake buildenv TARGET_ARCH=armv6 159a3c733b2SEdward Tomasz Napieralamake -sj8 kernel KERNFAST=1 DESTDIR=/clients/arm 160a3c733b2SEdward Tomasz Napierala.Ed 1616ed033beSMatthew Dillon.Sh SEE ALSO 1625596cb94SEdward Tomasz Napierala.Xr svnlite 1 , 163bdfc6e62SEdward Tomasz Napierala.Xr witness 4 , 164c89927b8SChristian Brueffer.Xr build 7 , 165bdfc6e62SEdward Tomasz Napierala.Xr hier 7 , 1668347fe67SChristian Brueffer.Xr release 7 , 167bdfc6e62SEdward Tomasz Napierala.Xr locking 9 , 168bdfc6e62SEdward Tomasz Napierala.Xr style 9 1696ed033beSMatthew Dillon.Sh HISTORY 1706ed033beSMatthew DillonThe 1716ed033beSMatthew Dillon.Nm 1726ed033beSMatthew Dillonmanual page was originally written by 173a63d6c94SBaptiste Daroussin.An Matthew Dillon Aq Mt dillon@FreeBSD.org 1746ed033beSMatthew Dillonand first appeared 1756ed033beSMatthew Dillonin 17648096bb3SMatthew Dillon.Fx 5.0 , 1776ed033beSMatthew DillonDecember 2002. 1781fce71e4SEitan AdlerIt was since extensively modified by 179a63d6c94SBaptiste Daroussin.An Eitan Adler Aq Mt eadler@FreeBSD.org 1801fce71e4SEitan Adlerto reflect the repository conversion from 181a63d6c94SBaptiste Daroussin.Xr cvs 1 1821fce71e4SEitan Adlerto 183a63d6c94SBaptiste Daroussin.Xr svn 1 . 184bdfc6e62SEdward Tomasz NapieralaIt was rewritten from scratch by 185bdfc6e62SEdward Tomasz Napierala.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org 186bdfc6e62SEdward Tomasz Napieralafor 187bdfc6e62SEdward Tomasz Napierala.Fx 12.0 . 188