Virtually the best blog on the web!
How to Build Custom Xen Kernel Based on CentOS/RHEL Xen Kernel
The HOWTO on compiling CentOS kernel based on RHEL code base (currently 2.6.18) is overly complicated. Follow the following steps to build a custom Xen kernel, maybe with different kernel configuration.
- Setup the rpmbuild directory, and install prerequisite packages.
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} sudo yum -y install rpm-build redhat-rpm-config unifdef kernel-devel kernel-xen-devel - Grab the kernel source RPM, you want to modify and compile, and install it.
wget -c http://mirrors.kernel.org/centos/5/updates/SRPMS/kernel-`uname -r`.src.rpm rpm -i kernel-`uname -r`.src.rpm
- Create the spec file for the downloaded kernel
cd ~/rpmbuild/SPECS rpmbuild -bp --target=`uname -m` kernel-2.6.spec
- Modify the config to your needs. The config file are stored in
~/rpmbuild/SOURCES. - Modify the buildid. This is a good practice, if you are making extensive changes.
cd ~/rpmbuild/SPECS sed -ibak -e 's/#% define buildid/%define buildid .ppadala/' kernel-2.6.spec
- Build the kernel
cd ~/rpmbuild/SPECS sudo rpmbuild -bb --with xenonly --without debug --without debuginfo --target=`uname -m` kernel-2.6.spec
- This will generate a RPM that you can install on other machines as well.
| Print article | This entry was posted by Pradeep Padala on October 1, 2010 at 3:26 pm, and is filed under Uncategorized. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
about 2 years ago
THX ,I’m looking for it .
about 2 years ago
Wow, no idea how I even found this but its still WAY over my head!
Hope you had a merry xmas PP
about 3 months ago
Thank you for this tutorial,
After running rpm -i… all folders inside ~/rpmbuild/ are empty. Any idea?