LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 08-23-2006, 07:49 PM   #1
pete1234
Member
 
Registered: May 2005
Distribution: Slack, FreeBSD,NetBSD, OpenBSD, Open Solaris, Minix
Posts: 172

Rep: Reputation: 30
Kernel Source Location


Up until now I think I've been going about updating my kernel ass backwards. First off, I always download the whole source which doesn't take very long, but seems unnecessary. So I was looking into just applying the patch instead. In doing so I realized I keep my kernel source in /boot, and not /usr/src/linux. So I'd like to know two things; one is there any reason to store the source in /usr/src/linux, or is it just tradition, also is there any disadvantage to applying a kernel patch, as opposed to fresh source. I apologize if these are silly question, when it comes to kernel matters other than just customizing / compiling I'm a newb.
 
Old 08-23-2006, 08:06 PM   #2
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
Quote:
one is there any reason to store the source in /usr/src/linux, or is it just tradition,
No, and Linus Torvads says it's a bad idea to compile kernels from there. He says it's better to compile the kernel as a user in your home directory and then install.
Some old programs may check the /usr/src/linux link to find the kernel source if they need it (not sure about that), but the correct place to find the kernel source is the /lib/modules/<version>/build link. So make sure this points to the correct location.

Quote:
also is there any disadvantage to applying a kernel patch, as opposed to fresh source
No, it's the same thing. That's why the patches are for.
 
Old 08-23-2006, 08:13 PM   #3
pete1234
Member
 
Registered: May 2005
Distribution: Slack, FreeBSD,NetBSD, OpenBSD, Open Solaris, Minix
Posts: 172

Original Poster
Rep: Reputation: 30
Thanks for the reply. Another question, when I patch, I'd still patch the kernel source (which I have in /boot) per this link: http://kernelnewbies.org/FAQ/HowToApplyAPatch as opposed to /lib/modules/<version>/build?
 
Old 08-23-2006, 08:41 PM   #4
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
This link is created when you do "make modules_install" To install the modules. So this is not a problem.
 
Old 08-23-2006, 08:49 PM   #5
pete1234
Member
 
Registered: May 2005
Distribution: Slack, FreeBSD,NetBSD, OpenBSD, Open Solaris, Minix
Posts: 172

Original Poster
Rep: Reputation: 30
Thanks. Guess I'm going to go ahead and patch.
 
Old 08-27-2006, 02:53 AM   #6
ciotog
Member
 
Registered: Mar 2004
Location: Canada
Distribution: Slackware current
Posts: 728
Blog Entries: 2

Rep: Reputation: 43
Patching is definitely the way to go, even if just to take some load off of the kernel.org servers.

I read that FAQ, and I must say they make it sound rather confusing. It's really not so complicated - I think the README in the kernel source says it more clearer.
 
Old 08-27-2006, 03:10 AM   #7
unreal128
Member
 
Registered: Jun 2003
Distribution: SuSE, Slackware, Gentoo
Posts: 207

Rep: Reputation: 30
If it is a bad idea to have the source in /usr/src/linux, why do some distros (eg. Gentoo) use it to compile the kernel with their automated tools (eg. genkernel?) Why put it in the user directory if it can only be compiled by root? I am not questioning the wisdom of your guy's conclusion, I just want to understand it better for myself.
 
Old 08-27-2006, 10:54 AM   #8
ciotog
Member
 
Registered: Mar 2004
Location: Canada
Distribution: Slackware current
Posts: 728
Blog Entries: 2

Rep: Reputation: 43
The kernel can be compiled by anyone with read/write privileges in the folder where the kernel has been extracted, it only needs to be installed as root.

As for the kernel location, I always used to use /usr/src but have since migrated to /home/share/kernel (I create a /home/share folder on every system I set up for shared files). Basically when you are compiling some software, it may look at /usr/src/linux first when it should really be checking /lib/modules first (as mentioned by perfect_circle). If this software uses kernel headers for a new kernel, whereas the c libraries were compiled against an older kernel, you could end up with library issues ("missing" functions and such that were added to the new kernel).

I don't think I'm explaining it too well, but that's the general idea. If you search for "linus /usr/src headers" I'm sure you could find some commentary by Linus Torvalds concerning the matter. If you read the original README files for some older kernels you'll see that at one point it was suggested to use /usr/src, but this has been changed.
 
Old 08-27-2006, 04:08 PM   #9
unreal128
Member
 
Registered: Jun 2003
Distribution: SuSE, Slackware, Gentoo
Posts: 207

Rep: Reputation: 30
Thanks for the explaination. I will check out the resources out there.
 
  


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
Kernel Source Location alltime Linux - General 2 10-18-2005 12:21 AM
Location of kernel source Echo Kilo Linux - General 2 12-19-2004 06:15 PM
location of kernel source joe_sixpack Linux - General 2 02-19-2004 03:45 AM
Location of kernel source code mhl Mandriva 2 11-30-2003 05:02 PM
Kernel Source Location in Mandrake 9.1? Ken Ju-On Linux - Newbie 11 08-13-2003 07:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

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