LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   compiling the kernel (https://www.linuxquestions.org/questions/linux-newbie-8/compiling-the-kernel-639868/)

okar 05-04-2008 04:12 PM

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?

mrrangerman 05-04-2008 08:59 PM

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.

sundialsvcs 05-04-2008 10:00 PM

I cordially submit that, if you're using a binary distribution, you should consider "compiling your own kernel" only as a self-educational exercise.

onebuck 05-04-2008 10:30 PM

Hi,

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

This link and others are available from 'Slackware-Links' .

H_TeXMeX_H 05-05-2008 04:44 AM

Quote:

Originally Posted by sundialsvcs (Post 3142849)
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'.

okar 05-05-2008 11:11 AM

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.

farslayer 05-05-2008 11:26 AM

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


All times are GMT -5. The time now is 07:12 PM.