How to properly compile a kernel?

Liam Proven lproven at gmail.com
Mon Jan 14 17:27:55 UTC 2008


On 14/01/2008, Josef Wolf <jw at raven.inka.de> wrote:
> Hello,
>
> I am trying to compile the kernel on my Gutsy box by myself.  This is
> what I tried so far:
>
>    apt-get install linux-source kernel-package debianutils fakeroot \
>                    libc6-dev libncurses5-dev gcc make
>    cd /usr/src
>    tar xjf linux-source-2.6.22.tar.bz2
>    cd linux-source-2.6.22
>    cp /boot/config-`uname -r` .config
>    make oldconfig
>    make prepare
>    make-kpkg kernel_image kernel_headers --initrd \
>              --append-to-version -mykernel \
>              --revision myrev
>
> This works so far, but it generates
> linux-image-2.6.22.9-mykernel_myrev_i386 while the original kernel
> was linux-image-2.6.22-14-generic_2.6.22-14.46_i386.  Notice the
> differences in the version numbers?  Why is apt-get retrieving the
> wrong version of the sources?  How do I get exactly the version which
> was installed by apt?
>
> A second problem is that not all of the modules are built.  I guess I
> have to compile linux-ubuntu-modules-2.6.22_2.6.22-14.37 somehow.  But
> this is yet another version number.  How do I know which version of
> the modules sources belongs to a given kerne?  And how do I properly
> compile the modules?
>
> Any hints?

This may not be much help, but when I used to roll my own kernels, I
just grabbed the ordinary sources from kernel.org. It seemed much
simpler to me. I also did not use an initrd - if you're building your
own kernel, you can compile in the drivers you need, and so I saw no
point.

-- 
Liam Proven • Profile: http://www.linkedin.com/in/liamproven
Email: lproven at cix.co.uk • GMail/GoogleTalk/Orkut: lproven at gmail.com
Tel: +44 20-8685-0498 • Cell: +44 7939-087884 • Fax: + 44 870-9151419
AOL/AIM/iChat: liamproven at aol.com • MSN/Messenger: lproven at hotmail.com
Yahoo: liamproven at yahoo.co.uk • Skype: liamproven • ICQ: 73187508




More information about the ubuntu-users mailing list