xref: /netbsd-src/share/man/man7/src.7 (revision dac6dcb8de201aa82d76a602d1e685631e46b16f)
1*dac6dcb8Slukem.\" $NetBSD: src.7,v 1.17 2022/08/21 07:10:03 lukem Exp $
29edfa90dSwiz.\"
31428b55aSjdf.\" Copyright (c) 2012, 2013 Mingzhe Wang and Elvira Khabirova.
4719a5de0Sjdf.\"	All rights reserved.
5719a5de0Sjdf.\"
6719a5de0Sjdf.\" Redistribution and use in source and binary forms, with or without
7719a5de0Sjdf.\" modification, are permitted provided that the following conditions
8719a5de0Sjdf.\" are met:
9719a5de0Sjdf.\" 1. Redistributions of source code must retain the above copyright
10719a5de0Sjdf.\"    notice, this list of conditions and the following disclaimer.
11719a5de0Sjdf.\" 2. Redistributions in binary form must reproduce the above copyright
12719a5de0Sjdf.\"    notice, this list of conditions and the following disclaimer in the
13719a5de0Sjdf.\"    documentation and/or other materials provided with the distribution.
14719a5de0Sjdf.\"
15719a5de0Sjdf.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
16719a5de0Sjdf.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17719a5de0Sjdf.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18719a5de0Sjdf.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
19719a5de0Sjdf.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20719a5de0Sjdf.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21719a5de0Sjdf.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22719a5de0Sjdf.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23719a5de0Sjdf.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24719a5de0Sjdf.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25719a5de0Sjdf.\" SUCH DAMAGE.
269edfa90dSwiz.\"
27f27f66aeSsnj.Dd May 14, 2020
28107d0467Sjdf.Dt SRC 7
29107d0467Sjdf.Os
30107d0467Sjdf.Sh NAME
31107d0467Sjdf.Nm src
32107d0467Sjdf.Nd layout of NetBSD sources
33107d0467Sjdf.Sh DESCRIPTION
34107d0467SjdfAn outline of the
35107d0467Sjdf.Nx
36107d0467Sjdfsource code hierarchy.
37107d0467Sjdf.Bl -tag -width "external/"
38107d0467Sjdf.It Pa bin/
39107d0467SjdfCritical utilities for the system and users.
40107d0467Sjdf.It Pa sbin/
41107d0467SjdfCritical utilities for the system and the superuser.
42107d0467Sjdf.It Pa usr.bin/
43107d0467SjdfNot-so critical utilities for the system and users.
44107d0467Sjdf.It Pa usr.sbin/
45107d0467SjdfNot-so critical utilities for the system and the superuser.
46107d0467Sjdf.It Pa common/
47107d0467SjdfSources shared between kernel and userland.
48107d0467Sjdf.Bl -tag -width "include/" -compact
49107d0467Sjdf.It Pa dist/
50107d0467SjdfUtilities.
51107d0467SjdfEvery utility has its own subdirectory,
52107d0467Sjdfwhere its source and Makefile are located.
53107d0467Sjdf.It Pa include/
54107d0467SjdfInclude headers.
55107d0467SjdfEvery group of header files has its own
56107d0467Sjdfsubdirectory, where it and its
57107d0467SjdfMakefile are located.
58107d0467Sjdf.It Pa lib/
59107d0467SjdfLibraries.
60107d0467SjdfEvery library has its own subdirectory,
61107d0467Sjdfwhere it and its Makefile are located.
62107d0467Sjdf.El
63107d0467Sjdf.It Pa compat/
64107d0467SjdfA framework to (re)build the libraries
65107d0467Sjdfshipped with
66107d0467Sjdf.Nx
67107d0467Sjdffor different ABI than the default for
68107d0467Sjdfthat platform.
69107d0467Sjdf.Bl -tag -width "compat/<arch1>/<arch2>/" -compact
70107d0467Sjdf.It Pa compat/<arch1>/<arch2>/
71107d0467SjdfEvery
72107d0467Sjdf.Pa compat/<arch1>/<arch2>/
73107d0467Sjdfdirectory contains a Makefile and a makefile
74107d0467Sjdffragment for building an
75107d0467Sjdf.Pa <arch2>
76107d0467Sjdfcompat libraries for
77107d0467Sjdf.Pa <arch1> .
78f27f66aeSsnjFor example,
79107d0467Sjdf.Pa compat/amd64/i386/
80107d0467Sjdfis where the 32-bit compat libraries for the
81107d0467Sjdfamd64 port are being built.
82107d0467Sjdf.It Pa compatsubdir.mk
83107d0467SjdfThe list of subdirectories (the libraries and
84107d0467Sjdfld.elf_so) to build with this ABI.
85107d0467Sjdf.It Pa archdirs.mk
86107d0467SjdfThe list of subdirectories for each port.
87107d0467Sjdf.It Pa Makefile.compat
88107d0467SjdfThe basic framework to force the right paths for
89107d0467Sjdflibrary and ld.elf_so linkage.
90107d0467Sjdf.It Pa dirshack/Makefile
91107d0467SjdfA hack to get objdirs created timely.
92107d0467Sjdf.El
93107d0467Sjdf.It Pa crypto/
94107d0467SjdfCryptographic source, which may have import or
95107d0467Sjdfexport restrictions.
96107d0467Sjdf.Bl -tag -width "external/" -compact
97107d0467Sjdf.It Pa dist/
98107d0467SjdfOriginal sources.
99107d0467SjdfThis is deprecated;
100107d0467Sjdf.Pa crypto/external/
101107d0467Sjdfshould be used instead.
102107d0467Sjdf.It Pa external/
103107d0467SjdfOriginal sources, grouped by license, and then
104107d0467Sjdfpackage per license.
105107d0467Sjdf.Pa crypto/external/<license>/<package>/dist/
106107d0467Sjdfcontain original sources for given package;
107107d0467Sjdfother directories contain Makefiles and
108107d0467Sjdfgiven package's config files.
109107d0467Sjdf.El
110107d0467Sjdf.It Pa dist/
111107d0467SjdfUnmodified sources from third parties.
112107d0467SjdfThis is deprecated;
113107d0467Sjdf.Pa external/
114107d0467Sjdfshould be used instead.
115107d0467Sjdf.It Pa distrib/
116107d0467SjdfTools and data-files for making distributions.
117107d0467Sjdf.Bl -tag -width "distrib/notes/<arch>/" -compact
118107d0467Sjdf.It Pa <arch>/
119107d0467SjdfArchitecture-specific files, grouped by
120107d0467Sjdfimage type.
121f27f66aeSsnjFor example,
122107d0467Sjdf.Pa distrib/<arch>/floppies/
123107d0467Sjdfcontains Makefiles for making images for
124107d0467Sjdfvarious types of floppies;
125107d0467Sjdf.Pa <arch>/ramdisk/
126107d0467Sjdfcontains makefiles for making ramdisks etc.
127107d0467Sjdf.It Pa cdrom/
128107d0467SjdfWas used to create bootable CD images.
129107d0467SjdfThis is deprecated;
130107d0467Sjdf.Pa build.sh
131107d0467Sjdf\'s
132107d0467Sjdf.Pa iso-image
133107d0467Sjdftarget should be used instead.
134107d0467Sjdf.It Pa common/
135107d0467SjdfCommon files for images generation.
136107d0467Sjdf.It Pa miniroot/
137107d0467SjdfFiles for miniroot.
138107d0467Sjdf.It Pa notes/<arch>
139107d0467SjdfArchitecture-specific parts of release notes.
140107d0467Sjdf.It Pa sets/
141107d0467SjdfScripts for making file sets.
142107d0467Sjdf.It Pa utils/
143107d0467SjdfUtilities for installation ramdisk.
144107d0467Sjdf.El
145107d0467Sjdf.It Pa doc/
146107d0467SjdfDevelopment documentation files: changelogs,
147107d0467Sjdfbuild readmes etc.
148107d0467Sjdf.Pa doc/roadmaps/
149107d0467Sjdfcontains roadmaps.
150107d0467Sjdf.It Pa etc/
151107d0467SjdfDefault configuration files to be put into
152107d0467Sjdf.Pa /etc .
153107d0467Sjdf.Bl -tag -width "compat/<arch1>/<arch2>/" -compact
154107d0467Sjdf.It Pa etc/etc.<arch>/
155107d0467SjdfArchitecture-specific config files.
156107d0467Sjdf.El
157107d0467Sjdf.It Pa external/
158107d0467SjdfUnmodified sources from third parties,
159107d0467Sjdfgrouped by license.
160107d0467SjdfEvery
161107d0467Sjdf.Pa external/<license>/<package>/
162107d0467Sjdfmay contain:
163107d0467Sjdf.Bl -tag -width "usr.sbin/" -compact
164107d0467Sjdf.It Pa dist/
165107d0467SjdfUnmodified third party source for a given package
166107d0467Sjdf.It Pa bin/
167107d0467Sjdf.It Pa usr.bin/
168107d0467Sjdf.It Pa usr.sbin/
1699edfa90dSwiz.It etc.
170107d0467SjdfSuch subdirectories contain reachover Makefiles,
171107d0467SjdfREADME's and various import helper scripts.
172f27f66aeSsnjFor example,
173107d0467Sjdf.Pa external/public-domain/
174107d0467Sjdfcontains
175107d0467Sjdfsources licensed under Public Domain
176107d0467Sjdflicense;
177107d0467Sjdf.Pa external/public-domain/sqlite/dist/
178107d0467Sjdfcontains original sources;
179107d0467Sjdf.Pa external/public-domain/sqlite/bin/ ,
180107d0467Sjdf.Pa external/public-domain/sqlite/lib/
181107d0467Sjdfand
182107d0467Sjdf.Pa external/public-domain/sqlite/
183107d0467Sjdfitself contain reachover Makefiles.
184107d0467Sjdf.El
185107d0467Sjdf.It Pa games/
186107d0467SjdfSources for utilities/files in
187107d0467Sjdf.Pa /usr/games ;
188f0a7346dSsnjeach utility has its own subdirectory, where
189107d0467Sjdfits sources and Makefiles are located.
190107d0467Sjdf.It Pa include/
191107d0467SjdfFiles to be put into
192107d0467Sjdf.Pa /usr/include .
193107d0467Sjdf.It Pa lib/
194107d0467SjdfSource for libraries in
195107d0467Sjdf.Pa /usr/lib
196107d0467Sjdfand some scripts for them.
197107d0467SjdfEvery directory contains source for given library
198107d0467Sjdfand Makefiles.
199107d0467Sjdf.It Pa libexec/
200107d0467SjdfSource for utilities in
201107d0467Sjdf.Pa /usr/libexec .
202107d0467SjdfEvery directory contains source for given utility
203107d0467Sjdfand Makefiles.
204107d0467Sjdf.It Pa regress/
205107d0467SjdfVarious regression tests in
206107d0467Sjdf.Pa /usr/tests .
207107d0467SjdfThis is deprecated; most tests are being migrated
208107d0467Sjdfinto
209107d0467Sjdf.Pa tests/
210107d0467Sjdfonce they are migrated to the
211107d0467Sjdf.Xr atf 7
212107d0467Sjdftest framework.
213107d0467Sjdf.It Pa rescue/
214107d0467SjdfMakefiles for copying utilities to
215107d0467Sjdf.Pa /rescue .
216107d0467Sjdf.It Pa share/
217107d0467SjdfSource for utilities/files in
218107d0467Sjdf.Pa /usr/share .
219107d0467SjdfEvery utility has its own subdirectory,
220107d0467Sjdfwhere its source and Makefile are located.
221107d0467Sjdf.It Pa sys/
222107d0467SjdfKernel source.
223107d0467Sjdf.Bl -tag -width "opencrypto/" -compact
224107d0467Sjdf.It Pa altq/
225107d0467SjdfNetwork packet alternate queueing.
226107d0467Sjdf.It Pa arch/
227107d0467SjdfFiles to specific hardware platforms.
228107d0467Sjdf.It Pa coda/
229107d0467SjdfCoda file system driver.
230107d0467Sjdf.It Pa compat/
2319edfa90dSwizSupport for older version
2329edfa90dSwiz.Nx
2339edfa90dSwizbinaries and
2349edfa90dSwiz.Pf non- Nx
2359edfa90dSwizbinaries.
236107d0467Sjdf.It Pa conf/
237107d0467SjdfMisc files for building kernel.
238107d0467Sjdf.It Pa crypto/
2393b750626SabhinavCrypt algorithms used by IPsec.
240107d0467Sjdf.It Pa ddb/
241107d0467SjdfClient code for local kernel debugger.
242107d0467Sjdf.It Pa dev/
243107d0467SjdfDevice drivers.
244107d0467Sjdf.It Pa dist/
245107d0467SjdfParent directory for the
246107d0467Sjdf.Ox
247107d0467Sjdfpacket filter
248107d0467Sjdf.Xr pf 4 .
249107d0467Sjdf.It Pa external/
250107d0467SjdfSources from third parties, grouped by license.
251107d0467Sjdf.It Pa fs/
252107d0467SjdfFile systems storing data on physical drives.
253107d0467Sjdf.It Pa gdbscripts/
254107d0467Sjdf.Xr gdb 1
255107d0467Sjdfmacros.
256107d0467Sjdf.It Pa kern/
2579edfa90dSwiz.Nx Ap s
2589edfa90dSwizKernel code, such as resource management, signal delivering, etc.
259107d0467Sjdf.It Pa lib/
260107d0467SjdfLibraries used by the kernel.
261107d0467Sjdf.It Pa miscfs/
262107d0467SjdfDrivers for file systems used to store layered data for kernel features.
263107d0467Sjdf.It Pa modules/
264107d0467SjdfKernel components, including hardware specific drivers and upper-level drivers.
265107d0467Sjdf.It Pa net/
266107d0467SjdfLowlevel network: protocol drivers, packet filters and access interfaces for NICs.
267107d0467Sjdf.It Pa net80211/
268107d0467SjdfDrivers for 802.11 wireless network.
269107d0467Sjdf.It Pa netatalk/
270107d0467SjdfAppletalk protocol stack
271107d0467Sjdf.Xr atalk 4 .
272107d0467Sjdf.It Pa netbt/
273107d0467SjdfBluetooth stack
274107d0467Sjdf.Xr bluetooth 4 .
275f27f66aeSsnj.It Pa netcan/
276f27f66aeSsnjController Area Network stack
277f27f66aeSsnj.Xr can 4 .
278107d0467Sjdf.It Pa netinet/
279107d0467SjdfIPv4 protocol stack
280107d0467Sjdf.Xr ip 4 .
281107d0467Sjdf.It Pa netinet6/
282107d0467SjdfIPv6 protocol stack.
283107d0467Sjdf.It Pa netipsec/
284107d0467SjdfIPsec protocol stack
285107d0467Sjdf.Xr ipsec 4 .
286107d0467Sjdf.It Pa netmpls/
287107d0467SjdfMPLS protocol stack
288107d0467Sjdf.Xr mpls 4 .
289107d0467Sjdf.It Pa nfs/
290107d0467SjdfNetwork file system driver.
291107d0467Sjdf.It Pa opencrypto/
292107d0467SjdfCryptographic hardware framework
293107d0467Sjdf.Xr opencrypto 9 .
294107d0467Sjdf.It Pa rump/
295107d0467SjdfRump kernel
296107d0467Sjdf.Xr rump 3 .
297107d0467Sjdf.It Pa secmodel/
298107d0467SjdfSecurity model framework
299107d0467Sjdf.Xr secmodel 9 .
300107d0467Sjdf.It Pa stand/
3019edfa90dSwizSource for several standalone programs that aren't used by
3029edfa90dSwiz.Nx
3039edfa90dSwizcurrently.
304107d0467Sjdf.It Pa sys/
305107d0467SjdfHeader files that get installed into
306107d0467Sjdf.Pa /usr/include/sys .
307107d0467Sjdf.It Pa ufs/
308107d0467SjdfUFS file system driver.
309107d0467Sjdf.It Pa uvm/
310107d0467SjdfVirtual memory manager.
311107d0467Sjdf.El
312107d0467Sjdf.It Pa tests/
313107d0467SjdfSource for test programs in
314107d0467Sjdf.Pa /usr/tests .
315107d0467SjdfThese tests use the
316107d0467Sjdf.Xr atf 7
317107d0467Sjdftest framework.
318107d0467SjdfFor library routines, including system calls, the
319107d0467Sjdfdirectory structure of the tests should follow the
320107d0467Sjdfdirectory structure of the real source tree.
321107d0467SjdfFor instance, interfaces available via the C
322107d0467Sjdflibrary should follow:
323107d0467Sjdf.Pa src/lib/libc/gen -> Pa src/tests/lib/libc/gen ,
324107d0467Sjdf.Pa src/lib/libc/sys -> Pa src/tests/lib/libc/sys ,
325107d0467Sjdfetc.
326107d0467SjdfEquivalently, all tests for userland utilities
327107d0467Sjdfshould try to follow their location in the source tree.
328107d0467SjdfIf this can not be satisfied, the tests for
329107d0467Sjdfa utility should be located under the directory to which
3309edfa90dSwizthe utility is installed.
3319edfa90dSwizThus, a test for
332107d0467Sjdf.Xr env 1
333107d0467Sjdfshould go to
334107d0467Sjdf.Pa src/tests/usr.bin/env .
335107d0467SjdfLikewise, a test for
336107d0467Sjdf.Xr tcpdump 8
337107d0467Sjdfshould be in
338107d0467Sjdf.Pa src/tests/usr.sbin/tcpdump ,
339107d0467Sjdfeven though the source code for the program is located under
340107d0467Sjdf.Pa src/external .
341107d0467Sjdf.It Pa tools/
342107d0467SjdfReachover build structure for the host build tools.
343107d0467SjdfEvery utility has its own directory, where its Makefile
344107d0467Sjdfis located.
345107d0467Sjdf.It Pa x11/
346107d0467SjdfReachover build structure for X11R7; the source is in
347107d0467Sjdf.Pa X11SRCDIR .
348107d0467SjdfThe directory structure copies the system\'s;
349107d0467Sjdfevery directory contains a Makefile.
350e68ceedcSwiz.El
351107d0467Sjdf.Sh SEE ALSO
352107d0467Sjdf.Xr hier 7
3539edfa90dSwiz.Sh HISTORY
3549edfa90dSwizThis file was created as a part of Google Code-in 2012/2013.
3559edfa90dSwiz.Sh AUTHORS
3569edfa90dSwiz.An -nosplit
357107d0467SjdfThis manpage was written by
358a5684d07Swiz.An Elvira Khabirova Aq Mt skinder0@gmail.com ,
359107d0467Sjdfthe
360107d0467Sjdf.Pa sys/
3619edfa90dSwizpart by
3629edfa90dSwiz.An Mingzhe Wang .
363