Changes

Jump to: navigation, search

Kernel build

125 bytes removed, 23:31, 19 February 2007
get rid of <pre> tags -- use indentation instead
'''Note''': some of the paths below include $TOPDIR, which is distribution-dependent and can be further redefined by user. To find out the proper location on your system, issue this command:
<pre> rpm --eval "%{_topdir}"</pre>
=== Download ===
=== Installation ===
Install the downloaded SRC RPM with the following command:
<pre> # rpm -ihv ovzkernel-2.6.18-028test015.1.src.rpm</pre>
After successfull installation, you can usually find kernel sources in <code>$TOPDIR/SOURCES/</code>
Put your patch into SOURCES directory with the following command:
<pre> # cp <patch> $TOPDIR/SOURCES/</pre>
Then open spec file <code>$TOPDIR/SPECS/kernel-ovz.spec</code> in the editor and add the following lines:
<pre> Patch100000: <patch-name></pre>
and
<pre> %patch100000 -p1</pre>
in appropriate places where similar text lines are.
This will help you to distinguish binaries then from already existing kernels
(or from the official OpenVZ kernels). To do so, edit the <code>$TOPDIR/SPECS/kernel-ovz.spec</code> file and replace the following line:
<pre> %define ksubrelease 1</pre>
with something like
<pre> %define ksubrelease 1my.kernel.v1</pre>
=== Modifying configs ===
If you want to modify the kernel config, you need to do the following before you continue with the next step "Building RPMs".
<pre> # cd $TOPDIR/SPECS # rpmbuild -bp kernel-ovz.spec # cd $TOPDIR/BUILD/kernel-2.6.18/linux-2.6.18</pre>
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.
=== Building RPMs ===
To rebuild the kernel, type the following commands:
<pre> # cd $TOPDIR/SPECS # rpmbuild -ba --target=i686 kernel-ovz.spec</pre>
After successfull kernel compilation binary RPMs can be found at <code>$TOPDIR/RPMS/i686</code>.
=== Building ===
First, extract the kernel sources from archive:
<pre> # tar vjxf linux-2.6.18.tar.bz2 # cd linux-2.6.18</pre>
Apply OpenVZ patches to the kernel:
<pre> # gzip -dc patch-ovz028test015.1-combined.gz | patch -p1</pre>
Now we need to place the config and build the kernel:
<pre> # cp kernel-2.6.18-i686-smp.config.ovz .config # make oldconfig # make # make modules</pre>
=== Installation ===
After successfull a successful build of the kernel it can be installed on the machine with the following commands run under '''root''' user:<pre> # make install # make modules_install</pre>
Also you need to edit your GRUB or LILO config to make your kernel available for boot.

Navigation menu