LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 03-15-2011, 07:24 AM   #1
derchris
LQ Newbie
 
Registered: Feb 2011
Posts: 27

Rep: Reputation: 0
Kernel compilation: make vs make-kpkg


Hello,

I need to compile a new kernel, and I never did this before. Reading some tutorials I found out pretty well how it is done.
But then I looked into some Ubuntu related tutorials, and there is a difference and I hope someone can explain me why:
In general tutorials, it is told to do a make after you configured everything.
In Ubuntu you should use make-kpkg. So what is the difference between those two, why should I use the 2nd one?


FWIW: I'm currently compiling a kernel using make-kpkg. In my first try I used the make approach and it didn't work (didn't boot anymore).

My Problem is that I work on kernel module and I don't know whether make-kpkg will recompile the whole kernel even if I just change 1 or 2 files.


Edit: I just finished compiling. And after about an hour or so, the final message was this:
Code:
install -p    -o root -g root  -m  644 ./debian/templates.master /usr/src/linux-2.6.37.3/debian/linux-image-2.6.37.3meinsmeins/DEBIAN/templates
dpkg-gencontrol -DArchitecture=i386 -isp	     \
			-plinux-image-2.6.37.3meinsmeins -P/usr/src/linux-2.6.37.3/debian/linux-image-2.6.37.3meinsmeins/
dpkg-gencontrol: error: package linux-image-2.6.37.3meinsmeins not in control info
make[2]: *** [debian/stamp/binary/linux-image-2.6.37.3meinsmeins] Error 255
make[2]: Leaving directory `/usr/src/linux-2.6.37.3'
make[1]: *** [debian/stamp/binary/pre-linux-image-2.6.37.3meinsmeins] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.37.3'
make: *** [kernel-image] Error 2
Any idea what this means?

Last edited by derchris; 03-15-2011 at 07:42 AM.
 
Old 03-15-2011, 10:25 AM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
Quote:
Originally Posted by derchris View Post
In general tutorials, it is told to do a make after you configured everything.
In Ubuntu you should use make-kpkg. So what is the difference between those two, why should I use the 2nd one?
They encourage you to create a package that the package-manager can track.

https://help.ubuntu.com/community/Kernel/Compile

Quote:
Originally Posted by derchris View Post
My Problem is that I work on kernel module and I don't know whether make-kpkg will recompile the whole kernel even if I just change 1 or 2 files.
This depends on whether you ever issue a make-kpkg clean.

Quote:
Originally Posted by derchris View Post
Edit: I just finished compiling. And after about an hour or so, the final message was this:
Code:
dpkg-gencontrol: error: package linux-image-2.6.37.3meinsmeins not in control info
Where did you get the source?

If you got them straight from kernel.org, then your source does not include necessary control files, so you must build them.

You really should either be using the a natty source package:

http://archive.ubuntu.com/ubuntu/poo...38-6.34.tar.gz

Or if you plan on making a habit of building your own kernels use git:

Code:
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-natty.git
https://wiki.ubuntu.com/Kernel/Dev/KernelGitGuide

Inside your /home directory:

Code:
mkdir natty
cd natty
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-natty.git
then clone that clean source directory to another to build in

Code:
git clone ubuntu-natty ubuntu-natty-build
then you can

Code:
cd ubuntu-natty-build
and copy a .config file there and do whatever you want to do.
When you are ready to build the kernel then

Code:
fakeroot make-kpkg --initrd --revision=1 kernel_image kernel_headers
to update the sources you can

Code:
cd natty
rm -rf ubuntu-natty-build
cd ubuntu-natty
git fetch
git reset --hard origin/master-next
cd ..
git clone ubuntu-natty ubuntu-natty-build
cd ubuntu-natty-build
and build again

This process enables you to keep a clean source tree.
 
1 members found this post helpful.
  


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 build using make-kpkg fails GhostCow Ubuntu 2 01-07-2008 01:18 PM
make-kpkg kernel compilation issues 1337ln Debian 3 07-27-2007 05:57 PM
Kernel compile fails with make-kpkg, not with make cspos Debian 37 11-09-2005 09:11 AM
Kernel make-kpkg error TaNeK Debian 7 01-09-2005 12:24 PM
Need some advice on upgrading kernel via make-kpkg davidas Debian 4 04-07-2004 07:02 PM

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

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