[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RE-COMPILING the Kernel...



In message <[🔎] TCPSMTP.17.7.7.9.53.26.2645132977.722473@worldgroup.ourtownusa.com>
, writes:
  >Just so I know and have my ducks in order.
  >
  >Is this the correct method for re-compiling my Kernel??
  >
  >cd /usr/src/Linux

or /usr/src/linux or whatever

This is where the kernel source is stored, of course.

  >make config

If you're running X-windows with tk/tcl libraries installed, make xconfig
is much nicer, or make menuconfig, if you aren't running X.

This step lets you set up the config.h file which governs what parameters
are built into your kernel.  For example, the Debian kernel comes with
support for a large number of different network cards; but you will
probably need only one.  You therefore configure your kernel with that
driver alone, excluding the rest.  You also choose which bits of Linux
can be loadable modules and which must be permanently loaded in the kernel.

  >make dep

This creates dependency lines in the Makefile according to the choices
which are now defined in config.h

make clean

might be a good idea at this point.

  >make zImage

creates a bootable kernel in arch/<architecture>/boot, called zImage

If (at the configuration stage) you choose a lot of options to be included
in the kernel, it may become too big to be a zImage.  (The reasons for this
are explained in the lilo documentation - it's to do with the small amount
of memory available to the BIOS on a pc.)  In that case, you should make
bzImage instead.

These makefile targets are specific to Intel architecture; I don't have
experience of Linux on other architectures, but inspection of the
makefiles shows some quite different methods.


Unless you have chosen not to use kernel modules at all; which, in general,
would be ill-advised, you should now

make modules

which compiles the kernel code which is to be held in loadable modules
rather than being built into the kernel; and

make modules_install

which is rather obvious, really.
Modules are installed in /lib/modules/<kernel_version>

  >make zdisk

copies zImage (or bzImage) onto the floppy disk /dev/fd0

  >make zlilo

renames /vmlinuz to /vmlinuz.old;
copies zImage (or bzImage) to /vmlinuz;
runs lilo to set up /vmlinuz as the new kernel to be booted - this is
particularly important, since, without it, the machine will no longer
be bootable.



-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                                  http://lfix.co.uk/oliver

     Make it idiot-proof, and someone will breed a better idiot.


Attachment: pgp9KtkupM8lq.pgp
Description: PGP signature


Reply to: