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

Re: Updated Howto needed: How to compile a kernel like etch's.



On Tue, Nov 01, 2005 at 09:47:44AM +0000, Nick Hill wrote:
> I have tried and failed to find a howto which will fill my need:
> 
> I need a howto which gives the steps, package names and repositories to
> 
> 1) Build a kernel just like the binary distribution in testing/unstable.

apt-get source linux-2.6
cd linux-2.6-X.Y.Z-N
dpkg-buildpackage [-B] [-us] [-uc] [-frakeroot] ...

Thats eactly how I make kernels for uploading,
If I already have the source.

> 2) Build as 1) above but be able to apply/remove patches during the 
> build process

The patches are automatically applied and unapplied.

If you want to add or remove patches, I would recommend 
doing the following between the cd and dpkg-buildpackage commands
above.

1. Editing the debian/changelog to create your own version.

   Say, 2.6.14-2nh0

   If you run dch -i it will do most of the work for you.
   I believe it is in the devscripts package

2. Put any new patches in debian/patches-debain
   Please note that the filename of patches must end in .patch
   
   e.g. cp /tmp/blah.diff debian/patches-debain/blah.patch
   
3. Create a series file that matches the name of your version
   in debian/patches-debain/series. Inside, list one per line
   each patch you want to add or remove.

   e.g.
   echo "+ blah.patch" >> debian/patches-debain/series/2.6.14-2nh0
   echo "- a-bad.patch" >> debian/patches-debain/series/2.6.14-2nh0

   All lines that start in "+ " are patches to be added.
   All lines that start in "- " are patches to be removed.
   All lines that start in "# are comments"

   So lets say that a-bad.patch was added in 2.6.14-2 and released,
   and you don't like it. The above will add your patch, and then
   unapply a-bad.patch. Note that applying is done in the order
   listed in the file. Latter, the patches may be unapplied,
   this will be done in reverse order. This can be important
   if multiple patches touch the same part of the file.


> 3) As 1) But using the latest svn patch sets from debian kernel 
> development tree.

Assuming that the kernel has been released, run the follwing betwen
the apt-get and cd from question 1)

rm -rf debian
svn export svn://svn.debian.org/svn/kernel/dists/trunk/linux-2.6/debian \
  ./debain/

  Note that trunk above is just that, what is being worked on.
  Somtimes there is a sid branch, which reflects what is in sid.
  Right now there is an etch branch which reflects what is in etch.
  Its best to jump onto #debian-kernel on oftc.net and ask if you're unsure,
  which to use.

./debian/rules debian/rules.gen debian/contol

> I had an un-published howto which applied pre-sarge, but many things 
> have changed. I have not found a howto or a method to achieve any of the 
> above.
> 
> There are plenty of howtos which say along the lines of: download debian 
> source package or from kernel.org, make menuconfig, make-kpkg etc. But 
> that is not what I am looking for as I will end up with something other 
> than a current Debian kernel. If I wanted to create a patch for 
> submission, I can't be sure it will work without having a build process 
> for a patched debian kernel.

Understood, consistency is important, the current docs don't reflect that.

For the record.

1. Download original tar.bz2 of kernel from from kernel.org
   wget http://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.14.tar.bz2
2. Get prune-non-free from svn
   svn export svn://svn.debian.org/svn/kernel/dists/trunk/scripts/prune-non-free
3. Run this to create the orig tarballs
   Note for now you need ruby installed for this to run, also, it takes a while.
   ./prune-non-free linux-2.6.14.tar.bz2 2.6.14
4. Remove the non-free tree, rm -rf linux-nonfree-2.6-2.6.14/
3. Enter kernel tree
   cd linux-2.6-2.6.14/
4. Export the debian directory from svn, as in question 3) above
   svn export svn://svn.debian.org/svn/kernel/dists/trunk/linux-2.6/debian \
     ./debain/
5. Genearate the control file, as in question 3) above
   ./debian/rules debian/rules.gen debian/contol
6. Mangle at will, as per question 2) above
7. Run dpkg-buildpackage

-- 
Horms



Reply to: