LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 05-04-2008, 04:12 PM   #1
okar
LQ Newbie
 
Registered: Apr 2008
Posts: 16

Rep: Reputation: 0
compiling the kernel


hey, I would like to compile the linux kernel myself(on Debian), I will use make-kpkg to do this. furthermore I would like it to be i686 optimized, what do I have to do to achieve this? is choosing the right processor in menuconfig the only thing, or do I have to change Flags in the Makefile?
 
Old 05-04-2008, 08:59 PM   #2
mrrangerman
Member
 
Registered: Oct 2007
Location: MI
Distribution: Debian Slackware
Posts: 528

Rep: Reputation: 59
Are you wanting to compile the kernel just to learn? If you are needing to change kernel versions you can install a kernel-image for your platform. Just open synaptic and do a linux-kernel search and pick the one you want. Or you can go to there web site and download a kernel-image.deb package.

This may help if you still want to compile your own.
 
Old 05-04-2008, 10:00 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,657
Blog Entries: 4

Rep: Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938
I cordially submit that, if you're using a binary distribution, you should consider "compiling your own kernel" only as a self-educational exercise.
 
Old 05-04-2008, 10:30 PM   #4
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: Slackware®
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

I would suggest that you reference 'Linux Kernel in a Nutshell'.

This link and others are available from 'Slackware-Links' .
 
Old 05-05-2008, 04:44 AM   #5
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Quote:
Originally Posted by sundialsvcs View Post
I cordially submit that, if you're using a binary distribution, you should consider "compiling your own kernel" only as a self-educational exercise.
I was going to say BS, but to be nice I'll say, it has other uses too. Like to fix major bugs in some distros such as FC and sometimes Ubuntu, although people using these distro will likely never even think about compiling a kernel or even know what one is.

Onebuck gave some good links. It's really not that hard.

You should definitely optimize the kernel for your processor if you're gonna compile it anyway, why not. Note that if you compiled any out-of-kernel modules you'll have to re-compile and reinstall those too. Make sure to read through some the documentation that comes with the kernel, although some of it will be too technical to understand without wiki.

I would recommend starting with a pre-made config, say one provided by your distro, or look in '/proc' you should see a 'config.gz', that's the config file for the kernel you are currently running. Note that 'make mrproper' erases the file '.config' in the kernel source directory, run that first, then copy in the config file and rename it to '.config' then run 'make menuconfig' or xconfig or whatever, configure it, then run 'make', then for sure run 'make modules_install' and either install the kernel manually or using 'make install'. It says all this in the README that comes with the kernel source.

EDIT: And if you use lilo as bootloader, make sure to run '/sbin/lilo' to reload the config file. You may also need to modify the config file for both lilo '/etc/lilo.conf' and grub '/boot/grub/menu.lst'.

Last edited by H_TeXMeX_H; 05-05-2008 at 05:20 AM.
 
Old 05-05-2008, 11:11 AM   #6
okar
LQ Newbie
 
Registered: Apr 2008
Posts: 16

Original Poster
Rep: Reputation: 0
thx for your response and the links!!

I already know the basics of compiling a kernel, and I did it already. therefore I used my old config through make oldconfig.
it's primary a just for fun thing.
I'm just a little confused about a "i386" in the debian packet name, maybe it's just wrong labeled i don't know.
I couldn't try the kernel as I get a kernelpanic, (XD) but I think I can solve this myself.
I just wanted to know if choosing the right processor involves an i686 optimization, or if some Makefile flag magic is needed.
 
Old 05-05-2008, 11:26 AM   #7
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
4.2 4.2 Rebuilding an official Debian kernel package

For example, to build only the binary packages for 686 flavour on i386 architecture, use the following commands:

$ fakeroot debian/rules debian/build debian/stamps
$ fakeroot make -f debian/rules.gen binary-arch-i386-none-686

The target in the last command has general form of target-arch-subarch-flavour. Replace the subarch with none if it is empty.

the Debian Kernel handbook has a lot of useful information for your current project...

Last edited by farslayer; 05-05-2008 at 11:31 AM.
 
  


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
/lib/modules/2.4.33.3/kernel/sound folder is missing after compiling kernel Paulo Góes Slackware - Installation 2 04-15-2007 08:42 PM
compiling kernel problem --- Kernel panic: unable to mount root fs ........ anthonymts123 Linux - General 5 07-31-2006 02:29 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

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

All times are GMT -5. The time now is 02:05 AM.

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