How to properly compile a kernel?

Wolf Canis mr_canis at yahoo.co.uk
Fri Jan 18 00:02:22 UTC 2008


Josef Wolf wrote:
>
> I have not come to the modules yet.  I definitely will need something
> from linux-ubuntu-modules.  Yes, I expect problems when I come to the
> modules.  But first, I want to get a clear understanding about how to
> properly build the kernel.  Currently, I am trying to figure out a way
> to both, have my cake and eat it.  That is, I want to:
>
>  - automatically notice which original ubuntu kernel is installed and
>    automatically download+configure+compile+install its source.
>
>  - track whether new version (e.g. security patches) of the stock
>    kernel is available (best would be to receive new version with
>    "apt-get upgrade".
>
>  - automatically notice the upgrade and download+config+compile+install
>    the new source again.
>
> I want to do all this automatically because I have set up a distributed
> configuration mechanism (in spirit similar to cfengine).  Therefore, I
> need to know the exact names of versions/packages/files/directories.
>
> The first hurdle seems to be to figure out all the version information.
> First two steps seem to be easy:
>
>    $ uname -r                              # version of running kernel
>    2.6.22-14-generic
>    $ dpkg -S /boot/vmlinuz-`uname -r` | cut -d: -f1  # name of package
>    linux-image-2.6.22-14-generic
>
> But then it gets interesting: how do I (automatically) know that
>
>    $ apt-get source linux-image-2.6.22-14-generic
>
> creates
>
>    linux-source-2.6.22-2.6.22
>
> and when this is built, 
>
>    linux-image-2.6.22-14-generic_2.6.22-14.47_i386.deb
>
> is created.
>
> Of course, I could opendir/readdir and do some regex matches to find
> out which directory/file is actually created.  But I don't like this
> idea very much because it is a kludge and far from a proper solution.
>
> Anyone already done that?  Any hints?
So far I that know, you have to understand the file debian/rules that's the
script which does the job.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20080118/e16f089c/attachment.sig>


More information about the ubuntu-users mailing list