From 4add420a480265b7185896ca0aadb394d1da383c Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Wed, 28 Sep 2011 21:46:07 +0000 Subject: [PATCH] aufs3 kernelPackage svn path=/nixpkgs/trunk/; revision=29534 --- pkgs/os-specific/linux/aufs3/default.nix | 41 +++++++++++++++++++++++ pkgs/os-specific/linux/kernel/generic.nix | 2 +- pkgs/os-specific/linux/kernel/patches.nix | 19 ++++++----- pkgs/top-level/all-packages.nix | 4 +++ 4 files changed, 56 insertions(+), 10 deletions(-) create mode 100644 pkgs/os-specific/linux/aufs3/default.nix diff --git a/pkgs/os-specific/linux/aufs3/default.nix b/pkgs/os-specific/linux/aufs3/default.nix new file mode 100644 index 00000000000..a47dd9cb445 --- /dev/null +++ b/pkgs/os-specific/linux/aufs3/default.nix @@ -0,0 +1,41 @@ +{ stdenv, kernel, perl }: + +let + + aufsPredicate = x: + if x ? features then + (if x.features ? aufs3 then x.features.aufs3 else false) + else false; + featureAbort = abort "This kernel does not have aufs 3 support"; + patch = stdenv.lib.findFirst aufsPredicate featureAbort kernel.kernelPatches; + +in + +stdenv.mkDerivation { + name = "aufs3-${patch.version}"; + + src = patch.patch.src; + + buildInputs = [ perl ]; + + makeFlags = "KDIR=${kernel}/lib/modules/${kernel.modDirVersion}/build"; + + installPhase = + '' + ensureDir $out/lib/modules/${kernel.modDirVersion}/misc + cp -v aufs.ko $out/lib/modules/${kernel.modDirVersion}/misc + + # Install the headers because aufs3-util requires them. + ensureDir $out/include/linux + cp -v usr/include/linux/aufs_type.h $out/include/linux + ''; + + meta = { + description = "Another Unionfs implementation for Linux (third generation)"; + homepage = http://aufs.sourceforge.net/; + maintainers = [ stdenv.lib.maintainers.eelco + stdenv.lib.maintainers.raskin + stdenv.lib.maintainers.shlevy ]; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index a86aef1af8e..af62125eb75 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -69,7 +69,7 @@ stdenv.mkDerivation { enableParallelBuilding = true; passthru = { - inherit version modDirVersion; + inherit version modDirVersion kernelPatches; # Combine the `features' attribute sets of all the kernel patches. features = lib.fold (x: y: (if x ? features then x.features else {}) // y) features kernelPatches; }; diff --git a/pkgs/os-specific/linux/kernel/patches.nix b/pkgs/os-specific/linux/kernel/patches.nix index 3f66fcb8850..79e02753f32 100644 --- a/pkgs/os-specific/linux/kernel/patches.nix +++ b/pkgs/os-specific/linux/kernel/patches.nix @@ -290,16 +290,17 @@ rec { features.aufs2_1 = true; }; - aufs3_0 = - { name = "aufs3.0"; - patch = makeAufs3StandalonePatch { - version = "3.0"; - rev = "1067b9d8d64d23c70d905c9cd3c90a669e39c4d4"; - sha256 = "b508cab5987a623f057ae5fdc006c909a6bae6151af6e12fe672bf97b1a7549d"; - }; - features.aufsBase = true; - features.aufs3 = true; + aufs3_0 = rec { + name = "aufs3.0"; + version = "3.0"; + patch = makeAufs3StandalonePatch { + inherit version; + rev = "1067b9d8d64d23c70d905c9cd3c90a669e39c4d4"; + sha256 = "b508cab5987a623f057ae5fdc006c909a6bae6151af6e12fe672bf97b1a7549d"; }; + features.aufsBase = true; + features.aufs3 = true; + }; # Increase the timeout on CIFS requests from 15 to 120 seconds to # make CIFS more resilient to high load on the CIFS server. diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1c93b070c08..ece8cfe76b8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5588,6 +5588,10 @@ let callPackage ../os-specific/linux/aufs2.1 { } else null; + aufs3 = if kernel.features ? aufs3 then + callPackage ../os-specific/linux/aufs3 { } + else null; + aufs2_1_util = if kernel.features ? aufs2_1 then callPackage ../os-specific/linux/aufs2.1-util { } else null;