LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-21-2003, 05:09 PM   #1
killer_bunny
Member
 
Registered: Oct 2003
Location: Croatia
Distribution: RedHat 9, Slack
Posts: 106

Rep: Reputation: 15
where should kernel be located


I have seen posts and tutorials saying that kernel should not be untared in /usr/src?
Is this true?
And do i need after the compilation make symbolic link to source directory of kernel?
 
Old 12-21-2003, 05:14 PM   #2
Skyline
Senior Member
 
Registered: Jun 2003
Distribution: Debian/other
Posts: 2,104

Rep: Reputation: 45
It is possible to untar into your home directory then

cp -Rpdf

into /usr/src

then - if there's an old symlink to an existing source tree, delete it first , make a new one to your new tree then cd into it and carry on as normal
 
Old 12-21-2003, 05:17 PM   #3
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 48
skyline: what is the purpose of the symlink? i have never made one, and i have never had a problem compiling kernels (other than the normal ones, wrong options, etc. ) is it just something that has always been done so people still do it, or is there a safety/security/other reason?
 
Old 12-21-2003, 05:22 PM   #4
killer_bunny
Member
 
Registered: Oct 2003
Location: Croatia
Distribution: RedHat 9, Slack
Posts: 106

Original Poster
Rep: Reputation: 15
Well i compiled and currently using kernel 2.4.23 without symlink...
But today i had a conversation with my friend and he sead i should make one...
But he didnt say why??

And if i make one dose it need to be named Linux-2.4 for all 2.4.xx kernels?
 
Old 12-21-2003, 05:25 PM   #5
Skyline
Senior Member
 
Registered: Jun 2003
Distribution: Debian/other
Posts: 2,104

Rep: Reputation: 45
Talking

You can just call it "Linux"

No idea Synap. - after flicking through several how-tos etc , still haven't found an answer either - anyone else ?
 
Old 12-21-2003, 05:27 PM   #6
killer_bunny
Member
 
Registered: Oct 2003
Location: Croatia
Distribution: RedHat 9, Slack
Posts: 106

Original Poster
Rep: Reputation: 15
While we are on locations is there any specific place to store rpm's?
 
Old 12-21-2003, 05:29 PM   #7
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Rep: Reputation: 46
well, the imp thing is the kernel image. the vmlinuz ...
you can untar your kernel source archive anywhere. you should do it under any dir (i do it under /home/xxx) .
in the end u gonna move the kernel image to /boot.
i have scrapped my system many times, and everytime i would do a format on every partition except for the /home partition. this way, all i have to do is move the kernel images from my kernel compiles from earlier into /boot, and im ready to go. no wasting time untarring, configuring, building. all i have to do is edit my lilo then. i think thats at least 20 mins saved for every kernel compile.

the symlink (symbolic link) points to a file. for instance, if you are under the /usr/src/ directory, and your kernel source tree is under /home/newkernel/linux-2.6.0, then doing a "ln -s /home/newkernel/linx-2.6.0 linux" will make a file called linux under /usr/src. so, you can now go into the /usr/src/linux file and u will actually be traversing the file system under /home/newkernel/linux-2.6.0.

i hope i didnt confuse too much.
 
Old 12-21-2003, 05:34 PM   #8
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Rep: Reputation: 46
Quote:
Originally posted by killer_bunny
Well i compiled and currently using kernel 2.4.23 without symlink...
But today i had a conversation with my friend and he sead i should make one...
But he didnt say why??

And if i make one dose it need to be named Linux-2.4 for all 2.4.xx kernels?
If you are compiling different versions of the same kernel version (2.4.xxx or 2.6.xxx), its because you want to use something in the newer version (unless you just compile kernels for kicks, heh). for this, you will make changes during configuration. once you make a change for a kernel build, you have to know which one it was for, hence the different names given in grub or lilo. so you should see 2.4.18-bf24, 2.4.22, 2.4.23 in ur bootloader.

i havent tried, but maybe bootloaders are smart enough to give you errors if you dont give different names?
 
Old 12-21-2003, 05:35 PM   #9
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
To my knowledge when compiling the kernel, I think (not totally sure) but when compiling, it will look at the /usr/src/linux directory instead of the directory you unzipped/untarred to with the default name.
Ex. I untar linux-2.6.0.tar.gz it will create the directory linux-2.6.0.

