Anyone have a link to a really good, easy to follow, kernel compile guide?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Anyone have a link to a really good, easy to follow, kernel compile guide?
I have tried many times to compile a kernel so I can move off the generic one I am using now, and failed miserably almost every time, my latest, most successful attempt was the 2.6.20 kernel, I spent a considerable amount of time configuring it, adding what I think I need, and removing what I don't. After I installed it, I did a reboot and the computer booted within seconds, to which I was pleasantly surprised and extremely pleased with myself. I did notice, however during boot there were a couple of "FATAL" error messages, but I couldn't see what they were as they went by too fast. This didn't seem to make much of a difference, as it still booted to an X session and I could use it as normal. The problem is, when I wa using the generic kernel, my cpu usage hovered around 3-5% when idle, with the new kernel this figure is now in the 20s. So I think to myself, "I've done something wrong, again." It is really annoying because I spend so much time configuring and compiling, only to have to do it again. Any help would be appreciated, thanks.
Are you sure that it is your kernel that is causing extra cpu usage. Most distro default kernels will have some things compiled into the kernel and all other things are modules which will load/unload as required.
Could it be that you are running a distro that starts off with allot of services running. Services mean servers or daemons running in the background and I have found with some distros there are way more enabled by default than I really need.
Try figuring out what might be running that is causing that 5%. Have you run "ps -A" or "top" as root?
As for compiling there's heaps of how to's out there, and there's docs in the kernel souce too. There might be others, but I know for sure that there is a 2.6 compile howto with pages of thread at the slackware forum on right here on linuxquestions
There is a utility that's been around for a few years, that helps with building new kernels. It's called buildkernel. You can keep the current working kernel and /lib/modules, and build a new kernel with a new /lib/modules for that kernel. If anything goes wrong, you can still boot the working kernel. After compiling a new kernel with buildkernel, it's simply a matter of copying the compressed kernel image to /boot (with an appropriate name so that it isn't confused with vmlinuz), and editing the bootloader config file to add the new image to the boot menu.
You can then test the new kernel, but still have the original as fallback until the new kernel is proven, before deleting the old one.
To introuble, you are correct in assuming my distro is Slackware, I play with others, but this is my main one because I like it more than the rest. Also, don't I have to do make modules before make modules_install? This is what I have read in many of the places I have looked.
To justwantin, there are quite a lot of processes running when I use ps -A, and when I run top, the process which takes up most cpu is X. The rest take up hardly anything.
to XavierP, thanks for the lik, I'm gonna check it out right now.
Thank you all for responding.
Last edited by johngreenwood; 02-18-2007 at 02:48 PM.
Linus has posted many times about not compiling kernels in /usr/src but5 I'd venture to say that most people still do probably because until memory became relatively cheap most linux users didn't want to keep 50-60 mb of kernel source in in one part of their hd and copy it somewhere else just to do a compile. Old habits die hard especially if the old habit causes no problem.
The rest of this may be a bit tedious for most readers but john might find it helpful for a comparison with his computer.
I am pasting in the output of top and ps -A on my box with 1 konsole (2 sessions), 1 konqueror, kmail and 2 kedits open. This is on a 220.127.116.11 kernel from slack-2.11 install disk, running kde-3.5.6 acquired from linuxpackages.net. Note that some of the things running in my box are sitting in the panel, e.g. kweather,amorak and not opened up. I'll also give you an ls -l /etc/rc.d so that you can see what services are set to run by being executable.
Wow, thanks for that. But am I supposed to run those commands with the generic kernel distributed as Slackware's default, or the compiled one? Your cpu usage is much lower than mine, could this be a result of my cpu clock speed being a mere 700Mhz? I need to upgrade, but I can't afford it right now.
I wouldn't worry about different cpus or ram the difference between my box and yours can't be explained there. Each revision of kde seems more efficient than the last but that won't matter much here either
The above command output came off a 2 week old install. I always install with Pat's default (2.4 in this case) and then upgrade by installing Pat's 2.6. I always use bare.i and haven't had to compile my own for awhile now.
If you were to do any comparison with what I posted you'd need to have an fairly unmodified install with 18.104.22.168 bare.i kernel and the same permissions as in my /etc/rc.d.
If X seems to be the hog. Have you booted up without X? What is your cpu usage then? If its back down then maybe it is something to do with your X configuration, driver, or video card. I don't know too much about these things but if you have lost some of your video (card) memory, could you be taking it from you system?
Do you have important files and /home on their own partition? If so why not reinstall? I know its a bit wondowsish but it may tell you whether this is something do to something you did or if a clean install has this problem then it may not be kernel/software related, but rather hardware.
I will try booting to runlevel 3, and check it then. I think I'll check out bare.i too, can I take it from the cd and use it straight away?
memtest seems to show no problems with ram, I checked it a few weeks ago and left it running for about 6 hours.
My /home directory is on a separate partition on my second hard disk so re-installing wouldn't be a problem. I would really prefer not to re-install though, as I have been using Linux for a few months now and started with Slackware. During that time I have messed up and had to re-install countless times. It's been frustrating, but I have learned a lot. The main reason I would like to keep the install I have is because of all the programs I have compiled and installed, and I recently got Bluetooth set up, which was a huge pain and would not like to have to do it again.
I just rebooted without X and cpu usage stayed at a steady 0.3%
Last edited by johngreenwood; 02-18-2007 at 06:17 PM.
I've noted your cpu usage. Now what's not running in runlevel 3 that would be running in runlevel 4?
Process of elimination, What runs in the background other than X? Anything that is not stock slack-11? This is also what I was getting at with the permissions in my /etc/rc.d, if it isn't set to execute it isn't running. You've gotten bluetooth going, what does that run in the background if anything? Anything else?
Here's some examples of things that can go wrong. I was have the symptoms of memory loss. It turned out the audacity was not shutting down when gui was closed. 4 audacity processes going behind the scenes, 45 % cpu with the aps running feral. Also I tried to view dvb-t but had forgotten to install nvidia driver first. Default slack xorg config was ok but not good enough for dvb-t and memory buffering/whatever gave jerky display. Never checked the memory use though.
One was a software problem and the other just plain forgetfullness on my part.
Probably too late to tell you. When I compile I make my own slackpacs using checkinstall instead of make install. I also make notes on the tweeks and configurations I do for future reference. My / /usr /usr/local /home and /opt all get there own partitions so install only wipes / and /usr when moving up a version
My first linux was suse preinstalled on a box I purchased in 2000. By the time I switched to Mdk the same year I probably held the Guiness record for reinstalls. Mdk wasn't much better and eventually I switched to Slack in 2001. still did allot of installs but I was learning all the time. Took sme time but I learned a bit more each time. This box with the two week old install was a reinstall just because I had fiddled around a bit and probably had installed some stuff I didn't need since oct 06. I figured I'd start from scratch again and pay a little more attention to what I install this time. That being said I never mess with my daughter's box or the server (both slack) they just keep chugging along after initial install and config with only tweeks as required. I only crash and burn my own.
All the bluetooth stuff runs in runlevel 3 too (except kbluetoothd), I made a script which does everything I need to start bluetooth and then call that from the startup scripts. As for other prcesses not in 3, but in 4. There are quite a few, I will reboot, make a list of everything that shows up in ps -A in both runlevels. But for a start I know of a few, yakuake, superkaramba, kbluetoothd, kbfx.
I don't suppose you happen to know what "msp3410 [auto]" is?
Last edited by johngreenwood; 02-18-2007 at 07:54 PM.