2011-09-28 23:46:07 +02:00
|
|
|
{ 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 {
|
2011-11-08 16:05:54 +01:00
|
|
|
name = "aufs3-${patch.version}-${kernel.version}";
|
2011-09-28 23:46:07 +02:00
|
|
|
|
|
|
|
src = patch.patch.src;
|
|
|
|
|
|
|
|
buildInputs = [ perl ];
|
|
|
|
|
|
|
|
makeFlags = "KDIR=${kernel}/lib/modules/${kernel.modDirVersion}/build";
|
|
|
|
|
2012-03-12 03:19:05 +01:00
|
|
|
NIX_CFLAGS_COMPILE="-I${kernel}/lib/modules/${kernel.modDirVersion}/build/include/generated";
|
|
|
|
|
2011-09-28 23:46:07 +02:00
|
|
|
installPhase =
|
|
|
|
''
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p $out/lib/modules/${kernel.modDirVersion}/misc
|
2011-09-28 23:46:07 +02:00
|
|
|
cp -v aufs.ko $out/lib/modules/${kernel.modDirVersion}/misc
|
|
|
|
|
|
|
|
# Install the headers because aufs3-util requires them.
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p $out/include/linux
|
2011-09-28 23:46:07 +02:00
|
|
|
cp -v usr/include/linux/aufs_type.h $out/include/linux
|
|
|
|
'';
|
|
|
|
|
2011-09-28 23:59:07 +02:00
|
|
|
passthru = { inherit patch; };
|
2011-09-28 23:46:07 +02:00
|
|
|
meta = {
|
|
|
|
description = "Another Unionfs implementation for Linux (third generation)";
|
|
|
|
homepage = http://aufs.sourceforge.net/;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.eelco
|
2012-12-17 23:16:48 +01:00
|
|
|
stdenv.lib.maintainers.raskin ];
|
2011-09-28 23:46:07 +02:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|