1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017, 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
3 ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
4 ;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2018 Leo Famulari <leo@famulari.name>
6 ;;; Copyright © 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2020 Raghav Gururajan <raghavgururajan@disroot.org>
9 ;;; This file is part of GNU Guix.
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24 (define-module (gnu packages file-systems)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module (guix build-system cmake)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix build-system linux-module)
32 #:use-module (guix build-system trivial)
33 #:use-module (guix utils)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages acl)
36 #:use-module (gnu packages attr)
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages bison)
39 #:use-module (gnu packages check)
40 #:use-module (gnu packages compression)
41 #:use-module (gnu packages crypto)
42 #:use-module (gnu packages curl)
43 #:use-module (gnu packages datastructures)
44 #:use-module (gnu packages documentation)
45 #:use-module (gnu packages docbook)
46 #:use-module (gnu packages flex)
47 #:use-module (gnu packages glib)
48 #:use-module (gnu packages gnupg)
49 #:use-module (gnu packages libffi)
50 #:use-module (gnu packages linux)
51 #:use-module (gnu packages nfs)
52 #:use-module (gnu packages onc-rpc)
53 #:use-module (gnu packages photo)
54 #:use-module (gnu packages pkg-config)
55 #:use-module (gnu packages python)
56 #:use-module (gnu packages readline)
57 #:use-module (gnu packages sqlite)
58 #:use-module (gnu packages tls)
59 #:use-module (gnu packages valgrind)
60 #:use-module (gnu packages xml))
62 (define-public fsarchiver
71 (url "https://github.com/fdupoux/fsarchiver.git")
73 (file-name (git-file-name name version))
75 (base32 "1rvwq5v3rl14bqxjm1ibfapyicf0sa44nw7451v10kx39lp56ylp"))))
76 (build-system gnu-build-system)
78 `(("autoconf" ,autoconf)
79 ("automake" ,automake)
80 ("pkg-config" ,pkg-config)))
83 ("e2fsprogs" ,e2fsprogs)
84 ("libgcrypt" ,libgcrypt)
87 ("util-linux" ,util-linux "lib")
90 ("zstd:lib" ,zstd "lib")))
91 (synopsis "Filesystem Backup/Deployment Tool")
92 (description "FSArchiver allows you to save the contents of a file-system to
93 a compressed archive file. The file-system can be restored on a partition which
94 has a different size and it can be restored on a different file-system.")
95 (home-page "http://www.fsarchiver.org/")
96 (license license:gpl2)))
98 (define-public gphotofs
106 (string-append "mirror://sourceforge/gphoto/gphotofs/" version
107 "/gphotofs-0.5.tar.gz"))
110 "04slwhr6ap9xcc27wphk22ad8yn79ngyy5z10lxams3k5liahvc2"))))
111 (build-system gnu-build-system)
113 `(("pkg-config" ,pkg-config)))
117 ("libgphoto2" ,libgphoto2)))
118 (synopsis "Virtual filesystem for libgphoto2 using FUSE")
119 (description "GPhotoFS is a FUSE filesystem module to mount your camera as
120 a filesystem on Linux. This allow using your camera with any tool able to read
121 from a mounted filesystem.")
122 (home-page "http://www.gphoto.org/proj/gphotofs/")
123 (license license:gpl2+)))
125 (define-public bcachefs-tools
126 (let ((commit "ab2f1ec24f5307b0cf1e3c4ad19bf350d9f54d9f")
129 (name "bcachefs-tools")
130 (version (git-version "0.1" revision commit))
135 (url "https://evilpiepirate.org/git/bcachefs-tools.git")
137 (file-name (git-file-name name version))
139 (base32 "10pafvaxg1lvwnqjv3a4rsi96bghbpcsgh3vhqilndi334k3b0hd"))))
140 (build-system gnu-build-system)
143 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
144 "INITRAMFS_DIR=$(PREFIX)/share/initramfs-tools"
148 (modify-phases %standard-phases
149 (delete 'configure)) ; no configure script
150 #:tests? #f)) ; XXX 6 valgrind tests fail
152 `(("pkg-config" ,pkg-config)
155 ("python-pytest" ,python-pytest)
156 ("valgrind" ,valgrind)))
158 `(("keyutils" ,keyutils)
160 ("libscrypt" ,libscrypt)
161 ("libsodium" ,libsodium)
163 ("util-linux" ,util-linux "lib") ; lib{blkid,uuid}
166 ("zstd:lib" ,zstd "lib")))
167 (home-page "https://bcachefs.org/")
168 (synopsis "Tools to create and manage bcachefs file systems")
170 "The bcachefs-tools are command-line utilities for creating, checking,
171 and otherwise managing bcachefs file systems.
173 Bcachefs is a @acronym{CoW, copy-on-write} file system supporting native
174 encryption, compression, snapshots, and (meta)data checksums. It can use
175 multiple block devices for replication and/or performance, similar to RAID.
177 In addition, bcachefs provides all the functionality of bcache, a block-layer
178 caching system, and lets you assign different roles to each device based on its
179 performance and other characteristics.")
180 (license license:gpl2+))))
182 (define-public httpfs2
189 (uri (string-append "mirror://sourceforge/httpfs/httpfs2/"
190 "httpfs2-" version ".tar.gz"))
193 "1h8ggvhw30n2r6w11n1s458ypggdqx6ldwd61ma4yd7binrlpjq1"))))
194 (build-system gnu-build-system)
196 `(("asciidoc" ,asciidoc)
197 ("docbook-xml" ,docbook-xml)
200 ("pkg-config" ,pkg-config)))
206 (modify-phases %standard-phases
207 (delete 'configure) ; no configure script
209 ;; There's no ‘install’ target. Install all variants manually.
210 (lambda* (#:key outputs #:allow-other-keys)
211 (let* ((out (assoc-ref outputs "out"))
212 (bin (string-append out "/bin"))
213 (man1 (string-append out "/share/man/man1")))
218 (let ((man1-page (string-append variant ".1")))
219 (install-file variant bin)
220 (install-file man1-page man1)))
226 #:make-flags (list "CC=gcc")
227 #:parallel-build? #f ; can result in missing man pages
228 #:tests? #f)) ; no tests
229 (home-page "https://sourceforge.net/projects/httpfs/")
230 (synopsis "Mount remote files over HTTP")
231 (description "httpfs2 is a @code{fuse} file system for mounting any
232 @dfn{HyperText} (HTTP or HTTPS) URL. It uses HTTP/1.1 byte ranges to request
233 arbitrary bytes from the web server, without needing to download the entire
234 file. This is particularly useful with large archives such as ZIP files and
235 ISO images when you only need to inspect their contents or extract specific
236 files. Since the HTTP protocol itself has no notion of directories, only a
237 single file can be mounted.")
238 (license license:gpl2+)))
240 (define-public jfsutils
247 (uri (string-append "http://jfs.sourceforge.net/project/pub/jfsutils-"
250 (base32 "0kbsy2sk1jv4m82rxyl25gwrlkzvl3hzdga9gshkxkhm83v1aji4"))
251 (patches (search-patches "jfsutils-add-sysmacros.patch"
252 "jfsutils-include-systypes.patch"))))
253 (build-system gnu-build-system)
255 `(("util-linux" ,util-linux "lib")))
256 (home-page "http://jfs.sourceforge.net/home.html")
257 (synopsis "Utilities for managing JFS file systems")
259 "The JFSutils are a collection of utilities for managing the @acronym{JFS,
260 Journaled File System}, a 64-bit journaling file system created by IBM and later
261 ported to the kernel Linux. The following commands are available:
263 @item @command{fsck.jfs}: check and repair a JFS file system or replay its
265 @item @command{logdump}: dump the JFS journal log.
266 @item @command{logredo}: replay the JFS journal log.
267 @item @command{mkfs.jfs}: create a new JFS file system.
268 @item @command{xchklog}: save a JFS fsck log to a file.
269 @item @command{xchkdmp}: dump the contents of such a log file.
270 @item @command{xpeek}: a JFS file system editor with a shell-like interface.
272 (license license:gpl3+))) ; no explicit version given
274 (define-public jfsutils/static
278 (name "jfsutils-static")
280 `(("util-linux:static" ,util-linux "static")
281 ,@(package-inputs jfsutils))))))
283 (define-public jfs_fsck/static
285 (name "jfs_fsck-static")
286 (version (package-version jfsutils))
288 (build-system trivial-build-system)
290 `(#:modules ((guix build utils))
293 (use-modules (guix build utils)
296 (let* ((jfsutils (assoc-ref %build-inputs "jfsutils"))
298 (out (assoc-ref %outputs "out"))
299 (sbin (string-append out "/sbin")))
301 (with-directory-excursion sbin
302 (install-file (string-append jfsutils "/sbin/" fsck)
304 (remove-store-references fsck)
308 `(("jfsutils" ,jfsutils/static)))
309 (home-page (package-home-page jfsutils))
310 (synopsis "Statically-linked jfs_fsck command from jfsutils")
311 (description "This package provides statically-linked jfs_fsck command taken
312 from the jfsutils package. It is meant to be used in initrds.")
313 (license (package-license jfsutils))))
315 (define-public disorderfs
323 (url "https://salsa.debian.org/reproducible-builds/disorderfs.git")
325 (file-name (git-file-name name version))
328 "0irgr9hkm9icx1s44m9382484yx8hddzjxbsz621ip9c946pif0g"))))
329 (build-system gnu-build-system)
331 `(("pkg-config" ,pkg-config)))
336 `(#:phases (modify-phases %standard-phases
337 (delete 'configure)) ; no configure script
338 #:make-flags (let ((out (assoc-ref %outputs "out")))
339 (list (string-append "PREFIX=" out)))
341 ;; FIXME: Tests require 'run-parts' which is not in Guix yet.
343 (home-page "https://salsa.debian.org/reproducible-builds/disorderfs")
344 (synopsis "FUSE file system that introduces non-determinism")
346 "An overlay FUSE file system that introduces non-determinism
347 into file system metadata. For example, it can randomize the order
348 in which directory entries are read. This is useful for detecting
349 non-determinism in the build process.")
350 (license license:gpl3+)))
352 (define-public glusterfs
359 (uri (string-append "https://download.gluster.org/pub/gluster/glusterfs/"
360 (version-major version) "/"
361 (version-major+minor version) "/"
362 "glusterfs-" version ".tar.gz"))
365 "0yzhx710ypj0j3m5dcgmmgvkp7p0rmmp2p7ld0axrm4vpwc2b1wa"))))
366 (build-system gnu-build-system)
369 (let ((out (assoc-ref %outputs "out"))
370 (p2 (assoc-ref %build-inputs "python-2")))
371 (list (string-append "PYTHON=" p2 "/bin/python")
372 (string-append "--with-initdir=" out "/etc/init.d")
373 (string-append "--with-mountutildir=" out "/sbin")
374 "--enable-cmocka" ; unit tests
375 ;; "--enable-debug" ; debug build options
376 ;; "--enable-asan" ; Address Sanitizer
377 ;; "--enable-tsan" ; ThreadSanitizer
380 (modify-phases %standard-phases
381 (add-before 'configure 'autogen
382 (lambda _ (invoke "./autogen.sh"))))))
384 `(("pkg-config" ,pkg-config)
385 ("libtirpc", libtirpc)
386 ("rpcsvc-proto", rpcsvc-proto)
387 ("python-2" ,python-2) ; must be version 2
391 ("autoconf" ,autoconf)
392 ("automake" ,automake)
399 ("libuuid" ,util-linux "lib")
401 ("readline" ,readline)
404 ("rdma-core", rdma-core)))
405 (home-page "https://www.gluster.org")
406 (synopsis "Distributed file system")
407 (description "GlusterFS is a distributed scalable network file system
408 suitable for data-intensive tasks such as cloud storage and media streaming.
409 It allows rapid provisioning of additional storage based on your storage
410 consumption needs. It incorporates automatic failover as a primary feature.
411 All of this is accomplished without a centralized metadata server.")
412 ;; The user may choose either LGPLv3+ or GPLv2 only.
413 (license (list license:lgpl3+ license:gpl2+))))
415 (define-public curlftpfs
422 (uri (string-append "mirror://sourceforge/curlftpfs/curlftpfs/" version
423 "/curlftpfs-" version ".tar.gz"))
426 "0n397hmv21jsr1j7zx3m21i7ryscdhkdsyqpvvns12q7qwwlgd2f"))))
427 (build-system gnu-build-system)
430 (modify-phases %standard-phases
431 (add-after 'unpack 'fix-test
433 ;; One of the 512-Byte block counts is definitely wrong.
434 ;; See <https://sourceforge.net/p/curlftpfs/bugs/73/>.
435 (substitute* "tests/ftpfs-ls_unittest.c"
436 (("4426192") "12814800"))
443 `(("pkg-config" ,pkg-config)))
444 (home-page "http://curlftpfs.sourceforge.net/")
445 (synopsis "Mount remote file systems over FTP")
447 "This is a file system client based on the FTP File Transfer Protocol.")
448 (license license:gpl2+)))
450 (define-public libnfs
457 (url "https://github.com/sahlberg/libnfs.git")
458 (commit (string-append "libnfs-" version))))
459 (file-name (git-file-name name version))
462 "115p55y2cbs92z5lmcnjx1v29lwinpgq4sha9v1kq1vd8674h404"))))
463 (build-system gnu-build-system)
464 (home-page "https://github.com/sahlberg/libnfs")
466 `(("autoconf" ,autoconf)
467 ("automake" ,automake)
469 ("pkg-config" ,pkg-config)))
470 (synopsis "Client library for accessing NFS shares")
471 (description "LIBNFS is a client library for accessing NFS shares over a
472 network. LIBNFS offers three different APIs, for different use :
475 @item RAW, a fully asynchronous low level RPC library for NFS protocols. This
476 API provides very flexible and precise control of the RPC issued.
477 @item NFS ASYNC, a fully asynchronous library for high level vfs functions
478 @item NFS SYNC, a synchronous library for high level vfs functions.
480 (license (list license:lgpl2.1+ ; library
481 license:gpl3+ ; tests
482 license:bsd-3 ; copied nsf4 files
485 (define-public apfs-fuse
486 (let ((commit "c7036a3030d128bcecefc1eabc47c039ccfdcec9")
490 (version (git-version "0.0.0" revision commit))
494 (url "https://github.com/sgan81/apfs-fuse")
495 (recursive? #t) ; for lzfse
499 "1akd4cx1f9cyq6sfk9ybv4chhjwjlnqi8ic4z5ajnd5x0g76nz3r"))
500 (file-name (git-file-name name version))))
501 (build-system cmake-build-system)
503 `(#:tests? #f ; No test suite
505 (modify-phases %standard-phases
506 ;; No 'install' target in CMakeLists.txt
508 (lambda* (#:key outputs #:allow-other-keys)
509 (let* ((out (assoc-ref outputs "out"))
510 (bin (string-append out "/bin"))
511 (lib (string-append out "/lib"))
512 (doc (string-append out "/share/doc/"
513 (string-append ,name "-" ,version))))
514 (install-file "apfs-dump" bin)
515 (install-file "apfs-dump-quick" bin)
516 (install-file "apfs-fuse" bin)
517 (install-file "libapfs.a" lib)
523 (synopsis "Read-only FUSE driver for the APFS file system")
524 (description "APFS-FUSE is a read-only FUSE driver for the @dfn{Apple File
525 System} (APFS). It is currently in an experimental state — it may not be able
526 to read all files, and it does not support all the compression methods in
528 (home-page "https://github.com/sgan81/apfs-fuse")
529 (license license:gpl2+))))
535 (outputs '("out" "module" "src"))
539 (uri (string-append "https://github.com/zfsonlinux/zfs/releases"
540 "/download/zfs-" version
541 "/zfs-" version ".tar.gz"))
544 "1f7aig15q3z832pr2n48j3clafic2yk1vvqlh28vpklfghjqwq27"))))
545 (build-system linux-module-build-system)
547 `(;; The ZFS kernel module should not be downloaded since the license
548 ;; terms don't allow for distributing it, only building it locally.
550 ;; Tests cannot run in an unprivileged build environment.
553 (modify-phases %standard-phases
554 (add-after 'configure 'really-configure
555 (lambda* (#:key outputs inputs #:allow-other-keys)
556 (let ((out (assoc-ref outputs "out")))
557 (substitute* "configure"
558 (("-/bin/sh") (string-append "-" (which "sh")))
559 ((" /bin/sh") (string-append " " (which "sh"))))
560 (invoke "./configure"
562 (string-append "--prefix=" out)
563 (string-append "--with-dracutdir=" out "/lib/dracut")
564 (string-append "--with-udevdir=" out "/lib/udev")
565 (string-append "--with-mounthelperdir=" out "/sbin")
566 (string-append "--with-linux="
567 (assoc-ref inputs "linux-module-builder")
568 "/lib/modules/build")))))
569 (add-after 'unpack 'patch-source
570 (lambda* (#:key inputs outputs #:allow-other-keys)
571 (let ((out (assoc-ref outputs "out"))
572 (src (assoc-ref outputs "src"))
573 (util-linux (assoc-ref inputs "util-linux"))
574 (nfs-utils (assoc-ref inputs "nfs-utils")))
575 (substitute* "module/zfs/zfs_ctldir.c"
576 (("/usr/bin/env\", \"umount")
577 (string-append util-linux "/bin/umount\", \"-n"))
578 (("/usr/bin/env\", \"mount")
579 (string-append util-linux "/bin/mount\", \"-n")))
580 (substitute* "lib/libzfs/libzfs_mount.c"
581 (("/bin/mount") (string-append util-linux "/bin/mount"))
582 (("/bin/umount") (string-append util-linux "/bin/umount")))
583 (substitute* "lib/libshare/nfs.c"
584 (("/usr/sbin/exportfs")
585 (string-append nfs-utils "/sbin/exportfs")))
586 (substitute* "config/zfs-build.m4"
587 (("\\$sysconfdir/init.d") (string-append out "/etc/init.d")))
588 (substitute* '("etc/zfs/Makefile.am"
589 "cmd/zed/Makefile.am")
590 (("\\$\\(sysconfdir)") (string-append out "/etc")))
591 (substitute* "cmd/vdev_id/vdev_id"
592 (("PATH=/bin:/sbin:/usr/bin:/usr/sbin")
593 (string-append "PATH="
594 (dirname (which "chmod")) ":"
595 (dirname (which "grep")) ":"
596 (dirname (which "sed")) ":"
597 (dirname (which "gawk")))))
598 (substitute* "contrib/pyzfs/Makefile.in"
599 ((".*install-lib.*") ""))
600 (substitute* '("Makefile.am" "Makefile.in")
601 (("\\$\\(prefix)/src") (string-append src "/src"))))
604 (lambda _ (invoke "make")))
606 (lambda* (#:key outputs inputs native-inputs #:allow-other-keys)
607 (let* ((out (assoc-ref outputs "out"))
608 (moddir (assoc-ref outputs "module"))
609 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
610 (invoke "make" "install"
611 (string-append "DEFAULT_INITCONF_DIR=" out "/etc/default")
612 (string-append "DEPMOD=" kmod "/bin/depmod")
613 (string-append "INSTALL_PATH=" out)
614 (string-append "INSTALL_MOD_PATH=" moddir)
615 "INSTALL_MOD_STRIP=1")
616 (install-file "contrib/bash_completion.d/zfs"
617 (string-append out "/share/bash-completion/completions"))
618 (symlink "../share/pkgconfig/" (string-append out "/lib/pkgconfig"))
623 ("pkg-config" ,pkg-config)))
627 ("libtirpc" ,libtirpc)
628 ("nfs-utils" ,nfs-utils)
631 ("python-cffi" ,python-cffi)
632 ("util-linux" ,util-linux "lib")
634 (home-page "https://zfsonlinux.org/")
635 (synopsis "Native ZFS on Linux")
637 "ZFS on Linux is an advanced file system and volume manager which was
638 originally developed for Solaris and is now maintained by the OpenZFS
640 (license license:cddl1.0)))