LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-20-2003, 12:50 AM   #1
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Rep: Reputation: 46
buildin a custom kernel


hi, i would like to build a kernel, and was wondering wht this line meant :

"unpack the kernel source package on any partition where you have free disk space (like /home)."

i have seen posts where ppl have recommended this - but im not sure why, instead of in /usr/src.

culd someone breifly explain to me why and how i would go about building it from /home?

thnx.
 
Old 08-20-2003, 01:00 AM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
The location of the build is irrelevant for the most part. If you try to build drivers for the kernel that aren't part of the kernel, most driver applications will look in/at /usr/src/linux for the sources of the current kernel by default. However, the newer ones seem to allow a --kernel-source= option in the configure script, so you don't have to follow suit on the /usr/src anymore (although that would seem to be standard practice).

So, if you are going to be using drivers that ARE in the kernel, and the kernel contains everything you need, build it anywhere you'd like (the above sentence means anywhere you have enough disk space to unpack and build something). And after you build it, test it, and successfully run it, you can even delete the source, I'd save the .config somewhere safe though, that way if you ever need to 'update' or something, you have an old config to use

Cool
 
Old 08-20-2003, 01:09 AM   #3
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Original Poster
Rep: Reputation: 46
thnx for the quick reply, masterc.

im also a bit confused bout permissions when compiling this.

if i place them in either /ur/src or /home, i will have to do it with root permission. i read in the documentation that all commands till the "make install' should not be done using root.

how do i go about this?

thnx again!
 
Old 08-20-2003, 08:15 AM   #4
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
You have a few options:
* chmod or chown /usr/src to allow a specific group access to that directory, then add your user to that group.
* Do it as root (no no)
* Give your user priv's to write in the /home directory
* Unpack it in the user's home directory
* Unpack it in /tmp



I'd go with the group gettin perms on /usr/src and adding the user to that group.

Cool
 
Old 08-20-2003, 09:17 AM   #5
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
Interesting... Why is it that one should not compile a kernel with root privelidges? I've done this several times without any problems.
 
Old 08-20-2003, 09:37 AM   #6
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Original Poster
Rep: Reputation: 46
aha - thank u very much masterc.
 
Old 08-20-2003, 08:01 PM   #7
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Quote:
Originally posted by adz
Interesting... Why is it that one should not compile a kernel with root privelidges? I've done this several times without any problems.
As have I. But you take a risk when you compile anything as root, if you and I are willing to do that, so be it. However, to teach someone how to do it, that's a whole different ball game, and you wanna teach correctly so later they can make their own judgements on what to cut corners on

Cool
 
Old 08-20-2003, 08:38 PM   #8
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Original Poster
Rep: Reputation: 46
hmm-i built it (i didnt know how else to break the news)
but im not happy with the way i did it. i did everything as root.
and it started up. i didnt configure some modules and ....
at least, it started running this time round - i hadnt been able to uptil now.

sigh. soooo not happy with it - i felt like i was using a hammer to swat a fly.
 
Old 08-20-2003, 08:42 PM   #9
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Original Poster
Rep: Reputation: 46
ive been tryin to compile the kernel with the patch as i havent been able to get my soundcard working (i810 ac97).

sigh.
 
Old 08-20-2003, 09:40 PM   #10
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
Make sure you save your config to another filer (not ".config") so that you can have a place to work from when you debug. How big is your kernel (in kb), btw?
 
Old 08-20-2003, 09:54 PM   #11
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Original Poster
Rep: Reputation: 46
i shud be lookin at the vmlinuzxxx filesize to answer that?
i am exhausted with this. but its fun!
 
Old 08-20-2003, 09:57 PM   #12
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
Yep. That's the one. Mine's just over 700kb.
 
