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