SRC(7) | Miscellaneous Information Manual | SRC(7)

# NAME

`src` —
layout of NetBSD sources

# DESCRIPTION

An outline of the NetBSD source code hierarchy.

bin/
  Critical utilities for the system and users.
sbin/
  Critical utilities for the system and the superuser.
usr.bin/
  Not-so critical utilities for the system and users.
usr.sbin/
  Not-so critical utilities for the system and the superuser.
common/
  Sources shared between kernel and userland.
  dist/
    Utilities. Every utility has its own subdirectory, where its source and Makefile are located.
  include/
    Include headers. Every group of header files has its own subdirectory, where it and its Makefile are located.
  lib/
    Libraries. Every library has its own subdirectory, where it and its Makefile are located.
compat/
  A framework to (re)build the libraries shipped with NetBSD for different ABI than the default for that platform.
  compat/<arch1>/<arch2>/
    Every compat/<arch1>/<arch2>/ directory contains a Makefile and a makefile fragment for building an <arch2> compat libraries for <arch1>. E. g., compat/amd64/i386/ is where the 32-bit compat libraries for the amd64 port are being built.
  compatsubdir.mk
    The list of subdirectories (the libraries and ld.elf_so) to build with this ABI.
  archdirs.mk
    The list of subdirectories for each port.
  Makefile.compat
    The basic framework to force the right paths for library and ld.elf_so linkage.
  dirshack/Makefile
    A hack to get objdirs created timely.
crypto/
  Cryptographic source, which may have import or export restrictions.
  dist/
    Original sources. This is deprecated; crypto/external/ should be used instead.
  external/
    Original sources, grouped by license, and then package per license. crypto/external/<license>/<package>/dist/ contain original sources for given package; other directories contain Makefiles and given package's config files.
dist/
  Unmodified sources from third parties. This is deprecated; external/ should be used instead.
distrib/
  Tools and data-files for making distributions.
  <arch>/
    Architecture-specific files, grouped by image type. E. g., distrib/<arch>/floppies/ contains Makefiles for making images for various types of floppies; <arch>/ramdisk/ contains makefiles for making ramdisks etc.
  cdrom/
    Was used to create bootable CD images. This is deprecated; build.sh ´s iso-image target should be used instead.
  common/
    Common files for images generation.
  miniroot/
    Files for miniroot.
  notes/<arch>
    Architecture-specific parts of release notes.
  sets/
    Scripts for making file sets.
  utils/
    Utilities for installation ramdisk.
doc/
  Development documentation files: changelogs, build readmes etc. doc/roadmaps/ contains roadmaps.
etc/
  Default configuration files to be put into /etc.
  etc/etc.<arch>/
    Architecture-specific config files.
external/
  Unmodified sources from third parties, grouped by license. They are built with so-called "reachover" Makefiles which can be found in src/*bin/ hierarchies. Every external/<license>/<package>/ may contain:
  dist/
    Unmodified third party source for a given package
  bin/
  usr.bin/
  usr.sbin/
  etc.
    Such subdirectories contain reachover Makefiles, README's and various import helper scripts. E. g., external/public-domain/ contains sources licensed under Public Domain license; external/public-domain/sqlite/dist/ contains original sources; external/public-domain/sqlite/bin/, external/public-domain/sqlite/lib/ and external/public-domain/sqlite/ itself contain reachover Makefiles.
extsrc/
  Optional developer-provided sources that are built if MKEXTSRC=yes, as a way to include extra components in the build.
games/
  Sources for utilities/files in /usr/games; each utility has its own subdirectory, where its sources and Makefiles are located.
gnu/
  Sources licensed under GNU GPL. This is deprecated; external/gpl2/ or external/gpl3/ should be used instead. gnu/dists contains the original GNU sources plus changes that were submitted to maintainers and that are not yet published. Other folders contain files that are never expected to be submitted to the FSF (reachover Makefiles, etc.)
include/
  Files to be put into /usr/include.
lib/
  Source for libraries in /usr/lib and some scripts for them. Every directory contains source for given library and Makefiles.
libexec/
  Source for utilities in /usr/libexec. Every directory contains source for given utility and Makefiles.
regress/
  Various regression tests in /usr/tests. This is deprecated; most tests are being migrated into tests/ once they are migrated to the atf(7) test framework.
rescue/
  Makefiles for copying utilities to /rescue.
share/
  Source for utilities/files in /usr/share. Every utility has its own subdirectory, where its source and Makefile are located.
sys/
  Kernel source.
  altq/
    Network packet alternate queueing.
  arch/
    Files to specific hardware platforms.
  coda/
    Coda file system driver.
  compat/
    Support for older version NetBSD binaries and non-NetBSD binaries.
  conf/
    Misc files for building kernel.
  crypto/
    Crypt algorithms used by IPsec.
  ddb/
    Client code for local kernel debugger.
  dev/
    Device drivers.
  dist/
    Parent directory for the OpenBSD packet filter pf(4).
  external/
    Sources from third parties, grouped by license.
  fs/
    File systems storing data on physical drives.
  gdbscripts/
    gdb(1) macros.
  kern/
    NetBSD's Kernel code, such as resource management, signal delivering, etc.
  lib/
    Libraries used by the kernel.
  miscfs/
    Drivers for file systems used to store layered data for kernel features.
  modules/
    Kernel components, including hardware specific drivers and upper-level drivers.
  net/
    Lowlevel network: protocol drivers, packet filters and access interfaces for NICs.
  net80211/
    Drivers for 802.11 wireless network.
  netatalk/
    Appletalk protocol stack atalk(4).
  netbt/
    Bluetooth stack bluetooth(4).
  netinet/
    IPv4 protocol stack ip(4).
  netinet6/
    IPv6 protocol stack.
  netipsec/
    IPsec protocol stack ipsec(4).
  netmpls/
    MPLS protocol stack mpls(4).
  netsmb/
    SMB network protocol stack.
  nfs/
    Network file system driver.
  opencrypto/
    Cryptographic hardware framework opencrypto(9).
  rump/
    Rump kernel rump(3).
  secmodel/
    Security model framework secmodel(9).
  stand/
    Source for several standalone programs that aren't used by NetBSD currently.
  sys/
    Header files that get installed into /usr/include/sys.
  ufs/
    UFS file system driver.
  uvm/
    Virtual memory manager.
tests/
  Source for test programs in /usr/tests. These tests use the atf(7) test framework. For library routines, including system calls, the directory structure of the tests should follow the directory structure of the real source tree. For instance, interfaces available via the C library should follow: src/lib/libc/gen -> src/tests/lib/libc/gen, src/lib/libc/sys -> src/tests/lib/libc/sys, etc. Equivalently, all tests for userland utilities should try to follow their location in the source tree. If this can not be satisfied, the tests for a utility should be located under the directory to which the utility is installed. Thus, a test for env(1) should go to src/tests/usr.bin/env. Likewise, a test for tcpdump(8) should be in src/tests/usr.sbin/tcpdump, even though the source code for the program is located under src/external.
tools/
  Reachover build structure for the host build tools. Every utility has its own directory, where its Makefile is located.
x11/
  Reachover build structure for X11R7; the source is in X11SRCDIR. The directory structure copies the system´s; every directory contains a Makefile.

# SEE ALSO

hier(7)

# HISTORY

This file was created as a part of Google Code-in 2012/2013.

# AUTHORS

This manpage was written by Elvira Khabirova <skinder0@gmail.com>, the sys/ part by Mingzhe Wang.

September 23, 2018 | NetBSD 9.3