summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-emulation/kvm/Manifest28
-rw-r--r--app-emulation/kvm/files/digest-kvm-122
-rw-r--r--app-emulation/kvm/files/digest-kvm-133
-rw-r--r--app-emulation/kvm/files/kvm_add-scripts-qemu-ifup.patch12
-rw-r--r--app-emulation/kvm/files/kvm_use_bios_files_in_usr_share_kvm.patch11
-rw-r--r--app-emulation/kvm/files/kvm_use_etc_kvm_kvm-ifup.patch15
-rw-r--r--app-emulation/kvm/kvm-12.ebuild80
-rw-r--r--app-emulation/kvm/kvm-13.ebuild93
8 files changed, 244 insertions, 0 deletions
diff --git a/app-emulation/kvm/Manifest b/app-emulation/kvm/Manifest
new file mode 100644
index 00000000..7fdafcf4
--- /dev/null
+++ b/app-emulation/kvm/Manifest
@@ -0,0 +1,28 @@
+AUX kvm_add-scripts-qemu-ifup.patch 359 RMD160 d66e31dedd21c5fb752721ae2bc86caaf0e1301d SHA1 3e5eede431640625a2cfc03c4f1a39b0bd3f33fe SHA256 7f47028bc50cc669bebe1ca70e667a296715601601be71049a2f7c1d211bb320
+MD5 11750a6894c39ab6350cb62c034b6796 files/kvm_add-scripts-qemu-ifup.patch 359
+RMD160 d66e31dedd21c5fb752721ae2bc86caaf0e1301d files/kvm_add-scripts-qemu-ifup.patch 359
+SHA256 7f47028bc50cc669bebe1ca70e667a296715601601be71049a2f7c1d211bb320 files/kvm_add-scripts-qemu-ifup.patch 359
+AUX kvm_use_bios_files_in_usr_share_kvm.patch 306 RMD160 e9f299ea50151d7eb41a33d05dd86dca766d319d SHA1 8a721d15f518ed20da0ba9852737b119c4fa724f SHA256 3757405b687431d5998d89cf844015713b6b3d6dc90965bdc73bd0dfec38c585
+MD5 0088f7d64734479ddd9c181dfdacd070 files/kvm_use_bios_files_in_usr_share_kvm.patch 306
+RMD160 e9f299ea50151d7eb41a33d05dd86dca766d319d files/kvm_use_bios_files_in_usr_share_kvm.patch 306
+SHA256 3757405b687431d5998d89cf844015713b6b3d6dc90965bdc73bd0dfec38c585 files/kvm_use_bios_files_in_usr_share_kvm.patch 306
+AUX kvm_use_etc_kvm_kvm-ifup.patch 440 RMD160 e47f6269d3744ad9a80df8ddf9915cabceb4867a SHA1 c76c18cb70056b70cf78d88b434bd2b47353e440 SHA256 abe8121aecfeafe0eab851cb8951eee2ba89e1560e14dea069b3f92fc24abe64
+MD5 b1119a77ee45a23f3e2d2d8cd27bd39e files/kvm_use_etc_kvm_kvm-ifup.patch 440
+RMD160 e47f6269d3744ad9a80df8ddf9915cabceb4867a files/kvm_use_etc_kvm_kvm-ifup.patch 440
+SHA256 abe8121aecfeafe0eab851cb8951eee2ba89e1560e14dea069b3f92fc24abe64 files/kvm_use_etc_kvm_kvm-ifup.patch 440
+DIST kvm-12.tar.gz 1978729 RMD160 55c0bfabce8d7916aa8977150c1eb85fb12ce03c SHA1 e6999910e764daa0b41c36fd41e56c40ecf9742e SHA256 bcd29a34c94b74cadfdd9e7911e807a704039e850b8caddc551a871cff245c70
+DIST kvm-13.tar.gz 1987242 RMD160 3b9ef7bd73b2781db237cada58569f5a975f7df1 SHA1 f18ef1bd0777059d1d6331ae2be5274e0cde197e SHA256 630880a657c2dd4d2d8631d81224a9b7f87f780d7cda8bad4aa06691a199f0b5
+EBUILD kvm-12.ebuild 2182 RMD160 2a4eb7c7ec99d976648a74f52f81c954f11f2db6 SHA1 5513cd423a41f376faf3dde8515dd3ceb0073ad3 SHA256 42e8f3a9fcebdcf7a56b14725c476d9fdb6cc3c9f6b95c70e5538e17de269bcb
+MD5 1bea9bbef1670a0a5d64a753fc3da41f kvm-12.ebuild 2182
+RMD160 2a4eb7c7ec99d976648a74f52f81c954f11f2db6 kvm-12.ebuild 2182
+SHA256 42e8f3a9fcebdcf7a56b14725c476d9fdb6cc3c9f6b95c70e5538e17de269bcb kvm-12.ebuild 2182
+EBUILD kvm-13.ebuild 2699 RMD160 973569dca87b4782b92391c754f980f17a1f1d8b SHA1 d30b962efef0fa88edc39ed89f7aa8b831c8e737 SHA256 af932b9b5ba0e1e811af355ae287d2fe14bb9cc55f2e843608eacd2e3bc983c5
+MD5 c6fc7143b15ec8e6decd2837f3258e83 kvm-13.ebuild 2699
+RMD160 973569dca87b4782b92391c754f980f17a1f1d8b kvm-13.ebuild 2699
+SHA256 af932b9b5ba0e1e811af355ae287d2fe14bb9cc55f2e843608eacd2e3bc983c5 kvm-13.ebuild 2699
+MD5 e0da84d782ff7a30a83444686da6ae78 files/digest-kvm-12 164
+RMD160 a8fa76a7a7bc0339f6cc9427a328b67f4b091f81 files/digest-kvm-12 164
+SHA256 d2281870c00463b3fb9aa129fce43603311417de7f1abe38799a986734e8b5ca files/digest-kvm-12 164
+MD5 bcd5df7d8b0144b1b2bec840c1f0e33d files/digest-kvm-13 223
+RMD160 779ed6f0c935f37438de99a10af6b28d54a9780f files/digest-kvm-13 223
+SHA256 261f4be9bd3ef52555d19f2179f5e6fb770d5101f2b782fd0177a874fc031eee files/digest-kvm-13 223
diff --git a/app-emulation/kvm/files/digest-kvm-12 b/app-emulation/kvm/files/digest-kvm-12
new file mode 100644
index 00000000..242b5097
--- /dev/null
+++ b/app-emulation/kvm/files/digest-kvm-12
@@ -0,0 +1,2 @@
+RMD160 55c0bfabce8d7916aa8977150c1eb85fb12ce03c kvm-12.tar.gz 1978729
+SHA256 bcd29a34c94b74cadfdd9e7911e807a704039e850b8caddc551a871cff245c70 kvm-12.tar.gz 1978729
diff --git a/app-emulation/kvm/files/digest-kvm-13 b/app-emulation/kvm/files/digest-kvm-13
new file mode 100644
index 00000000..ec8b0b82
--- /dev/null
+++ b/app-emulation/kvm/files/digest-kvm-13
@@ -0,0 +1,3 @@
+MD5 d638084f5e3410464c9e8158c259352d kvm-13.tar.gz 1987242
+RMD160 3b9ef7bd73b2781db237cada58569f5a975f7df1 kvm-13.tar.gz 1987242
+SHA256 630880a657c2dd4d2d8631d81224a9b7f87f780d7cda8bad4aa06691a199f0b5 kvm-13.tar.gz 1987242
diff --git a/app-emulation/kvm/files/kvm_add-scripts-qemu-ifup.patch b/app-emulation/kvm/files/kvm_add-scripts-qemu-ifup.patch
new file mode 100644
index 00000000..37fc63ee
--- /dev/null
+++ b/app-emulation/kvm/files/kvm_add-scripts-qemu-ifup.patch
@@ -0,0 +1,12 @@
+
+Taken from upstream SVN, in scripts/qemu-ifup.
+
+diff -ruN scripts-orig/qemu-ifup scripts/qemu-ifup
+--- scripts-orig/qemu-ifup 1970-01-01 02:00:00.000000000 +0200
++++ scripts/qemu-ifup 2006-12-23 08:32:56.000000000 +0200
+@@ -0,0 +1,5 @@
++#!/bin/sh
++
++switch=$(ip route list | awk '/^default / { print $NF }')
++ifconfig $1 0.0.0.0 up
++brctl addif ${switch} $1
diff --git a/app-emulation/kvm/files/kvm_use_bios_files_in_usr_share_kvm.patch b/app-emulation/kvm/files/kvm_use_bios_files_in_usr_share_kvm.patch
new file mode 100644
index 00000000..8b54a5dc
--- /dev/null
+++ b/app-emulation/kvm/files/kvm_use_bios_files_in_usr_share_kvm.patch
@@ -0,0 +1,11 @@
+--- qemu/configure~ 2006-11-02 14:25:06.000000000 +0200
++++ qemu/configure 2007-01-12 11:54:05.000000000 +0200
+@@ -514,7 +514,7 @@
+ prefix="/usr/local"
+ fi
+ mandir="$prefix/share/man"
+-datadir="$prefix/share/qemu"
++datadir="$prefix/share/kvm"
+ docdir="$prefix/share/doc/qemu"
+ bindir="$prefix/bin"
+ fi
diff --git a/app-emulation/kvm/files/kvm_use_etc_kvm_kvm-ifup.patch b/app-emulation/kvm/files/kvm_use_etc_kvm_kvm-ifup.patch
new file mode 100644
index 00000000..dfdccd48
--- /dev/null
+++ b/app-emulation/kvm/files/kvm_use_etc_kvm_kvm-ifup.patch
@@ -0,0 +1,15 @@
+
+Use an independent script to control the network at startup.
+
+diff -ruN kvm-11-orig/qemu/vl.c kvm-11/qemu/vl.c
+--- kvm-11-orig/qemu/vl.c 2007-01-07 14:58:54.000000000 +0200
++++ kvm-11/qemu/vl.c 2007-01-17 13:34:12.000000000 +0200
+@@ -93,7 +93,7 @@
+ #include "qemu-kvm.h"
+ #endif
+
+-#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
++#define DEFAULT_NETWORK_SCRIPT "/etc/kvm/kvm-ifup"
+
+ //#define DEBUG_UNUSED_IOPORT
+ //#define DEBUG_IOPORT
diff --git a/app-emulation/kvm/kvm-12.ebuild b/app-emulation/kvm/kvm-12.ebuild
new file mode 100644
index 00000000..35de0510
--- /dev/null
+++ b/app-emulation/kvm/kvm-12.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit linux-mod eutils
+
+SRC_URI="http://easynews.dl.sourceforge.net/sourceforge/${PN}/${P}.tar.gz"
+
+DESCRIPTION="KVM (for Kernel-based Virtual Machine) is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V)"
+HOMEPAGE="http://kvm.qumranet.com/kvmwiki"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE=""
+
+MODULE_NAMES="kernel/kvm(extra:)
+ kernel/kvm-intel(extra:)
+ kernel/kvm-amd(extra:)"
+BUILD_TARGETS="kernel"
+
+pkg_setup() {
+ if [ "$(gcc-major-version)" == "4" ]; then
+ eerror "kvm requires gcc-3 in order to build and work correctly"
+ eerror "please compile it switching to gcc-3."
+ die "gcc 4 cannot build qemu"
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch ${FILESDIR}/kvm_use_bios_files_in_usr_share_kvm.patch
+ epatch ${FILESDIR}/kvm_add-scripts-qemu-ifup.patch
+ epatch ${FILESDIR}/kvm_use_etc_kvm_kvm-ifup.patch
+}
+
+src_compile() {
+ #fix make install to not install modules
+ sed -i '/$(kcmd)/d' ${WORKDIR}/${P}/Makefile
+
+ linux-mod_pkg_setup
+ conf_opts="--prefix=/usr"
+
+ ./configure ${conf_opts} || die "configure failed"
+ #Check if kvm is NOT part of the kernel and compile the module
+ if ! linux_chkconfig_present KVM; then
+ linux-mod_src_compile
+ ./configure ${conf_opts}
+ #If it is we need to disable the build of the module
+ else
+ ./confiure ${conf_opts} --with-patched-kernel || die "Configure failed"
+ fi
+ make user qemu || die "make failed"
+}
+
+pkg_preinst() {
+ enewgroup kvm
+
+ einfo "qemu-img is removed from this package."
+ einfo "If you wanna use it. Install qemu."
+}
+
+src_install() {
+ make install DESTDIR="${D}" || die
+ if ! linux_chkconfig_present KVM; then
+ linux-mod_src_install
+ fi
+ mv ${D}/usr/bin/qemu ${D}/usr/bin/kvm
+ mv ${D}/usr/share/doc/qemu ${D}/usr/share/doc/kvm
+ mv ${D}/usr/share/man/man1/qemu.1 ${D}/usr/share/man/man1/kvm.1
+ rm -f ${D}/usr/bin/qemu-img
+ rm -f ${D}/usr/share/man/man1/qemu-img.1
+ insinto /etc/udev/rules.d/
+ doins ${WORKDIR}/${P}/scripts/65-kvm.rules
+ insinto /etc/kvm/
+ doins ${WORKDIR}/${P}/scripts/qemu-ifup
+
+}
diff --git a/app-emulation/kvm/kvm-13.ebuild b/app-emulation/kvm/kvm-13.ebuild
new file mode 100644
index 00000000..cc21864a
--- /dev/null
+++ b/app-emulation/kvm/kvm-13.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit linux-mod eutils
+
+SRC_URI="http://easynews.dl.sourceforge.net/sourceforge/${PN}/${P}.tar.gz"
+
+DESCRIPTION="KVM (for Kernel-based Virtual Machine) is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V)"
+HOMEPAGE="http://kvm.qumranet.com/kvmwiki"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE=""
+
+MODULE_NAMES="kernel/kvm(extra:)
+ kernel/kvm-intel(extra:)
+ kernel/kvm-amd(extra:)"
+BUILD_TARGETS="kernel"
+
+pkg_setup() {
+ if [ "$(gcc-major-version)" == "4" ]; then
+ eerror "kvm requires gcc-3 in order to build and work correctly"
+ eerror "please compile it switching to gcc-3."
+ die "gcc 4 cannot build qemu"
+ fi
+ #kvm-13 doesn't work with modules from linux kernel 2.6.20
+ if kernel_is 2 6 20 && linux_chkconfig_present KVM ; then
+ eerror "kvm-13 doesn't work with the 2.6.20 kernel module"
+ die "kvm module is included in the 2.6.20 kernel"
+ fi
+
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch ${FILESDIR}/kvm_use_bios_files_in_usr_share_kvm.patch
+ epatch ${FILESDIR}/kvm_add-scripts-qemu-ifup.patch
+ epatch ${FILESDIR}/kvm_use_etc_kvm_kvm-ifup.patch
+}
+
+src_compile() {
+ #fix make install to not install modules
+ sed -i '/$(kcmd)/d' ${WORKDIR}/${P}/Makefile
+
+ linux-mod_pkg_setup
+ conf_opts="--prefix=/usr"
+
+ #Check if kvm is NOT part of the kernel and compile the module
+ if ! linux_chkconfig_present KVM ; then
+ ./configure ${conf_opts} || die "Configure failed"
+ linux-mod_src_compile
+ #If it is we need to disable the build of the module
+ else
+ ./configure ${conf_opts} --with-patched-kernel || die "Configure failed"
+ fi
+ emake user qemu || die "make failed"
+}
+
+src_install() {
+ make install DESTDIR="${D}" || die
+ if ! linux_chkconfig_present KVM; then
+ linux-mod_src_install
+ fi
+ if use amd64; then
+ mv ${D}/usr/bin/qemu-system-x86_64 ${D}/usr/bin/kvm
+ else
+ mv ${D}/usr/bin/qemu ${D}/usr/bin/kvm
+ fi
+ mv ${D}/usr/share/doc/qemu ${D}/usr/share/doc/kvm
+ mv ${D}/usr/share/man/man1/qemu.1 ${D}/usr/share/man/man1/kvm.1
+ rm -f ${D}/usr/bin/qemu-img
+ rm -f ${D}/usr/share/man/man1/qemu-img.1
+ insinto /etc/udev/rules.d/
+ doins ${WORKDIR}/${P}/scripts/65-kvm.rules
+ insinto /etc/kvm/
+ doins ${WORKDIR}/${P}/scripts/qemu-ifup
+
+}
+
+pkg_postinst() {
+ enewgroup kvm
+
+ elog "qemu-img is removed from this package."
+ elog "If you wanna use it. Install qemu."
+ elog "Make sure you have the kernel module loaded before running kvm"
+ elog "and your user is in the 'kvm' group"
+ elog "Just run 'gpasswd -a <USER> kvm', then have <USER> re-login."
+
+} \ No newline at end of file