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* ((out (assoc-ref outputs "out"))
143 (bin (string-append out "/bin"))
144 (man (string-append out "/share/man/man8")))
145 (install-file "gdisk" bin)
146 (install-file "sgdisk" bin)
147 (install-file "cgdisk" bin)
148 (install-file "fixparts" bin)
149 (install-file "cgdisk.8" man)
150 (install-file "fixparts.8" man)
151 (install-file "gdisk.8" man)
152 (install-file "sgdisk.8" man)))))))
153 (home-page "http://www.rodsbooks.com/gdisk/")
154 (synopsis "Low-level GPT disk partitioning and formatting")
155 (description "GPT fdisk (aka gdisk) is a text-mode partitioning tool that
156 works on Globally Unique Identifier (GUID) Partition Table (GPT) disks, rather
157 than on the more common (through 2009) Master Boot Record (MBR) partition
159 (license license:gpl2)))
161 (define-public ddrescue
168 (uri (string-append "mirror://gnu/ddrescue/ddrescue-"
172 "19qhx9ggkkjl0g3a88g501wmybkj1y4n5lm5kp0km0blh0p7p189"))))
173 (build-system gnu-build-system)
174 (home-page "https://www.gnu.org/software/ddrescue/ddrescue.html")
175 (synopsis "Data recovery utility")
176 (native-inputs `(("lzip" ,lzip)))
178 "GNU ddrescue is a fully automated data recovery tool. It copies data
179 from one file to another, working to rescue data in case of read errors. The
180 program also includes a tool for manipulating its log files, which are used
181 to recover data more efficiently by only reading the necessary blocks.")
182 (license license:gpl3+)))
184 (define-public dosfstools
191 (uri (string-append "https://github.com/" name "/" name
192 "/releases/download/v" version "/"
193 name "-" version ".tar.xz"))
196 "0wy13i3i4x2bw1hf5m4fd0myh61f9bcrs035fdlf6gyc1jksrcp6"))))
197 (build-system gnu-build-system)
199 `(#:make-flags (list (string-append "PREFIX=" %output)
202 `(("xxd" ,vim))) ; for tests
203 (home-page "https://github.com/dosfstools/dosfstools")
204 (synopsis "Utilities for making and checking MS-DOS FAT file systems")
206 "The dosfstools package includes the mkfs.fat and fsck.fat utilities,
207 which respectively make and check MS-DOS FAT file systems.")
208 (license license:gpl3+)))
210 (define dosfstools/static
212 (package (inherit dosfstools))))
214 (define-public fatfsck/static
216 (name "fatfsck-static")
217 (version (package-version dosfstools))
218 (build-system trivial-build-system)
221 `(#:modules ((guix build utils))
224 (use-modules (guix build utils))
225 (let ((src (string-append (assoc-ref %build-inputs "dosfstools")
228 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
230 (with-directory-excursion bin
231 (copy-file (string-append src "/" exe) exe)
232 (remove-store-references exe)
234 ;; Add fsck.vfat symlink to match the Linux driver name.
235 (symlink exe "fsck.vfat")
237 (inputs `(("dosfstools" ,dosfstools/static)))
238 (home-page (package-home-page dosfstools))
239 (synopsis "Statically linked fsck.fat from dosfstools")
240 (description "This package provides a statically-linked @command{fsck.fat}
241 and a @command{fsck.vfat} compatibility symlink for use in an initrd.")
242 (license (package-license dosfstools))))
244 (define-public sdparm
251 (uri (string-append "http://sg.danny.cz/sg/p/"
252 name "-" version ".tar.xz"))
255 "0jakqyjwi72zqjzss04bally0xl0lc4710mx8da08vpmir1hfphg"))))
256 (build-system gnu-build-system)
257 (home-page "http://sg.danny.cz/sg/sdparm.html")
258 (synopsis "Provide access to SCSI device parameters")
260 "Sdparm reads and modifies SCSI device parameters. These devices can be
261 SCSI disks, in which case the role of @command{sdparm} is similar to its
262 namesake: the @command{hdparm} utility originally designed for ATA disks.
263 However, @command{sdparm} can be used to access parameters on any device that
264 uses a SCSI command set. Such devices include CD/DVD drives (irrespective of
265 transport), SCSI and ATAPI tape drives, and SCSI enclosures. This utility can
266 also send commands associated with starting and stopping the media, loading
267 and unloading removable media and some other housekeeping functions.")
268 (license license:bsd-3)))
270 (define-public idle3-tools
277 (uri (string-append "mirror://sourceforge/idle3-tools/idle3-tools-"
281 "00ia7xq9yldxyl9gz0mr4xa568nav14p0fnv82f2rbbkg060cy4p"))))
282 (build-system gnu-build-system)
284 `(#:tests? #f ;no test suite
286 (modify-phases %standard-phases
288 #:make-flags (list "CC=gcc"
289 (string-append "manprefix=")
290 (string-append "DESTDIR="
291 (assoc-ref %outputs "out")))))
292 (home-page "http://idle3-tools.sourceforge.net")
293 (synopsis "Change or disable Western Digital hard drives' Idle3 timer")
295 "Idle3-tools provides a utility to get, set, or disable the Idle3 timer
296 present in many Western Digital hard drives. This timer is part of the
297 \"IntelliPark\" feature that stops the disk when not in use. Unfortunately,
298 the default timer setting is not well suited to Linux or other *nix systems,
299 and can dramatically shorten the lifespan of the drive if left unchecked.")
300 (license license:gpl3+)))
302 (define-public gparted
309 (uri (string-append "mirror://sourceforge/gparted/gparted/gparted-"
310 version "/gparted-" version ".tar.gz"))
312 (base32 "0cyk8lpimm6wani8khw0szwqkgw5wpq2mfnfxkbgfm2774a1z2bn"))))
313 (build-system gnu-build-system)
315 `(#:tests? #f ; Tests require a network connection.
316 #:configure-flags '("--disable-scrollkeeper")))
318 `(("util-linux" ,util-linux)
324 ("gnome-doc-utils" ,gnome-doc-utils)
325 ("docbook-xml" ,docbook-xml-4.2)
327 ("python-libxml2" ,python2-libxml2)
330 `(("intltool" ,intltool)
331 ("pkg-config" ,pkg-config)))
332 (home-page "https://sourceforge.net/projects/gparted/")
333 (synopsis "Partition editor to graphically manage disk partitions")
334 (description "GParted is a GNOME partition editor for creating,
335 reorganizing, and deleting disk partitions. It uses libparted from the parted
336 project to detect and manipulate partition tables. Optional file system tools
337 permit managing file systems not included in libparted.")
338 ;; The home page says GPLv2, but the source code says GPLv2+.
339 (license license:gpl2+)))