LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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.

Notices


Reply
  Search this Thread
Old 05-29-2005, 02:10 PM   #1
dr_zayus69
Member
 
Registered: Sep 2004
Location: western massachusetts
Distribution: fedora core 3, Suse 10
Posts: 877

Rep: Reputation: 35
Tips on compiling a kernel.


Hi. im trying to compile a new kernel because i believe last time i tried compiling a custom kernel the sound modules got messed because i have no sound now. I've read online and in books about the process but some sites are out dated and include unecessary steps like make dep. One site will say to do it in /usr/src others say not to etc. I was wondering if anyone could share their experiences with kernel compiling and tips they have learned from mistakes and successes that would be useful for others getting into the compiling game. One thing in particular that would help is someone let me know what order to do the make commands in. is this the correct order?

make "your choice of config script"
make clean
make bzImage
make modules
make install
make modules_install?

This is confusing to me because when i first tried compiling the book i used was older then i thought so it didn't mention the make install to install the kernel they did it manually with cp. But when i did it with cp my kernel didn't boot but make install did it correctly and i could boot it. Also i think i remember a make initrd command that fits in their somewhere? That book didn't mention that either. Also are kernels set to configure a standard workable way so if i just did make xconfig and saved it it would be a working kernel and if not where does one find the standard .config file? Is it hiding in the source tree somewhere? Im sorry if im asking too much, but figured people's experiences might help me more then following a site step by step again - cuz last time that got me in trouble. lol. thanks for any replies in advance, i appreciate it.
 
Old 05-29-2005, 03:00 PM   #2
marghorp
Senior Member
 
Registered: Jan 2004
Location: Slovenia
Distribution: Slackware 10.1, SLAX to the MAX :)
Posts: 1,040

Rep: Reputation: 45
http://www.linuxquestions.org/questi...5&pagenumber=1

Use this guide. You should come through with no problems. I did the first time I used it and ever since.
 
Old 05-29-2005, 03:10 PM   #3
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Quote:
make "your choice of config script"
make clean
I think you may have those two steps backwards. If I remember correctly, make clean wipes out your .config file. Or maybe that is make mrproper. In any case, I'd do the make clean first, then make config.

By the way, those steps are for a 2.4 series kernel. If you do a 2.6 series you just need

make clean or mrproper
make config
make
make modules
make install




Quote:
This is confusing to me because when i first tried compiling the book i used was older then i thought so it didn't mention the make install to install the kernel they did it manually with cp.
One of the things you can do is edit the makefile and uncomment the line that says

export INSTALL_PATH=/boot

If you have everything in /boot, it does all the copying for you.

And probably the most important "tip" I could give would be to make sure you have a good kernel available for boot. Nothing is worse than not being able to boot because the kernel is borked.
 
Old 06-01-2005, 02:52 PM   #4
dr_zayus69
Member
 
Registered: Sep 2004
Location: western massachusetts
Distribution: fedora core 3, Suse 10
Posts: 877

Original Poster
Rep: Reputation: 35
i'd like to become really proficient in kernel compiling so i figured the best way would be to really take the time to learn all of the config options and become familar with the technology behind some options that i am not familar with. Does this seem like a good idea? I wasn't sure because i could take time to learn about some options and have them be obsolete or not included in the next version or couple versions down. Does anyone know of any good online docs or books that would help me out? Like a site that explains the options and the bare minimun you need to get a kernel working. i've read the Kernel HOW-TO on www.tldp.org already. thanks for any replies in advance.
 
Old 06-01-2005, 07:47 PM   #5
marghorp
Senior Member
 
Registered: Jan 2004
Location: Slovenia
Distribution: Slackware 10.1, SLAX to the MAX :)
Posts: 1,040

Rep: Reputation: 45
The best way is to read the help that comes with every module in the kernel compiling process. At every module, at least almost every module, there is help, that tells you what the module does and what it should be compiled as. Read that and you will be on your way. But keep in mind that you should know your hardware before attempting kernel recompile.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel compile tips needed Tim Johnson Slackware 6 09-08-2005 05:30 PM
kernel compile tips wanted Nightfrost Linux - General 2 11-03-2004 06:34 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
Kernel upgrade tips? syxxpac023 Linux - General 2 10-31-2001 03:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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