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>
13 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
60 (uri (string-append "mirror://gnu/parted/parted-"
64 "1r3qpg3bhz37mgvp9chsaa3k0csby3vayfvz8ggsqz194af5i2w5"))))
65 (build-system gnu-build-system)
68 (modify-phases %standard-phases
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"))))))))
78 ("readline" ,readline)
79 ("util-linux" ,util-linux)))
81 `(("gettext" ,gettext-minimal)
84 ("python" ,python-2)))
85 (home-page "https://www.gnu.org/software/parted/")
86 (synopsis "Disk partition editor")
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+)))
99 (uri (string-append "mirror://gnu/fdisk/gnufdisk-"
103 "1d8za79kw8ihnp2br084rgyjv9whkwp7957rzw815i0izx6xhqy9"))))
104 (build-system gnu-build-system)
106 `(("gettext" ,gettext-minimal)
108 ("util-linux" ,util-linux)
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.
114 (modify-phases %standard-phases
115 (add-after 'unpack 'skip-broken-header-probes
117 (substitute* "backend/configure"
118 (("gnufdisk-common.h .*") "\n"))
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")
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+)))
132 (define-public gptfdisk
139 (uri (string-append "mirror://sourceforge/gptfdisk/gptfdisk/"
140 version "/" name "-" version ".tar.gz"))
143 "0p0vr67lnqdsgdv2y144xmjqa1a2nijrrd3clc8dc2f46pn5mzc9"))))
144 (build-system gnu-build-system)
146 `(("gettext" ,gettext-minimal)
149 ("util-linux" ,util-linux))) ; libuuid
151 `(#:test-target "test"
153 (modify-phases %standard-phases
154 ;; no configure script
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
176 (license license:gpl2)))
178 (define-public ddrescue
185 (uri (string-append "mirror://gnu/ddrescue/ddrescue-"
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)))
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+)))
201 (define-public dosfstools
208 (uri (string-append "https://github.com/" name "/" name
209 "/releases/download/v" version "/"
210 name "-" version ".tar.xz"))
213 "0wy13i3i4x2bw1hf5m4fd0myh61f9bcrs035fdlf6gyc1jksrcp6"))))
214 (build-system gnu-build-system)
216 `(#:make-flags (list (string-append "PREFIX=" %output)
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")
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+)))
227 (define dosfstools/static
229 (package (inherit dosfstools))))
231 (define-public fatfsck/static
233 (name "fatfsck-static")
234 (version (package-version dosfstools))
235 (build-system trivial-build-system)
238 `(#:modules ((guix build utils))
241 (use-modules (guix build utils))
242 (let ((src (string-append (assoc-ref %build-inputs "dosfstools")
245 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
247 (with-directory-excursion bin
248 (copy-file (string-append src "/" exe) exe)
249 (remove-store-references exe)
251 ;; Add fsck.vfat symlink to match the Linux driver name.
252 (symlink exe "fsck.vfat")
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))))
261 (define-public sdparm
268 (uri (string-append "http://sg.danny.cz/sg/p/"
269 name "-" version ".tar.xz"))
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")
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)))
287 (define-public idle3-tools
294 (uri (string-append "mirror://sourceforge/idle3-tools/idle3-tools-"
298 "00ia7xq9yldxyl9gz0mr4xa568nav14p0fnv82f2rbbkg060cy4p"))))
299 (build-system gnu-build-system)
301 `(#:tests? #f ;no test suite
303 (modify-phases %standard-phases
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")
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+)))
319 (define-public gparted
326 (uri (string-append "mirror://sourceforge/gparted/gparted/gparted-"
327 version "/gparted-" version ".tar.gz"))
329 (base32 "0cyk8lpimm6wani8khw0szwqkgw5wpq2mfnfxkbgfm2774a1z2bn"))))
330 (build-system gnu-build-system)
332 `(#:tests? #f ; Tests require a network connection.
333 #:configure-flags '("--disable-scrollkeeper")))
335 `(("util-linux" ,util-linux)
341 ("gnome-doc-utils" ,gnome-doc-utils)
342 ("docbook-xml" ,docbook-xml-4.2)
344 ("python-libxml2" ,python2-libxml2)
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+)))
365 (uri (pypi-uri "pydf" version))
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)))
385 (uri (string-append "https://github.com/AltraMayor/f3/archive/"
386 "v" version ".tar.gz"))
387 (file-name (string-append name "-" version ".tar.gz"))
390 "1mgbzc1swvgil45md1336j0aqkmkhwmpxical0ln5g09b2qxsanp"))))
391 (build-system gnu-build-system)
393 '(#:tests? #f ; no check target
394 #:make-flags (list "CC=gcc"
395 (string-append "PREFIX=" %output))
397 (modify-phases %standard-phases
399 (add-before 'build 'fix-makefile
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 "))
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+)))