File: placement

package info (click to toggle)
modutils 2.1.85-11
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 1,020 kB
  • ctags: 1,024
  • sloc: ansic: 9,324; sh: 2,180; lex: 484; yacc: 362; makefile: 309
file content (62 lines) | stat: -rw-r--r-- 2,483 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Where to keep your modules
==========================

This text describes the strategy Debian Linux uses for locating kernel
modules.

Copyright 1996 W.Akkerman


1. Different types of modules

The first thing to notice is that we have to kinds of modules:
- modules that are specific to one kernel version. These modules are
  included with the kernel source and evolve along with the kernel.
- somewhat more `general' version. These modules are not updated with
  every new kernel. However, since the module-kernel interface or
  kernel internals mature over time they do need to be changed on
  occasion.

2. Where do we keep module-directories?

In order to make use of these two module type we use two locations for
storing them. The current filesystem standard (latest revision 1.2) only
states that kernel loadable modules should be in /lib/modules but leaves
us free otherwise.

Following kernel development every Linux system uses /lib/modules/`uname -r`/
(where `uname -r` gives the current kernel revision) for normal modules. This
gives /lib/modules/2.0.23, /lib/modules/2.1.3, etcetera.

As said before, some modules do not have to be updated with each new kernel.
They can remain the same for a while series of kernels. To support this we use
one module-directory for a whole version. This gives /lib/modules/2.0,
/lib/modules/2.1, etcetera.

Here is a sample directory structure:

/lib/modules   -- Main directory for modules
|
+-2.0            -- modules for 2.0.xx kernels
+-2.0.20         -- modules specific for kernel 2.0.20
+-2.0.23         -- modules specific for kernel 2.0.23
+-2.1            -- modules for 2.1.xx kernels
+-2.1.3          -- modules specific for kernel 2.1.3
+-2.1.5          -- modules specific for kernel 2.1.5

3. Internal structure of a module-directory.

To make maintaining modules easier each module-directory has an internal
structure that makes it easier for us to locate a module: each type of
module has a seperate subdirectory allocated for it. Currently we have
xxx different types:
-fs: filesystems. Things like msdos, vfat, nfs and minix.
-net: networking code. For example: slip, ppp, ipx and helpers.
-scsi: SCSI drivers.
-block: drivers for block devices. Examples: ide, loop
-cdrom: drivers for non-IDE cdrom drives
-ipv4: IP version 4 networking code
-misc: all the other stuff like sound, watchdog, etc.

Furthermore a module-directory usually contains a modules.dep file, which
tells insmod about module dependencies.