This is a very terse, but good guide to compiling a new kernel on a Debian system. However…
The debian way of compiling the kernel is good, but whenever a new kernel is released, it tends to not show up in debian for a while; so if you want the latest and greatest, you have to download the source yourself.
Also, I would recommend naming your kernel image something that provides useful information regarding what the image is, and also recommend using an epoch. For example,
I agree with Iconoclast….very terse. Make-kpkg is pretty versatile. For example, do an apt-cache search kernel-patch, and you’ll see that many of the newer patches are included for you to use if you’d like. Just install them, and either edit the make-kpkg.conf file or export PATCH_THE_KERNEL=YES in your shell.
Also, make-kpkg makes things like alsa and pcmcia-cs easy. apt-get install alsa-source pcmcia-cs. It’ll grab those tarballs — untar them, go into the /usr/src/modules/ directory, configure each, then within /usr/src/linux do a make-kpkg kernel_image modules_image. You’ll get two or three debs — one with the kernel and stock modules, then a couple others with modules.
A caveat: Debian’s kernel-source packages aren’t the vanilla kernel.org sources. Although they’re very close, if you use Debian’s stuff, some patches will not apply correctly. Conversely, if you use a kernel.org tarball, Debian’s patches sometimes don’t apply correctly. But most of the time, the stock distro stuff is fine.
If the debianized kernel build fails, you see the same warnings/errors as if a normal kernel build had failed. It uses the kernel’s same internal build system anyway.
I tend to agree with Debman regarding installation. make-kpkg offers nothing new and easy to me. Sure it can do this, if you get this, edit the conf, blah…
1. Get source from kernel.org
2. make menuconfig
3. make dep bzImage modules modules_install
4. cp arch/i386/boot/bzImage /boot/kernel-2.x.x
5. nano -w /boot/grub/menu.lst
6. reboot
With grub, if something is wrong, you can edit the boot config right there instead of finding an emergency boot disk. Saves time if mistakes.
You see with Windows XP, I get a pre-compiled, pre-optimized kernel from certified professionals. On Linux, all I get is a bunch of buggy code that contains IP stolen from SCO, and I have to compile it myself! Puh-leeze, this is 2003
>You see with Windows XP, I get a pre-compiled, pre-optimized >kernel from certified professionals. On Linux, all I get is a >bunch of buggy code that contains IP stolen from SCO, and I >have to compile it myself! Puh-leeze, this is 2003
Poor Trolling!
A linux distro also provides pre-compiled kernels and – if you wish – highly optimized, no just poor pre-optimized. Buggy Code? Ever heard of MS security problems? Stolen IP from SCO? This is earth, what planet are you from?? Is the SCO case already finished? No, they even didn’t manage to show ONE evidence to the curious audience. Even worse, it seems they stole code from Linux without respecting GPL.
You see with Windows XP, I get a pre-compiled, pre-optimized kernel from certified professionals.
Well, that depends on what you mean by “optimized” I suppose. If you mean specifically designed and customized for you machine; I’m afraid you are ill-informed and mistaken.
If you mean “optimized” in the same sense that high school students are “avant garde”, or “non-conformists”, along with everybody else, then any Linux distro you install can also be considered optimized (except for the source-based distros, which let you build the system from scratch – but then they were never meant to be end-user easy).
On Linux, all I get is a bunch of buggy code
All code is buggy. Get over it.
that contains IP stolen from SCO
I will run across the parking lot and tell SCO you have proof that Linux stole their IP. I’m sure they could use you in the trial.
and I have to compile it myself! Puh-leeze, this is 2003
You don’t have to compile everything yourself; duh. Linux kernel compilations are like the spare tire in your car. You may never use it. You may never WANT to use it. But isn’t it extremely nice that the option is there; just in case?
has some problems. Just recently I downloaded the newest 2.4.20 source deb and decided to compile it “by hand” (should work either way). It puked on the reiserfs super.c file; when I looked into it, it seems that what should have been on one line was on two. I fixed it and reiserfs compiled fine. Then it just totally puked on some filtering file, and I could not fix this. I gave up and got the kernel.org source, which worked perfectly.
I’m new to Debian, and I’m abit confused to which branch this howto relates to. What about the problem described in the Debian Reference:
“If you need to compile a program with kernel headers that are newer than those provided by libc6-dev, then you must add -I/usr/src/linux/include/ to your command line when compiling.”
One of the big issues for me is patching the kernel, for example with alsa and video4linux drivers. The article would have been better if it adressed these questions as well. My guess is few desktop users use unpatched vanilla sources.
There is nothing wrong with the “classical” way of compiling the kernel. Debian’s kernel installation procedure is convoluted and totally unnecessary. Just do the “make menuconfig” and “make dep clean bzImage modules modules_install” limbo and be done with it. Do NOT, I repeat, do NOT make things harder than they are!
The article says you can use the kernel.org kernel equally well as the Debian kernel.
The article also mentions the use of the “Debian Way”: you can install the whole kernel, inclusive modules, on multiple pc’s by just copying and installing the .deb. You can also easily uninstall the kernel by just removing the package and installing the default one.
I have no experience with this, but I also think it should be possible for a company, a school or whatever to make a DEB repository on the server. Then installing a new kernel to all clients only one package needs to be made which will then be installed on every client using a cron job. But as said, I only use Debian at home.
And thus, I use Debian. Yes, I also have SuSE, which seems to be ten times more responsive on the desktop, but for some purposes Debian is great.
well I use it debian(sid) exlusively for my desktop and love it.. Have tried every other OS and distro I could get my hands on but have decided Debian is “it” for me. I also like building my kernels the debian way, much more conveniant but it is certainly not a prerequisite as the normal methods also work (though you miss out on a few advantages). I also like the debian kernel patch system.
I have Debian and Knoppix, I used the debian way on Debian and crashed the whole thing (now I need a geek to fix it or re-install). I did the same thing with Knoppix and all went fine (by the way Knoppix is much much easier to install). So after recompiling I was able to install VMWare without a glitch. I will stick to Knoppix
“You see with Windows XP, I get a pre-compiled, pre-optimized kernel”
WinXp is Compiled for i386 Instruction Set for Backwards compatablilty, not specific like i686 or Athlon-xp Optimized for the compilation. With Debian , Gentoo ,Libranet and others, Even Mandrake is aleast has i586 optimizations
This is a very terse, but good guide to compiling a new kernel on a Debian system. However…
The debian way of compiling the kernel is good, but whenever a new kernel is released, it tends to not show up in debian for a while; so if you want the latest and greatest, you have to download the source yourself.
Also, I would recommend naming your kernel image something that provides useful information regarding what the image is, and also recommend using an epoch. For example,
make-kpkg –revision=1:fugu_Custom2.4.20 kernel_image
I would also recommend doing make-kpkg clean prior to running the make-kpkg kernel-image command.
Other than that, I thought it was a good article.
I like :
make xconfig
make dep bzImage modules modules_install
cp arch/i386/boot/bzImage /boot/myImage
edit lilo.conf
run sbin/lilo
reboot
then if it does not work I can see where it went wrong alot easier.
I agree with Iconoclast….very terse. Make-kpkg is pretty versatile. For example, do an apt-cache search kernel-patch, and you’ll see that many of the newer patches are included for you to use if you’d like. Just install them, and either edit the make-kpkg.conf file or export PATCH_THE_KERNEL=YES in your shell.
Also, make-kpkg makes things like alsa and pcmcia-cs easy. apt-get install alsa-source pcmcia-cs. It’ll grab those tarballs — untar them, go into the /usr/src/modules/ directory, configure each, then within /usr/src/linux do a make-kpkg kernel_image modules_image. You’ll get two or three debs — one with the kernel and stock modules, then a couple others with modules.
A caveat: Debian’s kernel-source packages aren’t the vanilla kernel.org sources. Although they’re very close, if you use Debian’s stuff, some patches will not apply correctly. Conversely, if you use a kernel.org tarball, Debian’s patches sometimes don’t apply correctly. But most of the time, the stock distro stuff is fine.
If the debianized kernel build fails, you see the same warnings/errors as if a normal kernel build had failed. It uses the kernel’s same internal build system anyway.
does libranet have a custom kernel? if i recompile my kernel would i lose any of my libranet kernel settings?
I thought the debian way was by ditching linux and using the freebsd base system …
I tend to agree with Debman regarding installation. make-kpkg offers nothing new and easy to me. Sure it can do this, if you get this, edit the conf, blah…
1. Get source from kernel.org
2. make menuconfig
3. make dep bzImage modules modules_install
4. cp arch/i386/boot/bzImage /boot/kernel-2.x.x
5. nano -w /boot/grub/menu.lst
6. reboot
With grub, if something is wrong, you can edit the boot config right there instead of finding an emergency boot disk. Saves time if mistakes.
You see with Windows XP, I get a pre-compiled, pre-optimized kernel from certified professionals. On Linux, all I get is a bunch of buggy code that contains IP stolen from SCO, and I have to compile it myself! Puh-leeze, this is 2003
“You see with Windows XP, I get a pre-compiled, pre-optimized kernel”
You get the same with most versions of Linux.
“from certified professionals.”
Certified professionals? Perhaps that is a matter of opinion.
http://story.news.yahoo.com/news?tmpl=story&cid=75&ncid=75&e=1&u=/n…
“On Linux, all I get is a bunch of buggy code”
Tell that to IBM, Dell, HP, the city of Munich & assorted universities around the world, etc.
“that contains IP stolen from SCO”
A company must first produce something, other than unsubstantiated claims, before it can be stolen.
“and I have to compile it myself!”
See the first response above.
“Puh-leeze, this is 2003”
Yes, puh-leeze get with the program as quickly as you can.
>You see with Windows XP, I get a pre-compiled, pre-optimized >kernel from certified professionals. On Linux, all I get is a >bunch of buggy code that contains IP stolen from SCO, and I >have to compile it myself! Puh-leeze, this is 2003
Poor Trolling!
A linux distro also provides pre-compiled kernels and – if you wish – highly optimized, no just poor pre-optimized. Buggy Code? Ever heard of MS security problems? Stolen IP from SCO? This is earth, what planet are you from?? Is the SCO case already finished? No, they even didn’t manage to show ONE evidence to the curious audience. Even worse, it seems they stole code from Linux without respecting GPL.
You see with Windows XP, I get a pre-compiled, pre-optimized kernel from certified professionals.
Well, that depends on what you mean by “optimized” I suppose. If you mean specifically designed and customized for you machine; I’m afraid you are ill-informed and mistaken.
If you mean “optimized” in the same sense that high school students are “avant garde”, or “non-conformists”, along with everybody else, then any Linux distro you install can also be considered optimized (except for the source-based distros, which let you build the system from scratch – but then they were never meant to be end-user easy).
On Linux, all I get is a bunch of buggy code
All code is buggy. Get over it.
that contains IP stolen from SCO
I will run across the parking lot and tell SCO you have proof that Linux stole their IP. I’m sure they could use you in the trial.
and I have to compile it myself! Puh-leeze, this is 2003
You don’t have to compile everything yourself; duh. Linux kernel compilations are like the spare tire in your car. You may never use it. You may never WANT to use it. But isn’t it extremely nice that the option is there; just in case?
kernel-patch-preempt
alsa-driver
3rdpartyshittyUSBmodemforADSL
kernel-source-2.4.20
#sudo cp /boot/.config-‘uname -r’
/usr/src/kernel-source-2.4.20
#cd /usr/src/kernel-source-2.4.20
#export PATCH_THE_KERNEL=YES
#fakeroot make-kpkg –configure=oldconfig –revision=psilo
buildpackage modules_image
#cd ..
Installing:
#dpkg -i kernel-image-2.4.20<version>.deb
alsa-modules<version>.deb crappyUSBADSLmodemdrivers.deb
#update-grub
#reboot
#sudo rm -rf /usr/src/kernel-source-2.4.20
If you need to build additional modules you can install the kernel-header file that buildpackage has created and do a
#dpkg-buildpackage -uc -us
inside the /modules/additionalmodule/ tree
If it doesn’t work make sure the symlink /lib/modules/’uname -r’/build points to the kernel-header tree.
you can remove any created package you won’t need inside the /usr/src tree.
has some problems. Just recently I downloaded the newest 2.4.20 source deb and decided to compile it “by hand” (should work either way). It puked on the reiserfs super.c file; when I looked into it, it seems that what should have been on one line was on two. I fixed it and reiserfs compiled fine. Then it just totally puked on some filtering file, and I could not fix this. I gave up and got the kernel.org source, which worked perfectly.
Caveat downloador.
I’m new to Debian, and I’m abit confused to which branch this howto relates to. What about the problem described in the Debian Reference:
“If you need to compile a program with kernel headers that are newer than those provided by libc6-dev, then you must add -I/usr/src/linux/include/ to your command line when compiling.”
One of the big issues for me is patching the kernel, for example with alsa and video4linux drivers. The article would have been better if it adressed these questions as well. My guess is few desktop users use unpatched vanilla sources.
There is nothing wrong with the “classical” way of compiling the kernel. Debian’s kernel installation procedure is convoluted and totally unnecessary. Just do the “make menuconfig” and “make dep clean bzImage modules modules_install” limbo and be done with it. Do NOT, I repeat, do NOT make things harder than they are!
Are people still using Debian?
The article says you can use the kernel.org kernel equally well as the Debian kernel.
The article also mentions the use of the “Debian Way”: you can install the whole kernel, inclusive modules, on multiple pc’s by just copying and installing the .deb. You can also easily uninstall the kernel by just removing the package and installing the default one.
I have no experience with this, but I also think it should be possible for a company, a school or whatever to make a DEB repository on the server. Then installing a new kernel to all clients only one package needs to be made which will then be installed on every client using a cron job. But as said, I only use Debian at home.
And thus, I use Debian. Yes, I also have SuSE, which seems to be ten times more responsive on the desktop, but for some purposes Debian is great.
well I use it debian(sid) exlusively for my desktop and love it.. Have tried every other OS and distro I could get my hands on but have decided Debian is “it” for me. I also like building my kernels the debian way, much more conveniant but it is certainly not a prerequisite as the normal methods also work (though you miss out on a few advantages). I also like the debian kernel patch system.
>On Linux, all I get is a bunch of buggy code
Yeah really, I’ve been running Windows for a while now and it is vritually perf….
..sdsaf
fdaskjjl;kdasf
asdfsda;’
[B.S.O.D]
here is some tips for performance in debian:
patch the kernel witht he CK patch and perhaps the rmap and O(1) interactive patch on the same page.
then do a dpkg-reconfigure xserver-common and set nice to 0.
boom, you have a nice responsive desktop.
I can’t wait for the 26 kernel based distros.
I have Debian and Knoppix, I used the debian way on Debian and crashed the whole thing (now I need a geek to fix it or re-install). I did the same thing with Knoppix and all went fine (by the way Knoppix is much much easier to install). So after recompiling I was able to install VMWare without a glitch. I will stick to Knoppix
A Linux newbie
“You see with Windows XP, I get a pre-compiled, pre-optimized kernel”
WinXp is Compiled for i386 Instruction Set for Backwards compatablilty, not specific like i686 or Athlon-xp Optimized for the compilation. With Debian , Gentoo ,Libranet and others, Even Mandrake is aleast has i586 optimizations