LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 12-19-2003, 10:02 AM   #1
navarre9
Member
 
Registered: Nov 2003
Posts: 40

Rep: Reputation: 15
To Compile A Kernel


Here is my very simple question:

I have asked in other forums, i have asked to other more experienced linux users, i have followed wrong or inacurate instructions found on the web and NO ONE, absolutely NO ONE seems to give me a simple answer:

How the hell do i compile and/or install a kernel?

I have numerous (as always with ANY linux) hardware detection and configuration problems and everytime i try to solve them the answer is invariably the same: "You have to compile the kernel, bla bla bla".

So once and for all could somebody tell me or indicate me a website that tells me IN DETAIL how to install and compile a kernel?

For what it's worth i'm now using MEPIS Linux (it's based on Debian)

 
Old 12-19-2003, 10:10 AM   #2
kingka
Member
 
Registered: Aug 2003
Location: mechelen (belgium)
Distribution: debian gnu/linux (sid)
Posts: 99

Rep: Reputation: 15
if you are using debian this is worth reading...

http://www.osnews.com/story.php?news_id=2949


I have installed my first kernel (the 2.4.23) 2 weeks ago I think and this howto really helped me. One important thing: never forget to use the "lilo -v" command when you are finished or you won't be able to boot your system anymore (I know that because I screwed it up the first time)

I suppose the described method still works for 2.6.0 but I will only try it on monday when I have more time...
anybody has already installed 2.6.0 the debian way?
 
Old 12-19-2003, 10:32 AM   #3
enyawix
Member
 
Registered: Sep 2003
Location: ky
Distribution: gentoo
Posts: 399

Rep: Reputation: 32
Lightbulb Kernel HOWTO

This howto is based on 2.6.0
1 download the src from http://www.kernel.org/pub/linux/kern...x-2.6.0.tar.gz
2 move the src to /usr/src/ "su passwd mv /home/user.name/linux-2.6.0.tar.gz /usr/src/linux-2.6.0.tar.gz"
3 move to /usr/src/ "cd usr/src/"
4 ungzip src "gzip -d linux-2.6.0.tar.gz
5 untar src "tar -xvf linux-2.6.0.tar.gz"
6 link src "ln -s linux /usr/src/linux"
7 move to /usr/src/linux "cd /usr/src/linux"
8 configure src "make menu config"
9 build kernel "make bzImage"
10 move kernel to /boot "mv /usr/src/linux/arch/i386/boot/bzImage /boot"
ask me for a lilo howto if you need one
 
Old 12-19-2003, 10:52 AM   #4
kingka
Member
 
Registered: Aug 2003
Location: mechelen (belgium)
Distribution: debian gnu/linux (sid)
Posts: 99

Rep: Reputation: 15
thank you enyawix, if you have a good lilo howto I would like to have it too...
 
Old 12-19-2003, 11:14 AM   #5
navarre9
Member
 
Registered: Nov 2003
Posts: 40

Original Poster
Rep: Reputation: 15
yeah, me too enyawix!

Thanks for the post!
 
Old 12-19-2003, 11:57 AM   #6
navarre9
Member
 
Registered: Nov 2003
Posts: 40

Original Poster
Rep: Reputation: 15
by the way, i just tried eniawix's instructions. they don't work.

i do exactly as he says in the previous post but when i get to the part "make menu config" there's an error message saying there is no such file or directory or something like that.

I tried "make menuconfig", "make config" and "make xconfig"

None worked. Back to square one...
 
Old 12-19-2003, 12:57 PM   #7
kingka
Member
 
Registered: Aug 2003
Location: mechelen (belgium)
Distribution: debian gnu/linux (sid)
Posts: 99

Rep: Reputation: 15
navarre9,
make sure you have installed all the necessary packages (check the howto in one of the previous messages)
maybe you don't have installed the kernel-package?
I don't know if your debian-based distro has apt-get, if so just try apt-get install kernel-package
and check the other necessary software in the howto (http://www.osnews.com/story.php?news_id=2949)

good luck!
 
Old 12-19-2003, 01:26 PM   #8
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
navarre9,

eniawix's instructions has bugs in steps 5 and 7. His instructions have you first unzip, then untar however the file he has you untarring in step 5 is the .gz file (zipped). You can combine steps 4 and 5 with a single command:

tar -zxvf linux-2.6.0.tar.gz

That will both unzip and untar the file. Once you've done that, check to make sure that you have a directory called linux-2.6.0 (or something similar). Now for step 7, he's having you create a symlink named linux to the directory that was created in steps 4/5. To correctly do that you need to execute the following command:

ln -s /usr/src/linux-2.6.0 linux

Again, check to make sure that the symlink has been created (ls -l).

Then drop down into your new linux directory (cd linux) and do a quick ls to make sure there are files there. If there aren't, you haven't done something right. And yes, it should be make menuconfig or make xconfig if you are running from a console in X.

And if you haven't already, have a read in the Slackware forum for DaOne's kernel guide for the

2.6.0 kernels and the 2.4.x kernels.
 
Old 12-19-2003, 01:46 PM   #9
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Would someone please explain to me why it's necessary to have
a the symlink link->linux-2.6.0 ? I don't understand the purpose of it.

Thank you.

edit:

wait. i thought of a purpose. it's so that other programs
that need the kernel source can use, right?
it's not needed for creating the new kernel image though, is it?

Last edited by Berhanie; 12-19-2003 at 02:03 PM.
 
Old 12-19-2003, 03:19 PM   #10
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
You're right, you don't need it to create the new kernel. In fact the kernel tree doesn't have to be in /usr/src. However, this is convention, so following it may avoid problems later on.
 
Old 12-19-2003, 03:49 PM   #11
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Thanks a lot, Hangdog. Good to know that.
 
Old 12-19-2003, 10:28 PM   #12
enyawix
Member
 
Registered: Sep 2003
Location: ky
Distribution: gentoo
Posts: 399

Rep: Reputation: 32
Exclamation howto fix

navarre9, was correct about step 4 and 5

Quote:
eniawix's instructions has bugs in steps 5 and 7. His instructions have you first unzip, then untar however the file he has you untarring in step 5 is the .gz file (zipped). You can combine steps 4 and 5 with a single command: tar -zxvf linux-2.6.0.tar.gz
navarre9 was incorrect about step 7

step 6 is broken i had 6 link src "ln -s linux /usr/src/linux"

step 6 should be "ln -s /usr/src/linux-2.6.0 /usr/src/linux"

that is why make menuconfig did not work.
 
Old 12-20-2003, 06:19 PM   #13
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
From your first post:

Quote:
4 ungzip src "gzip -d linux-2.6.0.tar.gz
5 untar src "tar -xvf linux-2.6.0.tar.gz
Step 4 would result in a file named linux-2.6.0.tar so therefore step 5 needs to be tar -xvf linux-2.6.0.tar. Since you have tar -xvf on a .tar.gz file, it ain't gonna work. However, tar -zxvf would.


Quote:
step 6 should be "ln -s /usr/src/linux-2.6.0 /usr/src/linux"
that is why make menuconfig did not work.
In a word, no. You do NOT need the symlink for make menuconfig to work. You only need to be in directory created by unpacking the linux-2.6.0 tarball. I've successfully compiled many a kernel in directories that are not symlinked.
 
Old 12-20-2003, 06:49 PM   #14
enyawix
Member
 
Registered: Sep 2003
Location: ky
Distribution: gentoo
Posts: 399

Rep: Reputation: 32
Lightbulb kernel

Hangdog42 you are correct but some 3rd party drivers will look for /usr/src/linux
 
Old 12-20-2003, 08:34 PM   #15
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
I believe I said that a couple of posts back....

Quote:
You're right, you don't need it to create the new kernel. In fact the kernel tree doesn't have to be in /usr/src. However, this is convention, so following it may avoid problems later on.
 
  


Reply


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
upgraded kernel, won't let me compile kernel once Suspend2 patches are applied microsoft/linux Linux - Laptop and Netbook 3 10-02-2005 03:37 PM
I want to compile 2.6 kernel and keep everything from 2.4 intact (dual kernel system) sina_kish Linux - Software 7 02-02-2005 10:01 AM
Kernel Problems. Howto Compile a new kernel from 4.2 with backwards compatibility ? ShoCkwave Linux - General 2 06-19-2004 07:02 AM
can i compile just one kernel module whithout recompiling the whole kernel? edman007 Linux - Software 3 02-17-2004 04:05 PM
Kernel 2.4.23 compile causes kernel panics on ATA RAID-1 (mirror) array Raptor Ramjet Slackware 3 12-18-2003 02:40 PM


All times are GMT -5. The time now is 06:18 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration