LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Another Kernel Guide 2.6.11 (https://www.linuxquestions.org/questions/slackware-14/another-kernel-guide-2-6-11-a-305921/)

xaos5 03-25-2005 10:44 AM

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!

xushi 03-25-2005 11:17 AM

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.

egag 03-25-2005 11:38 AM

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

xaos5 03-25-2005 11:44 AM

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.

egag 03-25-2005 11:49 AM

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

xaos5 03-25-2005 11:59 AM

true, true, thats why I posted here so you guys can pick it apart to make it better :D

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.

egag 03-25-2005 12:10 PM

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

xaos5 03-25-2005 12:33 PM

I'll rewrite it later thanks for the tips

BenneJezzerette 03-25-2005 02:53 PM

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.

linuxhippy 03-25-2005 03:38 PM

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

BenneJezzerette 03-25-2005 04:21 PM

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?

egag 03-25-2005 04:57 PM

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

BenneJezzerette 03-25-2005 07:41 PM

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.

xaos5 03-25-2005 07:48 PM

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

xaos5 03-25-2005 08:08 PM

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?


All times are GMT -5. The time now is 04:14 AM.