Rebuild kernel-2.6.32.26-174.xendom0.fc12.src.rpm on RHEL Server 6

This post follows up “Howto” http://wiki.xen.org/xenwiki/RHEL6Xen4Tutorial ( [1] ).
Install kernel-2.6.32.26-174.xendom0.fc12.src.rpm on RHEL 6 Server.

# wget http://fedorapeople.org/~myoung/dom0/src/kernel-2.6.32.26-174.xendom0.fc12.src.rpm
# rpm -iv kernel-2.6.32.26-174.xendom0.fc12.src.rpm

*********************************************************************************************
UPDATE @ 12/01/10
Straight forward build with option “– with firmware” :
# rpmbuild -bb –with firmware kernel.spec
allows to get all rpms been built and installed, including kernel-firmware.rpm
*********************************************************************************************
Actually , we have two options to perform this rebuild on RHEL 6 Server.
************
Option 1
************
Apply manually following patch to kernel.spec. It changes just one line in code. Remove the one with (-) and add the one with (+).

--- kernel.spec.orig 2010-11-23 16:36:51.000000000 +0300
+++ kernel.spec 2010-11-29 21:50:28.609899657 +0300
@@ -466,7 +466,7 @@
# Packages that need to be installed before the kernel is, because the %post
# scripts use them.
#
-%define kernel_prereq fileutils, module-init-tools, initscripts >= 8.11.1-1, kernel-firmware >= %{rpmversion}-%{pkg_release}, grubby >= 7.0.4-1
+%define kernel_prereq fileutils, module-init-tools, initscripts >= 8.11.1-1,grubby >= 7.0.4-1
%if %{with_dracut}
%define initrd_prereq dracut >= 002 xorg-x11-drv-ati-firmware
%else

Install EPEL Repos to succeed with build

rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

After compile and install, disable the epel repo change /etc/yum.repos.d/epel.repo to ‘enabled=0′ and then run ‘yum clean all && yum update’
Now run :-

# rpmbuild -bb ./kernel.spec
# cd ../RPMS/x86_64

and install generated RPMS :-
[root@ServerTest x86_64]# ./inst.sh
Loaded plugins: refresh-packagekit, rhnplugin
Setting up Install Process
Examining kernel-2.6.32.26-174.xendom0.el6.x86_64.rpm: kernel-2.6.32.26-174.xendom0.el6.x86_64
Marking kernel-2.6.32.26-174.xendom0.el6.x86_64.rpm as an update to kernel-2.6.32-71.el6.x86_64
Examining kernel-debuginfo-2.6.32.26-174.xendom0.el6.x86_64.rpm: kernel-debuginfo-2.6.32.26-174.xendom0.el6.x86_64
Marking kernel-debuginfo-2.6.32.26-174.xendom0.el6.x86_64.rpm to be installed
Examining kernel-debuginfo-common-x86_64-2.6.32.26-174.xendom0.el6.x86_64.rpm: kernel-debuginfo-common-x86_64-2.6.32.26-174.xendom0.el6.x86_64
Marking kernel-debuginfo-common-x86_64-2.6.32.26-174.xendom0.el6.x86_64.rpm to be installed
Examining kernel-devel-2.6.32.26-174.xendom0.el6.x86_64.rpm: kernel-devel-2.6.32.26-174.xendom0.el6.x86_64
Marking kernel-devel-2.6.32.26-174.xendom0.el6.x86_64.rpm as an update to kernel-devel-2.6.32-71.el6.x86_64
Examining kernel-headers-2.6.32.26-174.xendom0.el6.x86_64.rpm: kernel-headers-2.6.32.26-174.xendom0.el6.x86_64
Marking kernel-headers-2.6.32.26-174.xendom0.el6.x86_64.rpm as an update to kernel-headers-2.6.32-71.el6.x86_64
Resolving Dependencies
–> Running transaction check
—> Package kernel.x86_64 0:2.6.32.26-174.xendom0.el6 set to be installed
—> Package kernel-debuginfo.x86_64 0:2.6.32.26-174.xendom0.el6 set to be updated
—> Package kernel-debuginfo-common-x86_64.x86_64 0:2.6.32.26-174.xendom0.el6 set to be updated
—> Package kernel-devel.x86_64 0:2.6.32.26-174.xendom0.el6 set to be installed
—> Package kernel-headers.x86_64 0:2.6.32.26-174.xendom0.el6 set to be updated
–> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================
Package Arch Version Repository Size
===================================================================================================================
Installing:
kernel x86_64 2.6.32.26-174.xendom0.el6 /kernel-2.6.32.26-174.xendom0.el6.x86_64 91 M
kernel-debuginfo x86_64 2.6.32.26-174.xendom0.el6 /kernel-debuginfo-2.6.32.26-174.xendom0.el6.x86_64 1.1 G
kernel-debuginfo-common-x86_64 x86_64 2.6.32.26-174.xendom0.el6 /kernel-debuginfo-common-x86_64-2.6.32.26-174.xendom0.el6.x86_64 151 M
kernel-devel x86_64 2.6.32.26-174.xendom0.el6 /kernel-devel-2.6.32.26-174.xendom0.el6.x86_64 22 M
Updating:
kernel-headers x86_64 2.6.32.26-174.xendom0.el6 /kernel-headers-2.6.32.26-174.xendom0.el6.x86_64 2.3 M

