DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am running Debian etch 2.6.18-4-686 and I am wanting to try and compile a kernel for the 1st time. However I really have never done this and I am wondering what things I need to be aware of (good and ugly) or even what is involved in compiling a kernel (for Debian).
What is the process to getting 2.6.20.1 kernel on my Linux box?
I downloaded patch-2.6.20.1.bz2 from www.kernel.org but I don't even know if that is a correct file I need...or should be using on my Debian system.
Apt-get the kernel image from Debian or you'll make life hard for yourself. I suggest you read the sticky on the topic of recompiling right here on this forum!
You're very busy on your system(s) aren't you? Get the "linux-2.6.xxx" file from kernel.org. I've had success with all the 2.6.19.x versions on debian. I've also had no problems at all compiling a kernel using the following as my guide:
This used to be on debian.org, but for some reason they pulled it down. I emailed the owner and he said they just didn't figure it worked anymore. Of course, you have to change the 2.4.etc to 2.6.etc, but it works, just the same. And, you'll want to leave out the step "apt-get install kernel-source-2.4.18 # use latest version" if you're using one downloaded from kernel.org. Even if you decide to do it some other way, this page is good as it tells you all the helper packages that you'll need to be able to compile the kernel, no matter what method you use.
Be wary of 2.6.20 kernels. They've changed the parameters to the workqueue and you've got enough problems with your raid that you don't want to add that to the mix.
Last edited by Quakeboy02; 03-05-2007 at 06:05 PM.
Then
1) tar -jxf /usr/src/linux-source-2.6.18.tar.bz2
2) ln -s linux-source-2.6.18 linux
3) cd linux
4) make oldconfig
5) make xconfig # (You can trim your kernel if you want)
6) fakeroot make-kpkg --initrd --append-to-version=-whatever kernel_image kernel_headers
Now you have your kernel image and headers (you should install both if you are going to need to install drivers that require it - like nVidia drivers.)
Last edited by JackieBrown; 03-06-2007 at 06:58 AM.
The link that Mikieboy gave is right on the money. It was written for 2.6.8, but it still works, and is SUPER easy. Long story really short -
1) Download full sources for the newest kernel from kernel.org
2) Extract to /usr/src
3) Remove the symbolic link named linux, replace it with on pointing at the new sources you just unzipped
4) Copy the file /boot/config-(current kernel) to .config in /usr/src/linux
5) I do make menuconfig, others like xconfig, but config it, changing things you want/don't want or just want to check out.
6) make-kpkg clean (apt-get install kernel-package if you lack it)
7) make-kpkg --initrd --append-to-version=-mykernelname kernel_image (get a beer or 3, it takes a good bit of time to compile, even on brand new hardware. You're looking at hundreds of Mb of sources to put together).
8) cd /usr/src
9) Install the nice .deb file sitting there with the command dpkg -i kernel-image-2.6.20-mykernelname_10.00.deb
10) Reboot, reinstall your NVidia or ATI drivers, and away you go!
JackieBrown understood it correctly. This warning has been in the README unchanged since I started using Linux (2.0 kernel) and probably before. I've always ignored it without any harmful consequences. Some distros ignore it, too. For compiling foreign modules it's good to have it in a standard location.
I take the README at its literal value - don't download the tarball to /usr/src, because to do that you would have to be root. That would be great for the kernel developers, if people developed problems because they were accessing the internet as root, and put some sort of malware/virus on their machines.
I download as a normal user to home, just as the readme suggests, but I don't compile it there. I have always unpacked and compiled as root in /usr/src, and it has never caused me a problem.
/usr/src is supposed to have the kernel headers for the running kernel if I remember well. Linus made a discussion about this a long time ago (if I find it, I will post)
It's more relevant for cross compiling.
Compiling a 2.6 on a 2.6 shouldn't be a problem so putting in /usr/src/linux is ok.
I used to put them in /usr/src too but there is no advantage at all.
You are supposed also to create a user for compiling and give him the rights to access /usr/src. I had also created a group src that had write access to /usr/src.
Like put sguid for user:src on this directory.
(this was taken from a debian or kernel official readme, I didn't invent anything)
Quote:
compiled as root in /usr/src
I wouldn't do this but.. it's your machine and I'm sure you know the risk.
An error in a makefile or a bad make clean could wipe your disk.
Theorically
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.