Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
make-kpkg(1)
Edit
PageHistory
Diff
Info
LikePages
MAKE-KPKG !!!MAKE-KPKG NAME SYNOPSIS DESCRIPTION OPTIONS TARGETS ENVIRONMENT VARIABLES FILES SEE ALSO AUTHOR ---- !!NAME make-kpkg - build Debian kernel packages from Linux kernel sources !!SYNOPSIS __make-kpkg__ ''[[options]'' [[target [[target ...]] !!DESCRIPTION This manual page explains the Debian __make-kpkg__ utility, which is used to create the kernel related Debian packages. This utility needs to be run from a top level Linux kernel source directory. !!OPTIONS __--help__ Print out a usage message. __--revision__ number Changes the Debian revision number for the packages produced to the argument __number.__ This has certain constraints: the --revision option only has an effect during the configure phase (in other words, if a file called ''stamp-configure'' exists, this option has no effect -- run __make-kpkg clean__ or manually remove ''stamp-configure'' and ''stamp-debian'' for it to have an effect -- I strongly suggest you run __make-kpkg clean__ unless you know what you are doing). Additionally, official source package maintainers provide their own version numbers and data for the official uploads, and hence a number of things, including the __Debian__ revision, is not modified by __make-kpkg.__ If you happen to have an official source, (that would mean that the file ''debian/official'' exists), and want to use your own revision number, make sure you remove ''debian/official'' before running __make-kpkg clean__ for this option to have an effect. So, if you want to re-run __make-kpkg__ with a different revision number, you have to make sure you start with a clean slate. Secondly, the version may contain only alphanumerics and the characters + . (full stop and plus) and must contain a digit. (Look at the Policy manual for details). ''Actually, that is a lie: official kernel and modules maintainers have special dispensation to use hyphens, but it is strongly deprecated for most people, since no sanitization of the version number is done, and dpkg and friends may choke on it at the end of the compile unless one knows what one is doing.'' Optionally, you may prepend the revision with a digit followed by a colon (:). The default is __1.00.Custom__ unless the env variable __DEBIAN_REVISION_MANDATORY__ is set, in which case an error is generated if the revision is not set on the command line or the config file. __--append-to-version__ foo __--append_to_version__ foo This argument ( __foo__ ) is appended to the value of the EXTRAVERSION variable present in the kernel Makefile. Since EXTRAVERSION is a component of the kernel version, it is also added to the Debian package name, and, as such must obey the policy governing the package name. That means it may contain only __lowercase__ alphanumerics and the characters - + . (full stop, hyphen, and plus). Uppercase letters are not permitted under the Policy for a new package. This over rides the environment variable __APPEND_TO_VERSION__ Please note that you __must__ run a __make-kpkg__ ''clean'' after configuring the kernel using ''make (x|menu)?config,'' since that creates the file ''include/linux/version.h'' __without__ the ''append_to_version'' data (foo). This file won't be updated by the make-kpkg run (make-kpkg creates version.h if it doesn't exist, but doesn't touch if exists), so the final kernel will _not_ have the append_to_version data in its version number it shall look for the modules and symbols in all the wrong places. The simpliest solution is either to remove include/linux/version.h after configuring and before compiling, or running __make-kpkg clean__ after configuring, before compiling. __Note__ also that once you use __--append_to_version__ foo for configuring, or building the kernel-image, you need to also use the same option in any later invocation of make-kpkg (say, for building stand alone modules, or something). __make-kpkg__ does not remember the argument foo in between invocations (this is different from the behaviour of --revision, which we do remember in between invocations). If you are annoyed by make-kpkg whining about using __--append_to_version__ and there already being a file from before, you can set the environment variable __VERSION_H_OK__ which shall shut off the warning. __--flavour foo__ This option is now deprecated in favour of __--append_to_version.__ Sets the kernel flavour to the argument __foo__. The flavour is also appended to the package name. You need a patched Makefile to make this work properly (see /usr/share/doc/kernel-package/ Flavours .gz). It may contain only __lowercase__ alphanumerics and the characters - + . (full stop, hyphen, and plus). Uppercase letter are not permitted under the Policy for a new package. __NOTE__ : Hyphens are discouraged. (Look at Chapters 4 of the Policy manual for details). Please note that you shall need to __make-kpkg__ ''clean'' __FIRST__ if you wish to recompile the kernel-image using a flavour. __--added-modules foo__ __--added_modules foo__ The argument should be a comma separated list of additional add-on modules (not in the main kernel tree) that you wish to build when you invoke the modules_blah targets. You may give full path names of the directory the modules reside in, or just the module name if it can be found in __MODULE_LOC,__ which defaults to ''/usr/src/modules.'' The default is that all modules in __MODULE_LOC,__ are compiled when the modules_blah targets are invoked. __--added-patches foo__ __--added_patches foo__ The argument should be a comma separated list of additional patches to the kernel sources. This requires the ''patch_the_kernel'' configuration option to be set to YES (this, in turn, can be overridden by the environment variable __PATCH_THE_KERNEL__ ). Unlike the treatment of the modules, you may only give the patch name (not the full path name of the patch file). It shall be applied during the configure phase (and removed in the clean phase) if it can be found in the directories __ALL_PATCH_DIR/{apply,unpatch}/,__ which defaults to a subdirectory of ''/usr/src/kernel-patches/.'' The default is that all patches are applied if requested (Either by setting the configuration option __patch_the_kernel__ or the env variable __PATCH_THE_KERNEL__ to YES). Please note that the patches are uninstalled from the source when you run the clean target. This cleanup can be prevented by setting the env variable __NO_UNPATCH_BY_DEFAULT__ Some times it would be convenient to have the patches applied when one asks for specific patches using this option, without also having to explicitly set the envirnonment variable. Since setting the environment variable __PATCH_THE_KERNEL__ to YES could be dangerous, (for in that case all patches may be installed when you want none, and did not specify the applied_pacthes option), You may also set the variable PATCH_THE_KERNEL to ''AUTO,'' in which case PATCH_THE_KERNEL shall be set to YES for you when you invoke __--added-patches foo,__ but not otherwise. __--arch foo__ This is useful for setting the architecture when you are cross compiling. If you are not cross compiling, the architecture is determined automatically. The same effect can be achieved by setting the environment variable __KPKG_ARCH__ __--cross-compile foo__ __--cross_compile foo__ This is useful for setting the target string when you are cross compiling. The same effect can be achieved by setting the environment variable __CROSS_COMPILE__ __--subarch foo__ Some architectures (the Alpha, and the m68k) require a different kernel for each subarchitecture. This option provides a way of specifying it as an argument to __make-kpkg__. __Please note__ that additional support for subarchitectures may be required in the kernel sources to actually make this do anything. The same effect can be achieved by setting the environment variable __KPKG_SUBARCH__ __--arch-in-name__ __--arch_in_name__ This option uses an extended name for the kernel image package by embedding the subarchitecture in the image name, so one could write a script to create multiple subarchitectures one after the other. You may also do this by setting the environment variable __ARCH_IN_NAME. Please note__ that only the package ''name'' is affected, not modules locations etc. __--pgpsign__ name Set the string used to sign the __changes__ file for any external modules in ''/usr/src/modules/'' using PGP. This option will override the builtin default and the site wide customizations stored in the file ''/etc/kernel-pkg.conf'' or ''~/.kernel-pkg.conf.'' __--config__ target Change the type of configure done from the default oldconfig. ''target'' must be one of oldconfig, config, menuconfig, xconfig; or old, menu, or x. This option is particularly useful when using PATCH_THE_KERNEL if some of the patches change what configuration options are available. __--targets__ Prints out a list of known targets. See the Section __Targets__ below. __--noexec__ Pass a __-n__ option to the ''make'' process so that commands are merely printed to the screen but not actually executed. This is very useful for debugging. __--initrd__ If __make-kpkg__ is generating a ''kernel-image'' package, perform any actions necessary for a kernel loaded using __initrd.__ This may include extra dependencies, and modifications to maintainer scripts. It has no effect when __make-kpkg is not making a__ ''kernel-image'' package. The same effect can be achieved by setting the environment variable __INITRD__ to any non empty value. To avoid a warning at install time, please read kernel-img.conf(5), and add a ''warn_initrd'' directive in that file. __--zimage__ Makes a zImage kernel rather than a bzImage kernel (the default). Useful for people having problems with bzImage kernels. __--bzimage__ Makes a bzImage kernel. Useful for people who want a bzImage kernel on sites where the default is zImage kernels. __--rootcmd foo__ The command that provides a means of gaining super user access (for example, `sudo' or `fakeroot') as needed by dpkg-buildpackages' -r option. __--us__ This option is passed to dpkg-buildpackage, and directs that package not to sign the source. This is only relevant for the buildpackage target. __--uc__ This option is passed to dpkg-buildpackage, and directs that package not to sign the changelog. This is only relevant for the buildpackage target. The options maybe shortened to the smallest unique string, and may be entered with either a - or a -- prefix, and you may use a space or an = symbol between an option string and a value. You may also use the form option=value; for details these and other variant forms supported, please read man Getopt::Long (3perl). !!TARGETS __clean__ Cleans the kernel source directory of all files created by target __build,__ and runs a make distclean. (Please look at a Linux kernel Makefile for details). Please note that although we take care of the list of current kernel configuration contained in the file ''.config,'' the file ''include/linux/autoconf.h'' is not preserved. __buildpackage__ This target runs the targets __clean,__ and __binary,__ and produces the complete package using __dpkg-buildpackage__ __binary__ This target produces all four Debian kernel packages by running the targets __kernel_source, kernel_headers, kernel_doc__ and __kernel_image.__ __kernel_source__ This target produces a debianised package of the Linux kernel sources. __kernel_headers__ This target produces a Debian package containing the header files included in the Linux kernel. __kernel_doc__ This target produces a Debian package containing the documentation included in the Linux kernel. __kernel_image__ This target produces a Debian package of the Linux kernel source image, and any modules configured in the kernel configuration file ''.config.'' If there is no ''.config'' file in the kernel source directory, a default configuration is provided similar to the one used to create the __Debian__ boot-floppies. At install time, it updates symbolic links in the symlink destination directory (the root directory by default) to point to the new kernel image in the image directory, which is nominally ''/boot.'' If the symbolic link already points to the current kernel image, no action is taken. If a prior symbolic link exists, it is rotated out with a suffix.old, and a new symbolic link, properly updated is installed in its place (the variable minimal_swap in ''/etc/kernel-img.conf'' further modifies this behaviour). On installation, it also offers to run the Linux loader, ''LILO'' (or alternates like ''loadlin, SILO, QUIK, VMELILO, ZIPL, yaboot, PALO'' or ''GRUB'' ), creating a configuration file for supported boot loaders if needed. At that time it also offers to put the new kernel on a floppy, formatting the floppy if needed. On deletion, the package checks the version of the kernel running, and refuses to delete a running kernel. ''grub'' rates a special mention here, since grub may not need to be rerun after installing a kernel image, though an automated change to the menu list would be nice on install and removal of kernel image packages. Please see the documentation about hooks in __kernel-img.conf(5).__ These hooks are variables that can be pointed to scripts that add or remove a line from the grub menu list at kernel image install and remove times. A sample script to add lines to a grub menu file is included in the dir __build__ This target, used by target __kernel_image__ above, compiles the Linux kernel image. __modules__ This target allows you to build all add-on modules and packages that are very dependent on the precise kernel version they are compiled for at the same time you build your kernel image. This target expects to find the modules or packages under /usr/src/modules, and, for all such directories, changes to /usr/src/modules/x, and runs the __kdist__ rule in the local ''debian.rules'' file. This target should create the __Debian__ module package(s), and may also produce a compressed tar file, and a compressed diff file, with ''md5sums'' recorded in a changes file using __dpkg-genchanges.__ The file is signed by the same identity that would be used to sign the kernel packages. This option is used by maintainers uploading the package to the Debian archives. __modules_config__ This target allows you to configure all packages under __/usr/src/modules.__ This is useful if you need to manually modify some aspects of the configuration, or if you want to manually compile the add on modules. __modules_image__ This target allows you to build all packages under __/usr/src/modules,__ but does not create the source or diff files, and does not create and sign a changes file. This is the only modules related option you need if you just want to compile the add on modules image files for installation on one or more machines. Generally called inconjunction with __kernel_image,__ especially if also using the option __append_to_version__ (prevents spurious warnings). __modules_clean__ This target allows you to clean all packages under __/usr/src/modules,__ and this sould be all that is needed to undo the effect of any of the other modules_ targets. __configure__ This target runs configure (actually, __config_target,__ set by __--config__ which defaults to ''oldconfig'' ) early, so you may edit files generated by __make config__ in the kernel source directory and not have them stomped by __make-kpkg__ later. __debian__ This target creates the ''./debian'' directory, and optionally patches the source. This is called by the __configure__ target. You may use this target to have the sources patched, and then manually run the configuration step. __libc-kheaders__ This is a special target for the libc-dev maintainer, who can use it to create the headers package that libc needs. Please note that it is dangerous to create a libc-kheaders package that is different fomr the headers libc was compiled with; it is __known__ to subtly break systems. Please look at ''/usr/share/kernel-package/README.headers'' for details. Creating and installing a self created libc-kheaders package may break your system unless you know what you are doing. You have been warned. !!ENVIRONMENT VARIABLES The following variables (documented aboce) affect __make-kpkg:__ ''DEBIAN_REVISION_MANDATORY APPEND_TO_VERSION VERSION_H_OK PATCH_THE_KERNEL NO_UNPATCH_BY_DEFAULT KPKG_ARCH CROSS_COMPILE KPKG_SUBARCH ARCH_IN_NAME INITRD'' !!FILES Apart from the runtime options, the ''debian.rules'' file run by __make-kpkg__ also looks for a per user configuration file ''~/.kernel-pkg.conf.'' Failing that, it looks for site-wide defaults in the file ''/etc/kernel-pkg.conf.'' The default configuration allows there to be a site wide override for the full name and email address of the person responsible for maintaining the kernel packages on the site, but the ''/etc/kernel-pkg.conf'' (or ''~/.kernel-pkg.conf.'' ) file is actually a Makefile snippet, and any legal make directives may be included in there. __Note:__ Caution is urged with this file, since you can totally change the way that the make is run by suitably editing this file. Please look at ''/usr/share/doc/kernel-package/Problems.gz'' for a list of known problems while compiling kernel images. Extensive tutorial like documentation is also available in ''/usr/share/doc/kernel-package/README.gz'' and it is recommended that one read that before using this utility. !!SEE ALSO kernel-pkg.conf(5), __kernel-img.conf__(5), Getopt::Long(3perl), __dpkg-deb__(1), dpkg-source(1), make(1), __The Programmers manual, The GNU Make manual,__ and the extensive documentation in the directory __/usr/share/doc/kernel-package__ !!AUTHOR This manual page was written by Manoj Srivastava ---- make-kpkg builds packages with files which have root ownership and so forth. Therefore, to use make-kpkg, you need to either have root permissions, or use fakeroot. Here's kind of a walkthrough: http://www.differentpla.net/node/view/153 --EthanGlasserCamp
5 pages link to
make-kpkg(1)
:
kernel-img.conf(5)
kernel-pkg.conf(5)
Man1m
AFSNotes
kernel-package(5)
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.