Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Kernel build

13 bytes added, 23:35, 19 February 2007
use Template:Kver and Template:Krel
Install the downloaded SRC RPM with the following command:
# rpm -ihv ovzkernel-2.6.18{{kver}}-028test015{{krel}}.1.src.rpm
After successfull installation, you can usually find kernel sources in <code>$TOPDIR/SOURCES/</code>
# cd $TOPDIR/SPECS
# rpmbuild -bp kernel-ovz.spec
# cd $TOPDIR/BUILD/kernel-2{{kver}}/linux-{{kver}} There you will find the configuration files in the subdirectory <code>config/*.6config</code>.18Copy the one you want to modifiy to <code>$TOPDIR/BUILD/kernel-{{kver}}/linux-2{{kver}}/.config</code>.6Then you can do a make menuconfig or something similar to adjust the kernel configuration. Next, copy <code>$TOPDIR/BUILD/kernel-{{kver}}/linux-{{kver}}/.config</code> to the <code>$TOPDIR/SOURCES</code> directory, but use the corresponding file name in the target directory.18
There you will find the configuration files in the subdirectory <code>config/*.config</code>. Copy the one you want to modifiy to <code>$TOPDIR/BUILD/kernel-2.6.18/linux-2.6.18/.config</code>. Then you can do a make menuconfig or something similar to adjust the kernel configuration. Afterwards copy
<code>$TOPDIR/BUILD/kernel-2.6.18/linux-2.6.18/.config</code> to the <code>$TOPDIR/SOURCES</code> directory, but use the corresponding file name in the target directory.
Some background information on this procedure can be found in the following thread: http://www.arcknowledge.com/gmane.comp.audio.planetccrma.general/2004-11/msg00018.html
To compile OpenVZ linux kernel one need to download the original linux kernel sources and OpenVZ patches for it.
Linux kernel can be found at [http://www.kernel.org/ kernel.org], e.g. 2.6.18 {{kver}} kernel can be downloaded from [http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.18{{kver}}.tar.bz2 linux-2.6.18{{kver}}.tar.bz2].
Appropriate OpenVZ patches for this kernel version can be found at http://openvz.org/download/kernel/<version>/patches/. For example, at the moment there is a patch [http://download.openvz.org/kernel/devel/028test015{{krel}}.1/patches/patch-ovz028test015ovz{{krel}}.1-combined.gz patch-ovz028test015ovz{{krel}}.1-combined.gz] available.
Kernel configs are also available at OpenVZ download site. Most frequently SMP config is used, so let's download [http://download.openvz.org/kernel/devel/028test015{{krel}}.1/configs/kernel-2.6.18{{kver}}-i686-smp.config.ovz kernel-2.6.18{{kver}}-i686-smp.config.ovz]
for this example.
First, extract the kernel sources from archive:
# tar vjxf linux-2.6.18{{kver}}.tar.bz2 # cd linux-2.6.18{{kver}}
Apply OpenVZ patches to the kernel:
# gzip -dc patch-ovz028test015ovz{{krel}}.1-combined.gz | patch -p1
Now we need to place the config and build the kernel:
# cp kernel-2.6.18{{kver}}-i686-smp.config.ovz .config
# make oldconfig
# make