LinuxQuestions.org
Visit Jeremy's Blog.
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, 05: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, 09:59 PM   #2
mrrangerman
Member
 
Registered: Oct 2007
Location: MI
Distribution: Debian Slackware
Posts: 528

Rep: Reputation: 50
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, 11:00 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 7,149

Rep: Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203
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, 11:30 PM   #4
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware«
Posts: 12,541
Blog Entries: 23

Rep: Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943
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, 05:44 AM   #5
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285
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 06:20 AM.
 
Old 05-05-2008, 12:11 PM   #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, 12:26 PM   #7
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
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 12:31 PM.
 
  


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
/lib/modules/2.4.33.3/kernel/sound folder is missing after compiling kernel Paulo Gˇes Slackware - Installation 2 04-15-2007 09:42 PM
compiling kernel problem --- Kernel panic: unable to mount root fs ........ anthonymts123 Linux - General 5 07-31-2006 03: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 05:17 AM
Kernel compiling and module compiling tarballed Linux - General 1 12-22-2002 06:31 PM


All times are GMT -5. The time now is 06:38 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration