summary refs log tree commit diff
path: root/pkgs/os-specific/linux/aufs2.1-util
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2011-03-27 15:18:39 +0000
committerLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2011-03-27 15:18:39 +0000
commit13579049825ab815cfad43cd0eb175f0f0014e1f (patch)
tree4ce1b7351b9a39717b19a66ffbf4c8df01c3f60c /pkgs/os-specific/linux/aufs2.1-util
parentbd3f5e73409b1980825e75e7e1a7cb8ad8b35131 (diff)
downloadnixlib-13579049825ab815cfad43cd0eb175f0f0014e1f.tar
nixlib-13579049825ab815cfad43cd0eb175f0f0014e1f.tar.gz
nixlib-13579049825ab815cfad43cd0eb175f0f0014e1f.tar.bz2
nixlib-13579049825ab815cfad43cd0eb175f0f0014e1f.tar.lz
nixlib-13579049825ab815cfad43cd0eb175f0f0014e1f.tar.xz
nixlib-13579049825ab815cfad43cd0eb175f0f0014e1f.tar.zst
nixlib-13579049825ab815cfad43cd0eb175f0f0014e1f.zip
Committing the aufs2.1 patch by Shea Levy. His comments:
   * My motivation for this patch is that kernels < 2.6.36 contain an
     e1000e that does not support the ethernet card that is part of the
     chipset for the second-generation Core-i Intel CPUs, so in order
     to have a more useful livecd I needed to get aufs working with a
     newer kernel, and 2.6.37 is the latest kernel with an official
     aufs release.
   * All sources are downloaded with fetchgit. This is because the aufs
     upstream doesn't provide release tarballs, they just add a tag to
     their git tree for an official release.
   * The make target for the aufs2.1 headers uses a Makefile in the
     kernel build directory that requires that unifdef be in the
     scripts/ subdirectory of the build directory. The way I've dealt
     with this here is by adding "make $makeFlags -C scripts unifdef"
     to the postBuild in the kernel builder. Since the builder is used
     by all kernel versions, this will require rebuilding every kernel
     and kernel-dependent package if the patch is accepted, so one
     alternative I thought of would be to create a fake kernel build
     directory where everything is symlinked to the real build
     directory except scripts/, which is first copied and then make
     unifdef is run before building aufs2.1. If that more complicated
     solution is preferred, or if anyone has ideas for another one, I
     can do that and submit a new patch.
   * The patch was tested by building a livecd ISO that uses it, then
     running the ISO from within virtualbox and installing aufs2.1-util
     from within the livecd environment.
   * The livecd was built using installation-cd-minimal.nix, with two
     changes to the Nixos tree:
        1. boot.kernelPackages = pkgs.linuxPackages_2_6_37 was added to
           profiles/minimal.nix
        2. config.boot.kernelPackages.aufs2 was changed to
           config.boot.kernelPackages.aufs2_1 in iso-image.nix
     I would have preferred to keep all changes within
     profiles/minimal.nix, but I couldn't figure out how to override
     iso-image.nix's definition of boot.extraModulePackages. Livecds
     that use an older kernel can't be built with this iso-image.nix,
     since we don't have aufs2.1 for them (just aufs2). If someone can
     point me to how I can override things set in iso-image.nix, I'd
     appreciate it.

make -C scripts unifdef compiles the unifdef application in the
scripts/ directory, and when Nix copies over the build tree to
$out/lib/modules/$version/build for kernel modules to reference, it
copies over all of scripts/ except the .o files. I can't speak for
other kernel versions, but at the least for 2.6.37.1 unifdef is not
built by default. If you look at the Makefile in scripts, unifdef is
listed  under a comment saying that the following programs are only
built on-demand.

svn path=/nixpkgs/trunk/; revision=26548
Diffstat (limited to 'pkgs/os-specific/linux/aufs2.1-util')
-rw-r--r--pkgs/os-specific/linux/aufs2.1-util/default.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/aufs2.1-util/default.nix b/pkgs/os-specific/linux/aufs2.1-util/default.nix
new file mode 100644
index 000000000000..a12a0900ca40
--- /dev/null
+++ b/pkgs/os-specific/linux/aufs2.1-util/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchgit, kernel, aufs2_1 }:
+
+let version = "20110217"; in
+
+stdenv.mkDerivation {
+  name = "aufs2.1-util-${version}";
+
+  src = fetchgit {
+    url = "git://git.c3sl.ufpr.br/aufs/aufs2-util.git";
+    rev = "0f0cf3f2ae39906fd4b5376cdaa24e9fe64a03f4";
+    sha256 = "0fce5601b67efe8b5652a813ae612348bf4503aa71056cd31a5ed0406632e364";
+  };
+
+  buildInputs = [ aufs2_1 ];
+
+  makeFlags =
+    [ "KDIR=${kernel}/lib/modules/${kernel.version}/build"
+      "Install=install"
+      "DESTDIR=$(out)"
+    ];
+
+  postInstall =
+    ''
+      mv $out/usr/* $out
+      rmdir $out/usr
+
+      cp aufs.shlib $out/lib/
+
+      substituteInPlace $out/bin/aubrsync \
+        --replace /sbin/mount $out/sbin/mount \
+        --replace /usr/lib/aufs.shlib $out/lib/aufs.shlib
+    '';
+
+  meta = {
+    description = "Utilities for AUFS2.1";
+    homepage = http://aufs.sourceforge.net/;
+    maintainers = [ stdenv.lib.maintainers.eelco 
+                    stdenv.lib.maintainers.shlevy ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}