Penguin
Blame: KernelPackageNotes
EditPageHistoryDiffInfoLikePages
Annotated edit history of KernelPackageNotes version 4, including all changes. View license author blame.
Rev Author # Line
1 DanielLawson 1 Perhaps fitting. Kernel compilation can be a real pain in the ass, especially if you forgot to do a make modules_install on a machine on a remote network, or forget that you have drivers that are outside the kernel tree, such as your NVidia graphics card drivers, that you need to compile as well.
2
3 Debian provides a framework for managing this. The kernel-package provides the capability to make a debian kernel-image package for you. Here's some basic instructions -- although I recommend you read the kernel-package docs too, as they are pretty good.
4
4 MattBrown 5 !!! Creating a Debian kernel package for your machine.
1 DanielLawson 6
4 MattBrown 7 !Install kernel-package
8 apt-get install kernel-package
1 DanielLawson 9
4 MattBrown 10 ! Untar your kernel source
11 Put it somewhere, maybe /usr/src/. Go through the normal steps of configuring it (eg, make menuconfig)
1 DanielLawson 12 make-kpkg clean
13
4 MattBrown 14 ! Build the actual package
15 This will create a .deb for you, but before you do this you have to decide if you want to set a revision number or a version tag. The revision number is basically the version of this package. Use --revision N to set it. You should use revision 1 for the first kernel package you build for each version. When you update the package (perhaps to add in an option you forgot the first time) simply increment the revision and recompile.
1 DanielLawson 16
17 You can also set a version tag. This goes in the 'EXTRAVERSION' field of the kernel version. If you have installed a pre-packaged kernel for most distributions before, you'll have seen this. Eg: 2.4.18-bf24, one of debians install kernels, has the EXTRAVERSION tag of 'bf24'.
18 More importantly, the extraversion is reported in 'uname -r' output, and is also used to locate the modules for the kernel (they reside in /lib/modules/`uname -r`/ ). If you change the EXTRAVERSION for every kernel you build, you dont run into problems with the module tree still existing, or wanting to be overridden.
19
4 MattBrown 20 For example, I use an EXTRAVERSION of "-smp" to indicate that this is an [SMP] kernel. If I build a UP kernel as an emergency kernel for the OS, I use "-up", and so on. If there are any extra patches I have applied to this kernel, for example the pre-emptive multitasking patch, I mention that: "-preempt". And so on. This basically means you can keep track of what features a kernel has, simply by checking its extraversion tag - or its .deb package name
1 DanielLawson 21
4 MattBrown 22 Use the '--append-to-version' command in make-kpkg to set this: --append-to-version=-smp
1 DanielLawson 23
4 MattBrown 24 Finally, to get make-kpkg to build this kernel you give it the target of 'kernel_image'. This creates a .deb with the kernel image, system map, config file for the kernel, and the kernel modules tree. When you install the .deb, if you set up your /etc/kernel-img.conf correctly it'll even configure your bootloader for you.
1 DanielLawson 25
4 MattBrown 26 make-kpkg -revision=1 --append-to-version=-smp kernel_image
1 DanielLawson 27
2 DanielLawson 28 ls ../*.deb
4 MattBrown 29 kernel-image-2.4.20-smp_1_i386.deb
1 DanielLawson 30
31 ----
4 MattBrown 32 !!! Building External Modules
33
1 DanielLawson 34 Another feature of make-kpkg is that it will build .debs for any module sources you have installed that are outside the kernel tree. The condition is that they must exist in /usr/src/modules - which is the case if a debian source package existed for them. One example of this is lm-sesnors.
35
36 The lm-sensors-source package contains the file /usr/src/lm-sensors.tar.gz. If this is untarred, it extracts into /usr/src/modules/lm-sensors/. If you specify the 'modules_image' target, it'll build the kernel modules out of all subfolders in /usr/src/modules and create .deb package for each tree (eg, lm-sensors in this case) built against the kernel you are configuring
37
38 eg:
39
4 MattBrown 40 make-kpkg -revision=1 --append-to-version=-SMP kernel_image modules_image
2 DanielLawson 41 ls ../*.deb
4 MattBrown 42 kernel-image-2.4.20-smp_1_i386.deb
43 lm-sensors-2.4.20-smp_2.6.3-5+1_i386.deb
44
45 ----
46 !!! Building Kernels for Distribution
47
48 If you are building kernel packages for your own private repository to use on more than one machine, or you have a single base configuration that you need to compile for multiple architectures or flavours of machine then you probably want to make use of the Debian kernel package architecture instead of using make-kpkg directly.
49
50 There is a good HOWTO on doing this at http://kernel-handbook.alioth.debian.org/index.html
3 PerryLorier 51
52 ----
53 CategoryKernel CategoryDebian

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach()