1.9. /lib

/lib 目录包含内核模块和启动系统以及运行根文件系统中命令所需的共享库映像(C 编程代码库),例如,/bin 和 /sbin 中的二进制文件。库很容易通过其 *.so 文件扩展名来识别。Windows 中与共享库等效的是 DLL(动态链接库)文件。它们对于基本系统功能至关重要。内核模块(驱动程序)位于子目录 /lib/modules/'kernel-version' 中。为了确保正确的模块编译,您应该确保 /lib/modules/'kernel-version'/kernel/build 指向 /usr/src/'kernel-version',或者确保 Makefile 知道内核源代码本身的位置。

/lib/'机器架构'

包含平台/架构相关的库。

/lib/iptables

iptables 共享库文件。

/lib/kbd

包含各种键盘映射。

/lib/modules/'内核版本'

所有内核模块的所在地。这里的文件组织相当清晰,因此不需要详细说明。

/lib/modules/'内核版本'/isapnpmap.dep

包含基于 ISA 的卡、它们所需的模块以及各种其他属性的详细信息。

/lib/modules/'内核版本'/modules.dep

列出所有模块依赖项。可以使用 depmod 命令更新此文件。

/lib/modules/'内核版本'/pcimap

是 /lib/modules/'内核版本'/isapnpmap.dep 文件的 PCI 等效文件。

/lib/modules/'内核版本'/usbmap

是 /lib/modules/'内核版本'/isapnpmap.dep 文件的 USB 等效文件。

/lib/oss

默认情况下,所有 OSS(开放声音系统)文件都安装在此处。

/lib/security

PAM 库文件。

The FSSTND states that the /lib directory contains those shared library
images needed to boot the system and run the commands in the root filesystem,
ie. by binaries in /bin and /sbin.

Shared libraries that are only necessary for binaries in /usr (such as any 
X Window binaries) must not be in /lib. Only the shared libraries required
to run binaries in /bin and /sbin may be here. In particular, the library 
libm.so.* may also be placed in /usr/lib if it is not required by anything
in /bin or /sbin.

At least one of each of the following filename patterns are required (they 
may be files, or symbolic links):

libc.so.* The dynamically-linked C library (optional)
ld*       The execution time linker/loader (optional)

If a C preprocessor is installed, /lib/cpp must be a reference to it, for
historical reasons. The usual placement of this binary is /usr/bin/cpp.

The following directories, or symbolic links to directories, must be in 
/lib, if the corresponding subsystem is installed:

modules   Loadable kernel modules (optional)

/lib<qual> : Alternate format essential shared libraries (optional)

There may be one or more variants of the /lib directory on systems which
support more than one binary format requiring separate libraries.

This is commonly used for 64-bit or 32-bit support on systems which support
multiple binary formats, but require libraries of the same name. In this 
case, /lib32 and /lib64 might be the library directories, and /lib a symlink
to one of them.

If one or more of these directories exist, the requirements for their contents
are the same as the normal /lib directory, except that /lib<qual>/cpp is 
not required.

/lib<qual>/cpp is still permitted: this allows the case where /lib and 
/lib<qual> are the same (one is a symbolic link to the other).