Strategy for complex kernels...

Strategy for complex kernels...

Post by Guillaume Dargau » Thu, 26 Jun 2003 06:33:29



Yesterday I installed RH9 on a friend's brand new laptop. No problem. Then I
told him we would make an optimized kernel as I'd done it many times on
servers. That's when I ran into problems: that laptop (Toshiba) has
_everything_ ! I mean it has Infrared ports, USB 2.0, Firewire, Bluetooth,
LAN, modem, 802.11b, sound card and much more.
I quickly found out that if making a kernel for a big iron with only a
couple large disks is one thing, making one for that interface monster was a
higher level of problem, with unknown .config options, missing ones, driver
compatibilities, etc...

So the question is, how do you operate when having to do a complex kernel
like that ?
- use the default RH one and don't bother ?
- make something very simple and _slowly_ play with the options to add
missing drivers ?
- Search google for whatever patches/drivers may (not) be available ?

It all seems terribly inefficient to me. I know what hardware is on the
machine, but is there a tool I can run that tells me what .config options
should be enabled/disabled just by scanning the hardware ?
--
Guillaume Dargaud
Colorado State University - Dept of Atmospheric Science
http://www.gdargaud.net/
  "I love cooking with wine. Sometimes I even put it in the food."

 
 
 

Strategy for complex kernels...

Post by Dave Uhrin » Thu, 26 Jun 2003 07:11:31



> So the question is, how do you operate when having to do a complex kernel
> like that ?
> - use the default RH one and don't bother ?
> - make something very simple and _slowly_ play with the options to add
> missing drivers ?
> - Search google for whatever patches/drivers may (not) be available ?

Why not start with the config file for whichever kernel you installed?

/usr/src/linux-2.4/configs

Select your favorite and cp it to /usr/src/linux-2.4/.config, then run
make xconfig|menuconfig|config.

 
 
 

Strategy for complex kernels...

Post by Guillaume Dargau » Thu, 26 Jun 2003 14:10:00


Quote:> Why not start with the config file for whichever kernel you installed?

> /usr/src/linux-2.4/configs

> Select your favorite and cp it to /usr/src/linux-2.4/.config, then run
> make xconfig|menuconfig|config.

Well, I tried that, but I don't think the .config had anything to do with
that machine's hardware. When you install RedHat, it guesses/detects what
hardware is present, right ? Does it compile a specific kernel or does it
install a standard 'all included' kernel ?
So what kind of configuration does this default /usr/src/linux-2.4/.config
represents ?
--
Guillaume Dargaud
Colorado State University
http://www.gdargaud.net/
  "Omniscience: Talking only about things you know about."
 
 
 

Strategy for complex kernels...

Post by Stephan Hurle » Thu, 26 Jun 2003 14:41:23



> When you install RedHat, it guesses/detects what
> hardware is present, right ? Does it compile a specific kernel or does it
> install a standard 'all included' kernel ?
> So what kind of configuration does this default /usr/src/linux-2.4/.config
> represents ?

the "mainstream" distributors like RH, MDK, SuSE all ship an "all included"-type
kernel, with tons of modules for everybody, so you can safely start with the
.config of your distributors kernel and just cut out all the unnecessary (you
don't need fibrechannel on that laptop, do you?).
your main problem would be (IMHO) that the distribution-kernels come with lots
of patches that aren't in the "vanilla" versions, so you need to find out which
of these patches you need or want. especially, on some of those "legacy-free"
toshiba laptops, you need really extensive ACPI support to run anything on the
box, and the 2.4.21 vanilla kernel does not include all that's needed, i'm
told.
you might want to look at: http://kernel.kolivas.org/ for a nice patch set for
desktops...

hth
st

 
 
 

Strategy for complex kernels...

Post by Vwake » Thu, 26 Jun 2003 17:37:30



 >> Why not start with the config file for whichever kernel you
 >> installed?
 >>
 >> /usr/src/linux-2.4/configs
 >>
 >> Select your favorite and cp it to /usr/src/linux-2.4/.config, then
 >> run make xconfig|menuconfig|config.
 >
 >Well, I tried that, but I don't think the .config had anything to do
 >with that machine's hardware.

What was meant was you can start with a working config that was already
used and tested, and build up on it by adding/removing modules or
features that suit your hardware/system.

 >When you install RedHat, it guesses/detects what hardware is present,
 >right ?

Yes. I think anaconda does it during installation. Based on the hardware
detected the rite module is loaded into the kernel if its not inbuilt.
However, the tools that do it during other times are different.

 >Does it compile a specific kernel or does it install a standard 'all
 >included' kernel ?

No. It installs a precompiled kernel. And that depends on what you mean
by specific? If you are talking abt a specific architecture then yes, RH
installs the rite kernel for your arch. To find it out and which will
help you decide which config file to use, try this

# rpm -q --qf "%{NAME} --> %{VERSION} --> %{ARCH}\n" kernel

And yes, lot of drivers are included as modules in the kernel so that it
can be used to any hardware system.

 >So what kind of configuration does this default
 >/usr/src/linux-2.4/.config represents ?

Never used it. Check the documentation of how its created.

 >>> It all seems terribly inefficient to me.

Thats the problem. If you know what you are doing, it will be easy.
Until then ....

 >>> I know what hardware is on the machine, but is there a tool I can
 >>> run that tells me what .config options should be enabled/disabled
 >>> just by scanning the hardware ?

None I know of. I agree its sometimes hard to find. But usually I do
this,

 1 Find the module a particular HW uses, say my sound card is SB Live.
 2 Do a locate emu10k1.o,

   /lib/modules/2.4.20-8/kernel/drivers/sound/emu10k1/emu10k1.o

 3 See the directory structure Sound --> emu10k1
 4 So I wud guess the corresponding config option wud be somewhere in

    Sound --> Creative SBLive

 5 And click help you wud know it is

    CONFIG_SOUND_EMU10K1

It wont work always. But a good thumb rule. It would be easy if you
familiarize urself with dir structure at /lib/modules/*

HTH

 
 
 

Strategy for complex kernels...

Post by ne.. » Thu, 26 Jun 2003 21:25:03



>> Why not start with the config file for whichever kernel you installed?

>> /usr/src/linux-2.4/configs

>> Select your favorite and cp it to /usr/src/linux-2.4/.config, then run
>> make xconfig|menuconfig|config.

> Well, I tried that, but I don't think the .config had anything to do with
> that machine's hardware. When you install RedHat, it guesses/detects what
> hardware is present, right ? Does it compile a specific kernel or does it
> install a standard 'all included' kernel ?
> So what kind of configuration does this default /usr/src/linux-2.4/.config
> represents ?

Unless you are really constrained for space, I wouldn't bother.
What I would do is shut down all the services I do not need and
not bother starting them from boot. I would also remove the rpms
I definitely know I would never use. RH generally ships a kernel
that is striped down and has everything else as modules. Only
those modules that are needed are loaded.

--
Registered Linux User # 125653 (http://counter.li.org) | Please remove
Certified: 55% bastard, 31% of which is tard.          |   '.invalid'
http://www.thespark.com/bastardtest                    |    to reply.
Switch to: http://www.speakeasy.net/refer/190653

 
 
 

Strategy for complex kernels...

Post by Dave Uhrin » Thu, 26 Jun 2003 22:16:23



> Well, I tried that, but I don't think the .config had anything to do with
> that machine's hardware. When you install RedHat, it guesses/detects what
> hardware is present, right ? Does it compile a specific kernel or does it
> install a standard 'all included' kernel ?
> So what kind of configuration does this default /usr/src/linux-2.4/.config
> represents ?

If you do not know the answers to those questions you do not know enough
to "customize" the kernel.  The most likely result of your efforts will be
a system which unbootable.

There is a considerable amount of material in
/usr/src/linux-2.4/Documentation which you might want to read.
Additionally there is on-line documentation at www.tldp.org.