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

Re: Building custom kernel based off stock debian kernel



I think I see what Nick wants, because I kinda wanna do the same thing.  I have
compiled any number of kernels before, and know what I am doing.  But I am quite
happy with the kernel I have straight out of the box except that I need to apply
a patch to my network card driver.  So I have to completely reconfigure the
kernel in all aspects to suit my system, which seems stupid when someone else
has done it for me.  All I want is the source tree that was used to compile the
kernel that comes with potato, so that I can change four lines and recompile one
module.  Is this available?

Tom

Faheem Mitha wrote:
> 
> 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.
> 
> --
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

-- 
Tom Cook

"I do not believe, you know, that the art and practice of
 sitting on the fence is sufficiently appreciated in our
 society.  To me, it is an occupational necessity."
	- Prince Phillip

Level 6
10 Pultney St.
Adelaide University, AUSTRALIA 5005
Ph    : +61 8 8303 6110
e-mail: tom.cook@adelaide.edu.au

----------------------------------------------------------- 
This email message is intended only for the addressee(s) 
and contains information which may be confidential and/or
copyright.  If you are not the intended recipient please
do not read, save, forward, disclose, or copy the contents
of this email. If this email has been sent to you in error,
please notify the sender by reply email and delete this 
email and any copies or links to this email completely and
immediately from your system.  No representation is made
that this email is free of viruses.  Virus scanning is 
recommended and is the responsibility of the recipient.



Reply to: