LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 03-25-2005, 11:44 AM   #1
xaos5
Member
 
Registered: Dec 2004
Distribution: debian and slackware
Posts: 217

Rep: Reputation: 31
Another Kernel Guide 2.6.11


Here is my complete newbie guide to building a kernel in slackware taken from all the other compile guides I found on this site and cleaned them up:

*Either logon to root into your gui or use the su command because you need root access.

1. First go and download the kernel source at kernel.org and download what you wish mine was linux-2.6.11.5.tar.bz2.A good directory is /usr/src

2. Change into the directory by cd /usr/src. Now you need to extract the file so we will do tar -xjvf linux-2.6.11.5.tar.bz2. This will create a directory named linux-2.6.11.5/

3. change directories into linux-2.6.11.5 now by doing cd linux-2.6.11.5/ and now we are ready for the fun part:

NOTE: if you want to use your existing config file do this now or otherwise skip this. We need to copy the old config file in the /boot directory. So type cp /boot/config-ide-2.4.29 .config. (your config file name could differ)

Here is a list of ways to pick the kernel options the way some do it which is inside the console and don't need a gui running so you can do it straight from the shell is:

make menuconfig (uses the .config file)

Here are a few other options which provide graphical way of doing it:

make gconfig
make xconfig (I like this option better)

NOTE: Circles are modules and check marks are built into the kernel, you don't want stuff like your filesystem as a module or you will need to do an extra step which is not covered here.

NOTE: lspci -v or cat /proc/pci cat /proc/cpuinfo will help identify your hardware.

I can't really help you much more with this part but all I have to say is research your equipment and know what is in your computer, make sure you have some basic support for your kernel like:

filesystem (ext2, ext3)
usb support for keyboard and mouse (like OHCI)
framebuffer support for graphics card

After you are done with your selections save and close the window out or hit exit in menuconfig.

make bzImage (builds the kernel)
make
make modules_install (installs the modules)

NOTE: On a 1.6Ghz computer with 512mb of ram it took 10-15 minutes for make bzImage to finish, on slower computers this could take a while.


UPDATE: ALTERNATIVE STEP (UNTESTED)
http://www.linuxquestions.org/questi...13#post1552913
after following the above link run make install and it should do step 4 for you. Please tell me if this worked.

NOTE: You can skip step 4 if you followed this.

4. Now we need to move our files into the /boot directory to be used.

cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-2.6.11.5
cp System.map /boot/System.map-2.6.11.5
cp .config /boot/config-2.6.11.5

5. Now that we have all of this setup we need to tell lilo to boot our new kernel. open your favorite text editor and load /etc/lilo.conf. heres what it should look like (yours is going to be a bit different, but this should work on a default 10.1 install)

image="/boot/vmlinuz-ide-2.4.29"
root="/dev/hda2"
label="Slack-2.4.29"
read-only

Copy this and paste it right below we are going add the new kernel and it should look like this:

image="/boot/vmlinuz-ide-2.4.29"
root="/dev/hda2"
label="Slack-2.4.29"
read-only
image="/boot/vmlinuz-2.6.11.5"
root="/dev/hda2"
label="Slack-2.6.11.5"
read-only

Make sure image= points to your bzImage you compiled in the /boot directory
Make sure root= points to your harddrive partition
Make sure label= anything you want without spaces, this is how it will appear in the menu selection on lilo menu
Add read-only at the end.

6. Save and exit lilo.conf and then run lilo and it shouldn't display any errors.

7. Reboot and hope for the best!


Thank you everybody here for helping me out with this!

Last edited by xaos5; 03-25-2005 at 09:54 PM.
 
Old 03-25-2005, 12:17 PM   #2
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Rep: Reputation: 45
Very nice review.

Might i suggest that you don't have to 'make modules' (afaik?)

you can do it safely with
make
make modules_install
make install

EDIT:
========
Also, to save on point 5 and 6,

you could edit the Makefile
pico /usr/src/linux/Makefile

search for the line '# export INSTALL_PATH=/boot'
ctrl + w
type 'boot'

and uncomment the line
get rid of the # so it looks like
export INSTALL_PATH=/boot

save and exit
ctrl + x + enter

So after you compile, it will automatically copy everything to /boot, and update your boot loader (lilo), and all you have to do is reboot. This will save you the hassle especially everytime you recompile the kernel to enable/disable something.

Last edited by xushi; 03-25-2005 at 12:22 PM.
 
Old 03-25-2005, 12:38 PM   #3
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 52
hmmm....we had another guide a few weeks ago , buy anyway....

------------------
3. Now we want to create a symbolic link to this to make the job easier. Type ln -s linux-2.6.11.5/ linux (you might have to use -sf to force it to overwrite your existing link which was pointing to 2.4.29 on slack 10.1)
------------------

there's no reason to do that, just skip it.
i wonder why everybody is parrotting about that link. it's never used.
and not advicing that link will prevent us for programs that will use it.
( newbie of today = programmer of tomorrow )

-----------
6. Now we need to redo our symbolic links in /boot directory so you can Type cd /boot and do this and again you might have to do ln -sf to force/overwrite the old.

ln -s System.map-2.6.11.5 System.map
------------

that's also not needed.
if you name the kernel : vmlinuz-2.6.11.5
you name the map : System.map-2.6.11.5

it's just better to not talk about symlinks, they are just confusing.
i think compiling your own kernel is one of the basics of linux so a guide is ok.

egag
 
Old 03-25-2005, 12:44 PM   #4
xaos5
Member
 
Registered: Dec 2004
Distribution: debian and slackware
Posts: 217

Original Poster
Rep: Reputation: 31
this is somewhat of the guide I made for myself and has worked so far, I've tryed before using other guides but failed so I took everything I understood from the others and put them together. I guess symbolic links are kinda pointless but every other guide seemed to use it so I built mine up like that also and learned that way.
 
Old 03-25-2005, 12:49 PM   #5
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 52
well...i understand that, but they are redundant steps.
people might think that they are important and give a lot of attention/time
to those points when they are troubleshooting,
and that's just a waste of time ( as making the links is. )

egag
 
Old 03-25-2005, 12:59 PM   #6
xaos5
Member
 
Registered: Dec 2004
Distribution: debian and slackware
Posts: 217

Original Poster
Rep: Reputation: 31
true, true, thats why I posted here so you guys can pick it apart to make it better

I've been messing with slackware maybe 3 months at the most off and on and have compiled my own kernel but sure i've missed some stuff, because I still don't understand it all. Long live linux.
 
Old 03-25-2005, 01:10 PM   #7
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 52
then you made a good start eh...
but with linux you can do things ( almost ) allways in 2 or more ways.
( you can also compile the kernel in your home- dir. and some people edit the " makefile " to install directly
into the /boot dir. )

i think when you found a way that works, you want to stick to that.
and that's ok

