| 1 |
louis |
21 |
.\" Hey, Emacs! This is an -*- nroff -*- source file. |
| 2 |
|
|
.\" Copyright (c) 1997 Manoj Srivastava <srivasta@debian.org> |
| 3 |
|
|
.\" |
| 4 |
|
|
.\" This is free documentation; you can redistribute it and/or |
| 5 |
|
|
.\" modify it under the terms of the GNU General Public License as |
| 6 |
|
|
.\" published by the Free Software Foundation; either version 2 of |
| 7 |
|
|
.\" the License, or (at your option) any later version. |
| 8 |
|
|
.\" |
| 9 |
|
|
.\" The GNU General Public License's references to "object code" |
| 10 |
|
|
.\" and "executables" are to be interpreted as the output of any |
| 11 |
|
|
.\" document formatting or typesetting system, including |
| 12 |
|
|
.\" intermediate and printed output. |
| 13 |
|
|
.\" |
| 14 |
|
|
.\" This manual is distributed in the hope that it will be useful, |
| 15 |
|
|
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 |
|
|
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 |
|
|
.\" GNU General Public License for more details. |
| 18 |
|
|
.\" |
| 19 |
|
|
.\" You should have received a copy of the GNU General Public |
| 20 |
|
|
.\" License along with this manual; if not, write to the Free |
| 21 |
|
|
.\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, |
| 22 |
|
|
.\" USA. |
| 23 |
|
|
.\" |
| 24 |
|
|
.\" |
| 25 |
barbier |
438 |
.\" $Id: make-kpkg.8,v 1.76 2003/09/28 01:16:52 srivasta Exp $ |
| 26 |
louis |
21 |
.\" |
| 27 |
barbier |
120 |
.TH MAKE\-KPKG 1 "Nov 14 2002" "Debian" "Debian GNU/Linux manual" |
| 28 |
louis |
21 |
.SH NAME |
| 29 |
|
|
make\-kpkg \- build Debian kernel packages from Linux kernel sources |
| 30 |
|
|
.SH SYNOPSIS |
| 31 |
|
|
.B make\-kpkg |
| 32 |
|
|
.I [options] |
| 33 |
|
|
\&[target [target ...]] |
| 34 |
|
|
.SH DESCRIPTION |
| 35 |
|
|
This manual page explains the Debian |
| 36 |
|
|
.B "make\-kpkg" |
| 37 |
|
|
utility, which is used to create the kernel related |
| 38 |
|
|
Debian |
| 39 |
|
|
packages. This utility needs to be run from a top level |
| 40 |
|
|
Linux |
| 41 |
barbier |
120 |
kernel source directory, |
| 42 |
|
|
which has been previously configured (unless you are using the |
| 43 |
|
|
configure target). Typycally, you run this command as root, or under |
| 44 |
|
|
.B fakeroot, |
| 45 |
|
|
or tell |
| 46 |
|
|
.B make\-kpkg |
| 47 |
|
|
how to become root, like so: |
| 48 |
|
|
.sp 1 |
| 49 |
|
|
.ti +5 |
| 50 |
louis |
189 |
make\-kpkg --rootcmd fakeroot kernel_image |
| 51 |
barbier |
120 |
.sp 1 |
| 52 |
|
|
The Debian package file is created in the parent directory of the |
| 53 |
|
|
kernel source directory where this command is run. |
| 54 |
louis |
21 |
.SH OPTIONS |
| 55 |
|
|
.B \-\-help |
| 56 |
|
|
Print out a usage message. |
| 57 |
|
|
.TP |
| 58 |
|
|
.BR \-\-revision " number" |
| 59 |
|
|
Changes the Debian revision number for the packages produced to the argument |
| 60 |
|
|
.BR number. |
| 61 |
|
|
This has certain constraints: the --revision option only has an effect |
| 62 |
|
|
during the configure phase (in other words, if a file called |
| 63 |
|
|
.I stamp\-configure |
| 64 |
|
|
exists, this option has no effect \-\- run |
| 65 |
|
|
.B make\-kpkg clean |
| 66 |
|
|
or manually remove |
| 67 |
|
|
.I stamp\-configure |
| 68 |
|
|
and |
| 69 |
|
|
.I stamp-debian |
| 70 |
|
|
for it to have an effect -- I strongly suggest you run |
| 71 |
|
|
.B make\-kpkg clean |
| 72 |
|
|
unless you know what you are doing). |
| 73 |
|
|
Additionally, official source package maintainers provide their own |
| 74 |
|
|
version numbers and data for the official uploads, and hence a number |
| 75 |
|
|
of things, including the |
| 76 |
|
|
.B Debian |
| 77 |
|
|
revision, is not modified by |
| 78 |
|
|
.B make-kpkg. |
| 79 |
|
|
If you happen to have an official source, (that would mean that the |
| 80 |
|
|
file |
| 81 |
|
|
.I debian/official |
| 82 |
|
|
exists, and is not empty), and want to use your own revision number, |
| 83 |
|
|
make sure you remove |
| 84 |
|
|
.I debian/official |
| 85 |
|
|
before running |
| 86 |
|
|
.B make\-kpkg clean |
| 87 |
|
|
for this option to have an effect. |
| 88 |
|
|
So, if you want to re\-run |
| 89 |
|
|
.B make\-kpkg |
| 90 |
|
|
with a different revision number, you have to make sure you start with |
| 91 |
|
|
a clean slate. Secondly, the version may contain only |
| 92 |
|
|
alphanumerics and the characters + . (full stop and plus) |
| 93 |
|
|
and must contain a digit. (Look at the Policy manual for |
| 94 |
|
|
details). |
| 95 |
|
|
.I Actually, that is a lie: official kernel and modules maintainers |
| 96 |
|
|
have special dispensation to use hyphens, but it is strongly |
| 97 |
|
|
deprecated for most people, since no sanitization of the version |
| 98 |
|
|
number is done, and dpkg and friends may choke on it at the end of the |
| 99 |
|
|
compile unless one knows what one is doing. |
| 100 |
|
|
Optionally, you may prepend the revision with a digit followed by a |
| 101 |
|
|
colon (:). The default is |
| 102 |
|
|
.B 1.00.Custom |
| 103 |
|
|
unless the environment variable |
| 104 |
|
|
.B DEBIAN_REVISION_MANDATORY |
| 105 |
|
|
is set, in which case an error is generated if the revision is not set |
| 106 |
|
|
on the command line or the configuration file. |
| 107 |
|
|
.TP |
| 108 |
|
|
.BR \-\-append-to-version " foo" |
| 109 |
|
|
.TP |
| 110 |
|
|
.BR \-\-append_to_version " foo" |
| 111 |
|
|
This argument ( |
| 112 |
|
|
.B foo |
| 113 |
|
|
) is appended to the value of the EXTRAVERSION variable present in |
| 114 |
|
|
the kernel Makefile. Since EXTRAVERSION is a component of the kernel |
| 115 |
|
|
version, it is also added to the Debian package name, and, as such |
| 116 |
|
|
must obey the policy governing the package name. That means it may |
| 117 |
|
|
contain only |
| 118 |
|
|
.B lowercase |
| 119 |
|
|
alphanumerics and the characters - + . (full stop, hyphen, and |
| 120 |
|
|
plus). Uppercase letters are not permitted under the Policy for a new |
| 121 |
|
|
package. This over rides the environment variable |
| 122 |
|
|
.B APPEND_TO_VERSION |
| 123 |
|
|
Please note that you \fB\s-1must\s0\fR run a |
| 124 |
|
|
.B make-kpkg |
| 125 |
|
|
.I clean |
| 126 |
|
|
after configuring the kernel using |
| 127 |
|
|
.I make (x|menu)?config, |
| 128 |
|
|
since that creates the file |
| 129 |
|
|
.I include/linux/version.h |
| 130 |
|
|
.B without |
| 131 |
|
|
the |
| 132 |
|
|
.I append_to_version |
| 133 |
|
|
data (foo). This file won't be updated by the make-kpkg run (make-kpkg |
| 134 |
|
|
creates version.h if it doesn't exist, but doesn't touch if exists), |
| 135 |
|
|
so the final kernel will _not_ have the append_to_version data in its |
| 136 |
|
|
version number it shall look for the modules and symbols in all the |
| 137 |
|
|
wrong places. The simplest solution is either to remove |
| 138 |
|
|
include/linux/version.h after configuring and before compiling, or |
| 139 |
|
|
running |
| 140 |
|
|
.B make-kpkg clean |
| 141 |
|
|
after configuring, before compiling. |
| 142 |
|
|
.B Note |
| 143 |
|
|
also that once you use |
| 144 |
|
|
.BR \-\-append_to_version " foo" |
| 145 |
|
|
for configuring, or building the kernel-image, you need to also use |
| 146 |
|
|
the same option in any later invocation of make-kpkg (say, for |
| 147 |
|
|
building stand alone modules, or something). |
| 148 |
|
|
.B make\-kpkg |
| 149 |
|
|
does not remember the argument foo in between invocations (this is |
| 150 |
|
|
different from the behavior of --revision, which we do remember in |
| 151 |
|
|
between invocations). If you are annoyed by make-kpkg whining about |
| 152 |
|
|
using |
| 153 |
|
|
.BR \-\-append_to_version |
| 154 |
|
|
and there already being a |
| 155 |
|
|
.T version.h |
| 156 |
|
|
file from before, you can set the environment variable |
| 157 |
|
|
.B VERSION_H_OK |
| 158 |
|
|
which shall shut off the warning. |
| 159 |
|
|
.TP |
| 160 |
|
|
.BR \-\-flavour\ foo |
| 161 |
|
|
This option is now deprecated in favor of |
| 162 |
|
|
.BR \-\-append_to_version. |
| 163 |
|
|
Sets the kernel flavour to the argument \fBfoo\fR. The flavour is |
| 164 |
|
|
also appended to the package name. You need a patched Makefile to make |
| 165 |
|
|
this work properly (see /usr/share/doc/kernel-package/\s-1Flavours\s0.gz). |
| 166 |
|
|
It may contain only |
| 167 |
|
|
.B lowercase |
| 168 |
|
|
alphanumerics and the characters \- + . (full stop, hyphen, and |
| 169 |
|
|
plus). Uppercase letter are not permitted under the Policy for a new |
| 170 |
|
|
package. \fB\s-1NOTE\s0\fR: Hyphens are discouraged. (Look at |
| 171 |
|
|
Chapters 4 of the Policy manual for details). Please note that you |
| 172 |
|
|
shall need to |
| 173 |
|
|
.B make-kpkg |
| 174 |
|
|
.I clean |
| 175 |
|
|
.B FIRST |
| 176 |
|
|
if you wish to recompile the kernel-image using a flavour. |
| 177 |
|
|
.TP |
| 178 |
|
|
.BR \-\-added-modules\ foo |
| 179 |
|
|
.TP |
| 180 |
|
|
.BR \-\-added_modules\ foo |
| 181 |
|
|
The argument should be a comma separated list of additional |
| 182 |
|
|
add-on modules (not in the main kernel tree) that you wish to |
| 183 |
|
|
build when you invoke the modules_blah targets. You may give full path |
| 184 |
|
|
names of the directory the modules |
| 185 |
|
|
reside in, or just the module name if it can be found in |
| 186 |
|
|
.B MODULE_LOC, |
| 187 |
|
|
which defaults to |
| 188 |
|
|
.I /usr/src/modules. |
| 189 |
|
|
The default is that all modules in |
| 190 |
|
|
.B MODULE_LOC, |
| 191 |
|
|
are compiled when the modules_blah targets are invoked. |
| 192 |
|
|
.TP |
| 193 |
|
|
.BR \-\-added-patches\ foo |
| 194 |
|
|
.TP |
| 195 |
|
|
.BR \-\-added_patches\ foo |
| 196 |
|
|
The argument should be a comma separated list of additional |
| 197 |
louis |
189 |
patches to the kernel sources. This automatically sets the |
| 198 |
louis |
21 |
.I patch_the_kernel |
| 199 |
louis |
189 |
configuration option to YES. |
| 200 |
louis |
21 |
.IP |
| 201 |
louis |
205 |
Unlike the treatment of the modules, you may only give the patch file |
| 202 |
|
|
basename (not the full path name of the patch file). For each file |
| 203 |
|
|
<patch_name> in the list, the following process is followed: If |
| 204 |
|
|
the file can be found in the directories |
| 205 |
|
|
.B ALL_PATCH_DIR/{apply,unpatch}/, |
| 206 |
|
|
then the file |
| 207 |
|
|
.B ALL_PATCH_DIR/apply/<patch_name> |
| 208 |
|
|
shall be executed in turn during the configure phase (and presumably |
| 209 |
louis |
255 |
this applies the patch). Correspondingly, the file |
| 210 |
louis |
205 |
.B ALL_PATCH_DIR/unpatch/<patch_name> |
| 211 |
|
|
shall be executed in the clean phase. |
| 212 |
|
|
The default is that all patches are applied by running all the |
| 213 |
|
|
executable files in |
| 214 |
|
|
.B ALL_PATCH_DIR/apply/ |
| 215 |
louis |
21 |
if requested (Either by setting the configuration option |
| 216 |
|
|
.B patch_the_kernel |
| 217 |
|
|
or the environment variable |
| 218 |
|
|
.B PATCH_THE_KERNEL |
| 219 |
|
|
to YES). Please note that the patches are UN-installed from the source |
| 220 |
|
|
when you run the clean target. This cleanup can be prevented by |
| 221 |
|
|
setting the environment variable |
| 222 |
|
|
.B NO_UNPATCH_BY_DEFAULT |
| 223 |
|
|
.IP |
| 224 |
louis |
205 |
In the above, |
| 225 |
|
|
.B ALL_PATCH_DIR |
| 226 |
|
|
defaults to a subdirectory of |
| 227 |
|
|
.I /usr/src/kernel-patches/. |
| 228 |
|
|
.IP |
| 229 |
louis |
21 |
Some times it would be convenient to have the patches applied when |
| 230 |
|
|
one asks for specific patches using this option, without also having |
| 231 |
|
|
to explicitly set the environment variable. Since setting the |
| 232 |
|
|
environment variable |
| 233 |
|
|
.B PATCH_THE_KERNEL |
| 234 |
|
|
to YES could be dangerous, (for in that case all patches may be |
| 235 |
louis |
223 |
installed when you want none, and did not specify the added_patches |
| 236 |
louis |
21 |
option), You may also set the variable PATCH_THE_KERNEL to |
| 237 |
|
|
.I AUTO, |
| 238 |
|
|
in which case PATCH_THE_KERNEL shall be set to YES for you when you |
| 239 |
|
|
invoke |
| 240 |
|
|
.BR \-\-added-patches\ foo, |
| 241 |
|
|
but not otherwise. |
| 242 |
|
|
Also, please note that if any patch installs a script in |
| 243 |
|
|
.I ./debian/image.d/ |
| 244 |
|
|
directory, |
| 245 |
|
|
.B run-parts |
| 246 |
|
|
shall be called on that directory just before the kernel image package is |
| 247 |
|
|
built. The location of the root of the image package being built shall |
| 248 |
|
|
be passed in the environment variable |
| 249 |
|
|
.B IMAGE_TOP, |
| 250 |
louis |
255 |
and the kernel versions is passed in through the environment variable |
| 251 |
louis |
21 |
.B version. |
| 252 |
|
|
This is a way for the patch to insert any additional files into |
| 253 |
|
|
the image, for example. |
| 254 |
|
|
.TP |
| 255 |
|
|
.BR \-\-arch\ foo |
| 256 |
|
|
This is useful for setting the architecture when you are cross |
| 257 |
|
|
compiling. If you are not cross compiling, the architecture is |
| 258 |
|
|
determined automatically. The same effect can be achieved by setting |
| 259 |
|
|
the environment variable |
| 260 |
|
|
.B KPKG_ARCH |
| 261 |
|
|
.TP |
| 262 |
|
|
.BR \-\-cross-compile\ foo |
| 263 |
|
|
.TP |
| 264 |
|
|
.BR \-\-cross_compile\ foo |
| 265 |
|
|
This is useful for setting the target string when you are cross |
| 266 |
|
|
compiling. The same effect can be achieved by setting the environment variable |
| 267 |
|
|
.B CROSS_COMPILE |
| 268 |
|
|
.TP |
| 269 |
|
|
.BR \-\-subarch\ foo |
| 270 |
|
|
Some architectures (the Alpha, and the m68k) require a different |
| 271 |
|
|
kernel for each sub-architecture. This option provides a way of |
| 272 |
|
|
specifying it as an argument to \fBmake-kpkg\fR. \fBPlease note\fR |
| 273 |
|
|
that additional support for sub-architectures may be required in the |
| 274 |
|
|
kernel sources to actually make this do anything. The same effect can |
| 275 |
|
|
be achieved by setting the environment variable |
| 276 |
|
|
.B KPKG_SUBARCH |
| 277 |
|
|
.TP |
| 278 |
|
|
.BR \-\-arch-in-name |
| 279 |
|
|
.TP |
| 280 |
|
|
.BR \-\-arch_in_name |
| 281 |
|
|
This option uses an extended name for the kernel image package by |
| 282 |
|
|
embedding the sub-architecture in the image name, so one could write a |
| 283 |
|
|
script to create multiple sub-architectures one after the other. You |
| 284 |
|
|
may also do this by setting the environment variable |
| 285 |
|
|
.B ARCH_IN_NAME. |
| 286 |
|
|
\fBPlease note\fR that only the package |
| 287 |
|
|
.I name |
| 288 |
|
|
is affected, not modules locations etc. |
| 289 |
|
|
.TP |
| 290 |
|
|
.BR \-\-pgpsign " name" |
| 291 |
|
|
Set the string used to sign the |
| 292 |
|
|
.B changes |
| 293 |
|
|
file for any external modules in |
| 294 |
|
|
.IR /usr/src/modules/ |
| 295 |
|
|
using PGP. This option will override the builtin default and the site |
| 296 |
|
|
wide customizations stored in the file |
| 297 |
|
|
.IR /etc/kernel-pkg.conf |
| 298 |
|
|
or |
| 299 |
|
|
.IR ~/.kernel-pkg.conf. |
| 300 |
|
|
.TP |
| 301 |
|
|
.BR \-\-config " target" |
| 302 |
|
|
Change the type of configure done from the default \f(CWoldconfig\fR. |
| 303 |
|
|
\fItarget\fR must be one of \f(CWoldconfig\fR, \f(CWconfig\fR, \f(CWmenuconfig\fR, |
| 304 |
|
|
\f(CWxconfig\fR; or \f(CWold\fR, \f(CWmenu\fR, or \f(CWx\fR. |
| 305 |
|
|
.Sp |
| 306 |
|
|
This option is particularly useful when using \s-1PATCH_THE_KERNEL\s0 if some |
| 307 |
barbier |
366 |
of the patches change what configuration options are available. |
| 308 |
|
|
.B Note |
| 309 |
|
|
however that |
| 310 |
|
|
.BR make\-kpkg |
| 311 |
|
|
scans the config file at startup for some options, notably the fact |
| 312 |
|
|
that modules are enabled or not, so toggling the status during the |
| 313 |
|
|
delayed configuration results in an error. If needed, created the |
| 314 |
|
|
configuration file as close to the desired one before calling |
| 315 |
|
|
make\-kpkg with this switch. |
| 316 |
louis |
21 |
.TP |
| 317 |
|
|
.B \-\-targets |
| 318 |
|
|
Prints out a list of known targets. See the Section |
| 319 |
|
|
.B Targets |
| 320 |
|
|
below. |
| 321 |
|
|
.TP |
| 322 |
|
|
.B \-\-noexec |
| 323 |
|
|
Pass a |
| 324 |
|
|
.B \-n |
| 325 |
|
|
option to the |
| 326 |
|
|
.I make |
| 327 |
|
|
process so that commands are merely printed to the screen but not actually |
| 328 |
|
|
executed. This is very useful for debugging. |
| 329 |
|
|
.TP |
| 330 |
|
|
.B \-\-initrd |
| 331 |
|
|
If |
| 332 |
|
|
.B make\-kpkg |
| 333 |
|
|
is generating a |
| 334 |
|
|
.I kernel-image |
| 335 |
|
|
package, perform any actions |
| 336 |
|
|
necessary for a kernel loaded using |
| 337 |
|
|
.B initrd. |
| 338 |
|
|
.B NOTE: |
| 339 |
barbier |
120 |
this requires a non-standard cramfs initrd patch to the kernel |
| 340 |
|
|
sources, (unless the mkintrd configuration has been modified not to |
| 341 |
|
|
use cramfs) or may result in a unbootable kernel. The patch is |
| 342 |
|
|
generally present in the kernel sources shipped by Debian, but is not |
| 343 |
|
|
present in pristine kernel sources. This option may include extra |
| 344 |
|
|
dependencies, and modifications to maintainer scripts. It has no |
| 345 |
|
|
effect when |
| 346 |
louis |
21 |
.B make\-kpkg is not making a |
| 347 |
|
|
.I kernel-image |
| 348 |
|
|
package. The same effect can be achieved by setting the environment |
| 349 |
|
|
variable |
| 350 |
|
|
.B INITRD |
| 351 |
|
|
to any non empty value. |
| 352 |
|
|
To avoid a warning at install time, please read kernel-img.conf(5), |
| 353 |
|
|
and add a |
| 354 |
|
|
.I warn_initrd |
| 355 |
barbier |
366 |
directive in that file. To avoid the warning ar compile time, please |
| 356 |
|
|
set the environment variable |
| 357 |
|
|
.B INITRD_OK. |
| 358 |
louis |
21 |
.TP |
| 359 |
|
|
.B \-\-zimage |
| 360 |
|
|
Makes a zImage kernel rather than a bzImage kernel (the default). |
| 361 |
|
|
Useful for people having problems with bzImage kernels. |
| 362 |
|
|
.TP |
| 363 |
|
|
.B \-\-bzimage |
| 364 |
|
|
Makes a bzImage kernel. Useful for people who want a bzImage kernel on |
| 365 |
|
|
sites where the default is zImage kernels. |
| 366 |
|
|
.TP |
| 367 |
barbier |
438 |
.B \-\-mkimage |
| 368 |
|
|
This should be a command that produces an initrd image given a |
| 369 |
|
|
directory. It is passed to the |
| 370 |
|
|
.I mkinitrd |
| 371 |
|
|
program's |
| 372 |
|
|
.I \-m |
| 373 |
|
|
option. For example, it can be |
| 374 |
|
|
"genromfs -d %s -f %s" |
| 375 |
|
|
or |
| 376 |
|
|
"mkcramfs %s %s" |
| 377 |
|
|
.TP |
| 378 |
louis |
21 |
.B \-\-rootcmd foo |
| 379 |
|
|
The command that provides a means of gaining super user access (for |
| 380 |
barbier |
132 |
example, `sudo' or `fakeroot') as needed by dpkg-buildpackage's -r |
| 381 |
louis |
21 |
option. |
| 382 |
|
|
.TP |
| 383 |
|
|
.B \-\-us |
| 384 |
|
|
This option is passed to dpkg-buildpackage, and directs that package |
| 385 |
|
|
not to sign the source. This is only relevant for the buildpackage |
| 386 |
|
|
target. |
| 387 |
|
|
.TP |
| 388 |
|
|
.B \-\-uc |
| 389 |
|
|
This option is passed to dpkg-buildpackage, and directs that package |
| 390 |
|
|
not to sign the changelog. This is only relevant for the buildpackage |
| 391 |
|
|
target. |
| 392 |
|
|
.PP |
| 393 |
|
|
The options maybe shortened to the smallest unique string, and may |
| 394 |
|
|
be entered with either a \- or a \-\- prefix, and you may use a space |
| 395 |
|
|
or an = symbol between an option string and a value. You may also use |
| 396 |
|
|
the form option=value; for details these and other variant forms |
| 397 |
|
|
supported, please read man Getopt::Long (3perl). |
| 398 |
|
|
.SH TARGETS |
| 399 |
|
|
.TP |
| 400 |
|
|
.B clean |
| 401 |
|
|
Cleans the kernel source directory of all files created by target |
| 402 |
|
|
.B build, |
| 403 |
|
|
and runs a make distclean. (Please look at a Linux kernel Makefile for |
| 404 |
|
|
details). Please note that although we take care of the list of |
| 405 |
|
|
current kernel configuration contained in the file |
| 406 |
|
|
.I .config, |
| 407 |
|
|
the file |
| 408 |
|
|
.I include/linux/autoconf.h |
| 409 |
|
|
is not preserved. |
| 410 |
|
|
.TP |
| 411 |
|
|
.B buildpackage |
| 412 |
|
|
This target runs the targets |
| 413 |
|
|
.B clean, |
| 414 |
|
|
and |
| 415 |
|
|
.B binary, |
| 416 |
|
|
and produces the complete package using |
| 417 |
|
|
.B dpkg-buildpackage |
| 418 |
|
|
.TP |
| 419 |
|
|
.B binary |
| 420 |
|
|
This target produces all four Debian kernel packages by running the |
| 421 |
|
|
targets |
| 422 |
|
|
.B kernel_source, kernel_headers, kernel_doc |
| 423 |
|
|
and |
| 424 |
|
|
.B kernel_image. |
| 425 |
|
|
.TP |
| 426 |
|
|
.B kernel_source |
| 427 |
|
|
This target produces a debianised package of the Linux kernel sources. |
| 428 |
louis |
255 |
If the environment variable |
| 429 |
louis |
21 |
.B SOURCE_CLEAN_HOOK |
| 430 |
|
|
points to an executable, then that executable shall be run from the |
| 431 |
|
|
temporary (top) directory of the kernel sources just before packaging it, |
| 432 |
|
|
.I ./debian/tmp-source/usr/src/kernel-source-X.X.XX, |
| 433 |
|
|
so people may take any action they see fit (remove arch trees, prune |
| 434 |
|
|
version control directories, |
| 435 |
|
|
.I find . \-type d \-name CVS \-prune \-exec rm \-rf {} \\; |
| 436 |
|
|
etc). This has no effect on anything |
| 437 |
|
|
other than the kernel sources that are being packaged -- if the script |
| 438 |
|
|
operates on the current directory and its children, the original |
| 439 |
barbier |
120 |
source tree should remain intact. The environment variables |
| 440 |
|
|
.B HEADER_CLEAN_HOOK |
| 441 |
|
|
and |
| 442 |
|
|
.B DOC_CLEAN_HOOK |
| 443 |
|
|
are similiar. The should point tp executables, then that executable |
| 444 |
|
|
shall be run from the temporary (top) directory of the kernel headers |
| 445 |
|
|
and coumentation just before packaging respectively, so people may |
| 446 |
|
|
take any action they see fit. This also has no effect on anything |
| 447 |
|
|
other than the sources that are being packaged. |
| 448 |
louis |
21 |
.TP |
| 449 |
|
|
.B kernel_headers |
| 450 |
|
|
This target produces a Debian package containing the header files |
| 451 |
|
|
included in the Linux kernel. |
| 452 |
|
|
.TP |
| 453 |
|
|
.B kernel_doc |
| 454 |
|
|
This target produces a Debian package containing the documentation |
| 455 |
|
|
included in the Linux kernel. |
| 456 |
|
|
.TP |
| 457 |
|
|
.B kernel_image |
| 458 |
|
|
This target produces a Debian package of the Linux kernel source |
| 459 |
|
|
image, and any modules configured in the kernel configuration file |
| 460 |
|
|
.I .config. |
| 461 |
|
|
If there is no |
| 462 |
|
|
.I .config |
| 463 |
|
|
file in the kernel source directory, a default configuration is |
| 464 |
|
|
provided similar to the one used to create the |
| 465 |
|
|
.B Debian |
| 466 |
|
|
boot\-floppies. |
| 467 |
|
|
.IP |
| 468 |
|
|
If the file |
| 469 |
|
|
.I ./debian/post-install |
| 470 |
|
|
exists, and is an executable, it is run just before the kernel image |
| 471 |
|
|
package is created. Also, please note that if there are any scripts in |
| 472 |
|
|
.I ./debian/image.d/ |
| 473 |
|
|
directory, |
| 474 |
|
|
.B run-parts |
| 475 |
|
|
shall be called on that directory just before the kernel image package is |
| 476 |
|
|
built. The location of the root of the image package being built shall |
| 477 |
|
|
be passed in the environment variable |
| 478 |
|
|
.B IMAGE_TOP, |
| 479 |
louis |
255 |
and the kernel versions is passed in through the environment variable |
| 480 |
|
|
.B version |
| 481 |
louis |
21 |
for all these scripts. |
| 482 |
|
|
.IP |
| 483 |
|
|
On initial installation, the image package updates symbolic links in |
| 484 |
|
|
the symbolic link destination directory (the root directory by |
| 485 |
|
|
default) to point to the new kernel image in the image directory, |
| 486 |
|
|
which is nominally |
| 487 |
|
|
.I /boot. |
| 488 |
|
|
If the symbolic link already points to the current kernel image, no |
| 489 |
|
|
action is taken. If a prior symbolic link exists, it is rotated out |
| 490 |
|
|
with a suffix.old, and a new symbolic link, properly updated is |
| 491 |
|
|
installed in its place (the variable minimal_swap in |
| 492 |
|
|
.I /etc/kernel-img.conf |
| 493 |
|
|
further modifies this behaviour). No action is taken on upgrades. |
| 494 |
|
|
.IP |
| 495 |
|
|
On installation, it also offers to run the Linux loader, |
| 496 |
|
|
.I LILO |
| 497 |
|
|
(or alternates like |
| 498 |
|
|
.I loadlin, SILO, QUIK, VMELILO, ZIPL, yaboot, PALO |
| 499 |
|
|
or |
| 500 |
|
|
.I GRUB |
| 501 |
|
|
), creating a configuration file for supported boot loaders |
| 502 |
|
|
if needed. At that time it also offers to put the new kernel on a |
| 503 |
|
|
floppy, formatting the floppy if needed. On deletion, the package |
| 504 |
|
|
checks the version of the kernel running, and refuses to delete a |
| 505 |
|
|
running kernel. |
| 506 |
|
|
.I grub |
| 507 |
|
|
rates a special mention here, since grub may not need to be rerun |
| 508 |
|
|
after installing a kernel image, though an automated change to the |
| 509 |
|
|
menu list would be nice on install and removal of kernel image |
| 510 |
|
|
packages. |
| 511 |
|
|
.IP |
| 512 |
|
|
Please see the documentation about hooks in |
| 513 |
|
|
.B kernel-img.conf(5). |
| 514 |
|
|
These hooks are variables that can be pointed to scripts that add or |
| 515 |
|
|
remove a line from the grub menu list at kernel image install and |
| 516 |
|
|
remove times. A sample script to add lines to a grub menu file is |
| 517 |
|
|
included in the directory |
| 518 |
|
|
.TT /usr/share/doc/kernel-package/. |
| 519 |
|
|
.TP |
| 520 |
|
|
.B build |
| 521 |
|
|
This target, used by target |
| 522 |
|
|
.B kernel_image |
| 523 |
|
|
above, compiles the |
| 524 |
|
|
Linux |
| 525 |
|
|
kernel image. |
| 526 |
|
|
.TP |
| 527 |
|
|
.B modules |
| 528 |
|
|
This target allows you to build all add-on modules and packages that are |
| 529 |
|
|
very dependent on the precise kernel version they are compiled for at the |
| 530 |
|
|
same time you build your kernel image. This target expects to find the |
| 531 |
|
|
modules or packages under /usr/src/modules, and, for all such directories, |
| 532 |
|
|
changes to /usr/src/modules/x, and runs the |
| 533 |
|
|
.B kdist |
| 534 |
|
|
rule in the local |
| 535 |
|
|
.I debian.rules |
| 536 |
|
|
file. This target should create the |
| 537 |
|
|
.B Debian |
| 538 |
|
|
module package(s), and may also produce a compressed tar file, and a |
| 539 |
|
|
compressed diff file, with |
| 540 |
|
|
.I md5sums |
| 541 |
|
|
recorded in a changes file using |
| 542 |
|
|
.B dpkg-genchanges. |
| 543 |
|
|
The file is signed by the same identity that would be used to sign the |
| 544 |
|
|
kernel packages. This option is used by maintainers uploading the |
| 545 |
|
|
package to the Debian archives. |
| 546 |
|
|
.TP |
| 547 |
|
|
.B modules_config |
| 548 |
|
|
This target allows you to configure all packages under |
| 549 |
|
|
.B /usr/src/modules. |
| 550 |
|
|
This is useful if you need to manually modify some aspects of the |
| 551 |
|
|
configuration, or if you want to manually compile the add on modules. |
| 552 |
|
|
.TP |
| 553 |
|
|
.B modules_image |
| 554 |
|
|
This target allows you to build all packages under |
| 555 |
|
|
.B /usr/src/modules, |
| 556 |
|
|
but does not create the source or diff files, and does not create and sign |
| 557 |
|
|
a changes file. This is the only modules related option you need if |
| 558 |
|
|
you just want to compile the add on modules image files for |
| 559 |
|
|
installation on one or more machines. Generally called in conjunction |
| 560 |
|
|
with |
| 561 |
|
|
.B kernel_image, |
| 562 |
|
|
especially if also using the option |
| 563 |
|
|
.B append_to_version |
| 564 |
|
|
(prevents spurious warnings). |
| 565 |
|
|
.TP |
| 566 |
|
|
.B modules_clean |
| 567 |
|
|
This target allows you to clean all packages under |
| 568 |
|
|
.B /usr/src/modules, |
| 569 |
|
|
and this should be all that is needed to undo the effect of any of the |
| 570 |
|
|
other modules_ targets. |
| 571 |
|
|
.TP |
| 572 |
|
|
.B configure |
| 573 |
|
|
This target runs configure (actually, |
| 574 |
|
|
.B config_target, |
| 575 |
|
|
set by |
| 576 |
|
|
.B --config |
| 577 |
|
|
which defaults to |
| 578 |
|
|
.I oldconfig |
| 579 |
|
|
) early, so you may edit files generated by |
| 580 |
|
|
.B make config |
| 581 |
|
|
in the kernel source directory and not have them stomped by |
| 582 |
|
|
.B make\-kpkg |
| 583 |
|
|
later. |
| 584 |
|
|
.TP |
| 585 |
|
|
.B debian |
| 586 |
|
|
This target creates the |
| 587 |
|
|
.I ./debian |
| 588 |
|
|
directory, and optionally patches the source. This is called by the |
| 589 |
|
|
.B configure |
| 590 |
|
|
target. You may use this target to have the sources patched, and then |
| 591 |
|
|
manually run the configuration step. |
| 592 |
|
|
.TP |
| 593 |
|
|
.B libc\-kheaders |
| 594 |
|
|
This is a special target for the libc-dev maintainer, who can use it |
| 595 |
|
|
to create the headers package that libc needs. Please note that it is |
| 596 |
|
|
dangerous to create a libc-kheaders package that is different from the |
| 597 |
|
|
headers libc was compiled with; it is |
| 598 |
|
|
.B known |
| 599 |
|
|
to subtly break systems. Please look at |
| 600 |
|
|
.I /usr/share/kernel-package/README.headers |
| 601 |
|
|
for details. Creating and installing a self created libc-kheaders |
| 602 |
|
|
package may break your system unless you know what you are doing. You |
| 603 |
|
|
have been warned. |
| 604 |
|
|
.SH "ENVIRONMENT VARIABLES" |
| 605 |
|
|
The following variables (documented above) affect |
| 606 |
|
|
.B make-kpkg: |
| 607 |
|
|
.I DEBIAN_REVISION_MANDATORY |
| 608 |
|
|
.I APPEND_TO_VERSION |
| 609 |
|
|
.I VERSION_H_OK |
| 610 |
|
|
.I PATCH_THE_KERNEL |
| 611 |
|
|
.I NO_UNPATCH_BY_DEFAULT |
| 612 |
|
|
.I KPKG_ARCH |
| 613 |
|
|
.I CROSS_COMPILE |
| 614 |
|
|
.I KPKG_SUBARCH |
| 615 |
|
|
.I ARCH_IN_NAME |
| 616 |
|
|
.I INITRD |
| 617 |
|
|
.I SOURCE_CLEAN_HOOK |
| 618 |
barbier |
366 |
.I MODULE_LOC |
| 619 |
|
|
.I INITRD_OK |
| 620 |
louis |
21 |
.SH FILES |
| 621 |
|
|
Apart from the runtime options, the |
| 622 |
|
|
.I debian.rules |
| 623 |
|
|
file run by |
| 624 |
|
|
.B make\-kpkg |
| 625 |
|
|
also looks for a per user configuration file |
| 626 |
|
|
.I ~/.kernel-pkg.conf. |
| 627 |
|
|
Failing that, it looks for site\-wide defaults in the file |
| 628 |
|
|
.I /etc/kernel-pkg.conf. |
| 629 |
|
|
The default configuration allows there to be a site wide override for |
| 630 |
|
|
the full name and email address of the person responsible for maintaining |
| 631 |
|
|
the kernel packages on the site, but the |
| 632 |
|
|
.I /etc/kernel-pkg.conf |
| 633 |
|
|
(or |
| 634 |
|
|
.I ~/.kernel-pkg.conf. |
| 635 |
|
|
) file is actually a Makefile snippet, and any legal make directives |
| 636 |
|
|
may be included in there. |
| 637 |
|
|
.B Note: |
| 638 |
|
|
Caution is urged with this file, since you can totally change the way that the |
| 639 |
|
|
make is run by suitably editing this file. Please look at |
| 640 |
|
|
.I /usr/share/doc/kernel-package/Problems.gz |
| 641 |
|
|
for a list of known problems while compiling kernel images. Extensive |
| 642 |
|
|
tutorial like documentation is also available in |
| 643 |
|
|
.I /usr/share/doc/kernel-package/README.gz |
| 644 |
|
|
and it is recommended that one read that before using this utility. |
| 645 |
|
|
.SH "SEE ALSO" |
| 646 |
|
|
.BR kernel-pkg.conf (5), |
| 647 |
|
|
.BR kernel-img.conf (5), |
| 648 |
|
|
.BR Getopt::Long (3perl), |
| 649 |
|
|
.BR dpkg-deb (1), |
| 650 |
|
|
.BR dpkg-source (1), |
| 651 |
|
|
.BR make (1), |
| 652 |
|
|
.BR The\ Programmers\ manual, |
| 653 |
|
|
.BR The\ GNU\ Make\ manual, |
| 654 |
|
|
and the extensive documentation in the directory |
| 655 |
|
|
.B /usr/share/doc/kernel-package |
| 656 |
|
|
.SH AUTHOR |
| 657 |
|
|
This manual page was written by Manoj Srivastava <srivasta@debian.org>, |
| 658 |
|
|
for the Debian GNU/Linux system. |