3
0
Fork 0
forked from mirrors/nixpkgs

* KVM 82.

* Kernel headers for Linux 2.6.28.

svn path=/nixpkgs/trunk/; revision=13755
This commit is contained in:
Eelco Dolstra 2009-01-13 12:40:58 +00:00
parent 6c0b144efc
commit 1a3a6835c2
7 changed files with 177 additions and 5 deletions

View file

@ -2,13 +2,13 @@
assert stdenv.isLinux;
let version = "2.6.26.2"; in
stdenv.mkDerivation {
name = "linux-headers-2.6.26.2";
builder = ./builder.sh;
name = "linux-headers-${version}";
src = fetchurl {
url = "mirror://kernel/linux/kernel/v2.6/linux-2.6.26.2.tar.bz2";
url = "mirror://kernel/linux/kernel/v2.6/linux-${version}.tar.bz2";
sha256 = "0xrkv6wk5l4qhza35a76cd00a7g9xv3ymw7znwskig2kmqswnp1m";
};
@ -23,4 +23,20 @@ stdenv.mkDerivation {
extraIncludeDirs =
if stdenv.system == "powerpc-linux" then ["ppc"] else [];
patchPhase = ''
sed -i '/scsi/d' include/Kbuild
'';
buildPhase = ''
make mrproper headers_check
'';
installPhase = ''
make INSTALL_HDR_PATH=$out headers_install
# Some builds (e.g. KVM) want a kernel.release.
ensureDir $out/include/config
echo "${version}-default" > $out/include/config/kernel.release
'';
}

View file

@ -0,0 +1,44 @@
{stdenv, fetchurl, perl}:
assert stdenv.isLinux;
let version = "2.6.28"; in
stdenv.mkDerivation {
name = "linux-headers-${version}";
src = fetchurl {
url = "mirror://kernel/linux/kernel/v2.6/linux-${version}.tar.bz2";
sha256 = "1023nl992s4qmnwzbfz385azzpph58azi5rw4w0wwzzybv2rf3df";
};
platform =
if stdenv.system == "i686-linux" then "i386" else
if stdenv.system == "x86_64-linux" then "x86_64" else
if stdenv.system == "powerpc-linux" then "powerpc" else
abort "don't know what the kernel include directory is called for this platform";
buildInputs = [perl];
# !!! hacky
fixupPhase = "ln -s $out/include/asm $out/include/asm-$platform";
extraIncludeDirs =
if stdenv.system == "powerpc-linux" then ["ppc"] else [];
patchPhase = ''
sed -i '/scsi/d' include/Kbuild
'';
buildPhase = ''
make mrproper headers_check
'';
installPhase = ''
make INSTALL_HDR_PATH=$out headers_install
# Some builds (e.g. KVM) want a kernel.release.
ensureDir $out/include/config
echo "${version}-default" > $out/include/config/kernel.release
'';
}

View file

@ -0,0 +1,38 @@
{stdenv, fetchurl, kernelHeaders, zlib, e2fsprogs, SDL, alsaLib, pkgconfig, rsync}:
assert stdenv.isLinux;
stdenv.mkDerivation {
name = "kvm-82";
src = fetchurl {
url = mirror://sourceforge/kvm/kvm-82.tar.gz;
sha256 = "1fk58g8z9v7z42vy76zq0sq28slqf8zszzmh73vyxm07vfbc96zs";
};
patches = [
# Allow setting the path to Samba through $QEMU_SMBD_COMMAND.
./smbd-path-r2.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-r3.patch
];
configureFlags = "--with-patched-kernel --kerneldir=${kernelHeaders}";
# 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";
};
}

View file

@ -0,0 +1,14 @@
diff -rc kvm-78-orig/kernel/Makefile kvm-78/kernel/Makefile
*** kvm-78-orig/kernel/Makefile 2008-10-30 11:58:12.000000000 +0100
--- kvm-78/kernel/Makefile 2008-11-07 15:59:34.000000000 +0100
***************
*** 66,71 ****
--- 66,72 ----
"$(LINUX)"/./include/linux/kvm*.h \
$(if $(wildcard $(headers-old)), $(headers-old)) \
$T/
+ chmod -R u+w $T
$(if $(wildcard $(headers-new)), \
rsync -R \
$(headers-new) \
Only in kvm-78/kernel: Makefile~

View file

@ -0,0 +1,50 @@
diff -rc kvm-82-orig/qemu/net.c kvm-82/qemu/net.c
*** kvm-82-orig/qemu/net.c 2008-12-24 15:24:58.000000000 +0100
--- kvm-82/qemu/net.c 2009-01-13 12:59:15.000000000 +0100
***************
*** 560,570 ****
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");
--- 560,572 ----
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");
diff -rc kvm-82-orig/qemu/net.h kvm-82/qemu/net.h
*** kvm-82-orig/qemu/net.h 2008-12-24 15:24:58.000000000 +0100
--- kvm-82/qemu/net.h 2009-01-13 12:58:28.000000000 +0100
***************
*** 99,105 ****
#ifdef __sun__
#define SMBD_COMMAND "/usr/sfw/sbin/smbd"
#else
! #define SMBD_COMMAND "/usr/sbin/smbd"
#endif
#endif
--- 99,105 ----
#ifdef __sun__
#define SMBD_COMMAND "/usr/sfw/sbin/smbd"
#else
! #define SMBD_COMMAND "smbd"
#endif
#endif

View file

@ -6074,6 +6074,10 @@ let
inherit fetchurl stdenv;
};
kernelHeaders_2_6_28 = import ../os-specific/linux/kernel-headers/2.6.28.nix {
inherit fetchurl stdenv perl;
};
kernelHeadersArm = import ../os-specific/linux/kernel-headers-cross {
inherit fetchurl stdenv;
cross = "arm-linux";
@ -6532,6 +6536,11 @@ let
kernelHeaders = kernelHeaders_2_6_26;
};
kvm82 = import ../os-specific/linux/kvm/82.nix {
inherit fetchurl stdenv zlib e2fsprogs SDL alsaLib pkgconfig rsync;
kernelHeaders = kernelHeaders_2_6_28;
};
libcap = import ../os-specific/linux/libcap {
inherit fetchurl stdenv attr;
};

View file

@ -150,9 +150,10 @@ let
qt4
#quake3demo
readline
reiserfsprogs
rLang
reiserfsprogs
rogue
rpm
rsync
ruby
screen