diff options
author | Daniel Gryniewicz <dang@gentoo.org> | 2008-07-09 00:21:56 +0000 |
---|---|---|
committer | Daniel Gryniewicz <dang@gentoo.org> | 2008-07-09 00:21:56 +0000 |
commit | 751cc842fd38b82924e53c52c9d1f2bf463771c5 (patch) | |
tree | fc066ff03ca73c1a6de26f0163a973771637c30e | |
parent | Add kvm local use flags (diff) | |
download | historical-751cc842fd38b82924e53c52c9d1f2bf463771c5.tar.gz historical-751cc842fd38b82924e53c52c9d1f2bf463771c5.tar.bz2 historical-751cc842fd38b82924e53c52c9d1f2bf463771c5.zip |
Add kvm to the tree
Package-Manager: portage-2.2_rc1/cvs/Linux 2.6.25-gentoo-r5 x86_64
-rw-r--r-- | app-emulation/kvm/ChangeLog | 14 | ||||
-rw-r--r-- | app-emulation/kvm/Manifest | 23 | ||||
-rw-r--r-- | app-emulation/kvm/files/kvm-45-qemu-configure.patch | 13 | ||||
-rw-r--r-- | app-emulation/kvm/files/kvm-48-kvm.patch | 134 | ||||
-rw-r--r-- | app-emulation/kvm/files/kvm-57-kernel-longmode.patch | 11 | ||||
-rw-r--r-- | app-emulation/kvm/files/kvm-57-qemu-kvm-cmdline.patch | 22 | ||||
-rw-r--r-- | app-emulation/kvm/files/kvm-61-qemu-kvm.patch | 15 | ||||
-rw-r--r-- | app-emulation/kvm/files/kvm-68-libkvm-no-kernel.patch | 14 | ||||
-rw-r--r-- | app-emulation/kvm/files/kvm-69-qemu-ifup_ifdown.patch | 52 | ||||
-rw-r--r-- | app-emulation/kvm/files/kvm-69-qemu-no-blobs.patch | 67 | ||||
-rw-r--r-- | app-emulation/kvm/files/kvm-70-qemu-kvm-doc.patch | 339 | ||||
-rw-r--r-- | app-emulation/kvm/kvm-70.ebuild | 178 | ||||
-rw-r--r-- | app-emulation/kvm/metadata.xml | 19 |
13 files changed, 901 insertions, 0 deletions
diff --git a/app-emulation/kvm/ChangeLog b/app-emulation/kvm/ChangeLog new file mode 100644 index 000000000000..82880f8c4d83 --- /dev/null +++ b/app-emulation/kvm/ChangeLog @@ -0,0 +1,14 @@ +# ChangeLog for app-emulation/kvm +# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/kvm/ChangeLog,v 1.1 2008/07/09 00:21:56 dang Exp $ + +*kvm-70 (09 Jul 2008) + + 09 Jul 2008; Daniel Gryniewicz <dang@gentoo.org> + +files/kvm-45-qemu-configure.patch, +files/kvm-48-kvm.patch, + +files/kvm-57-kernel-longmode.patch, +files/kvm-57-qemu-kvm-cmdline.patch, + +files/kvm-61-qemu-kvm.patch, +files/kvm-68-libkvm-no-kernel.patch, + +files/kvm-69-qemu-ifup_ifdown.patch, +files/kvm-69-qemu-no-blobs.patch, + +files/kvm-70-qemu-kvm-doc.patch, +metadata.xml, +kvm-70.ebuild: + Add kvm to the tree + diff --git a/app-emulation/kvm/Manifest b/app-emulation/kvm/Manifest new file mode 100644 index 000000000000..d769e6d1d625 --- /dev/null +++ b/app-emulation/kvm/Manifest @@ -0,0 +1,23 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +AUX kvm-45-qemu-configure.patch 350 RMD160 c84a6659c97ba1518c2cc98e6383af463f3de9a6 SHA1 11002bbca68fbd1f32f1020a5ddb28751003bcc2 SHA256 154c30bdc8e1682540f2f1264bc2fbffd52a77869684b0721cadb304ce06ea85 +AUX kvm-48-kvm.patch 4199 RMD160 c1adae4599a554efefe0349690e06c0e8e874168 SHA1 ff9d73c10b477470a0955460ca985252cbf31d5d SHA256 0b2cfaca612318cad2d4b151d6d93ef24db72fd1e4af4d7311986824a27e85fa +AUX kvm-57-kernel-longmode.patch 374 RMD160 0276687ac0a039b5e628003d96d7a0281e5873cf SHA1 9d65298cdb031216a3934ff5382d93efcc236177 SHA256 c56acdd8e22d312aa6e0e09f975968e04037fb91b38f4f6f3b6b9adea0962d07 +AUX kvm-57-qemu-kvm-cmdline.patch 769 RMD160 229c0137f7dea8b2003ca06aaa14d40e58f73258 SHA1 a6fa1d70cd68d6d2ea65511c8b12690a42fd55a0 SHA256 dc9d3ce1b86a6f58d10b8a666fb589d9bceb3f3f982ff071b5ee8ae30546c446 +AUX kvm-61-qemu-kvm.patch 385 RMD160 4709414d0481db19b81b14484bd7b132111f78f0 SHA1 3c7d933c9ee4622339d3f7d54e0f1e9aed6c7356 SHA256 dcdf47fe620ba7052ced0144cf4846cb87a8865fdaa4e7fbdf8daf98123a397f +AUX kvm-68-libkvm-no-kernel.patch 657 RMD160 799fba8a3f4e20c908b04ff15b99fc0d739126c4 SHA1 4348d347c39c56d17dc1509cc9841df7d5860c5a SHA256 b060309fb54455b1473524085d339ac07a031392eeeb5e209e4b39f5e173b376 +AUX kvm-69-qemu-ifup_ifdown.patch 1530 RMD160 80d5c9c42268f819ccbce4a4a0a7bf1e36101f97 SHA1 136be6d0f84f366f1acdd5837e22578c6768724f SHA256 5991b2ee8fa3542129eedd22983d3500ac21cae255b38ed94c796c30ad4688e0 +AUX kvm-69-qemu-no-blobs.patch 3142 RMD160 3a8f67e04ff1f1fcb8e25ccc5ee6606791799352 SHA1 26b51d7fbad6d7d0fe90166410bc05ab3d8bc43c SHA256 eaecfda00bb25cfba770017af143ccf0d989f3c3a1abd46d3de1b096bfc49505 +AUX kvm-70-qemu-kvm-doc.patch 12287 RMD160 99203f6691d5d9506206c8fd0fc5f72fd92386b8 SHA1 f11e5f060543200e13d12c1b1a69dab96872fbab SHA256 dee25daefcee8e125d66378b307a23da4bd0ef54538aae5ccdd3c3e7ebd76c4e +DIST kvm-70.tar.gz 3929412 RMD160 8a43d9437bd839ca10c4e43992fdf10f0363bc39 SHA1 19e34f21cee5ad05669a814b656c58dedd747ea0 SHA256 a0d3dcd65e1373f86237433a2e30f7dfa4996cb09ccf58efa610b9f48d1b2599 +EBUILD kvm-70.ebuild 5470 RMD160 6e0c0e0f214537f90f736cd1691e8c0a7ad8a78a SHA1 5e0e6c347b1aaf1dc39e702b9dec3988c61d12c2 SHA256 a3d971ee90e3d4e01c987735e6d1e58a8078df5842f4c37bd0064efcfc6163e3 +MISC ChangeLog 654 RMD160 ccb39d1933eac8cf00fa4063bad5fb91ef7db8e2 SHA1 29d84f1bb09219419c64955f64a67ed9f1e8cb59 SHA256 a2c483f73b47809dd706a74d70f1889a2524d8018cee9517714959f3c7fcf4b0 +MISC metadata.xml 569 RMD160 c055f1f688f8d9ce326236f4ed06522e05f0671d SHA1 d89bf363f3c1094343d79a55ac8ce38dc850656c SHA256 a40eca2774a092221b970f8b135ffb63d3bb52a544948bf740e7e60e2ce52ce5 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.9 (GNU/Linux) + +iD8DBQFIdATTomPajV0RnrERAiEpAJwPfoj6FUzIfI5wLsU8PvCKSu6HIwCffdPd +9d5P+tI2ouJvdSAI5x9v0Og= +=mo2V +-----END PGP SIGNATURE----- diff --git a/app-emulation/kvm/files/kvm-45-qemu-configure.patch b/app-emulation/kvm/files/kvm-45-qemu-configure.patch new file mode 100644 index 000000000000..fc88d233ea19 --- /dev/null +++ b/app-emulation/kvm/files/kvm-45-qemu-configure.patch @@ -0,0 +1,13 @@ +--- kvm-45/qemu/configure.orig 2007-10-02 12:30:29.000000000 +0200 ++++ kvm-45/qemu/configure 2007-10-02 12:31:09.000000000 +0200 +@@ -666,8 +666,8 @@ + prefix="/usr/local" + fi + mansuffix="/share/man" +- datasuffix="/share/qemu" +- docsuffix="/share/doc/qemu" ++ datasuffix="/share/kvm" ++ docsuffix="/share/doc/kvm" + binsuffix="/bin" + fi + diff --git a/app-emulation/kvm/files/kvm-48-kvm.patch b/app-emulation/kvm/files/kvm-48-kvm.patch new file mode 100644 index 000000000000..7a2006ac8c77 --- /dev/null +++ b/app-emulation/kvm/files/kvm-48-kvm.patch @@ -0,0 +1,134 @@ +--- kvm-48/kvm 2007-10-18 02:58:26.000000000 -0700 ++++ kvm-48/kvm 2007-10-18 11:58:57.000000000 -0700 +@@ -15,9 +15,11 @@ + self.readfp(file, filename) + + config = ShellConfigParser() +-config.read('config.mak') ++config.read('/etc/kvm/config.mak') + + external_module = config.get('shell', 'want_module') ++prefix = config.get('shell', 'prefix') ++kerneldir = config.get('shell', 'kerneldir').replace('build', 'misc') + privileged = os.getuid() == 0 + + optparser = optparse.OptionParser() +@@ -55,6 +57,12 @@ + default = not privileged, + ) + ++optparser.add_option('--bridge', ++ help = 'use this device to build the bridge', ++ dest = 'bridge', ++ default = None, ++ ) ++ + optparser.add_option('--mac', + help = 'use this specific mac addr', + dest = 'mac', +@@ -73,11 +81,19 @@ + dest = 'kvm', + default = True, + ) ++ ++optparser.add_option('--imagesize', ++ help = 'use this size for the image', ++ dest = 'imagesize', ++ default = '30G', ++ ) ++ + optparser.add_option('--image', + help = 'select disk image', + dest = 'image', + default = '/tmp/disk', + ) ++ + optparser.add_option('--cdrom', + help = 'select cdrom image', + dest = 'cdrom', +@@ -119,7 +135,7 @@ + action = 'store_false', + default = True, + dest = 'irqchip', +- help = 'avoid using in-kernel irqchip', ++ help = 'disable KVM kernel mode PIC/IOAPIC/LAPIC', + ) + + optparser.add_option('-n', '--dry-run', +@@ -148,7 +164,7 @@ + + def insert_module(module): + if os.spawnl(os.P_WAIT, '/sbin/insmod', 'insmod', +- 'kernel/%s.ko' % (module,)) != 0: ++ kerneldir + '/%s.ko' % (module,)) != 0: + raise Exception('failed to load kvm module') + + def probe_module(module): +@@ -181,9 +197,10 @@ + print '/dev/kvm not present' + + disk = options.image ++disksize = options.imagesize + if options.install: +- (status, output) = commands.getstatusoutput( +- 'qemu/qemu-img create -f qcow2 "%s" 30G' % disk) ++ cmd = 'qemu-img create -f qcow2 "' + disk + '" ' + disksize ++ (status, output) = commands.getstatusoutput(cmd) + if status: + raise Exception, output + +@@ -191,14 +208,11 @@ + if options.install: + bootdisk = 'd' + ++# kvm always compiles for the x86_64 target + arch = 'x86_64' ++cmd = 'kvm' + +-if arch == 'x86_64': +- cmd = 'qemu-system-' + arch +-else: +- cmd = 'qemu' +- +-local_cmd = 'qemu/' + arch + '-softmmu/' + cmd ++local_cmd = prefix + '/bin/' + cmd + if os.access(local_cmd, os.F_OK): + cmd = local_cmd + else: +@@ -226,15 +240,31 @@ + if not options.irqchip: + qemu_args += ('-no-kvm-irqchip',) + ++def getmac(interface): ++ if os.access('/sbin/ip', os.F_OK): ++ for line in commands.getoutput('/sbin/ip link show ' + interface).splitlines(): ++ m = re.match(r'.*link/ether (..:..:..:..:..:..).*', line) ++ if m: ++ mac = m.group(1) ++ return mac ++ else: ++ for line in commands.getoutput('/sbin/ifconfig ' + interface).splitlines(): ++ m = re.match(r'.*HWaddr (..:..:..:..:..:..)', line) ++ if m: ++ mac = m.group(1) ++ return mac ++ return False ++ + if not options.notap: ++ bridge = options.bridge ++ if not bridge: ++ bridge = 'eth0' ++ + mac = options.mac + if not mac: +- for line in commands.getoutput('/sbin/ip link show eth0').splitlines(): +- m = re.match(r'.*link/ether (..:..:..:..:..:..).*', line) +- if m: +- mac = m.group(1) ++ mac = getmac(bridge) + if not mac: +- raise Exception, 'Unable to determine eth0 mac address' ++ raise Exception, 'Unable to determine ' + bridge + ' mac address' + mac_components = mac.split(':') + mac_components[0] = 'a0' + mac = ':'.join(mac_components) diff --git a/app-emulation/kvm/files/kvm-57-kernel-longmode.patch b/app-emulation/kvm/files/kvm-57-kernel-longmode.patch new file mode 100644 index 000000000000..e34d380298a8 --- /dev/null +++ b/app-emulation/kvm/files/kvm-57-kernel-longmode.patch @@ -0,0 +1,11 @@ +--- kvm-57/kernel/mmu.h 2007-12-18 08:02:40.000000000 -0800 ++++ kvm-57/kernel/mmu.h 2007-12-20 08:19:31.000000000 -0800 +@@ -20,7 +20,7 @@ static inline int kvm_mmu_reload(struct + static inline int is_long_mode(struct kvm_vcpu *vcpu) + { + #ifdef CONFIG_X86_64 +- return vcpu->arch.shadow_efer & EFER_LME; ++ return vcpu->arch.shadow_efer & EFER_LMA; + #else + return 0; + #endif diff --git a/app-emulation/kvm/files/kvm-57-qemu-kvm-cmdline.patch b/app-emulation/kvm/files/kvm-57-qemu-kvm-cmdline.patch new file mode 100644 index 000000000000..71275d40a3d5 --- /dev/null +++ b/app-emulation/kvm/files/kvm-57-qemu-kvm-cmdline.patch @@ -0,0 +1,22 @@ +--- kvm-57/qemu/vl.c 2007-12-18 07:57:46.000000000 -0800 ++++ kvm-57/qemu/vl.c 2007-12-20 06:59:55.000000000 -0800 +@@ -136,8 +136,8 @@ int inet_aton(const char *cp, struct in_ + #include "qemu-kvm.h" + #endif + +-#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup" +-#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown" ++#define DEFAULT_NETWORK_SCRIPT "/etc/kvm/kvm-ifup" ++#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/kvm/kvm-ifdown" + #ifdef __sun__ + #define SMBD_COMMAND "/usr/sfw/sbin/smbd" + #else +@@ -7971,7 +7971,7 @@ static void help(int exitcode) + "\n" + "When using -nographic, press 'ctrl-a h' to get some help.\n" + , +- "qemu", ++ "kvm", + DEFAULT_RAM_SIZE, + #ifndef _WIN32 + DEFAULT_NETWORK_SCRIPT, diff --git a/app-emulation/kvm/files/kvm-61-qemu-kvm.patch b/app-emulation/kvm/files/kvm-61-qemu-kvm.patch new file mode 100644 index 000000000000..7f624d9aff11 --- /dev/null +++ b/app-emulation/kvm/files/kvm-61-qemu-kvm.patch @@ -0,0 +1,15 @@ +--- kvm-61/qemu/Makefile.target 2008-02-19 06:58:28.000000000 -0800 ++++ kvm-61/qemu/Makefile.target 2008-02-19 18:38:24.000000000 -0800 +@@ -70,11 +70,7 @@ + QEMU_PROG=qemu-$(TARGET_ARCH2) + else + # system emulator name +-ifeq ($(TARGET_ARCH), i386) +-QEMU_PROG=qemu$(EXESUF) +-else +-QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF) +-endif ++QEMU_PROG=kvm$(EXESUF) + endif + + PROGS=$(QEMU_PROG) diff --git a/app-emulation/kvm/files/kvm-68-libkvm-no-kernel.patch b/app-emulation/kvm/files/kvm-68-libkvm-no-kernel.patch new file mode 100644 index 000000000000..e4c81831cc0c --- /dev/null +++ b/app-emulation/kvm/files/kvm-68-libkvm-no-kernel.patch @@ -0,0 +1,14 @@ +diff --exclude-from=/home/dang/.scripts/diffrc -up -ruN kvm-68.orig/libkvm/Makefile kvm-68/libkvm/Makefile +--- kvm-68.orig/libkvm/Makefile 2008-05-02 07:20:13.000000000 -0400 ++++ kvm-68/libkvm/Makefile 2008-05-07 15:25:07.000000000 -0400 +@@ -25,10 +25,6 @@ libkvm.a: libkvm.o $(libkvm-$(ARCH)-objs + + install: + install -D libkvm.h $(DESTDIR)/$(PREFIX)/include/libkvm.h +- install -D $(LIBKVM_KERNELDIR)/include/linux/kvm.h \ +- $(DESTDIR)/$(PREFIX)/include/linux/kvm.h +- install -D $(LIBKVM_KERNELDIR)/include/linux/kvm_para.h \ +- $(DESTDIR)/$(PREFIX)/include/linux/kvm_para.h + install -D libkvm.a $(DESTDIR)/$(PREFIX)/$(LIBDIR)/libkvm.a + + -include .*.d diff --git a/app-emulation/kvm/files/kvm-69-qemu-ifup_ifdown.patch b/app-emulation/kvm/files/kvm-69-qemu-ifup_ifdown.patch new file mode 100644 index 000000000000..08451900c4d8 --- /dev/null +++ b/app-emulation/kvm/files/kvm-69-qemu-ifup_ifdown.patch @@ -0,0 +1,52 @@ +diff -Naur kvm-69.orig/scripts/qemu-ifdown kvm-69/scripts/qemu-ifdown +--- kvm-69.orig/scripts/qemu-ifdown 1970-01-01 01:00:00.000000000 +0100 ++++ kvm-69/scripts/qemu-ifdown 2008-06-03 09:46:53.000000000 +0200 +@@ -0,0 +1,20 @@ ++#!/bin/sh ++ ++if [ -x /sbin/brctl ]; then ++ BRCTL="/sbin/brctl" ++elif [ -x /usr/sbin/brctl ]; then ++ BRCTL="/usr/sbin/brctl" ++else ++ echo "no bridge utils installed" ++ exit 1 ++fi ++ ++if [ -x /sbin/ip ]; then ++ switch=$(/sbin/ip route list | awk '/^default / { sub(/.* dev /, ""); print $1 }') ++ ${BRCTL} delif ${switch} $1 ++ /sbin/ip link set $1 down ++else ++ switch=$(/bin/netstat -rn | awk '/^0\.0\.0\.0/ { print $NF }') ++ ${BRCTL} delif ${switch} $1 ++ /sbin/ifconfig $1 down ++fi +diff -Naur kvm-69.orig/scripts/qemu-ifup kvm-69/scripts/qemu-ifup +--- kvm-69.orig/scripts/qemu-ifup 2008-06-03 09:42:05.000000000 +0200 ++++ kvm-69/scripts/qemu-ifup 2008-06-03 09:44:30.000000000 +0200 +@@ -1,5 +1,21 @@ + #!/bin/sh + +-switch=$(/sbin/ip route list | awk '/^default / { print $NF }') +-/sbin/ifconfig $1 0.0.0.0 up +-/usr/sbin/brctl addif ${switch} $1 ++if [ -x /sbin/brctl ]; then ++ BRCTL="/sbin/brctl" ++elif [ -x /usr/sbin/brctl ]; then ++ BRCTL="/usr/sbin/brctl" ++else ++ echo "no bridge utils installed" ++ exit 1 ++fi ++ ++if [ -x /sbin/ip ]; then ++ switch=$(/sbin/ip route list | awk '/^default / { sub(/.* dev /, ""); print $1 }') ++ /sbin/ip link set $1 up ++else ++ switch=$(/bin/netstat -rn | awk '/^0\.0\.0\.0/ { print $NF }') ++ /sbin/ifconfig $1 0.0.0.0 up ++fi ++ ++${BRCTL} addif ${switch} $1 ++ diff --git a/app-emulation/kvm/files/kvm-69-qemu-no-blobs.patch b/app-emulation/kvm/files/kvm-69-qemu-no-blobs.patch new file mode 100644 index 000000000000..b45bdd85712a --- /dev/null +++ b/app-emulation/kvm/files/kvm-69-qemu-no-blobs.patch @@ -0,0 +1,67 @@ +diff --exclude-from=/home/dang/.scripts/diffrc -up -ruN kvm-69.orig/qemu/Makefile kvm-69/qemu/Makefile +--- kvm-69.orig/qemu/Makefile 2008-05-12 07:30:43.000000000 -0400 ++++ kvm-69/qemu/Makefile 2008-05-21 09:59:59.000000000 -0400 +@@ -199,8 +199,8 @@ ifneq ($(TOOLS),) + $(INSTALL) -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)" + endif + mkdir -p "$(DESTDIR)$(datadir)" +- set -e; for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \ +- video.x openbios-sparc32 openbios-sparc64 pxe-ne2k_pci.bin \ ++ set -e; for x in bios.bin vgabios.bin vgabios-cirrus.bin \ ++ pxe-ne2k_pci.bin \ + pxe-rtl8139.bin pxe-pcnet.bin pxe-e1000.bin extboot.bin \ + bamboo.dtb; \ + do \ +@@ -301,10 +301,6 @@ tarbin: + $(datadir)/bios.bin \ + $(datadir)/vgabios.bin \ + $(datadir)/vgabios-cirrus.bin \ +- $(datadir)/ppc_rom.bin \ +- $(datadir)/video.x \ +- $(datadir)/openbios-sparc32 \ +- $(datadir)/openbios-sparc64 \ + $(datadir)/pxe-ne2k_pci.bin \ + $(datadir)/pxe-rtl8139.bin \ + $(datadir)/pxe-pcnet.bin \ +diff --exclude-from=/home/dang/.scripts/diffrc -up -ruN kvm-69.orig/qemu/pc-bios/README kvm-69/qemu/pc-bios/README +--- kvm-69.orig/qemu/pc-bios/README 2008-05-12 07:30:43.000000000 -0400 ++++ kvm-69/qemu/pc-bios/README 2008-05-21 09:59:34.000000000 -0400 +@@ -1,24 +1,19 @@ +-- The PC BIOS comes from the Bochs project +- (http://bochs.sourceforge.net/). A patch from bios.diff was applied. ++- The PC BIOS comes from the Bochs project (http://bochs.sourceforge.net/) ++ The bios.bin binary is provided for convenience. If you want to rebuild ++ it from source refer to the top level bios directory in the source package. + +-- The VGA BIOS and the Cirrus VGA BIOS come from the LGPL VGA bios +- project (http://www.nongnu.org/vgabios/). ++- The VGA BIOS and the Cirrus VGA BIOS come from the LGPL VGA bios project ++ (http://www.nongnu.org/vgabios/). The vgabios.bin and vgabios-cirrus.bin ++ binaries are provided for convenience. If you want to rebuild them from ++ source refer to the top level vgabios directory in the source package. + +-- The PowerPC Open Hack'Ware Open Firmware Compatible BIOS is +- available at http://perso.magic.fr/l_indien/OpenHackWare/index.htm. ++- The PXE roms come from Rom-o-Matic etherboot 5.4.2 (http://rom-o-matic.net/) + +-- video.x is a PowerMac NDRV compatible driver for a VGA frame +- buffer. It comes from the Mac-on-Linux project +- (http://www.maconlinux.org/). ++ pcnet32:pcnet32 -- [0x1022,0x2000] ++ ns8390:winbond940 -- [0x1050,0x0940] ++ rtl8139:rtl8139 -- [0x10ec,0x8139] + +-- OpenBIOS (http://www.openbios.org/) is a free (GPL v2) portable +- firmware implementation. The goal is to implement a 100% IEEE +- 1275-1994 (referred to as Open Firmware) compliant firmware. +- The included Sparc32 image is built from SVN revision 185 +- and Sparc64 from SVN revision 181. ++ For the source code go to the etherboot 5.4 git tree in : ++ ++ http://git.etherboot.org/?p=etherboot.git + +-- The PXE roms come from Rom-o-Matic etherboot 5.4.2. +- pcnet32:pcnet32 -- [0x1022,0x2000] +- ns8390:winbond940 -- [0x1050,0x0940] +- rtl8139:rtl8139 -- [0x10ec,0x8139] +- http://rom-o-matic.net/ diff --git a/app-emulation/kvm/files/kvm-70-qemu-kvm-doc.patch b/app-emulation/kvm/files/kvm-70-qemu-kvm-doc.patch new file mode 100644 index 000000000000..b6a1d2125492 --- /dev/null +++ b/app-emulation/kvm/files/kvm-70-qemu-kvm-doc.patch @@ -0,0 +1,339 @@ +diff --exclude-from=/home/dang/.scripts/diffrc -up -ruN kvm-70.orig/qemu/qemu-doc.texi kvm-70/qemu/qemu-doc.texi +--- kvm-70.orig/qemu/qemu-doc.texi 2008-06-16 14:25:16.000000000 -0400 ++++ kvm-70/qemu/qemu-doc.texi 2008-06-17 09:29:57.000000000 -0400 +@@ -199,7 +199,7 @@ by Tibor "TS" Schütz. + Download and uncompress the linux image (@file{linux.img}) and type: + + @example +-qemu linux.img ++kvm linux.img + @end example + + Linux should boot and give you a prompt. +@@ -209,7 +209,7 @@ Linux should boot and give you a prompt. + + @example + @c man begin SYNOPSIS +-usage: qemu [options] [@var{disk_image}] ++usage: kvm [options] [@var{disk_image}] + @c man end + @end example + +@@ -273,53 +273,53 @@ an untrusted format header. + + Instead of @option{-cdrom} you can use: + @example +-qemu -drive file=file,index=2,media=cdrom ++kvm -drive file=file,index=2,media=cdrom + @end example + + Instead of @option{-hda}, @option{-hdb}, @option{-hdc}, @option{-hdd}, you can + use: + @example +-qemu -drive file=file,index=0,media=disk +-qemu -drive file=file,index=1,media=disk +-qemu -drive file=file,index=2,media=disk +-qemu -drive file=file,index=3,media=disk ++kvm -drive file=file,index=0,media=disk ++kvm -drive file=file,index=1,media=disk ++kvm -drive file=file,index=2,media=disk ++kvm -drive file=file,index=3,media=disk + @end example + + You can connect a CDROM to the slave of ide0: + @example +-qemu -drive file=file,if=ide,index=1,media=cdrom ++kvm -drive file=file,if=ide,index=1,media=cdrom + @end example + + If you don't specify the "file=" argument, you define an empty drive: + @example +-qemu -drive if=ide,index=1,media=cdrom ++kvm -drive if=ide,index=1,media=cdrom + @end example + + You can connect a SCSI disk with unit ID 6 on the bus #0: + @example +-qemu -drive file=file,if=scsi,bus=0,unit=6 ++kvm -drive file=file,if=scsi,bus=0,unit=6 + @end example + + To boot from a SCSI disk, one would use: + + @example +-qemu -drive file=file,if=scsi,boot=on ++kvm -drive file=file,if=scsi,boot=on + @end example + + Instead of @option{-fda}, @option{-fdb}, you can use: + @example +-qemu -drive file=file,index=0,if=floppy +-qemu -drive file=file,index=1,if=floppy ++kvm -drive file=file,index=0,if=floppy ++kvm -drive file=file,index=1,if=floppy + @end example + + By default, @var{interface} is "ide" and @var{index} is automatically + incremented: + @example +-qemu -drive file=a -drive file=b" ++kvm -drive file=a -drive file=b" + @end example + is interpreted like: + @example +-qemu -hda a -hdb b ++kvm -hda a -hdb b + @end example + + @item -boot [a|c|d|n] +@@ -356,11 +356,11 @@ Enable audio and selected sound hardware + available sound hardware. + + @example +-qemu -soundhw sb16,adlib hda +-qemu -soundhw es1370 hda +-qemu -soundhw ac97 hda +-qemu -soundhw all hda +-qemu -soundhw ? ++kvm -soundhw sb16,adlib hda ++kvm -soundhw es1370 hda ++kvm -soundhw ac97 hda ++kvm -soundhw all hda ++kvm -soundhw ? + @end example + + Note that Linux's i810_audio OSS kernel (for AC97) module might +@@ -599,18 +599,18 @@ hostname reported by the builtin DHCP se + @item -net tap[,vlan=@var{n}][,fd=@var{h}][,ifname=@var{name}][,script=@var{file}] + Connect the host TAP network interface @var{name} to VLAN @var{n} and + use the network script @var{file} to configure it. The default +-network script is @file{/etc/qemu-ifup}. Use @option{script=no} to ++network script is @file{/etc/kvm/qemu-ifup}. Use @option{script=no} to + disable script execution. If @var{name} is not + provided, the OS automatically provides one. @option{fd}=@var{h} can be + used to specify the handle of an already opened host TAP interface. Example: + + @example +-qemu linux.img -net nic -net tap ++kvm linux.img -net nic -net tap + @end example + + More complicated example (two NICs, each one connected to a TAP device) + @example +-qemu linux.img -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 \ ++kvm linux.img -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 \ + -net nic,vlan=1 -net tap,vlan=1,ifname=tap1 + @end example + +@@ -627,11 +627,11 @@ specifies an already opened TCP socket. + Example: + @example + # launch a first QEMU instance +-qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \ ++kvm linux.img -net nic,macaddr=52:54:00:12:34:56 \ + -net socket,listen=:1234 + # connect the VLAN 0 of this instance to the VLAN 0 + # of the first instance +-qemu linux.img -net nic,macaddr=52:54:00:12:34:57 \ ++kvm linux.img -net nic,macaddr=52:54:00:12:34:57 \ + -net socket,connect=127.0.0.1:1234 + @end example + +@@ -655,13 +655,13 @@ Use @option{fd=h} to specify an already + Example: + @example + # launch one QEMU instance +-qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \ ++kvm linux.img -net nic,macaddr=52:54:00:12:34:56 \ + -net socket,mcast=230.0.0.1:1234 + # launch another QEMU instance on same "bus" +-qemu linux.img -net nic,macaddr=52:54:00:12:34:57 \ ++kvm linux.img -net nic,macaddr=52:54:00:12:34:57 \ + -net socket,mcast=230.0.0.1:1234 + # launch yet another QEMU instance on same "bus" +-qemu linux.img -net nic,macaddr=52:54:00:12:34:58 \ ++kvm linux.img -net nic,macaddr=52:54:00:12:34:58 \ + -net socket,mcast=230.0.0.1:1234 + @end example + +@@ -669,7 +669,7 @@ Example (User Mode Linux compat.): + @example + # launch QEMU instance (note mcast address selected + # is UML's default) +-qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \ ++kvm linux.img -net nic,macaddr=52:54:00:12:34:56 \ + -net socket,mcast=239.192.168.1:1102 + # launch UML + /path/to/linux ubd0=/path/to/root_fs eth0=mcast +@@ -694,7 +694,7 @@ a guest from a local directory. + + Example (using pxelinux): + @example +-qemu -hda linux.img -boot n -tftp /path/to/tftp/files -bootp /pxelinux.0 ++kvm -hda linux.img -boot n -tftp /path/to/tftp/files -bootp /pxelinux.0 + @end example + + @item -smb @var{dir} +@@ -728,7 +728,7 @@ screen 0, use the following: + + @example + # on the host +-qemu -redir tcp:6001::6000 [...] ++kvm -redir tcp:6001::6000 [...] + # this host xterm should open in the guest X11 server + xterm -display :1 + @end example +@@ -738,7 +738,7 @@ the guest, use the following: + + @example + # on the host +-qemu -redir tcp:5555::23 [...] ++kvm -redir tcp:5555::23 [...] + telnet localhost 5555 + @end example + +@@ -815,19 +815,19 @@ they default to @code{0.0.0.0}. + When not using a specified @var{src_port} a random port is automatically chosen. + + If you just want a simple readonly console you can use @code{netcat} or +-@code{nc}, by starting qemu with: @code{-serial udp::4555} and nc as: +-@code{nc -u -l -p 4555}. Any time qemu writes something to that port it ++@code{nc}, by starting kvm with: @code{-serial udp::4555} and nc as: ++@code{nc -u -l -p 4555}. Any time kvm writes something to that port it + will appear in the netconsole session. + + If you plan to send characters back via netconsole or you want to stop +-and start qemu a lot of times, you should have qemu use the same ++and start kvm a lot of times, you should have kvm use the same + source port each time by using something like @code{-serial +-udp::4555@@:4556} to qemu. Another approach is to use a patched ++udp::4555@@:4556} to kvm. Another approach is to use a patched + version of netcat which can listen to a TCP port and send and receive + characters via udp. If you have a patched version of netcat which + activates telnet remote echo and single char transfer, then you can + use the following options to step up a netcat redirector to allow +-telnet on port 5555 to access the qemu port. ++telnet on port 5555 to access the kvm port. + @table @code + @item Qemu Options: + -serial udp::4555@@:4556 +@@ -1461,7 +1461,7 @@ QEMU can automatically create a virtual + directory tree. In order to use it, just type: + + @example +-qemu linux.img -hdb fat:/my_directory ++kvm linux.img -hdb fat:/my_directory + @end example + + Then you access access to all the files in the @file{/my_directory} +@@ -1471,14 +1471,14 @@ them via SAMBA or NFS. The default acces + Floppies can be emulated with the @code{:floppy:} option: + + @example +-qemu linux.img -fda fat:floppy:/my_directory ++kvm linux.img -fda fat:floppy:/my_directory + @end example + + A read/write support is available for testing (beta stage) with the + @code{:rw:} option: + + @example +-qemu linux.img -fda fat:floppy:rw:/my_directory ++kvm linux.img -fda fat:floppy:rw:/my_directory + @end example + + What you should @emph{never} do: +@@ -1516,7 +1516,7 @@ can then configure it as if it was a rea + @subsubsection Linux host + + As an example, you can download the @file{linux-test-xxx.tar.gz} +-archive and copy the script @file{qemu-ifup} in @file{/etc} and ++archive and copy the script @file{qemu-ifup} in @file{/etc/kvm} and + configure properly @code{sudo} so that the command @code{ifconfig} + contained in @file{qemu-ifup} can be executed as root. You must verify + that your host kernel supports the TAP network interfaces: the +@@ -1584,7 +1584,7 @@ kernel testing. + + The syntax is: + @example +-qemu -kernel arch/i386/boot/bzImage -hda root-2.4.20.img -append "root=/dev/hda" ++kvm -kernel arch/i386/boot/bzImage -hda root-2.4.20.img -append "root=/dev/hda" + @end example + + Use @option{-kernel} to provide the Linux kernel image and +@@ -1599,7 +1599,7 @@ If you do not need graphical output, you + the virtual serial port and the QEMU monitor to the console with the + @option{-nographic} option. The typical command line is: + @example +-qemu -kernel arch/i386/boot/bzImage -hda root-2.4.20.img \ ++kvm -kernel arch/i386/boot/bzImage -hda root-2.4.20.img \ + -append "root=/dev/hda console=ttyS0" -nographic + @end example + +@@ -1629,7 +1629,7 @@ or the @code{usb_add} monitor command. + Virtual Mouse. This will override the PS/2 mouse emulation when activated. + @item tablet + Pointer device that uses absolute coordinates (like a touchscreen). +-This means qemu is able to report the mouse position without having ++This means kvm is able to report the mouse position without having + to grab the mouse. Also overrides the PS/2 mouse emulation when activated. + @item disk:@var{file} + Mass storage device based on @var{file} (@pxref{disk_images}) +@@ -1731,7 +1731,7 @@ For this setup it is recommended to rest + socket only. For example + + @example +-qemu [...OPTIONS...] -vnc unix:/home/joebloggs/.qemu-myvm-vnc ++kvm [...OPTIONS...] -vnc unix:/home/joebloggs/.qemu-myvm-vnc + @end example + + This ensures that only users on local box with read/write access to that +@@ -1752,7 +1752,7 @@ option, and then once QEMU is running th + the monitor is used to set the password all clients will be rejected. + + @example +-qemu [...OPTIONS...] -vnc :1,password -monitor stdio ++kvm [...OPTIONS...] -vnc :1,password -monitor stdio + (qemu) change vnc password + Password: ******** + (qemu) +@@ -1769,7 +1769,7 @@ support provides a secure session, but n + client to connect, and provides an encrypted session. + + @example +-qemu [...OPTIONS...] -vnc :1,tls,x509=/etc/pki/qemu -monitor stdio ++kvm [...OPTIONS...] -vnc :1,tls,x509=/etc/pki/qemu -monitor stdio + @end example + + In the above example @code{/etc/pki/qemu} should contain at least three files, +@@ -1787,7 +1787,7 @@ then validate against the CA certificate + in an environment with a private internal certificate authority. + + @example +-qemu [...OPTIONS...] -vnc :1,tls,x509verify=/etc/pki/qemu -monitor stdio ++kvm [...OPTIONS...] -vnc :1,tls,x509verify=/etc/pki/qemu -monitor stdio + @end example + + +@@ -1798,7 +1798,7 @@ Finally, the previous method can be comb + to provide two layers of authentication for clients. + + @example +-qemu [...OPTIONS...] -vnc :1,password,tls,x509verify=/etc/pki/qemu -monitor stdio ++kvm [...OPTIONS...] -vnc :1,password,tls,x509verify=/etc/pki/qemu -monitor stdio + (qemu) change vnc password + Password: ******** + (qemu) +@@ -1921,10 +1921,10 @@ copied to the client for which they were + QEMU has a primitive support to work with gdb, so that you can do + 'Ctrl-C' while the virtual machine is running and inspect its state. + +-In order to use gdb, launch qemu with the '-s' option. It will wait for a ++In order to use gdb, launch kvm with the '-s' option. It will wait for a + gdb connection: + @example +-> qemu -s -kernel arch/i386/boot/bzImage -hda root-2.4.20.img \ ++> kvm -s -kernel arch/i386/boot/bzImage -hda root-2.4.20.img \ + -append "root=/dev/hda" + Connected to host network interface: tun0 + Waiting gdb connection on port 1234 diff --git a/app-emulation/kvm/kvm-70.ebuild b/app-emulation/kvm/kvm-70.ebuild new file mode 100644 index 000000000000..26f175a8473e --- /dev/null +++ b/app-emulation/kvm/kvm-70.ebuild @@ -0,0 +1,178 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/kvm/kvm-70.ebuild,v 1.1 2008/07/09 00:21:56 dang Exp $ + +inherit eutils flag-o-matic toolchain-funcs linux-mod + +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +DESCRIPTION="Kernel-based Virtual Machine userland tools" +HOMEPAGE="http://kvm.qumranet.com/kvmwiki" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86" +IUSE="alsa bios esd gnutls havekernel ncurses sdl test" +RESTRICT="mirror test" + +RDEPEND="sys-libs/zlib + alsa? ( >=media-libs/alsa-lib-1.0.13 ) + esd? ( media-sound/esound ) + gnutls? ( net-libs/gnutls ) + ncurses? ( sys-libs/ncurses ) + sdl? ( >=media-libs/libsdl-1.2.11 )" + +DEPEND="${RDEPEND} + bios? ( + sys-devel/dev86 + dev-lang/perl + sys-power/iasl + ) + gnutls? ( dev-util/pkgconfig ) + app-text/texi2html" + +QA_TEXTRELS="usr/bin/kvm" + +pkg_setup() { + # check kernel version + if use havekernel ; then + ewarn "You have the 'havekernel' use flag set. This means you" + ewarn "must ensure you have a compatible kernel on your own." + elif kernel_is lt 2 6 22; then + eerror "the kvm in your kernel requires an older version of" + eerror "kvm as shown in :" + eerror " http://kvm.qumranet.com/kvmwiki/Downloads" + die "kvm version not compatible" + fi + + # check for kvm support + if use havekernel ; then + ewarn "You have the 'havekernel' use flag set. This means you" + ewarn "must ensure your kernel has KVM support enable on your own" + elif ! linux_chkconfig_present KVM; then + eerror "Please enable KVM support in your kernel, found at:" + eerror + eerror " Virtualization" + eerror " Kernel-based Virtual Machine (KVM) support" + die "KVM support not detected!" + fi + + enewgroup kvm +} + +src_unpack() { + unpack ${A} + + cd "${S}" + # prevent docs to get automatically installed + sed -i '/$(DESTDIR)$(docdir)/d' qemu/Makefile + # Alter target makefiles to accept CFLAGS set via flag-o + sed -i 's/^\(C\|OP_C\|HELPER_C\)FLAGS=/\1FLAGS+=/' \ + qemu/Makefile qemu/Makefile.target + [[ -x /sbin/paxctl ]] && \ + sed -i 's/^VL_LDFLAGS=$/VL_LDFLAGS=-Wl,-z,execheap/' \ + qemu/Makefile.target + # avoid strip + sed -i 's/$(INSTALL) -m 755 -s/$(INSTALL) -m 755/' qemu/Makefile + + epatch \ + "${FILESDIR}"/kvm-45-qemu-configure.patch \ + "${FILESDIR}"/kvm-61-qemu-kvm.patch \ + "${FILESDIR}"/kvm-57-qemu-kvm-cmdline.patch \ + "${FILESDIR}"/kvm-48-kvm.patch \ + "${FILESDIR}"/kvm-57-kernel-longmode.patch \ + "${FILESDIR}"/kvm-68-libkvm-no-kernel.patch \ + "${FILESDIR}"/kvm-69-qemu-no-blobs.patch \ + "${FILESDIR}"/kvm-69-qemu-ifup_ifdown.patch \ + "${FILESDIR}"/kvm-70-qemu-kvm-doc.patch +} + +src_compile() { + local mycc conf_opts + + use alsa && conf_opts="$conf_opts --enable-alsa" + use esd && conf_opts="$conf_opts --enable-esd" + use gnutls || conf_opts="$conf_opts --disable-vnc-tls" + use ncurses || conf_opts="$conf_opts --disable-curses" + use sdl || conf_opts="$conf_opts --disable-gfx-check --disable-sdl" + conf_opts="$conf_opts --disable-gcc-check" + conf_opts="$conf_opts --prefix=/usr" + + ./configure ${conf_opts} || die "econf failed" + + emake libkvm || die "emake libkvm failed" + + if use test; then + emake user || die "emake user failed" + fi + + mycc=$(cat qemu/config-host.mak | egrep "^CC=" | cut -d "=" -f 2) + + filter-flags -fpie -fstack-protector + + # If using gentoo's compiler set the SPEC to non-hardened + if [ ! -z ${GCC_SPECS} -a -f ${GCC_SPECS} ]; then + local myccver=$(${mycc} -dumpversion) + local gccver=$($(tc-getBUILD_CC) -dumpversion) + + #Is this a SPEC for the right compiler version? + myspec="${GCC_SPECS/${gccver}/${myccver}}" + if [ "${myspec}" == "${GCC_SPECS}" ]; then + shopt -s extglob + GCC_SPECS="${GCC_SPECS/%hardened*specs/vanilla.specs}" + shopt -u extglob + else + unset GCC_SPECS + fi + fi + + if use bios; then + emake bios || die "emake bios failed" + emake vgabios || die "emake vgabios failed" + fi + + emake qemu || die "emake qemu failed" +} + +src_install() { + # kcmd so we don't install kernel modules which weren't build + emake DESTDIR="${D}" kcmd='#' install || die "make install failed" + + exeinto /usr/bin/ + doexe "${S}/kvm_stat" + + mv "${D}"/usr/share/man/man1/qemu.1 "${D}"/usr/share/man/man1/kvm.1 + mv "${D}"/usr/share/man/man1/qemu-img.1 "${D}"/usr/share/man/man1/kvm-img.1 + mv "${D}"/usr/bin/qemu-img "${D}"/usr/bin/kvm-img + + insinto /etc/udev/rules.d/ + doins scripts/65-kvm.rules + + insinto /etc/kvm/ + insopts -m0755 + newins scripts/qemu-ifup kvm-ifup + newins scripts/qemu-ifdown kvm-ifdown + + dodoc qemu/pc-bios/README + newdoc qemu/qemu-doc.html kvm-doc.html + newdoc qemu/qemu-tech.html kvm-tech.html +} + +pkg_postinst() { + elog "If you don't have kvm compiled into the kernel, make sure you have" + elog "the kernel module loaded before running kvm. The easiest way to" + elog "ensure that the kernel module is loaded is to load it on boot." + elog "For AMD CPUs the module is called 'kvm-amd'" + elog "For Intel CPUs the module is called 'kvm-intel'" + elog "Please review /etc/conf.d/modules for how to load these" + elog + elog "Make sure your user is in the 'kvm' group" + elog "Just run 'gpasswd -a <USER> kvm', then have <USER> re-login." + elog + elog "You will need the Universal TUN/TAP driver compiled into your" + elog "kernel or loaded as a module to use the virtual network device" + elog "if using -net tap. You will also need support for 802.1d" + elog "Ethernet Bridging and a configured bridge if using the provided" + elog "qemu-ifup script from /etc/kvm." + echo +} diff --git a/app-emulation/kvm/metadata.xml b/app-emulation/kvm/metadata.xml new file mode 100644 index 000000000000..e77fe14ab037 --- /dev/null +++ b/app-emulation/kvm/metadata.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>virtualization</herd> + <maintainer> + <email>cardoe@gentoo.org</email> + <name>Doug Goldstein</name> + </maintainer> + <maintainer> + <email>dang@gentoo.org</email> + <name>Daniel Gryniewicz</name> + </maintainer> + <longdescription lang="en"> + KVM (for Kernel-based Virtual Machine) is a full virtualization solution + for Linux on x86 hardware containing virtualization extensions (Intel VT + or AMD-V) + </longdescription> +</pkgmetadata> + |