Transaction Summary
===================================================================================================================
Install 4 Package(s)
Upgrade 1 Package(s)

Total size: 1.4 G
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : kernel-2.6.32.26-174.xendom0.el6.x86_64 1/6

grubby fatal error: unable to find a suitable template => May be ignored

Installing : kernel-debuginfo-common-x86_64-2.6.32.26-174.xendom0.el6.x86_64 2/6
Installing : kernel-debuginfo-2.6.32.26-174.xendom0.el6.x86_64 3/6
Updating : kernel-headers-2.6.32.26-174.xendom0.el6.x86_64 4/6
Installing : kernel-devel-2.6.32.26-174.xendom0.el6.x86_64 5/6
Cleanup : kernel-headers-2.6.32-71.el6.x86_64 6/6

Installed: kernel.x86_64
0:2.6.32.26-174.xendom0.el6
kernel-debuginfo.x86_64 0:2.6.32.26-174.xendom0.el6
kernel-debuginfo-common-x86_64.x86_64 0:2.6.32.26-174.xendom0.el6
kernel-devel.x86_64 0:2.6.32.26-174.xendom0.el6

Updated:
kernel-headers.x86_64 0:2.6.32.26-174.xendom0.el6

Complete!

Reboot with new kernel

title Xen 4.0.1 with Red Hat Enterprise Linux (vmlinuz-2.6.32.26-174.xendom0.el6.x86_64)
root (hd1,7)
kernel /xen.gz dom0_mem=1024M loglvl=all guest_loglvl=all
module /vmlinuz-2.6.32.26-174.xendom0.el6.x86_64 ro root=/dev/mapper/vg_servertest-lv_root rd_LVM_LV=vg_servertest/lv_root
module /initramfs-2.6.32.26-174.xendom0.el6.x86_64.img

[root@ServerTest ~]# xm info
host : ServerTest
release : 2.6.32.26-174.xendom0.el6.x86_64
version : #1 SMP Mon Nov 29 20:12:24 MSK 2010
machine : x86_64
nr_cpus : 4
nr_nodes : 1
cores_per_socket : 4
threads_per_core : 1
cpu_mhz : 2833
hw_caps : bfebfbff:20100800:00000000:00000940:0008e3fd:00000000:00000001:00000000
virt_caps : hvm
total_memory : 8190
free_memory : 7070
node_to_cpu : node0:0-3
node_to_memory : node0:7070
node_to_dma32_mem : node0:3259
max_node_id : 0
xen_major : 4
xen_minor : 0
xen_extra : .1
xen_caps : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64
xen_scheduler : credit
xen_pagesize : 4096
platform_params : virt_start=0xffff800000000000
xen_changeset : unavailable
xen_commandline : dom0_mem=1024M loglvl=all guest_loglvl=all
cc_compiler : gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC)
cc_compile_by : root
cc_compile_domain : (none)
cc_compile_date : Mon Nov 29 10:24:07 MSK 2010
xend_config_format : 4





********************************************************
Option 2. Installation with no hackery at all.
********************************************************

# rpmbuild -bb --with firmware kernel.spec

# cd ../RPMS/x86_64
yum install \
kernel-2.6.32.26-174.xendom0.el6.x86_64.rpm \
kernel-debuginfo-2.6.32.26-174.xendom0.el6.x86_64.rpm \
kernel-debuginfo-common-x86_64-2.6.32.26-174.xendom0.el6.x86_64.rpm \
kernel-devel-2.6.32.26-174.xendom0.el6.x86_64.rpm \
kernel-firmware-2.6.32.26-174.xendom0.el6.x86_64.rpm \
kernel-headers-2.6.32.26-174.xendom0.el6.x86_64.rpm

