[UFO Chicago] kernel building, quick and dirty

BrianT.Grant BrianT.Grant
Thu, 26 Jul 2001 10:03:16 -0500


The Story in Brief:  
About a month ago, Pete posted some skeleton instructions for compiling a new
kernel in an attempt to help me out.  I got a new laptop for work - a Dell
Inspirion 4000 - which my boss wanted me to get Linux - Debian, to be
specific - running on.  I would also have a Windows 2000 Professional
partition on the drive, but my primary OS was to be Linux.  My boss, Stel,
also has the exact same laptop, and he?d done quite a bit of research
before buying it.  By the time I?d gotten mine, he?d had Debian running
for some time and he?d been the laptop as his primary workstation.

I had a base install CD of Potato - the current, "stable" Debian release -
running kernel 2.2.17.    The biggest problem with my existing kernel was
that it did not support Advanced Power Management (APM) - a feature which allows
a laptop to suspend and then recover from the suspend state.  More
precisely, the laptop would suspend regardless of the version or set of
features supported by the kernel.  However, after resuming, the ethernet
interface would basically be lost because of some wacky hardware problem. 
A fine gentleman named Marcel van der Goot documented this problem; here
is his description of the problem (which probably make more sense
than mine):  

"As it turns out, some crucial configuration registers of the bridge
get corrupted during the suspend-resume cycle, making the ethernet
and modem chips unreachable. On top of that, the configuration of these
chips gets corrupted as well."

Stel told me that I needed kernel 2.4.2 or higher to get the suspend
working correctly.  I had never compiled a kernel before, so with some
help from a handful of sources - Pete in his two e-mail posts, Nick
Moffitt (and others) over IRC, the Kernel HOWTO at The Linux Documentation
Project (http://www.linuxdoc.org/HOWTO/Kernel-HOWTO.html) and Stel's
pointers -  I got things going.  Nick suggested that I document my kernel
compiling experience and post it to the group so others could
comment/learn/etc.  In general, my writing follows Pete's original
messages with my comments & observations.  I hope this is helpful!

  
On Mon, 2 Jul 2001 15:36:35 -0500
"Peter A. Peterson II" <pedro@tastytronic.net> wrote:

> for bananafish:
> 
> OK, so you've got your kernel source. 

apt-get install kernel-source-2.4.5.  The file installed at
/usr/src/kernel-source-2.4.5.bz2  

> Make a ~/linux directory, and then
> symlink ~/linux/ as /usr/src/linux/. 

I had to do this as user ?brian? not as ?root?; I don?t entirely
understand why that is the case.  I?m sure it has something to do with
file permissions, etc. (/usr/src/ is not freely accessible to anyone other
than root).  Anyone know why it has to work this way?

> apt-get install
> kernel-headers-2.4.x (these are the development files you need to
> compile the kernel).
> 
> NOw, uncompresss the kernel source. If you uncompress it in your
> homedir, it should create a ~/linux directory. If it is a tar.gz, you'll
> need to use tar -xvvzf and if it's a bz2 (which I recommend) you'll use
> bunzip2 to uncompress it.

Originally, it was a bz2 file, and running bunzip2 gave me a
kernel-source-2.4.5.tar file.  When I decompressed & UN-tarred it, it
created a directory called kernel-source-2.4.5, not ?linux.?  I went into
that directory and did ?mv * --target-directory=/home/brian/linux/? 


> 
> THen, go into your source directory, and type make menuconfig.
> 
> WHat happens?

cd /usr/src/linux  
make menuconfig
I get an error telling me that I didn't have ncurses installed.  
>> Unable to find the Ncurses libraries.
>>
>> You must have Ncurses installed in order
>> to use "make menuconfig"

After conferring with Nick a bit via IRC, I went to install
libncurses-dev; apt-get gave me this back:
>Package libncurses-dev is a virtual package provided by:
  libncurses5-dev 5.2.20010318-2
  libncurses4-dev 4.2-9"

Hmmm...back to IRC...  
Ask and ye shall receive:  Emad says,  "go 5!"  So, I go 5.  
Once again, I run "make menuconfig."  It runs, and I get this crazy ASCII
interface with about 30 different options.

As it turns out, menuconfig has TRUCKLOADS of documentation, both within
the app itself and in accompanying text files.  Once I figured how to wade
through that, operating menuconfig was fairly simple.  But what did I want
in this kernel?  There are SO MANY OPTIONS, and for someone who has never
performed this operation before, there were just enough to make my head
spin.  Fortunately for me, Stel had included the .config file that he had
used to compile his new kernel.  I copied the .config file into
/usr/src/linux and loaded it up.  

> 
> pedro
> 
> -- 
> ---------------------------------------------------------------------
> http://tastytronic.net/ufo/  --------------- Users of Free OS Chicago
> http://robotfindskitten.org/ ---------------    Free Software Zen Sim
> 
> 
> _______________________________________________
> UFO Chicago -- Users of Free Operating Systems
> Free Software Rules -- Proprietary Drools!
> http://tastytronic.net/cgi-bin/mailman/listinfo/ufo