[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Building custom kernel based off stock debian kernel




On 7 Feb 2002, Nick Jennings wrote:

>  *Please CC me in the response as I am not subscribed to debian-user*
>
> Hello.
>
>  I'd like to make a slight customization to the debian kernel. I do not
>  understand the debian packing scheme for getting the complete source
>  to the DEBIAN linux kernel (i.e. all patches applied and the .config
>  that is used for the debian kernel-images).
>
>  I grabbed the kernel-source:
>
> gateway:/usr/src/# apt-get install kernel-source-2.4.17
>
>  After examining the source tree from this, I have found that it does
>  not have a .config at all, and I do not this any of the debian patches
>  have been applied. This looks like kernel.org source.
>
>  So I tried:
>
> gateway:/usr/src/deb-src# apt-get source kernel-image-2.4.17
>
>  This created the following:
>
> gateway:/usr/src/deb-src# ls
> kernel-source-2.4.17-2.4.17            kernel-source-2.4.17_2.4.17-1.dsc
> kernel-source-2.4.17_2.4.17-1.diff.gz  kernel-source-2.4.17_2.4.17.orig.tar.gz
> gateway:/usr/src/deb-src#
>
>  The directory 'kernel-source-2.4.17-2.4.17' is quite a strange name? I
>  am confused by this behaviour and am not sure how I can use this source
>  package to build a custom debian kernel. Why is it called 2.4.17-2.4.17?

No, you do apt-get install kernel-source-2.4.17. This will put the sources
in the right places for compilation.

>  Is the 'source kernel-image-2.4.17' what I am supposed to be building
>  from? If so, why is there no '.config' in there? Where do I get the
>  '.config' from?

You make it yourself by running make menuconfig or make xconfig. I
strongly suggest take your time in this step or you will end up with a
broken kernel. Also make xconfig is nicer and recommended if you have X
running, though the two are very similar.

>  Now assuming I get answers to these questions, can someone please verify
>  the the following would be how I build this source into a kernel package?
>
> <apply customization>
> patch kernel && 'make menuconfig' to customize kernel configuration.

Why do you want to patch the kernel?

> <build kernel package>
> gateway:/usr/src/linux# make-kpkg --revision=gateway.1 --initrd buildpackage

I was in a rather similar position to you last Christmas, when I wanted to
build a kernel but had never done before. My advice to you is to do the
following:

STEP 1:

a) Go to http://newbiedoc.sourceforge.net/ and get the document called
"kernel compiling" under section "System Management Ideas". Note you may
want to just get a tarball of the entire Newbiedoc ducumentation as a
tarball of postscript files (see the section "Release Files") and print
out the "kernel compiling" one.

Note that if you are in testing you will need to get package tk8.3-dev
instead of task-tcltk-dev

Note also that creating an epoch is probably a good idea.

b) Go to the Linux Documentation Project and get the kernel compiling
howto.  Make sure you get a recent version. There are some old versions
floating around. Here is a direct link
ftp://www.linuxdoc.org/pub/Linux/docs/HOWTO/other-formats/ps/Kernel-HOWTO.ps.gz
You'll need to unzip it before printing "gunzip Kernel-HOWTO.ps.gz"

You'll mainly need this as reference for the config step "make menuconfig"
or "make xconfig". Everything else should be done as described in tbe
newbiedoc document.

b) Go the the documentation directory for kernel-package
(/usr/share/doc/kernel-package) and print out the README.gz and
README.modules. These are a useful supplement to the Newbiedoc document.

STEP 2:

Print all these out, sit down and take a couple of hours to read these
documents.

STEP 3:

Try following the steps. Post to the list if you get stuck.

Note that one place in which my experience differed from the Newbiedoc
documentation is that I did need to preface my make-pkg commands by
fakeroot, otherwise my kernels would not build correctly. Also, I do
recommend running make-pkg clean before actually trying to build the
kernel.

                                   Sincerely, Faheem Mitha.



Reply to: