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 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
|
Add on modules and the kernel-package
=== == ======= === === ==============
There are a number of add-on modules (that is, kernel modules
are developed apart from the Linux kernel and do not appear in the
mainstream kernel sources). Notables, at the time of writing, are the
pcmcia-cs and and the alsa sound modules.
Most of these modules need to be compiled for each kernel
version; they are very dependent on kernel structures. It was
suggested that it would be nice to be able to build the add-on
modules whenever one created a new kernel, and kernel-package
provides some mechanisms to do so for co-operating add-on modules.
In order for this to work, the add-on modules must appear in
a standard location, choosen to be $(MODULE_LOC)/<mod-name>/
(MODULE_LOC defaults to /usr/src/modules, and can be set either in
the environment or the configuration file), and must arrange to be
manipulated by the kernel-package mechanisms.
USER INSTRUCTIONS
==== ============
1) Ensure that the module source tree is in a subdirectory of
the $(MODULE_LOC)[/usr/src/modules] directory. Use a
symbolic link to the actual source tree if you must.
2) As root, go to the the base of the kernel source tree (usually
the /usr/src/linux directory). If you are building a kernel that
is custom configured to your specifications, go ahead and
configure the kernel with `make config,' `make menuconfig,' or
`make xconfig.'
3) To build a new kernel-image package, execute:
make-kpkg --revision number kernel_image
This will generate a kernel-image-<kernel version> deb file
in the parent directory. Here number (the argument supplied
after the --revision flag) is a version number for your
custom built kernel. You may also do this on the fly by
setting the DEBIAN_REVISION environmental variable. It is
important that you choose the revision number in such a way
that a generic kernel-image package will not override the
custom package while using dselect (or `dpkg -BOGiE'). I
recommend a two-level scheme where the major level starts
with a letter. One such scheme is your (short) host name
followed by a dot (.) and a number. For example, if your
machine is named myhost, you would use --revision myhost.1
in the command line. If you had to rebuild your custom
kernel, you would use --revision myhost.2 and so on. See
/usr/share/doc/kernel-package/README.gz for more information on
revision numbers.
4) To build the actual module packages, execute:
make-kpkg modules_image
The revision you supplied while building the kernel shall be
used automatically. Or, if you have skipped step 2 above; or
run make-kpkg clean after building the kernel image,
and are just compiling the modules now, do:
make dep;
make-kpkg --revision number modules_image
where number is the same revision number used to build the
kernel-image package previously. This will generate a
pcmcia-modules-<kernel version> deb file in the parent
directory.
5) Install the two newly created deb files (you can use `dpkg -i
file').
6) Clean the source trees:
make-kpkg clean modules_clean
kernel-package provides for four targets for the use of
stand-alone kernel modules packages.
The special targets to give to make-kpkg are:
a) modules-image modules_image: only generate module binary
packages. Please remember to clean
the modules after the build; see
the sample files for an example.
b) modules: generate the modules packages and
sign them with dchanges (this
creates the source and diff packages
as well)
c) modules-config modules_config: only configure the module
d) modules-clean modules_clean: Clean the modules source tree, and
undo all changes made by the above
commands.
So, add to the
4% fakeroot make-kpkg --revision=custom.1.0 kernel_image
4a% fakeroot make-kpkg --revision=custom.1.0 modules_image,
and remember to install the modules (after you have installed
the kernel-image) by saying
5# dpkg -i ../kernel-image-X.XXX_1.0_<arch>.deb
5a# dpkg -i /usr/src/modules/<mode-name>-<version>.deb
MODULE Packaging hints
====== ========= =====
make-kpkg arranges to cd into each modules top directory,
/usr/src/modules/<mod-name>/, and runs ./debian/rules <target>.
Additionally, the following information is provided in the
environment:
a) KVERS Contains the kernel version
b) KSRC Contains the location of the kernel sources
c) KMAINT Contains the Name of the maintainer to pass to PGP
d) KEMAIL Contains the email address of the maintainer
Additionally, the following variables may also be present in the
environment:
e) APPEND_TO_VERSION This contains a string to be appended to the
EXTRAVERSION variable. This is already factored
into the KVERS variable above.
f) FLAVOUR Contains the flavour, if any, of the current
kernel. This is already factored into the KVERS variable
above. Please note that FLAVOURS are now deprecated in
preference to APPEND_TO_VERSION
g) INT_SUBARCH Contains the SUB arch if any if and only if the
ARCH_IN_NAME variable has been set. I suspect that the
user wants the .deb names to be modified (but not the
kernel version or the location of the dir in which to
find modules if this is set. This is *NOT* factored
into KVERS above, and is there to be used at your
discretion.
h) UNSIGN_CHANGELOG A boolean
i) UNSIGN_SOURCE A boolean
j) ROOT_CMD a program, like sudo or fakeroot
k) root_cmd This is a misnomer. That variable actually holds arguments
for dpkg, specifically, -uc -us -r<blah>, or any
combination thereof, asd requested by the user. This
may be set in the config file, so if this variable
exists, it incorporates and over rides the env vars
UNSIGN_CHANGELOG, UNSIGN_SOURCE, and ROOT_CMD
Please have a look at the sample files for creating a
dependent modules package, sample.module.rules and
sample.module.control.
Have fun,
manoj
--
Manoj Srivastava <srivasta@acm.org> <http://www.datasync.com/%7Esrivasta/>
Key C7261095 fingerprint = CB D9 F4 12 68 07 E4 05 CC 2D 27 12 1D F5 E8 6E
|