LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-05-2006, 08:18 PM   #1
furiousn00b
LQ Newbie
 
Registered: Mar 2006
Distribution: CentOS 4.4
Posts: 29

Rep: Reputation: 15
Unhappy Need help on compiling/patching adding new kernel


I have the Digital Hermit Kernel Howto pulled up and thats been the only human readable guide I've found so far. But I stand here confused even still. I'm running CentOS 4.4 and it has the 2.6.9 kernel if I'm not mistaken. I'd like to get the newest .17 kernel going and have downloaded it from kernel.org, but the file says patch. I want to have multiple kernels to boot from in the grub window, but if its too complicated for now I'll settle for just patching this one. Trouble is, in the walkthrough it seems like he's inferring that I need to find every patch from .10 all the way up to .17?? And add them all together? Is that right? Baaah someone who has some patience pleeeeez explain this in lamens terms, and what the differences are between patching, upgrading, and adding kernels. Thanks a ton.
 
Old 09-05-2006, 08:30 PM   #2
Penguin of Wonder
Senior Member
 
Registered: Sep 2005
Location: West Virginia
Distribution: Gentoo
Posts: 1,249

Rep: Reputation: 45
Well I'll help you out the best I can. In a terminal type
Code:
uname -a
That should tell you what version of the kernel you have now.

To patch a kernel isn't totally neccessary. To "patch" it all you do is add a little to it like bug fixes maybe an extra driver or too. This is something you have to do before you compile your new kernel though.

To "upgrade" and "get a new kernel" are really the same thing. You can't just "upgrade" the one you have now, not like you can throw a new CPU or more RAM in your computer. All you can do is replace it with a new one. Now you can recompile it, but in your case, I would just go ahead and use a 2.6.17 kernel too. Especially if your computer is newer.

Now, if the file you downloaded says nothing but "patch" you've downloaded the wrong thing. At www.kernel.org it has all the various version layed out for you on the homepage, if you click the latest stable version listed there, all you'll download is the patch. You might need that later, but right now you need to download the kernel. If you don't you won't have anything to patch. So at the top of the page click either FTP or HTPP. It dosen't really matter which one. But for the sake of my mini howto we'll click the HTTP one. Don't click "HTTP" click the web address. You want the first address on the list, the kernel sources one. From there select the kernel folder, then you want v2.6, thats going to give you a huge list of items. The one you want will be atleast 30M+. So either download linux-2.6.17.11.tar.gz or linux-2.6.17.tar.gz. Both are kernel sources, I suggest the first one, its pre-patched for you.

Am I helping any so far?
 
Old 09-05-2006, 08:39 PM   #3
furiousn00b
LQ Newbie
 
Registered: Mar 2006
Distribution: CentOS 4.4
Posts: 29

Original Poster
Rep: Reputation: 15
omg yes! your helping an incredible amount. Ok downloading that kernel. I knew i was missing something huge here. Alright...whats next?
 
Old 09-05-2006, 09:45 PM   #4
Penguin of Wonder
Senior Member
 
Registered: Sep 2005
Location: West Virginia
Distribution: Gentoo
Posts: 1,249

Rep: Reputation: 45
Alright then. In that case after you download your sources, you'll need to move them. We're going to do this through the terminal because any other way just wouldn't be right. So open your terminal and login as root. On my Gentoo machine I use "su -" centos might use "sudo" either way remember that. So you'll then need to issue the following commands. I don't know where you downloaded the sources too, so adjust the first part of the command there to compensate.
Code:
su 
mv ~/linux-2.6.17.11.tar.gz /usr/src
Now you need to unpack the sources. They've been zipped and tarred.
Code:
cd /usr/src
gzip -d linux-2.6.17.11.tar.gz
That should unzip the file and leave you with a tar.
Code:
tar -xvf linux-2.6.17.11.tar
Now you have to make sure your symlink is pointing to the right sources. Since you've got one kernel installed I know your symlink has to be pointing to it, so we'll have to now make it point to the other sources.cp /usr/src/linux/System.map /boot/System.map-2.6.17.11
ln -s /boot/System.map-2.6.17.11 /boot/System.map
Code:
ln -sfn linux-2.6.17.11
Now
Code:
cd linux
make menuconfig
Now this part is up to you. You'll have to pick out the options you want in your new kernel. This isn't near as bad as it sounds. Almost all of the options have help associated with them, so don't be afraid to read it. Most of it is easy to understand. After you finish that it's time to compile your kernel.
Code:
make && make modules_install
mount /boot (if its not already mounted)
cp arch/i386/boot/bzImage /boot/bzImage-2.6.17.11
On my Gentoo machine I don't have to worry about the System.map file, but if you do, then you'll need to issue the following commands as well.
Code:
cp /usr/src/linux/System.map /boot/System.map-2.6.17.11
ln -s /boot/System.map-2.6.17.11 /boot/System.map
And that is about a detailed an upgrade guide as you can get. I'm so proud of my work actually I think I'll post on my website. Rock. Good luck.
 
Old 09-05-2006, 09:58 PM   #5
furiousn00b
LQ Newbie
 
Registered: Mar 2006
Distribution: CentOS 4.4
Posts: 29

Original Poster
Rep: Reputation: 15
haha ya well its been a great walkthrough so far. I feel confident enough to do it now, however I don't have a 'linux' folder in /usr/src. Instead of have kernel and redhat.

Code:
[root@localhost /]# cd /usr/src
[root@localhost src]# ls
kernels  redhat
Code:
[root@localhost src]# cd kernels
[root@localhost kernels]# ls
2.6.9-42.EL-hugemem-i686  2.6.9-42.EL-smp-i686
2.6.9-42.EL-i686          linux-2.6.17.11
Code:
[root@localhost src]# cd redhat
[root@localhost redhat]# ls
BUILD  RPMS  SOURCES  SPECS  SRPMS

Not sure where to go from here in remapping the kernel and stuff...also I only have 256mb of ram on this box, but its a dual core 450mhz or something to that effect. I read somewhere that 'make BZimage' is better for lesser ram systems than 'make zimage' and it will avoid the 'System is too big error' know anything about that? would that be advisable for my system in particular?

Last edited by furiousn00b; 09-05-2006 at 10:02 PM.
 
Old 09-05-2006, 10:23 PM   #6
Penguin of Wonder
Senior Member
 
Registered: Sep 2005
Location: West Virginia
Distribution: Gentoo
Posts: 1,249

Rep: Reputation: 45
I would put in Kernels, which is where it looks like you've already got it. As for the last part I don't know, never heard that. I've compiled kernels just fine on a computer with less RAM than that using the method I just gave you. If you have a dual core processor then you should be fine, but make sure you enable SMP in the kernel, or you'll be screwed.
 
Old 09-05-2006, 10:42 PM   #7
furiousn00b
LQ Newbie
 
Registered: Mar 2006
Distribution: CentOS 4.4
Posts: 29

Original Poster
Rep: Reputation: 15
Code:
[root@localhost ~]# locate System.map
/boot/System.map-2.6.9-42.ELsmp
/boot/System.map-2.6.9-42.EL
Don't have that file so I'm going to skip this step for now:

Code:
cp /usr/src/linux/System.map /boot/System.map-2.6.17.11
ln -s /boot/System.map-2.6.17.11 /boot/System.map
ln -sfn linux-2.6.17.11
I'll go ahead and make it and compile until you or someone else can tell me what the RHE/CentOS type map file is and what to do with it....here goes...
 
Old 09-06-2006, 12:37 AM   #8
furiousn00b
LQ Newbie
 
Registered: Mar 2006
Distribution: CentOS 4.4
Posts: 29

Original Poster
Rep: Reputation: 15
done..

alright its done compiling but gave this message at the end...in fact its the only error or message it gave me:

Code:
drivers/input/joydev.c:597: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.
The bug is not reproducible, so it is likely a hardware or OS problem.
make[2]: *** [drivers/input/joydev.o] Error 1
make[1]: *** [drivers/input] Error 2
make: *** [drivers] Error 2
Will that be a problem at all? anyways, what I'm really wanting to know is how to finish the /boot and grub updates since I couldnt find that file to copy. Thanks for all the help!!

*****

Hmm and something else, went ahead and ran make bzImage and it started doing its thing again. This is another error I received at the end of it:

Code:
net/ipv4/tcp_input.c: In function `tcp_parse_options':
net/ipv4/tcp_input.c:136: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.
The bug is not reproducible, so it is likely a hardware or OS problem.
make[2]: *** [net/ipv4/tcp_input.o] Error 1
make[1]: *** [net/ipv4] Error 2
make: *** [net] Error 2

Last edited by furiousn00b; 09-06-2006 at 02:35 PM.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
error while patching Rtlinux 3.1 kernel using kernel linux-2.4.29 dolreich_c Linux - General 1 02-06-2018 06:48 AM
Patching the Kernel Zuggy Linux - General 3 12-27-2004 08:34 AM
Patching a 2.6 kernel with a 2.4 kernel keyboard driver..possible? dxx Linux - Laptop and Netbook 3 11-18-2004 04:18 AM
Kernel Patching? wr3ck3d Linux - General 4 04-13-2003 03:17 PM
patching and re-compiling kernel denbark3725 Linux - Newbie 1 07-11-2002 12:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:12 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
Open Source Consulting | Domain Registration