LinuxQuestions.org
Help answer threads with 0 replies.
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 02-08-2002, 11:41 PM   #1
cameronknives
LQ Newbie
 
Registered: Feb 2002
Distribution: Mandrake 8.1
Posts: 17

Rep: Reputation: 0
compiling problems


Hello -
I just downloaded kernel 2.4.17.14mdk-1-1mdk.i586.rpm and the sources to go with it. I did a rpm -i first to the sources and then to the kernel package and rebooted. Everything booted fine, Lilo was setup for me, uname -r shows 2.4.17mdk.
So I went to usr/src and found that my linux folder is still a link to the stock M8.1 kernel 2.4.8-26 What I want and need to do is recompile my 2.4.17 kernel so that I can select a few things I need to get support for my hardware and network. How can I recompile my kernel and do a xconfig when I don't have a Linux folder for my new 2.4.17 kernel? Don't I go to a terminal and drop into my linux folder that is linked to kernel 2.4.17 and type xconfig and then select the options I need? Problem is that I don't have a linux folder for the new 2.4.17 kernel, just the older stock one. How do I recompile my kernel then?
Thanks for your help
Scott
 
Old 02-09-2002, 12:35 AM   #2
ryanstrayer
Member
 
Registered: Jan 2002
Location: Kansas City
Distribution: RedHat 7.2 Kernel 2.4.17
Posts: 250

Rep: Reputation: 30
Just relink /usr/src/linux with the new kernel directory.

cd /usr/src
ln -s linux linux-2.4.17

the it will be linked appropriately... in which you can then

cd /usr/src/linux
make xconfig

and select what you want.
 
Old 02-09-2002, 12:36 AM   #3
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
You don't need to use /usr/src/linux to compile your kernel.

It is actually recomended that you leave the kernel headers that library is linked to in /usr/src/linux, you don't want to change the kernel headers.

you can build it in some other folder, like /usr/src/linux-2.4.17

Last edited by DavidPhillips; 02-09-2002 at 01:09 AM.
 
Old 02-09-2002, 12:49 AM   #4
cameronknives
LQ Newbie
 
Registered: Feb 2002
Distribution: Mandrake 8.1
Posts: 17

Original Poster
Rep: Reputation: 0
compile problems

I ran rpm -i on the kernel and sources packages from my HOME directory. When I go to /usr/src the only folders in there are linux, linux 2.4.8 and rpms. There is no folder that I can find anywhere on my system for linux-2.4.17mdk? That is the main problem. Is there any other places where it could possibly be? I need to run make xconfig from within my Linux folder for the new kernel to find the .config file so that I can recompile, right? Is it possible that the new kernel is not installed even though uname -r say it is and during boot after Lilo it displays 2.4.17-14mdk?
Thanks for the help so far, I can really use it : )
Scott

Last edited by cameronknives; 02-09-2002 at 12:59 AM.
 
Old 02-09-2002, 12:54 AM   #5
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
Quote:
ln -s linux linux-2.4.17

what this command does is make a link named linux-2.4.17 linking to a file named linux


I think that is backwards
 
Old 02-09-2002, 12:55 AM   #6
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
it should go to /usr/src/linux-2.4-17


was the file like this

kernel-source-*.rpm


and you should not move the /usr/src/linux from it's current target,

the libraries are linked against it.

this is what you care about, not the kernel you are running.

Last edited by DavidPhillips; 02-09-2002 at 01:03 AM.
 
Old 02-09-2002, 01:11 AM   #7
cameronknives
LQ Newbie
 
Registered: Feb 2002
Distribution: Mandrake 8.1
Posts: 17

Original Poster
Rep: Reputation: 0
No linux-2.4.17 folder

Thanks for your help so far Dave. In /usr/src I don't have a linux-2.4.17 folder like I should. Therefor I am having difficulty linking linux to said folder. What I originally did was download kernel-2.4.17.14mdk-1-1mdk.i586.rpm and linux-2.4.17.14mdk-1-1.src.rpm from Rpmfind.net to my HOME directory. I ran rpm -i on both of those files. I did the source file first then the kernel file last. I then rebooted and saw a new entry for it on my Lilo screen. It booted fine and I did a uname -r and it verified it as 2.4.17mdk. I then went to /usr/src to recompile my newly installed kernel but there was no folder for the new 2.4.17 kernel. The only folders there were the Linux folder symbolically linked to linux 2.4.8 and then the RPMS folder for it. Inside the RPMS folder I found a lot of stuff for the 2.4.17 kernel. In my /boot folder there is a system.map for the new kernel and also initrd-2.4.17.img and vmlinuz-2.4.17 and config-2.4.17 Everything seems to be in place except for the darn /usr/src/linux-2.4.17 folder? Am I really running the new kernel and can I recompile it without having a linux-2.4.17 folder for it? If there is no Linux-2.4.17 folder in there then how can I be running the new kernel?
Thanks -
Scott

Last edited by cameronknives; 02-09-2002 at 01:14 AM.
 
Old 02-09-2002, 01:21 AM   #8
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
Sounds like a mandrake thing, not sure


The correct thing to do at this point if you have the kernel folder in /usr/src/linux-2.4.8 and that's the way it came then that should be /usr/src/linux.


you can do this

mv /usr/src/linux-2.4.8 /usr/src/linux

that will make it a folder not a link, if you want a link do this

ln -s /usr/src/linux-2.4.8 /usr/src/linux


then you will still have the folder linux-2.4.8 but a link will point to it.


then you should leave that folder alone.



build you new kernels somewhere else, anywhere, it don't matter.

if you decide at some point to recompile the glibc library then you move your kernel you want to use to /usr/src/linux and compile glibc.


other than that don't move the original kernel from /usr/src/linux



I would go to kernel.org and get the kernel you want. then compile it
 
Old 02-09-2002, 01:24 AM   #9
ryanstrayer
Member
 
Registered: Jan 2002
Location: Kansas City
Distribution: RedHat 7.2 Kernel 2.4.17
Posts: 250

Rep: Reputation: 30
Quote:
Originally posted by DavidPhillips



what this command does is make a link named linux-2.4.17 linking to a file named linux


I think that is backwards
Opps yea sorry that is bass ackwards.. I've been up for too many hours.. sorry if I confused anyone.

So enlighten me David, I guess I'm missing your point to Cameron.. why should you relink /usr/src/linux ot the new kernel? Are you saying because if he boots to the old kernel it will choke on the new modules/headers?

(something tells me I should stop posting after 12am)
 
Old 02-09-2002, 01:32 AM   #10
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
the source tree is there for compiling.

if you are not compiling anything it's just sitting there.


if you compile something you want to compile it with the same kernel headers that the library was linked to.



I recently learned this, and it seems that the whole world is off on this /usr/src/linux thing.
 
Old 02-09-2002, 01:33 AM   #11
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
Linus explains it much better than I do, because he really knows what he's talking about....


http://www.uwsg.iu.edu/hypermail/lin...07.3/0587.html
 
Old 02-09-2002, 01:35 AM   #12
ryanstrayer
Member
 
Registered: Jan 2002
Location: Kansas City
Distribution: RedHat 7.2 Kernel 2.4.17
Posts: 250

Rep: Reputation: 30
Well I'm not sure if that makes sense now or not.. when you download a new kernel, the new tar ball include new kernel headers for the new kernel source.

I read the thread you posted, but it's to deep for me. The only thing I can see breaking if you relinked /usr/src/linux would be your old kernel.. because when it boots up with will be linked against /usr/src/linux which now has new kernel headers, etc from the newest kernel.

Hence, that is why my old kernel bombs out big time when I load it now.

Sorry, I'm just trying to get this thought process correct for me, and I'm sure we're confusing the heck out of Cameron! LOL

Last edited by ryanstrayer; 02-09-2002 at 01:49 AM.
 
Old 02-09-2002, 01:47 AM   #13
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
weeelll, the thing is any program you compile needs to use /usr/src/linux


that's why you leave the old kernel source tree there.
 
Old 02-09-2002, 01:49 AM   #14
cameronknives
LQ Newbie
 
Registered: Feb 2002
Distribution: Mandrake 8.1
Posts: 17

Original Poster
Rep: Reputation: 0
Still not getting it

Hi -
Thanks again everyone for your help so far. Maybe I am just slow or not expressing my problem correctly. There is no linux-2.4.17 folder in usr/src to link to. There is no Linux-2.4.17 folder anywhere on my system that I can find. I can't link to a folder that doesn't exist.
 
Old 02-09-2002, 01:52 AM   #15
ryanstrayer
Member
 
Registered: Jan 2002
Location: Kansas City
Distribution: RedHat 7.2 Kernel 2.4.17
Posts: 250

Rep: Reputation: 30
LOL - I think I edited my last comment after you posted.. maybe you should IM me so we could talk..

I see what you're saying, but what if you do all of that, leave /usr/src/linux linked to the old headers, then when you compile new programs, you'd be compiling with old headers ... unless you put in the paramater in the 'configure' or 'make' to use the new /usr/src/linux-2.4.17 or whatever.. so it would use the new headers.
 
  


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
Problems compiling gv wearetheborg Linux - Software 2 10-17-2005 07:42 AM
Problems Compiling Problems With GCC And C++ phnxbn Linux - Software 0 11-02-2004 05:49 PM
Problems installing amsn (TK compiling problems) JNewton Linux - Software 0 05-24-2004 12:07 PM
Compiling problems garf12 Linux - Software 4 03-06-2004 09:37 PM
problems compiling thejubster Linux - Software 2 07-29-2003 04:26 AM

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

All times are GMT -5. The time now is 11:22 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