LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-04-2006, 11:15 AM   #1
Padawan.AVT
Member
 
Registered: Feb 2006
Distribution: Gentoo, Slackware, Debian, Suse
Posts: 86

Rep: Reputation: 15
Kernel compiling


I've a few questions about subject:
now I'm working under 2.4.29 kernel, but I want to compile a 2.6.15.6
The problem is that I'll do it for the first time and I don't know how to do it right (universal manuals didn't help, for example in books and README file said about /usr/src/linux but I don't have such a directory)
Also some people told me that usage of kernel 2.6 after 2.4 may cause troubles with dependencies.
 
Old 05-04-2006, 12:24 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,223
Blog Entries: 1

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
Quote:
n books and README file said about /usr/src/linux but I don't have such a directory
You should d/l the sources fromkernel.org
Quote:
Also some people told me that usage of kernel 2.6 after 2.4 may cause troubles with dependencies.
You only need the newest module-init-tools
As for compiling a 2.6.x kernel there is a nice guide in the top of this forum.

Regards
 
Old 05-04-2006, 12:46 PM   #3
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 47
/usr/src/linux is just a link to the source of the kernel version. Once you download the kernel source and extract to /usr/src/, create a link to it like so:
Code:
#ln -s /usr/src/linux-2.6.15.6 /usr/src/linux
regards,
...drkstr
 
Old 05-04-2006, 03:20 PM   #4
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
Quote:
Originally Posted by drkstr
/usr/src/linux is just a link to the source of the kernel version. Once you download the kernel source and extract to /usr/src/, create a link to it like so:
Code:
#ln -s /usr/src/linux-2.6.15.6 /usr/src/linux
regards,
...drkstr
that link is not needed.
just skip it...

egag
 
Old 05-04-2006, 03:52 PM   #5
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 47
Quote:
that link is not needed.
this is correct, it's use is for simplicity only. I have many different kernel source versions in my /usr/src directory and like to keep the link updated so I don't have to remember which version I currently have installed.

regards,
...drkstr
 
Old 05-04-2006, 05:27 PM   #6
piete
Member
 
Registered: Apr 2005
Location: Havant, Hampshire, UK
Distribution: Slamd64, Slackware, PS2Linux
Posts: 465

Rep: Reputation: 44
`uname -a` would probably save you the hassle of constantly updating your symlink
 
Old 05-04-2006, 05:31 PM   #7
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
...and that link is also advised in a lot of kernel-howtos.

btw. if you read the README file in the kernel-source tree
you'll see they ( L. T. ) suggest to compile a kernel in your home-dir.
you can do that as a normal user and it keeps the /usr/src clean.

egag
 
Old 05-04-2006, 11:31 PM   #8
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
iptables, cdrtools and a few others completely crap out on the make if you have /usr/src/linux.... Just a bad idea in general to have that link around IMO... I always ignored the kernel devs the past couple years on the subject untill I started to build lots of packages. The 'convienence' factor went right out the window along with my headaches...
 
Old 05-05-2006, 12:09 AM   #9
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 47
That's strange, I've had no problems whatsoever with it. I have both iptables and cdrtools and have upgraded to many different kernel versions starting with 2.4.29. I am curious to know what exactly would cause the problem, it is after all just a link. Maybe certain things think it has the same kernel source version in two different directories and gets confused? Can any one expand a little bit more on the reasoning behind this? Or perhaps suggest some reading that specifically states the conflicts it creates? I learn by doing, and until I see a direct problem with the /usr/src/linux, I am going to keep using it. It's not that I don't value your advice, you are probably right about it, I'm just a learn the hard way kind of person.

regards,
...drkstr
 
Old 05-05-2006, 01:14 AM   #10
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Yea, I'm the same way. That's why I used it for so long.

What seems to be happening is that some programs look for the kernel headers by way of /usr/src/linux/include when they should be looking in /usr/include. I'm not entirely sure to tell you the truth but I believe thats what is happening. I was talking about building iptables/cdrtools yourself, not just having it installed. Compile iptables and cdrtools yourself and watch it bomb. I forget what it spit out at me. It basically states the wrong kernel headers were found.

Here's a link that somewhat explains it.

http://linuxmafia.com/faq/Kernel/usr...x-symlink.html

Linus is mostly talking about header symlinks but also mentions the /usr/src symlink. They are infact both directly related. If you use /usr/src/linux your stating (to certain progs) that the kernel headers that were used to build glibc can be found in /usr/src/linux/include. 9 times out of ten we are NEVER using the same kernel that was used against our running glibc.

I could be a little off in my explanation. Regardless of what is really happening, I don't have any more problems since I ditched the symlink.

Incase you missed the very last link in the link I posted above...

"Some source packages indeed search for /usr/src/linux for configuration purposes.If this is not just a default which could, and should, be adjusted then they are simply wrong."

Seems that this is what is happening with iptables/cdrtools. Those maintainers are still using old 'standards' of finding headers. Hmm... Maybe I had 2 kernel versions is /usr/src at the time with a symlink pointing to the wrong one. I forget now. I'm half-tempted to track it down again now that you got me thinking about it.

Last edited by jong357; 05-05-2006 at 01:34 AM.
 
Old 05-05-2006, 02:06 AM   #11
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Well, I just tried to compile both progs and they worked.. Make a liar out of me will ya'?!!

I think what happened with iptables is that I was booting with 2 different kernels and my /usr/src/linux symlink was stale.

-I/usr/src/linux/include

Obviously thats a problem if your symlink isn't point to the running kernel. Use it if you wish or not.... At most, It's just a weak link that has the potential for failure...
 
Old 05-05-2006, 02:07 AM   #12
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 47
Thanks for the good info. I'm going to play around with it a bit and see what happens. I'm glad I started posting on LQ, I always seem to be learning new stuff when I least expect it.

regards,
...drkstr
 
  


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
Errors Compiling Kernel 2.6 on Slackware 10.2 - Old kernel headers required? Dave S. Slackware 8 03-04-2006 12:15 AM
Compiling kernel = kernel panic Tons of Fun Debian 5 07-02-2005 01:59 PM
Compiling kernel module for linux kernel 2.4 in 2.6 guam Linux - Software 0 01-13-2005 02:02 AM
Where Is Kernel Directory In Rh9(kernel 2.4.20-8), For Compiling HSP56 MR(pctel) Mode rudy3107 Linux - Software 1 07-25-2004 04:17 AM
Kernel compiling and module compiling tarballed Linux - General 1 12-22-2002 05:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:22 PM.

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