LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   buildin a custom kernel (https://www.linuxquestions.org/questions/linux-newbie-8/buildin-a-custom-kernel-83728/)

h/w 08-20-2003 12:50 AM

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.

MasterC 08-20-2003 01:00 AM

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

h/w 08-20-2003 01:09 AM

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!

MasterC 08-20-2003 08:15 AM

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

adz 08-20-2003 09:17 AM

Interesting... Why is it that one should not compile a kernel with root privelidges? I've done this several times without any problems.

h/w 08-20-2003 09:37 AM

aha - thank u very much masterc.

MasterC 08-20-2003 08:01 PM

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

h/w 08-20-2003 08:38 PM

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

h/w 08-20-2003 08:42 PM

ive been tryin to compile the kernel with the patch as i havent been able to get my soundcard working (i810 ac97).

sigh.

adz 08-20-2003 09:40 PM

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?

h/w 08-20-2003 09:54 PM

i shud be lookin at the vmlinuzxxx filesize to answer that?
:( i am exhausted with this. :) but its fun! :)

adz 08-20-2003 09:57 PM

Yep. That's the one. Mine's just over 700kb.

h/w 08-20-2003 10:00 PM

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?

h/w 08-20-2003 10:02 PM

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?

adz 08-23-2003 06:57 AM

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.


All times are GMT -5. The time now is 06:03 PM.