LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 03-02-2006, 07:44 PM   #1
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Rep: Reputation: 49
Debian way kernel compilation question


I generally compile the kernel the debian way. Here is the list of steps that I do:

Code:
1.cd /usr/src/linux
2.make clean
3.cp /boot/config /usr/src/linux/.config
4.make xconfig
5.make-kpkg clean
6.fakeroot make-kpkg --append-to-version=-myname kernel_image
7.dpkg -i kernel_image-<version>
8.mkinitrd -o /boot/initrd.img-<kernel-version> <kernel-version>
i.e. mkinitrd -o /boot/initrd.img-2.6.13 2.613
Now the above methods works fine. But I have seen some people giving command number 6 as
fakeroot make-kpkg --append-to-version=-myname kernel_image kernel_headers

What is the difference between the two commands(with and without kernel_headers)? What is the purpose of kernel_headers and how are they useful to us?

Also can I some how omit the step number 8? Does make-kpkg have the capibility to build the initrd image also and install it?

Thanks
 
Old 03-02-2006, 07:50 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
I don't know about the first couple, but I actually leave off the mkinitrd because I don't seem to need it by compiling my filesystem type into the kernel. When I recompiled the kernel, I included ext3 support and when I tried having the initrd image in my lilo.conf file, I got an error and it wouldn't boot. So I booted the old kernel and commented out the initrd= line lilo.conf, reran /sbin/lilo and just boot the kernel image.
 
Old 03-02-2006, 07:52 PM   #3
dracae
Member
 
Registered: Feb 2006
Location: Oklahoma
Distribution: Debian Sid and Etch
Posts: 423

Rep: Reputation: 30
kernel_headers builds the kernel-headers or linux-headers deb package, so that you can remove, update or otherwise change the kernel source and still compile against it.

Add --initrd to your make-kpkg command line and it will build the initrd during the install
 
Old 03-02-2006, 08:12 PM   #4
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 49
Thanks dracae for the effort!!!

Quote:
Originally Posted by dracae
kernel_headers builds the kernel-headers or linux-headers deb package, so that you can remove, update or otherwise change the kernel source and still compile against it.
I quite did not understood what do you mean by that. Sorry my bad. I really don;t know anything about kernel-headers. Whenever I have to compile new sources I just do
#apt-get install kernel-package linux-source-<uname -r>

and I am able to compile the kernel. Can you suggest anything good documentation which will explain the purpose of kernel_headers?

Quote:
Originally Posted by dracae
Add --initrd to your make-kpkg command line and it will build the initrd during the install
Thanks for the initrd tip. I will try that and see how it goes.
 
Old 03-02-2006, 08:47 PM   #5
dracae
Member
 
Registered: Feb 2006
Location: Oklahoma
Distribution: Debian Sid and Etch
Posts: 423

Rep: Reputation: 30
When you need to compile modules that are kernel specific, you need the kernel source. But you don't really need the kernel source, you just need the kernel headers, the *.h files. You might do something to the kernel source, as long as the versions.h reports the same make, will not complain, but modprobe might. With kernel headers this simply will not happen, because you should never be changing anything in them. There is a lots of documentation on how and why the kernel-headers package came to be.

I always build them, but I don't typically install them until I need them. Like when a new version of the nvidia driver becomes available. By that time there have been many changes inside my kernel-source dir.
 
  


Reply



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
Kernel Compilation Question yougene Slackware 9 11-24-2005 12:29 AM
Quick question about kernel compilation and nvidia... audibel Linux - Software 5 03-12-2005 06:20 PM
Some question about the Kernel 2.6.10 compilation Shagrath239 Slackware 5 02-20-2005 12:01 PM
kernel compilation question plisken Linux - General 12 12-09-2004 02:04 PM
Kernel compilation question spotz78 Linux - Newbie 2 10-07-2004 08:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 04:11 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
Open Source Consulting | Domain Registration