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 "File system back-up, deployment, and migration tool")
93 "FSArchiver saves the contents of a file system to a compressed archive
94 file, and restores it to a different file system and/or partition. This
95 partition can be of a different size than the original and FSArchiver will
96 create a new file system if none exists.
98 All standard file attributes supported by the kernel are preserved, including
99 file permissions, timestamps, symbolic and hard links, and extended attributes.
101 Each file in the archive is protected by a checksum. If part of the archive
102 is corrupted you'll lose the affected file(s) but not the whole back-up.")
103 (home-page "http://www.fsarchiver.org/")
104 (license license:gpl2)))
106 (define-public gphotofs
114 (string-append "mirror://sourceforge/gphoto/gphotofs/" version
115 "/gphotofs-0.5.tar.gz"))
118 "04slwhr6ap9xcc27wphk22ad8yn79ngyy5z10lxams3k5liahvc2"))))
119 (build-system gnu-build-system)
121 `(("pkg-config" ,pkg-config)))
125 ("libgphoto2" ,libgphoto2)))
126 (synopsis "Virtual filesystem for libgphoto2 using FUSE")
127 (description "GPhotoFS is a FUSE filesystem module to mount your camera as
128 a filesystem on Linux. This allow using your camera with any tool able to read
129 from a mounted filesystem.")
130 (home-page "http://www.gphoto.org/proj/gphotofs/")
131 (license license:gpl2+)))
133 (define-public bcachefs-tools
134 (let ((commit "ab2f1ec24f5307b0cf1e3c4ad19bf350d9f54d9f")
137 (name "bcachefs-tools")
138 (version (git-version "0.1" revision commit))
143 (url "https://evilpiepirate.org/git/bcachefs-tools.git")
145 (file-name (git-file-name name version))
147 (base32 "10pafvaxg1lvwnqjv3a4rsi96bghbpcsgh3vhqilndi334k3b0hd"))))
148 (build-system gnu-build-system)
151 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
152 "INITRAMFS_DIR=$(PREFIX)/share/initramfs-tools"
156 (modify-phases %standard-phases
157 (delete 'configure)) ; no configure script
158 #:tests? #f)) ; XXX 6 valgrind tests fail
160 `(("pkg-config" ,pkg-config)
163 ("python-pytest" ,python-pytest)
164 ("valgrind" ,valgrind)))
166 `(("keyutils" ,keyutils)
168 ("libscrypt" ,libscrypt)
169 ("libsodium" ,libsodium)
171 ("util-linux" ,util-linux "lib") ; lib{blkid,uuid}
174 ("zstd:lib" ,zstd "lib")))
175 (home-page "https://bcachefs.org/")
176 (synopsis "Tools to create and manage bcachefs file systems")
178 "The bcachefs-tools are command-line utilities for creating, checking,
179 and otherwise managing bcachefs file systems.
181 Bcachefs is a @acronym{CoW, copy-on-write} file system supporting native
182 encryption, compression, snapshots, and (meta)data checksums. It can use
183 multiple block devices for replication and/or performance, similar to RAID.
185 In addition, bcachefs provides all the functionality of bcache, a block-layer
186 caching system, and lets you assign different roles to each device based on its
187 performance and other characteristics.")
188 (license license:gpl2+))))
190 (define-public exfatprogs
198 (url "https://github.com/exfatprogs/exfatprogs")
200 (file-name (git-file-name name version))
203 "1s47qvhr702z5c19wfqz8cwl9ammmincs7a8vjc6p974wnnjg77y"))))
204 (build-system gnu-build-system)
207 (list "--disable-static")))
209 `(("autoconf" ,autoconf)
210 ("automake" ,automake)
212 ("pkg-config" ,pkg-config)))
213 (home-page "https://github.com/exfatprogs/exfatprogs")
214 (synopsis "Tools to create, check, and repair exFAT file systems")
216 "These are command-line user space tools for the @acronym{exFAT,
217 Extensible File Allocation Table} file systems. Included are
218 @command{mkfs.exfat} to create (format) new exFAT file systems, and
219 @command{fsck.exfat} to check their consistency and repair them.")
220 (license license:gpl2+)))
222 (define-public httpfs2
229 (uri (string-append "mirror://sourceforge/httpfs/httpfs2/"
230 "httpfs2-" version ".tar.gz"))
233 "1h8ggvhw30n2r6w11n1s458ypggdqx6ldwd61ma4yd7binrlpjq1"))))
234 (build-system gnu-build-system)
236 `(("asciidoc" ,asciidoc)
237 ("docbook-xml" ,docbook-xml)
240 ("pkg-config" ,pkg-config)))
246 (modify-phases %standard-phases
247 (delete 'configure) ; no configure script
249 ;; There's no ‘install’ target. Install all variants manually.
250 (lambda* (#:key outputs #:allow-other-keys)
251 (let* ((out (assoc-ref outputs "out"))
252 (bin (string-append out "/bin"))
253 (man1 (string-append out "/share/man/man1")))
258 (let ((man1-page (string-append variant ".1")))
259 (install-file variant bin)
260 (install-file man1-page man1)))
266 #:make-flags (list "CC=gcc")
267 #:parallel-build? #f ; can result in missing man pages
268 #:tests? #f)) ; no tests
269 (home-page "https://sourceforge.net/projects/httpfs/")
270 (synopsis "Mount remote files over HTTP")
271 (description "httpfs2 is a @code{fuse} file system for mounting any
272 @dfn{HyperText} (HTTP or HTTPS) URL. It uses HTTP/1.1 byte ranges to request
273 arbitrary bytes from the web server, without needing to download the entire
274 file. This is particularly useful with large archives such as ZIP files and
275 ISO images when you only need to inspect their contents or extract specific
276 files. Since the HTTP protocol itself has no notion of directories, only a
277 single file can be mounted.")
278 (license license:gpl2+)))
280 (define-public jfsutils
287 (uri (string-append "http://jfs.sourceforge.net/project/pub/jfsutils-"
290 (base32 "0kbsy2sk1jv4m82rxyl25gwrlkzvl3hzdga9gshkxkhm83v1aji4"))
291 (patches (search-patches "jfsutils-add-sysmacros.patch"
292 "jfsutils-include-systypes.patch"))))
293 (build-system gnu-build-system)
295 `(("util-linux" ,util-linux "lib")))
296 (home-page "http://jfs.sourceforge.net/home.html")
297 (synopsis "Utilities for managing JFS file systems")
299 "The JFSutils are a collection of utilities for managing the @acronym{JFS,
300 Journaled File System}, a 64-bit journaling file system created by IBM and later
301 ported to the kernel Linux. The following commands are available:
303 @item @command{fsck.jfs}: check and repair a JFS file system or replay its
305 @item @command{logdump}: dump the JFS journal log.
306 @item @command{logredo}: replay the JFS journal log.
307 @item @command{mkfs.jfs}: create a new JFS file system.
308 @item @command{xchklog}: save a JFS fsck log to a file.
309 @item @command{xchkdmp}: dump the contents of such a log file.
310 @item @command{xpeek}: a JFS file system editor with a shell-like interface.
312 (license license:gpl3+))) ; no explicit version given
314 (define-public jfsutils/static
318 (name "jfsutils-static")
320 `(("util-linux:static" ,util-linux "static")
321 ,@(package-inputs jfsutils))))))
323 (define-public jfs_fsck/static
325 (name "jfs_fsck-static")
326 (version (package-version jfsutils))
328 (build-system trivial-build-system)
330 `(#:modules ((guix build utils))
333 (use-modules (guix build utils)
336 (let* ((jfsutils (assoc-ref %build-inputs "jfsutils"))
338 (out (assoc-ref %outputs "out"))
339 (sbin (string-append out "/sbin")))
341 (with-directory-excursion sbin
342 (install-file (string-append jfsutils "/sbin/" fsck)
344 (remove-store-references fsck)
348 `(("jfsutils" ,jfsutils/static)))
349 (home-page (package-home-page jfsutils))
350 (synopsis "Statically-linked jfs_fsck command from jfsutils")
351 (description "This package provides statically-linked jfs_fsck command taken
352 from the jfsutils package. It is meant to be used in initrds.")
353 (license (package-license jfsutils))))
355 (define-public disorderfs
363 (url "https://salsa.debian.org/reproducible-builds/disorderfs.git")
365 (file-name (git-file-name name version))
368 "0lsisx5118k0qk0b5klbxl03rvhycnznyfx05yxmjawh85bfhmlh"))))
369 (build-system gnu-build-system)
371 `(("pkg-config" ,pkg-config)))
376 `(#:phases (modify-phases %standard-phases
377 (delete 'configure)) ; no configure script
378 #:make-flags (let ((out (assoc-ref %outputs "out")))
379 (list (string-append "PREFIX=" out)))
381 ;; FIXME: Tests require 'run-parts' which is not in Guix yet.
383 (home-page "https://salsa.debian.org/reproducible-builds/disorderfs")
384 (synopsis "FUSE file system that introduces non-determinism")
386 "An overlay FUSE file system that introduces non-determinism
387 into file system metadata. For example, it can randomize the order
388 in which directory entries are read. This is useful for detecting
389 non-determinism in the build process.")
390 (license license:gpl3+)))
392 (define-public glusterfs
399 (uri (string-append "https://download.gluster.org/pub/gluster/glusterfs/"
400 (version-major version) "/"
401 (version-major+minor version) "/"
402 "glusterfs-" version ".tar.gz"))
405 "0yzhx710ypj0j3m5dcgmmgvkp7p0rmmp2p7ld0axrm4vpwc2b1wa"))))
406 (build-system gnu-build-system)
409 (let ((out (assoc-ref %outputs "out"))
410 (p2 (assoc-ref %build-inputs "python-2")))
411 (list (string-append "PYTHON=" p2 "/bin/python")
412 (string-append "--with-initdir=" out "/etc/init.d")
413 (string-append "--with-mountutildir=" out "/sbin")
414 "--enable-cmocka" ; unit tests
415 ;; "--enable-debug" ; debug build options
416 ;; "--enable-asan" ; Address Sanitizer
417 ;; "--enable-tsan" ; ThreadSanitizer
420 (modify-phases %standard-phases
421 (add-before 'configure 'autogen
422 (lambda _ (invoke "./autogen.sh"))))))
424 `(("pkg-config" ,pkg-config)
425 ("libtirpc", libtirpc)
426 ("rpcsvc-proto", rpcsvc-proto)
427 ("python-2" ,python-2) ; must be version 2
431 ("autoconf" ,autoconf)
432 ("automake" ,automake)
439 ("libuuid" ,util-linux "lib")
441 ("readline" ,readline)
444 ("rdma-core", rdma-core)))
445 (home-page "https://www.gluster.org")
446 (synopsis "Distributed file system")
447 (description "GlusterFS is a distributed scalable network file system
448 suitable for data-intensive tasks such as cloud storage and media streaming.
449 It allows rapid provisioning of additional storage based on your storage
450 consumption needs. It incorporates automatic failover as a primary feature.
451 All of this is accomplished without a centralized metadata server.")
452 ;; The user may choose either LGPLv3+ or GPLv2 only.
453 (license (list license:lgpl3+ license:gpl2+))))
455 (define-public curlftpfs
462 (uri (string-append "mirror://sourceforge/curlftpfs/curlftpfs/" version
463 "/curlftpfs-" version ".tar.gz"))
466 "0n397hmv21jsr1j7zx3m21i7ryscdhkdsyqpvvns12q7qwwlgd2f"))))
467 (build-system gnu-build-system)
470 (modify-phases %standard-phases
471 (add-after 'unpack 'fix-test
473 ;; One of the 512-Byte block counts is definitely wrong.
474 ;; See <https://sourceforge.net/p/curlftpfs/bugs/73/>.
475 (substitute* "tests/ftpfs-ls_unittest.c"
476 (("4426192") "12814800"))
483 `(("pkg-config" ,pkg-config)))
484 (home-page "http://curlftpfs.sourceforge.net/")
485 (synopsis "Mount remote file systems over FTP")
487 "This is a file system client based on the FTP File Transfer Protocol.")
488 (license license:gpl2+)))
490 (define-public libnfs
497 (url "https://github.com/sahlberg/libnfs.git")
498 (commit (string-append "libnfs-" version))))
499 (file-name (git-file-name name version))
502 "115p55y2cbs92z5lmcnjx1v29lwinpgq4sha9v1kq1vd8674h404"))))
503 (build-system gnu-build-system)
504 (home-page "https://github.com/sahlberg/libnfs")
506 `(("autoconf" ,autoconf)
507 ("automake" ,automake)
509 ("pkg-config" ,pkg-config)))
510 (synopsis "Client library for accessing NFS shares")
511 (description "LIBNFS is a client library for accessing NFS shares over a
512 network. LIBNFS offers three different APIs, for different use :
515 @item RAW, a fully asynchronous low level RPC library for NFS protocols. This
516 API provides very flexible and precise control of the RPC issued.
517 @item NFS ASYNC, a fully asynchronous library for high level vfs functions
518 @item NFS SYNC, a synchronous library for high level vfs functions.
520 (license (list license:lgpl2.1+ ; library
521 license:gpl3+ ; tests
522 license:bsd-3 ; copied nsf4 files
525 (define-public apfs-fuse
526 ;; Later versions require FUSE 3.
527 (let ((commit "7b89418e8dc27103d3c4f8fa348086ffcd634c17")
531 (version (git-version "0.0.0" revision commit))
535 (url "https://github.com/sgan81/apfs-fuse")
536 (recursive? #t) ; for lzfse
540 "0x2siy3cmnm9wsdfazg3xc8r3kbg73gijmnn1vjw33pp71ckylxr"))
541 (file-name (git-file-name name version))))
542 (build-system cmake-build-system)
544 `(#:tests? #f ; No test suite
546 '("-DUSE_FUSE3=OFF") ; FUSE 3 is not packaged yet.
548 (modify-phases %standard-phases
549 ;; No 'install' target in CMakeLists.txt
551 (lambda* (#:key outputs #:allow-other-keys)
552 (let* ((out (assoc-ref outputs "out"))
553 (bin (string-append out "/bin"))
554 (lib (string-append out "/lib"))
555 (doc (string-append out "/share/doc/"
556 (string-append ,name "-" ,version))))
557 (install-file "apfs-dump" bin)
558 (install-file "apfs-dump-quick" bin)
559 (install-file "apfs-fuse" bin)
560 (install-file "libapfs.a" lib)
561 (install-file "../source/README.md" doc)
567 (synopsis "Read-only FUSE driver for the APFS file system")
568 (description "APFS-FUSE is a read-only FUSE driver for the @dfn{Apple File
569 System} (APFS). It is currently in an experimental state — it may not be able
570 to read all files, and it does not support all the compression methods in
572 (home-page "https://github.com/sgan81/apfs-fuse")
573 (license license:gpl2+))))
579 (outputs '("out" "module" "src"))
583 (uri (string-append "https://github.com/zfsonlinux/zfs/releases"
584 "/download/zfs-" version
585 "/zfs-" version ".tar.gz"))
588 "1f7aig15q3z832pr2n48j3clafic2yk1vvqlh28vpklfghjqwq27"))))
589 (build-system linux-module-build-system)
591 `(;; The ZFS kernel module should not be downloaded since the license
592 ;; terms don't allow for distributing it, only building it locally.
594 ;; Tests cannot run in an unprivileged build environment.
597 (modify-phases %standard-phases
598 (add-after 'configure 'really-configure
599 (lambda* (#:key outputs inputs #:allow-other-keys)
600 (let ((out (assoc-ref outputs "out")))
601 (substitute* "configure"
602 (("-/bin/sh") (string-append "-" (which "sh")))
603 ((" /bin/sh") (string-append " " (which "sh"))))
604 (invoke "./configure"
606 (string-append "--prefix=" out)
607 (string-append "--with-dracutdir=" out "/lib/dracut")
608 (string-append "--with-udevdir=" out "/lib/udev")
609 (string-append "--with-mounthelperdir=" out "/sbin")
610 (string-append "--with-linux="
611 (assoc-ref inputs "linux-module-builder")
612 "/lib/modules/build")))))
613 (add-after 'unpack 'patch-source
614 (lambda* (#:key inputs outputs #:allow-other-keys)
615 (let ((out (assoc-ref outputs "out"))
616 (src (assoc-ref outputs "src"))
617 (util-linux (assoc-ref inputs "util-linux"))
618 (nfs-utils (assoc-ref inputs "nfs-utils")))
619 (substitute* "module/zfs/zfs_ctldir.c"
620 (("/usr/bin/env\", \"umount")
621 (string-append util-linux "/bin/umount\", \"-n"))
622 (("/usr/bin/env\", \"mount")
623 (string-append util-linux "/bin/mount\", \"-n")))
624 (substitute* "lib/libzfs/libzfs_mount.c"
625 (("/bin/mount") (string-append util-linux "/bin/mount"))
626 (("/bin/umount") (string-append util-linux "/bin/umount")))
627 (substitute* "lib/libshare/nfs.c"
628 (("/usr/sbin/exportfs")
629 (string-append nfs-utils "/sbin/exportfs")))
630 (substitute* "config/zfs-build.m4"
631 (("\\$sysconfdir/init.d") (string-append out "/etc/init.d")))
632 (substitute* '("etc/zfs/Makefile.am"
633 "cmd/zed/Makefile.am")
634 (("\\$\\(sysconfdir)") (string-append out "/etc")))
635 (substitute* "cmd/vdev_id/vdev_id"
636 (("PATH=/bin:/sbin:/usr/bin:/usr/sbin")
637 (string-append "PATH="
638 (dirname (which "chmod")) ":"
639 (dirname (which "grep")) ":"
640 (dirname (which "sed")) ":"
641 (dirname (which "gawk")))))
642 (substitute* "contrib/pyzfs/Makefile.in"
643 ((".*install-lib.*") ""))
644 (substitute* '("Makefile.am" "Makefile.in")
645 (("\\$\\(prefix)/src") (string-append src "/src"))))
648 (lambda _ (invoke "make")))
650 (lambda* (#:key outputs inputs native-inputs #:allow-other-keys)
651 (let* ((out (assoc-ref outputs "out"))
652 (moddir (assoc-ref outputs "module"))
653 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
654 (invoke "make" "install"
655 (string-append "DEFAULT_INITCONF_DIR=" out "/etc/default")
656 (string-append "DEPMOD=" kmod "/bin/depmod")
657 (string-append "INSTALL_PATH=" out)
658 (string-append "INSTALL_MOD_PATH=" moddir)
659 "INSTALL_MOD_STRIP=1")
660 (install-file "contrib/bash_completion.d/zfs"
661 (string-append out "/share/bash-completion/completions"))
662 (symlink "../share/pkgconfig/" (string-append out "/lib/pkgconfig"))
667 ("pkg-config" ,pkg-config)))
671 ("libtirpc" ,libtirpc)
672 ("nfs-utils" ,nfs-utils)
675 ("python-cffi" ,python-cffi)
676 ("util-linux" ,util-linux "lib")
678 (home-page "https://zfsonlinux.org/")
679 (synopsis "Native ZFS on Linux")
681 "ZFS on Linux is an advanced file system and volume manager which was
682 originally developed for Solaris and is now maintained by the OpenZFS
684 (license license:cddl1.0)))
686 (define-public mergerfs
693 (uri (string-append "https://github.com/trapexit/mergerfs/releases/download/"
694 version "/mergerfs-" version ".tar.gz"))
697 "17gizw4vgbqqjd2ykkfpp276942jb5qclp0lkiwkmq1yjgyjqfmk"))))
698 (build-system gnu-build-system)
700 `(#:tests? #f ; No tests exist.
702 (modify-phases %standard-phases
704 (add-after 'unpack 'fix-paths
705 (lambda* (#:key inputs outputs #:allow-other-keys)
707 ;; These were copied from the package libfuse.
708 (substitute* '("libfuse/lib/mount_util.c" "libfuse/util/mount_util.c")
709 (("/bin/(u?)mount" _ maybe-u)
710 (string-append (assoc-ref inputs "util-linux")
711 "/bin/" maybe-u "mount")))
712 (substitute* '("libfuse/util/mount.mergerfs.c")
715 ;; The Makefile does not allow overriding PREFIX via make variables.
716 (substitute* '("Makefile" "libfuse/Makefile")
717 (("= /usr/local") (string-append "= " (assoc-ref outputs "out")))
718 ;; cannot chown as build user
719 (("chown root:root") "true"))
721 ;; mergerfs bundles a heavily modified copy of libfuse.
722 (inputs `(("util-linux" ,util-linux)))
723 (home-page "https://github.com/trapexit/mergerfs")
724 (synopsis "Featureful union filesystem")
725 (description "mergerfs is a union filesystem geared towards simplifying
726 storage and management of files across numerous commodity storage devices. It
727 is similar to mhddfs, unionfs, and aufs.")
729 license:isc ; mergerfs
730 license:gpl2 license:lgpl2.0 ; Imported libfuse code.