1.Dd November 30, 2012 2.Dt SRC 7 3.Os 4.Sh NAME 5.Nm src 6.Nd layout of NetBSD sources 7.Sh DESCRIPTION 8An outline of the 9.Nx 10source code hierarchy. 11.Bl -tag -width "external/" 12.It Pa bin/ 13Critical utilities for the system and users. 14.It Pa sbin/ 15Critical utilities for the system and the superuser. 16.It Pa usr.bin/ 17Not-so critical utilities for the system and users. 18.It Pa usr.sbin/ 19Not-so critical utilities for the system and the superuser. 20.It Pa common/ 21Sources shared between kernel and userland. 22.Bl -tag -width "include/" -compact 23.It Pa dist/ 24Utilities. 25Every utility has its own subdirectory, 26where its source and Makefile are located. 27.It Pa include/ 28Include headers. 29Every group of header files has its own 30subdirectory, where it and its 31Makefile are located. 32.It Pa lib/ 33Libraries. 34Every library has its own subdirectory, 35where it and its Makefile are located. 36.El 37.It Pa compat/ 38A framework to (re)build the libraries 39shipped with 40.Nx 41for different ABI than the default for 42that platform. 43.Bl -tag -width "compat/<arch1>/<arch2>/" -compact 44.It Pa compat/<arch1>/<arch2>/ 45Every 46.Pa compat/<arch1>/<arch2>/ 47directory contains a Makefile and a makefile 48fragment for building an 49.Pa <arch2> 50compat libraries for 51.Pa <arch1> . 52E. g., 53.Pa compat/amd64/i386/ 54is where the 32-bit compat libraries for the 55amd64 port are being built. 56.It Pa compatsubdir.mk 57The list of subdirectories (the libraries and 58ld.elf_so) to build with this ABI. 59.It Pa archdirs.mk 60The list of subdirectories for each port. 61.It Pa Makefile.compat 62The basic framework to force the right paths for 63library and ld.elf_so linkage. 64.It Pa dirshack/Makefile 65A hack to get objdirs created timely. 66.El 67.It Pa crypto/ 68Cryptographic source, which may have import or 69export restrictions. 70.Bl -tag -width "external/" -compact 71.It Pa dist/ 72Original sources. 73This is deprecated; 74.Pa crypto/external/ 75should be used instead. 76.It Pa external/ 77Original sources, grouped by license, and then 78package per license. 79.Pa crypto/external/<license>/<package>/dist/ 80contain original sources for given package; 81other directories contain Makefiles and 82given package's config files. 83.El 84.It Pa dist/ 85Unmodified sources from third parties. 86This is deprecated; 87.Pa external/ 88should be used instead. 89.It Pa distrib/ 90Tools and data-files for making distributions. 91.Bl -tag -width "distrib/notes/<arch>/" -compact 92.It Pa <arch>/ 93Architecture-specific files, grouped by 94image type. 95E. g., 96.Pa distrib/<arch>/floppies/ 97contains Makefiles for making images for 98various types of floppies; 99.Pa <arch>/ramdisk/ 100contains makefiles for making ramdisks etc. 101.It Pa cdrom/ 102Was used to create bootable CD images. 103This is deprecated; 104.Pa build.sh 105\'s 106.Pa iso-image 107target should be used instead. 108.It Pa common/ 109Common files for images generation. 110.It Pa miniroot/ 111Files for miniroot. 112.It Pa notes/<arch> 113Architecture-specific parts of release notes. 114.It Pa sets/ 115Scripts for making file sets. 116.It Pa utils/ 117Utilities for installation ramdisk. 118.El 119.It Pa doc/ 120Development documentation files: changelogs, 121build readmes etc. 122.Pa doc/roadmaps/ 123contains roadmaps. 124.It Pa etc/ 125Default configuration files to be put into 126.Pa /etc . 127.Bl -tag -width "compat/<arch1>/<arch2>/" -compact 128.It Pa etc/etc.<arch>/ 129Architecture-specific config files. 130.El 131.It Pa external/ 132Unmodified sources from third parties, 133grouped by license. 134They are built with so-called "reachover" 135Makefiles which can be found in 136.Pa src/*bin/ 137hierarchies. 138Every 139.Pa external/<license>/<package>/ 140may contain: 141.Bl -tag -width "usr.sbin/" -compact 142.It Pa dist/ 143Unmodified third party source for a given package 144.It Pa bin/ 145.It Pa usr.bin/ 146.It Pa usr.sbin/ 147.It Pa etc. 148Such subdirectories contain reachover Makefiles, 149README's and various import helper scripts. 150E. g., 151.Pa external/public-domain/ 152contains 153sources licensed under Public Domain 154license; 155.Pa external/public-domain/sqlite/dist/ 156contains original sources; 157.Pa external/public-domain/sqlite/bin/ , 158.Pa external/public-domain/sqlite/lib/ 159and 160.Pa external/public-domain/sqlite/ 161itself contain reachover Makefiles. 162.El 163.It Pa extsrc/ 164Optional developer-provided sources that are built if 165.Pa MKEXTSRC=yes , 166as a way to include extra components in the 167build. 168.It Pa games/ 169Sources for utilities/files in 170.Pa /usr/games ; 171each utility has it's own subdirectory, where 172its sources and Makefiles are located. 173.It Pa gnu/ 174Sources licensed under GNU GPL. 175This is deprecated; 176.Pa external/gpl2/ 177or 178.Pa external/gpl3/ 179should be used instead. 180.Pa gnu/dists 181contains the original GNU sources plus changes that 182were submitted to maintainers and that are not 183yet published. 184Other folders contain files that are never expected 185to be submitted to the FSF (reachover Makefiles, etc.) 186.It Pa include/ 187Files to be put into 188.Pa /usr/include . 189.It Pa lib/ 190Source for libraries in 191.Pa /usr/lib 192and some scripts for them. 193Every directory contains source for given library 194and Makefiles. 195.It Pa libexec/ 196Source for utilities in 197.Pa /usr/libexec . 198Every directory contains source for given utility 199and Makefiles. 200.It Pa regress/ 201Various regression tests in 202.Pa /usr/tests . 203This is deprecated; most tests are being migrated 204into 205.Pa tests/ 206once they are migrated to the 207.Xr atf 7 208test framework. 209.It Pa rescue/ 210Makefiles for copying utilities to 211.Pa /rescue . 212.It Pa share/ 213Source for utilities/files in 214.Pa /usr/share . 215Every utility has its own subdirectory, 216where its source and Makefile are located. 217.It Pa sys/ 218Kernel source. 219.Bl -tag -width "opencrypto/" -compact 220.It Pa altq/ 221Network packet alternate queueing. 222.It Pa arch/ 223Files to specific hardware platforms. 224.It Pa coda/ 225Coda file system driver. 226.It Pa compat/ 227Support for older version NetBSD binaries and non-NetBSD binaries. 228.It Pa conf/ 229Misc files for building kernel. 230.It Pa crypto/ 231Crypt alogorithms used by IPsec. 232.It Pa ddb/ 233Client code for local kernel debugger. 234.It Pa dev/ 235Device drivers. 236.It Pa dist/ 237Parent directory for the 238.Ox 239packet filter 240.Xr pf 4 . 241.It Pa external/ 242Sources from third parties, grouped by license. 243.It Pa fs/ 244File systems storing data on physical drives. 245.It Pa gdbscripts/ 246.Xr gdb 1 247macros. 248.It Pa ipkdb/ 249Client code for remote kernel debugger. 250.It Pa kern/ 251NetBSD's Kernel code, such as resource management, signal delivering, etc. 252.It Pa lib/ 253Libraries used by the kernel. 254.It Pa miscfs/ 255Drivers for file systems used to store layered data for kernel features. 256.It Pa modules/ 257Kernel components, including hardware specific drivers and upper-level drivers. 258.It Pa net/ 259Lowlevel network: protocol drivers, packet filters and access interfaces for NICs. 260.It Pa net80211/ 261Drivers for 802.11 wireless network. 262.It Pa netatalk/ 263Appletalk protocol stack 264.Xr atalk 4 . 265.It Pa netbt/ 266Bluetooth stack 267.Xr bluetooth 4 . 268.It Pa netinet/ 269IPv4 protocol stack 270.Xr ip 4 . 271.It Pa netinet6/ 272IPv6 protocol stack. 273.It Pa netipsec/ 274IPsec protocol stack 275.Xr ipsec 4 . 276.It Pa netisdn/ 277ISDN protocol stack 278.Xr isdn 4 . 279.It Pa netkey/ 280Key management for IPsec. 281.It Pa netmpls/ 282MPLS protocol stack 283.Xr mpls 4 . 284.It Pa netnatm/ 285Native Mode ATM protocol stack. 286.It Pa netns/ 287Xerox network protocol stack. 288.It Pa netsmb/ 289SMB network protocol stack. 290.It Pa nfs/ 291Network file system driver. 292.It Pa opencrypto/ 293Cryptographic hardware framework 294.Xr opencrypto 9 . 295.It Pa rump/ 296Rump kernel 297.Xr rump 3 . 298.It Pa secmodel/ 299Security model framework 300.Xr secmodel 9 . 301.It Pa stand/ 302Source for several standalone programs that aren't used by NetBSD currently. 303.It Pa sys/ 304Header files that get installed into 305.Pa /usr/include/sys . 306.It Pa ufs/ 307UFS file system driver. 308.It Pa uvm/ 309Virtual memory manager. 310.El 311.It Pa tests/ 312Source for test programs in 313.Pa /usr/tests . 314These tests use the 315.Xr atf 7 316test framework. 317For library routines, including system calls, the 318directory structure of the tests should follow the 319directory structure of the real source tree. 320For instance, interfaces available via the C 321library should follow: 322.Pa src/lib/libc/gen -> Pa src/tests/lib/libc/gen , 323.Pa src/lib/libc/sys -> Pa src/tests/lib/libc/sys , 324etc. 325Equivalently, all tests for userland utilities 326should try to follow their location in the source tree. 327If this can not be satisfied, the tests for 328a utility should be located under the directory to which 329the utility is installed. Thus, a test for 330.Xr env 1 331should go to 332.Pa src/tests/usr.bin/env. 333Likewise, a test for 334.Xr tcpdump 8 335should be in 336.Pa src/tests/usr.sbin/tcpdump , 337even though the source code for the program is located under 338.Pa src/external . 339.It Pa tools/ 340Reachover build structure for the host build tools. 341Every utility has its own directory, where its Makefile 342is located. 343.It Pa x11/ 344Reachover build structure for X11R7; the source is in 345.Pa X11SRCDIR . 346The directory structure copies the system\'s; 347every directory contains a Makefile. 348.Sh SEE ALSO 349.Xr hier 7 350.Sh AUTHOR 351This manpage was written by 352.An Elvira Khabirova Aq skinder0@gmail.com , 353the 354.Pa sys/ 355part by Mingzhe Wang. 356.Sh HISTORY 357This file was created as a part of Google Code-in 2012/2013. 358