--- kvm-60+dfsg.orig/scripts/qemu-ifup +++ kvm-60+dfsg/scripts/qemu-ifup @@ -1,5 +1,6 @@ #!/bin/sh -switch=$(/sbin/ip route list | awk '/^default / { print $NF }') +switch=$(ip route ls | awk '/^default / { for(i=0;i. + +Index: qemu/vl.c +=================================================================== +--- qemu/vl.c.orig 2007-03-31 20:59:32.000000000 +0300 ++++ qemu/vl.c 2007-03-31 20:59:35.000000000 +0300 +@@ -3269,7 +3269,7 @@ + return -1; + } + memset(&ifr, 0, sizeof(ifr)); +- ifr.ifr_flags = IFF_TAP | IFF_NO_PI; ++ ifr.ifr_flags = IFF_TAP | IFF_NO_PI | IFF_ONE_QUEUE; + if (ifname[0] != '\0') + pstrcpy(ifr.ifr_name, IFNAMSIZ, ifname); + else --- kvm-60+dfsg.orig/debian/patches/from-debian-qemu/62_linux_boot_nasm.patch +++ kvm-60+dfsg/debian/patches/from-debian-qemu/62_linux_boot_nasm.patch @@ -0,0 +1,59 @@ +Taken from Debian's qemu-0.8.2. Buildd fails building kvm on amd64 without this. + +#DPATCHLEVEL=0 +Index: qemu/pc-bios/linux_boot.asm +=================================================================== +--- /dev/null ++++ qemu/pc-bios/linux_boot.asm +@@ -0,0 +1,31 @@ ++; ++; QEMU Boot sector to launch a preloaded Linux kernel ++; Copyright (c) 2004 Fabrice Bellard ++; Copyright (c) 2006 Guillem Jover ++; ++ ++LOAD_SEG equ 0x9000 ++ ++bits 16 ++global _start ++ ++section .text ++ ++_start: ++ cli ++ cld ++ mov ax, LOAD_SEG ++ mov ds, ax ++ mov es, ax ++ mov fs, ax ++ mov gs, ax ++ mov ss, ax ++ mov sp, 0x8ffe ++ jmp LOAD_SEG + 0x20:0 ++ ++ times 510 - ($ - $$) db 0 ++ ++ ; boot sector signature ++ db 0x55 ++ db 0xaa ++ +Index: qemu/pc-bios/Makefile +=================================================================== +--- qemu/pc-bios/Makefile.orig ++++ qemu/pc-bios/Makefile +@@ -5,12 +5,12 @@ + + DEFINES= + +-TARGETS= ++TARGETS+=linux_boot.bin + + all: $(TARGETS) + +-%.o: %.S +- $(CC) $(DEFINES) -c -o $@ $< ++linux_boot.bin: linux_boot.asm ++ nasm -f bin -o $@ $< + + clean: + rm -f $(TARGETS) *.o *~ --- kvm-60+dfsg.orig/debian/patches/06_no_system_linux_kvm_h.patch +++ kvm-60+dfsg/debian/patches/06_no_system_linux_kvm_h.patch @@ -0,0 +1,19 @@ + +Avoid including system header for linux/kvm.h - otherwise we will fail +when the system has older headers than what we're really trying to +compile, for example a Linux 2.6.20 host with 2.6.20 Linux headers +installed would fail. + +Index: libkvm/libkvm.h +=================================================================== +--- libkvm/libkvm.h.orig ++++ libkvm/libkvm.h +@@ -11,7 +11,7 @@ + #define __user /* temporary, until installed via make headers_install */ + #endif + +-#include ++#include "linux/kvm.h" + + #include + --- kvm-60+dfsg.orig/debian/patches/01_use_bios_files_in_usr_share_kvm.patch +++ kvm-60+dfsg/debian/patches/01_use_bios_files_in_usr_share_kvm.patch @@ -0,0 +1,13 @@ +Index: qemu/configure +=================================================================== +--- qemu/configure.orig ++++ qemu/configure +@@ -666,7 +666,7 @@ + prefix="/usr/local" + fi + mansuffix="/share/man" +- datasuffix="/share/qemu" ++ datasuffix="/share/kvm" + docsuffix="/share/doc/qemu" + binsuffix="/bin" + fi --- kvm-60+dfsg.orig/debian/patches/07_change_qemu_docdir.patch +++ kvm-60+dfsg/debian/patches/07_change_qemu_docdir.patch @@ -0,0 +1,13 @@ +Index: trunk/qemu/configure +=================================================================== +--- trunk.orig/qemu/configure ++++ trunk/qemu/configure +@@ -667,7 +667,7 @@ + fi + mansuffix="/share/man" + datasuffix="/share/kvm" +- docsuffix="/share/doc/qemu" ++ docsuffix="/share/doc/kvm" + binsuffix="/bin" + fi + --- kvm-60+dfsg.orig/debian/patches/02_fix_kernel_Makefile.patch +++ kvm-60+dfsg/debian/patches/02_fix_kernel_Makefile.patch @@ -0,0 +1,10 @@ +Index: trunk/kernel/Makefile +=================================================================== +--- trunk.orig/kernel/Makefile 2007-03-31 21:36:36.000000000 +0300 ++++ trunk/kernel/Makefile 2007-03-31 21:36:47.000000000 +0300 +@@ -1,5 +1,3 @@ +-include ../config.mak +- + KVERREL = $(patsubst /lib/modules/%/build,%,$(KERNELDIR)) + + DESTDIR= --- kvm-60+dfsg.orig/debian/patches/04_use_etc_kvm_kvm-ifup.patch +++ kvm-60+dfsg/debian/patches/04_use_etc_kvm_kvm-ifup.patch @@ -0,0 +1,16 @@ + +Use an independent script to control the network at startup. + +Index: qemu/vl.c +=================================================================== +--- qemu/vl.c.orig 2007-12-18 16:57:46.000000000 +0100 ++++ qemu/vl.c 2007-12-18 18:19:13.678727492 +0100 +@@ -136,7 +136,7 @@ + #include "qemu-kvm.h" + #endif + +-#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup" ++#define DEFAULT_NETWORK_SCRIPT "/etc/kvm/kvm-ifup" + #define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown" + #ifdef __sun__ + #define SMBD_COMMAND "/usr/sfw/sbin/smbd" --- kvm-60+dfsg.orig/debian/patches/fix_kernel_api.diff +++ kvm-60+dfsg/debian/patches/fix_kernel_api.diff @@ -0,0 +1,14 @@ +diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c +index 5a1b7d4..179585f 100644 +--- a/qemu/hw/pc.c ++++ b/qemu/hw/pc.c +@@ -865,8 +865,7 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, + if (kvm_allowed) + kvm_cpu_register_physical_memory(0x100000 - isa_bios_size, + isa_bios_size, +- (bios_offset + bios_size - isa_bios_size) +- /* | IO_MEM_ROM */); ++ (bios_offset + bios_size - isa_bios_size) | IO_MEM_ROM); + #endif + + --- kvm-60+dfsg.orig/debian/patches/rtl8139_default.patch +++ kvm-60+dfsg/debian/patches/rtl8139_default.patch @@ -0,0 +1,26 @@ +Index: kvm-59+dfsg/qemu/vl.c +=================================================================== +--- kvm-59+dfsg.orig/qemu/vl.c 2008-01-22 12:19:03.767625433 +0100 ++++ kvm-59+dfsg/qemu/vl.c 2008-01-22 12:19:03.884110443 +0100 +@@ -9242,7 +9242,7 @@ + char buf[1024]; + if (net_boot & (1 << i)) { + if (model == NULL) +- model = "ne2k_pci"; ++ model = "rtl8139"; + snprintf(buf, sizeof(buf), "%s/pxe-%s.bin", bios_dir, model); + if (get_image_size(buf) > 0) { + if (nb_option_roms >= MAX_OPTION_ROMS) { +Index: kvm-59+dfsg/qemu/hw/pc.c +=================================================================== +--- kvm-59+dfsg.orig/qemu/hw/pc.c 2008-01-22 12:19:50.991610395 +0100 ++++ kvm-59+dfsg/qemu/hw/pc.c 2008-01-22 12:20:36.096102300 +0100 +@@ -1004,7 +1004,7 @@ + nd = &nd_table[i]; + if (!nd->model) { + if (pci_enabled) { +- nd->model = "ne2k_pci"; ++ nd->model = "rtl8139"; + } else { + nd->model = "ne2k_isa"; + } --- kvm-60+dfsg.orig/debian/patches/install_linux_boot.patch +++ kvm-60+dfsg/debian/patches/install_linux_boot.patch @@ -0,0 +1,13 @@ +Index: kvm-60+dfsg/qemu/Makefile +=================================================================== +--- kvm-60+dfsg.orig/qemu/Makefile 2008-01-23 10:33:40.940109286 +0100 ++++ kvm-60+dfsg/qemu/Makefile 2008-01-23 10:35:31.706589701 +0100 +@@ -179,7 +179,7 @@ + mkdir -p "$(DESTDIR)$(datadir)" + for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \ + video.x openbios-sparc32 pxe-ne2k_pci.bin \ +- pxe-rtl8139.bin pxe-pcnet.bin extboot.bin; do \ ++ pxe-rtl8139.bin pxe-pcnet.bin extboot.bin linux_boot.bin; do \ + $(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \ + done + ifndef CONFIG_WIN32 --- kvm-60+dfsg.orig/debian/patches/qemu_vnc_ext_key_event.diff +++ kvm-60+dfsg/debian/patches/qemu_vnc_ext_key_event.diff @@ -0,0 +1,115 @@ +This patch adds support for the ExtendedKeyEvent client message. This message +allows a client to send raw scan codes directly to the server. If the client +and server are using the same keymap, then it's unnecessary to use the '-k' +option with QEMU when this extension is supported. + +Index: qemu/vnc.c +=================================================================== +--- qemu/vnc.c.orig 2008-01-20 13:35:04.000000000 +0100 ++++ qemu/vnc.c 2008-01-23 10:35:42.227610482 +0100 +@@ -927,12 +927,8 @@ + kbd_put_keycode(keysym2scancode(vs->kbd_layout, keysym) | 0x80); + } + +-static void do_key_event(VncState *vs, int down, uint32_t sym) ++static void do_key_event(VncState *vs, int down, int keycode, int sym) + { +- int keycode; +- +- keycode = keysym2scancode(vs->kbd_layout, sym & 0xFFFF); +- + /* QEMU console switch */ + switch(keycode) { + case 0x2a: /* Left Shift */ +@@ -1033,9 +1029,24 @@ + + static void key_event(VncState *vs, int down, uint32_t sym) + { ++ int keycode; ++ + if (sym >= 'A' && sym <= 'Z' && is_graphic_console()) + sym = sym - 'A' + 'a'; +- do_key_event(vs, down, sym); ++ ++ keycode = keysym2scancode(vs->kbd_layout, sym & 0xFFFF); ++ do_key_event(vs, down, keycode, sym); ++} ++ ++static void ext_key_event(VncState *vs, int down, ++ uint32_t sym, uint16_t keycode) ++{ ++ /* if the user specifies a keyboard layout, always use it */ ++ if (keyboard_layout) ++ key_event(vs, down, sym); ++ else ++ do_key_event(vs, down, keycode, sym); ++ + } + + static void framebuffer_update_request(VncState *vs, int incremental, +@@ -1065,6 +1076,15 @@ + } + } + ++static void send_ext_key_event_ack(VncState *vs) ++{ ++ vnc_write_u8(vs, 0); ++ vnc_write_u8(vs, 0); ++ vnc_write_u16(vs, 1); ++ vnc_framebuffer_update(vs, 0, 0, vs->ds->width, vs->ds->height, -258); ++ vnc_flush(vs); ++} ++ + static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings) + { + int i; +@@ -1092,6 +1112,9 @@ + case -257: + vs->has_pointer_type_change = 1; + break; ++ case -258: ++ send_ext_key_event_ack(vs); ++ break; + default: + break; + } +@@ -1245,6 +1268,24 @@ + + client_cut_text(vs, read_u32(data, 4), data + 8); + break; ++ case 255: ++ if (len == 1) ++ return 2; ++ ++ switch (read_u8(data, 1)) { ++ case 0: ++ if (len == 2) ++ return 12; ++ ++ ext_key_event(vs, read_u16(data, 2), ++ read_u32(data, 4), read_u32(data, 8)); ++ break; ++ default: ++ printf("Msg: %d\n", read_u16(data, 0)); ++ vnc_client_error(vs); ++ break; ++ } ++ break; + default: + printf("Msg: %d\n", data[0]); + vnc_client_error(vs); +@@ -1955,10 +1996,11 @@ + + vs->ds = ds; + +- if (!keyboard_layout) +- keyboard_layout = "en-us"; ++ if (keyboard_layout) ++ vs->kbd_layout = init_keyboard_layout(keyboard_layout); ++ else ++ vs->kbd_layout = init_keyboard_layout("en-us"); + +- vs->kbd_layout = init_keyboard_layout(keyboard_layout); + if (!vs->kbd_layout) + exit(1); + --- kvm-60+dfsg.orig/debian/patches/series +++ kvm-60+dfsg/debian/patches/series @@ -0,0 +1,10 @@ +01_use_bios_files_in_usr_share_kvm.patch -p0 +02_fix_kernel_Makefile.patch +04_use_etc_kvm_kvm-ifup.patch -p0 +06_no_system_linux_kvm_h.patch -p0 +from-debian-qemu/22_net_tuntap_stall.patch -p0 +from-debian-qemu/62_linux_boot_nasm.patch -p0 +07_change_qemu_docdir.patch +install_linux_boot.patch +qemu_vnc_ext_key_event.diff -p0 +disable_unaccelerated_execution.patch --- kvm-60+dfsg.orig/debian/patches/disable_unaccelerated_execution.patch +++ kvm-60+dfsg/debian/patches/disable_unaccelerated_execution.patch @@ -0,0 +1,15 @@ +Index: kvm-60+dfsg/qemu/vl.c +=================================================================== +--- kvm-60+dfsg.orig/qemu/vl.c 2008-02-20 10:53:27.257527176 +0100 ++++ kvm-60+dfsg/qemu/vl.c 2008-02-20 10:56:09.133526640 +0100 +@@ -9216,6 +9216,10 @@ + } + } + #endif ++ if (!kvm_allowed) { ++ fprintf(stderr, "Ubuntu does not support running KVM without hardware acceleration. Sorry.\n"); ++ exit(1); ++ } + + if (pid_file && qemu_create_pidfile(pid_file) != 0) { + if (daemonize) { --- kvm-60+dfsg.orig/debian/kvm-source.dirs +++ kvm-60+dfsg/debian/kvm-source.dirs @@ -0,0 +1,2 @@ +usr/share/bug +usr/src --- kvm-60+dfsg.orig/debian/README.Debian +++ kvm-60+dfsg/debian/README.Debian @@ -0,0 +1,45 @@ +KVM for Debian +-------------- + +Please see ./README for a description of the kvm software. + +The Debian kvm source package provides two packages, + + 1) kvm, which the provides the userspace daemon + 2) kvm-source, which provides the source for the kernel modules + +Linux 2.6.22 and later include kvm modules which are compatible with this kvm +package. + +If you want to use the current features you need to install the kvm-source +package, build the kernel modules as described below and then install the +newly built modules package. + +Without the kernel modules KVM will be very slow. When KVM is operating at +full speed, the virtual machine window title will say "QEMU/KVM". If +the KVM modules are not installed or the user has no write access to +/dev/kvm, the window title will just say "QEMU" and the virtual PC +will be very slow. + +The kvm-source package can be used in several ways, once it has been +installed: + + - If the module-assistant package is installed, the KVM kernel + modules can be automatically built, packaged and installed + with a single command. Simply become root and run the command: + + # module-assistant auto-install --force kvm + + or just: + + # m-a a-i --force kvm + + - Using the make-kpkg(1) command provided by the kernel-package Debian + package. This will produce a corresponding kvm-modules package for + the Debian kernel-image package that you are using. This is "the Debian + way". See the "modules_image" section of the make-kpkg(1) man page. + + - Changing to the /usr/src/modules/kvm/ directory and building as + the README file instructs using "make; make install". This will build + and install a module specific to the system you are building on and is + not under control of the packaging system. --- kvm-60+dfsg.orig/debian/preinst.modules.in +++ kvm-60+dfsg/debian/preinst.modules.in @@ -0,0 +1,31 @@ +#!/bin/sh + +set -e + +drivers="kvm kvm-intel kvm-amd" +dir=/lib/modules/@KERNEL@/kernel/drivers/kvm + +case "${1}" in + install|upgrade) + for driver in $drivers; do + if [ -e "$dir/$driver.ko" ]; then + dpkg-divert --package kvm-modules-@KERNEL@ --add --rename \ + --divert $dir/$driver.ko.linux \ + $dir/$driver.ko + fi + done + ;; + + abort-upgrade) + + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 --- kvm-60+dfsg.orig/debian/watch +++ kvm-60+dfsg/debian/watch @@ -0,0 +1,3 @@ +version=3 +opts=dversionmangle=s/\+dfsg.*$// \ + http://qa.debian.org/watch/sf.php/kvm/ kvm-(\d*).tar.gz --- kvm-60+dfsg.orig/debian/preinst +++ kvm-60+dfsg/debian/preinst @@ -0,0 +1,63 @@ +#!/bin/sh +# Debian kvm package pre-installation script +# Copyright (C) 2007 Leonard Norrgard, Refactor, Finland +# Licensed under the GNU General Public License, version 2. See the file +# /usr/share/common-licenses/GPL or . + +GROUP=kvm + +# Workaround for bug in addgroup +. /etc/adduser.conf +[ -z "$FIRST_SYSTEM_UID" ] && exit 1 +[ -z "$LAST_SYSTEM_UID" ] && exit 2 + +GID=$(grep ${GROUP} /etc/group >/dev/null && grep ${GROUP} /etc/group | cut -d ':' -f 3) + +if [ -n "$GID" ] \ + && [ "$GID" -lt "$FIRST_SYSTEM_UID" \ + -o "$GID" -gt "$LAST_SYSTEM_UID" ]; then + cat >&2 <&2 "Error: failed to add the group ${GROUP}." + exit 4 + fi +else + echo >&2 "kvm: Using the existing group \"$GROUP\" (gid $GID) for /dev/kvm" +fi + +# Remove a no-longer used conffiles +rm_existing_file() { + CHECK="$1" + FILENAME="$2" + if [ "$CHECK" "$FILENAME" ]; then + rm -f "$FILENAME" + fi +} + +LASTVERSION=28-2 +case "$1" in +install|upgrade) + if dpkg --compare-versions "$2" le "$LASTVERSION"; then + rm_existing_file -e "/etc/udev/kvm.rules" + rm_existing_file -L "/etc/udev/rules.d/z60_kvm.rules" + fi +esac + +#DEBHELPER# + +exit 0 --- kvm-60+dfsg.orig/debian/control.modules.in +++ kvm-60+dfsg/debian/control.modules.in @@ -0,0 +1,20 @@ +Source: kvm +Section: misc +Priority: optional +Maintainer: Baruch Even +Build-Depends: debhelper (>> 4.0.0) +Standards-Version: 3.7.2 + +Package: kvm-modules-_KVERS_ +Architecture: any +Provides: kvm-modules +Description: kvm modules for Linux (kernel _KVERS_). + This package contains the set of loadable kernel modules for the + KVM module that provides Kernel Virtual Machine services. + . + This package contains the compiled kernel modules for _KVERS_ + . + If you have compiled your own kernel, you will most likely need to build + your own kvm-modules. The kvm-source package has been + provided for use with the Debian's module-assistant or kernel-package + utilities to produce a version of kvm-module for your kernel. --- kvm-60+dfsg.orig/debian/kvm.1 +++ kvm-60+dfsg/debian/kvm.1 @@ -0,0 +1,78 @@ +.\" Hey, EMACS: -*- nroff -*- +.TH KVM 1 "2007-01-20" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) + +.SH NAME +kvm \- x86 emulator with CPU VT support + +.SH SYNOPSIS +.B kvm +.RI [ options ] [ disk_image ] +.SH OPTIONS +.TP +.B \-h +Print a summary of all options. +.TP +.B -no-kvm +Disable KVM hardware virtualization. +.TP +All other options +The other options are similar to those of qemu(1). + +.SH DESCRIPTION +.B kvm +is based on qemu and its parameters are the same with the above +additions, please see the qemu(1) manpage for instructions on how to +run the program. + +.SH SETTING UP THE NETWORK +In Debian, kvm uses the configuration script +.I /etc/kvm/kvm-ifup +to initialize the network for the virtual machine on the host side +when starting a virtual machine. The default script sets up a virtual +switch, so the guest appears to be on the same subnet as the host, +which greatly simplifies setting up networking in the guest operating +system. For example, if the IP adress of the host is 192.168.1.1, the +guest could use 192.168.1.2, with a netmask of 255.255.255.0. + +To learn more about setting up the network, please refer to the +following documents: +.TP +.BR "QEMU Documentation" " at" +.I http://qemu.org/user-doc.html +.TP +.BR "Linux Networking-concepts" " at" +.I http://www.netfilter.org/documentation/HOWTO/networking-concepts-HOWTO.html +.TP +.BR "Linux Networking HOWTO" " at" +.I http://tldp.org/HOWTO/NET3-4-HOWTO.html +.TP +.BR "Linux Advanced Routing & Traffic Control HOWTO" " at" +.I http://tldp.org/HOWTO/Adv-Routing-HOWTO/index.html + +.SH FILES +.na +.nf +.BR "/etc/kvm/kvm-ifup" ", called at startup to configure the host-side network" +.BR "/usr/share/kvm/" ", BIOS files are by default loaded from this directory" +.BR "/usr/share/kvm/keymaps" ", keymap files" + +.SH SEE ALSO +.BR "kvm-qemu" "(1), " "qemu-img" "(1)." +.SH AUTHOR +KVM was written by Avi Kivity from Qumranet. +.PP +This manual page was written by Baruch Even and +Leonard Norrgard for the Debian project (but may +be used by others). --- kvm-60+dfsg.orig/debian/postrm.modules.in +++ kvm-60+dfsg/debian/postrm.modules.in @@ -0,0 +1,31 @@ +#!/bin/sh + +set -e + +drivers="kvm kvm-intel kvm-amd" +dir=/lib/modules/@KERNEL@/kernel/drivers/kvm + +case "${1}" in + remove) + for driver in $drivers; do + if [ -e "$dir/$driver.ko.linux" ]; then + dpkg-divert --package kvm-modules-@KERNEL@ --remove --rename \ + --divert $dir/$driver.ko.linux \ + $dir/$driver.ko + fi + done + ;; + + purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 --- kvm-60+dfsg.orig/debian/reportbug-hook.sh +++ kvm-60+dfsg/debian/reportbug-hook.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# +# kvm reportbug script +# + +echo >&3 +echo >&3 + +if which lshal > /dev/null 2>&1; then + echo 'selected information from lshal(1):' >&3 + echo >&3 + lshal | egrep '^ (system\.(vendor|product)|smbios)' >&3 + echo >&3 + echo >&3 +fi + +if [ -r /proc/cpuinfo ]; then + echo /proc/cpuinfo: >&3 + echo >&3 + cat /proc/cpuinfo >&3 + echo >&3 + echo >&3 +fi --- kvm-60+dfsg.orig/debian/kvm.udev +++ kvm-60+dfsg/debian/kvm.udev @@ -0,0 +1 @@ +KERNEL=="kvm", NAME="%k", GROUP="kvm", MODE="0660" --- kvm-60+dfsg.orig/debian/copyright +++ kvm-60+dfsg/debian/copyright @@ -0,0 +1,56 @@ +This package was debianized by Baruch Even on +Tue, 14 Nov 2006 20:49:57 +0200. + +It was downloaded from http://kvm.qumranet.com/ + +The source tarball has been repackaged to remove the elpin vgabios. Use +debian/rules get-orig-source to produce a clean source tarball. + +Upstream Author: Yaniv Kamay + Avi Kivity + +Copyright: Copyright (C) 2006 Qumranet, Inc. + +License: + +KVM Kernel module: + + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + +KVM User code: + + Copyright (C) 2006 Qumranet. + + The files in this directory and its subdirectories are licensed under the + GNU LGPL, version 2. + +QEMU: + + The following points clarify the QEMU licenses: + + 1) The QEMU virtual CPU core library (libqemu.a) and the QEMU PC + system emulator are released under the GNU Lesser General Public + License. + + 2) The Linux user mode QEMU emulator is released under the GNU General + Public License. + + 3) QEMU is a trademark of Fabrice Bellard. + +BIOS files in QEMU: + + bios.bin: Copyright (C) 2002 MandrakeSoft S.A. This file is + licensed under the GNU LGPL, version 2, or (at your option) + any later version. Homepage: http://sourceforge.net/projects/bochs + + vgabios.bin and vgabios-cirrus.bin: (C) 2003 the LGPL VGABios + developers Team. These files are licensed under the GNU LGPL, + version 2, or (at your option) any later version. Homepage: + http://savannah.nongnu.org/projects/vgabios + +The Debian packaging is: + (C) 2006, Baruch Even + (C) 2006, 2007 Leonard Norrgard + (C) 2007 Jan Luebbe +It is licensed under the GPL, see `/usr/share/common-licenses/GPL'. --- kvm-60+dfsg.orig/debian/compat +++ kvm-60+dfsg/debian/compat @@ -0,0 +1 @@ +5 --- kvm-60+dfsg.orig/debian/kvm.dirs +++ kvm-60+dfsg/debian/kvm.dirs @@ -0,0 +1,7 @@ +usr/bin +usr/share/bug +usr/share/kvm +etc/udev +etc/kvm/utils +etc/init.d +usr/share/modass/packages --- kvm-60+dfsg.orig/debian/changelog.upstream +++ kvm-60+dfsg/debian/changelog.upstream @@ -0,0 +1,602 @@ += kvm-55 [4 dec 2007] = + + * remove old hypercall driver (Anthony Liguori) + * disable dirty page logging for main memory (Izik Eidus) + * fix incorrect page count calculation for dirty logging (Izik Eidus) + * improve testsuite 'make clean' (Neo Jia) + * compile fix (Sheng Yang) + * reorganize x86 emulator main switch + * don't bypass mmu on pae cr3 reload if pdptrs changed + * fixes Solaris x86 + * use common defines for EFER (Carlo Marcelo Arenas Belon) + * portability (Xiantao Zhang) + * fix kvm_init() error path (Xiantao Zhang) + * ia64 iosapic support (Xiantao Zhang) + += kvm-54 [27 nov 2007] = + + * fix fpu leak on AMD (Amit Shah) + * (on kvm-53, lazy fpu was disabled, so this just improves performance) + * prefetch instruction bytes when emulating + * implement guest page fault bypass on nonpae + * should speed up some 32-bit guests + * add a bunch of statistics + * avoid unnecessary remote tlb flushes + * improves guest smp scaling + * avoid mmu reloads on guest tlb flushes + * mmu code simplification + * disallow using kvm after fork() + * fix failures while injecting external interrupts in real mode + * fixes Mandrake 9 regression + * fix multiple address- and operand- size override prefix emulation + * infrastructure for using host cpu features on guest (Dan Kenigsberg) + * not used yet by qemu + * cmps instruction emulation (Guillaume Thouvenin) + * allows OpenBSD to boot + * cleanups (Hollis Blanchard) + * fix potential memory leak in real-mode smp (Izik Eidus) + * reduce unnecessary dirtying of pages (Izik Eidus) + * mark guest pages as accessed with the Linux lru (Izik Eidus) + * more portability work (Jerone Young, Xiantao Zhang) + * allow new vmx features even if not using in-kernel apic (Sheng Yang) + * refactor shadow mmu size calculation (Xiantao Zhang) + * improve testsuite + * beginning of x86 emulator unit test + * fix compile warnings (Carlo Marcelo Arenas Belon) + * log module version in dmesg on load + += kvm-53 [20 nov 2007] = + + * testsuite: exit on end of test + * batch mode for kvm_stat script + * compile fixes (Carlo Marcelo Arenas Belon, Joe Perches) + * portability (Jerone Young, Zhang Xiantao) + * disable lazy fpu on AMD (Amit Shah) + * should fix instability on AMD + * will cause performance regression, fix in progress + * x86 emulator: fix 'push r/m' emulation (Amit Shah) + * register use reduction in vmx guest entry + * infrastructure for per-vm stats + * extends existing per-vcpu stats + * add mmu, state switch, emulation statistics + * use copy_{to,from}_user to access guest memory (Izik Eidus) + * simplify access to guest page tables (Izik Eidus) + * fix entry to real mode with segment bases beyond 1MB (Jan Kiszka) + * finally kill last use of cr2 in emulator (Sheng Yang) + += kvm-52 [12 nov 2007] = + + * fix efer reload host crash on T2600 and similar processors + * revert sleepy interrupt injection + * fixes "Fault when IDT_Vectoring" + * atomically inject real-mode interrupts + * wbinvd exiting on newer Intel processors (Eddie Dong) + * fixes real-time issues + * fix call/jmp instruction emulation (Izik Eidus) + * fixes Vista x64 installation + * fix save/restore/migrate with multiple nics + * fix build on i386 uniprocessor w/ no ioapic hosts + * fix smp_call_function_single() emulation on older hosts + * fixes smp guests not booting on RHEL 5 hosts + * make qemu/kvm memory allocation match plain qemu more closely (Izik Eidus) + * fixes issues with large memory guests + * libkvm compile fixes (Carlo Marcelo Arenas Belon, Jerone Young) + + += kvm-51 [7 nov 2007] = + + * fix some x86 emulator one-byte insns (fixes W2K3 installer again) + * fix host hangs with NMI watchdog on AMD + * fix guest SMP on AMD + * fix dirty page tracking when clearing a guest page (Dor Laor) + * more portability work (Hollis Blanchard, Jerone Young) + * fix FlexPriority with guest smp (Sheng Yang) + * improve rpm specfile (Akio Takebe, Avi Kivity) + * fix external module vs portability work (Andrea Arcangeli) + * remove elpin bios due to license violation + * testsuite shutdown pio port + * don't advertise svm on the guest + * fix reset with kernel apic (Markus Rechberger) + += kvm-50 [2 nov 2007] = + + * fix smp_call_function_mask() emulation on preemptible kernels + * move libkvm into own directory (Hollis Blanchard) + * fix save/restore/migrate for new memory slot management (Uri Lublin) + * compile fixes (Uri Lublin, Avi Kivity) + * fix recursive locking on mmap() (Anthony Liguori) + * remove some cr2 dependencies from x86 emulator + * further simplify x86 emulator + * more portability work (Carsten Otte, Hollis Blanchard) + * Intel FlexPriority support (Sheng Yang) + * fix dirty page tracking on aliased pages (Uri Lublin) + += kvm-49 [29 oct 2007] = + + * Fix PIT time-drift-fix (only with -no-kvm-irqchip) (Dan Kenigsberg) + * Fix vnc auth error with clients <= 3.7 protocol (Dan Kenigsberg) + * Don't spin on hlt with interrupts disabled (Dor Laor) + * Fix pxe boot (Izik Eidus) + * Hide the Intel real-mode tss from userspace (Izik Eidus) + * Automatic memory slot management for libkvm (Izik Eidus) + * Fix problem with std-vga and 4GB guests (Izik Eidus) + * External module compat for smp_call_function_mask() (Laurent Vivier) + * More portability work (Jerone Young, Christian Borntraeger, Zhang Xiantao) + * Fix sleep-in-atomic-context during vcpu init + * Fix 'push imm8' emulation (fixes W2K3 installer) + * Intercept invd and wbinvd on AMD + * Reduce emulator dependency on cr2 (mov abs insns) + * Move page fault processing to common code + * Fix rmap memory consumption oops due to increased rmap usage with swap + * Fix potential memory leak with kernel-allocated memslots (Izik Eidus) + * Export memory slot allocation mechanism (Izik Eidus) + * Add kernel-private memslots (Izik Eidus) + * Fix local apic divide-by-zero (Kevin Pedretti) + * Improve local apic timer wraparound handling (Kevin Pedretti) + * Use newly available smp_call_function_mask() (Laurent Vivier) + * Micro-optimize register usage on vmentry/vmexit (Laurent Vivier) + * Cleanups, compilation fixes (Akio Takebe, Anthony Liguori, Avi Kivity) + + += kvm-48 [18 oct 2007] = + + * use precise cpu accounting on ppc and s390 (Christian Borntraeger) + * make guest time accounting actually work (Laurent Vivier) + * fix host memory corruption when setting the guest dirty bit + * allow swapping with older userspace (Anthony Liguori) + * allow custom memory setup using libkvm (Gerd Hoffmann) + + += kvm-47 [18 oct 2007] = + + * Reset fixes (Eddie Dong, Avi Kivity) + * Portability work (Carsten Otte) + * Cleanups (Anthony Liguori, Laurent Vivier) + * Simplify guest pagetable dirty bit management + * Fix nx bit for huge pages + * Fix write access to clean large pages (fixes rmap leak) + * Support for Linux 2.6.16 guests (movnti instruction) (Sheng Yang) + * Simplify apic timer backlog processing + * Move interrupt injection out of critical section + * x86 emulator work (Nitin A Kamble) + * restore freebsd support on AMD (fix smsw and lmsw) (Aurelien Jarno) + * Simplify guest page table walker + * Partial guest swapping (Izik Eidus) + * kvmctl improvements (Anthony Liguori) + * libkvm, qemu compilation against older kernels + * guest time accounting (Laurent Vivier) + * configure improvements (Carlo Marcelo Arenas Belon) + * fix 4GB+ configurations (Izik Eidus) + * cross compilation support (Jerone Young) + += kvm-46 [10 oct 2007] = + + * fix host oops on bad guest ioapic accesses + * handle NMIs before enabling host interrupts + * add general guest memory accessors (Izik Eidus) + * allow user control over shadow cache size (Izik Eidus) + * auto tune shadow cache size with guest memory (Izik Eidus) + * allocate guest memory in userspace instead of in kernel (Izik Eidus) + * code style fixes (Mike Day, Anthony Liguori) + * lapic cleanups (Rusty Russell) + * fix acpi interrupt reporting for FreeBSD + * fix color problems on certain displays + * Red Hat 7.1 support + * vmmouse support (Dan Kenigsberg) + * fix sdl window caption when keyboard is captured (Dan Kenigsberg) + * improve libkvm configure script (Jerone Young) + * improve bios compilation support on x86_64 hosts (Laurent Vivier) + * fix acpi processor reporting for Windows 2000 with the ACPI HAL (Sheng Yang) + += kvm-45 [2 oct 2007] = + + * don't use page->private for guest pages (Izik Eidus) + * x86 emulator cleanups, simplifications, and fixes (Laurent Vivier, Qing He) + * apic round robin delivery mode cleanup (Qing He) + * merge qemu-cvs + * fix compilation on older kernels (Rusty Russell, Avi Kivity) + * reduce tap networking latency + * fix FC6 x86_64 booting with -no-kvm + * fix code dump on exception + += kvm-44 [23 sep 2007] = + * fix smp guest boot + * fix IDE emulation bug with newer guest kernels (S.Çağlar Onur) + * support VMware server as guest (Ryan Harper) + * fix smp race in shadow code (Izik Eidus) + * allow guest page faults to bypass kvm on Intel (performance boost) + += kvm-43 [21 sep 2007] = + + * fix ioapic edge-triggered interrupt handling + += kvm-42 [20 sep 2007] = + + * important host oops fix + * document -no-kvm-irqchip option in qemu help message (Carlo Marcelo Arenas Belon) + * acpi bios: export pci irqs as active high + * avoid redelivery of edge-triggered ioapic interrupts if already in service + * implement ioapic polarity + * fix x86 emulator merge problems (Nitin A Kamble, Laurent Vivier) + * fix x86 repne decoding (fixes OpenBSD boot regression) (Laurent Vivier) + * install kvm_para.h (Gerd Hoffman) + += kvm-41 [19 sep 2007] = + + * refactor hypercall infrastructure for simplicity and better smp support (Anthony Liguori) + * fix ioapic level triggered interrupt redelivers (solves networking stalls) + * reduce efer reloads with 32-bit guests; minor performance improvement + * split x86 emulator decode and execute stages (Laurent Vivier) + * fix pic interrupt delivery (solves time going double speed on x86_64 Linux guests) (Qing He) + * adaptive live migration bandwidth limits (Uri Lublin) + += kvm-40 [16 sep 2007] = + + * fix guest reboot (most scenarios) + * further x86 emulator work (Nitin A Kamble) + * compile fixes for older kernels + * make the external module work again + += kvm-39 [12 sep 2007] = + + * provide div64_64() for older kernels + * improve emulation failure reporting + * more x86 emulator work (push imm8, pushf, call near) (Nitin A Kamble) + * don't use TPR shadow on i386 (Sheng Yang) + += kvm-38 [12 sep 2007] = + + * fix fpu indication for Solaris (Amit Shah) + * Avoid GFP_NOWAIT allocation in mmu + * Fix runtime smp_processor_id() warning in lapic + * Move vcpu loop into subarch independent loop + * Rename kvm_arch_ops to kvm_x86_ops (Christian Ehrhardt) + * Fix missing "genapic" on i386 (Eddie Dong) + * Fix lapic hrtimer migration (Qing He) + * Fix lapic 64-bit division on i386 (Jindrich Makovicka) + * Simplify memory allocation ioctl (Laurent vivier) + * Keep control register shadows in sync (Rusty Russell) + * Retire invlpg (Rusty Russell) + * Expose get_cs_db_l_bits for kvm-lite (Rusty Russell) + * Fix network boot (Anthony Liguori) + * Round up memory in libkvm (Anthony Liguori) + * Fix option ROM loading (Anthony Liguori) + * Revert FACP ACPI change for Vista + * Fix segfault with -no-kvm + * lapic hrtimer external module compatibility (Qing He, Avi Kivity) + * improved (still imprefect) reboot + * better bios smp detection + += kvm-37 [9 sep 2007] = + + * in-kernel lapic, ioapic, and pic (Eddie Dong, Qing He, Sheng Yang, Gregory Haskins, Dor Laor, Avi Kivity) + * split segment reload (vmx microoptimization) (Laurent Vivier) + * fix vga redraw regression (Izik Eidus) + * fix testsuite compilation with older assemblers (H. Peter Anvin) + += kvm-36 [22 aug 2007] = + + * support guests with more than 2GB of RAM on 64-bit hosts (Izik Eidus) + * fix rare host oops on guest context switch + * avoid smp_call_function_single() warning on suspend/resume + * more real mode emulator work (Nitin A Kamble) + * Windows x64 support (Sheng Yang) + * close minor signal handling race + * carry bios in kvm source tree for easier maintenance + * fix -std-vga (Uri Lublin) + * advertise kvm in vnc window title (Matthew Kent) + * fix Windows SMP guests consuming cpu time when idle (Igor Lvovsky) + += kvm-35 [15 aug 2007] = + + * fix kvm refusing to load on Core processors (Glauber de Oliveira Costa) + * improve qemu monitor handling CR/LF sequences (Jim Paris) + * fix compile warning in qemu (Luca Tettamanti) + += kvm-34 [13 aug 2007] = + + * make kvm preemptible + * allow calling sleeping functions in the kvm exit handlers (Shaohua Li) + * this is a first step in getting guest swapping + * fix running kvm on nx-incapable host kernel on nx-capable hardware + * fix more fallback from the x86 emulator writeback changes (Aurelien Jarno, Avi Kivity) + * remove vmx specific code from subarch independent code (Gregory Haskins) + * allocate vcpus as needed (Rusty Russell) + * consolidate x86 emulator guest read/write code (Laurent Vivier) + * cleanup string pio instruction emulation (Laurent Vivier) + * ensure all cpus have the same vmx features (Sheng Yang) + * version string for external module + * disable long mode capability bit on 32-bit kernels + * fix qemu -isapc (Uri Lublin) + * fixes for smp live migration + * this is still raw + * fix unhandled wrmsr MSR_CSTAR on i386 (Luca Tettamanti) + * some migration fixes (Jim Paris) + * the usual cleanups and minor fixes (various but mostly Rusty) + += kvm-33 [23 jul 2007] = + + * fix massive performance regression + += kvm-32 [23 jul 2007] = + + * fix oops with the slub allocator (CONFIG_SLUB) + * fix cmov instruction emulation, trashed by the mmio rmw fix + * fix rare, silent data corruption on writes that cross a page boundary and touch a page table (Aurelien Jarno, Avi Kivity) + * fix race between vm creation and vcpu hotunplug (Rusty Russell) + * fix guest turning on pae with invalid pdptres (Rusty Russell) + * adapt external module to changed kmem_cache_create() api + * allow external module on 2.6.22 i386 nonpae + * fix regression in network throughput caused by guest smp changes (Aurelien Jarno, Avi Kivity) + * live migration updates (Uri Lublin) + * minor cleanups (Nguyen Anh Quynh, Avi Kivity) + += kvm-31 [19 jul 2007] = + + * a few cleanups that somehow evaded kvm-30 (Jeff Dike, Rusty Russell) + * allow the external module to compile on older kernels. + += kvm-30 [19 jul 2007] = + + * minor fixes and cleanups (Jeff Dike, Rusty Russell, Avi Kivity) + * kernel pio string write (Eddie Dong) + * guest smp kernel fixes + * rdmsr and wrmsr real mode emulation + * fix real mode shadow pages aliasing nx large page shadows + * enable guest smp in qemu + * fix external module installer + * revert ide enable changes that caused an I/O regression + += kvm-29 [12 jul 2007] = + + * live migration from 32-bit hosts to 64-bit hosts (Uri Lublin) + * monotonic timestamp counter on Intel + * more real mode support (Nitin A Kamble) + * infrastructure for in-kernel PIC and APIC (Gregory Haskins, Eddie Dong) + * fix read-modify-write to mmio (fixes F7 installer) (Luca Tettamanti) + * fix rebooting a long-running guest + * reliably detect if svm was disabled by bios (Joerg Roedel) + * suspend/resumes fixes (will not work with older kernels) + * fix nx confusion with large pages and real mode + * remove dependency on libuuid + * fix registers access in monitor/gdbstub (Anthony Liguori) + * minor fixes and cleanups (various) + += kvm-28 [10 jun 2007] = + + * fix host oops on guest context switch + * many code cleanups (Nguyen Anh Quynh, others) + * prepare kernel for guest smp + * update libkvm for guest smp + * update testsuite for guest smp + * emulate hlt in real mode (avoids crash when booting from unformatted disk) + * initialize ata ports for Fedora 7 guests (Luca Tettamanti) + += kvm-27 [3 jun 2007] = + + * use slab cache for mmu shadow pages + * make shadow pte updates atomic (for guest smp) + * general mmu cleanups + += kvm-26 [27 may 2007] = + + * implement wbinvd emulation, triggered by Windows Vista + * compile fixes (Markus Rechberger, Avi Kivity) + += kvm-25 [24 may 2007] = + + * massive performance increase (Eddie Dong) + * regenerate bios from latest bochs sources, hopefully fixing a regression with some guests + * some testsuite work (Anthony Lihuori, Eddie Dong, Avi Kivity) + * minor fixes (various) + += kvm-24 [8 may 2007] = + + * fix oops loading kvm-intel module on i386 with highmem + += kvm-23 [7 may 2007] = + + * OpenBSD 4.1 i386 support (Matthew Gregan) + * Fix host and guest crashes on reboot + += kvm-22 [6 may 2007] = + + * Significant performance improvements (Anthony Liguori, Eddie Dong, Qing He, Avi Kivity) + * Fix longstanding bug: time runs at double speed on x86_64 Linux (Qing He) + * Windows Vista 32-bit support (Qing He, Jun Nakajima) + * Support for kvm abi 10 modules + * Minor updates + += kvm-21 [27 apr 2007] = + + * fix regression on Core (not Core 2) processors + * performance improvements (Eddie Dong, Anthony Liguori) + * minor fixes + += kvm-20 [24 apr 2007] = + + * Windows 2000 support + * performance enhancements + * patch against latest kernel tree included in tarball + * fix oops with 32-bit nonpae guests + += kvm-19 [16 apr 2007] = + + * bug fixes + * memory aliasing api + += kvm-18 [26 mar 2007] = + + * merged new userspace API + * revert the optimization which killed some 32-bit Linux guests + * reboot support on Intel hosts (AMD are already supported) + * better timekeeping under load (Uri Lublin) + * other minor fixes and cleanups + += kvm-17 [25 mar 2007] = + + * live migration enhancements (Uri Lublin) + * better/working acpi support + * revert to unhacked qemu bios + * fix some 32-bit nonpae guests (*BSD) + * initial ballooning support + * random fixes + += kvm-16 [7 mar 2007] = + + * bug fixes (including a nasty one on module load) + * use lanana assigned minor device number for /dev/kvm + += kvm-15 [26 feb 2007] = + + * live migration with kvm (Uri Lublin) + * based on Anthony Liguori's qemu patches + * new userspace interface (work in progress) + * the usual random fixes + += kvm-14 [19 feb 2007] = + + * qemu 0.9.0 + * too many goodies to list + * kvm can no longer share qemu's bios on Intel hosts due to real mode trouble. use the supplied bios. + * migration now based on Anthony Liguori's live migration patches (Uri Lublin) + * currently, only non-live migration is supported under kvm + * handle smi on host on AMD hosts (Joerg Roedel) + * random fixes + += kvm-13 [8 feb 2007] = + + * add dirty page tracking in some corner cases for live migration + * fix lockups on nx-challenged hosts + * host suspend/resume + * nobody's testing this, so it's probably broken + * host cpu hotplug support + * beginning of paravirt support (Ingo Molnar) + * guest reboot support (Markus Rechberger, Joerg Roedel) + * pio latency reduction (Anthony Liguori) + * stone age kernel compatibility (Markus Rechberger) + * the usual cleanups and stability fixes + += kvm-12 [23 jan 2007] = + + * More migration work (Uri Lublin) + * savevm/loadvm (and migration) work on AMD (Leonard Norrgard) + * More guest support + * mmu testsuite and fixes + * Windows ACPI install/run support (Dor Laor) + * Fix host reboot on guest reboot on AMD (Joerg Roedel) + += kvm-11 [11 jan 2007] = + + * stabilization fixes + * vmexit profiling (Ingo Molnar; requires Linux 2.6.20+) + += kvm-10 [7 jan 2007] = + + * more hypercall work + * cleanup irq handling + * shadow page table caching + * migration fixes + * stabilization fixes + += kvm-9 [31 dec 2006] = + + * API documentation (James Jacobsson) + * More stabilization fixes (Yoshimi Ichiyanagi, Ingo Molnar, Nguyen Anh Quynh) + * Interactivity improvements (Dor Laor) + += kvm-8 [21 dec 2006] = + + * msr fixes (Michael Riepe) + * more guest support (Michael Riepe) + * random fixes + * fpu state corruption fix on AMD hosts + += kvm-7 [12 dec 2006] = + + * prevent loading arch module on wrong hardware + * fix for macbooks + * other minor fixes + += kvm-6 [11 dec 2006] = + + * AMD 32-bit host support (Anthony Liguori) + * more migration work + * stabilization + * improved performance + * improved guest support on AMD + += kvm-5 [28 nov 2006] = + + * AMD SVM support (x86-64 hosts only) + * Preliminary live migration support + * 'make install' also installs kernel modules, if selected + * random fixes + += kvm-4 [21 nov 2006] = + + * added the msr work + * suspend/resume should work now + * more vmdk compatibility work + * random build updates + += kvm-3 [15 nov 2006] = + +[Avi Kivity retained the natural number versioning after he contemplated the +confusion that can arise from having releases 1, 2, and 0.3] + +Kernel module + * make exit reason numbers explicit + * sync kernel module with -mm tree + * asm constraint fixes + * userspace interface blurb + * segment restore across mode switch (fixes etherboot) + * segment asm constraint fix (Bernhard Rosenkraenzer) + * segment access cleanup + +libkvm: + * better error reporting (Simon Kagstrom) + * 'make clean' + * attributions and license + +kvmctl: + * add option to launch guest in 32-bit mode + * add test programs + +qemu/kvm: + * autodetect kvm presence (Simon Kagstrom) + +General + * fix host arch detection on debian + * fix ./configure on debian (Gildas) + * toplevel 'make clean' + += ?? [9 nov 2006] = + + * much easier to get running, see updated HOWTO + * now just one download, get yours while supplies last + * single qemu binary for kvm and non-kvm runs (Anthony Liguori) + * accompanying external kernel module package has all bugfixes folded in (plus a bit of cosmetics) + += lkml submission v4 [5 nov 2006] = + * [http://lwn.net/Articles/207875/] + * detect msrs on host dynamically. Avoids oopses on non-ia32e capable processors. + * web site: http://kvm.sourceforge.net + * slightly rediffed + += lkml submission v3 [26 oct 2006] = + * [http://uwsg.indiana.edu/hypermail/linux/kernel/0610.3/0747.html] + * mailing list: kvm-devel@public.gmane.org (http://lists.sourceforge.net/lists/listinfo/kvm-devel) + * applied code review comments + * fixed set_sregs() ioctl corrupting guest state if cr0.pe changed (a polite way of saying that loading a saved vm was broken) + += lkml submission v2 [23 oct 2006] = + * [http://lwn.net/Articles/205580/] + * fixed a lockup on i386 with host memory >= 4GB + * finer patch split to conform to vger limits + * minor fixes + * send through script to avoid mailer damage + += lkml submission v1 [19 oct 2006] = + + * [http://lkml.org/lkml/2006/10/19/146] --- kvm-60+dfsg.orig/debian/links +++ kvm-60+dfsg/debian/links @@ -0,0 +1,2 @@ +usr/share/vgabios/vgabios.bin usr/share/kvm/vgabios.bin +usr/share/vgabios/vgabios.cirrus.bin usr/share/kvm/vgabios-cirrus.bin --- kvm-60+dfsg.orig/debian/TODO +++ kvm-60+dfsg/debian/TODO @@ -0,0 +1,17 @@ +- Make the kvm-amd / kvm-intel modules load automatically when the kvm module + is inserted. + +- Fix the /etc/init.d/kvm script (see patch directory) and enable it in rules + This (as it is now) replaces eth0 with a switch sw0. Config questions to be + asked, possibly alternative default network setups supplied etc. + +- Create a kvm-doc package from the texinfo source of the full manual in + qemu/qemu-doc.texi. The kvm upstream for qemu-doc.texi isn't up to date with + the qemu upstream on the manual, though. + +- Create a kvm-dev package from the files that are currently removed in rules + +- Build the 3 etherboot images from source so we can include them here directly, + rather than suggesting the etherboot package. + +- Support for sound --- kvm-60+dfsg.orig/debian/kvm.init +++ kvm-60+dfsg/debian/kvm.init @@ -0,0 +1,69 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: kvm +# Required-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: S 0 1 6 +# Short-Description: KVM init script +# Description: This script loads the kernel modules needed by kvm +### END INIT INFO + +. /lib/lsb/init-functions + +# Figure out which module we need. +if grep -q ^flags.*\\\ /proc/cpuinfo +then + module=kvm_intel +elif grep -q ^flags.*\\\ /proc/cpuinfo +then + module=kvm_amd +else + module= +fi + +case "$1" in + start) + if [ -z "$module" ] + then + log_failure_msg "Your system does not have the CPU extensions required to use KVM. Not doing anything." + exit 0 + fi + if modprobe "$module" + then + log_success_msg "Loading kvm module $module" + else + log_failure_msg "Module $module failed to load" + exit 1 + fi + ;; + stop) + if [ -z "$module" ] + then + exit 0 + fi + if lsmod | grep -q "$module" + then + if rmmod "$module" + then + log_success_msg "Succesfully unloaded kvm module $module" + rmmod kvm + else + log_failure_msg "Failed to remove $module" + exit 1 + fi + else + log_failure_msg "Module $module not loaded" + fi + ;; + force-reload|restart) + $0 stop + $0 start + ;; + *) + echo "Usage: $0 {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: --- kvm-60+dfsg.orig/debian/changelog +++ kvm-60+dfsg/debian/changelog @@ -0,0 +1,448 @@ +kvm (1:60+dfsg-0ubuntu2) hardy; urgency=low + + * Make installs succeed regardless of the init script's exit code. (LP: + #183663) + * Disable non-accelerated execution. + * Fixed up the clean target in debian/rules to properly clean up after + ourselves. + * Dropped build-dependency on gcc-3.4. + + -- Soren Hansen Wed, 20 Feb 2008 17:41:11 +0100 + +kvm (1:60+dfsg-0ubuntu1) hardy; urgency=low + + * New upstream release. + + -- Soren Hansen Wed, 23 Jan 2008 10:38:11 +0100 + +kvm (1:59+dfsg-0ubuntu6) hardy; urgency=low + + * Removed 08_default_tdf.patch. No longer needed. + * Modify init script to not exit with an error when stopping if the module + isn't loaded (LP: #183663). + * Use the correct names for the modules in init script. + + -- Soren Hansen Fri, 18 Jan 2008 19:12:26 +0100 + +kvm (1:59+dfsg-0ubuntu5) hardy; urgency=low + + * Added *updated* patch to support extended key events in qemu's vnc + implementation. + + -- Soren Hansen Sun, 13 Jan 2008 21:13:33 +0100 + +kvm (1:59+dfsg-0ubuntu4) hardy; urgency=low + + * Added patch to support extended key events in qemu's vnc implementation. + * s/log_error_msg/log_failure_msg/ in init script. + * Don't bother calling kvm.init stop/start on upgrade. + + -- Soren Hansen Sun, 13 Jan 2008 20:46:59 +0100 + +kvm (1:59+dfsg-0ubuntu3) hardy; urgency=low + + * Add init script to load kvm modules. (LP: #104297) + * Install linux_boot.bin to enable -kernel option. (LP: #111884) + + -- Soren Hansen Tue, 08 Jan 2008 16:26:05 +0100 + +kvm (1:59+dfsg-0ubuntu2) hardy; urgency=low + + * Cherry pick 6b8bb99a9cde386d72b4b7c22b92f4bdec333dab from git to + probably fix LP: 180105, and certainly fix an issue on Intel hardware + due to incompatible changes to the kernel API. + + -- Soren Hansen Fri, 04 Jan 2008 03:20:57 +0100 + +kvm (1:59+dfsg-0ubuntu1) hardy; urgency=low + + * New upstream release + * Build with alsa support (cherry pick from 57+dfsg-2) + + -- Soren Hansen Thu, 03 Jan 2008 10:39:25 +0100 + +kvm (1:57+dfsg-0ubuntu1) hardy; urgency=low + + * New upstream release. + + -- Soren Hansen Tue, 18 Dec 2007 18:15:54 +0100 + +kvm (1:56+dfsg-0ubuntu1) hardy; urgency=low + + * New upstream version. + * Merge changes from 55+dfsg-2. + + -- Soren Hansen Tue, 18 Dec 2007 09:36:20 +0100 + +kvm (55+dfsg-2) unstable; urgency=low + + * Depend on libgnutls for VNC TLS support + * Build BIOS from kvm sources (kvm and qemu patchs are different, thanks to + Carlo Marcelo Arenas Belon for spotting this) + * Fix debian/rules clean + + -- Jan Luebbe Sat, 08 Dec 2007 19:45:45 +0100 + +kvm (1:55+dfsg-1ubuntu1) hardy; urgency=low + + * Merge with Debian. Remaining changes: + - debian/control: + - Demote kvm-source to Suggests + - Mention kvm-source is unnecessary + - Modify Maintainer value to match the DebianMaintainerField + specification. + - Depend on recent bochsbios-qemu. + - Moved Vcs-* to XS-Original-Vcs-*. + - Don't recommend linux-image-2.6 since Ubuntu is Linux 2.6 only anyway. + - Rename suggestions of linux-{headers,source} to Ubuntu's naming scheme. + - Add pkg-config to Build-Depends (fixes warning during build) + - Add 08_default_tdf.patch to make -tdf the default. + + -- Soren Hansen Mon, 10 Dec 2007 13:43:03 +0100 + +kvm (55+dfsg-1) unstable; urgency=low + + * New upstream release + * Include cpu information also for bugs against kvm-source + * Update upstream changelog + * Remove bios.bin from upstream tarball (closes: #452963) and depend on the + current version of bochsbios + + -- Jan Luebbe Fri, 07 Dec 2007 19:22:57 +0100 + +kvm (54+dfsg-1) unstable; urgency=low + + * New upstream release + * Revive get-orig-source to remove other BIOS files (see #452963). + Thanks Soren Hansen. + * Include upstream changelog from the wiki. + * Update README.Debian and mention the kvm modules distributed with + the Linux kernel (closes: #440790) + + -- Jan Luebbe Thu, 29 Nov 2007 14:40:23 +0000 + +kvm (1:54+dfsg-0ubuntu1) hardy; urgency=low + + * New upstream release. + + -- Soren Hansen Tue, 04 Dec 2007 09:06:33 +0100 + +kvm (53-1) unstable; urgency=low + + * New upstream release + * Upstream has removed the elpin BIOS files, stop repacking the tarball. + + -- Jan Luebbe Wed, 21 Nov 2007 16:53:51 +0100 + +kvm (1:53+dfsg-0ubuntu1) hardy; urgency=low + + * New upstream release + * Properly clean out all the blobs from the tarball in get-orig-source. + * Depend on bochsbios-qemu and vgabios to get the needed blobs from there + instead. + + -- Soren Hansen Mon, 26 Nov 2007 12:09:12 +0100 + +kvm (52+dfsg-1) unstable; urgency=low + + * New upstream release + * Switch to Vcs-Svn and Vcs-Browser in debian/control + + -- Jan Luebbe Thu, 15 Nov 2007 18:47:41 +0100 + +kvm (1:52+dfsg-0ubuntu1) hardy; urgency=low + + * New upstream release. + * 08_default_tdf.patch + - Make -tdf the default and add a -no-tdf option. + + -- Soren Hansen Thu, 15 Nov 2007 02:21:55 +0100 + +kvm (1:48+dfsg-1ubuntu1) hardy; urgency=low + + * Merge from Debian unstable (LP: #161790, LP: #149785). + * Remaining Ubuntu changes: + + Add epoch + + debian/preinst: + - Remove code to delete never-in-Ubuntu conf file + + debian/control: + - Demote kvm-source to Suggests + - Mention kvm-source is unnecessary + - Add epoch to Conflicts + + debian/patches/from-debian-qemu/63_use_dev_bus_usb_not_proc_bus_usb.patch + - USB path /proc/bus/usb => /dev/bus/usb + + debian/rules: + - Call dh_installudev + * New changes: + + debian/control: + - Remove Debian's VCS fields: that's not where the Ubuntu packages are + maintained. + + -- Christopher James Halse Rogers Sat, 10 Nov 2007 17:42:58 +1100 + +kvm (48+dfsg-1) unstable; urgency=low + + * Adopt package with Baruch Even's permission + * New upstream release + + -- Jan Luebbe Thu, 25 Oct 2007 11:15:54 +0200 + +kvm (46+dfsg-0.1) unstable; urgency=low + + * Non-maintainer upload (low threshold nmu) + * New upstream release + * Adapt sf-get-orig-source from gnome-pkg-tools + * Repackage tarball to remove elpin VGA bios (closes: #440472) + * Add debian/watch file + + -- Jan Luebbe Sun, 14 Oct 2007 12:02:54 +0200 + +kvm (36-0.1) unstable; urgency=low + + * Non-maintainer upload (with permission) + * New upstream release (closes: #438412) + * Update patches + * Install documentation from qemu to /usr/share/doc/kvm to avoid conflicts + and refer to it from kvm(1) (closes: #434729) + * Rename conflicting manpages + * Add texi2html as a Build-Dependency + * Make module-assistant a Dependency of kvm-source because it is needed by + it's debian/rules + * debian/conffiles is not necessary for /etc + + -- Jan Luebbe Mon, 27 Aug 2007 18:45:36 +0200 + +kvm (1:28-4ubuntu3) hardy; urgency=low + + * debian/patches/from-debian-qemu/63_use_dev_bus_usb_not_proc_bus_usb.patch: + + Fixes broken USB device access since /proc/bus/usb/devices was replaced by + /dev/bus/usb/devices. (LP #156085) + + -- TJ Mon, 29 Oct 2007 13:00:00 +0000 + +kvm (1:28-4ubuntu2) gutsy; urgency=low + + * debian/rules: + + Call dh_installudev again (LP #127704). We have a slightly different + udev policy to Debian. + * debian/preinst: + + Remove code to delete old kvm.rules file. The file it references was + never in the Ubuntu packages, and we use dh_installudev now. + * debian/control: + + Demote the Recommends on kvm-source to Suggests. kvm works with the + kernel modules we ship, so the kvm-source package doesn't add much. + + -- Christopher James Halse Rogers Sat, 29 Sep 2007 18:53:27 +1000 + +kvm (1:28-4ubuntu1) gutsy; urgency=low + + * Merge from Debian Unstable (LP: #119254, #122113). + * Remaining Ubuntu Changes: + + Add epoch + + debian/control + - Mention that the kvm-source package is unnecessary. + * Add epoch to the Conflicts + + -- Christopher James Halse Rogers (RAOF) Mon, 25 Jun 2007 22:49:27 +1000 + +kvm (28-4) unstable; urgency=low + + * Divert kernel modules when installing the kvm-source modules + (Closes: #429851) + * kvm-ifup, even if bridge command failed continue to work, this will allow + users who have no bridge setup and intend to setup some other method to + get it to work without messing with the package files. (Closes: #407459) + + -- Baruch Even Thu, 21 Jun 2007 12:37:54 +0100 + +kvm (28-3) unstable; urgency=low + + * Fix infinite loop in kvm-ifup script + + -- Baruch Even Mon, 18 Jun 2007 20:51:50 +0100 + +kvm (28-2) unstable; urgency=low + + * We moved a file from kvm-source to kvm, to be able to properly upgrade we + specify a conflict against older versions (Closes: #417652) + * Fix kvm-ifup script to work in more conditions (Closes: #417151) + * Remove old /etc/udev/kvm.rules since it's not needed (Closes: #414331) + + -- Baruch Even Sun, 17 Jun 2007 21:13:07 +0100 + +kvm (28-1) unstable; urgency=low + + * New upstream release (Closes: #422197) + - Should fix oops (Closes: #418928) + * kqemu is no longer in non-free (Closes: #419152) + + -- Baruch Even Sun, 17 Jun 2007 10:32:40 +0100 + +kvm (18-1) unstable; urgency=low + + * New upstream release (Closes: #416926) + * Move the module-assistant script to the kvm package from kvm-source so all + users will benefit from the integration (Closes: #416122) + * Remove patch to add qemu-ifup and kvm initscript, they are now part of kvm directly. + + -- Baruch Even Sat, 31 Mar 2007 21:00:34 +0300 + +kvm (1:16-1ubuntu2) feisty; urgency=low + + * Revert to kvm-16 to match released kernel. + * Add epoch. + + -- Ben Collins Sun, 15 Apr 2007 17:52:01 -0400 + +kvm (16-1ubuntu1) feisty; urgency=low + + * New upstream. + + -- Ben Collins Wed, 14 Mar 2007 00:33:11 -0400 + +kvm (15-1ubuntu1) feisty; urgency=low + + * New upstream. + + -- Ben Collins Thu, 1 Mar 2007 22:15:02 -0500 + +kvm (14-1) unstable; urgency=medium + + [ Leonard Norrgård ] + * New upstream version. KVM is now based on qemu-0.9.0. + * Suggest etherboot and actually suggest hal (was only mentioning it). + * Update copyright info. + * Add a couple of patches from Debian qemu: 22_net_tuntap_stall.patch, + 04_do_not_print_rtc_freq_if_ok.patch, 62_linux_boot_nasm.patch (62_* + currently only to avoid a buildd FTBS problem). + * Reorder the first two paragraphs in the description for kvm so the + general description is first, the more technical second. + * Moved adduser to Pre-Depends, as we rely on it for installation. + * For a detailed changelog, please see: + svn log -v -r 2227:2383 svn://svn.debian.org/svn/collab-maint/ext-maint/kvm/trunk + + [ Baruch Even ] + * Update the uploader name of Leonard so that lintian won't think it's an + NMU. + * Add XS-Vcs-Browser field + + -- Baruch Even Sat, 24 Feb 2007 17:43:42 +0200 + +kvm (13-1) UNRELEASED; urgency=low + + * New upstream version. + + -- Leonard Norrgård Sat, 10 Feb 2007 07:40:59 +0200 + +kvm (12-1) unstable; urgency=high + + * New upstream version. Most important upstream changes: + - Attempting to reboot Linux guest no longer reboots host on AMD, + actual guest reboot still not possible. + - The option -no-acpi is no longer required to install Windows + (the option is still recommended as the Windows ACPI HAL will + eat a lot of cpu time). + + -- Leonard Norrgard Sun, 23 Jan 2007 18:54:17 +0200 + +kvm (11-2) unstable; urgency=low + + [ Baruch Even ] + * Make the quilt include part conditional so we don't have to have it when + building the kernel module. (Closes: #407447, #407482) + * Do not recommend linux-image-2.6 in kvm-source, and move linux-headers-2.6 + from depends to suggests where it belongs. The package can build from + vanilla kernels as well as Debian kernels. (Closes: #407729) + + [ Leonard Norrgard ] + * Enhance manual page a bit. + + -- Baruch Even Sun, 21 Jan 2007 09:05:38 +0200 + +kvm (11-1) unstable; urgency=high + + * New upstream version. Closes #406800, #406275, #404075. + * This version fixes many stability issues in earlier versions of KVM. + * Automatically create group kvm on installation of package kvm + * Added udev support to automatically set group kvm on /dev/kvm + * Added reportbug script (/usr/share/bug/kvm) so some info that + might be relevant gets included automatically. + * Tell module-assistant about the kvm-source package, so it shows up + in the module selection menu. + * Add information on building the modules using module-assistant. + * Add /etc/kvm/kvm-ifup script (conffile) to bring up the network for + the VM in a simpler way, see the manual page for kvm for description. + This used to be /etc/qemu-ifup, as installed by the qemu package. + * Depend on iproute, bridge-utils, used by kvm-ifup and the upcoming + /etc/init.d script. + * Remove non-x86 bios images - KVM is only meaningful for x86 guests. + * Keep KVM bios files in /usr/share/kvm, rather than sharing them with + other packages as the KVM bios is different (also avoids unexpected + bios updates). + * Don't depend on qemu, as we now keep our own bios. + * Recommend kvm-source, qemu (mostly for qemu-img), vde2 and linux-image-2.6. + * Suggest sudo and debootstrap. + * For kvm-source, depend on linux-headers-2.6 | linux-source-2.6, + recommend linux-image-2.6 and suggest module-assistant and + kernel-package. + * Use quilt to handle patches. + * More detailed package description for kvm, added Homepage:. + + -- Leonard Norrgard Sun, 14 Jan 2007 07:11:03 +0200 + +kvm (7-1) unstable; urgency=low + + * New upstream version + * Install the Intel and AMD modules (Closes: 402820) + + -- Baruch Even Wed, 13 Dec 2006 09:19:44 +0200 + +kvm (5-2) unstable; urgency=low + + * Yet another attempt to fix building on amd64. + + -- Baruch Even Wed, 6 Dec 2006 08:35:04 +0200 + +kvm (5-1) unstable; urgency=low + + * New upstream version + * Really fix building on amd64 (Closes: #400549) + + -- Baruch Even Wed, 6 Dec 2006 07:12:30 +0200 + +kvm (4-2) unstable; urgency=low + + * Allow build on amd64 arch, it really should mean Intel x86 64bit arches, + kvm still doesn't support AMD SVM instructions and requires the Intel + CPUs. (Closes: #400549) + + -- Baruch Even Tue, 28 Nov 2006 22:16:08 +0200 + +kvm (4-1) unstable; urgency=low + + * New upstream version. + + -- Baruch Even Tue, 21 Nov 2006 22:23:26 +0200 + +kvm (3-2) unstable; urgency=low + + * Use KERNEL_DIR variable when building the module to enable building a + module for a kernel that is not being run right now. (Closes: #399603) + * Add manpage that refers the user to qemu(1) where he can find all the + information he needs. + + -- Baruch Even Tue, 21 Nov 2006 09:22:57 +0200 + +kvm (3-1) unstable; urgency=low + + * New upstream version. + * Use upstream versioning of natural numbers. + * First upload to Debian (Closes: #398458) + + -- Baruch Even Wed, 15 Nov 2006 23:58:12 +0200 + +kvm (0.0.2-1) unstable; urgency=low + + * Initial release + + -- Baruch Even Tue, 14 Nov 2006 20:49:57 +0200 --- kvm-60+dfsg.orig/debian/control +++ kvm-60+dfsg/debian/control @@ -0,0 +1,73 @@ +Source: kvm +Section: misc +Priority: optional +Maintainer: Ubuntu MOTU Developers +XSBC-Original-Maintainer: Jan Luebbe +Build-Depends: debhelper (>= 5), pkg-config, quilt (>= 0.40), autotools-dev, + bzip2, uuid-dev, zlib1g-dev, libsdl1.2-dev, libasound2-dev, libgnutls-dev, + nasm, texi2html, bcc, iasl, sysv-rc (>= 2.86.ds1-14.1ubuntu2) +XS-Original-Vcs-Svn: svn://svn.debian.org/collab-maint/ext-maint/kvm/trunk/ +XS-Original-Vcs-Browser: http://svn.debian.org/wsvn/collab-maint/ext-maint/kvm/trunk/ +Standards-Version: 3.7.2 +Homepage: http://kvm.qumranet.com/ + +Package: kvm +Architecture: i386 amd64 +Pre-Depends: adduser +Depends: ${shlibs:Depends}, ${misc:Depends}, iproute, bridge-utils, vgabios +Recommends: qemu, vde2 +Suggests: kvm-source, debootstrap, hal, etherboot +Conflicts: kvm-source (<= 18-1) +Description: Full virtualization on x86 hardware + Using KVM, one can run multiple virtual PC:s, each running unmodified Linux or + Windows images. Each virtual machine has private virtualized hardware: a + network card, disk, graphics adapter, etc. + . + KVM (for Kernel-based Virtual Machine) is a full virtualization solution for + Linux hosts on x86 hardware with x86 guests. KVM is intended for systems where + the processor has hardware support for virtualization, see below for details. + All combinations of 32-bit and 64-bit host and guest systems are supported, + except 64-bit guests on 32-bit hosts. + . + For the best performance the processor must support hardware virtualization, + provided by AMD's SVM capability and Intel's VT. To find out if your + processor has the necessary support, do as follows: + . + * Make sure you run Linux 2.6.16 or newer for AMD processors, or + Linux 2.6.15 for Intel processors. Older Linux versions do not report + the virtualization capabilities. + . + * Run this command in a shell: egrep '^flags.*(vmx|svm)' /proc/cpuinfo + . + If it prints anything, the processor provides hardware virtualization + support and is suitable for use with KVM. + . + Without hardware support, KVM falls back to the considerably slower QEMU-based + software virtualization. In this case, it makes more sense to use the qemu + package, possibly with the kqemu package for better performance. + . + The recommended qemu package contains the the qemu-img program needed to create + virtual disk images as well as the script /usr/sbin/qemu-make-debian-root, + which uses debootstrap to build a debian disk image. See the man page + for qemu-make-debian-root. The suggested hal package is only used for + automatically reporting the system bios version and computer model when + reporting bugs. The suggested etherboot package contains Etherboot + ROM images for, among others, the NE2000, PCNET and RTL8139 ethernet cards + emulated (see appendix A. List of supported NICs in the package etherboot-doc). + . + KVM consists of two loadable kernel modules (kvm.ko and kvm-amd.ko or + kvm-intel.ko) and a userspace component. This package contains the userspace + component, while kvm-source provides the module source. + +Package: kvm-source +Architecture: all +Depends: debhelper (>>4.0.0), make, bzip2, module-assistant +Suggests: kernel-package, linux-headers | linux-source +Enhances: kvm +Homepage: http://kvm.qumranet.com/ +Description: Source for the KVM driver + This package provides the source code for the KVM kernel modules. + The kvm package is also required in order to make use of these + modules. Kernel source or headers are required to compile these modules. + . + NOT needed for Ubuntu systems --- kvm-60+dfsg.orig/debian/rules +++ kvm-60+dfsg/debian/rules @@ -0,0 +1,343 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. +# +# This version is for a hypothetical package that can build a kernel modules +# architecture-dependant package via make-kpkg, as well as an +# architecture-independent module source package, and other packages +# either dep/indep for things like common files or userspace components +# needed for the kernel modules. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +ifeq (i386,$(shell dpkg-architecture -qDEB_BUILD_ARCH)) + BUILD_CPU = i386 + QEMU_EXE = qemu-system-x86_64 +else + BUILD_CPU = x86_64 + QEMU_EXE = qemu-system-x86_64 +endif + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +# some default definitions, important! +# +# Name of the source package +psource:=kvm-source + +# The short upstream name, used for the module source directory +sname:=kvm + +### KERNEL SETUP +### Setup the stuff needed for making kernel module packages +### taken from /usr/share/kernel-package/sample.module.rules + +# prefix of the target package name +PACKAGE=kvm-modules +# modifieable for experiments or debugging m-a +MA_DIR ?= /usr/share/modass +# load generic variable handling +-include $(MA_DIR)/include/generic.make +# load default rules, including kdist, kdist_image, ... +-include $(MA_DIR)/include/common-rules.make + +# module assistant calculates all needed things for us and sets +# following variables: +# KSRC (kernel source directory), KVERS (kernel version string), KDREV +# (revision of the Debian kernel-image package), CC (the correct +# compiler), VERSION (the final package version string), PKGNAME (full +# package name with KVERS included), DEB_DESTDIR (path to store DEBs) + +# The kdist_configure target is called by make-kpkg modules_config and +# by kdist* rules by dependency. It should configure the module so it is +# ready for compilation (mostly useful for calling configure). +# prep-deb-files from module-assistant creates the neccessary debian/ files +kdist_config kdist_configure: prep-deb-files + +# the kdist_clean target is called by make-kpkg modules_clean and from +# kdist* rules. It is responsible for cleaning up any changes that have +# been made by the other kdist_commands (except for the .deb files created) +kdist_clean: + $(MAKE) KERNELDIR=$(KSRC) KVERREL=$(KVERS) clean +# rm -f driver/*.o driver/*.ko +# +### end KERNEL SETUP + +config.status: configure + dh_testdir + # Add here commands to configure the package. + ./configure --prefix=/usr --disable-gcc-check --enable-alsa + + +build-arch: config.status build-arch-stamp +build-arch-stamp: + dh_testdir + + # Add here command to compile/build the package. + $(MAKE) qemu bios + $(MAKE) -C qemu/pc-bios + touch $@ + +# the binary-modules rule is invoked by module-assistant while processing the +# kdist* targets. It is called by module-assistant or make-kpkg and *not* +# during a normal build +binary-modules: + dh_testroot + dh_clean -k + dh_installdirs lib/modules/$(KVERS)/misc + + # Build the modules + $(MAKE) KERNELDIR=$(KSRC) KVERREL=$(KVERS) + + # Install the modules + cp kvm.ko kvm-intel.ko kvm-amd.ko debian/$(PKGNAME)/lib/modules/$(KVERS)/misc + + dh_installdocs + dh_installchangelogs + dh_installmodules + sed -e "s/@KERNEL@/$(KVERS)/g" debian/preinst.modules.in > debian/preinst + sed -e "s/@KERNEL@/$(KVERS)/g" debian/postrm.modules.in > debian/postrm + dh_compress + dh_fixperms + dh_installdeb + dh_gencontrol -- -v$(VERSION) + dh_md5sums + dh_builddeb --destdir=$(DEB_DESTDIR) + dh_clean -k + +build-indep: config.status build-indep-stamp +build-indep-stamp: + dh_testdir + + # Add here command to compile/build the arch indep package. + # It's ok not to do anything here, if you don't need to build + # anything for this package. + #docbook-to-man debian/kvm.sgml > kvm.1 + + touch $@ + +build: patch build-arch build-indep + +clean: unpatch + dh_testdir + #dh_testroot + rm -f build-arch-stamp build-indep-stamp + rm -rf qemu/$(BUILD_CPU)-softmmu + rm -f config.sub config.guess + + # Add here commands to clean up after the build process. + -$(MAKE) -C qemu/pc-bios clean + -$(MAKE) -C qemu clean + -$(MAKE) -C extboot clean + -$(MAKE) clean + rm -f qemu/pc-bios/*.bin bios/BIOS* user/config.mak qemu/config-host.h qemu/config-host.mak config.mak + + dh_clean + +ifneq "$(wildcard /usr/share/quilt/quilt.make)" "" +include /usr/share/quilt/quilt.make +endif + +# Removing binary blobs +unwanted_bios_files = ppc_rom.bin openbios-sparc32 video.x pxe-ne2k_pci.bin pxe-pcnet.bin pxe-rtl8139.bin vgabios.bin vgabios-cirrus.bin openbios-sparc openbios-sparc64 + +built_bios_files = bios.bin + +install: DH_OPTIONS= +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Create the directories to install the source into + dh_installdirs -p$(psource) usr/src/modules/$(sname)/debian + + # Make qemu's "make install" happy + for i in $(unwanted_bios_files); do \ + touch qemu/pc-bios/$$i; \ + done + # Build & install normally, remove extraneous files + $(MAKE) -C libkvm DESTDIR=$(CURDIR)/debian/$(sname) install + $(MAKE) -C qemu DESTDIR=$(CURDIR)/debian/$(sname) install + + # Clean up the mess + for i in $(unwanted_bios_files); do \ + rm -f qemu/pc-bios/$$i debian/tmp/usr/share/kvm/$$i; \ + done + + # Add here commands to install the package into debian/kvm. + dh_install + mv $(CURDIR)/debian/kvm/usr/bin/$(QEMU_EXE) $(CURDIR)/debian/kvm/usr/bin/kvm + # Collisions with the qemu package + rm $(CURDIR)/debian/kvm/usr/bin/qemu-img + rm $(CURDIR)/debian/kvm/usr/share/man/man1/qemu-img.1 + mv $(CURDIR)/debian/kvm/usr/share/man/man1/qemu.1 $(CURDIR)/debian/kvm/usr/share/man/man1/kvm-qemu.1 + + ## The /etc/init.d script (not quite ready for prime time yet) + #cp -a scripts/kvm $(CURDIR)/debian/kvm/etc/init.d/ + #dh_installinit --onlyscripts --no-restart-on-upgrade + + install -m 0755 scripts/qemu-ifup $(CURDIR)/debian/kvm/etc/kvm/kvm-ifup + install -m 0755 debian/reportbug-hook.sh $(CURDIR)/debian/kvm/usr/share/bug/kvm + + # Upstream does this though it is wrong for Debian, but installing it + # properly with dh_py* would makes it clash with the binary /usr/bin/kvm + # This seems likely to change in coming versions as upstream also + # has /usr/bin/kvm. + install -m 0755 kvm $(CURDIR)/debian/kvm/etc/kvm/utils/kvm + + # Remove unwanted bios files + for i in $(unwanted_bios_files); do \ + rm -f $(CURDIR)/debian/kvm/usr/share/kvm/$$i; \ + done + + # kvm-source + install -m 0755 debian/reportbug-hook.sh $(CURDIR)/debian/$(psource)/usr/share/bug/kvm-source + # Copy only the driver source to the proper location + cp -r kernel/* debian/$(psource)/usr/src/modules/$(sname) + # Copy the needed debian/ pieces to the proper location + cp debian/*modules.in* \ + debian/$(psource)/usr/src/modules/$(sname)/debian + cp debian/rules debian/changelog debian/copyright \ + debian/compat debian/$(psource)/usr/src/modules/$(sname)/debian/ + cd debian/$(psource)/usr/src && tar c modules | bzip2 -9 > $(sname).tar.bz2 && rm -rf modules + # tell module-assistant about the kvm modules, so they show up in the list menu + ln -s default.sh $(CURDIR)/debian/kvm/usr/share/modass/packages/$(psource) + + # Remove things we don't package at all, would be a "kvm-dev" package + rm -Rf $(CURDIR)/debian/kvm/usr/include/linux/ + rm -Rf $(CURDIR)/debian/kvm/usr/include + rm -Rf $(CURDIR)/debian/kvm/usr/lib* + + +# Build architecture-independent files here. +# Pass -i to all debhelper commands in this target to reduce clutter. +binary-indep: build install + dh_testdir -i + dh_testroot -i + dh_installchangelogs -i debian/changelog.upstream + dh_installdocs -i +# dh_installexamples -i +# dh_install -i +# dh_installmenu -i +# dh_installdebconf -i +# dh_installlogrotate -i +# dh_installemacsen -i +# dh_installpam -i +# dh_installmime -i +# dh_installinit -i +# dh_installcron -i +# dh_installinfo -i + dh_installman -i + dh_link -i + dh_compress -i + dh_fixperms -i + dh_installdeb -i +# dh_perl -i +# dh_python -i +# dh_makeshlibs -i + dh_installdeb -i + dh_shlibdeps -i + dh_gencontrol -i + dh_md5sums -i + dh_builddeb -i + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir -s + dh_testroot -s +# dh_installdebconf -s + dh_installdocs -s +# dh_installexamples -s +# dh_installmenu -s +# dh_installlogrotate -s +# dh_installemacsen -s +# dh_installpam -s +# dh_installmime -s + dh_installinit -s -r -umultiuser --error-handler=true +# dh_installcron -s + dh_installman -s debian/kvm.1 + dh_installudev -s --priority=45 +# dh_installinfo -s + dh_installchangelogs -s debian/changelog.upstream + dh_strip -s + dh_link -s + dh_compress -s + dh_fixperms -s +# dh_makeshlibs -s + dh_installdeb -s +# dh_perl -s + dh_shlibdeps -s + dh_gencontrol -s + dh_md5sums -s + dh_builddeb -s + +binary: binary-indep binary-arch + +# get-orig-source adapted from /usr/share/gnome-pkg-tools/1/rules/sf-get-source.mk from the gnome-pkg-tools package +# copied from CDBS' buildvars +DEB_SOURCE_PACKAGE ?= $(strip $(shell egrep '^Source: ' debian/control | cut -f 2 -d ':')) +DEB_VERSION ?= $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ') +DEB_NOEPOCH_VERSION ?= $(shell echo $(DEB_VERSION) | cut -d: -f2-) +DEB_UPSTREAM_VERSION ?= $(shell echo $(DEB_NOEPOCH_VERSION) | sed 's/+[^-]*-[^-]*$$//') + +# where to store the resulting .orig tarball +DEB_TARBALL_DOWNLOAD_DIR ?= ../tarballs +TARBALL_EXT ?= tar.gz + +SF_PROJECT ?= $(DEB_SOURCE_PACKAGE) +SF_MODULE ?= $(DEB_SOURCE_PACKAGE) +SF_TARBALL ?= $(SF_MODULE)-$(DEB_UPSTREAM_VERSION).$(TARBALL_EXT) +SF_DOWNLOAD_URL ?= http://$$sf_mirror.dl.sourceforge.net/$(SF_PROJECT)/$(SF_TARBALL) +SF_MIRRORS ?= belnet easynews heanet internap jaist kent mesh nchc optusnet ovh puzzle superb-east superb-west surfnet switch ufpr umn +SF_DOWNLOAD_COMMAND ?= for sf_mirror in $(SF_MIRRORS); do wget -N -nv -T10 -t1 -O $(DEB_TARBALL_DOWNLOAD_DIR)/$(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_VERSION).orig.$(TARBALL_EXT) $(SF_DOWNLOAD_URL) && break; done + +get-orig-source: + dh_testdir + @@echo 'Source package: $(DEB_SOURCE_PACKAGE)' + @@echo 'Source package: $(DEB_VERSION)' + @@echo 'Source version without epoch: $(DEB_NOEPOCH_VERSION)' + @@echo 'Upstream version (for orig tarball): $(DEB_UPSTREAM_VERSION)' + mkdir -p $(DEB_TARBALL_DOWNLOAD_DIR) + $(SF_DOWNLOAD_COMMAND) + case "$(TARBALL_EXT)" in \ + tar.bz2|tbz) \ + bzcat $(DEB_TARBALL_DOWNLOAD_DIR)/$(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_VERSION).orig.$(TARBALL_EXT) | \ + gzip -9 >$(DEB_TARBALL_DOWNLOAD_DIR)/$(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_VERSION).orig.tar.gz ; \ + rm -f $(DEB_TARBALL_DOWNLOAD_DIR)/$(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_VERSION).orig.$(TARBALL_EXT) \ + ;;\ + esac + cd $(DEB_TARBALL_DOWNLOAD_DIR) && \ + tar xzf $(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_VERSION).orig.tar.gz + cd $(DEB_TARBALL_DOWNLOAD_DIR) && \ +# rm -f $(DEB_SOURCE_PACKAGE)-$(DEB_UPSTREAM_VERSION)/qemu/pc-bios/openbios* && \ +# rm -f $(DEB_SOURCE_PACKAGE)-$(DEB_UPSTREAM_VERSION)/qemu/pc-bios/*.bin && \ + rm -f $(DEB_SOURCE_PACKAGE)-$(DEB_UPSTREAM_VERSION)/bios/VGABIOS* && \ + rm -f $(DEB_SOURCE_PACKAGE)-$(DEB_UPSTREAM_VERSION)/bios/*.bin + cd $(DEB_TARBALL_DOWNLOAD_DIR) && \ + for i in $(unwanted_bios_files) $(built_bios_files); do \ + rm -f $(DEB_SOURCE_PACKAGE)-$(DEB_UPSTREAM_VERSION)/qemu/pc-bios/$$i; \ + done + cd $(DEB_TARBALL_DOWNLOAD_DIR) && \ + tar c $(DEB_SOURCE_PACKAGE)-$(DEB_UPSTREAM_VERSION) | \ + gzip -9 >$(DEB_TARBALL_DOWNLOAD_DIR)/$(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_VERSION)+dfsg.orig.tar.gz + + +.PHONY: build clean binary-indep binary-arch binary install binary-modules kdist kdist_configure kdist_config kdist_image kdist_clean --- kvm-60+dfsg.orig/Makefile +++ kvm-60+dfsg/Makefile @@ -1,5 +1,5 @@ -include config.mak +-include config.mak DESTDIR=