git.iko.soy/typeable/nixpkgs
on master help sign in
Merge branch 'nixpart-1.0-preparations'.

Partially and temporarily addresses NixOS/nixops#228. We now have an up-to-date version of Blivet and a bunch of its dependen- cies as well as the old nixpart 0.4 with all its old and crappy dependencies, which should fix _simple_ partitioning layouts for NixOps. Also, nixpart 1.0 is now marked as broken, because it is not yet released and this branch is more of a preparation and "damage control" in case I shouldn't manage to finish nixpart + nixos-assimilate in time for the next NixOS release.

commit57aaf3d36e431d36acf447bb7b3f52bd17c29f04 authoraszlig <aszlig@redmoonstudios.org> dateWed 22 Oct 2014, 08:23 (12 years ago) parent8953fb578ef5f9
21 files changed+630−52
nixos/modules/module-list.nix+1 nixos/modules/tasks/filesystems/jfs.nix+19 nixos/release.nix+1 nixos/tests/blivet.nix+85 nixos/tests/partition.nix+2−2 pkgs/development/python-modules/blivet/default.nix+18−28 pkgs/tools/filesystems/btrfsprogs/default.nix+2−2 pkgs/tools/filesystems/nixpart/0.4/blivet.nix+54 pkgs/tools/filesystems/nixpart/0.4/cryptsetup.nix+28 pkgs/tools/filesystems/nixpart/0.4/default.nix+76 pkgs/tools/filesystems/nixpart/0.4/dmraid.nix+26 pkgs/tools/filesystems/nixpart/0.4/lvm2.nix+58 pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix+34 pkgs/tools/filesystems/nixpart/0.4/parted.nix+57 pkgs/tools/filesystems/nixpart/0.4/pyblock.nix+29 pkgs/tools/filesystems/nixpart/0.4/pykickstart.nix+30 pkgs/tools/filesystems/nixpart/0.4/pyparted.nix+42 pkgs/tools/filesystems/nixpart/default.nix+5−13 pkgs/tools/misc/parted/default.nix+10−4 pkgs/tools/misc/parted/gpt-unicode-test-fix.patch+38 pkgs/top-level/python-packages.nix+15−3
nixos/modules/module-list.nix+1
@@ -364,6 +364,7 @@
364364 ./tasks/filesystems/cifs.nix
365365 ./tasks/filesystems/ext.nix
366366 ./tasks/filesystems/f2fs.nix
367+ ./tasks/filesystems/jfs.nix
367368 ./tasks/filesystems/nfs.nix
368369 ./tasks/filesystems/reiserfs.nix
369370 ./tasks/filesystems/unionfs-fuse.nix
nixos/modules/tasks/filesystems/jfs.nixnew file+19
@@ -0,0 +1,19 @@
1+{ config, lib, pkgs, ... }:
2+
3+with lib;
4+
5+let
6+ inInitrd = any (fs: fs == "jfs") config.boot.initrd.supportedFilesystems;
7+in
8+{
9+ config = mkIf (any (fs: fs == "jfs") config.boot.supportedFilesystems) {
10+
11+ system.fsPackages = [ pkgs.jfsutils ];
12+
13+ boot.initrd.kernelModules = mkIf inInitrd [ "jfs" ];
14+
15+ boot.initrd.extraUtilsCommands = mkIf inInitrd ''
16+ cp -v ${pkgs.jfsutils}/sbin/fsck.jfs "$out/bin/"
17+ '';
18+ };
19+}
nixos/release.nix+1
@@ -234,6 +234,7 @@ in rec {
234234 # ‘nix-build tests/login.nix -A result’.
235235 tests.avahi = callTest tests/avahi.nix {};
236236 tests.bittorrent = callTest tests/bittorrent.nix {};
237+ tests.blivet = callTest tests/blivet.nix {};
237238 tests.containers = callTest tests/containers.nix {};
238239 tests.firefox = callTest tests/firefox.nix {};
239240 tests.firewall = callTest tests/firewall.nix {};
nixos/tests/blivet.nixnew file+85
@@ -0,0 +1,85 @@
1+import ./make-test.nix ({ pkgs, ... }: with pkgs.pythonPackages; rec {
2+ name = "blivet";
3+
4+ machine = {
5+ environment.systemPackages = [ pkgs.python blivet mock ];
6+ boot.supportedFilesystems = [ "btrfs" "jfs" "reiserfs" "xfs" ];
7+ virtualisation.memorySize = 768;
8+ };
9+
10+ debugBlivet = false;
11+ debugProgramCalls = false;
12+
13+ pythonTestRunner = pkgs.writeText "run-blivet-tests.py" ''
14+ import sys
15+ import logging
16+
17+ from unittest import TestLoader
18+ from unittest.runner import TextTestRunner
19+
20+ ${pkgs.lib.optionalString debugProgramCalls ''
21+ blivet_program_log = logging.getLogger("program")
22+ blivet_program_log.setLevel(logging.DEBUG)
23+ blivet_program_log.addHandler(logging.StreamHandler(sys.stderr))
24+ ''}
25+
26+ ${pkgs.lib.optionalString debugBlivet ''
27+ blivet_log = logging.getLogger("blivet")
28+ blivet_log.setLevel(logging.DEBUG)
29+ blivet_log.addHandler(logging.StreamHandler(sys.stderr))
30+ ''}
31+
32+ runner = TextTestRunner(verbosity=2, failfast=False, buffer=False)
33+ result = runner.run(TestLoader().discover('tests/', pattern='*_test.py'))
34+ sys.exit(not result.wasSuccessful())
35+ '';
36+
37+ blivetTest = pkgs.writeScript "blivet-test.sh" ''
38+ #!${pkgs.stdenv.shell} -e
39+
40+ # Use the hosts temporary directory, because we have a tmpfs within the VM
41+ # and we don't want to increase the memory size of the VM for no reason.
42+ mkdir -p /tmp/xchg/bigtmp
43+ TMPDIR=/tmp/xchg/bigtmp
44+ export TMPDIR
45+
46+ mkPythonPath() {
47+ nix-store -qR "$@" \
48+ | sed -e 's|$|/lib/${pkgs.python.libPrefix}/site-packages|'
49+ }
50+
51+ cp -Rd "${blivet.src}/tests" .
52+
53+ # Skip SELinux tests
54+ rm -f tests/formats_test/selinux_test.py
55+
56+ # Race conditions in growing/shrinking during resync
57+ rm -f tests/devicelibs_test/mdraid_*
58+
59+ # Deactivate small BTRFS device test, because it fails with newer btrfsprogs
60+ sed -i -e '/^class *BTRFSAsRootTestCase3(/,/^[^ ]/ {
61+ /^class *BTRFSAsRootTestCase3(/d
62+ /^$/d
63+ /^ /d
64+ }' tests/devicelibs_test/btrfs_test.py
65+
66+ # How on earth can these tests ever work even upstream? O_o
67+ sed -i -e '/def testDiskChunk[12]/,/^ *[^ ]/{n; s/^ */&return # /}' \
68+ tests/partitioning_test.py
69+
70+ # fix hardcoded temporary directory
71+ sed -i \
72+ -e '1i import tempfile' \
73+ -e 's|_STORE_FILE_PATH = .*|_STORE_FILE_PATH = tempfile.gettempdir()|' \
74+ tests/loopbackedtestcase.py
75+
76+ PYTHONPATH=".:$(mkPythonPath "${blivet}" "${mock}" | paste -sd :)" \
77+ python "${pythonTestRunner}"
78+ '';
79+
80+ testScript = ''
81+ $machine->waitForUnit("multi-user.target");
82+ $machine->succeed("${blivetTest}");
83+ $machine->execute("rm -rf /tmp/xchg/bigtmp");
84+ '';
85+})
nixos/tests/partition.nix+2−2
@@ -67,7 +67,7 @@ in {
6767
6868 machine = { config, pkgs, ... }: {
6969 environment.systemPackages = [
70− pkgs.pythonPackages.nixpart
70+ pkgs.pythonPackages.nixpart0
7171 pkgs.file pkgs.btrfsProgs pkgs.xfsprogs pkgs.lvm2
7272 ];
7373 virtualisation.emptyDiskImages = [ 4096 4096 ];
@@ -209,7 +209,7 @@ in {
209209 ensurePartition("swap", "swap");
210210 ensurePartition("boot", "f2fs");
211211 ensurePartition("root", "f2fs");
212− remoteAndCheck;
212+ remountAndCheck;
213213 ensureMountPoint("/mnt/boot", "f2fs");
214214 };
215215
pkgs/development/python-modules/blivet/default.nix+18−28
@@ -1,52 +1,42 @@
1−{ stdenv, fetchurl, buildPythonPackage, pykickstart, pyparted, pyblock
2−, libselinux, cryptsetup, multipath_tools, lsof, utillinux
3−, useNixUdev ? true, udev ? null
4−# This is only used when useNixUdev is false
5−, udevSoMajor ? 1
1+{ stdenv, fetchFromGitHub, buildPythonPackage, pykickstart, pyparted, pyblock
2+, pyudev, six, libselinux, cryptsetup, multipath_tools, lsof, utillinux
63}:
74
8−assert useNixUdev -> udev != null;
9−
105let
116 pyenable = { enablePython = true; };
127 selinuxWithPython = libselinux.override pyenable;
138 cryptsetupWithPython = cryptsetup.override pyenable;
149in buildPythonPackage rec {
1510 name = "blivet-${version}";
16− version = "0.17-1";
11+ version = "0.67";
1712
18− src = fetchurl {
19− url = "https://git.fedorahosted.org/cgit/blivet.git/snapshot/"
20− + "${name}.tar.bz2";
21− sha256 = "1k3mws2q0ryb7422mml6idmaasz2i2v6ngyvg6d976dx090qnmci";
13+ src = fetchFromGitHub {
14+ owner = "dwlehman";
15+ repo = "blivet";
16+ rev = name;
17+ sha256 = "1gk94ghjrxfqnx53hph1j2s7qcv86fjz48is7l099q9c24rjv8ky";
2218 };
2319
2420 postPatch = ''
25− sed -i -e 's|"multipath"|"${multipath_tools}/sbin/multipath"|' \
26− blivet/devicelibs/mpath.py blivet/devices.py
21+ sed -i \
22+ -e 's|"multipath"|"${multipath_tools}/sbin/multipath"|' \
23+ -e '/^def set_friendly_names/a \ return False' \
24+ blivet/devicelibs/mpath.py
2725 sed -i -e '/"wipefs"/ {
2826 s|wipefs|${utillinux}/sbin/wipefs|
2927 s/-f/--force/
3028 }' blivet/formats/__init__.py
3129 sed -i -e 's|"lsof"|"${lsof}/bin/lsof"|' blivet/formats/fs.py
3230 sed -i -r -e 's|"(u?mount)"|"${utillinux}/bin/\1"|' blivet/util.py
33− sed -i '/pvscan/s/, *"--cache"//' blivet/devicelibs/lvm.py
34− '' + (if useNixUdev then ''
35− sed -i -e '/find_library/,/find_library/ {
36− c libudev = "${udev}/lib/libudev.so.1"
37− }' blivet/pyudev.py
38− '' else ''
39− sed -i \
40− -e '/^somajor *=/s/=.*/= ${toString udevSoMajor}/p' \
41− -e 's|common =.*|& + ["/lib/x86_64-linux-gnu", "/lib/i686-linux-gnu"]|' \
42− blivet/pyudev.py
43− '');
31+ sed -i -e '/pvscan/s/, *"--cache"//' blivet/devicelibs/lvm.py
32+ '';
4433
4534 propagatedBuildInputs = [
46− pykickstart pyparted pyblock selinuxWithPython cryptsetupWithPython
47− ] ++ stdenv.lib.optional useNixUdev udev;
35+ pykickstart pyparted pyblock pyudev selinuxWithPython cryptsetupWithPython
36+ six
37+ ];
4838
49− # tests are currently _heavily_ broken upstream
39+ # Tests are in <nixos/tests/blivet.nix>.
5040 doCheck = false;
5141
5242 meta = {
pkgs/tools/filesystems/btrfsprogs/default.nix+2−2
@@ -1,14 +1,14 @@
11{ stdenv, fetchurl, attr, acl, zlib, libuuid, e2fsprogs, lzo
22, asciidoc, xmlto, docbook_xml_dtd_45, docbook_xsl, libxslt }:
33
4−let version = "3.16.2"; in
4+let version = "3.17"; in
55
66stdenv.mkDerivation rec {
77 name = "btrfs-progs-${version}";
88
99 src = fetchurl {
1010 url = "mirror://kernel/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v${version}.tar.xz";
11− sha256 = "0avk8x0k91zrqvlbk8r067aw49byr8hvvr4niy48d3ib1jz2mmnl";
11+ sha256 = "187hdfh10hrabvldqmhg88wdv0s9r7hc5264v83ykir9wxqvzbzc";
1212 };
1313
1414 buildInputs = [
pkgs/tools/filesystems/nixpart/0.4/blivet.nixnew file+54
@@ -0,0 +1,54 @@
1+{ stdenv, fetchurl, buildPythonPackage, pykickstart, pyparted, pyblock
2+, libselinux, cryptsetup, multipath_tools, lsof, utillinux
3+, useNixUdev ? true, udev ? null
4+# This is only used when useNixUdev is false
5+, udevSoMajor ? 1
6+}:
7+
8+assert useNixUdev -> udev != null;
9+
10+buildPythonPackage rec {
11+ name = "blivet-${version}";
12+ version = "0.17-1";
13+
14+ src = fetchurl {
15+ url = "https://git.fedorahosted.org/cgit/blivet.git/snapshot/"
16+ + "${name}.tar.bz2";
17+ sha256 = "1k3mws2q0ryb7422mml6idmaasz2i2v6ngyvg6d976dx090qnmci";
18+ };
19+
20+ postPatch = ''
21+ sed -i -e 's|"multipath"|"${multipath_tools}/sbin/multipath"|' \
22+ blivet/devicelibs/mpath.py blivet/devices.py
23+ sed -i -e '/"wipefs"/ {
24+ s|wipefs|${utillinux}/sbin/wipefs|
25+ s/-f/--force/
26+ }' blivet/formats/__init__.py
27+ sed -i -e 's|"lsof"|"${lsof}/bin/lsof"|' blivet/formats/fs.py
28+ sed -i -r -e 's|"(u?mount)"|"${utillinux}/bin/\1"|' blivet/util.py
29+ sed -i '/pvscan/s/, *"--cache"//' blivet/devicelibs/lvm.py
30+ '' + (if useNixUdev then ''
31+ sed -i -e '/find_library/,/find_library/ {
32+ c libudev = "${udev}/lib/libudev.so.1"
33+ }' blivet/pyudev.py
34+ '' else ''
35+ sed -i \
36+ -e '/^somajor *=/s/=.*/= ${toString udevSoMajor}/p' \
37+ -e 's|common =.*|& + ["/lib/x86_64-linux-gnu", "/lib/i686-linux-gnu"]|' \
38+ blivet/pyudev.py
39+ '');
40+
41+ propagatedBuildInputs = [
42+ pykickstart pyparted pyblock libselinux cryptsetup
43+ ] ++ stdenv.lib.optional useNixUdev udev;
44+
45+ # tests are currently _heavily_ broken upstream
46+ doCheck = false;
47+
48+ meta = {
49+ homepage = "https://fedoraproject.org/wiki/Blivet";
50+ description = "Module for management of a system's storage configuration";
51+ license = [ "GPLv2+" "LGPLv2.1+" ];
52+ platforms = stdenv.lib.platforms.linux;
53+ };
54+}
pkgs/tools/filesystems/nixpart/0.4/cryptsetup.nixnew file+28
@@ -0,0 +1,28 @@
1+{ stdenv, fetchurl, devicemapper, libgcrypt, libuuid, pkgconfig, popt
2+, enablePython ? true, python ? null
3+}:
4+
5+assert enablePython -> python != null;
6+
7+stdenv.mkDerivation rec {
8+ name = "cryptsetup-1.6.3";
9+
10+ src = fetchurl {
11+ url = "http://cryptsetup.googlecode.com/files/${name}.tar.bz2";
12+ sha256 = "1n1qk5chyjspbiianrdb55fhb4wl0vfyqz2br05vfb24v4qlgbx2";
13+ };
14+
15+ configureFlags = [ "--enable-cryptsetup-reencrypt" ]
16+ ++ stdenv.lib.optional enablePython "--enable-python";
17+
18+ buildInputs = [ devicemapper libgcrypt libuuid pkgconfig popt ]
19+ ++ stdenv.lib.optional enablePython python;
20+
21+ meta = {
22+ homepage = http://code.google.com/p/cryptsetup/;
23+ description = "LUKS for dm-crypt";
24+ license = stdenv.lib.licenses.gpl2;
25+ maintainers = with stdenv.lib.maintainers; [ viric chaoflow ];
26+ platforms = with stdenv.lib.platforms; linux;
27+ };
28+}
pkgs/tools/filesystems/nixpart/0.4/default.nixnew file+76
@@ -0,0 +1,76 @@
1+{ stdenv, fetchurl, python, buildPythonPackage
2+# Propagated to blivet
3+, useNixUdev ? true, udevSoMajor ? null
4+# Propagated dependencies
5+, pkgs, urlgrabber
6+}:
7+
8+let
9+ blivet = import ./blivet.nix {
10+ inherit stdenv fetchurl buildPythonPackage;
11+ inherit pykickstart pyparted pyblock cryptsetup multipath_tools;
12+ inherit useNixUdev udevSoMajor;
13+ inherit (pkgs) lsof utillinux udev;
14+ libselinux = pkgs.libselinux.override { enablePython = true; };
15+ };
16+
17+ cryptsetup = import ./cryptsetup.nix {
18+ inherit stdenv fetchurl python;
19+ inherit (pkgs) pkgconfig libgcrypt libuuid popt;
20+ devicemapper = lvm2;
21+ };
22+
23+ dmraid = import ./dmraid.nix {
24+ inherit stdenv fetchurl;
25+ devicemapper = lvm2;
26+ };
27+
28+ lvm2 = import ./lvm2.nix {
29+ inherit stdenv fetchurl;
30+ inherit (pkgs) pkgconfig utillinux udev coreutils;
31+ };
32+
33+ multipath_tools = import ./multipath-tools.nix {
34+ inherit stdenv fetchurl lvm2;
35+ inherit (pkgs) readline udev libaio gzip;
36+ };
37+
38+ parted = import ./parted.nix {
39+ inherit stdenv fetchurl;
40+ inherit (pkgs) utillinux readline libuuid gettext check;
41+ devicemapper = lvm2;
42+ };
43+
44+ pyblock = import ./pyblock.nix {
45+ inherit stdenv fetchurl python lvm2 dmraid;
46+ };
47+
48+ pykickstart = import ./pykickstart.nix {
49+ inherit stdenv fetchurl python buildPythonPackage urlgrabber;
50+ };
51+
52+ pyparted = import ./pyparted.nix {
53+ inherit stdenv fetchurl python buildPythonPackage parted;
54+ inherit (pkgs) pkgconfig e2fsprogs;
55+ };
56+
57+in buildPythonPackage rec {
58+ name = "nixpart-${version}";
59+ version = "0.4.1";
60+
61+ src = fetchurl {
62+ url = "https://github.com/aszlig/nixpart/archive/v${version}.tar.gz";
63+ sha256 = "0avwd8p47xy9cydlbjxk8pj8q75zyl68gw2w6fnkk78dcb1a3swp";
64+ };
65+
66+ propagatedBuildInputs = [ blivet ];
67+
68+ doCheck = false;
69+
70+ meta = {
71+ description = "NixOS storage manager/partitioner";
72+ license = stdenv.lib.licenses.gpl2Plus;
73+ maintainers = [ stdenv.lib.maintainers.aszlig ];
74+ platforms = stdenv.lib.platforms.linux;
75+ };
76+}
pkgs/tools/filesystems/nixpart/0.4/dmraid.nixnew file+26
@@ -0,0 +1,26 @@
1+{ stdenv, fetchurl, devicemapper }:
2+
3+stdenv.mkDerivation rec {
4+ name = "dmraid-1.0.0.rc15";
5+
6+ src = fetchurl {
7+ url = "http://people.redhat.com/~heinzm/sw/dmraid/src/old/${name}.tar.bz2";
8+ sha256 = "01bcaq0sc329ghgj7f182xws7jgjpdc41bvris8fsiprnxc7511h";
9+ };
10+
11+ preConfigure = "cd */";
12+
13+ buildInputs = [ devicemapper ];
14+
15+ meta = {
16+ description = "Old-style RAID configuration utility";
17+ longDescritipn = ''
18+ Old RAID configuration utility (still under development, though).
19+ It is fully compatible with modern kernels and mdadm recognizes
20+ its volumes. May be needed for rescuing an older system or nuking
21+ the metadata when reformatting.
22+ '';
23+ maintainers = [ stdenv.lib.maintainers.raskin ];
24+ platforms = stdenv.lib.platforms.linux;
25+ };
26+}
pkgs/tools/filesystems/nixpart/0.4/lvm2.nixnew file+58
@@ -0,0 +1,58 @@
1+{ stdenv, fetchurl, pkgconfig, udev, utillinux, coreutils }:
2+
3+let
4+ v = "2.02.106";
5+in
6+
7+stdenv.mkDerivation {
8+ name = "lvm2-${v}";
9+
10+ src = fetchurl {
11+ url = "ftp://sources.redhat.com/pub/lvm2/releases/LVM2.${v}.tgz";
12+ sha256 = "0nr833bl0q4zq52drjxmmpf7bs6kqxwa5kahwwxm9411khkxz0vc";
13+ };
14+
15+ configureFlags =
16+ "--disable-readline --enable-udev_rules --enable-udev_sync --enable-pkgconfig --enable-applib";
17+
18+ buildInputs = [ pkgconfig udev ];
19+
20+ preConfigure =
21+ ''
22+ substituteInPlace scripts/lvmdump.sh \
23+ --replace /usr/bin/tr ${coreutils}/bin/tr
24+ substituteInPlace scripts/lvm2_activation_generator_systemd_red_hat.c \
25+ --replace /usr/sbin/lvm $out/sbin/lvm \
26+ --replace /usr/bin/udevadm ${udev}/bin/udevadm
27+
28+ sed -i /DEFAULT_SYS_DIR/d Makefile.in
29+ sed -i /DEFAULT_PROFILE_DIR/d conf/Makefile.in
30+ '';
31+
32+ enableParallelBuilding = true;
33+
34+ #patches = [ ./purity.patch ];
35+
36+ # To prevent make install from failing.
37+ preInstall = "installFlags=\"OWNER= GROUP= confdir=$out/etc\"";
38+
39+ # Install systemd stuff.
40+ #installTargets = "install install_systemd_generators install_systemd_units install_tmpfiles_configuration";
41+
42+ postInstall =
43+ ''
44+ substituteInPlace $out/lib/udev/rules.d/13-dm-disk.rules \
45+ --replace $out/sbin/blkid ${utillinux}/sbin/blkid
46+
47+ # Systemd stuff
48+ mkdir -p $out/etc/systemd/system $out/lib/systemd/system-generators
49+ cp scripts/blk_availability_systemd_red_hat.service $out/etc/systemd/system
50+ cp scripts/lvm2_activation_generator_systemd_red_hat $out/lib/systemd/system-generators
51+ '';
52+
53+ meta = {
54+ homepage = http://sourceware.org/lvm2/;
55+ descriptions = "Tools to support Logical Volume Management (LVM) on Linux";
56+ platforms = stdenv.lib.platforms.linux;
57+ };
58+}
pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nixnew file+34
@@ -0,0 +1,34 @@
1+{ stdenv, fetchurl, lvm2, libaio, gzip, readline, udev }:
2+
3+stdenv.mkDerivation rec {
4+ name = "multipath-tools-0.4.9";
5+
6+ src = fetchurl {
7+ url = "http://christophe.varoqui.free.fr/multipath-tools/${name}.tar.bz2";
8+ sha256 = "04n7kazp1zrlqfza32phmqla0xkcq4zwn176qff5ida4a60whi4d";
9+ };
10+
11+ sourceRoot = ".";
12+
13+ buildInputs = [ lvm2 libaio readline ];
14+
15+ preBuild =
16+ ''
17+ makeFlagsArray=(GZIP="${gzip}/bin/gzip -9 -c" prefix=$out mandir=$out/share/man/man8 man5dir=$out/share/man/man5 LIB=lib)
18+
19+ substituteInPlace multipath/Makefile --replace /etc $out/etc
20+ substituteInPlace kpartx/Makefile --replace /etc $out/etc
21+
22+ substituteInPlace kpartx/kpartx.rules --replace /sbin/kpartx $out/sbin/kpartx
23+ substituteInPlace kpartx/kpartx_id --replace /sbin/dmsetup ${lvm2}/sbin/dmsetup
24+
25+ substituteInPlace libmultipath/defaults.h --replace /lib/udev/scsi_id ${udev}/lib/udev/scsi_id
26+ substituteInPlace libmultipath/hwtable.c --replace /lib/udev/scsi_id ${udev}/lib/udev/scsi_id
27+ '';
28+
29+ meta = {
30+ description = "Tools for the Linux multipathing driver";
31+ homepage = http://christophe.varoqui.free.fr/;
32+ platforms = stdenv.lib.platforms.linux;
33+ };
34+}
pkgs/tools/filesystems/nixpart/0.4/parted.nixnew file+57
@@ -0,0 +1,57 @@
1+{ stdenv, fetchurl, devicemapper, libuuid, gettext, readline
2+, utillinux, check, enableStatic ? false, hurd ? null }:
3+
4+stdenv.mkDerivation rec {
5+ name = "parted-3.1";
6+
7+ src = fetchurl {
8+ url = "mirror://gnu/parted/${name}.tar.xz";
9+ sha256 = "05fa4m1bky9d13hqv91jlnngzlyn7y4rnnyq6d86w0dg3vww372y";
10+ };
11+
12+ buildInputs = [ libuuid ]
13+ ++ stdenv.lib.optional (readline != null) readline
14+ ++ stdenv.lib.optional (gettext != null) gettext
15+ ++ stdenv.lib.optional (devicemapper != null) devicemapper
16+ ++ stdenv.lib.optional (hurd != null) hurd
17+ ++ stdenv.lib.optional doCheck check;
18+
19+ configureFlags =
20+ (if (readline != null)
21+ then [ "--with-readline" ]
22+ else [ "--without-readline" ])
23+ ++ stdenv.lib.optional (devicemapper == null) "--disable-device-mapper"
24+ ++ stdenv.lib.optional enableStatic "--enable-static";
25+
26+ doCheck = true;
27+
28+ preCheck =
29+ stdenv.lib.optionalString doCheck
30+ # The `t0400-loop-clobber-infloop.sh' test wants `mkswap'.
31+ "export PATH=\"${utillinux}/sbin:$PATH\"";
32+
33+ meta = {
34+ description = "Create, destroy, resize, check, and copy partitions";
35+
36+ longDescription = ''
37+ GNU Parted is an industrial-strength package for creating, destroying,
38+ resizing, checking and copying partitions, and the file systems on
39+ them. This is useful for creating space for new operating systems,
40+ reorganising disk usage, copying data on hard disks and disk imaging.
41+
42+ It contains a library, libparted, and a command-line frontend, parted,
43+ which also serves as a sample implementation and script backend.
44+ '';
45+
46+ homepage = http://www.gnu.org/software/parted/;
47+ license = stdenv.lib.licenses.gpl3Plus;
48+
49+ maintainers = [
50+ # Add your name here!
51+ stdenv.lib.maintainers.ludo
52+ ];
53+
54+ # GNU Parted requires libuuid, which is part of util-linux-ng.
55+ platforms = stdenv.lib.platforms.linux;
56+ };
57+}
pkgs/tools/filesystems/nixpart/0.4/pyblock.nixnew file+29
@@ -0,0 +1,29 @@
1+{ stdenv, fetchurl, python, lvm2, dmraid }:
2+
3+stdenv.mkDerivation rec {
4+ name = "pyblock-${version}";
5+ version = "0.53";
6+
7+ src = fetchurl rec {
8+ url = "http://pkgs.fedoraproject.org/repo/pkgs/python-pyblock/"
9+ + "${name}.tar.bz2/${md5}/${name}.tar.bz2";
10+ md5 = "f6d33a8362dee358517d0a9e2ebdd044";
11+ };
12+
13+ postPatch = ''
14+ sed -i -e 's|/usr/include/python|${python}/include/python|' \
15+ -e 's/-Werror *//' -e 's|/usr/|'"$out"'/|' Makefile
16+ '';
17+
18+ buildInputs = [ python lvm2 dmraid ];
19+
20+ makeFlags = [
21+ "USESELINUX=0"
22+ "SITELIB=$(out)/lib/${python.libPrefix}/site-packages"
23+ ];
24+
25+ meta = {
26+ description = "Interface for working with block devices";
27+ license = stdenv.lib.licenses.gpl2Plus;
28+ };
29+}
pkgs/tools/filesystems/nixpart/0.4/pykickstart.nixnew file+30
@@ -0,0 +1,30 @@
1+{ stdenv, python, buildPythonPackage, fetchurl, urlgrabber }:
2+
3+buildPythonPackage rec {
4+ name = "pykickstart-${version}";
5+ version = "1.99.39";
6+
7+ src = fetchurl rec {
8+ url = "http://pkgs.fedoraproject.org/repo/pkgs/pykickstart/"
9+ + "${name}.tar.gz/${md5}/${name}.tar.gz";
10+ md5 = "d249f60aa89b1b4facd63f776925116d";
11+ };
12+
13+ postPatch = ''
14+ sed -i -e "s/for tst in tstList/for tst in sorted(tstList, \
15+ key=lambda m: m.__name__)/" tests/baseclass.py
16+ '';
17+
18+ propagatedBuildInputs = [ urlgrabber ];
19+
20+ checkPhase = ''
21+ export PYTHONPATH="$PYTHONPATH:."
22+ ${python}/bin/${python.executable} tests/baseclass.py -vv
23+ '';
24+
25+ meta = {
26+ homepage = "http://fedoraproject.org/wiki/Pykickstart";
27+ description = "Read and write Fedora kickstart files";
28+ license = stdenv.lib.licenses.gpl2Plus;
29+ };
30+}
pkgs/tools/filesystems/nixpart/0.4/pyparted.nixnew file+42
@@ -0,0 +1,42 @@
1+{ stdenv, fetchurl, pkgconfig, python, buildPythonPackage, parted, e2fsprogs }:
2+
3+buildPythonPackage rec {
4+ name = "pyparted-${version}";
5+ version = "3.10";
6+
7+ src = fetchurl {
8+ url = "https://fedorahosted.org/releases/p/y/pyparted/${name}.tar.gz";
9+ sha256 = "17wq4invmv1nfazaksf59ymqyvgv3i8h4q03ry2az0s9lldyg3dv";
10+ };
11+
12+ postPatch = ''
13+ sed -i -e 's|/sbin/mke2fs|${e2fsprogs}&|' tests/baseclass.py
14+ sed -i -e '
15+ s|e\.path\.startswith("/tmp/temp-device-")|"temp-device-" in e.path|
16+ ' tests/test__ped_ped.py
17+ '' + stdenv.lib.optionalString stdenv.isi686 ''
18+ # remove some integers in this test case which overflow on 32bit systems
19+ sed -i -r -e '/class *UnitGetSizeTestCase/,/^$/{/[0-9]{11}/d}' \
20+ tests/test__ped_ped.py
21+ '';
22+
23+ preConfigure = ''
24+ PATH="${parted}/sbin:$PATH"
25+ '';
26+
27+ buildInputs = [ pkgconfig ];
28+
29+ propagatedBuildInputs = [ parted ];
30+
31+ checkPhase = ''
32+ patchShebangs Makefile
33+ make test PYTHON=${python.executable}
34+ '';
35+
36+ meta = {
37+ homepage = "https://fedorahosted.org/pyparted/";
38+ description = "Python interface for libparted";
39+ license = stdenv.lib.licenses.gpl2Plus;
40+ platforms = stdenv.lib.platforms.linux;
41+ };
42+}
pkgs/tools/filesystems/nixpart/default.nix+5−13
@@ -1,29 +1,21 @@
1−{ stdenv, fetchurl, buildPythonPackage, blivet
2−# Propagated to blivet
3−, useNixUdev ? null, udevSoMajor ? null
4−}:
1+{ stdenv, fetchurl, buildPythonPackage, blivet }:
52
6−let
7− blivetOverrides = stdenv.lib.filterAttrs (k: v: v != null) {
8− inherit useNixUdev udevSoMajor;
9− };
10−in buildPythonPackage rec {
3+buildPythonPackage rec {
114 name = "nixpart-${version}";
12− version = "0.4.1";
5+ version = "1.0.0";
136
147 src = fetchurl {
158 url = "https://github.com/aszlig/nixpart/archive/v${version}.tar.gz";
169 sha256 = "0avwd8p47xy9cydlbjxk8pj8q75zyl68gw2w6fnkk78dcb1a3swp";
1710 };
1811
19− propagatedBuildInputs = [ (blivet.override blivetOverrides) ];
20−
21− doCheck = false;
12+ propagatedBuildInputs = [ blivet ];
2213
2314 meta = {
2415 description = "NixOS storage manager/partitioner";
2516 license = stdenv.lib.licenses.gpl2Plus;
2617 maintainers = [ stdenv.lib.maintainers.aszlig ];
2718 platforms = stdenv.lib.platforms.linux;
19+ broken = true;
2820 };
2921}
pkgs/tools/misc/parted/default.nix+10−4
@@ -1,20 +1,26 @@
1−{ stdenv, fetchurl, devicemapper, libuuid, gettext, readline
1+{ stdenv, fetchurl, devicemapper, libuuid, gettext, readline, perl, python
22, utillinux, check, enableStatic ? false, hurd ? null }:
33
44stdenv.mkDerivation rec {
5− name = "parted-3.1";
5+ name = "parted-3.2";
66
77 src = fetchurl {
88 url = "mirror://gnu/parted/${name}.tar.xz";
9− sha256 = "05fa4m1bky9d13hqv91jlnngzlyn7y4rnnyq6d86w0dg3vww372y";
9+ sha256 = "1r3qpg3bhz37mgvp9chsaa3k0csby3vayfvz8ggsqz194af5i2w5";
1010 };
1111
12+ patches = stdenv.lib.optional doCheck ./gpt-unicode-test-fix.patch;
13+
14+ postPatch = stdenv.lib.optionalString doCheck ''
15+ patchShebangs tests
16+ '';
17+
1218 buildInputs = [ libuuid ]
1319 ++ stdenv.lib.optional (readline != null) readline
1420 ++ stdenv.lib.optional (gettext != null) gettext
1521 ++ stdenv.lib.optional (devicemapper != null) devicemapper
1622 ++ stdenv.lib.optional (hurd != null) hurd
17− ++ stdenv.lib.optional doCheck check;
23+ ++ stdenv.lib.optionals doCheck [ check perl python ];
1824
1925 configureFlags =
2026 (if (readline != null)
pkgs/tools/misc/parted/gpt-unicode-test-fix.patchnew file+38
@@ -0,0 +1,38 @@
1+From Ludo's suggestion at:
2+
3+ http://debbugs.gnu.org/cgi/bugreport.cgi?msg=8;bug=18258
4+
5+diff --git a/tests/.t0251-gpt-unicode.sh.swp b/tests/.t0251-gpt-unicode.sh.swp
6+deleted file mode 100644
7+index b41c337..0000000
8+Binary files a/tests/.t0251-gpt-unicode.sh.swp and /dev/null differ
9+diff --git a/tests/t0251-gpt-unicode.sh b/tests/t0251-gpt-unicode.sh
10+index c845950..fa63a72 100755
11+--- a/tests/t0251-gpt-unicode.sh
12++++ b/tests/t0251-gpt-unicode.sh
13+@@ -22,7 +22,24 @@ dev=loop-file
14+ # create zeroed device
15+ truncate -s 10m $dev || fail=1
16+
17+-export LC_ALL=C.UTF-8
18++found_locale=no
19++for locale in en_US de_DE fr_FR es_ES
20++do
21++ LC_ALL="$locale.UTF-8"
22++ export LC_ALL
23++
24++ # In a UTF-8 locale, the string below prints as 4 characters.
25++ if [ `printf 'foo\341\264\244' | wc -m` -eq 4 ]; then
26++ found_locale=yes
27++ break
28++ fi
29++done
30++
31++if [ "$found_locale" != "yes" ]; then
32++ echo "no valid UTF-8 locale found; skipping" >&2
33++ exit 77
34++fi
35++
36+ # create gpt label with named partition
37+ part_name=$(printf 'foo\341\264\244')
38+ parted -s $dev mklabel gpt mkpart primary ext2 1MiB 2MiB name 1 $part_name > empty 2>&1 || fail=1
pkgs/top-level/python-packages.nix+15−3
@@ -123,7 +123,7 @@ let
123123
124124 # This is used for NixOps to make sure we won't break it with the next major
125125 # version of nixpart.
126− nixpart0 = self.nixpart;
126+ nixpart0 = callPackage ../tools/filesystems/nixpart/0.4 { };
127127
128128 pitz = callPackage ../applications/misc/pitz { };
129129
@@ -6518,6 +6518,7 @@ let
65186518 };
65196519 };
65206520
6521+
65216522 pycapnp = buildPythonPackage rec {
65226523 name = "pycapnp-0.4.4";
65236524 disabled = isPyPy || isPy3k;
@@ -6857,6 +6858,17 @@ let
68576858 sha256 = "17wq4invmv1nfazaksf59ymqyvgv3i8h4q03ry2az0s9lldyg3dv";
68586859 };
68596860
6861+ patches = singleton (pkgs.fetchurl {
6862+ url = "https://www.redhat.com/archives/pyparted-devel/"
6863+ + "2014-April/msg00000.html";
6864+ postFetch = ''
6865+ sed -i -ne '/<!--X-Body-of-Message-->/,/<!--X-Body-of-Message-End-->/ {
6866+ s/^<[^>]*>//; /^$/!p
6867+ }' "$downloadedFile"
6868+ '';
6869+ sha256 = "1lakhz3nvx0qacn90bj1nq13zqxphiw4d9dsc44gwa8nj24j2zws";
6870+ });
6871+
68606872 postPatch = ''
68616873 sed -i -e 's|/sbin/mke2fs|${pkgs.e2fsprogs}&|' tests/baseclass.py
68626874 sed -i -e '
@@ -8481,11 +8493,11 @@ let
84818493
84828494
84838495 six = buildPythonPackage rec {
8484− name = "six-1.7.3";
8496+ name = "six-1.8.0";
84858497
84868498 src = pkgs.fetchurl {
84878499 url = "http://pypi.python.org/packages/source/s/six/${name}.tar.gz";
8488− md5 = "784c6e5541c3c4952de9c0a966a0a80b";
8500+ md5 = "1626eb24cc889110c38f7e786ec69885";
84898501 };
84908502
84918503 # error: invalid command 'test'