. . . . . .
Setting up Install Process
Examining kernel-2.6.32.26-174.xendom0.el6.x86_64.rpm: kernel-2.6.32.26-174.xendom0.el6.x86_64
Marking kernel-2.6.32.26-174.xendom0.el6.x86_64.rpm as an update to kernel-2.6.32-71.el6.x86_64
Marking kernel-2.6.32.26-174.xendom0.el6.x86_64.rpm as an update to kernel-2.6.32-71.7.1.el6.x86_64
Examining kernel-debuginfo-2.6.32.26-174.xendom0.el6.x86_64.rpm: kernel-debuginfo-2.6.32.26-174.xendom0.el6.x86_64
Marking kernel-debuginfo-2.6.32.26-174.xendom0.el6.x86_64.rpm to be installed
Examining kernel-debuginfo-common-x86_64-2.6.32.26-174.xendom0.el6.x86_64.rpm: kernel-debuginfo-common-x86_64-2.6.32.26-174.xendom0.el6.x86_64
Marking kernel-debuginfo-common-x86_64-2.6.32.26-174.xendom0.el6.x86_64.rpm to be installed
Examining kernel-devel-2.6.32.26-174.xendom0.el6.x86_64.rpm: kernel-devel-2.6.32.26-174.xendom0.el6.x86_64
Marking kernel-devel-2.6.32.26-174.xendom0.el6.x86_64.rpm as an update to kernel-devel-2.6.32-71.el6.x86_64
Marking kernel-devel-2.6.32.26-174.xendom0.el6.x86_64.rpm as an update to kernel-devel-2.6.32-71.7.1.el6.x86_64
Examining kernel-firmware-2.6.32.26-174.xendom0.el6.x86_64.rpm: kernel-firmware-2.6.32.26-174.xendom0.el6.x86_64
Marking kernel-firmware-2.6.32.26-174.xendom0.el6.x86_64.rpm to be installed
Examining kernel-headers-2.6.32.26-174.xendom0.el6.x86_64.rpm: kernel-headers-2.6.32.26-174.xendom0.el6.x86_64
Marking kernel-headers-2.6.32.26-174.xendom0.el6.x86_64.rpm as an update to kernel-headers-2.6.32-71.7.1.el6.x86_64
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:2.6.32.26-174.xendom0.el6 set to be installed
---> Package kernel-debuginfo.x86_64 0:2.6.32.26-174.xendom0.el6 set to be updated
---> Package kernel-debuginfo-common-x86_64.x86_64 0:2.6.32.26-174.xendom0.el6 set to be updated
---> Package kernel-devel.x86_64 0:2.6.32.26-174.xendom0.el6 set to be installed
---> Package kernel-firmware.x86_64 0:2.6.32.26-174.xendom0.el6 set to be updated
---> Package kernel-headers.x86_64 0:2.6.32.26-174.xendom0.el6 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================
Package Arch Version Repository Size
=================================================================================================================
Installing:
kernel x86_64 2.6.32.26-174.xendom0.el6 /kernel-2.6.32.26-174.xendom0.el6.x86_64 91 M
kernel-debuginfo x86_64 2.6.32.26-174.xendom0.el6 /kernel-debuginfo-2.6.32.26-174.xendom0.el6.x86_64 1.1 G
kernel-debuginfo-common-x86_64
x86_64 2.6.32.26-174.xendom0.el6 /kernel-debuginfo-common-x86_64-2.6.32.26-174.xendom0.el6.x86_64
151 M
kernel-devel x86_64 2.6.32.26-174.xendom0.el6 /kernel-devel-2.6.32.26-174.xendom0.el6.x86_64 22 M
kernel-firmware x86_64 2.6.32.26-174.xendom0.el6 /kernel-firmware-2.6.32.26-174.xendom0.el6.x86_64 2.2 M
Updating:
kernel-headers x86_64 2.6.32.26-174.xendom0.el6 /kernel-headers-2.6.32.26-174.xendom0.el6.x86_64 2.3 M

Transaction Summary
=================================================================================================================
Install 5 Package(s)
Upgrade 1 Package(s)

Total size: 1.4 G
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : kernel-debuginfo-common-x86_64-2.6.32.26-174.xendom0.el6.x86_64 1/7
Installing : kernel-firmware-2.6.32.26-174.xendom0.el6.x86_64 2/7
Installing : kernel-debuginfo-2.6.32.26-174.xendom0.el6.x86_64 3/7
Updating : kernel-headers-2.6.32.26-174.xendom0.el6.x86_64 4/7
Installing : kernel-devel-2.6.32.26-174.xendom0.el6.x86_64 5/7
Installing : kernel-2.6.32.26-174.xendom0.el6.x86_64 6/7
Cleanup : kernel-headers-2.6.32-71.7.1.el6.x86_64 7/7

Installed:
kernel.x86_64 0:2.6.32.26-174.xendom0.el6
kernel-debuginfo.x86_64 0:2.6.32.26-174.xendom0.el6
kernel-debuginfo-common-x86_64.x86_64 0:2.6.32.26-174.xendom0.el6
kernel-devel.x86_64 0:2.6.32.26-174.xendom0.el6
kernel-firmware.x86_64 0:2.6.32.26-174.xendom0.el6
Updated:
kernel-headers.x86_64 0:2.6.32.26-174.xendom0.el6
Complete!






References
1. http://wiki.xen.org/xenwiki/RHEL6Xen4Tutorial

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: