172
edits
Changes
some info added
=== Building OpenVZ kernels and kernel modules ===
Let's consider, how to build <tt>2.6.18</tt> OpenVZ kernel RPM package with squashfs support.
First download and install OpenVZ source RPM:
<pre>
# wget http://download.openvz.org/kernel/branches/2.6.18/028stab033.1/kernel-2.6.18-ovz028stab033.1.src.rpm
# rpm -ivh kernel-2.6.18-ovz028stab033.1.src.rpm
</pre>
<tt>squashfs</tt> sources content the patch against <tt>2.6.18</tt>. Let's copy this patch to RPM build directory:
<pre>
# cp squashfs3.2-r2/kernel-patches/linux-2.6.18/squashfs3.2-patch /usr/src/redhat/SOURCES/
</pre>
Now we need to modify the spec-file in order to add patch to build process. Below is the changes you should add in diff-based format:
<pre>
@@ -5,13 +5,13 @@ Summary: The Linux kernel (the core of t
# normal/debug/debuginfo
%define buildnormal 1
-%define builddebug 1
+%define builddebug 0
%define builddebuginfo 0
# kernels we want to build
-%define buildup 1
+%define buildup 0
%define buildsmp 1
-%define buildenterprise 1
+%define buildenterprise 0
%define buildentnosplit 0
# versions
@@ -161,6 +161,9 @@ Patch2104: linux-2.6.18-drbd-0.7.22-0.8.
Patch2105: linux-2.6.18-drbd-8.0.0-8.0.2.patch
Patch2106: linux-2.6.18-drbd-8.0.2-8.0.3.patch
+# squashfs
+Patch2107: squashfs3.2-patch
+
# ----------------------------------------------------------------------------
BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -318,6 +321,8 @@ cd linux-%{kversion}
%patch2105 -p1
%patch2106 -p1
+%patch2107 -p1
+
# ----------------------------------------------------------------------------
</pre>
Building the RPM:
<pre>
# rpmbuild --target=i686 -ba kernel-ovz.spec
</pre>
If everything goes ok, then you will have a ready rpm kernel:
<pre>
# ls -l
</pre>
== Installing RPMs ==
We have the RPM package for the kernel. But we also need
<pre>
<
To be continued...