From 9037126df0050748b3bf65b90a6be36e1c3e8cd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sat, 1 Feb 2014 12:30:23 +0100 Subject: [PATCH] bcache-tools: new package Bcache is a Linux kernel block layer cache. It allows one or more fast disk drives such as flash-based solid state drives (SSDs) to act as a cache for one or more slower hard disk drives. This package contains the required user-space tools. User documentation is in Documentation/bcache.txt in the Linux kernel tree. http://bcache.evilpiepirate.org/ --- .../filesystems/bcache-tools/default.nix | 51 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/tools/filesystems/bcache-tools/default.nix diff --git a/pkgs/tools/filesystems/bcache-tools/default.nix b/pkgs/tools/filesystems/bcache-tools/default.nix new file mode 100644 index 000000000000..183b889da9b3 --- /dev/null +++ b/pkgs/tools/filesystems/bcache-tools/default.nix @@ -0,0 +1,51 @@ +{ stdenv, fetchurl, pkgconfig, utillinux, kmod }: + +stdenv.mkDerivation rec { + name = "bcache-tools-${version}"; + version = "1.0.5"; + + src = fetchurl { + url = "https://github.com/g2p/bcache-tools/archive/v${version}.tar.gz"; + sha256 = "1abf86xcnj601lddig3kmn26jrf8q8xhcyszf5pxrcs5ym72jj8l"; + }; + + buildInputs = [ pkgconfig utillinux ]; + + # * Remove broken install rules (they ignore $PREFIX) for stuff we don't need + # anyway (it's distro specific stuff). + # * Fixup absolute path to modprobe. + prePatch = '' + sed -e "/INSTALL.*initramfs\/hook/d" \ + -e "/INSTALL.*initcpio\/install/d" \ + -e "/INSTALL.*dracut\/module-setup.sh/d" \ + -i Makefile + + sed -e "s|/sbin/modprobe|${kmod}/sbin/modprobe|" -i bcache-register + ''; + + preBuild = '' + export makeFlags="$makeFlags PREFIX=\"$out\" UDEVLIBDIR=\"$out/lib/udev/\""; + ''; + + preInstall = '' + mkdir -p "$out/sbin" "$out/lib/udev/rules.d" "$out/share/man/man8" + ''; + + meta = with stdenv.lib; { + description = "User-space tools required for bcache (Linux block layer cache)"; + longDescription = '' + Bcache is a Linux kernel block layer cache. It allows one or more fast + disk drives such as flash-based solid state drives (SSDs) to act as a + cache for one or more slower hard disk drives. + + This package contains the required user-space tools. + + User documentation is in Documentation/bcache.txt in the Linux kernel + tree. + ''; + homepage = http://bcache.evilpiepirate.org/; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = [ maintainers.bjornfor ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e2cb2a62174f..c0de8b6a2d10 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -532,6 +532,8 @@ let bc = callPackage ../tools/misc/bc { }; + bcache-tools = callPackage ../tools/filesystems/bcache-tools { }; + bchunk = callPackage ../tools/cd-dvd/bchunk { }; bfr = callPackage ../tools/misc/bfr { };