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>
11 ;;; This file is part of GNU Guix.
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26 (define-module (gnu packages disk)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix build-system trivial)
32 #:use-module (gnu packages)
33 #:use-module (gnu packages base)
34 #:use-module (gnu packages docbook)
35 #:use-module (gnu packages gettext)
36 #:use-module (gnu packages glib)
37 #:use-module (gnu packages gtk)
38 #:use-module (gnu packages gnome)
39 #:use-module (gnu packages linux)
40 #:use-module (gnu packages ncurses)
41 #:use-module (gnu packages perl)
42 #:use-module (gnu packages pkg-config)
43 #:use-module (gnu packages popt)
44 #:use-module (gnu packages python)
45 #:use-module (gnu packages readline)
46 #:use-module (gnu packages guile)
47 #:use-module (gnu packages compression)
48 #:use-module (gnu packages vim)
49 #:use-module (gnu packages xml))
57 (uri (string-append "mirror://gnu/parted/parted-"
61 "1r3qpg3bhz37mgvp9chsaa3k0csby3vayfvz8ggsqz194af5i2w5"))))
62 (build-system gnu-build-system)
65 (modify-phases %standard-phases
67 'unpack 'fix-locales-and-python
68 (lambda* (#:key inputs #:allow-other-keys)
69 (substitute* "tests/t0251-gpt-unicode.sh"
70 (("C.UTF-8") "en_US.utf8")) ;not in Glibc locales
71 (substitute* "tests/msdos-overlap"
72 (("/usr/bin/python") (which "python"))))))))
75 ("readline" ,readline)
76 ("util-linux" ,util-linux)))
78 `(("gettext" ,gettext-minimal)
81 ("python" ,python-2)))
82 (home-page "https://www.gnu.org/software/parted/")
83 (synopsis "Disk partition editor")
85 "GNU Parted is a package for creating and manipulating disk partition
86 tables. It includes a library and command-line utility.")
87 (license license:gpl3+)))
96 (uri (string-append "mirror://gnu/fdisk/gnufdisk-"
100 "04nd7civ561x2lwcmxhsqbprml3178jfc58fy1v7hzqg5k4nbhy3"))))
101 (build-system gnu-build-system)
103 `(("gettext" ,gettext-minimal)
105 ("util-linux" ,util-linux)
107 (home-page "https://www.gnu.org/software/fdisk/")
108 (synopsis "Low-level disk partitioning and formatting")
110 "GNU fdisk provides a GNU version of the common disk partitioning tool
111 fdisk. fdisk is used for the creation and manipulation of disk partition
112 tables, and it understands a variety of different formats.")
113 (license license:gpl3+)))
115 (define-public gptfdisk
122 (uri (string-append "mirror://sourceforge/gptfdisk/gptfdisk/"
123 version "/" name "-" version ".tar.gz"))
126 "1izazbyv5n2d81qdym77i8mg9m870hiydmq4d0s51npx5vp8lk46"))))
127 (build-system gnu-build-system)
129 `(("gettext" ,gettext-minimal)
132 ("util-linux" ,util-linux))) ; libuuid
134 `(#:test-target "test"
136 (modify-phases %standard-phases
137 ;; no configure script
141 (lambda* (#:key outputs #:allow-other-keys)
142 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
143 (install-file "gdisk" bin)
144 (install-file "sgdisk" bin)
145 (install-file "cgdisk" bin)
146 (install-file "fixparts" bin)))))))
147 (home-page "http://www.rodsbooks.com/gdisk/")
148 (synopsis "Low-level GPT disk partitioning and formatting")
149 (description "GPT fdisk (aka gdisk) is a text-mode partitioning tool that
150 works on Globally Unique Identifier (GUID) Partition Table (GPT) disks, rather
151 than on the more common (through 2009) Master Boot Record (MBR) partition
153 (license license:gpl2)))
155 (define-public ddrescue
162 (uri (string-append "mirror://gnu/ddrescue/ddrescue-"
166 "19qhx9ggkkjl0g3a88g501wmybkj1y4n5lm5kp0km0blh0p7p189"))))
167 (build-system gnu-build-system)
168 (home-page "https://www.gnu.org/software/ddrescue/ddrescue.html")
169 (synopsis "Data recovery utility")
170 (native-inputs `(("lzip" ,lzip)))
172 "GNU ddrescue is a fully automated data recovery tool. It copies data
173 from one file to another, working to rescue data in case of read errors. The
174 program also includes a tool for manipulating its log files, which are used
175 to recover data more efficiently by only reading the necessary blocks.")
176 (license license:gpl3+)))
178 (define-public dosfstools
185 (uri (string-append "https://github.com/" name "/" name
186 "/releases/download/v" version "/"
187 name "-" version ".tar.xz"))
190 "0wy13i3i4x2bw1hf5m4fd0myh61f9bcrs035fdlf6gyc1jksrcp6"))))
191 (build-system gnu-build-system)
193 `(#:make-flags (list (string-append "PREFIX=" %output)
196 `(("xxd" ,vim))) ; for tests
197 (home-page "https://github.com/dosfstools/dosfstools")
198 (synopsis "Utilities for making and checking MS-DOS FAT file systems")
200 "The dosfstools package includes the mkfs.fat and fsck.fat utilities,
201 which respectively make and check MS-DOS FAT file systems.")
202 (license license:gpl3+)))
204 (define dosfstools/static
206 (package (inherit dosfstools))))
208 (define-public fatfsck/static
210 (name "fatfsck-static")
211 (version (package-version dosfstools))
212 (build-system trivial-build-system)
215 `(#:modules ((guix build utils))
218 (use-modules (guix build utils))
219 (let ((src (string-append (assoc-ref %build-inputs "dosfstools")
222 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
224 (with-directory-excursion bin
225 (copy-file (string-append src "/" exe) exe)
226 (remove-store-references exe)
228 ;; Add fsck.vfat symlink to match the Linux driver name.
229 (symlink exe "fsck.vfat")
231 (inputs `(("dosfstools" ,dosfstools/static)))
232 (home-page (package-home-page dosfstools))
233 (synopsis "Statically linked fsck.fat from dosfstools")
234 (description "This package provides a statically-linked @command{fsck.fat}
235 and a @command{fsck.vfat} compatibility symlink for use in an initrd.")
236 (license (package-license dosfstools))))
238 (define-public sdparm
245 (uri (string-append "http://sg.danny.cz/sg/p/"
246 name "-" version ".tar.xz"))
249 "0jakqyjwi72zqjzss04bally0xl0lc4710mx8da08vpmir1hfphg"))))
250 (build-system gnu-build-system)
251 (home-page "http://sg.danny.cz/sg/sdparm.html")
252 (synopsis "Provide access to SCSI device parameters")
254 "Sdparm reads and modifies SCSI device parameters. These devices can be
255 SCSI disks, in which case the role of @command{sdparm} is similar to its
256 namesake: the @command{hdparm} utility originally designed for ATA disks.
257 However, @command{sdparm} can be used to access parameters on any device that
258 uses a SCSI command set. Such devices include CD/DVD drives (irrespective of
259 transport), SCSI and ATAPI tape drives, and SCSI enclosures. This utility can
260 also send commands associated with starting and stopping the media, loading
261 and unloading removable media and some other housekeeping functions.")
262 (license license:bsd-3)))
264 (define-public idle3-tools
271 (uri (string-append "mirror://sourceforge/idle3-tools/idle3-tools-"
275 "00ia7xq9yldxyl9gz0mr4xa568nav14p0fnv82f2rbbkg060cy4p"))))
276 (build-system gnu-build-system)
278 `(#:tests? #f ;no test suite
280 (modify-phases %standard-phases
282 #:make-flags (list "CC=gcc"
283 (string-append "manprefix=")
284 (string-append "DESTDIR="
285 (assoc-ref %outputs "out")))))
286 (home-page "http://idle3-tools.sourceforge.net")
287 (synopsis "Change or disable Western Digital hard drives' Idle3 timer")
289 "Idle3-tools provides a utility to get, set, or disable the Idle3 timer
290 present in many Western Digital hard drives. This timer is part of the
291 \"IntelliPark\" feature that stops the disk when not in use. Unfortunately,
292 the default timer setting is not well suited to Linux or other *nix systems,
293 and can dramatically shorten the lifespan of the drive if left unchecked.")
294 (license license:gpl3+)))
296 (define-public gparted
303 (uri (string-append "mirror://sourceforge/gparted/gparted/gparted-"
304 version "/gparted-" version ".tar.gz"))
306 (base32 "1gg7k63jd6128mmzciwqmgixqhyqnninimaqyvjbx1hv0q6gd310"))))
307 (build-system gnu-build-system)
309 `(#:tests? #f ; Tests require a network connection.
310 #:configure-flags '("--disable-scrollkeeper")))
312 `(("util-linux" ,util-linux)
318 ("gnome-doc-utils" ,gnome-doc-utils)
319 ("docbook-xml" ,docbook-xml-4.2)
321 ("python-libxml2" ,python2-libxml2)
324 `(("intltool" ,intltool)
325 ("pkg-config" ,pkg-config)))
326 (home-page "https://sourceforge.net/projects/gparted/")
327 (synopsis "Partition editor to graphically manage disk partitions")
328 (description "GParted is a GNOME partition editor for creating,
329 reorganizing, and deleting disk partitions. It uses libparted from the parted
330 project to detect and manipulate partition tables. Optional file system tools
331 permit managing file systems not included in libparted.")
332 ;; The home page says GPLv2, but the source code says GPLv2+.
333 (license license:gpl2+)))