LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   where should kernel be located (https://www.linuxquestions.org/questions/linux-newbie-8/where-should-kernel-be-located-127888/)

killer_bunny 12-21-2003 05:09 PM

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?

Skyline 12-21-2003 05:14 PM

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

synaptical 12-21-2003 05:17 PM

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. :p) is it just something that has always been done so people still do it, or is there a safety/security/other reason?

killer_bunny 12-21-2003 05:22 PM

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?

Skyline 12-21-2003 05:25 PM

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 ?

killer_bunny 12-21-2003 05:27 PM

While we are on locations is there any specific place to store rpm's?

h/w 12-21-2003 05:29 PM

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. :)

h/w 12-21-2003 05:34 PM

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?

trickykid 12-21-2003 05:35 PM

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.

killer_bunny 12-21-2003 05:36 PM

" 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..

h/w 12-21-2003 05:37 PM

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

killer_bunny 12-21-2003 05:49 PM

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?

Skyline 12-21-2003 05:55 PM

You just need to remove the old symlink, not the old source tree

for the old symlink you can use use

rm -rf

etc

killer_bunny 12-21-2003 06:06 PM

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...:tisk: :rolleyes: :study: :study: :study: :study:

synaptical 12-21-2003 06:10 PM

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. :D 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. :eek: :p 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? :D


All times are GMT -5. The time now is 02:18 AM.