Old 08-20-2003, 10:00 PM   #13
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Original Poster
Rep: Reputation: 46
aha ok. well, ill let u know in a bit, cos i switched to windows for my cam.
i notice ur on debian.
im downloading the debian cd right now (cos i dont have any floppies on me, but cd's i have lots - haha).
u wudnt be using an nvidia card, wud ya?

i was thinking of trying debian out b4 i pack up for the day.

any words of advice?
 
Old 08-20-2003, 10:02 PM   #14
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Original Poster
Rep: Reputation: 46
it wud be ok to install it with the first cd itself right? or do i need to get cd 2 too?
and i was wondering, since debian was the one with apt ... wud it not do an apt-get for installing packages?
is there any option to install stuff with apt during the first install?
 
Old 08-23-2003, 06:57 AM   #15
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
OK. I'm going to try this one more time. So far every time I've tried to reply my browser crashes. It's nothing to do with LQ but rather with another site I think. This time I'm writing this reply in a text editor and even if Opera crashes on me I'll still have my message. So, here goes...

Yes I do use nvidia on my other computer which also runs debian. This computer runs some sort of nvidia compatible card or something but I never compiled the proper nvidia driver for it.

With regards to debian tips, I have a few. One is: try it, debian rocks! It's a little more manual but the package management is second to none and it runs lighter than most other distros. You're right, as a result of the package management you only really need the first CD. Then you can apt-get the rest of the system. It helps to have a broadband connection. If you don't (like me) you have to set it over night and in the morning you have an updated system.

My debian installation tips are as follows.
1. If you want a newer kernel (2.4.18) straight off the bat, then at the "boot:" prompt type "bf24". If you just press enter then you get 2.2.20. Press F3 for more boot options.
2. You do have the option of using apt at first install but I wouldn't. the automated install never seems to get the "sources.list" configuration right. You can always install other things later.
3. Don't install too many modules (possibly none at all), it's pretty easy to do later.
4. Do NOT run tasksel or dselect. Tasksel is clumsy and will install a whole bunch of stuff you weren't expecting and dselect just made me want to cry the first time I saw it. Additional programs can be gotten later through apt-get.
5. I don't configure exim (option 5) but if you use it than this may be a good time.
6. Once the automated install is over, set up your internet connection and your "/etc/apt/sources.list" file. Type "man sources.list" and follow the examples they have there. Check out www.debian.org for a list of mirror sites near you.
7. Once you have done all that type "apt-get update" and then "apt-get dist-upgrade". The latter command ugrades your system to either testing or unstable (which you'll probably want unless you're running a server) as stable is a little old. I recommend testing because it's not as bleeding edge and it's much easier to go from testing to unstable than vice versa.
8. Now, just install the packages you want (all dependencies are take care of for you) by typing "apt-get install <package names>". Multiple packages can be specified at once. Common package names include:
* x-window-system (xfree86 and dependencies)
* kde, gnome, wmaker, blackbox, fluxbox (Your choice of DE or WM)
* mozilla, mozilla-firebird, galeon, konqueror, lynx (Your choice of browser. If you want opera you can d/l the .deb package from their site directly. It's not available through apt-get)
* tk8.2 (and/or libncurses5), make, gcc, bin86, libc6-dev (packages necessary to compile your own kernel)

That's about all. If you want some good links here's one about installing debian: http://www.osnews.com/story.php?news_id=2016. And here's one about kernel comilation: http://www.osnews.com/story.php?news_id=2949. They're both by the same author and the one about compilation helped me a lot.

Have fun.

Last edited by adz; 08-23-2003 at 07:02 AM.
 
  


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-Patch Debian Logo 2.6.2 not correctly working for custom kernel 2.6.11 smp deepclutch Debian 3 06-27-2005 03:59 AM
New FAQ topic: Should I edit my kernel configuration?/Should I build a custom kernel? chort *BSD 10 09-10-2004 11:15 PM
Slackware 10, custom 2.6.7 kernel, lilo, loads kernel very slowly entropyv Slackware 3 08-19-2004 06:06 PM
custom kernel with Debian kernel-package comprookie2000 Debian 9 06-29-2004 05:30 PM
Buildin new Server need your Help ENick Linux - Hardware 0 05-19-2004 01:07 PM

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

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