LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 08-04-2006, 12:46 PM   #1
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian jessie/sid; OpenSuSE; Fedora
Posts: 1,593

Rep: Reputation: 162Reputation: 162
Smile Learn How To Compile A Pristine Kernel In Debian.


Pristine Kernel Source Sources Debian Compile 2.4 2.6 Package Image Yaird Initrd Change New Switch 2.6.15 2.6.16 Torvald Linus Tree

Pristine kernel sources are available from http://www.kernel.org/pub/linux/kernel/ . These are the kernel sources straight from Linus Torvald's own tree. These are the authentic, pristine kernel sources. Debian is very easy to compile a kernel for.

Install a debian kernel image for the kernel you will be compiling. This helps with the compile. Reboot with the new Debian kernel you installed, which should be as close to the pristine sources version as you can get. For instance, if you download linux-2.6.16.27.tar.bz2 You should have installed kernel-image-2.6-686 or something similar, from the Debian archive.

Reboot

Install yaird to build initrd.

Install linux-patch-debian-kernelversion

(A word about Debian patches. The Debian patches are kernel modules. The kernel images that come with Debian contain modules that are not part of the official kernel tree. There are packages in Debian, albeit only a few, which require one, or more of these patches. The Debian development team believes these modules are stable enough for release, even though the Linus Torvalds development team has not officially made them part of the stable kernel yet. There are kernel source packages, which are not part of the Debian distribution, but, nevertheless are available from the Debian repository, which are pristine. For some unknown reason Debian claims the Debian kernel patches will only work with a pristine kernel source package from Debian's CVS repository. This is not true. You can use a pristine kernel from www.kernel.org, with or without the Debian kernel patches, and it will work fine. Some packages available in Debian won't work right without the patches, though.)

Download pristine kernel sources from the above link. Use the .tar.bz2 archive.

If you are presently running a 2.6 kernel you can leave it alone. Copy the pristine sources to:

/usr/src

Expand the archive with:

tar jxvf linux-2.6.16.27.tar.bz2

make a soft link to the resulting:

linux-2.6.16.27 directory like so:

ln -s linux-2.6.16.27 linux

Change to the new softlink directory, linux:

cd linux

Copy your existing kernel configuration from /boot like so:

cp /boot/config-2.6-686 .config

Start the kernel configuration program like this:

make xconfig


Make all the configuration choices you are competent to, or take a few risks. I don't care. You'll still have your old kernel to get back in if the machine won't boot.

When you get all done with xconfig, save .config, and exit xconfig.

Compile the kernel with:


make-kpkg --added-patches=debian --revision=1 kernel_image

When the compile is done, which you can tell because the screen settles down, change directories to /usr/src:

cd ..

do:

ls

There will be a .deb kernel package. Install it with:

dpkg -i kernel-package.deb

Make initrd like so:

yaird 2.6.16.27

Reboot

You might need to install the nVidia driver if you have it installed. An easy way is:

./NV* --update

which will install the latest version. You have to do that command in directory where the nVidia driver pack is located.

Last edited by AwesomeMachine; 09-06-2006 at 11:53 PM. Reason: Change Title To Be More Accurate
 
Old 08-04-2006, 02:31 PM   #2
pljvaldez
Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Squeeze (x86)
Posts: 6,092

Rep: Reputation: 269Reputation: 269Reputation: 269
Is the linux-patch-debian-kernelversion package for pristine kernels a new thing in Etch? In Sarge, apt-cache show kernel-patch-debian-2.6.8 states that
Quote:
... Note that these patches do NOT apply against a pristine Linux 2.6.8 kernel but only against kernel-source-2.6.8_2.6.8.orig.tar.gz from the Debian archive.
 
Old 08-06-2006, 12:16 AM   #3
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian jessie/sid; OpenSuSE; Fedora
Posts: 1,593

Original Poster
Rep: Reputation: 162Reputation: 162
The name of the debian patches package changes frequently, and Debian goes out of their way to tell people these patches only work with a kernel from Debian, but the patches work with a pristine kernel, also.
 
Old 08-07-2006, 10:44 AM   #4
pljvaldez
Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Squeeze (x86)
Posts: 6,092

Rep: Reputation: 269Reputation: 269Reputation: 269
What's generally in the debian patches anyway (i.e. what benefits are there for patching)? I guess I never really thought about adding them when I've built my own kernels...
 
Old 08-09-2006, 01:55 AM   #5
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian jessie/sid; OpenSuSE; Fedora
Posts: 1,593

Original Poster
Rep: Reputation: 162Reputation: 162
Debian patches are kernel modules that are available, but not part of the official kernel release. The developers at Debian think these modules are good enough to use, so they include them with the Debian kernel images. If you want your nice, pristine kernel with everything available that is available in a Debian kernel, you use the Debian patches. I have compiled a pristine kernel without the patches, and everything worked right, but there are some things available in Debian that won't work with a pristine kernel.
 
Old 08-09-2006, 01:59 AM   #6
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 60
So, since you've gone to the effort of laying this thing out so clearly, how about a brief commentary on including the Debian patch(es), or is that just a matter of getting the kernel source from Debian instead of from kernel.org?

Last edited by rickh; 08-09-2006 at 02:00 AM.
 
Old 08-09-2006, 04:37 PM   #7
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian jessie/sid; OpenSuSE; Fedora
Posts: 1,593

Original Poster
Rep: Reputation: 162Reputation: 162
I have added the requested section to the post.
 
  


Reply

Tags
compilekernel


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
debian - need to install kernel source AM1SHFURN1TURE Linux - Software 5 01-10-2006 06:18 PM
Configure kernel source for standard debian kernel (module install) twinkers Debian 2 12-22-2005 12:19 PM
How could I possibly learn Linux & Debian when no accurate help is given spaceuser Debian 7 08-23-2005 10:13 AM
Debian 2.6 kernel install -- CD not recognized mnmcook Linux - Hardware 4 03-04-2005 06:03 AM
How install Kernel 2.6.5 in Debian 3.0r2 velan Debian 11 04-18-2004 01:52 AM


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