Jump to content

Custom Kernel Info?


Recommended Posts

Well I converted to MDK because I'm a tinkerer. Now I'm interested in compiling custom kernels. Is this advisable for a rookie? What are the advantages? Can one take a shortcut by using a custom kernel designed by someone else? Just some ideas. Also, some entry level tutorials might be good. Found some through Google but most are over my head. At this point I have no justification to do this, other than my obsession with tweaking. And I want to bench my MDK install against my Windex XP setup.

Thnx, Dan

 

[moved from Software by spinynorman]

Link to comment
Share on other sites

Guest miketigerwoods

Starting out compiling kernels can lead to pulling out a lot of hair...But to start, get a new kernel src.rpm from mandrake and install it.

 

the process for installing/compiling a 2.6 kernel is:

cd /usr/src/linux
#Compile kernel
make mrproper
make xconfig
make bzImage
make modules
make modules_install

#Setup /boot directory
mkinitrd /boot/initrd-KERNEL_VERSION KERNEL_VERSION
ln -sf /boot/initrd-KERNEL_VERSION.img /boot/initrd.img
cp System.map /boot/System.map-KERNEL_VERSION
ln -sf /boot/System.map-KERNEL_VERSION /boot/System.map
cp .config /boot/config-KERNEL_VERSION
ln -sf /boot/config-KERNEL_VERSION /boot/config
cp arch/i386/boot/bzImage /boot/vmlinuz-KERNEL_VERSION
ln -sf /boot/vmlinuz-KERNEL_VERSION /boot/vmlinuz

 

replacing KERNEL_VERSION with the appropriate version of your downloaded kernel (something like 2.6.3-13mdkcustom)...

 

The part that goes over the head of many new users is the program that pops up after the xconfig. This is where you customize the kernel to your liking, for example tell it that you have an AMD cpu instead of an Intel and include drivers into the kernel or as loadable modules.

 

Set some time for yourself and compile and watch an error mess you up, then fix it, compile again etc...the best way to learn is to do it yourself. A good idea is not to uncheck too many things or else youll encounter errors because something may rely on the object you unchecked.

 

Good luck!

Link to comment
Share on other sites

Starting out compiling kernels can lead to pulling out a lot of hair...But to start, get a new kernel src.rpm from mandrake and install it.

 

the process for installing/compiling a 2.6 kernel is:

cd /usr/src/linux
#Compile kernel
make mrproper
make xconfig
make bzImage
make modules
make modules_install

#Setup /boot directory
mkinitrd /boot/initrd-KERNEL_VERSION KERNEL_VERSION
ln -sf /boot/initrd-KERNEL_VERSION.img /boot/initrd.img
cp System.map /boot/System.map-KERNEL_VERSION
ln -sf /boot/System.map-KERNEL_VERSION /boot/System.map
cp .config /boot/config-KERNEL_VERSION
ln -sf /boot/config-KERNEL_VERSION /boot/config
cp arch/i386/boot/bzImage /boot/vmlinuz-KERNEL_VERSION
ln -sf /boot/vmlinuz-KERNEL_VERSION /boot/vmlinuz

 

replacing KERNEL_VERSION with the appropriate version of your downloaded kernel (something like 2.6.3-13mdkcustom)...

 

The part that goes over the head of many new users is the program that pops up after the xconfig. This is where you customize the kernel to your liking, for example tell it that you have an AMD cpu instead of an Intel and include drivers into the kernel or as loadable modules.

 

Set some time for yourself and compile and watch an error mess you up, then fix it, compile again etc...the best way to learn is to do it yourself. A good idea is not to uncheck too many things or else youll encounter errors because something may rely on the object you unchecked.

 

Good luck!

cd /usr/src/linux

#Compile kernel

make mrproper

make xconfig

make bzImage

make modules

make modules_install

 

Or you can do

make mrproper

make *config

make

 

And make will do those three for you.

Where i have *config, there are multiple options. menuconfig which is my personal perference is a curses config tool. xconfig is gui, kconfig is qt, and gconfig is gtk, take your pick.

 

As for the last few commands with the initrd, these may or may not be needed. Again, personal preference. I prefer to compile everything into my kernel including drivers for my root fs (ext3) and only have modules for sound and third party drivers, which means i dont need an initrd. However if you choose to use lots of modules, you probably will need an initrd, which adds those extra steps.

 

