Update email for Pierre Neidhardt.
[jackhill/guix/guix.git] / gnu / packages / disk.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013 Nikita Karetnikov <nikita@karetnikov.org>
3 ;;; Copyright © 2015 Mathieu Lirzin <mthl@gnu.org>
4 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2016, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
8 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
9 ;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
10 ;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
11 ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
12 ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
13 ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
14 ;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
15 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
16 ;;;
17 ;;; This file is part of GNU Guix.
18 ;;;
19 ;;; GNU Guix is free software; you can redistribute it and/or modify it
20 ;;; under the terms of the GNU General Public License as published by
21 ;;; the Free Software Foundation; either version 3 of the License, or (at
22 ;;; your option) any later version.
23 ;;;
24 ;;; GNU Guix is distributed in the hope that it will be useful, but
25 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ;;; GNU General Public License for more details.
28 ;;;
29 ;;; You should have received a copy of the GNU General Public License
30 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31
32 (define-module (gnu packages disk)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (guix packages)
35 #:use-module (guix download)
36 #:use-module (guix git-download)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix build-system trivial)
39 #:use-module (guix build-system python)
40 #:use-module (gnu packages)
41 #:use-module (gnu packages base)
42 #:use-module (gnu packages check)
43 #:use-module (gnu packages databases)
44 #:use-module (gnu packages docbook)
45 #:use-module (gnu packages gettext)
46 #:use-module (gnu packages glib)
47 #:use-module (gnu packages gtk)
48 #:use-module (gnu packages gnome)
49 #:use-module (gnu packages linux)
50 #:use-module (gnu packages ncurses)
51 #:use-module (gnu packages perl)
52 #:use-module (gnu packages pkg-config)
53 #:use-module (gnu packages popt)
54 #:use-module (gnu packages python)
55 #:use-module (gnu packages readline)
56 #:use-module (gnu packages guile)
57 #:use-module (gnu packages compression)
58 #:use-module (gnu packages vim)
59 #:use-module (gnu packages w3m)
60 #:use-module (gnu packages xml)
61 #:use-module (gnu packages cryptsetup)
62 #:use-module (gnu packages gnuzilla)
63 #:use-module (gnu packages gnupg)
64 #:use-module (gnu packages swig)
65 #:use-module (gnu packages autotools)
66 #:use-module (gnu packages web)
67 #:use-module (gnu packages documentation)
68 #:use-module (gnu packages bash)
69 #:use-module (gnu packages c))
70
71 (define-public parted
72 (package
73 (name "parted")
74 (version "3.2")
75 (source (origin
76 (method url-fetch)
77 (uri (string-append "mirror://gnu/parted/parted-"
78 version ".tar.xz"))
79 (sha256
80 (base32
81 "1r3qpg3bhz37mgvp9chsaa3k0csby3vayfvz8ggsqz194af5i2w5"))))
82 (build-system gnu-build-system)
83 (arguments
84 `(#:phases
85 (modify-phases %standard-phases
86 (add-after
87 'unpack 'fix-locales-and-python
88 (lambda* (#:key inputs #:allow-other-keys)
89 (substitute* "tests/t0251-gpt-unicode.sh"
90 (("C.UTF-8") "en_US.utf8")) ;not in Glibc locales
91 (substitute* "tests/msdos-overlap"
92 (("/usr/bin/python") (which "python"))))))))
93 (inputs
94 `(("lvm2" ,lvm2)
95 ("readline" ,readline)
96 ("util-linux" ,util-linux)))
97 (native-inputs
98 `(("gettext" ,gettext-minimal)
99 ;; For the tests.
100 ("perl" ,perl)
101 ("python" ,python-2)))
102 (home-page "https://www.gnu.org/software/parted/")
103 (synopsis "Disk partition editor")
104 (description
105 "GNU Parted is a package for creating and manipulating disk partition
106 tables. It includes a library and command-line utility.")
107 (license license:gpl3+)))
108
109 (define-public fdisk
110 (package
111 (name "fdisk")
112 (version "2.0.0a1")
113 (source
114 (origin
115 (method url-fetch)
116 (uri (string-append "mirror://gnu/fdisk/gnufdisk-"
117 version ".tar.gz"))
118 (sha256
119 (base32
120 "1d8za79kw8ihnp2br084rgyjv9whkwp7957rzw815i0izx6xhqy9"))))
121 (build-system gnu-build-system)
122 (inputs
123 `(("gettext" ,gettext-minimal)
124 ("guile" ,guile-1.8)
125 ("util-linux" ,util-linux)
126 ("parted" ,parted)))
127 ;; The build neglects to look for its own headers in its own tree. A next
128 ;; release should fix this, but may never come: GNU fdisk looks abandoned.
129 (arguments
130 `(#:phases
131 (modify-phases %standard-phases
132 (add-after 'unpack 'skip-broken-header-probes
133 (lambda _
134 (substitute* "backend/configure"
135 (("gnufdisk-common.h .*") "\n"))
136 #t)))
137 #:make-flags (list (string-append "CPPFLAGS="
138 " -I../common/include "
139 " -I../debug/include "
140 " -I../exception/include"))))
141 (home-page "https://www.gnu.org/software/fdisk/")
142 (synopsis "Low-level disk partitioning and formatting")
143 (description
144 "GNU fdisk provides a GNU version of the common disk partitioning tool
145 fdisk. fdisk is used for the creation and manipulation of disk partition
146 tables, and it understands a variety of different formats.")
147 (license license:gpl3+)))
148
149 (define-public gptfdisk
150 (package
151 (name "gptfdisk")
152 (version "1.0.4")
153 (source
154 (origin
155 (method url-fetch)
156 (uri (string-append "mirror://sourceforge/gptfdisk/gptfdisk/"
157 version "/" name "-" version ".tar.gz"))
158 (sha256
159 (base32
160 "13d7gff4prl1nsdknjigmb7bbqhn79165n01v4y9mwbnd0d3jqxn"))))
161 (build-system gnu-build-system)
162 (inputs
163 `(("gettext" ,gettext-minimal)
164 ("ncurses" ,ncurses)
165 ("popt" ,popt)
166 ("util-linux" ,util-linux))) ; libuuid
167 (arguments
168 `(#:test-target "test"
169 #:phases
170 (modify-phases %standard-phases
171 ;; no configure script
172 (delete 'configure)
173 ;; no install target
174 (replace 'install
175 (lambda* (#:key outputs #:allow-other-keys)
176 (let* ((out (assoc-ref outputs "out"))
177 (bin (string-append out "/bin"))
178 (man (string-append out "/share/man/man8")))
179 (install-file "gdisk" bin)
180 (install-file "sgdisk" bin)
181 (install-file "cgdisk" bin)
182 (install-file "fixparts" bin)
183 (install-file "cgdisk.8" man)
184 (install-file "fixparts.8" man)
185 (install-file "gdisk.8" man)
186 (install-file "sgdisk.8" man)))))))
187 (home-page "http://www.rodsbooks.com/gdisk/")
188 (synopsis "Low-level GPT disk partitioning and formatting")
189 (description "GPT fdisk (aka gdisk) is a text-mode partitioning tool that
190 works on Globally Unique Identifier (@dfn{GUID}) Partition Table (@dfn{GPT})
191 disks, rather than on the older Master Boot Record (@dfn{MBR}) partition
192 scheme.")
193 (license license:gpl2)))
194
195 (define-public ddrescue
196 (package
197 (name "ddrescue")
198 (version "1.23")
199 (source
200 (origin
201 (method url-fetch)
202 (uri (string-append "mirror://gnu/ddrescue/ddrescue-"
203 version ".tar.lz"))
204 (sha256
205 (base32
206 "13cd6c0x91zq10vdlyl6r5rib47bmsn5sshmkin3igwj8pa2vbm9"))))
207 (build-system gnu-build-system)
208 (home-page "https://www.gnu.org/software/ddrescue/ddrescue.html")
209 (synopsis "Data recovery utility")
210 (native-inputs `(("lzip" ,lzip)))
211 (description
212 "GNU ddrescue is a fully automated data recovery tool. It copies data
213 from one file to another, working to rescue data in case of read errors. The
214 program also includes a tool for manipulating its log files, which are used
215 to recover data more efficiently by only reading the necessary blocks.")
216 (license license:gpl3+)))
217
218 (define-public dosfstools
219 (package
220 (name "dosfstools")
221 (version "4.1")
222 (source
223 (origin
224 (method url-fetch)
225 (uri (string-append "https://github.com/" name "/" name
226 "/releases/download/v" version "/"
227 name "-" version ".tar.xz"))
228 (sha256
229 (base32
230 "0wy13i3i4x2bw1hf5m4fd0myh61f9bcrs035fdlf6gyc1jksrcp6"))))
231 (build-system gnu-build-system)
232 (arguments
233 `(#:make-flags (list (string-append "PREFIX=" %output)
234 "CC=gcc")))
235 (native-inputs
236 `(("xxd" ,xxd))) ; for tests
237 (home-page "https://github.com/dosfstools/dosfstools")
238 (synopsis "Utilities for making and checking MS-DOS FAT file systems")
239 (description
240 "The dosfstools package includes the mkfs.fat and fsck.fat utilities,
241 which respectively make and check MS-DOS FAT file systems.")
242 (license license:gpl3+)))
243
244 (define dosfstools/static
245 (static-package
246 (package (inherit dosfstools))))
247
248 (define-public fatfsck/static
249 (package
250 (name "fatfsck-static")
251 (version (package-version dosfstools))
252 (build-system trivial-build-system)
253 (source #f)
254 (arguments
255 `(#:modules ((guix build utils))
256 #:builder
257 (begin
258 (use-modules (guix build utils))
259 (let ((src (string-append (assoc-ref %build-inputs "dosfstools")
260 "/sbin"))
261 (exe "fsck.fat")
262 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
263 (mkdir-p bin)
264 (with-directory-excursion bin
265 (copy-file (string-append src "/" exe) exe)
266 (remove-store-references exe)
267 (chmod exe #o555)
268 ;; Add fsck.vfat symlink to match the Linux driver name.
269 (symlink exe "fsck.vfat")
270 #t)))))
271 (inputs `(("dosfstools" ,dosfstools/static)))
272 (home-page (package-home-page dosfstools))
273 (synopsis "Statically linked fsck.fat from dosfstools")
274 (description "This package provides a statically-linked @command{fsck.fat}
275 and a @command{fsck.vfat} compatibility symlink for use in an initrd.")
276 (license (package-license dosfstools))))
277
278 (define-public sdparm
279 (package
280 (name "sdparm")
281 (version "1.10")
282 (source
283 (origin
284 (method url-fetch)
285 (uri (string-append "http://sg.danny.cz/sg/p/"
286 name "-" version ".tar.xz"))
287 (sha256
288 (base32
289 "1jjq3lzgfy4r76rc26q02lv4wm5cb4dx5nh913h489zjrr4f3jbx"))))
290 (build-system gnu-build-system)
291 (home-page "http://sg.danny.cz/sg/sdparm.html")
292 (synopsis "Provide access to SCSI device parameters")
293 (description
294 "Sdparm reads and modifies SCSI device parameters. These devices can be
295 SCSI disks, in which case the role of @command{sdparm} is similar to its
296 namesake: the @command{hdparm} utility originally designed for ATA disks.
297 However, @command{sdparm} can be used to access parameters on any device that
298 uses a SCSI command set. Such devices include CD/DVD drives (irrespective of
299 transport), SCSI and ATAPI tape drives, and SCSI enclosures. This utility can
300 also send commands associated with starting and stopping the media, loading
301 and unloading removable media and some other housekeeping functions.")
302 (license license:bsd-3)))
303
304 (define-public idle3-tools
305 (package
306 (name "idle3-tools")
307 (version "0.9.1")
308 (source
309 (origin
310 (method url-fetch)
311 (uri (string-append "mirror://sourceforge/idle3-tools/idle3-tools-"
312 version ".tgz"))
313 (sha256
314 (base32
315 "00ia7xq9yldxyl9gz0mr4xa568nav14p0fnv82f2rbbkg060cy4p"))))
316 (build-system gnu-build-system)
317 (arguments
318 `(#:tests? #f ;no test suite
319 #:phases
320 (modify-phases %standard-phases
321 (delete 'configure))
322 #:make-flags (list "CC=gcc"
323 (string-append "manprefix=")
324 (string-append "DESTDIR="
325 (assoc-ref %outputs "out")))))
326 (home-page "http://idle3-tools.sourceforge.net")
327 (synopsis "Change or disable Western Digital hard drives' Idle3 timer")
328 (description
329 "Idle3-tools provides a utility to get, set, or disable the Idle3 timer
330 present in many Western Digital hard drives. This timer is part of the
331 \"IntelliPark\" feature that stops the disk when not in use. Unfortunately,
332 the default timer setting is not well suited to Linux or other *nix systems,
333 and can dramatically shorten the lifespan of the drive if left unchecked.")
334 (license license:gpl3+)))
335
336 (define-public gparted
337 (package
338 (name "gparted")
339 (version "0.31.0")
340 (source
341 (origin
342 (method url-fetch)
343 (uri (string-append "mirror://sourceforge/gparted/gparted/gparted-"
344 version "/gparted-" version ".tar.gz"))
345 (sha256
346 (base32 "1fh7rpgb4xxdhgyjsirb83zvjfc5mfngb8a1pjbv7r6r6jj4jyrv"))))
347 (build-system gnu-build-system)
348 (arguments
349 `(#:tests? #f ; tests require a network connection
350 #:configure-flags '("--disable-scrollkeeper")))
351 (inputs
352 `(("util-linux" ,util-linux)
353 ("parted" ,parted)
354 ("glib" ,glib)
355 ("gtkmm" ,gtkmm-2)
356 ("libxml2" ,libxml2)
357 ("libxslt" ,libxslt)
358 ("gnome-doc-utils" ,gnome-doc-utils)
359 ("docbook-xml" ,docbook-xml-4.2)
360 ("python" ,python-2)
361 ("python-libxml2" ,python2-libxml2)
362 ("which" ,which)))
363 (native-inputs
364 `(("intltool" ,intltool)
365 ("pkg-config" ,pkg-config)))
366 (home-page "https://gparted.org/")
367 (synopsis "Partition editor to graphically manage disk partitions")
368 (description "GParted is a GNOME partition editor for creating,
369 reorganizing, and deleting disk partitions. It uses libparted from the parted
370 project to detect and manipulate partition tables. Optional file system tools
371 permit managing file systems not included in libparted.")
372 ;; The home page says GPLv2, but the source code says GPLv2+.
373 (license license:gpl2+)))
374
375 (define-public pydf
376 (package
377 (name "pydf")
378 (version "12")
379 (source
380 (origin
381 (method url-fetch)
382 (uri (pypi-uri "pydf" version))
383 (sha256
384 (base32
385 "0f8ly8xyp93i2hm9c0qjqd4y86nz73axw2f09z01mszwmg1sfivz"))))
386 (build-system python-build-system)
387 (home-page "http://kassiopeia.juls.savba.sk/~garabik/software/pydf/")
388 (synopsis "Colourised @command{df} clone")
389 (description "All-singing, all-dancing, fully colourised @command{df} clone
390 written in Python. It displays the amount of disk space available on the
391 mounted file systems, using different colours for different types of file
392 systems. Output format is completely customizable.")
393 (license license:public-domain)))
394
395 (define-public f3
396 (package
397 (name "f3")
398 (version "7.1")
399 (source
400 (origin
401 (method git-fetch)
402 (uri (git-reference
403 (url "https://github.com/AltraMayor/f3.git")
404 (commit (string-append "v" version))))
405 (file-name (git-file-name name version))
406 (sha256
407 (base32
408 "0zglsmz683jg7f9wc6vmgljyg9w87pbnjw5x4w6x02w8233zvjqf"))))
409 (build-system gnu-build-system)
410 (arguments
411 '(#:tests? #f ; no check target
412 #:make-flags (list "CC=gcc"
413 (string-append "PREFIX=" %output))
414 #:phases
415 (modify-phases %standard-phases
416 (delete 'configure) ; no configure script
417 (add-after 'build 'build-extra
418 (lambda* (#:key make-flags #:allow-other-keys)
419 (apply invoke "make" "extra" make-flags)))
420 (add-after 'build 'install-extra
421 (lambda* (#:key make-flags #:allow-other-keys)
422 (apply invoke "make" "install-extra" make-flags))))))
423 (inputs
424 `(("eudev" ,eudev)
425 ("parted" ,parted)))
426 (home-page "http://oss.digirati.com.br/f3/")
427 (synopsis "Test real capacity of flash memory cards and such.")
428 (description "F3 (Fight Flash Fraud or Fight Fake Flash) tests the full
429 capacity of a flash card (flash drive, flash disk, pendrive). F3 writes to
430 the card and then checks if can read it. It will assure you haven't been sold
431 a card with a smaller capacity than stated.")
432 (license license:gpl3+)))
433
434 (define-public python-parted
435 (package
436 (name "python-parted")
437 (version "3.11.1")
438 (source
439 (origin
440 (method url-fetch)
441 (uri (string-append "https://github.com/dcantrell/pyparted/archive/v"
442 version ".tar.gz"))
443 (sha256
444 (base32
445 "0r1nyjj40nacnfnv17x2mnsj6ga1qplyxyza82v2809dfhim2fwq"))))
446 (build-system python-build-system)
447 (arguments
448 `(#:phases
449 (modify-phases %standard-phases
450 (delete 'check)
451 (add-after 'install 'check
452 (lambda* (#:key outputs inputs #:allow-other-keys)
453 (add-installed-pythonpath inputs outputs)
454 ;; See <https://github.com/dcantrell/pyparted/issues/47>.
455 (substitute* "tests/test__ped_ped.py"
456 (("\"/tmp/temp-device-\"") "self.path"))
457 (invoke "python" "-m" "unittest" "discover" "-v")
458 #t)))))
459 (native-inputs
460 `(("e2fsprogs" ,e2fsprogs)
461 ("pkg-config" ,pkg-config)))
462 (propagated-inputs
463 `(("python-six" ,python-six)))
464 (inputs
465 `(("parted" ,parted)))
466 (home-page "https://github.com/dcantrell/pyparted")
467 (synopsis "Parted bindings for Python")
468 (description "This package provides @code{parted} bindings for Python.")
469 (license license:gpl2+)))
470
471 (define-public python2-parted
472 (package-with-python2 python-parted))
473
474 (define-public duperemove
475 (package
476 (name "duperemove")
477 (version "0.11")
478 (source (origin
479 (method url-fetch)
480 (uri (string-append
481 "https://github.com/markfasheh/duperemove/archive/v"
482 version ".tar.gz"))
483 (sha256
484 (base32
485 "0rjmmh42yqw9a5j6sp31cqwxk3s97dsi4xz0wpxpllj7bsp3aiw5"))
486 (file-name (string-append name "-" version ".tar.gz"))))
487 (build-system gnu-build-system)
488 (native-inputs
489 `(("pkg-config" ,pkg-config)))
490 (inputs
491 `(("glib" ,glib)
492 ("sqlite" ,sqlite)))
493 (arguments
494 `(#:tests? #f ; no test suite
495 #:phases
496 (modify-phases %standard-phases
497 (delete 'configure)) ; no configure script
498 #:make-flags (list (string-append "PREFIX=" %output)
499 "CC=gcc")))
500 (home-page "https://github.com/markfasheh/duperemove")
501 (synopsis "Tools for de-duplicating file system data")
502 (description "Duperemove is a simple tool for finding duplicated extents
503 and submitting them for deduplication. When given a list of files it will
504 hash their contents on a block by block basis and compare those hashes to each
505 other, finding and categorizing blocks that match each other. When given the
506 @option{-d} option, duperemove will submit those extents for deduplication
507 using the Linux kernel extent-same @code{ioctl}.
508
509 Duperemove can store the hashes it computes in a @dfn{hash file}. If given an
510 existing hash file, duperemove will only compute hashes for those files which
511 have changed since the last run. Thus you can run duperemove repeatedly on
512 your data as it changes, without having to re-checksum unchanged data.
513
514 Duperemove can also take input from the @command{fdupes} program.")
515 (license license:gpl2)))
516
517 (define-public ranger
518 (package
519 (name "ranger")
520 (version "1.9.1")
521 (source (origin
522 (method url-fetch)
523 (uri (string-append "https://ranger.github.io/"
524 "ranger-" version ".tar.gz"))
525 (sha256
526 (base32
527 "1lnzkrxcnlwnyi3z0v8ybyp8d5rm26qm35rr68kbs2lbs06inha0"))))
528 (build-system python-build-system)
529 (inputs
530 `(("w3m" ,w3m)))
531 (native-inputs ;for tests
532 `(("python-pytest" ,python-pytest)
533 ("python-pylint" ,python-pylint)
534 ("python-flake8" ,python-flake8)
535 ("which" ,which)))
536 (arguments
537 '(#:test-target "test"
538 #:phases
539 (modify-phases %standard-phases
540 (add-after 'configure 'wrap-program
541 ;; Tell 'ranger' where 'w3mimgdisplay' is.
542 (lambda* (#:key inputs outputs #:allow-other-keys)
543 (let* ((out (assoc-ref outputs "out"))
544 (ranger (string-append out "/bin/ranger"))
545 (w3m (assoc-ref inputs "w3m"))
546 (w3mimgdisplay (string-append w3m
547 "/libexec/w3m/w3mimgdisplay")))
548 (wrap-program ranger
549 `("W3MIMGDISPLAY_PATH" ":" prefix (,w3mimgdisplay)))
550 #t))))))
551 (home-page "https://ranger.github.io/")
552 (synopsis "Console file manager")
553 (description "ranger is a console file manager with Vi key bindings. It
554 provides a minimalistic and nice curses interface with a view on the directory
555 hierarchy. It ships with @code{rifle}, a file launcher that is good at
556 automatically finding out which program to use for what file type.")
557 (license license:gpl3)))
558
559 (define-public volume-key
560 (package
561 (name "volume-key")
562 (version "0.3.11")
563 (source (origin
564 (method url-fetch)
565 (uri (string-append "https://releases.pagure.org/volume_key/volume_key-"
566 version ".tar.xz"))
567 (sha256
568 (base32
569 "0vaz15rcgdkh5z4yxc22x76wi44gh50jxnrqz5avaxz4bb17kcp6"))))
570 (build-system gnu-build-system)
571 (native-inputs
572 `(("pkg-config" ,pkg-config)
573 ("util-linux" ,util-linux)
574 ("swig" ,swig)
575 ("python" ,python-3))) ; Used to generate the Python bindings.
576 (inputs
577 `(("cryptsetup" ,cryptsetup)
578 ("nss" ,nss)
579 ("lvm2" ,lvm2) ; For "-ldevmapper".
580 ("glib" ,glib)
581 ("gpgme" ,gpgme)))
582 (arguments
583 `(#:tests? #f ; Not sure how tests are supposed to pass, even when run manually.
584 #:phases
585 (modify-phases %standard-phases
586 (add-before 'configure 'patch-python.h-path
587 (lambda* (#:key inputs #:allow-other-keys)
588 (let ((python (assoc-ref inputs "python")))
589 (substitute* "Makefile.in"
590 (("/usr/include/python") (string-append python "/include/python")))
591 #t))))))
592 (home-page "https://pagure.io/volume_key")
593 (synopsis "Manipulate storage volume encryption keys")
594 (description
595 "This package provides a library for manipulating storage volume
596 encryption keys and storing them separately from volumes to handle forgotten
597 passphrases.")
598 (license license:gpl2)))
599
600 (define-public ndctl
601 (package
602 (name "ndctl")
603 (version "61.2")
604 (source (origin
605 (method git-fetch)
606 (uri (git-reference
607 (url "https://github.com/pmem/ndctl")
608 (commit (string-append "v" version))))
609 (file-name (string-append name "-" version "-checkout"))
610 (sha256
611 (base32
612 "0vid78jzhmzh505bpwn8mvlamfhcvl6rlfjc29y4yn7zslpydxl7"))))
613 (build-system gnu-build-system)
614 (native-inputs
615 `(("asciidoc" ,asciidoc)
616 ("automake" ,automake)
617 ("autoconf" ,autoconf)
618 ("docbook-xsl" ,docbook-xsl)
619 ("libtool" ,libtool)
620 ("libxml2" ,libxml2)
621 ("pkg-config" ,pkg-config)
622 ("xmlto" ,xmlto)
623 ;; Required for offline docbook generation:
624 ("which" ,which)))
625 (inputs
626 `(("eudev" ,eudev)
627 ("json-c" ,json-c)
628 ("kmod" ,kmod)
629 ("util-linux" ,util-linux)))
630 (arguments
631 `(#:phases
632 (modify-phases %standard-phases
633 (add-after 'unpack 'autogen
634 (lambda _
635 (substitute* "autogen.sh"
636 (("/bin/sh") (which "sh")))
637 (substitute* "git-version-gen"
638 (("/bin/sh") (which "sh")))
639 (substitute* "git-version"
640 (("/bin/bash") (which "bash"))))))
641 #:make-flags
642 (let ((out (assoc-ref %outputs "out")))
643 (list (string-append "BASH_COMPLETION_DIR=" out
644 "/share/bash-completion/completions")))))
645 (home-page "https://github.com/pmem/ndctl")
646 (synopsis "Manage the non-volatile memory device sub-system in the Linux kernel")
647 (description
648 "This package provides a utility library for managing the
649 libnvdimm (non-volatile memory device) sub-system in the Linux kernel.")
650 ;; COPYING says LGPL2.1, but many source files are GPL2 so that's
651 ;; the effective license. Note that some files under ccan/ are
652 ;; covered by BSD-3 or public domain, see the individual folders.
653 (license license:gpl2)))
654
655 (define-public dmraid
656 (package
657 (name "dmraid")
658 (version "1.0.0.rc16-3")
659 (source (origin
660 (method url-fetch)
661 (uri (string-append "https://people.redhat.com/~heinzm/sw/dmraid/src/dmraid-"
662 version ".tar.bz2"))
663 (sha256
664 (base32
665 "1n7vsqvh7y6yvil682q129d21yhb0cmvd5fvsbkza7ypd78inhlk"))))
666 (build-system gnu-build-system)
667 (inputs `(("lvm2" ,lvm2)))
668 (native-inputs `(("which" ,which)))
669 (arguments
670 `(#:tests? #f ; No tests.
671 ;; Prevent a race condition where some target would attempt to link
672 ;; libdmraid.so before it had been built as reported in
673 ;; <https://bugs.gnu.org/31999#187>.
674 #:parallel-build? #f
675 #:phases (modify-phases %standard-phases
676 (add-before 'configure 'change-directory
677 (lambda _
678 (chdir (string-append ,version "/dmraid"))
679 (substitute* "make.tmpl.in"
680 (("/bin/sh") (which "sh")))
681 #t)))
682 #:configure-flags (list ;; Make sure programs such as 'dmevent_tool' can
683 ;; find libdmraid.so.
684 (string-append "LDFLAGS=-Wl,-rpath="
685 (assoc-ref %outputs "out")
686 "/lib"))))
687 (home-page "https://people.redhat.com/~heinzm/sw/dmraid/")
688 (synopsis "Device mapper RAID interface")
689 (description
690 "This software supports RAID device discovery, RAID set activation, creation,
691 removal, rebuild and display of properties for ATARAID/DDF1 metadata.
692
693 @command{dmraid} uses @file{libdevmapper} and the device-mapper kernel runtime
694 to create devices with respective mappings for the ATARAID sets discovered.")
695 (license license:gpl2+)))
696
697 (define-public libblockdev
698 (package
699 (name "libblockdev")
700 (version "2.18")
701 (source (origin
702 (method url-fetch)
703 (uri (string-append "https://github.com/storaged-project/libblockdev/releases/download/"
704 version "-1/libblockdev-" version ".tar.gz"))
705 (sha256
706 (base32
707 "1a3kpdr9s6g7nfibazi92i27wbv692b5gm2r24gimis6l6jq4pbh"))))
708 (build-system gnu-build-system)
709 (native-inputs
710 `(("pkg-config" ,pkg-config)
711 ("python" ,python-wrapper)
712 ("util-linux" ,util-linux)))
713 (inputs
714 `(("btrfs-progs" ,btrfs-progs)
715 ("cryptsetup" ,cryptsetup)
716 ("dosfstools" ,dosfstools)
717 ("dmraid" ,dmraid)
718 ("eudev" ,eudev)
719 ("glib" ,glib)
720 ("gobject-introspection" ,gobject-introspection)
721 ("kmod" ,kmod)
722 ("libbytesize" ,libbytesize)
723 ("libyaml" ,libyaml)
724 ("lvm2" ,lvm2)
725 ("mdadm" ,mdadm)
726 ("ndctl" ,ndctl)
727 ("nss" ,nss)
728 ("parted" ,parted)
729 ("volume-key" ,volume-key)
730 ;; ("xfsprogs" ,xfsprogs) ; TODO: Package?
731 ))
732 (home-page "https://github.com/storaged-project/libblockdev")
733 (synopsis "Library for manipulating block devices")
734 (description
735 "libblockdev is a C library supporting GObject introspection for
736 manipulation of block devices. It has a plugin-based architecture where each
737 technology (like LVM, Btrfs, MD RAID, Swap...) is implemented in a separate
738 plugin, possibly with multiple implementations (e.g. using LVM CLI or the new
739 LVM D-Bus API).")
740 ;; XXX: Copying says LGPL2.1, but the source files with license
741 ;; information are GPL2+.
742 (license license:gpl2+)))