Also makes it easier to keep more than one kernel download/source to compile from in that directory, cause you can't have dozens of linux directories in the same folder, so when you download a new one, simply change the symlink of linux to go to the current kernel your compiling, etc.

And RPM's you can store anywhere you want or remove them after installing as they've been installed to their correct locations, etc and into the RPM database. The only reason you will probably want to keep them around is to uninstall, etc.
 
Old 12-21-2003, 05:36 PM   #10
killer_bunny
Member
 
Registered: Oct 2003
Location: Croatia
Distribution: RedHat 9, Slack
Posts: 106

Original Poster
Rep: Reputation: 15
" symbolic link is just a second name for an object (file or directory).
In this case, /usr/src/linux is a generic name that we all use to point to
our (current) kernel source. Then any program or person looking for kernel
source doesn't need to figure out which directory contains your actual
source, in case you have several versions."

This is what i found about it...
If i am not mistaking in translation the symlink is needed for other programs that needs kernel source so they would know were the source is..
 
Old 12-21-2003, 05:37 PM   #11
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Rep: Reputation: 46
and if im not mistaken, the reason why we create the symlink linux under /usr/src/ and thennnnnnn work from inside /usr/src/linux is because the builds are all relative to "linux".
for instance if you try to compile your own pcmcia package, you will see it requires it to be placed relative to where your "linux" is. of co, you can have it relative to /home/whatever ... but lot of ppl use /usr/src as the start point
 
Old 12-21-2003, 05:49 PM   #12
killer_bunny
Member
 
Registered: Oct 2003
Location: Croatia
Distribution: RedHat 9, Slack
Posts: 106

Original Poster
Rep: Reputation: 15
And third and i hope final question...
How do you make symlink?

I made one by issuing:

ln -s linux-2.4.23 linux

And i thik i didn't make a symlink...
Cause when i removed the previous symlink to linux-2.4 it "went away" but when i try to remove this one i made it says

rm: cannot remove directory `Linux/': Is a directory

How's that possible?
 
Old 12-21-2003, 05:55 PM   #13
Skyline
Senior Member
 
Registered: Jun 2003
Distribution: Debian/other
Posts: 2,104

Rep: Reputation: 45
You just need to remove the old symlink, not the old source tree

for the old symlink you can use use

rm -rf

etc
 
Old 12-21-2003, 06:06 PM   #14
killer_bunny
Member
 
Registered: Oct 2003
Location: Croatia
Distribution: RedHat 9, Slack
Posts: 106

Original Poster
Rep: Reputation: 15
i have figure it out...
I didn't make link as i should have...

i typed:

ln -s linux-.2.xx/ linux

and i should have typed

ln -s linux-2.xx linux without that slash symbol...
 
Old 12-21-2003, 06:10 PM   #15
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 48
Quote:
Originally posted by trickykid
Also makes it easier to keep more than one kernel download/source to compile from in that directory, cause you can't have dozens of linux directories in the same folder, so when you download a new one, simply change the symlink of linux to go to the current kernel your compiling, etc.
i just throw everything in /usr/src. so for ex i have linux-2.4.23, linux-2.6.0, and before 2.6.0, linux-2.4.22 all in /usr/src. then to work on the kernel, i just go into that directory. i don't even have a /usr/src/linux. maybe i'm just lazy, but to me it seems like making a link is just one more thing that can go wrong. my attitude has always been that it works without it, so why bother?
 
  


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
Where is kernel header files located? Oh Cisco Debian 1 10-22-2004 06:11 AM
Where is the linux kernel source code located in mandrake 10? SGFHK321 Linux - Newbie 6 07-12-2004 10:52 PM
Where are sndconfig and isapnp tools located in RHEL3 (ws) kernel version 2.4.21-4 ( k_c_kumar Red Hat 8 02-04-2004 11:57 AM
Mandrake 8.2: Where exactly is the Kernel located? Doalwa Linux - Newbie 2 05-10-2002 02:17 AM
Where's my kernel source located??? jaycee999 Linux - Newbie 2 04-07-2002 01:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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