This is linux, you have, not one, but multiple choices.

 

iphitus

Link to comment
Share on other sites

I made my first kernel as part of my Linux from scratch.

 

i just turned everything on, unless it was blatantly obvious i didnt have it, eg SATA or RAID.

And some stuff i knew, like my soundcard, other stuff i got from hit and miss.

 

You learn your hardware over time, and if you are unsure about an option, go to the help/details on the side of it and if that doesnt enlighten you as to what to do, include it.

Link to comment
Share on other sites

Just for my own curiosity. Does the fact that it would be customized make it run faster, more stable? I'm trying to weigh the advantages. I saw the new kernel source posted. Not sure if I'd do it just for the sake of having the latest one. But if I decide to do it, what is the selection criteria for which kernel source to use?

Funny thing. I started to load slack ware in 1998. For whatever reason building the kernel was a requirment. I screwed it up about 6 times and then gave up. It was another 5 years before I even looked at Linux again.

Thanks for all the advice.

Dan

Link to comment
Share on other sites

No it won't run faster. Mandrake does an amazing job creating their kernels. Don't think you can beat them :P

 

Some people don't like bloat (for what ever reason) and build a kernel just for their needs but then they buy a new soundcard and have to recompile the kernel. Then they get a new videocard and they have to compile again. Then a TV card etc etc.. Others like the bleeding edge (my kernel is newer then yours).

 

Personnaly I see only one good reason (other then learning stuff) for compiling your own kernel and that is when your hardware isn't supported by earlier versions.

 

But if you like to play around with your PC and want to get a real understanding of Linux then go ahead. Building your own kernel is very enlightning :thumbs:

Link to comment
Share on other sites

I agree with devries, it mostly for fun and learning unless you have newer hardware that requires the compile.

 

Speed? Nah, not enough to justify the time invested. The 2 'fasted' installs I've ever had were ML.8.1 with a mdk kernel reduced from 1.1MB to 600kb :woot: , and lfs which used the same config except on an vanilla kernel. I just barely noticed any diff and I think it was mostly just smoother......no lock ups (which were common in 8.1 days).....less bloat to go through, whatever.

 

Now days mdk seems to have it pretty well tuned. I only compile/patch a vanilla kernel if I have to.

Link to comment
Share on other sites

Sorry for all the questions, but I will borrow your knowledge as long as you'll give it.

If I compile my own kernel I'm assuming I can set up the bootloader to boot either one. That way if the new one won't work I can boot the original "stable" one to recompile. Also, how do I find the path to my new kernel once installed?

Thanks for all the information,

Dan

Link to comment
Share on other sites

make install seems pretty safe now days. It'll setup lilo and everything for you that you can choose the different kernels to boot to.

 

location

[root@localhost root]# ls /boot
boot@                    diag1.img                    initrd.img@                message@               System.map-2.6.6-0.rc3.1mdk
boot.0300                diag2.img                    kernel.h@                  message-graphic        us.klt
config@                  grub/                        kernel.h-2.6.3-4mdk        message-text           vmlinuz@
config-2.6.3-4mdk        initrd-2.6.3-4mdk.img        kernel.h-2.6.6-0.rc3.1mdk  System.map@            vmlinuz-2.6.3-4mdk
config-2.6.6-0.rc3.1mdk  initrd-2.6.6-0.rc3.1mdk.img  map                        System.map-2.6.3-4mdk  vmlinuz-2.6.6-0.rc3.1mdk
[root@localhost root]# ls /lib/modules
2.6.3-4mdk/  2.6.6-0.rc3.1mdk/
[root@localhost root]#

 

grub

[root@localhost root]# cat /boot/grub/menu.lst
timeout 3
color black/cyan yellow/cyan
default 2

title ML-10-2.6.3
kernel (hd1,7)/boot/vmlinuz devfs=mount splash=quiet acpi=on vga=normal root=/dev/hdb8
initrd (hd1,7)/boot/initrd.img

title NT-Loader
root (hd0,0)
chainloader +1

title ML-10-2.6.6
kernel (hd1,7)/boot/vmlinuz-2.6.6-0.rc3.1mdk devfs=mount acpi=on splash=quiet vga=normal root=/dev/hdb8
initrd (hd1,7)/boot/initrd-2.6.6-0.rc3.1mdk.img
[root@localhost root]#

Edited by bvc
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...