SRC(7)

๐Ÿ“ฆ version 11.0, in nixpkgs unstable

โœจ SRC(7) โœจ

okay bestie, so you want the tea on the NetBSD source tree layout? this is the SRC(7) page from the Miscellaneous Information Manual and honestly it's giving map-of-the-whole-realm energy ๐Ÿ—บ๏ธโœจ. buckle up, we're going on a tour of every single directory, no cap.


๐ŸŒธ DESCRIPTION ๐ŸŒธ

An outline of the NetBSD source code hierarchy. literally the whole vibe of where stuff lives. slay.

  • bin/ โ€” Critical utilities for the system and users. the essentials, periodt.
  • sbin/ โ€” Critical utilities for the system and the superuser. big main-character privileges only ๐Ÿ‘‘
  • usr.bin/ โ€” Not-so critical utilities for the system and users. still cute, just less life-or-death ๐Ÿ’…
  • usr.sbin/ โ€” Not-so critical utilities for the system and the superuser. chill but still for the sudo girlies.
  • 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. iykyk.
    • compat/<arch1>/<arch2>/ โ€” Every compat/<arch1>/<arch2>/ directory contains a Makefile and a makefile fragment for building an <arch2> compat libraries for <arch1>. For example, 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. it's called a hack, I'm just reporting the facts bestie ๐Ÿซถ
  • crypto/ โ€” Cryptographic source, which may have import or export restrictions. โš ๏ธ careful with this one.
    • 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. bye bestie ๐Ÿ‘‹
  • distrib/ โ€” Tools and data-files for making distributions.
    • <arch>/ โ€” Architecture-specific files, grouped by image type. For example, 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. reading the docs is self-care fr fr ๐Ÿ“š
  • 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. 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. For example, 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.
  • games/ โ€” Sources for utilities/files in /usr/games; each utility has its own subdirectory, where its sources and Makefiles are located. ๐ŸŽฎ iconic.
  • 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. this is the big one bestie, hold on tight ๐Ÿ˜ค
    • 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).
    • netcan/ โ€” Controller Area Network stack can(4).
    • netinet/ โ€” IPv4 protocol stack ip(4).
    • netinet6/ โ€” IPv6 protocol stack.
    • netipsec/ โ€” IPsec protocol stack ipsec(4).
    • netmpls/ โ€” MPLS protocol stack mpls(4).
    • 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. the way that test layout mirrors reality? obsessed ๐Ÿ’–
  • 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) โ€” go read it bestie, it's the companion piece โœจ

๐Ÿ’œ HISTORY ๐Ÿ’œ

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


๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

This manpage was written by Elvira Khabirova <skinder0@gmail.com>, the sys/ part by Mingzhe Wang. absolute icons, both of them ๐ŸŒŸ


ok that's the whole tree bestie. go forth and navigate src/ like the main character you are. periodt. ๐Ÿ’…โœจ

Debian ยท May 14, 2020 ยท that's the version + date tea, mwah ๐ŸŽ€

๐Ÿ“ฆ where this page comes from