--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: linux-source-2.6.18: Vserver (kernel flavour) documentation missing
- From: Nagy Elemer Karoly <eknagy@omikk.bme.hu>
- Date: Fri, 04 May 2007 17:34:09 +0200
- Message-id: <20070504153409.11536.10351.reportbug@slonek>
Package: linux-source-2.6.18
Version: 2.6.18.dfsg.1-12etch1
Severity: normal
Tags: patch
No documentation for creating vserver flavour source from general flavour found - spent 20
hours figuring it out - please add attached documentation to Documentation with symlinks like
vserver.txt xen.txt bigmem.txt etc.
Very nasty ( I would say grave) for sarge => etch migrating when you need a non-stock kernel.
Reported first as Bug#393285 but kernel-patch-vserver will not be revived.
-- System Information:
Debian Release: 4.0
APT prefers stable
APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18nek6
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Versions of packages linux-source-2.6.18 depends on:
ii binutils 2.17-3 The GNU assembler, linker and bina
ii bzip2 1.0.3-6 high-quality block-sorting file co
Versions of packages linux-source-2.6.18 recommends:
ii gcc 4:4.1.1-15 The GNU C compiler
ii libc6-dev [libc-dev] 2.3.6.ds1-13 GNU C Library: Development Librari
ii make 3.81-2 The GNU version of the "make" util
-- no debconf information
**********************************************
* Building a patched kernel on your own. *
* (vserver, xen, xen-vserver, bigmem, smp) *
**********************************************
Nagy Elemer Karoly, 2007. May 04., LGPL
Short version for vserver only:
apt-get install linux-tree-2.6.18
cd /usr/src/kernel-patches/all/2.6.18/debian/series/
grep -iR vserver *
find /usr/src/kernel-patches/ -name "*vserver*"
cd /usr/src/linux
bzcat ../kernel-patches/all/2.6.18/debian/debian/vserver-version.patch.bz2 | patch -p 1
bzcat ../kernel-patches/all/2.6.18/debian/features/all/vserver/vs2.0.2.2-rc9.patch.bz2 | patch -p 1
bzcat ../kernel-patches/all/2.6.18/debian/features/all/vserver/bindmount-dev.patch.bz2 | patch -p 1
make-kpkg binary-arch
NOTE: Kernel version 2.6.18 is used all through this document.
1. Introduction
There are multiple linux-images (flavours) in Debian 4.0 Etch but there is only one
linux-tree (source).
Some image flavours (smp) are compiled from the standard source, while others (xserver, xen)
are compiled from a patched source. So, if you need a specific flavour of the linux-image but
you can't use or don't want to use the stock kernel, you need to patch the source.
Debian collects it's patches (diffs between the "vanilla" Linux kernel and the Debian kernel)
in the linux-patch-debian package (linux-tree = linux-patch-debian + linux-source).
Some of these patches are already applied in linux-source and some are not.
The applied patches are applied in series, so if you apply one "series" file, it will apply a
bunch of patches.
In the linux-patch-debian package, there is also an "apply" and an "unpatch" script that
applies or unpatches all debian patches (so, by downloading a vanilla kernel source and
running apply, you'll get a Debian kernel source).
2. Get kernel and patches
So, after doing
apt-get update ; apt-get install linux-tree-2.6.18
run
cat /usr/src/kernel-patches/all/2.6.18/debian/series/12
to see the "12" patch series. This is not very interesting, but
cat /usr/src/kernel-patches/all/2.6.18/debian/series/1-extra
is - you can see that "debian/vserver-version.patch" is only applied to images "*_vserver" and
"*_xen-vserver" - so if you want to build an official-grade xserver image, you need to apply
this "debian/vserver-version.patch" (and the kernel won1t compile otherwise!).
You can install a clean source by
apt-get update ; apt-get install linux-source-2.6.18
and then unpack it
bunzip2 linux-source-2.6.18.tar.bz2 ; tar -xf linux-source-2.6.18.tar
and create a "linux" symlink:
rm /usr/src/linux ; ln -s /usr/src/linux-source-2.6.18 /usr/src/linux
3. Locating patches
Now, let's take a look on which patches we need:
cd /usr/src/kernel-patches/all/2.6.18/debian/series/
grep -iR vserver *
It is usually a good idea to follow the order of the patches (the number of the series).
Patches are relative to "/use/src/kernel-patches/all/2.6.18/debian/" as shown by
find /usr/src/kernel-patches/ -name "*vserver*"
4. Applying invidual patches
So, let's patch a few to get a vserver:
cd /usr/src/linux
bzcat ../kernel-patches/all/2.6.18/debian/debian/vserver-version.patch.bz2 | patch -p 1
bzcat ../kernel-patches/all/2.6.18/debian/features/all/vserver/vs2.0.2.2-rc9.patch.bz2 | patch -p 1
bzcat ../kernel-patches/all/2.6.18/debian/features/all/vserver/bindmount-dev.patch.bz2 | patch -p 1
And voila - the patched kernel is ready.
There is a lot more about patching in /usr/src/linux/Documentaition/applying-patches.txt
5. Configure, build, install
Now, let's configure our kernel by:
cd /usr/src/linux ; make menuconfig
and get make-kpkg, a wonderful tool to automate kernel compilation and installation:
apt-get update ; apt-get install kernel-package
Let's create the kernel packages:
make-kpkg binary-arch
Finally, installation:
cd /usr/src
dpkg -i my_kernel_package.deb
If you have gzconfig support, you can get your current config by
zcat /proc/config.gz >/usr/src/linux/.config.my
6. Module-assistant
Also, if you need funny stuff like ndiswrapper, you should get module-assistant as:
apt-get update ; apt-get install module-assistant
Get available extensions by:
m-a list
And download, build and install them automatically (after a reboot):
m-a a-i ndiswrapper
7. Notes
That's all, forks.
Changelog:
2007 May 04 - Version 1.0
--- End Message ---
--- Begin Message ---
- To: 422263-done@bugs.debian.org
- Subject: Re: Bug#422263: linux-source-2.6.18: Vserver (kernel flavour) documentation missing
- From: maximilian attems <max@stro.at>
- Date: Sun, 24 Jun 2007 23:29:26 +0200
- Message-id: <20070624212926.GK4869@stro.at>
- In-reply-to: <20070504153409.11536.10351.reportbug@slonek>
- References: <20070504153409.11536.10351.reportbug@slonek>
On Fri, 04 May 2007, Nagy Elemer Karoly wrote:
> No documentation for creating vserver flavour source from general flavour found - spent 20
> hours figuring it out - please add attached documentation to Documentation with symlinks like
> vserver.txt xen.txt bigmem.txt etc.
sorry but the attached documentation would need a *lot* of polish,
before getting shipped.
also you are better of to build the image directly
instead with make-kpkg
closing for now.
--
maks
--- End Message ---