Well, there's the Linux-From-Scratch-HOWTO which is good reading for an
overall picture -

But the "long and short of it":

switch into /usr/src/linux *note - only good in 2.4.2 kernels and above...*
make menuconfig *or* make xconfig
choose "Load Configuration from File"
enter "/boot/config" for the running kernel
choose "Processor Type and Features"
choose "Processor Family" and select "Athlon/Duron/K7"
get back to the main menu, choose "Save Configuration to File"
save it somewhere safe (/root/MYKERNEL-2.4.3-8.config)
choose "Save and Exit" < this creates a file named ".config" in the
/usr/src/linux directory >

At this point you can and should edit the file "Makefile" and set
"EXTRAVERSION" to your own suffix - it'll prevent you from overwriting the
Mandrake kernels.

Now run "make dep" (sorts out the kernel dependancies for the make files"
then run "make modules" - go get a coffee (builds the loadable modules)
then run "make bzImage" - go get another coffee (builds the actual kernel)
run "make modules_install" - this copies all the modules into
/lib/modules/2.4.3-(your EXTRAVERSION suffix)
run "make install" - this copies the kernel to /boot/vmlinuz-2.4.3-(your
EXTRAVERSION suffix) and builds System.map-2.4.3-(your EXTRAVERSION
suffix) - the module/kernel symbol table xref

At this point you have an Athlon enhanced kernel.

Need pcmcia?
Now "cd pcmcia-cs-3.1.25"
make config
<answer the questions, select mostly the defaults, and make sure you select
"read from kernel tree" when asked. >
make all
make install

Need alsa?
cd ..
cd alsa-???
./configure --with-isapnp --with-sequencer --with-cards-(your sound card)
(you can get the list of cards using ./configure --help)
make install

Now, run "depmod -aF System-2.4.3-(your EXTRAVERSION suffix) 2.4.3-(your
EXTRAVERSION suffix)"
This should *not* produce any errors. If you played with other settings when
you configured the kernel you might see some things pop out here - go
through the process again until this is clean and returns no messages! This
builds the file /lib/modules/2.4.3-(your EXTRAVERSION suffix)/modules.dep,
and it's used by modprobe to load any modules that are depended on by the
one you're loading.

Need an initial ramdisk (initrd)? run "mkinitrd /boot/initrd-2.4.3-(your
EXTRAVERSION suffix) 2.4.3-(your EXTRAVERSION suffix)"  - this builds an
initial ramdisk containing /lib/modules/2.4.3-(your EXTRAVERSION suffix) for
the kernel to load startup modules from - required for SCSI, reiserfs, etc.

Almost done!! - edit /etc/lilo.conf or /boot/grub/menu.lst, create a copy of
one of the entries, and update it to point to your kernel version (and
initrd if needed.) Run "lilo" or do a grub install (I think you can use the
install.sh in the /boot/grub directory, but I'm not a grub-ite right now.)

Cross your fingers, and reboot. Select your new kernel at the prompt - woo
hoo! Wasn't that fun?

Now that you've got a working scenario, you can modify the kernel to your
exact machine - always make sure you change EXTRAVERSION so you don't
overwrite your working kernels!

Also - when you repeat the process, run "make mrproper" first - this will
clean up and remove the previous kernel compile code. Then run the "make
menuconfig" or "make xconfig" again, load your previously saved kernel
config, and continue on as before. If you're just going to rebuild the
kernel after a source update, copy your config file to the kernel source
root (cp /root/MYKERNEL.config /usr/src/linux/.config) and run a "make
oldconfig" - this will run through and update your config file
automatically, stopping and asking you about what you want for any new
configuration options that may show up. When that's done, copy the config
out again (cp /usr/src/linux/.config /root/MYNEWKERNEL.2.4.3-8.config) and
resume with the "make dep" step.

Whew! that was a bunch! I do this all the time, since I have a PIII and an
Athlon. There was some prefetch code in the 2.4.2 kernels that hasn't made
it to the 2.4.3 tree yet - it was only enabled on the PIII and Athlon builds
(and broke when you ran Linux under a VMWare virtual machine...)

Happy kernel hacking...

Regards, Gio


----- Original Message -----
From: "michael" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 07, 2001 4:02 AM
Subject: Re: [Cooker] Compiling kernel-2.4.3-8mdk.src.rpm on a Athlon Tbird


> On 07 Apr 2001 00:54:41 -0700, Daniel McKee wrote:
> > <snip>
> > How do I compile a Athlon optimized kernel from src rpm???
> >
> >
>
>
>
>  This is a great question! I'd like to know too.
>
> -m-
>
>


Reply via email to