LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 02-13-2005, 05:30 PM   #1
Shagrath239
Member
 
Registered: Jan 2005
Location: Santiago, Chile
Distribution: Looking towards LFS
Posts: 67

Rep: Reputation: 15
Exclamation I just cant get it right: If I download the kernel source, where do I put the files?


I dont understand this.

I have a tiny tiny HDD, so I need to do a very minimal installation, so!!, im NOT installing the kernel source that comes in the CD 1, im downloading it from the net.

SO!!!, if I download the kernel source, where does the extracted files go??? Ive read in a lot of places that they must be extracted in /usr/src, but in other ones ive read that they can go anywhere... and someplace i red that they have to be IN BOTH PLACES, the one you choose, and /usr/src.


And Im not getting it right... im only downloading the kernel from the net... not installing the source from the cd... so please, tell me where do these files go in order to succesfully compile the kernel!!!!!!!!!



PS: I think i'll compile the version 2.6.10.
 
Old 02-13-2005, 05:35 PM   #2
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
if you extract the kernel-tar in your home-dir, you'll be ok.
you can best use that, because a user cannot copy files to and from /usr/src.

so you only have to become root at install-time.

egag
 
Old 02-13-2005, 05:51 PM   #3
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Try to planify your filesystem, for my part I created a /home/build directory with user
permission and in which I extract an compiles kernel sources.
The reason I want it in a proper location is because when you do make modules_install, it
creates a symlink : /lib/modules/`uname -r`/build pointing to kernel sources (in my
/home/build/linux.x.x dir) . This symlink is required to build nvidia driver for example
 
Old 02-14-2005, 12:46 PM   #4
kriton12
Member
 
Registered: Oct 2002
Posts: 81

Rep: Reputation: 16
most FAQ's or guides on kernel compililng will tell you to put it in /usr/src mainly because it makes sense to put it there if you're going to be looking for it in the future. Just think, src is short for source, so if you have source code for the kernel you'd put it in there. However, you can put it anywhere, and if you still want to adhere to what a guide says in terms of thinking about the /usr/src/linux directory you can make a symbolic link from there to where ever it is that you put the source code to your kernel. For example, say if you had 3 copies of source code for different kernel versions, 2.4.24, 2.6.7, and 2.6.10 and you weren't sure which one you were going to be using or when, you could easily symlink a generic /usr/src/linux link to whatever version of the kernel you wanted to compile for testing. On my computer I have a 2.4.24 version and 2.6.7 version of source code. When compiling the 2.6.7 I made a sym link to that directory like this: directory name /usr/src/linux_2.6.7

ln -s /usr/src/linux_2.6.7 /usr/src/linux

So anytime you cd'd into /usr/src/linux it would actually take you to the /usr/src/linux_2.6.7 directory instead. This makes it easier for anybody using the system that goes looking for the source because it is in a standard link / standard location. Notice that you can put the actual source anywhere like /home/user1/sourcecode/2.6.10 or something, just link /usr/src/linux to there instead and you'd have the appearance of a standard location even though you actually have the source elsewhere. You don't need to do this of course, but for clarity it makes things simpler.


Now for the space issue. The kernel source code is much bigger than your compiled kernel is going to be. I think the source is something like 30-40 meg? At least the source from http://www.kernel.org/pub/linux/kernel/v2.6/ the archives are in that range.
When you compile the source the kernel image will still be relatively big which is why you'd want to issue the 'make bzImage' after you finished compiling which will shrink the size down to something more manageable. Sometimes this is done for you, although issuing that command will simply overwrite it so I don't think there is any harm in running it again. That will put the image into the arch/i386/boot/bzImage location (or whatever architecture you are building for). At least that is my experience on slack, but I think this is a standard practice. The bzImage is the image you would copy over to your /boot directory. If you're booting with Lilo or grub you can name the image whatever you want and just make an additional entry into your boot manager (lilo, grub, etc.) to have this kernel added to the menu. It is an excellent idea to do this just in case your kernel doesn't boot correctly, that way you'd have a backup to boot to and your system would still be useable.

Don't worry, it'll probably take you a couple of tries to get the right kernel compile that you want, but after you do it a couple of times it'll be old hat. If you happen to get it right your first time, then congratulations!
 
Old 02-14-2005, 12:56 PM   #5
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Quote:
I think the source is something like 30-40 meg
yes but when extracted and compiled :
$ du -h linux-2.6.10/
300M linux-2.6.10/

As you can see it take 300 MB of disk space
 
Old 02-14-2005, 02:39 PM   #6
Linux~Powered
Member
 
Registered: Jan 2004
Location: /lost+found
Distribution: Slackware 14.2
Posts: 849

Rep: Reputation: 33
If you're limited on space that much you can delete the kernel-2.6.? and the 2.4.29 kernel in your /usr/src "after" you have built and made all the proper links to your /boot, but I myself would keep at least one in your /usr/src. I wrote a little How-To on the subject. here
 
Old 02-14-2005, 09:13 PM   #7
Shagrath239
Member
 
Registered: Jan 2005
Location: Santiago, Chile
Distribution: Looking towards LFS
Posts: 67

Original Poster
Rep: Reputation: 15
Thanks for the answers guys... Im on another computer right now... the Slack machine is compiling at this time... wish me luck!!!

I did it as compact as I could.


PS: The menuconfig of the 2.6.x is much more easier to use than the one of the 2.4.x!!!
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I need to download kernel-source-2.6.0-7 Thaidog Linux - General 2 11-20-2005 03:49 PM
Where must I download files to so I can compile and install from source? eBopBob Linux - Software 3 08-12-2004 02:52 PM
how do i download apache and where do i put the files? pcdctr Linux - Newbie 5 07-25-2004 08:26 PM
where to download SSH and Lynx source files mitchb Linux - Newbie 1 06-23-2004 04:48 AM
Can I use RPM to download and update all core source files? minorgod Linux - Software 1 02-06-2004 04:59 PM

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

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