( but don't mention the " links " )

egag
 
Old 03-25-2005, 01:33 PM   #8
xaos5
Member
 
Registered: Dec 2004
Distribution: debian and slackware
Posts: 217

Original Poster
Rep: Reputation: 31
I'll rewrite it later thanks for the tips
 
Old 03-25-2005, 03:53 PM   #9
BenneJezzerette
Member
 
Registered: Mar 2005
Location: In a Box where Slackware Rocks
Distribution: Slackware 11 -current
Posts: 274

Rep: Reputation: 30
Ok, firstly this looks pretty good, one issue I am going to point out.

reiserjfs format drives and jfs.s kernels

IPv6 configuration
Document found on Google Search for this (spcifications in PDF format)

SCSI Configurations if the rieserjfs format and jfs.s is being used, especially if the drive is IDE, can the scsi be disabled and not affect the kernel's performance or the drive format?

so far I have figured out, display, sound, ports, mouse, other tty devices.

The Drive format and kernel information and IPv6 is a bit on the daunting side. This is where I am going to neen some rela help in configuring this.

Networking too, I have some idea here but this Linux thing is somewhat still new. Especially when it comes to the kernel settings.

I won't baffle or bs you, I am just a lot afraid of making this jump to 2.6.11.5 yet because these configurations are VERY important to make it work first try.

Last edited by BenneJezzerette; 03-25-2005 at 03:54 PM.
 
Old 03-25-2005, 04:38 PM   #10
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu
Posts: 1,189

Rep: Reputation: 47
The 2.6.x kernels need the initrd.img file to boot unlike the 2.4.x kernels. You need to do a mkinitrd....I'm still figuring kernel building out myself, but that's what I've read on the net and the man page:

man mkinitrd
 
Old 03-25-2005, 05:21 PM   #11
BenneJezzerette
Member
 
Registered: Mar 2005
Location: In a Box where Slackware Rocks
Distribution: Slackware 11 -current
Posts: 274

Rep: Reputation: 30
Quote:
Originally posted by linuxhippy
The 2.6.x kernels need the initrd.img file to boot unlike the 2.4.x kernels. You need to do a mkinitrd....I'm still figuring kernel building out myself, but that's what I've read on the net and the man page:

man mkinitrd
I have 3 printouts of how to's here and am still sifting through all this. This one is good and the one from Da One originally for 8.0 I guess is ok, but needs an update, the this is how I do it is ok, and then the updated 2.6.0 is good. Somewhere someone needs to use them all and make a perfect kernel and then write all the instructions in a post here verbatim for each and every step to make it work correctly. That was a very new to Kernel Building won't be shied away. So far I am trying to get the idea and some of it is there, but the main protion, well the biggest part is the jfs.s and reiserjfs for the boot device, and then IPv6 for networking, for that should I just enable it all and not worry? I think that would probably work so may try it. I have the kernal thing set too sort of, since the make menuconfig has that in it. Just not too sure on how it will maintain things. If I disable SCSI support with the jfs.s installed, will my IDE configuration go haywire?
 
Old 03-25-2005, 05:57 PM   #12
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 52
Quote:
Originally posted by linuxhippy
The 2.6.x kernels need the initrd.img file to boot unlike the 2.4.x kernels. You need to do a mkinitrd....I'm still figuring kernel building out myself, but that's what I've read on the net and the man page:

man mkinitrd
no, you do not need an initrd.
just make sure that all functions needed at boot time, are compiled in the kernel and not as module.

some examples :

-ide support if you've got ide -disks, and scsi for scsi;
-framebuffer-support for the graph. card you use; ( you'll find this under "graphics support" )
-the file-system you use for the root directory.
- basic mouse & keyboard support
( i guess a lot more , but with these a lot of people make mistakes )

such things i allways choose to be part of the bzImage.

and also some examples of things i choose as modules :

-agpgart; drm-manager ( these are under " character devices " )
- all alsa parts ( some time ago they *had* to be modular, but i don't know if that's still true )
-drivers for network, modem etc
-all network filtering parts.
-tv-card drivers
etc.......

and if you follow the howto above , ( editing lilo.conf and running lilo allways ), you'll have your old
kernel to boot incase the new one is not yet correct.
you can just trial and error until you have a config that's ok for your hw.

so, when you have some time, just try one .....

egag
 
Old 03-25-2005, 08:41 PM   #13
BenneJezzerette
Member
 
Registered: Mar 2005
Location: In a Box where Slackware Rocks
Distribution: Slackware 11 -current
Posts: 274

Rep: Reputation: 30
Quote:
Originally posted by egag
no, you do not need an initrd.
just make sure that all functions needed at boot time, are compiled in the kernel and not as module.

some examples :

-ide support if you've got ide -disks, and scsi for scsi;
-framebuffer-support for the graph. card you use; ( you'll find this under "graphics support" )
-the file-system you use for the root directory.
- basic mouse & keyboard support
( i guess a lot more , but with these a lot of people make mistakes )

such things i allways choose to be part of the bzImage.

and also some examples of things i choose as modules :

-agpgart; drm-manager ( these are under " character devices " )
- all alsa parts ( some time ago they *had* to be modular, but i don't know if that's still true )
-drivers for network, modem etc
-all network filtering parts.
-tv-card drivers
etc.......

and if you follow the howto above , ( editing lilo.conf and running lilo allways ), you'll have your old
kernel to boot incase the new one is not yet correct.
you can just trial and error until you have a config that's ok for your hw.

so, when you have some time, just try one .....

egag
Ok was doing the kernal building and fine tuned it to the specs of my system hardware. found the riserjs support and a few nice things, took about 20 or so munites to go through, typed in make and it got to some file in teh scripts directory and it did not find it. I think maybe I will have to delete it and un compress it again as something got corrupeted in it. Not too sure. This kernel setup has a nice built in help thing too so with all this here, and the built in, I think I can do this without too much problem. Just has to re decompress it to the ffolder and then everything should be there again. Starts new to see if it will be better.
 
Old 03-25-2005, 08:48 PM   #14
xaos5
Member
 
Registered: Dec 2004
Distribution: debian and slackware
Posts: 217

Original Poster
Rep: Reputation: 31
Quote:
Originally posted by BenneJezzerette
Somewhere someone needs to use them all and make a perfect kernel and then write all the instructions in a post here verbatim for each and every step to make it work correctly. That was a very new to Kernel Building won't be shied away.
Thats what I'm trying to do here, because when I went looking for a guide to compile they where all somewhat incomplete or never worked for me, being new it was probably something I did wrong not understanding something
 
Old 03-25-2005, 09:08 PM   #15
xaos5
Member
 
Registered: Dec 2004
Distribution: debian and slackware
Posts: 217

Original Poster
Rep: Reputation: 31
Quote:
Originally posted by egag


-----------
6. Now we need to redo our symbolic links in /boot directory so you can Type cd /boot and do this and again you might have to do ln -sf to force/overwrite the old.

ln -s System.map-2.6.11.5 System.map
------------

that's also not needed.
if you name the kernel : vmlinuz-2.6.11.5
you name the map : System.map-2.6.11.5

egag
Where in the etc/lilo.conf file is the parameter to set System.map-2.6.11.5 as your System.map file, I just assumed that it needed to be named System.map to be picked up by the system, I don't even know what this file does.

From what you posted if you put vmlinuz-xxxxxxx then it would look for System.map-xxxxxxx. Or is that completely wrong?
 
  


Reply

Tags
compilekernel


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel Compile Guide for 2.6.0 DaOne Slackware 581 04-11-2009 07:31 AM
Help - Need guide on how to (re)compile kernel in 9.2 timko Suse/Novell 1 02-17-2005 09:17 AM
is there a guide to cutting down your kernel? muxman Debian 1 10-30-2004 09:02 AM
re :kernel compile guide sh4d0w331 Slackware 1 10-02-2004 06:38 PM
Kernel re-compile guide marlor Slackware 6 08-08-2004 04:57 AM


All times are GMT -5. The time now is 12:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration