File kvm-kmp.spec of Package kvm-kmp
#
# spec file for package kvm-kmp (Version 78.2.6.30.1)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
# icecream 0
%define kernel_version %(echo `rpm -q --queryformat '%{VERSION}-%{RELEASE}' kernel-source`|sed 's/_/-/g;')
%define real_version 2.6.30.1
%ifarch ia64
%define kvm_arch ia64
%endif
%ifarch %ix86 x86_64
%define kvm_arch x86
%endif
Name: kvm-kmp
License: BSD 3-Clause; GPL v2 only; GPL v2 or later; LGPL v2.1 or later; X11/MIT
Group: System/Kernel
Summary: Kernel-based Virtual Machine
Url: http://kvm.qumranet.com/
Version: 78.%{real_version}
Release: 0.<RELEASE1>
#Source0: kvm-kmod-%version.tar.bz2
Source0: kvm-kmod-%{real_version}.tar.bz2
ExclusiveArch: %ix86 x86_64 ia64
# common and X86 patches
Patch01: kvm-local-include2.patch
Patch02: sles10.patch
# Mac OS X patches
Patch20: kvm-ioapic.patch
# Post-release upstream patches
Patch100: kvm-preXX-init-on-demand.patch
Patch101: kvm-preXX-macos.patch
Patch102: kvm-pre-2.6.32-hypercalls.patch
Patch103: kvm-preXX-COPYING.patch
Patch104: kvm-preXX-debug-reg-check-cpl.patch
Patch105: kvm-preXX-cr8-null-pointer.patch
Patch106: kvm-preXX-cpuid-entry-count.patch
# for IA64
Source500: ia64-fix-pagesize.pl
Patch500: IA64-kvm-suse.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: /usr/sbin/groupadd
# KMP
BuildRequires: kernel-syms module-init-tools
Requires: kvm-kmp
%suse_kernel_module_package -n kvm debug kdump xen xenpae ec2
# Build KMPs for SLERT
# kernel-syms-rt were not available for <= 11.1
%if %suse_version > 1110
%ifarch %ix86 x86_64
BuildRequires: kernel-syms-rt
%endif
%endif
%description
KVM (Kernel-based Virtual Machine) is a virtualization software for
Linux which is based on hardware virtualization extensions (Intel VT-X
and AMD-V) and a modified version of qemu to enable full hardware
emulation as far as needed to boot many PC operating systems in
unmodified form, including Linux, Windows and Mac OS X.
Note: KVM is not yet ready for production use and has known issues. You
can find details the Novell bugzilla: http://bugzilla.novell.com
KVM depends on Intel VT and AMD-V and does not run on CPUs without
these extensions. qemu can be used on those, with some performance
penalty, instead.
As the hardware emulation used for KVM is based on QEMU, virtual
machines can be moved between QEMU and KVM hosts seamlessly.
The package libvirt contains libvirtd, a simple hypervisor for managing
multiple QEMU and KVM virtual machines on one host machine. The
included virtsh allows to define virtual machines using XML files and
allows some simple management of such virtual machines on the command
line. virt-manager is a GUI for connecting to, and controlling virtual
machines based on libvirt.
Authors:
--------
Avi Kivity <avi@qumranet.com>
Yaniv Kamay <yaniv@qumranet.com>
Dor Laor <dor.laor@qumranet.com>
%package -n kvm-KMP
License: BSD 3-Clause; GPL v2 only; GPL v2 or later; LGPL v2.1 or later; X11/MIT
Summary: Updated kernel modules for KVM (Kernel-based Virtual Machine)
Group: System/Kernel
%description -n kvm-KMP
This package contains updated kernel modules which are recommended for
enhanced functionality of KVM. The Linux kernel rpm already contains
kvm modules, but with this package installed and the modules of this
package loaded, certain fixes which are not yet available in the kernel
rpm.
To verify the kernel to which this package is built for, compare the
postfix of this package has after "kvm-kmp-" with the postfix after
"kernel-", e.g. kvm-kmp-default contains updated modules for the
kernel-default with the exact same version number.
To take advantage of KVM in general, you need qemu-kvm (which is
included in the package kvm) which contains the PC hardware simulation
that is needed for full virtualisation.
KVM guests implemented using qemu-kvm can be monitored using libvirt
which contains a hypervisor for managing multible QEMU and KVM and Xen
virtual machines. virt-manager provides a graphical application for
connecting to and controlling virtual machines based on libvirt.
Authors:
--------
Avi Kivity <avi@qumranet.com>
Yaniv Kamay <yaniv@qumranet.com>
Dor Laor <dor.laor@qumranet.com>
%prep
%setup -q -n kvm-kmod-%{real_version}
%patch01 -p1
%if %suse_version <= 1020
%patch02 -p1
%endif
# Patches that were rejected upstream
%patch20 -p1
# Patches that should go upstream
%patch100 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1
%patch104 -p1
%patch105 -p1
%patch106 -p1
# IA64 support
%ifarch ia64
%patch500 -p1
#%_sourcedir/ia64-fix-pagesize.pl # needs testing...
%endif
%build
./configure
# Patch the module version, so we know which kmp was installed:
for i in `find . -name "*.c"`; do
sed -i "s|%{real_version}|%{version}-%{release}|" "$i"
done
# Main build:
cd ..
%ifarch ia64
cp -a /usr/src/linux/lib .
%endif
mkdir suse-kernel
for flavor in %flavors_to_build; do
rm -rf suse-kernel/$flavor
cp -r kvm-kmod-%{real_version} suse-kernel/$flavor
cd suse-kernel/$flavor
kver=$(line < /usr/src/linux-obj/%_target_cpu/$flavor/Makefile | cut -f4 -d/)
kernel_source_dir=/usr/src/$kver
# old kernels have different Makefiles
if [ "${kver:0:1}" = "#" ]; then
kernel_source_dir=/usr/src/$(grep "KERNELSRC " /usr/src/linux-obj/%_target_cpu/$flavor/Makefile | cut -f4 -d/)
fi
mkdir include2
%ifarch ia64
ln -s /usr/src/linux/arch/ia64/include/asm include2/asm
%else
if [ -d $kernel_source_dir/arch/%{kvm_arch}/include/asm ]; then
ln -s $kernel_source_dir/arch/%{kvm_arch}/include/asm include2/asm
else
ln -s $kernel_source_dir/include/asm-%{kvm_arch} include2/asm
fi
%endif
sed -i "s|KERNELDIR=.*|KERNELDIR=/usr/src/linux-obj/%_target_cpu/$flavor|
s|KERNELSOURCEDIR=.*|KERNELSOURCEDIR=$kernel_source_dir|" config.mak
make %{?jobs:-j%jobs}
cd ../..
done
cd kvm-kmod-%{real_version}
%install
# kernel modules
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
export INSTALL_MOD_DIR=updates
(
cd ../
for flavor in %flavors_to_build; do
make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install \
M=$PWD/suse-kernel/$flavor
done
)
%changelog