From fa314f07242f3bd6195c066a413a4d20c639f568 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 28 Jul 2010 15:39:39 +0000 Subject: [PATCH] * Remove KVM (obsolete -> qemu-kvm). svn path=/nixpkgs/trunk/; revision=22796 --- pkgs/os-specific/linux/kvm/76.nix | 38 ------- pkgs/os-specific/linux/kvm/86.nix | 43 ------- pkgs/os-specific/linux/kvm/88.nix | 34 ------ .../linux/kvm/readonly-kernel-r2.patch | 15 --- pkgs/os-specific/linux/kvm/smbd-path-r3.patch | 50 --------- pkgs/os-specific/linux/kvm/smbd-path.patch | 48 -------- .../linux/kvm/x86_boot_vidmode.patch | 105 ------------------ pkgs/top-level/all-packages.nix | 17 +-- 8 files changed, 1 insertion(+), 349 deletions(-) delete mode 100644 pkgs/os-specific/linux/kvm/76.nix delete mode 100644 pkgs/os-specific/linux/kvm/86.nix delete mode 100644 pkgs/os-specific/linux/kvm/88.nix delete mode 100644 pkgs/os-specific/linux/kvm/readonly-kernel-r2.patch delete mode 100644 pkgs/os-specific/linux/kvm/smbd-path-r3.patch delete mode 100644 pkgs/os-specific/linux/kvm/smbd-path.patch delete mode 100644 pkgs/os-specific/linux/kvm/x86_boot_vidmode.patch diff --git a/pkgs/os-specific/linux/kvm/76.nix b/pkgs/os-specific/linux/kvm/76.nix deleted file mode 100644 index 99d16b27a84..00000000000 --- a/pkgs/os-specific/linux/kvm/76.nix +++ /dev/null @@ -1,38 +0,0 @@ -{stdenv, fetchurl, linuxHeaders, zlib, e2fsprogs, SDL, alsaLib, pkgconfig, rsync}: - -assert stdenv.isLinux; - -stdenv.mkDerivation { - name = "kvm-76"; - - src = fetchurl { - url = mirror://sourceforge/kvm/kvm-76.tar.gz; - sha256 = "06gf2aic6n0b3fnd9vi0llyydr2w6qnx1k8imm710862xhncpssk"; - }; - - patches = [ - # Allow setting the path to Samba through $QEMU_SMBD_COMMAND. - ./smbd-path.patch - # The makefile copies stuff from the kernel directory and then - # tries to modify the copy, but it must be made writable first. - ./readonly-kernel-r2.patch - ]; - - configureFlags = "--with-patched-kernel --kerneldir=${linuxHeaders}"; - - # e2fsprogs is needed for libuuid. - # rsync is a weird dependency used for copying kernel header files. - buildInputs = [zlib e2fsprogs SDL alsaLib pkgconfig rsync]; - - preConfigure = '' - for i in configure user/configure; do - substituteInPlace $i --replace /bin/bash $shell - done - substituteInPlace libkvm/Makefile --replace kvm_para.h kvm.h # !!! quick hack - ''; - - meta = { - homepage = http://kvm.qumranet.com/; - description = "A full virtualization solution for Linux on x86 hardware containing virtualization extensions"; - }; -} diff --git a/pkgs/os-specific/linux/kvm/86.nix b/pkgs/os-specific/linux/kvm/86.nix deleted file mode 100644 index 5989988d5aa..00000000000 --- a/pkgs/os-specific/linux/kvm/86.nix +++ /dev/null @@ -1,43 +0,0 @@ -{stdenv, fetchurl, linuxHeaders, zlib, SDL, alsaLib, pkgconfig, pciutils}: - -assert stdenv.isLinux; - -stdenv.mkDerivation rec { - name = "kvm-86"; - - src = fetchurl { - url = "mirror://sourceforge/kvm/${name}.tar.gz"; - sha256 = "17fq2dyd0qla0yiddyiqvb8kz3sfy6dhy9fi9y7xcbhs26s0wxax"; - }; - - patches = [ - # Allow setting the path to Samba through $QEMU_SMBD_COMMAND. - ./smbd-path-r3.patch - - # Support the "vga" kernel command line option when using the - # -kernel option. - ./x86_boot_vidmode.patch - ]; - - configureFlags = "--enable-io-thread"; - - # e2fsprogs is needed for libuuid. - # rsync is a weird dependency used for copying kernel header files. - buildInputs = [zlib SDL alsaLib pkgconfig pciutils]; - - preConfigure = '' - for i in configure kvm/configure kvm/user/configure; do - substituteInPlace $i --replace /bin/bash $shell - done - - substituteInPlace kvm/libkvm/Makefile --replace kvm_para.h kvm.h # !!! quick hack - - # This prevents the kernel module from being built. - rm kvm/kernel/configure - ''; - - meta = { - homepage = http://kvm.qumranet.com/; - description = "A full virtualization solution for Linux on x86 hardware containing virtualization extensions"; - }; -} diff --git a/pkgs/os-specific/linux/kvm/88.nix b/pkgs/os-specific/linux/kvm/88.nix deleted file mode 100644 index 2a8a1b0ef19..00000000000 --- a/pkgs/os-specific/linux/kvm/88.nix +++ /dev/null @@ -1,34 +0,0 @@ -{stdenv, fetchurl, linuxHeaders, zlib, SDL, alsaLib, pkgconfig, pciutils}: - -assert stdenv.isLinux; - -stdenv.mkDerivation rec { - name = "kvm-88"; - - src = fetchurl { - url = "mirror://sourceforge/kvm/${name}.tar.gz"; - sha256 = "0gmmcwgkfk15wkcjaaa28nrzb0w3vbhg8p585qin61hz6kcy8ryw"; - }; - - configureFlags = "--enable-io-thread"; - - # e2fsprogs is needed for libuuid. - # rsync is a weird dependency used for copying kernel header files. - buildInputs = [zlib SDL alsaLib pkgconfig pciutils]; - - preConfigure = '' - for i in configure kvm/configure kvm/user/configure; do - substituteInPlace $i --replace /bin/bash $shell - done - - substituteInPlace kvm/libkvm/Makefile --replace kvm_para.h kvm.h # !!! quick hack - - # This prevents the kernel module from being built. - rm kvm/kernel/configure - ''; - - meta = { - homepage = http://kvm.qumranet.com/; - description = "A full virtualization solution for Linux on x86 hardware containing virtualization extensions"; - }; -} diff --git a/pkgs/os-specific/linux/kvm/readonly-kernel-r2.patch b/pkgs/os-specific/linux/kvm/readonly-kernel-r2.patch deleted file mode 100644 index 663db508b43..00000000000 --- a/pkgs/os-specific/linux/kvm/readonly-kernel-r2.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -rc kvm-74-orig/kernel/Makefile kvm-74/kernel/Makefile -*** kvm-74-orig/kernel/Makefile 2008-08-27 10:53:37.000000000 +0200 ---- kvm-74/kernel/Makefile 2008-08-29 14:12:00.000000000 +0200 -*************** -*** 59,64 **** ---- 59,65 ---- - -rsync -R \ - "$(LINUX)"/arch/$(ARCH_DIR)/include/asm/./kvm*.h \ - $T/include/asm-$(ARCH_DIR)/ -+ chmod -R u+w $T - - set -e && for i in $(find $T -name '*.h'); do \ - $(call unifdef,$$i); done -Only in kvm-74/kernel: Makefile~ -Only in kvm-74/kernel: Makefile.rej diff --git a/pkgs/os-specific/linux/kvm/smbd-path-r3.patch b/pkgs/os-specific/linux/kvm/smbd-path-r3.patch deleted file mode 100644 index 32099ad6930..00000000000 --- a/pkgs/os-specific/linux/kvm/smbd-path-r3.patch +++ /dev/null @@ -1,50 +0,0 @@ -diff -rc kvm-86/net.c kvm-86-new/net.c -*** kvm-86/net.c 2009-05-19 18:29:02.000000000 +0200 ---- kvm-86-new/net.c 2009-06-02 17:41:15.000000000 +0200 -*************** -*** 684,694 **** - slirp_init(slirp_restrict, slirp_ip); - } - -! /* XXX: better tmp dir construction */ -! snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%ld", (long)getpid()); -! if (mkdir(smb_dir, 0700) < 0) { -! fprintf(stderr, "qemu: could not create samba server dir '%s'\n", smb_dir); -! exit(1); - } - snprintf(smb_conf, sizeof(smb_conf), "%s/%s", smb_dir, "smb.conf"); - ---- 684,696 ---- - slirp_init(slirp_restrict, slirp_ip); - } - -! while (1) { -! snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%ld.%d", (long) getpid(), random()); -! if (mkdir(smb_dir, 0700) == 0) break; -! if (errno != EEXIST) { -! fprintf(stderr, "qemu: could not create samba server dir '%s'\n", smb_dir); -! exit(1); -! } - } - snprintf(smb_conf, sizeof(smb_conf), "%s/%s", smb_dir, "smb.conf"); - -diff -rc kvm-86/net.h kvm-86-new/net.h -*** kvm-86/net.h 2009-05-19 18:29:02.000000000 +0200 ---- kvm-86-new/net.h 2009-06-02 17:39:17.000000000 +0200 -*************** -*** 129,135 **** - #ifdef __sun__ - #define SMBD_COMMAND "/usr/sfw/sbin/smbd" - #else -! #define SMBD_COMMAND "/usr/sbin/smbd" - #endif - - #endif ---- 129,135 ---- - #ifdef __sun__ - #define SMBD_COMMAND "/usr/sfw/sbin/smbd" - #else -! #define SMBD_COMMAND "smbd" - #endif - - #endif diff --git a/pkgs/os-specific/linux/kvm/smbd-path.patch b/pkgs/os-specific/linux/kvm/smbd-path.patch deleted file mode 100644 index 5844ebefcf5..00000000000 --- a/pkgs/os-specific/linux/kvm/smbd-path.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff -rc kvm-57-orig/qemu/vl.c kvm-57/qemu/vl.c -*** kvm-57-orig/qemu/vl.c 2007-12-18 16:57:46.000000000 +0100 ---- kvm-57/qemu/vl.c 2008-08-26 13:17:57.000000000 +0200 -*************** -*** 141,147 **** - #ifdef __sun__ - #define SMBD_COMMAND "/usr/sfw/sbin/smbd" - #else -! #define SMBD_COMMAND "/usr/sbin/smbd" - #endif - - //#define DEBUG_UNUSED_IOPORT ---- 141,147 ---- - #ifdef __sun__ - #define SMBD_COMMAND "/usr/sfw/sbin/smbd" - #else -! #define SMBD_COMMAND "smbd" - #endif - - //#define DEBUG_UNUSED_IOPORT -*************** -*** 3828,3838 **** - slirp_init(); - } - -! /* XXX: better tmp dir construction */ -! snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%d", getpid()); -! if (mkdir(smb_dir, 0700) < 0) { -! fprintf(stderr, "qemu: could not create samba server dir '%s'\n", smb_dir); -! exit(1); - } - snprintf(smb_conf, sizeof(smb_conf), "%s/%s", smb_dir, "smb.conf"); - ---- 3828,3840 ---- - slirp_init(); - } - -! while (1) { -! snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%d.%d", getpid(), random()); -! if (mkdir(smb_dir, 0700) == 0) break; -! if (errno != EEXIST) { -! fprintf(stderr, "qemu: could not create samba server dir '%s'\n", smb_dir); -! exit(1); -! } - } - snprintf(smb_conf, sizeof(smb_conf), "%s/%s", smb_dir, "smb.conf"); - -Only in kvm-57/qemu: vl.c~ diff --git a/pkgs/os-specific/linux/kvm/x86_boot_vidmode.patch b/pkgs/os-specific/linux/kvm/x86_boot_vidmode.patch deleted file mode 100644 index 2ff6dd566c4..00000000000 --- a/pkgs/os-specific/linux/kvm/x86_boot_vidmode.patch +++ /dev/null @@ -1,105 +0,0 @@ -Based on http://www.mail-archive.com/qemu-commits@nongnu.org/msg00202/qemu.x86_boot_vidmode.patch. - -diff -Nupr qemu/hw/pc.c qemu-new/hw/pc.c ---- qemu/hw/pc.c 2009-05-26 16:10:44.000000000 +0800 -+++ qemu-new/hw/pc.c 2009-05-26 17:17:25.000000000 +0800 -@@ -593,6 +593,78 @@ static long get_file_size(FILE *f) - return size; - } - -+static uint16_t hato16i(char *hex) -+{ -+ uint16_t integer = 0; -+ if(hex[1] == 'x') -+ hex += 2; -+ -+ while(*hex != '\0'){ -+ integer = (integer<<4); -+ -+ if(*hex >= 0x30 && *hex <= 0x39){ /*0~9*/ -+ integer += *hex - 0x30; -+ }else if(*hex >= 0x61 && *hex <= 0x66){ /*a~f*/ -+ integer += *hex - 0x61 + 0xa; -+ }else if(*hex >= 0x41 && *hex <= 0x46){ /*A~F*/ -+ integer += *hex - 0x41 + 0x1; -+ }else -+ break; -+ -+ hex++; -+ } -+ return integer; -+} -+ -+static uint16_t ato16i(char *dec) -+{ -+ uint16_t integer = 0; -+ -+ while(*dec != '\0'){ -+ integer *= 10; -+ -+ if(*dec >= 0x30 && *dec <= 0x39){ /*0~9*/ -+ integer += *dec - 0x30; -+ }else -+ break; -+ -+ dec++; -+ } -+ return integer; -+} -+ -+static int get_vga_mode(const char* kernel_cmdline, uint16_t *vga_mode) -+{ -+ char mode[7]; -+ int i = 0; -+ char *p = strstr(kernel_cmdline, "vga="); -+ if(p == NULL) -+ return 1; -+ -+ p += 4; -+ -+ while(*p != ' ' && *p != '\0' && i < 6) { -+ mode[i] = *p; -+ i++; -+ p++; -+ } -+ mode[i] = 0; -+ -+ if(!strncmp(mode, "ask", 3)){ -+ *vga_mode = 0xfffd; -+ }else if(!strncmp(mode, "normal",6)){ -+ *vga_mode = 0xffff; -+ }else if(!strncmp(mode, "ext", 3)){ -+ *vga_mode = 0xfffe; -+ }else if(!strncmp(mode, "0x", 2)){//in hexdecimal -+ *vga_mode = hato16i(mode); -+ }else //in decimal -+ *vga_mode = ato16i(mode); -+ -+ return 0; -+} -+ -+ - static void load_linux(target_phys_addr_t option_rom, - const char *kernel_filename, - const char *initrd_filename, -@@ -605,6 +676,7 @@ static void load_linux(target_phys_addr_ - uint16_t real_seg; - int setup_size, kernel_size, initrd_size, cmdline_size; - uint32_t initrd_max; -+ uint16_t vid_mode; - uint8_t header[1024]; - target_phys_addr_t real_addr, prot_addr, cmdline_addr, initrd_addr; - FILE *f, *fi; -@@ -683,6 +755,12 @@ static void load_linux(target_phys_addr_ - if (protocol >= 0x200) - header[0x210] = 0xB0; - -+ /*parse cmdline and set vga mode*/ -+ if(!get_vga_mode(kernel_cmdline, &vid_mode)){ -+ header[0x1fa] = vid_mode&0xff; -+ header[0x1fb] = (vid_mode&0xff00)>>8; -+ } -+ - /* heap */ - if (protocol >= 0x201) { - header[0x211] |= 0x80; /* CAN_USE_HEAP */ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4a6a8fd224c..ab954ae00bb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6777,22 +6777,7 @@ let inherit stdenv klibc; }; - kvm = kvm76; - - kvm76 = import ../os-specific/linux/kvm/76.nix { - inherit fetchurl stdenv zlib e2fsprogs SDL alsaLib pkgconfig rsync; - linuxHeaders = glibc.kernelHeaders; - }; - - kvm86 = import ../os-specific/linux/kvm/86.nix { - inherit fetchurl stdenv zlib SDL alsaLib pkgconfig pciutils; - linuxHeaders = glibc.kernelHeaders; - }; - - kvm88 = import ../os-specific/linux/kvm/88.nix { - inherit fetchurl stdenv zlib SDL alsaLib pkgconfig pciutils; - linuxHeaders = glibc.kernelHeaders; - }; + kvm = qemu_kvm; libcap = import ../os-specific/linux/libcap { inherit fetchurl stdenv attr;