home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / src / linux-headers-2.6.17-6 / debian / docs / README < prev   
Encoding:
Text File  |  2005-12-01  |  52.2 KB  |  1,075 lines

  1.  
  2.    $Id: README,v 1.66 2003/08/26 01:47:23 srivasta Exp $
  3.  
  4. This is the Debian GNU/Linux prepackaged version of the Linux kernel.
  5. Linux was written by Linus Torvalds <Linus.Torvalds@cs.Helsinki.FI> and
  6. others.
  7.  
  8. This package was put together by Herbert Xu <herbert@greathan.apana.org.au>
  9.  
  10. Linux is copyrighted by Linus Torvalds and others.
  11.  
  12.    This program is free software; you can redistribute it and/or modify
  13.    it under the terms of the GNU General Public License as published by
  14.    the Free Software Foundation; version 2 dated June, 1991.
  15.  
  16.    This program is distributed in the hope that it will be useful,
  17.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  18.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19.    GNU General Public License for more details.
  20.  
  21.    You should have received a copy of the GNU General Public License
  22.    along with this program;  if not, write to the Free Software
  23.    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  24.    02111-1307  USA 
  25.  
  26. On Debian GNU/Linux systems, the complete text of the GNU General
  27. Public License can be found in `/usr/share/common-licenses/GPL'.
  28.  
  29. INSTALLATION NOTES:
  30.  
  31. Before you go any further, please allow me to point out that you need to
  32. have a few other packages installed before you can compile your own kernels
  33. (it is difficult to compile anything without a compiler ;-). 
  34.  
  35. Firstly, you will need gcc, the libc development package (libc5-dev or
  36. libc6-dev at the time of writing), and, on Intel platforms, bin86. [If
  37. you use the menuconfig target of make, you will need ncursesX.X-dev,
  38. and make xconfig also requires either tkX.X-dev for 2.4.X kernels, or
  39. libqt3-mt-dev and g++ >= 3.0 for the new 2.6 kernel versions, and 2.6.X
  40. kernels also have an additional option, make gconfig, which requires
  41. libglade2-dev, and other packages these depend on]
  42.  
  43. The packages suggested are:
  44. devel:        gcc, libc5-dev/libc6-dev, binutils, make, and, for intel
  45.               x86 platforms, bin86 (non-Intel platforms don't need
  46.               this), modutils (or module-init-tools for 2.5.x+ kernels).
  47. interpreters: awk, which is contained in either the mawk or gawk packages
  48. base:         gzip, shellutils, and grep.
  49.  
  50. Some of these packages are marked essential, and hence are going to be
  51. present on your machine already. Others you have to check and install.
  52.  
  53. Also, please note that some versions of gcc do not interact well with
  54. the kernel sources (gcc 2.95 has problems compiling the kernel without
  55. the flag '-fno-strict-aliasing'. This issue has been taken care of for
  56. recent kernels (2.2 and 2.4 series are fine) (I think you may have to
  57. edit the makefile for older kernels, or something).  You may control
  58. which version of gcc used in kernel compilation by setting the
  59. Makefile variables CC and HOSTCC in the top level kernel Makefile. You
  60. can do this simply by 
  61.   % MAKEFLAGS="CC=gcc-3.2" make-kpkg ...
  62. (please see the top level kernel Makefile).
  63.  
  64. Of course, pretty GUI front ends to kernel configuration require more
  65. packages, but they are not strictly essential (though quite nice really). 
  66.  
  67. Oh, and of course, make-kpkg is part of kernel-package, usually found
  68. in section misc.
  69.  
  70.  
  71.  For the Brave and the impatient: (Look for Kent's 10-Step Procedure
  72.  to Compiling a Debian Kernel near the tail end of this file for
  73.  more detailed HOWTO)
  74.  
  75. Phase ONE: Getting and configuring the kernel
  76.  1% cd <kernel source tree> (make sure you have write permission there)
  77.  2% make config # or make menuconfig or make xconfig (or, for 2.6.x
  78.     kernels, make gconfig) and configure
  79.  
  80. Phase TWO: Create a portable kernel image .deb file
  81.  3% make-kpkg clean
  82.  4% $Get_Root make-kpkg --revision=custom.1.0 kernel_image 
  83.       (Get_Root is whatever you need to become root -- fakeroot or
  84.       sudo are examples that come to mind).  NOTE: if you have
  85.       instructed your boot loader to expect initrd kernels (which is
  86.       the norm for recent official kernel image packages) you need to
  87.       add --initrd to the line above.
  88.    % $Get_Root make-kpkg --initrd --revision=custom.1.0 kernel_image 
  89.       Personally, I prefer non initrd images for my personal machines,
  90.       since then adding third party modules to the machine has fewer
  91.       gotchas
  92. Phase THREE: Install the kernel image on one or more machines
  93.  5# dpkg -i ../kernel-image-X.XXX_1.0_<arch>.deb
  94.  6# shutdown -r now # If and only if LILO/SILO/QUIK/PALO/VMELILO/ZIPL/yaboot/..
  95.                     # worked or you have a means of
  96.                     # booting the new kernel. YOU HAVE BEEN WARNED!!
  97.  
  98.  With the addition of fakeroot ( a really nice program, I recommend
  99.  it). Steps 1 to 4 can be carried out as a non root user. Step 5 does
  100.  require root privileges.
  101.  
  102.  If you're using the patch_the_kernel facility, you may want to remove
  103.  step 2 and instead insert `--config=menuconfig' into the make-kpkg
  104.  command-line of step 4 (or perhaps use `xconfig' or `config' (or, for
  105.  2.6.X kernels, `gconfig') in place of `menuconfig').  This way,
  106.  patching the kernel happens before menuconfig (or whichever), and
  107.  you'll get better defaults for any questions introduced by the
  108.  patches. (Also look at the --added_patches command line option to
  109.  selectively apply some patches in conjunction with patch_the_kernel)
  110.  
  111. Getting the kernel source
  112. ------- --- ------ ------
  113.  
  114.  You can get kerel sources in several different ways: by installing a
  115.  prepackaged Debian kernel source package (at the time of writing, it
  116.  is kernel-source-2.4.20_2.4.20-6_all.deb). This shall create a file
  117.  /usr/src/kernel-source-2.4.20.tar.bz2, which can be unpacked wherever
  118.  you wish. Alternately, you can get linux-2.4.20.tar.bz2 from you
  119.  favourite ftp.kernel.org mirror, (/pub/linux/kernel/v2.4/ in the ftp
  120.  site). 
  121.  
  122. Unpacking kernel sources:
  123. -------------------------
  124.  
  125. Some of the suggestions about where to unpack the kernel packages are
  126. a) /tmp/linux
  127. b) /var/tmp/linux
  128. c) /usr/local/src/<whatever>
  129. d) /usr/src/linux-X.X.XX; where X.X.XX is the version number of the
  130.    kernel. 
  131.  
  132. In any case, choose a partition that has a large amount of free space,
  133. since recent kernels, unpacked, run to about 23MB, and you need more
  134. than double that in order to create kernel-image, kernel-source, and
  135. the tar file (that is, if you choose to build everything together with
  136. the dist target in debian.rules -- say if you want, for whatever
  137. reason, to run dchanges on the files created). I needed nearly 60MB to
  138. create the full spectrum of packages for version 1.99.7 (and doubtless
  139. this size will go up in the future) [It has. Now even an gzipped kernel
  140. source is over 23MB].
  141.  
  142. Make sure that the user who is building the kernel has adequate write
  143. permissions in the kernel source tree, and also has write permissions
  144. in MODULES_LOC and its parent directory, or is using sudo or some
  145. other means of getting these write permission while building.
  146.  
  147. [ EXAMPLE
  148. So, suppose you have chosen /usr/local/src/kernel as the place to
  149. build kernels.
  150. % cd  /usr/local/src/kernel # or cd /path/to/where-ever/you/have/space
  151. % tar jvvfx /usr/src/kernel-source-2.4.20.tar.bz2
  152.   (or, tar jvvfx /path/to/download/linux-2.4.20.tar.bz2)
  153.  
  154.     The next two steps are optionsl, you only need them if you are
  155.  going to create third party modules (stuff in
  156.  /usr/src/module-name.tar.gz)
  157.  
  158.  % export MODULE_LOC=/usr/local/src/kernel/modules
  159.  % tar jvvfx /usr/src/some-module.tar.gz
  160. ]
  161.  
  162. Now, cd linux (wherever you have created the kernel sources). Make
  163. sure you have the permission to write in that dir, or that you are
  164. using sudo or some other means of getting this write permission while
  165. building.
  166.  
  167. Configuration File
  168. ------------- ----
  169.  
  170. Kernel package by itself does not create any configuration file
  171. (.config); it uses whatever you have. You can use the previous version
  172. made for you machine by copying it over from /boot/config-Y.Y.YY, like
  173. so:
  174.  % cp /boot/config-Y.Y.YY .config
  175. where Y.Y.YY stands for the old version of the kernel that you had
  176. hand tuned.
  177.  
  178. If you do not wish to copy the old copy over, you can create a new one
  179. from scratch using make menuconfig (please look at the kenrel
  180. documentaion for help on configuring your kernel).
  181.  
  182. Versions and revisions
  183. ----------------------
  184.  
  185. The version number is deduced from the kernel Makefile directly to
  186. ensure that the version numbers are in sync[1], so you don't have to
  187. worry about that.
  188.  
  189. Then, remember to change the revision number (using the --revision
  190. option of make-kpkg).  It has been suggested that you renumber the
  191. revision number in such a way that a generic kernel image package will
  192. not override the custom package while using dselect (or dpkg
  193. -BOGiE). You may also do this on the fly by setting the
  194. DEBIAN_REVISION environmental variable.
  195.  
  196. "--revision" affects the name of the Debian package itself but not the
  197. kernel name, so "uname -r" won't show the revision, and it will use
  198. the same modules as other revisions of the same version.
  199.  
  200. If I may digress to talk about "--append-to-version",
  201. "--append-to-version=bla" affects the name of the Debian package
  202. itself, and also appends the append-to-version text to the kernel name
  203. AND to the modules directory name when dpkg installs the kernel, so
  204. this kernel will have its own set of modules, separate from the
  205. modules used by the default kernel with the same version.
  206.  
  207. The revision number (the argument supplied after the --revision flag)
  208. has certain constraints: 
  209. a) It only has an effect during the configure phase (in other words,
  210.    if a file called stamp-configure exists, this option has no effect
  211.    -- run make-kpkg clean or manually remove stamp-configure,
  212.    stamp-debian, and debian/official for it to have an effect -- I
  213.    strongly suggest make-kpkg clean unless you know what you are
  214.    doing).  Additionally, official source package maintainers provide
  215.    their own version numbers and data for the official uploads, and
  216.    hence a number of things, including the Debian revision, is not
  217.    modified by make-kpkg.  If you happen to have an official source,
  218.    (that would mean that the file debian/official exists), and want to
  219.    use your own revision number, make sure you remove debian/official
  220.    before running make-kpkg clean for this option to have an effect.
  221.    So, if you want to re-run make-kpkg with a different revision
  222.    number, you have to make sure you start with a clean slate.
  223. b) It may contain only alphanumerics and the characters + . (full
  224.    stop, and plus) and should contain a digit.  NOTE: No hyphens
  225.    allowed (Look at the Debian Policy manual for details). Optionally,
  226.    you may prepend the revision with a digit followed by a colon (:);
  227.    this shall put your revision into a new epoch; more on this later.
  228.  
  229. You should _not_ use a "_" in the revision number! As tempting as it may
  230. seem, it actually interferes with the policy.
  231.  
  232. The revision number is required because dpkg imposes an ordering on
  233. version numbers, so that it can tell whether packages are being up- or
  234. downgraded and so that dselect can tell whether a package it finds
  235. available is newer than the one installed on the system. Dselect uses
  236. an option that prevents a package from being downgraded, for example.
  237.  
  238. Packaged kernel-images in the distribution also have a version number -
  239. not at all coincidentally coinciding with the kernel version, because it
  240. is used to reflect the upstream version number. Note that the kernel
  241. version is also part of the package's name, thus it appears twice in the
  242. package's file name. It also gets a debian revision number relating to
  243. differences in builds. It then looks like: 
  244.   kernel-image-2.0.29_2.0.29-8.deb
  245.  
  246. I've found that using a two-level scheme where the major level starts
  247. with a letter nicely does the job -- unless epochs are used,
  248. (--revision custom.Y, so the image package become
  249. kernel-image-X.X.XX-custom.Y.deb), and dselect and dpkg -BOGiE will
  250. refuse to downgrade to a generic kernel (don't give the BOG arguments
  251. to dpkg if you actually do want to downgrade later).
  252.  
  253. The reason for telling kernel-package that the package has a version
  254. "custom-x.y.whatever.you-want.to+add.more-just.do.not+use.an=underscore" 
  255. is that to dpkg that is always a higher version number than any version
  256. number starting with a numeral ( e.g. "a" > "2" like "b" > "a". ) This way,
  257. dselect will not try to upgrade your "roll-it-yourself" kernel-image when
  258. a new build of the distribution default kernel appears in the archive. 
  259.  
  260.  
  261. Unfortunately, this fails if the upstream maintainer uses epochs to
  262. correct a version misnumbering ;-(. The good news is that you can add
  263. your own epoch to your customized image, ugly though that may
  264. be. (--revision 1:custom.Y; the kernel image file shall remain
  265. kernel-image-X.X.XX-custom.Y.deb, but dpkg shall know that it should
  266. not replace that with a standard kernel with an epoch. Hopefully, we
  267. shall never see an epoch greater than 1 on a standard kernel, but who
  268. knows. Choose your epoch, if you must use it, wisely. I fear, though,
  269. that with the introduction of epochs in kernel image versions shame
  270. has entered the garden of eden, and we must forever use epochs to
  271. guard against forced upgrades.
  272.  
  273. So, try using an epoch for your custom packages: 
  274.   make-kpkg clean
  275.   $Get_Root make-kpkg --revision=3:custom.1.0 kernel_image
  276.       (Get_Root is whatever you need to become root -- fakeroot or
  277.       sudo are examples that come to mind).
  278.  
  279. And the next time when you build a kernel, because you just bought a new
  280. sound card or you discovered that you suddenly want masquerading in your
  281. kernel enabled, you'll type: 
  282.   make-kpkg clean
  283.   $Get_Root make-kpkg --revision=3:custom.2.0 kernel_image
  284.       (Get_Root is whatever you need to become root -- fakeroot or
  285.       sudo are examples that come to mind).
  286. (remember to do a make-kpkg clean before you compile again with a
  287. different revision, or else the revision flag shall not have any
  288. effect)
  289.  
  290.  NOTE about using initial ram disk images (initrd).  Recent official
  291.  kitchen sink kernel image packages tend to use this, in order to
  292.  accomodate as wide a vareity of root file system types as humanly
  293.  possible without building them all into the kernel. In order to use
  294.  these images, you need to instruct you boot loader that this is a
  295.  kernel image using intrd, and tell the boot loader where to find the
  296.  initrd image.  Unfortunately, you can't just substitute a non initrd
  297.  image afterwards without changing the boot loader instructions.  So,
  298.  if your boot loader configuration expects to see an initrd image, add
  299.  --initrd to the above invocation, like so:
  300.    make-kpkg clean
  301.    $Get_Root make-kpkg --initrd --revision=3:custom.2.0 kernel_image
  302.  
  303. When make-kpkg is finished, you'll have 
  304. kernel-image-2.0.29_custom.1.0_i386.deb and all it takes now is to
  305. install the package (as root):
  306. # dpkg -i kernel-image-2.0.29_custom.1.0_i386.deb
  307.  
  308. This will install the kernel, the modules, the map file and do some other
  309. administrativia and finally it will ask you if you want to make a
  310. boot floppy and if you want to run lilo now. 
  311.  
  312. Now, there is a caveat: If you already have kernel 2.0.29 installed,
  313. and you have a freshly created custom 2.0.29 kernel [having remembered
  314. to do a make-kpkg clean in between ;-], just installing the new 2.0.29
  315. kernel shall install modules (as it should) in /lib/modules/2.0.29,
  316. which is where the old modules were! If you have added or removed
  317. modules relative to the old 2.0.29 kernel (very likely if your old
  318. kernel was the default gigantic generic kernel), then you shall have a
  319. mish-mash of modules in /lib/modules/2.0.29 ;-(
  320.  
  321. Unfortunately, there is no reasonable solution; I suggest moving the
  322. old modules directory before installation, like so (need to be root):
  323.  
  324.         # mv /lib/modules/2.0.29 /lib/modules/2.0.29.save
  325.         # dpkg -i kernel-image-2.0.29_custom.1.0_i386.deb
  326. and later get rid of the .save directory.
  327.  
  328. People who want to have multiple flavours of the same kernel version
  329. around should look at the append_to_version flag of make-kpkg. This
  330. appends to the EXTRAVERSION variable of the kernel Makefile, and does
  331. not require one to edit that makefile manually.  This can also be done
  332. by setting the environment variable APPEND_TO_VERSION. The command
  333. line invocation overrides the env variable. 
  334.  
  335. You may also place long term directives (like your name and email
  336. address) in the file /etc/kernel-pkg.conf (or ~/.kernel-pkg.conf).
  337. Putting your name and address in that file is a good idea, to remind
  338. you that this is not an official package, unless, of course, you
  339. happen to be the maintainer (Hi Herbert). The file
  340. /etc/kernel-pkg.conf (or ~/.kernel-pkg.conf) is actually a Makefile
  341. snippet included during the kernel packages build process, and hence
  342. you may put any legal Makefile directive in that file (just make very
  343. sure you know what you are doing ;-).
  344.  
  345.         At the moment, the user modifiable variables supported are:
  346.  
  347. maintainer    Local kernel-* package maintainer.  Please note that
  348.                 any apostrophes "'" shall have to be quoted like so: 
  349.                 maintainer = John O'\\''Brien. 
  350.                 Yes, this is ugly, but this works.
  351.  
  352. email           The email address of that person.
  353.  
  354. pgp             Name to search for in the pgp database _iff_ separate
  355.                 modules (like pcmcia etc) are being built in
  356.                 $(MODULE_LOC:-/usr/src/modules)/*. Can be set from
  357.                 environment variable PGP_SIGNATURE. Defaults to
  358.                 maintainer.
  359.  
  360. debian         The Debian revision of the kernel packages. Can be set
  361.         from the environment variable DEBIAN_REVISION. Defaults
  362.         to 1.0.
  363.  
  364. link_in_boot    Set to True if you want the kernel image symlink (vmlinuz)
  365.                 in /boot rather than the default /. Can be set from the
  366.         environment variable LINK_IN_BOOT. Defaults to
  367.         undefined. 
  368.  
  369. kimage        The kernel image type (i.e. zImage or bzImage). Can be
  370.         set from the environment variable IMAGE_TYPE. Defaults
  371.         to bzImage.
  372.  
  373. no_symlinks     Mutually exclusive to reverse_symlinks Can be used with
  374.                 link_in_boot. The image is placed in vmlinuz (instead
  375.                 of /boot/vmlinuz-X.X.XX). The old vmlinuz is moved to
  376.                 vmlinuz.old unconditionally. (Normally, that is only
  377.                 done if the version of the new image differs from the
  378.                 old one). This restricts you to two images, unless you
  379.                 take additional action and save copies of older
  380.                 images. This is for people who have /boot on a system
  381.                 that does not use symlinks (and say, they use loadlin)
  382.                 This is a Hack.
  383.  
  384. reverse_symlinks Mutually exclusive to no_symlinks. Can be used with
  385.                 link_in_boot. Just like no_symlinks, except that the
  386.                 /boot/vmlinuz-X.XX is symlinked to the real new
  387.                 image, vmlinuz. This too restricts you to just two
  388.                 images unless further action is taken. The older
  389.                 symlinks are left dangling. This is for people with
  390.                 /boot on umsdos, and who can't see the link in dos, 
  391.                 but do want to know the image version when in Linux. 
  392.                 This is a Hack.
  393.  
  394. image_dest    If  you  want  the  symbolic  link  (or  image,  if
  395.               move_image is set) to be stored elsewhere than /
  396.               set this variable to the dir  where  you  want  the
  397.               symbolic  link.   Please  note  that  this is not a
  398.               boolean variable.  This may be of help  to  loadlin
  399.               users,  who  may  set  both  this  and  move_image.
  400.               Defaults to /. This can be used in conjunction with
  401.               all above options except link_in_boot, which would
  402.               not   make   sense.   (If   both   image_dest   and
  403.               link_in_boot are set, link_in_boot overrides).
  404.  
  405. patch_the_kernel This is an experts only variable. If set to YES (ENV
  406.                  variable PATCH_THE_KERNEL overrides this), the build
  407.                  process causes run-parts to be run over
  408.                  /usr/src/kernel-patches/$(architecture)/apply and
  409.                  (hopefully) reverses the process during clean by
  410.                  running run-parts over
  411.                  /usr/src/kernel-patches/$(architecture)/unpatch. The
  412.                  special architecture all is used for arch independent
  413.                  patches. You may use the --added_patches command line
  414.                  in conjunction with this variable to selectively
  415.                  apply only some patches from that directory. The
  416.                  people who package the pacthes should have arranged
  417.                  to have the order of application and unapplication be
  418.                  sane. This variable is automatically set to YES if
  419.                  you use the option --added-patches.
  420.  
  421. root_cmd         This should be set to a means of gaining superuser
  422.                  access (for example, `sudo' or `fakeroot') as needed
  423.                  by dpkg-buildpackages' -r option. This is  used
  424.                  to call dpkg-buildpackage with the proper
  425.                  options. The environment variable ROOT_CMD overrides
  426.                  this.
  427.  
  428. do_clean     Set to anything but YES, this shall forego the make
  429.                  clean done in the kernel source tree after building
  430.                  the kernel image package. The environment variable
  431.                  CLEAN_SOURCE overrides this.
  432.  
  433. install_vmlinux  Set to YES to install the uncompressed kernel
  434.                  ELF image along with the bootable compressed kernel
  435.          image (vmlinuz).
  436.          This image is necessary for profiling kernel and
  437.          userspace with oprofile (oprofile.sourceforge.net,
  438.          i386 only).
  439.  
  440. kpkg_follow_symlinks_in_src
  441.               This option is especially useful for people who use
  442.               symlinc farms to compile kernels. With this option,
  443.               kernel-source and kernel-header packages shall not be
  444.               just full of dangling symlinks, instead, the symbolic
  445.               links shall be followed. Please note that any symbolic
  446.               links in the kernel sources woudl be flattened as well.
  447.               The environment variable KPKG_FOLLOW_SYMLINKS_IN_SRC
  448.               overrides this. Symlink farming is described below.
  449.  
  450. make_libc_headers  This is meant to be used by the libc6 maintainer,
  451.                    when he compiles libc6, to also package up the
  452.                    corresponding headers. DO NOT SET THIS as a
  453.                    mismatch between the headers you package and libc6
  454.                    may well create a subtle instability in all code
  455.                    compiled on your machine. You have been warned. The
  456.                    environment variable MAKE_LIBC_HEADERS overrides
  457.                    this. 
  458.  
  459. The value of a variable can be set so: 
  460.   a) Defaults exist in the rules file. These are the values used if no
  461.      customization is done.
  462.   b) Variables can be set in the config file /etc/kernel-pkg.conf (or
  463.      ~/.kernel-pkg.conf).  These values override the defaults.
  464.   c) Variables can also be set by setting a corresponding environment
  465.      variable.  These values override the config file and the defaults.
  466.   d) Using make-kpkg options, or, if using the rules file directly, on 
  467.      command line ( # xxx/rules DEBIAN_REVISION=2.0a kernel_image). This 
  468.      overrides all the above methods.
  469.  
  470. Please see kernel-pkg.conf (5).
  471.  
  472. However, most of these are done on the machine you compile on: but you
  473. may need to install generic kernel image packages from time to time,
  474. and you need control over where the image sticks the symbolic links
  475. and such. With this in mind, there is the configuration file
  476. /etc/kernel-img.conf which sits on the target machine (the machine
  477. that the dpkg -i is run on, which need not be the same machine the
  478. kernel was compiled on), and that allows you to tweak these variables: 
  479.  
  480. This file is automatically created by the installation script if it
  481. does not exist, and neither does the symbolic link /vmlinuz.  The
  482. script asks the user whether the symbolic link should be created, and
  483. stashes the answer into /etc/kernel-img.conf
  484.  
  485. no_symlinks     Mutually exclusive to reverse_symlinks Can be used with
  486.                 link_in_boot. The image is placed in vmlinuz (instead
  487.                 of /boot/vmlinuz-X.X.XX). The old vmlinuz is moved to
  488.                 vmlinuz.old unconditionally. (Normally, that is only
  489.                 done if the version of the new image differs from the
  490.                 old one). This restricts you to two images, unless you
  491.                 take additional action and save copies of older
  492.                 images. This is for people who have /boot on a system
  493.                 that does not use symlinks (and say, they use loadlin)
  494.                 This is a Hack.
  495.  
  496. reverse_symlinks Mutually exclusive to no_symlinks. Can be used with
  497.                 link_in_boot. Just like no_symlinks, except that the
  498.                 /boot/vmlinuz-X.XX is symlinked to the real new
  499.                 image, vmlinuz. This too restricts you to just two
  500.                 images unless further action is taken. The older
  501.                 symlinks are left dangling. This is for people with
  502.                 /boot on umsdos, and who can't see the link in dos, but
  503.                 do want to know the image version when in Linux. 
  504.                 This is a Hack.
  505.  
  506. do_symlinks  By default,  the  kernel  image  post installation
  507.               script shall create or update the /vmlinuz and
  508.               /vmlinuz.old symbolic links.  This is true if a /vmlinuz
  509.               link already exists, however, in absence of /vmlinuz,
  510.               the script looks to see if this configuration file
  511.               exists. If it does not, the configuration script asks
  512.               the user whether to create the symbolic link, and
  513.               stashes the answer in a newly created
  514.               /etc/kernel-img.conf.  If the configuration file already
  515.               exists, and if this option is set to no, no symbolic
  516.               link is ever created. This for people who have other
  517.               means of booting their machines, and do not like the
  518.               symbolic links cluttering up their / directory.
  519.  
  520. link_in_boot    Set to True if you want the kernel image symlink
  521.                 (vmlinuz) in /boot rather than the default /.
  522.                 Defaults to undefined. 
  523.  
  524. image_dest    If  you  want  the  symbolic  link  (or  image,  if
  525.               move_image is set)   to be stored elsewhere than  /
  526.               set this variable to the dir  where  you  want  the
  527.               symbolic  link.   Please  note  that  this is not a
  528.               Boolean variable.  This may be of help  to  loadlin
  529.               users,  who  may  set  both  this  and  move_image.
  530.               Defaults to /. This can be used in conjunction with
  531.               all above options except link_in_boot, which would
  532.               not   make   sense.   (If   both   image_dest   and
  533.               link_in_boot are set, link_in_boot overrides).
  534.  
  535. move_image    Instead  of  creating  symbolic  links  to  (or, if
  536.               reverse_symlinks  is  set,  from)  image_dest,  the
  537.               image  is  moved  from  its  location in /boot into
  538.               image_dest.   If  reverse_symlinks  is  set,  /boot
  539.               shall  contain a symbolic link to the actual image.
  540.               This option can be useful to people using  loadlin,
  541.               who  may need the image to be moved to a  different
  542.               dos partition.  This variable is unset by  default.
  543.  
  544. clobber_modules
  545.               If  set,  the  preinst  shall  silently try to move
  546.               /lib/modules/version out of the way if  it  is  the
  547.               same  version  as the image being installed. Use at
  548.               your own risk.  This variable is unset by  default.
  549.  
  550. do_boot_enable
  551.               If set to NO, this shortcircuits all attempts to create
  552.               boot floppies, run lilo, etc. This has the additional
  553.               side effect that the postinst is silent. Setting both
  554.               do_bootfloppy and do_bootloader to NO implies setting
  555.               do_boot_enable to NO. Defaults to Yes.
  556.  
  557. do_bootfloppy
  558.               If set to NO, this prevents the postinst from asking
  559.               questions about creating a boot floppy, and no boot
  560.               floppy is created. The bootloader shall still be run.
  561.               This may cut down on the interaction the postinst has.
  562.               (It still prompts before formatting /dev/fd0). Defaults
  563.               to Yes.
  564.  
  565. do_bootloader
  566.               If set to NO, this prevents the postinst from running
  567.               the bootloader. The user may still be asked to create a
  568.               floppy, unless do_bootfloppy is also set to NO. Defaults
  569.               to Yes.
  570.  
  571. postinst_hook
  572.               Set this variable to a script to be executed during
  573.               installation after all the symbolic links are  cre-
  574.               ated,  but before running the bootloader or  offer-
  575.               ing to create a floppy. This script shall be called
  576.               with  two arguments, the first being the version of
  577.               the kernel image, and the second argument being the
  578.               location  of the kernel image itself. Errors in the
  579.               script shall produce a warning message,  but  shall
  580.               be  otherwise  ignored.  An example script for grub
  581.               users is present in  /usr/share/doc/kernel-package/
  582.               directory.
  583. postrm_hook
  584.               Set this variable to a script to be executed in the
  585.               postrm (that is, after the image has been  removed)
  586.               after  all  the remove actions have been performed.
  587.               This script shall be called with two arguments, the
  588.               first  being  the  version of the kernel image, and
  589.               the second argument being the location of the  ker-
  590.               nel  image  itself. Errors in the script shall pro-
  591.               duce a warning  message,  but  shall  be  otherwise
  592.               ignored.
  593.  
  594. Please see kernel-img.conf (5).
  595.  
  596.  
  597. To generate a new kernel image, just run
  598. % make-kpkg clean
  599. % $Get_Root make-kpkg --revision=custom.1.0 kernel_image
  600.       (Get_Root is whatever you need to become root -- fakeroot or
  601.       sudo are examples that come to mind) or (if you use initrd)
  602.    $Get_Root make-kpkg --initrd --revision=3:custom.2.0 kernel_image
  603.  
  604. This will create a default kernel image (as in the image package or
  605. available on the boot disks.  The kernel image package produced, on
  606. installation, shall offer you a chance to create a boot disk, or to
  607. run LILO (or SILO, QUIK, VMELILO, ZIPL, yaboot, PALO, or update the
  608. grub menu), but the default is not to do either, and you may choose to
  609. ignore these friendly overtures by the postinst.
  610.  
  611. If you want a custom kernel, you may generate a config file by any of
  612. these methods (just follow the directions).
  613. % make config          # boring old tty based method
  614. or
  615. % make menuconfig      # curses based menu driven method (uses color if 
  616.                          you have any)
  617. % make xconfig         # An X window system based method -- make sure
  618.                          you are running X windows when you call this.
  619. % make gconfig         # The gnome version, if you have version 2.6.X.
  620. All these methods ultimately generate a .config file.  If you already 
  621. have a .config file, just copy it to this directory, and you are go.
  622.  
  623. With a custom .config file in place (created as above) run again:
  624. % make-kpkg clean
  625. % $Get_Root make-kpkg --revision=custom.1.0 kernel_image
  626.       (Get_Root is whatever you need to become root -- fakeroot or
  627.       sudo are examples that come to mind).
  628.    $Get_Root make-kpkg --initrd --revision=3:custom.2.0 kernel_image
  629.  
  630. |-----------------------------------------------------------------------|
  631. |                           Special needs                               |
  632. | Or, for people who want to minimize time spent in fakeroot (for       |
  633. | whatever reasons that maybe -- I think that the separate step as      |
  634. | non-fake-root is not required, but that is a personal opinion)        |
  635. | % make-kpkg clean                                                     |
  636. | % make-kpkg  --revision=custom.1.0 build                              |
  637. | % $Get_Root make-kpkg --revision=custom.1.0 kernel_image              |
  638. |     (Get_Root is whatever you need to become root -- fakeroot or      |
  639. |     sudo are examples that come to mind)                              |
  640. |                                                                       |
  641. | For people who wish to see the username (not root) when they do a     |
  642. | uname -a on the machine when they install the kernel, there is a      |
  643. | trick:                                                                |
  644. |  % make config                                                        |
  645. |  % make-kpkg build                                                    |
  646. |  % $Get_Root make -f debian/rules stamp-kernel-image                  |
  647. | shall generate a kernel image with the username of the user embedded  |
  648. | in it.                                                                |
  649. |                                                                       |
  650. | If you use initrd images (and have told your boot loader so) you need |
  651. | to include the --initrd option on the command line, like so           |
  652. |                                                                       |
  653. | % $Get_Root make-kpkg --initrd --revision=3:custom.2.0 kernel_image   |
  654. |                                                                       |
  655. -------------------------------------------------------------------------
  656.  
  657. To create a source or header package, run
  658. % make-kpkg clean
  659. % $Get_Root make-kpkg --revision=custom.1.0 kernel_source
  660. % $Get_Root make-kpkg --revision=custom.1.0 kernel_headers
  661. Note: You only need one of these.
  662.       (Get_Root is whatever you need to become root -- fakeroot or
  663.       sudo are examples that come to mind).
  664. Here is a nice, practical example:
  665. % make-kpkg -rfakeroot --append-to-version $(hostname) \
  666.                --revision $(date +'%Y%m%d')
  667.  
  668. Similarly, the documentation package is built by:
  669. % $Get_Root make-kpkg --revision=custom.1.0 kernel_doc
  670.  
  671. Or if you want to generate the whole package, 
  672. % $Get_Root make-kpkg --revision=custom.1.0 \
  673.             --pgpsign="Your pgp ID" buildpackage
  674. Note that this needs a pgp key.
  675.       (Get_Root is whatever you need to become root -- fakeroot or
  676.       sudo are examples that come to mind).
  677.  
  678. A note on boot loaders: the kernel-image install-scripts arrange to
  679. have /vmlinuz and /vmlinuz.old point to the latest kernel image and
  680. the next most recent one, respectively.  You may choose to have your
  681. boot loader take advantage of this by putting image = /vmlinuz and
  682. image = /vmlinuz.old lines in your lilo.conf (or whatever config files
  683. your boot loader uses -- please read documentation on your boot loader
  684. for details). Oh, and if your kernel image package uses initrd (as do
  685. the newer official kernel image packages), please do not forget to add
  686. a line (initrd=/boot/initrd-2.4.X-foo) in your lilo.conf file
  687. pointing out this fact to your boot loader.
  688.  
  689. Conversely, people who wish to tightly control the versions in
  690. lilo.conf (believe me, people, this gets to be a pain in the neck
  691. fast) can use image = /boot/vmlinuz-X.X.XX.
  692.  
  693. For folks using grub, there are now postinst_hook and postrm_hook
  694. variables that can be pointed to scripts that add or remove  a line
  695. from the grub menu list at kernel image install and remove times. A
  696. sample script to add lines to a grub menu file is included in the dir
  697. /usr/share/doc/kernel-package/; and simple scripts like:
  698.  
  699.   # perl -nle 'print unless /^#Autogenerated by kernel-image $version/ \
  700.                         .. /^#End kernel-image '$version/'
  701.  
  702.  or for awk fans
  703.   #  awk 'BEGIN{printit=1} 
  704.       /^#Autogenerated by kernel-image $version/{printit=0}
  705.       /^#End kernel-image '$version/{printit=1}
  706.       {if (printit) {print}}'. 
  707.  or
  708.   #  awk '{p=0} 
  709.           /^#Autogenerated by kernel-image $version$/,
  710.           /^#End kernel-image '$version$/ {p=1}
  711.      {if(!p) print}' < foo
  712.  
  713.  can be put in a script and added to the postrm hook script to remove
  714.  the lines added by kernel_grub_conf.sh
  715.  
  716. So that loadlin people don't feel left out, all this talk about LILO
  717. does not mean to ignore loadlin, you can use the generated
  718. kernel-image just as easily (simply ignore the fol-de-rol with symlinks
  719. in /). For instance, you could:
  720.  
  721.  [1]# dpkg -BRGiE kernel-image-X.X.XX, # need to be root
  722.         and then
  723.  [2]% cp /boot/vmlinuz-X.X.XX <place where loadlin needs image>
  724.  [3]% echo '' > /boot/vmlinuz-X.X.XX
  725.  
  726.         So you don't have the image taking up space, but still leave a
  727. target for the /vmlinuz symlink.
  728.  
  729.  MODULES_LOC, SYMLINK FARMING, AND MORE
  730.  ============ ======= ======== === ====
  731.  
  732. Oh, a quick recipe for people who want to build kernel-module
  733. packages, and don't want to be root to do so (the following assumes
  734. /usr/local/src/kernel is an appropriate location to build kernels):
  735.  
  736. ###############################################################################
  737. # % sudo echo 'MODULE_LOC=/usr/local/src/kernel/modules' \                    #
  738. #                                             >> /etc/kernel-pkg.conf         #
  739. # % sudo echo 'debian := 5:501c' >> /etc/kernel-pkg.conf                      #
  740. # % sudo mkdir -p /usr/local/src/kernel/modules                               #
  741. # % sudo chown -R $(id -n -u) /usr/local/src/kernel/                          #
  742. # % sudo aptitude install cryptoapi-core cryptoloop # for example             #
  743. #                                                                             #
  744. #         Now, we no longer need to be root                                   #
  745. #                                                                             #
  746. # % cd /usr/local/src/kernel/                                                 #
  747. # % wget ftp://ftp.us.kernel.org/pub/linux/kernel/v2.4/linux-2.4.21.tar.bz2   #
  748. # % tar zvvfx /usr/src/cryptoapi-core.tar.gz                                  #
  749. # % tar zvvfx /usr/src/cryptoloop.tar.gz                                      #
  750. # % tar jvvfx linux-2.4.21.tar.bz2                                            #
  751. # % mkdir 2.4.21                                                              #
  752. # % cd 2.4.21                                                                 #
  753. # % lndir ../linux-2.4.21                                                     #
  754. # % cp /boot/config-2.4.20 .config                                            #
  755. # % make-kpkg --rootcmd fakeroot --append-to-version -cryptoloop kernel_image #
  756. # % fakeroot make-kpkg --append-to-version -cryptoloop modules_image          #
  757. ###############################################################################
  758.  
  759.     The above also demonstrates a technique called symlink farming. I like
  760.  to upgrade between kernel version using patches from
  761.  ftp.us.kernel.org; so I need to keep a source tree in as near a
  762.  pristine state as I can. Once I have
  763.  /usr/local/src/kernel/linux-2.4.20, say, I do this:
  764. #########################################################################
  765. #  last_version=2.4.18                        # I never went for 2.4.19 #
  766. #  for machine in kallissin ember smaug scatha glaurung, tiamat ;do     #
  767. #    mkdir $machine                                                     #
  768. #    scp $machine:/boot/config-$last_version $machine/.config           #
  769. #    cd $machine                                                        #
  770. #    lndir ../linux-2.4.20                                              #
  771. #    cd ..                                                              #
  772. #  done                                                                 #
  773. #                                                                       #
  774. #  for machine in kallissin ember smaug scatha glaurung, tiamat ;do     #
  775. #    if [ -f . configdirs/$machine ]; then                              #
  776. #      . configdirs/$machine                                            #
  777. #      # $patches is now either empty, or it has --added-patches=a,b    #
  778. #    fi                                                                 #
  779. #    cd $machine                                                        #
  780. #    make-kpkg --rootcmd fakeroot --append-to-version $machine \        #
  781. #        $patches $modules kernel_image                                 #
  782. #    if [ "X$modules" != "X" ]; then                                    #
  783. #       fakeroot make-kpkg  --append-to-version $machine \              #
  784. #            $patches $modules modules_image                            #
  785. #    fi                                                                 #
  786. #    make-kpkg clean                                                    #
  787. #  done                                                                 #
  788. #########################################################################
  789.  
  790.         See? Each lndir directory only has files that were patched, or
  791.  object files; and the ../linux-2.4.20 is pristine, ready to be
  792.  patched up to 2.4.21.
  793.  
  794.  
  795. Recompiling a kernel image
  796. ----------- - ------ -----
  797.  
  798. It happens to all of us. When we configured the kernel, we missed out
  799. on an module. Or we added in more things than we really need, and need
  800. to compile again. If you just recompile a kernel image, it shall, when
  801. installed, contain the same /boot/{System.map,config,vmlinuz}-X.X.XX
  802. files and the /lib/modules/X.X.XX directory that the previous kernel
  803. image contained.
  804.  
  805. If you try to install the recompiled kernel image over the previous
  806. kernel image (same version), then the install scripts
  807. detect that, and ask you to move at least the /lib/modules/X.X.XX dir
  808. away. If you continue anyway, the files in /boot shall be overwritten. 
  809.  
  810. Also, if you try to recompile with a changed --revison option or a
  811. different debian revision, you shall have to make-kpkg clean, and then
  812. recompile. 
  813.  
  814. Tecras and other notebooks 
  815. --------------------------
  816.           (Many thanks to Philip Hands <phil@hands.com> and
  817.            Avery Pennarun <apenwarr@worldvisions.ca> for this explanation)
  818.  
  819. Tecras and other notebooks, and some PCs have a problem where they
  820. fail to flush the cache when switching on the a20 gate (IIRC), which
  821. is provoked by bzImage kernels, but not by zImage kernels. 
  822.  
  823. bzImage files are actually "big zImage" not "bzipped Image".  bzImage
  824. kernels can be as large as you like, but because they need to decompress
  825. into extended memory, they aggravate this problem.  zImage kernels just
  826. compress into conventional memory, so they never need to touch the a20 gate,
  827. but they hit the 640k limit.
  828.  
  829. There are two solutions that I know of:
  830.  
  831.   1) Apply a patch, which flushes the cache.  Unfortunately this
  832.      causes other machines to crash so is not universally applicable
  833.      (hence the tecra disks being segregated from the mainstream).
  834.  
  835.   2) Build a zImage, rather than bzImage kernel.  This seems to get
  836.      round the problem. use the --zimage option to make-kpkg, or even
  837.      set this as the default in /etc/kernel-pkg.conf (or
  838.      ~/.kernel-pkg.conf).
  839.  
  840. There some add-on modules that hook into make-kpkg and the kernel
  841. sources so that they may be kept in synchrony with the kernel you
  842. run. If you have such a module source package, for example,
  843. pcmcia-source, then please read README.modules as well. If you don't
  844. never mind. (The file is in /usr/share/doc/kernel-source-X.X.XX/. If you
  845. don't have kernel-source packages installed [that's OK], there is a
  846. copy in /usr/share/kernel-package/README.modules).
  847.  
  848. Have fun,
  849.  
  850.     Manoj Srivastava
  851.  
  852.  
  853. Foot note 1:
  854.   For an explanation on why this synchronization is required, consider
  855.   this. The kernel knows what version it is, as given in the kernel
  856.   Makefile as the variables VERSION, PATCHLEVEL, and SUBLEVEL. It will
  857.   look for the modules in /lib/modules/$VERSION.$PATCHLEVEL.$SUBLEVEL.
  858.   The Debian scripts think they know what the kernel version is, as
  859.   given in the Debian file rules as the variable v (near the top). It
  860.   then proceeds to put the modules in /lib/modules/$v.  So, it is
  861.   essential that the kernel (Makefile) and the Debian script (rules)
  862.   agree about the version number, or the kernel will never figure out
  863.   where the Debian scripts hid the modules. So change the version
  864.   number in the file rules (v = X.X.XX) to be the same version as
  865.   given in the kernel Makefile (this will be
  866.   $VERSION.$PATCHLEVEL.$SUBLEVEL).
  867.  
  868. #############################################################################
  869. #############################################################################
  870. ## This is a working script contributed by Don Armstrong 
  871.  
  872. #!/bin/sh
  873. # Copyright 2004 Don Armstrong (~don@archimedes.ucr.edu)
  874. # This script is licensed under the GPL v2
  875. KERNEL="linux-2.4.24"
  876. MAKE_KPKG="make-kpkg"
  877. EXTRAVERSION=`date +'%m%d%Y'`
  878. MAKE_KPKG_OPTIONS="--rootcmd fakeroot --revision=$EXTRAVERSION"
  879. DATE=`date +'%m_%d_%Y'`
  880.  
  881. for CONFIG in `cd config; ls *.gz; cd ..`; do
  882.          MACHINE=$(echo $CONFIG|cut -d _ -f 1);
  883.          gzip -dc config/$CONFIG > $KERNEL/.config
  884.          cd $KERNEL
  885.          $MAKE_KPKG $MAKE_KPKG_OPTIONS --append-to-version $MACHINE clean
  886.          $MAKE_KPKG $MAKE_KPKG_OPTIONS --append-to-version $MACHINE kernel_image modules_image
  887.     gzip -c .config > ../config/${MACHINE}_config_${KERNEL}_${DATE}.gz
  888.     cd ..;
  889. done;
  890.  
  891. #############################################################################
  892. #############################################################################
  893.  
  894.  
  895. -- 
  896. Manoj Srivastava                        <srivasta@debian.org>
  897. PGP Key ID: 1024/C7261095 
  898. Key fingerprint =  CB D9 F4 12 68 07 E4 05  CC 2D 27 12 1D F5 E8 6E 
  899. ======================================================================
  900.  
  901.  
  902.  
  903.     Kent's 10-Step Procedure to Compiling a Debian Kernel
  904.           Kent West <westk@nicanor.acu.edu>
  905.  
  906. (I may leave a step or two out, but this is the gist. This example
  907. uses the latest kernel version at the time of writing, which was
  908. 2.4.18)
  909.  
  910. 1. Run "dselect". Choose "Update". Choose "Select". "space bar" to get
  911.    out of the Help screens. Use "/" (without the quotes) to start
  912.    search.  Search for "kernel-source". Mark for installation the
  913.    2.4.18 or so.
  914.  
  915. 1b. Use "/" to search for "kernel-package". Mark it for installation 
  916.     also. "Enter" to get back to the main dselect menu.
  917.  
  918. 1c. Choose "Install". This will download a file in /usr/src with a .tgz 
  919.     extension, as well as install "kernel-package".
  920.  
  921. 2. "cd /usr/local/src"
  922.  
  923. 3. "bunzip2 /usr/src/kernel-source-2.4.18.tar.bz2" (or whatever the file is 
  924.    named). This will unzip (decompress) the file.
  925.  
  926. 4. "tar -xvf kernel-source-2.4.18.tar". This will untar the file (x
  927.    means extract, v means "be verbose", f means "use the file named
  928.    ...").  A new subdirectory named kernel-source-2.4.18 will be
  929.    created with all the untarred files under it. You can also do steps
  930.    3 and 4 in one tar command, but I never do; habit is the only
  931.    reason. I think you just add the "j" switch to tar, such as "tar
  932.    -xvjf 'filename'". (It used to be the I switch to tar, but they
  933.    moved from I to j).
  934.  
  935.  
  936. Pause and Breathe. You now have the kernel sources installed. You 
  937. haven't done anything with them yet, but they're installed.
  938.  
  939. 5. "cd /usr/local/src/kernel-source-2.4.18" 
  940.  
  941. 6. "make menuconfig". This will start a curses-based (text-based) 
  942.      menu-driven application. There are a lot of choices here, and
  943.      many of them won't make sense to you at all. Take the time to
  944.      look at most all of them (some of them you'll know you don't
  945.      need, like SCSI support if you have an all-IDE system, or Amateur
  946.      Radio Support if you're not a ham) and read the HELP on them if
  947.      they look relevant. A lot of the time the HELP will suggest
  948.      whether you should include it or not, and generally when in
  949.      doubt, leave things set the way they are. Some things to check
  950.      out:
  951.        * the correct processor for your system (AMD vs Pentium vs P4, etc)
  952.        * Symmetric Multi-Processing; "No" if you only have a single processor
  953.        * Loadable module support; "Yes" to all three sub-items.
  954.        * Parallel port support; "Yes" if you have a parallel
  955.          printer. "No" to keep things simple for now if you can live
  956.          without the printer for a while. 
  957.        * Plug-N-Play; "Yes"; ISA P-N-P; only if you have any ISA cards
  958.          installed. 
  959.        * Character devices; turn on Direct Rendering if your video card is 
  960.          listed, and turn on agpgart if your video chipset is listed;
  961.          mice if you  have a PS/2 mouse
  962.        * Sound - find the driver for your card
  963.        * Input core support (some USB stuff needs this, but I'm hazy
  964.          on it - use your best guess) 
  965.        * USB support (make your best guesses; I'm hazy on it)
  966.        * You probably won't need to touch the following:
  967.               - General Setup
  968.               - Memory Technology
  969.               - Block devices
  970.               - Multi-device support
  971.               - Networking options
  972.               - Telephony support
  973.               - ATA/IDE/MFM/RLL support
  974.               - Fusion MPT device support
  975.               - I20 device support
  976.               - Amateur Radio support
  977.               - Infrared support
  978.               - ISDN subsystem
  979.               - Old CD-ROM drivers (unless you have a non-ATAPI CD-ROM
  980.                 drive for now; wait till you've compiled a kernel or
  981.                 two) 
  982.               - Multimedia devices (unless you have a tv tuner, etc;
  983.                 too complicated for now; wait) 
  984.               - File Systems (unless you'll be accessing a
  985.                 DOS/FAT/NTFS/etc partition, or Windows shares via smb,
  986.                 etc) 
  987.               - Console Drivers (play with different text modes at bootup)
  988.               - kernel hacking
  989.  
  990.      It's by turning off unneeded stuff that the hackers get their kernels 
  991.      down in size and up in efficiency. But you're not really worried about 
  992.      either at this point.
  993.  
  994. 6b. Exit and save your configuration. This will create a hidden file
  995.     named ".config" in the "/usr/local/src/kernel-source-2.4.18"
  996.     directory. You could edit this file directly to make changes to
  997.     your configuration, but I wouldn't. All that this step (6 and 6b))
  998.     has done is to set up this configuration file. This file is read
  999.     by the actual kernel compilation process to compile the options
  1000.     you've specified.
  1001.  
  1002.  
  1003. Pause and breathe again. You have now configured your options for the 
  1004. next kernel compilation, but you have not yet compiled it.
  1005.  
  1006.  
  1007. 7. Compile the kernel: use the command "make-kpkg clean; make-kpkg
  1008.    kernel_image". This will cause a bunch of grinding and text;
  1009.    depending on the speed of your computer and the options you chose,
  1010.    this could take minutes (fast computer) to hours (slow
  1011.    computer). This step is a Debian-way of compiling the kernel. The
  1012.    "other" way is to do it manually, which consists of several steps
  1013.    such as "make dep" and "make modules" and "make modules_install"
  1014.    and manually finding and moving the kernel to where it needs to be
  1015.    and setting up symlinks and configuring lilo.conf and running
  1016.    lilo. The Debian-way is much easier. The result will be a file
  1017.    named something like "kernel-image-2.4.18_2.4.18-10.00.Custom_i386.deb",
  1018.    one level up, in "/usr/local/src".
  1019.  
  1020.    You can try reading the documentation in the "kernel-package"
  1021.    package.  A more complicated comman line to build your kernel
  1022.    image, with all kinds of bells and whistels, is:
  1023.  
  1024.    make-kpkg clean   
  1025.    make-kpkg -rootcmd fakeroot --append-to-version -custom.${VER} \
  1026.         --revision custom.${VER} kernel_image modules-image
  1027.    This one also builds any standalone modules packages you may have
  1028.    installed on your machine.
  1029.  
  1030.  
  1031. Pause and breathe. You have now compiled your kernel and made a .deb 
  1032. file out of it for easy installation.
  1033.  
  1034.  
  1035. If you're (re)compiling a kernel with the same version number as your
  1036. current version, you'll probably want to run the command "mv
  1037. /lib/modules/2.[whateverversion] /lib/modules/2.[whateverversion].old"
  1038. to move the old modules out of the way in preparation for the creation
  1039. of new modules. If you forget, then step 8 shall warn you that you
  1040. need to do this before it overwrites the old modules, and you can just
  1041. open a new terminal and do it then without canceling whichever step it
  1042. concerns. This is only applicable when (re)compiling the same version
  1043. number of kernel as your existing version.
  1044.  
  1045. 8. Install the new .deb file. Use the command "dpkg -i
  1046.    /usr/local/src/kernel-image-2.14.18*.deb". This will install the
  1047.    new kernel to where it needs to be (and I believe configure
  1048.    /etc/lilo.conf if [and only if] /etc/lilo.conf does not exist) and
  1049.    run lilo.
  1050.  
  1051.  
  1052. Pause and breathe. You are ready for a reboot to start running your new 
  1053. kernel. Make sure you have a backup method for getting into your box (a 
  1054. Debian install CD, or boot floppy, etc) in case something goes
  1055. wrong. I generally have a lilo.conf file that includes at least one
  1056. other image than /vmlinuz and /vmlinuz.old
  1057.  
  1058.  
  1059. 9. Reboot. After the reboot, you should be running the new kernel.
  1060.    Typing "uname -a" will tell you what version of kernel you are
  1061.    running.  Test the machine and see if things work properly.
  1062.  
  1063.  
  1064. Pause, breathe, celebrate. You've successfully compiled and installed 
  1065. your first kernel! You may not have a working sound card or USB stuff 
  1066. yet, and other things may have broken, but now that you know the basic 
  1067. procedure you can go back and try again.
  1068.  
  1069. 10: Celebrate.
  1070.  
  1071.  
  1072. Have fun!
  1073.  
  1074. Kent
  1075.