Changes

Jump to: navigation, search
Configuring the Kernel with make menuconfig
[[Image:menu_config_root_nfs.jpg| Configuring Kernel Root filesystem on NFS support]]
 
Press the ''Esc''' key three times to exit from menuconfig and select the option to save the new configuration.
 
Edit the .config file and add a line immediately at the top of the file reflecting your architecuture:
 
<pre>
# i386
</pre>
 
or
 
<pre>
# x86_64
</pre>
 
Finally, copy the new configuration file to the source directory ready for the kernel compilation:
 
<pre>
cp .config ~/rpmbuild/SOURCES/kernel-2.6.18-<arch>-xen.config
</pre>
 
Where <arch> represents your architecture, for example ''i686'', ''ia64'', ''x86_64'', ''ppc64'' etc.
 
== Compiling the Kernel ==
 
The next step is to make some minor modifications to the ~/rpmbuild/SPECS/kernel-2.6.spec file. Load this file into an editor and change the ''build'' id definition such that it will be easy to distinguish the custom kernel from the original kernel. For example change:
 
<pre>
#% define buildid
</pre>
 
to:
 
<pre>
%define buildid .mycustom
</pre>
 
Also comment out the following lines:
 
<pre>
%prep
#if a rhel kernel, apply the rhel config options
%if 0%{?rhel}
for i in %{all_arch_configs}
do
mv $i $i.tmp
$RPM_SOURCE_DIR/merge.pl $RPM_SOURCE_DIR/config-rhel-generic $i.tmp > $i
rm $i.tmp
done
#CONFIG_FB_MATROX is disabled for rhel generic but needed for ppc64 rhel
for i in $RPM_SOURCE_DIR/kernel-%{kversion}-ppc64.config
do
mv $i $i.tmp
$RPM_SOURCE_DIR/merge.pl $RPM_SOURCE_DIR/config-rhel-ppc64-generic $i.tmp > $i
rm $i.tmp
done
%endif
</pre>
 
Save the spec file and then initiate the build as follows:
 
<pre>
rpmbuild -bb --target=`uname -m` kernel-2.6.spec
</pre>
 
Once the build is complete rpm packages will be located in ~rpmbuild/RPMS/<arch>. Install the custom Xen kernel on the system:
 
<pre>
rpm -ihv kernel-xen-<version>.el5.mycustom.i686.rpm
</pre>
 
The /boot directory will contain the necessary files to boot from the custom kernel, either for the host system or for a Xen domainU system.
1,798
edits

Navigation menu