Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-31-2004, 07:46 PM   #1
Registered: Mar 2004
Location: Pocatello, Idaho, USA
Distribution: Ubuntu
Posts: 256

Rep: Reputation: 30
kernel HOW-TO

I'm considering re-compiling the linux kernel on my laptop. Does anyone know of a good HOW-TO since the kernel HOW-TO on the website has been taken off for review. Also what's the difference between 2.4.x and 2.6.x. I tried it once with some very basic instructions but it said my hard drive was to small. I need something that explains all the options so I don't just skip over something and intall it all.

I should probably put this in my signature. My laptop is has a:

Cyrix 200Mhz Processor
Old 10-31-2004, 08:47 PM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Check the distro you have installed. Open a term and enter the command: locate HOWTO | less, and scroll down. You probably have a large set of HOWTO's install, including the kernel HOWTO.
Old 10-31-2004, 08:48 PM   #3
Registered: Aug 2004
Location: internet
Distribution: slackware
Posts: 133

Rep: Reputation: 15
i would suggest not compiling the kernel on your laptop, on account of it's speed/ram specifications.

i would suggest trying slackware, which seems to be accepting to i486 archtectures.

is a good install guide, it is the one i used. currently i am running slackware (10.1)
on two 486 machines. one a 50mhz and the other a 66mhz.
Old 10-31-2004, 08:52 PM   #4
Registered: Aug 2003
Location: Denver, CO
Distribution: CentOS, Debian
Posts: 825

Rep: Reputation: 33
EDIT: i agree with the comment about slackware, that's what i'm using on an old PIII 500mHz machine, 64mb RAM and a 9gb hard drive. slack is stable and clean, and using fluxbox i get great performance (for such an old POS).

i'm recompiling a custom 2.6.7 kernel right now. the basic steps are:

dowload a kernel, ie linux-2.6.7.tar.gz

in a terminal,

$ su
# cd /home/usr/downloads/ <-- change to whichever directory you downloaded to
# mv linux-2.6.7.tar.gz /usr/src <-- move the tarball to the directory you want to install in
# cd /usr/src <-- i like /usr/src
# tar -xvzf linux-2.6.7.tar.gz <-- untar the archive
# cd linux-2.6.7 <-- enter the new directory
# make menuconfig <-- many recommend make xconfig or gconfig, it's your choice
# make bzImage (when i'm done with menucofig i save to config-2.6.7, then exit
# make modules and also save to the default file)
# make modules_install
# cp .config-2.6.7 /boot/config-2.6.7
# cp /boot/
# cd /usr/src/linux-2.6.7/arch/i386/boot
# cp bzImage /boot/vmlinuz-2.6.7

then you need to edit /etc/lilo.conf to make the new kernel bootable. you should see something like

#start linux section
image = /boot/vmlinuz
root = /dev/hda3
label = linux
#end linux section

you want to add another entry, so that you have multiple options like this:

#start linux section
image = /boot/vmlinuz-2.4.26
root = /dev/hda3
label = linux-old
image = /boot/vmlinuz-2.6.7
root = /dev/hda3
label = linux-2.6.7
#end linux section

* /boot/vmlinuz is usually a symbolic link to /boot/vmlinux-x.x.x, and the same goes for /boot/ in lilo, you can use the symlink or the actual file, it doesn't matter (just be sure that your entries aren't both pointing to the same file!) i recommend checking out the contents of your /boot directory so that you know where they're pointing, ie type ls -al /boot and you should see something like this:

bash-2.05b# ls -al /boot
total 9032
drwxr-xr-x 4 root root 1024 2004-10-31 18:42 .
drwxr-xr-x 20 root root 464 2004-10-31 02:39 ..
lrwxrwxrwx 1 root root 37 2004-10-16 13:22 README.initrd -> /usr/doc/mkinitrd-1.0.1/README.initrd
lrwxrwxrwx 1 root root 16 2004-10-31 18:42 ->
-rw-r--r-- 1 root root 777662 2004-10-31 18:40
-rw-r--r-- 1 root root 888956 2004-10-31 17:24
-rw-r--r-- 1 root root 620999 2004-06-14 19:29
-rw-r--r-- 1 root root 512 2004-10-16 13:46 boot.0800
-rw-r--r-- 1 root root 168 2004-10-16 13:46 boot_message.txt
-rw-r--r-- 1 root root 23309 2004-10-31 18:41 config-2.6.7
-rw-r--r-- 1 root root 29124 2004-10-31 17:18 config-2.6.9
-rw-r--r-- 1 root root 41017 2004-06-14 19:29 config-ide-2.4.26
-rw-r--r-- 1 root root 5032 2004-05-21 00:19 diag1.img
-rw------- 1 root root 257471 2004-10-31 01:51 initrd-2.6.7.img
drwxr-xr-x 8 root root 1024 2004-06-20 21:00 initrd-tree
-rw------- 1 root root 257060 2004-10-31 00:26 initrd.gz
drwx------ 2 root root 12288 2004-10-16 13:08 lost+found
-rw------- 1 root root 67072 2004-10-31 17:21 map
lrwxrwxrwx 1 root root 13 2004-10-31 18:42 vmlinuz -> vmlinuz-2.6.7
-r-------- 1 root root 1424782 2004-10-30 16:44 vmlinuz-2.4.26
-rw-r--r-- 1 root root 1634015 2004-10-31 18:42 vmlinuz-2.6.7
-rw-r--r-- 1 root root 1898800 2004-10-31 17:19 vmlinuz-2.6.9
-rw-r--r-- 1 root root 1248111 2004-06-14 19:29 vmlinuz-ide-2.4.26

you can see that i have 3 kernels available:


so there are 3 varieties of config-*,*, and vmlinuz-*, one for each kernel. vmlinuz and point to the 2.6.7 versions of those files, which is why i changed my lilo entry above to look for /boot/vmlinuz-2.4.26, don't forget to do this!

so anyway, the process isn't so hard. the hard part is during menuconfig, you have to make sure you include support for your motherboard, chipset, processor, any PCI cards, AGP cards, IDE or SCSI devices: basically anything you are going to be using. it's easy to leave something out.

Last edited by mcd; 10-31-2004 at 09:25 PM.


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 2.4 in Zipslack (Waring: unable to open an initial console | Kernel Panic...) kurtamos Linux - General 2 05-10-2006 12:58 PM
Kernel-Patch Debian Logo 2.6.2 not correctly working for custom kernel 2.6.11 smp deepclutch Debian 3 06-27-2005 03:59 AM
kernel panic: try passing init= option to kernel...installation with Red Hat 9 kergen Linux - Hardware 1 09-30-2004 03:28 AM
Unable to build NVIDIA kernel module / determin kernel version Night Ink Fedora 2 05-31-2004 04:54 PM
Kernel 2.4.23 compile causes kernel panics on ATA RAID-1 (mirror) array Raptor Ramjet Slackware 3 12-18-2003 01:40 PM > Forums > Linux Forums > Linux - Newbie

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

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