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

Re: newbie help

trent@ebox.tninet.se wrote:
> I do have one little thing that I am stuck on.  I am trying to
> recompile the kernel and I am trying to follow the
> /usr/doc/kernel-package Readme file but I am not understanding the
> first step.  I have kernel-source 2.2.12.tar.gz in /usr/src now.  Do I
> need to gunzip it then un-tar it and then do the make config.  The
> read me talk about where to unpack it but i am not sure about the
> unpacking part. Any help is greatly appreciated.
> Clyde

>From within the /usr/src directory, as root:

	gunzip kernel-source-2.2.12.tar.gz

this unzips the file

	tar -xvf kernel-source-2.2.12.tar

this breaks the one file into it's constitutuent parts, placing them in
a directory named kernel-source-2.2.12

	ln -x kernel-source-2.2.12 linux

this creates a symbolic link (in MS-speak, a "shorcut" sort of, but not
really) to the newly created directory.

	cd linux

change into the newly-created kernel-source-2.2.12 directory.

read the docs in this directory, particularly README

	make menuconfig

runs a text-based app to pick-and-choose what features your kernel will
have, and what modules, if any, to compile. Can also use "make config"
(older, uglier, text-based config) or "make xconfig" (X-based graphical
config). Presents a lot of tough questions for a newbie, but you can't
hurt anything (well, not much) as long as you keep some method of
booting off your old kernel.

	make clean

cleans out kruft from other compilation attempts.

	make dep

to set up dependencies.

Insert a blank floppy in the first floppy drive.

	make zdisk

to actually compile the kernel,	placing it on the floppy. Can also use
"make zImage" (not compressed) or "..bzImage" (for a compressed kernel)
or "...zlilo", etc. These other methods require more work, but make it
possible to boot straight from the hard drive. The floppy is safer and
simpler for now. Tackle booting from the hard drive later.

	make modules				

Compiles the modules that you marked during the "make menuconfig" phase.
This is not necessary to have a functioning kernel, but is necessary to
use the modules which add functionality to the kernel, such as sound
support or AppleTalk support, etc, some of which may be necessary for a
functioning system (NIC support for network connectivity, etc). This
functionality can be compiled into the kernel directly instead of using
modules, but modules make for a smaller kernel and easier after-the-fact
tweakability. You can also get modules from other sources (third-party
modules, etc), but for the modules you've specified, you need to compile
them. This step does that.

	make modules_install

Copies the just-compiled modules to the appropriate locations on the
system (/lib/modules/[kernel-version usually]) and I believe, runs
"update modules" to create an appropriate /etc/modules.conf file, but
I'm not sure about this.

Unless I've forgotten something, and I probably have, you can now do a
"shutdown -r now", leaving the floppy in the drive, and on reboot you'll
be running your new kernel. Now you can focus on getting it to boot
directly off the hard drive.

Hope this has helped!


Reply to: