diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2014-01-04 12:45:06 +0100 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2014-01-04 18:34:53 +0100 |
commit | 9443129b08b37a6f4267d257cd8d42dd92a2539c (patch) | |
tree | aec261361299cc2d85827dbcf5d03b594ae85e28 /pkgs/tools/filesystems | |
parent | f78534ca0f8ec63d79370eb2367605579efba088 (diff) | |
parent | f6d51f7717cffd8b220ce02498db8b8359b5964c (diff) | |
download | nixlib-9443129b08b37a6f4267d257cd8d42dd92a2539c.tar nixlib-9443129b08b37a6f4267d257cd8d42dd92a2539c.tar.gz nixlib-9443129b08b37a6f4267d257cd8d42dd92a2539c.tar.bz2 nixlib-9443129b08b37a6f4267d257cd8d42dd92a2539c.tar.lz nixlib-9443129b08b37a6f4267d257cd8d42dd92a2539c.tar.xz nixlib-9443129b08b37a6f4267d257cd8d42dd92a2539c.tar.zst nixlib-9443129b08b37a6f4267d257cd8d42dd92a2539c.zip |
Merge master into stdenv-updates
Conflicts: pkgs/development/libraries/glibc/2.18/common.nix (take stdenv-updates) pkgs/misc/emulators/zsnes/default.nix (more complex, build tested) pkgs/top-level/all-packages.nix (auto-solved)
Diffstat (limited to 'pkgs/tools/filesystems')
-rw-r--r-- | pkgs/tools/filesystems/btrfsprogs/btrfs-set-received-uuid.c | 109 | ||||
-rw-r--r-- | pkgs/tools/filesystems/btrfsprogs/default.nix | 29 | ||||
-rw-r--r-- | pkgs/tools/filesystems/chunkfs/default.nix | 30 |
3 files changed, 37 insertions, 131 deletions
diff --git a/pkgs/tools/filesystems/btrfsprogs/btrfs-set-received-uuid.c b/pkgs/tools/filesystems/btrfsprogs/btrfs-set-received-uuid.c deleted file mode 100644 index 483ec5f84155..000000000000 --- a/pkgs/tools/filesystems/btrfsprogs/btrfs-set-received-uuid.c +++ /dev/null @@ -1,109 +0,0 @@ -/* -btrfs receive currently mandates that incremental receives can only be performed on a parent subvolume -that was also received. This means you cannot apply it to (snapshotted) subvolumes you still have on disk, -as they were not received themselves. - -This small utility allows you to set the received_uuid of a subvolume, tricking btrfs receive into using it. - -found on btrfs mailing list -read the discussion here: http://comments.gmane.org/gmane.comp.file-systems.btrfs/21922 -*/ - -#define _GNU_SOURCE - -#include <unistd.h> -#include <stdlib.h> -#include <errno.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <stdio.h> -#include <string.h> -#include <uuid/uuid.h> -#include <sys/ioctl.h> - -#include "ctree.h" -#include "ioctl.h" -#include "send-utils.h" - -#define CLEAR(var) memset(&var, 0, sizeof(var)) - - -int main(int argc, char **argv) { - int ret, fd; - struct subvol_uuid_search sus; - struct btrfs_ioctl_received_subvol_args rs_args; - struct subvol_info *si; - char uuidbuf[37], parent_uuidbuf[37], received_uuidbuf[37]; - - - if (argc != 3 && argc != 4) { - printf("usage: btrfs-set-received-uuid btrfs-mountpoint src-subvolume-path-relative-to-mountpoint [dest-absolute-subvolume-path]\n"); - exit(1); - } - - printf("opening srcmnt %s\n", argv[1]); - fd = open(argv[1], O_RDONLY | O_NOATIME); - if (fd < 0) { - printf("failed to open srcmnt %s! %s\n", argv[1], strerror(errno)); - exit(2); - } - - puts("initializing sub search"); - CLEAR(sus); - ret = subvol_uuid_search_init(fd, &sus); - if (ret < 0) { - printf("failed to initialize sub search! %s\n", strerror(-ret)); - exit(3); - } - - printf("searching srcsub %s\n", argv[2]); - si = subvol_uuid_search(&sus, 0, NULL, 0, argv[2], subvol_search_by_path); - if (!si) { - puts("srcsub not found!"); - exit(4); - } - - uuid_unparse(si->uuid, uuidbuf); - uuid_unparse(si->parent_uuid, parent_uuidbuf); - uuid_unparse(si->received_uuid, received_uuidbuf); - - printf("\nsrcsub found:\n" - " uuid=%s\n" - " parent_uuid=%s\n" - "received_uuid=%s\n" - "ctransid=%Lu otransid=%Lu stransid=%Lu rtransid=%Lu\n\n", - uuidbuf, parent_uuidbuf, received_uuidbuf, - (unsigned long long)(si->ctransid), - (unsigned long long)(si->otransid), - (unsigned long long)(si->stransid), - (unsigned long long)(si->rtransid)); - - if (argc == 3) - goto done; - - printf("opening dst subvol %s\n", argv[3]); - fd = open(argv[3], O_RDONLY | O_NOATIME); - if (fd < 0) { - printf("failed to open dst subvol %s. %s\n", argv[3], strerror(errno)); - exit(5); - } - - printf("\nhere we go with BTRFS_IOC_SET_RECEIVED_SUBVOL:\n" - "dstsub.received_uuid = srcsub.uuid == %s\n" - "dstsub.stransid = srcsub.ctransid == %Lu\n\n", - uuidbuf, (unsigned long long)(si->ctransid)); - - CLEAR(rs_args); - memcpy(rs_args.uuid, si->uuid, BTRFS_UUID_SIZE); - rs_args.stransid = si->ctransid; - - ret = ioctl(fd, BTRFS_IOC_SET_RECEIVED_SUBVOL, &rs_args); - if (ret < 0) { - printf("BTRFS_IOC_SET_RECEIVED_SUBVOL failed: %s", strerror(-ret)); - exit(6); - } - -done: - printf("done.\n"); - exit(0); -} diff --git a/pkgs/tools/filesystems/btrfsprogs/default.nix b/pkgs/tools/filesystems/btrfsprogs/default.nix index 0661755d2e17..16c5b58c38da 100644 --- a/pkgs/tools/filesystems/btrfsprogs/default.nix +++ b/pkgs/tools/filesystems/btrfsprogs/default.nix @@ -1,35 +1,20 @@ -{ stdenv, fetchgit, zlib, libuuid, acl, attr, e2fsprogs, lzo }: +{ stdenv, fetchurl, attr, acl, zlib, libuuid, e2fsprogs, lzo }: -let version = "0.20pre20130705"; in +let version = "3.12"; in -stdenv.mkDerivation { +stdenv.mkDerivation rec { name = "btrfs-progs-${version}"; - src = fetchgit { - url = "git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git"; - rev = "194aa4a1bd6447bb545286d0bcb0b0be8204d79f"; - sha256 = "07c6762c9873cdcc1b9b3be0b412ba14b83457d8f5608d3dd945953b5e06f0f2"; + src = fetchurl { + url = "mirror://kernel/linux/kernel/people/mason/btrfs-progs/btrfs-progs-v${version}.tar.xz"; + sha256 = "1pwcjf9jqdiy8445r1xkazqa07xmapnn0ylyz7yzphci3ib66zh9"; }; - buildInputs = [ zlib libuuid acl attr e2fsprogs lzo ]; + buildInputs = [ attr acl zlib libuuid e2fsprogs lzo ]; # for btrfs to get the rpath to libgcc_s, needed for pthread_cancel to work NIX_CFLAGS_LINK = "-lgcc_s"; - postPatch = '' - cp ${./btrfs-set-received-uuid.c} btrfs-set-received-uuid.c - ''; - - postBuild = '' - gcc -Wall -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -DBTRFS_FLAT_INCLUDES \ - -fPIC -g -O1 -luuid -o btrfs-set-received-uuid rbtree.o send-utils.o btrfs-list.o \ - btrfs-set-received-uuid.c - ''; - - postInstall = '' - cp btrfs-set-received-uuid $out/bin - ''; - makeFlags = "prefix=$(out)"; meta = { diff --git a/pkgs/tools/filesystems/chunkfs/default.nix b/pkgs/tools/filesystems/chunkfs/default.nix new file mode 100644 index 000000000000..c51837eef181 --- /dev/null +++ b/pkgs/tools/filesystems/chunkfs/default.nix @@ -0,0 +1,30 @@ +{ stdenv, fetchurl, perl, fuse }: + +stdenv.mkDerivation rec { + version = "0.7"; + name = "chunkfs-${version}"; + + src = fetchurl { + url = "http://chunkfs.florz.de/chunkfs_${version}.tar.gz"; + sha256 = "4c168fc2b265a6ba34afc565707ea738f34375325763c0596f2cfa1c9b8d40f1"; + }; + + buildInputs = [perl fuse]; + + makeFlags = [ + "DESTDIR=$(out)" + "PREFIX=" + ]; + + preInstall = '' + mkdir -p $out/bin + mkdir -p $out/share/man/man1 + ''; + + meta = { + description = "(Un)ChunkFS is a pair of FUSE filesystems for viewing chunksync-style directory trees as a block device and vice versa."; + homepage = "http://chunkfs.florz.de/"; + license = "GPLv2"; + platforms = with stdenv.lib.platforms; linux; + }; +} |