Merge branch 'master' into staging
[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 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 ;;;
13 ;;; This file is part of GNU Guix.
14 ;;;
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
19 ;;;
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
24 ;;;
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28 (define-module (gnu packages disk)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix build-system trivial)
34 #:use-module (guix build-system python)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages base)
37 #:use-module (gnu packages docbook)
38 #:use-module (gnu packages gettext)
39 #:use-module (gnu packages glib)
40 #:use-module (gnu packages gtk)
41 #:use-module (gnu packages gnome)
42 #:use-module (gnu packages linux)
43 #:use-module (gnu packages ncurses)
44 #:use-module (gnu packages perl)
45 #:use-module (gnu packages pkg-config)
46 #:use-module (gnu packages popt)
47 #:use-module (gnu packages python)
48 #:use-module (gnu packages readline)
49 #:use-module (gnu packages guile)
50 #:use-module (gnu packages compression)
51 #:use-module (gnu packages vim)
52 #:use-module (gnu packages xml))
53
54 (define-public parted
55 (package
56 (name "parted")
57 (version "3.2")
58 (source (origin
59 (method url-fetch)
60 (uri (string-append "mirror://gnu/parted/parted-"
61 version ".tar.xz"))
62 (sha256
63 (base32
64 "1r3qpg3bhz37mgvp9chsaa3k0csby3vayfvz8ggsqz194af5i2w5"))))
65 (build-system gnu-build-system)
66 (arguments
67 `(#:phases
68 (modify-phases %standard-phases
69 (add-after
70 'unpack 'fix-locales-and-python
71 (lambda* (#:key inputs #:allow-other-keys)
72 (substitute* "tests/t0251-gpt-unicode.sh"
73 (("C.UTF-8") "en_US.utf8")) ;not in Glibc locales
74 (substitute* "tests/msdos-overlap"
75 (("/usr/bin/python") (which "python"))))))))
76 (inputs
77 `(("lvm2" ,lvm2)
78 ("readline" ,readline)
79 ("util-linux" ,util-linux)))
80 (native-inputs
81 `(("gettext" ,gettext-minimal)
82 ;; For the tests.
83 ("perl" ,perl)
84 ("python" ,python-2)))
85 (home-page "https://www.gnu.org/software/parted/")
86 (synopsis "Disk partition editor")
87 (description
88 "GNU Parted is a package for creating and manipulating disk partition
89 tables. It includes a library and command-line utility.")
90 (license license:gpl3+)))
91
92 (define-public fdisk
93 (package
94 (name "fdisk")
95 (version "2.0.0a1")
96 (source
97 (origin
98 (method url-fetch)
99 (uri (string-append "mirror://gnu/fdisk/gnufdisk-"
100 version ".tar.gz"))
101 (sha256
102 (base32
103 "1d8za79kw8ihnp2br084rgyjv9whkwp7957rzw815i0izx6xhqy9"))))
104 (build-system gnu-build-system)
105 (inputs
106 `(("gettext" ,gettext-minimal)
107 ("guile" ,guile-1.8)
108 ("util-linux" ,util-linux)
109 ("parted" ,parted)))
110 ;; The build neglects to look for its own headers in its own tree. A next
111 ;; release should fix this, but may never come: GNU fdisk looks abandoned.
112 (arguments
113 `(#:phases
114 (modify-phases %standard-phases
115 (add-after 'unpack 'skip-broken-header-probes
116 (lambda _
117 (substitute* "backend/configure"
118 (("gnufdisk-common.h .*") "\n"))
119 #t)))
120 #:make-flags (list (string-append "CPPFLAGS="
121 " -I../common/include "
122 " -I../debug/include "
123 " -I../exception/include"))))
124 (home-page "https://www.gnu.org/software/fdisk/")
125 (synopsis "Low-level disk partitioning and formatting")
126 (description
127 "GNU fdisk provides a GNU version of the common disk partitioning tool
128 fdisk. fdisk is used for the creation and manipulation of disk partition
129 tables, and it understands a variety of different formats.")
130 (license license:gpl3+)))
131
132 (define-public gptfdisk
133 (package
134 (name "gptfdisk")
135 (version "1.0.3")
136 (source
137 (origin
138 (method url-fetch)
139 (uri (string-append "mirror://sourceforge/gptfdisk/gptfdisk/"
140 version "/" name "-" version ".tar.gz"))
141 (sha256
142 (base32
143 "0p0vr67lnqdsgdv2y144xmjqa1a2nijrrd3clc8dc2f46pn5mzc9"))))
144 (build-system gnu-build-system)
145 (inputs
146 `(("gettext" ,gettext-minimal)
147 ("ncurses" ,ncurses)
148 ("popt" ,popt)
149 ("util-linux" ,util-linux))) ; libuuid
150 (arguments
151 `(#:test-target "test"
152 #:phases
153 (modify-phases %standard-phases
154 ;; no configure script
155 (delete 'configure)
156 ;; no install target
157 (replace 'install
158 (lambda* (#:key outputs #:allow-other-keys)
159 (let* ((out (assoc-ref outputs "out"))
160 (bin (string-append out "/bin"))
161 (man (string-append out "/share/man/man8")))
162 (install-file "gdisk" bin)
163 (install-file "sgdisk" bin)
164 (install-file "cgdisk" bin)
165 (install-file "fixparts" bin)
166 (install-file "cgdisk.8" man)
167 (install-file "fixparts.8" man)
168 (install-file "gdisk.8" man)
169 (install-file "sgdisk.8" man)))))))
170 (home-page "http://www.rodsbooks.com/gdisk/")
171 (synopsis "Low-level GPT disk partitioning and formatting")
172 (description "GPT fdisk (aka gdisk) is a text-mode partitioning tool that
173 works on Globally Unique Identifier (@dfn{GUID}) Partition Table (@dfn{GPT})
174 disks, rather than on the older Master Boot Record (@dfn{MBR}) partition
175 scheme.")
176 (license license:gpl2)))
177
178 (define-public ddrescue
179 (package
180 (name "ddrescue")
181 (version "1.22")
182 (source
183 (origin
184 (method url-fetch)
185 (uri (string-append "mirror://gnu/ddrescue/ddrescue-"
186 version ".tar.lz"))
187 (sha256
188 (base32
189 "19qhx9ggkkjl0g3a88g501wmybkj1y4n5lm5kp0km0blh0p7p189"))))
190 (build-system gnu-build-system)
191 (home-page "https://www.gnu.org/software/ddrescue/ddrescue.html")
192 (synopsis "Data recovery utility")
193 (native-inputs `(("lzip" ,lzip)))
194 (description
195 "GNU ddrescue is a fully automated data recovery tool. It copies data
196 from one file to another, working to rescue data in case of read errors. The
197 program also includes a tool for manipulating its log files, which are used
198 to recover data more efficiently by only reading the necessary blocks.")
199 (license license:gpl3+)))
200
201 (define-public dosfstools
202 (package
203 (name "dosfstools")
204 (version "4.1")
205 (source
206 (origin
207 (method url-fetch)
208 (uri (string-append "https://github.com/" name "/" name
209 "/releases/download/v" version "/"
210 name "-" version ".tar.xz"))
211 (sha256
212 (base32
213 "0wy13i3i4x2bw1hf5m4fd0myh61f9bcrs035fdlf6gyc1jksrcp6"))))
214 (build-system gnu-build-system)
215 (arguments
216 `(#:make-flags (list (string-append "PREFIX=" %output)
217 "CC=gcc")))
218 (native-inputs
219 `(("xxd" ,xxd))) ; for tests
220 (home-page "https://github.com/dosfstools/dosfstools")
221 (synopsis "Utilities for making and checking MS-DOS FAT file systems")
222 (description
223 "The dosfstools package includes the mkfs.fat and fsck.fat utilities,
224 which respectively make and check MS-DOS FAT file systems.")
225 (license license:gpl3+)))
226
227 (define dosfstools/static
228 (static-package
229 (package (inherit dosfstools))))
230
231 (define-public fatfsck/static
232 (package
233 (name "fatfsck-static")
234 (version (package-version dosfstools))
235 (build-system trivial-build-system)
236 (source #f)
237 (arguments
238 `(#:modules ((guix build utils))
239 #:builder
240 (begin
241 (use-modules (guix build utils))
242 (let ((src (string-append (assoc-ref %build-inputs "dosfstools")
243 "/sbin"))
244 (exe "fsck.fat")
245 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
246 (mkdir-p bin)
247 (with-directory-excursion bin
248 (copy-file (string-append src "/" exe) exe)
249 (remove-store-references exe)
250 (chmod exe #o555)
251 ;; Add fsck.vfat symlink to match the Linux driver name.
252 (symlink exe "fsck.vfat")
253 #t)))))
254 (inputs `(("dosfstools" ,dosfstools/static)))
255 (home-page (package-home-page dosfstools))
256 (synopsis "Statically linked fsck.fat from dosfstools")
257 (description "This package provides a statically-linked @command{fsck.fat}
258 and a @command{fsck.vfat} compatibility symlink for use in an initrd.")
259 (license (package-license dosfstools))))
260
261 (define-public sdparm
262 (package
263 (name "sdparm")
264 (version "1.10")
265 (source
266 (origin
267 (method url-fetch)
268 (uri (string-append "http://sg.danny.cz/sg/p/"
269 name "-" version ".tar.xz"))
270 (sha256
271 (base32
272 "1jjq3lzgfy4r76rc26q02lv4wm5cb4dx5nh913h489zjrr4f3jbx"))))
273 (build-system gnu-build-system)
274 (home-page "http://sg.danny.cz/sg/sdparm.html")
275 (synopsis "Provide access to SCSI device parameters")
276 (description
277 "Sdparm reads and modifies SCSI device parameters. These devices can be
278 SCSI disks, in which case the role of @command{sdparm} is similar to its
279 namesake: the @command{hdparm} utility originally designed for ATA disks.
280 However, @command{sdparm} can be used to access parameters on any device that
281 uses a SCSI command set. Such devices include CD/DVD drives (irrespective of
282 transport), SCSI and ATAPI tape drives, and SCSI enclosures. This utility can
283 also send commands associated with starting and stopping the media, loading
284 and unloading removable media and some other housekeeping functions.")
285 (license license:bsd-3)))
286
287 (define-public idle3-tools
288 (package
289 (name "idle3-tools")
290 (version "0.9.1")
291 (source
292 (origin
293 (method url-fetch)
294 (uri (string-append "mirror://sourceforge/idle3-tools/idle3-tools-"
295 version ".tgz"))
296 (sha256
297 (base32
298 "00ia7xq9yldxyl9gz0mr4xa568nav14p0fnv82f2rbbkg060cy4p"))))
299 (build-system gnu-build-system)
300 (arguments
301 `(#:tests? #f ;no test suite
302 #:phases
303 (modify-phases %standard-phases
304 (delete 'configure))
305 #:make-flags (list "CC=gcc"
306 (string-append "manprefix=")
307 (string-append "DESTDIR="
308 (assoc-ref %outputs "out")))))
309 (home-page "http://idle3-tools.sourceforge.net")
310 (synopsis "Change or disable Western Digital hard drives' Idle3 timer")
311 (description
312 "Idle3-tools provides a utility to get, set, or disable the Idle3 timer
313 present in many Western Digital hard drives. This timer is part of the
314 \"IntelliPark\" feature that stops the disk when not in use. Unfortunately,
315 the default timer setting is not well suited to Linux or other *nix systems,
316 and can dramatically shorten the lifespan of the drive if left unchecked.")
317 (license license:gpl3+)))
318
319 (define-public gparted
320 (package
321 (name "gparted")
322 (version "0.28.1")
323 (source
324 (origin
325 (method url-fetch)
326 (uri (string-append "mirror://sourceforge/gparted/gparted/gparted-"
327 version "/gparted-" version ".tar.gz"))
328 (sha256
329 (base32 "0cyk8lpimm6wani8khw0szwqkgw5wpq2mfnfxkbgfm2774a1z2bn"))))
330 (build-system gnu-build-system)
331 (arguments
332 `(#:tests? #f ; Tests require a network connection.
333 #:configure-flags '("--disable-scrollkeeper")))
334 (inputs
335 `(("util-linux" ,util-linux)
336 ("parted" ,parted)
337 ("glib" ,glib)
338 ("gtkmm" ,gtkmm-2)
339 ("libxml2" ,libxml2)
340 ("libxslt" ,libxslt)
341 ("gnome-doc-utils" ,gnome-doc-utils)
342 ("docbook-xml" ,docbook-xml-4.2)
343 ("python" ,python-2)
344 ("python-libxml2" ,python2-libxml2)
345 ("which" ,which)))
346 (native-inputs
347 `(("intltool" ,intltool)
348 ("pkg-config" ,pkg-config)))
349 (home-page "https://gparted.org/")
350 (synopsis "Partition editor to graphically manage disk partitions")
351 (description "GParted is a GNOME partition editor for creating,
352 reorganizing, and deleting disk partitions. It uses libparted from the parted
353 project to detect and manipulate partition tables. Optional file system tools
354 permit managing file systems not included in libparted.")
355 ;; The home page says GPLv2, but the source code says GPLv2+.
356 (license license:gpl2+)))
357
358 (define-public pydf
359 (package
360 (name "pydf")
361 (version "12")
362 (source
363 (origin
364 (method url-fetch)
365 (uri (pypi-uri "pydf" version))
366 (sha256
367 (base32
368 "0f8ly8xyp93i2hm9c0qjqd4y86nz73axw2f09z01mszwmg1sfivz"))))
369 (build-system python-build-system)
370 (home-page "http://kassiopeia.juls.savba.sk/~garabik/software/pydf/")
371 (synopsis "Colourised @command{df} clone")
372 (description "All-singing, all-dancing, fully colourised @command{df} clone
373 written in Python. It displays the amount of disk space available on the
374 mounted filesystems, using different colours for different types of file
375 systems. Output format is completely customizable.")
376 (license license:public-domain)))
377
378 (define-public f3
379 (package
380 (name "f3")
381 (version "6.0")
382 (source
383 (origin
384 (method url-fetch)
385 (uri (string-append "https://github.com/AltraMayor/f3/archive/"
386 "v" version ".tar.gz"))
387 (file-name (string-append name "-" version ".tar.gz"))
388 (sha256
389 (base32
390 "1mgbzc1swvgil45md1336j0aqkmkhwmpxical0ln5g09b2qxsanp"))))
391 (build-system gnu-build-system)
392 (arguments
393 '(#:tests? #f ; no check target
394 #:make-flags (list "CC=gcc"
395 (string-append "PREFIX=" %output))
396 #:phases
397 (modify-phases %standard-phases
398 (delete 'configure)
399 (add-before 'build 'fix-makefile
400 (lambda _
401 (substitute* "Makefile"
402 ;; Install without setting owner and group
403 (("\\$\\(INSTALL\\) -oroot -groot ") "$(INSTALL) ")
404 ;; also build and install experimental tools
405 (("^all: ") "all: $(EXPERIMENTAL_TARGETS) ")
406 (("^install: ") "install-all: ")
407 (("^install-experimental: ") "install: install-all "))
408 #t)))))
409 (inputs
410 `(("eudev" ,eudev)
411 ("parted" ,parted)))
412 (home-page "http://oss.digirati.com.br/f3/")
413 (synopsis "Test real capacity of flash memory cards and such.")
414 (description "F3 (Fight Flash Fraud or Fight Fake Flash) tests the full
415 capacity of a flash card (flash drive, flash disk, pendrive). F3 writes to
416 the card and then checks if can read it. It will assure you haven't been sold
417 a card with a smaller capacity than stated.")
418 (license license:gpl3+)))