doc: "filesystem" -> "file system"
[jackhill/guix/guix.git] / gnu / packages / linux.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
400ed6ac 2;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
35dfcdd7 3;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
233e7676 4;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
beed3af5 5;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
31aa4379 6;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
e1e27737 7;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
ebf89f13 8;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
1348185a 9;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
e05647ad 10;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
b53e44fb 11;;; Copyright © 2016 Alex Kost <alezost@gmail.com>
96e9f097 12;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org>
dc9bdb1e 13;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
d17ae8c0 14;;; Copyright © 2016 Nicolas Goaziou <mail@nicolasgoaziou.fr>
81b98756 15;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
9b0942c1 16;;; Copyright © 2016 David Craven <david@craven.ch>
594d740d 17;;; Copyright © 2016 John Darrington <jmd@gnu.org>
fd76c904 18;;;
233e7676 19;;; This file is part of GNU Guix.
fd76c904 20;;;
233e7676 21;;; GNU Guix is free software; you can redistribute it and/or modify it
fd76c904
LC
22;;; under the terms of the GNU General Public License as published by
23;;; the Free Software Foundation; either version 3 of the License, or (at
24;;; your option) any later version.
25;;;
233e7676 26;;; GNU Guix is distributed in the hope that it will be useful, but
fd76c904
LC
27;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29;;; GNU General Public License for more details.
30;;;
31;;; You should have received a copy of the GNU General Public License
233e7676 32;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
fd76c904 33
1ffa7090 34(define-module (gnu packages linux)
59a43334 35 #:use-module (gnu packages)
75750abb
DC
36 #:use-module (gnu packages admin)
37 #:use-module (gnu packages algebra)
38 #:use-module (gnu packages attr)
39 #:use-module (gnu packages autotools)
40 #:use-module (gnu packages base)
41 #:use-module (gnu packages bison)
42 #:use-module (gnu packages calendar)
43 #:use-module (gnu packages check)
e385e957 44 #:use-module (gnu packages crypto)
f61e0e79 45 #:use-module (gnu packages compression)
75750abb
DC
46 #:use-module (gnu packages databases)
47 #:use-module (gnu packages docbook)
48 #:use-module (gnu packages documentation)
49 #:use-module (gnu packages elf)
1ffa7090 50 #:use-module (gnu packages flex)
75750abb
DC
51 #:use-module (gnu packages freedesktop)
52 #:use-module (gnu packages gcc)
53 #:use-module (gnu packages gettext)
54 #:use-module (gnu packages glib)
e385e957 55 #:use-module (gnu packages gnuzilla)
d7d42d6b 56 #:use-module (gnu packages gperf)
75750abb 57 #:use-module (gnu packages gtk)
1ffa7090 58 #:use-module (gnu packages libusb)
75750abb 59 #:use-module (gnu packages maths)
1ffa7090
LC
60 #:use-module (gnu packages ncurses)
61 #:use-module (gnu packages perl)
75750abb 62 #:use-module (gnu packages pciutils)
1ffa7090 63 #:use-module (gnu packages pkg-config)
75750abb 64 #:use-module (gnu packages pulseaudio)
7c0dbe78 65 #:use-module (gnu packages python)
75750abb
DC
66 #:use-module (gnu packages readline)
67 #:use-module (gnu packages rrdtool)
b1fb4b23 68 #:use-module (gnu packages slang)
f57d2639 69 #:use-module (gnu packages texinfo)
75343704 70 #:use-module (gnu packages tls)
75750abb 71 #:use-module (gnu packages xml)
220193ad 72 #:use-module (guix build-system cmake)
75750abb 73 #:use-module (guix build-system gnu)
e102f940 74 #:use-module (guix build-system python)
a94546ec 75 #:use-module (guix build-system trivial)
75750abb
DC
76 #:use-module (guix download)
77 #:use-module ((guix licenses) #:prefix license:)
78 #:use-module (guix packages)
79 #:use-module (guix utils)
adddd5ba 80 #:use-module (srfi srfi-1)
17db0706 81 #:use-module (srfi srfi-2)
a94546ec
LC
82 #:use-module (srfi srfi-26)
83 #:use-module (ice-9 match))
fd76c904 84
aaf4cb20
LC
85(define-public (system->linux-architecture arch)
86 "Return the Linux architecture name for ARCH, a Guix system name such as
6d7ef2aa 87\"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
618cea69
NK
88 (let ((arch (car (string-split arch #\-))))
89 (cond ((string=? arch "i686") "i386")
90 ((string-prefix? "mips" arch) "mips")
aaf4cb20 91 ((string-prefix? "arm" arch) "arm")
503275e9 92 ((string-prefix? "aarch64" arch) "arm64")
618cea69
NK
93 (else arch))))
94
6023cc74
LC
95(define (linux-libre-urls version)
96 "Return a list of URLs for Linux-Libre VERSION."
97 (list (string-append
98 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
99 version "-gnu/linux-libre-" version "-gnu.tar.xz")
100
101 ;; XXX: Work around <http://bugs.gnu.org/14851>.
102 (string-append
103 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
104 version "-gnu.tar.xz")
105
106 ;; Maybe this URL will become valid eventually.
107 (string-append
108 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
109 version "-gnu.tar.xz")))
110
80fe5c60 111(define-public linux-libre-headers
419016da 112 (let* ((version "4.1.18")
80fe5c60 113 (build-phase
618cea69
NK
114 (lambda (arch)
115 `(lambda _
116 (setenv "ARCH" ,(system->linux-architecture arch))
117 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
45298f8f 118
618cea69
NK
119 (and (zero? (system* "make" "defconfig"))
120 (zero? (system* "make" "mrproper" "headers_check"))))))
80fe5c60
LC
121 (install-phase
122 `(lambda* (#:key outputs #:allow-other-keys)
123 (let ((out (assoc-ref outputs "out")))
124 (and (zero? (system* "make"
125 (string-append "INSTALL_HDR_PATH=" out)
126 "headers_install"))
b15389e1
LC
127 (begin
128 (mkdir (string-append out "/include/config"))
129 (call-with-output-file
130 (string-append out
131 "/include/config/kernel.release")
132 (lambda (p)
133 (format p "~a-default~%" ,version)))
134
135 ;; Remove the '.install' and '..install.cmd' files; the
136 ;; latter contains store paths, which pulls in bootstrap
137 ;; binaries in the build environment, and prevents bit
138 ;; reproducibility for the bootstrap binaries.
139 (for-each delete-file (find-files out "\\.install"))
140
141 #t))))))
80fe5c60
LC
142 (package
143 (name "linux-libre-headers")
dfb52abb 144 (version version)
80fe5c60
LC
145 (source (origin
146 (method url-fetch)
6023cc74 147 (uri (linux-libre-urls version))
80fe5c60
LC
148 (sha256
149 (base32
419016da 150 "1bddh2rg645lavhjkk9z75vflba5y0g73z2fjwgbfrj5jb44x9i7"))))
80fe5c60
LC
151 (build-system gnu-build-system)
152 (native-inputs `(("perl" ,perl)))
153 (arguments
154 `(#:modules ((guix build gnu-build-system)
155 (guix build utils)
56c092ce 156 (srfi srfi-1))
80fe5c60 157 #:phases (alist-replace
fb6c2fa8
LC
158 'build ,(build-phase (or (%current-target-system)
159 (%current-system)))
80fe5c60
LC
160 (alist-replace
161 'install ,install-phase
56c092ce 162 (alist-delete 'configure %standard-phases)))
b15389e1 163 #:allowed-references ()
80fe5c60
LC
164 #:tests? #f))
165 (synopsis "GNU Linux-Libre kernel headers")
166 (description "Headers of the Linux-Libre kernel.")
3ac73271 167 (license license:gpl2)
80fe5c60
LC
168 (home-page "http://www.gnu.org/software/linux-libre/"))))
169
ac47a7c2
LC
170(define %boot-logo-patch
171 ;; Linux-Libre boot logo featuring Freedo and a gnu.
172 (origin
173 (method url-fetch)
174 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
74dde9e9 175 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
ac47a7c2
LC
176 (sha256
177 (base32
178 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
179
c258807a 180(define* (kernel-config arch #:key variant)
a94546ec 181 "Return the absolute file name of the Linux-Libre build configuration file
c258807a
DC
182for ARCH and optionally VARIANT, or #f if there is no such configuration."
183 (let* ((name (string-append "linux-libre-"
184 (if variant (string-append variant "-") "")
25847b32 185 (if (string=? "i386" arch) "i686" arch) ".conf"))
c258807a 186 (file (string-append "gnu/packages/" name)))
d6feaf6e 187 (search-path %load-path file)))
a94546ec 188
90c18c32
DC
189(define %default-extra-linux-options
190 `(("CONFIG_NET_9P" . m)
191 ("CONFIG_NET_9P_VIRTIO" . m)
192 ("CONFIG_VIRTIO_BLK" . m)
193 ("CONFIG_VIRTIO_NET" . m)
194 ;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
195 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t)
196 ("CONFIG_VIRTIO_PCI" . m)
197 ("CONFIG_VIRTIO_BALLOON" . m)
198 ("CONFIG_VIRTIO_MMIO" . m)
199 ("CONFIG_FUSE_FS" . m)
200 ("CONFIG_CIFS" . m)
201 ("CONFIG_9P_FS" . m)))
202
203(define (config->string options)
204 (string-join (map (match-lambda
205 ((option . 'm)
206 (string-append option "=m"))
207 ((option . #t)
208 (string-append option "=y"))
209 ((option . #f)
210 (string-append option "=n")))
211 options)
212 "\n"))
213
3129b9c2 214(define* (make-linux-libre version hash supported-systems
c258807a
DC
215 #:key
216 ;; A function that takes an arch and a variant.
217 ;; See kernel-config for an example.
a6d01325 218 (extra-version #f)
c258807a 219 (configuration-file #f)
90c18c32
DC
220 (defconfig "defconfig")
221 (extra-options %default-extra-linux-options))
614d1738 222 (package
a6d01325
DC
223 (name (if extra-version
224 (string-append "linux-libre-" extra-version)
225 "linux-libre"))
c258807a 226 (version version)
614d1738
DC
227 (source (origin
228 (method url-fetch)
229 (uri (linux-libre-urls version))
c258807a 230 (sha256 (base32 hash))
25847b32 231 (patches (list %boot-logo-patch))))
3129b9c2 232 (supported-systems supported-systems)
614d1738 233 (build-system gnu-build-system)
614d1738
DC
234 (native-inputs
235 `(("perl" ,perl)
236 ("bc" ,bc)
237 ("openssl" ,openssl)
78edcccc 238 ("kmod" ,kmod)
0b759869
DC
239 ,@(if configuration-file
240 `(("kconfig" ,(configuration-file
241 (system->linux-architecture
242 (or (%current-target-system)
243 (%current-system)))
244 #:variant (version-major+minor version))))
245 '())))
614d1738
DC
246 (arguments
247 `(#:modules ((guix build gnu-build-system)
248 (guix build utils)
249 (srfi srfi-1)
250 (ice-9 match))
251 #:phases
252 (modify-phases %standard-phases
9416459b 253 (replace 'configure
4b42703e 254 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
96e9f097
RN
255 ;; Avoid introducing timestamps
256 (setenv "KCONFIG_NOTIMESTAMP" "1")
257 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
258
4b42703e 259 ;; Set ARCH and CROSS_COMPILE
6d7ef2aa
DC
260 (let ((arch ,(system->linux-architecture
261 (or (%current-target-system)
262 (%current-system)))))
4b42703e
DC
263 (setenv "ARCH" arch)
264 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
6d7ef2aa 265
4b42703e
DC
266 (when target
267 (setenv "CROSS_COMPILE" (string-append target "-"))
268 (format #t "`CROSS_COMPILE' set to `~a'~%"
269 (getenv "CROSS_COMPILE"))))
beacfcab 270
a6d01325
DC
271 (setenv "EXTRA_VERSION" ,extra-version)
272
a94546ec
LC
273 (let ((build (assoc-ref %standard-phases 'build))
274 (config (assoc-ref inputs "kconfig")))
1650dd8a
LC
275
276 ;; Use the architecture-specific config if available, and
277 ;; 'defconfig' otherwise.
278 (if config
279 (begin
280 (copy-file config ".config")
281 (chmod ".config" #o666))
c258807a 282 (system* "make" ,defconfig))
a94546ec
LC
283
284 ;; Appending works even when the option wasn't in the
285 ;; file. The last one prevails if duplicated.
90c18c32
DC
286 (let ((port (open-file ".config" "a"))
287 (extra-configuration ,(config->string extra-options)))
288 (display extra-configuration port)
a94546ec
LC
289 (close-port port))
290
9416459b 291 (zero? (system* "make" "oldconfig")))))
614d1738 292 (replace 'install
4b42703e 293 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
beacfcab
LC
294 (let* ((out (assoc-ref outputs "out"))
295 (moddir (string-append out "/lib/modules"))
78edcccc 296 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
beacfcab
LC
297 (mkdir-p moddir)
298 (for-each (lambda (file)
299 (copy-file file
300 (string-append out "/" (basename file))))
fd6e0de3 301 (find-files "." "^(bzImage|zImage|vmlinuz|System\\.map)$"))
beacfcab
LC
302 (copy-file ".config" (string-append out "/config"))
303 (zero? (system* "make"
78edcccc 304 (string-append "DEPMOD=" kmod "/bin/depmod")
beacfcab
LC
305 (string-append "MODULE_DIR=" moddir)
306 (string-append "INSTALL_PATH=" out)
307 (string-append "INSTALL_MOD_PATH=" out)
cda3d81e 308 "INSTALL_MOD_STRIP=1"
beacfcab 309 "modules_install"))))))
beacfcab 310 #:tests? #f))
614d1738 311 (home-page "http://www.gnu.org/software/linux-libre/")
f50d2669 312 (synopsis "100% free redistribution of a cleaned Linux kernel")
a22dc0c4 313 (description
79c311b8
LC
314 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
315It has been modified to remove all non-free binary blobs.")
614d1738 316 (license license:gpl2)))
beacfcab 317
3129b9c2
DC
318(define %intel-compatible-systems '("x86_64-linux" "i686-linux"))
319
c258807a
DC
320(define-public linux-libre
321 (make-linux-libre "4.7.3"
322 "18sy1vh4x66hsk0qbq8g5299my082d530zm8c7xnbakq7350igi6"
3129b9c2 323 %intel-compatible-systems
c258807a
DC
324 #:configuration-file kernel-config))
325
75b314a6 326(define-public linux-libre-4.4
c258807a
DC
327 (make-linux-libre "4.4.20"
328 "1fi0pyyzcf643vdsss0d9ld6jqyxw0k76r0a5vpd4mv3dcl37yyq"
3129b9c2 329 %intel-compatible-systems
c258807a 330 #:configuration-file kernel-config))
75b314a6 331
adddd5ba 332(define-public linux-libre-4.1
c258807a
DC
333 (make-linux-libre "4.1.31"
334 "0grffah921k136w1qwcswxv6m810s8q54nr2rk7kyqka3a1b81yw"
3129b9c2 335 %intel-compatible-systems
c258807a 336 #:configuration-file kernel-config))
adddd5ba 337
cde7c23f
DC
338;; Avoid rebuilding kernel variants when there is a minor version bump.
339(define %linux-libre-version "4.7.3")
340(define %linux-libre-hash "18sy1vh4x66hsk0qbq8g5299my082d530zm8c7xnbakq7350igi6")
341
342(define-public linux-libre-arm-generic
343 (make-linux-libre %linux-libre-version
344 %linux-libre-hash
345 '("armhf-linux")
346 #:defconfig "multi_v7_defconfig"
347 #:extra-version "arm-generic"))
348
de459dc0
DC
349(define-public linux-libre-beagle-bone-black
350 (make-linux-libre %linux-libre-version
351 %linux-libre-hash
352 '("armhf-linux")
353 #:defconfig "omap2plus_defconfig"
354 #:extra-version "beagle-bone-black"))
355
97121c2a 356\f
c84d0eca
LC
357;;;
358;;; Pluggable authentication modules (PAM).
359;;;
360
fd76c904
LC
361(define-public linux-pam
362 (package
363 (name "linux-pam")
e3780200 364 (version "1.2.1")
fd76c904
LC
365 (source
366 (origin
367 (method url-fetch)
368 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
369 version ".tar.bz2")
370 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
371 version ".tar.bz2")))
372 (sha256
373 (base32
e3780200 374 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))))
fd76c904 375 (build-system gnu-build-system)
c4c4cc05 376 (native-inputs
fd76c904
LC
377 `(("flex" ,flex)
378
379 ;; TODO: optional dependencies
380 ;; ("libxcrypt" ,libxcrypt)
381 ;; ("cracklib" ,cracklib)
382 ))
383 (arguments
c134056a
LC
384 '(;; Most users, such as `shadow', expect the headers to be under
385 ;; `security'.
386 #:configure-flags (list (string-append "--includedir="
387 (assoc-ref %outputs "out")
388 "/include/security"))
389
390 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
391 ;; isn't available.
392 #:tests? #f))
fd76c904
LC
393 (home-page "http://www.linux-pam.org/")
394 (synopsis "Pluggable authentication modules for Linux")
395 (description
396 "A *Free* project to implement OSF's RFC 86.0.
397Pluggable authentication modules are small shared object files that can
398be used through the PAM API to perform tasks, like authenticating a user
e881752c 399at login. Local and dynamic reconfiguration are its key features.")
3ac73271 400 (license license:bsd-3)))
686f14e8 401
53142109 402
c84d0eca
LC
403;;;
404;;; Miscellaneous.
405;;;
406
686f14e8
LC
407(define-public psmisc
408 (package
409 (name "psmisc")
410 (version "22.20")
411 (source
412 (origin
413 (method url-fetch)
414 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
415 version ".tar.gz"))
416 (sha256
417 (base32
418 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
419 (build-system gnu-build-system)
420 (inputs `(("ncurses" ,ncurses)))
421 (home-page "http://psmisc.sourceforge.net/")
422 (synopsis
8f65585b 423 "Small utilities that use the proc file system")
686f14e8
LC
424 (description
425 "This PSmisc package is a set of some small useful utilities that
8f65585b 426use the proc file system. We're not about changing the world, but
686f14e8 427providing the system administrator with some help in common tasks.")
3ac73271 428 (license license:gpl2+)))
02b80c3f
NK
429
430(define-public util-linux
431 (package
432 (name "util-linux")
57a66c27 433 (version "2.27")
5a6a3ba4
LC
434 (source (origin
435 (method url-fetch)
436 (uri (string-append "mirror://kernel.org/linux/utils/"
9f533d60
LC
437 name "/v" (version-major+minor version) "/"
438 name "-" version ".tar.xz"))
5a6a3ba4
LC
439 (sha256
440 (base32
57a66c27 441 "1ivdx1bhjbakf77agm9dn3wyxia1wgz9lzxgd61zqxw3xzih9gzw"))
fc1adab1 442 (patches (search-patches "util-linux-tests.patch"))
9d77da2a
LC
443 (modules '((guix build utils)))
444 (snippet
ec2da92c
LC
445 ;; We take the 'logger' program from GNU Inetutils and 'kill'
446 ;; from GNU Coreutils.
8338c241
MW
447 '(begin
448 (substitute* "configure"
449 (("build_logger=yes") "build_logger=no")
450 (("build_kill=yes") "build_kill=no"))
451 #t))))
02b80c3f 452 (build-system gnu-build-system)
dd581e9a
TGR
453 (outputs '("out"
454 "static")) ; >2 MiB of static .a libraries
02b80c3f 455 (arguments
29ec55ee 456 `(#:configure-flags (list "--disable-use-tty-group"
29ec55ee
LC
457
458 ;; Install completions where our
459 ;; bash-completion package expects them.
460 (string-append "--with-bashcompletiondir="
461 (assoc-ref %outputs "out")
462 "/etc/bash_completion.d"))
1b9cf4ad 463 #:phases (modify-phases %standard-phases
7e512497
LC
464 (add-before
465 'build 'set-umount-file-name
466 (lambda* (#:key outputs #:allow-other-keys)
467 ;; Tell 'eject' the right file name of 'umount'.
468 (let ((out (assoc-ref outputs "out")))
469 (substitute* "sys-utils/eject.c"
470 (("\"/bin/umount\"")
471 (string-append "\"" out "/bin/umount\"")))
472 #t)))
1b9cf4ad
LC
473 (add-before
474 'check 'pre-check
475 (lambda* (#:key inputs outputs #:allow-other-keys)
476 (let ((out (assoc-ref outputs "out"))
477 (net (assoc-ref inputs "net-base")))
478 ;; Change the test to refer to the right file.
479 (substitute* "tests/ts/misc/mcookie"
480 (("/etc/services")
481 (string-append net "/etc/services")))
dd581e9a
TGR
482 #t)))
483 (add-after
484 'install 'move-static-libraries
485 (lambda* (#:key outputs #:allow-other-keys)
486 (let ((out (assoc-ref outputs "out"))
487 (static (assoc-ref outputs "static")))
488 (mkdir-p (string-append static "/lib"))
489 (with-directory-excursion out
490 (for-each (lambda (file)
491 (rename-file file
492 (string-append static "/"
493 file)))
494 (find-files "lib" "\\.a$")))
1b9cf4ad 495 #t))))))
f61e0e79 496 (inputs `(("zlib" ,zlib)
c4c4cc05
JD
497 ("ncurses" ,ncurses)))
498 (native-inputs
9f533d60
LC
499 `(("perl" ,perl)
500 ("net-base" ,net-base))) ;for tests
02b80c3f 501 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
35ec07c7 502 (synopsis "Collection of utilities for the Linux kernel")
437d7286 503 (description "Util-linux is a diverse collection of Linux kernel
8f65585b 504utilities. It provides dmesg and includes tools for working with file systems,
437d7286 505block devices, UUIDs, TTYs, and many other tools.")
fe8ccfcc 506
02b80c3f 507 ;; Note that util-linux doesn't use the same license for all the
fe8ccfcc 508 ;; code. GPLv2+ is the default license for a code without an
02b80c3f 509 ;; explicitly defined license.
3ac73271
LC
510 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
511 license:bsd-4 license:public-domain))))
5d5c4278 512
e47e3eff
LC
513(define-public procps
514 (package
515 (name "procps")
0cc22848 516 (version "3.3.11")
e47e3eff 517 (source (origin
0cc22848
SB
518 (method url-fetch)
519 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
520 "procps-ng-" version ".tar.xz"))
521 (sha256
522 (base32
d46123aa
MR
523 "1va4n0mpsq327ca9dqp4hnrpgs6821rp0f2m0jyc1bfjl9lk2jg9"))
524 (patches
525 (list (search-patch "procps-non-linux.patch")))))
e47e3eff 526 (build-system gnu-build-system)
e47e3eff 527 (arguments
80393eed
LC
528 '(#:modules ((guix build utils)
529 (guix build gnu-build-system)
530 (srfi srfi-1)
531 (srfi srfi-26))
0cc22848
SB
532 #:phases
533 (modify-phases %standard-phases
534 (add-after
535 'install 'post-install
536 ;; Remove commands and man pages redudant with
537 ;; Coreutils.
538 (lambda* (#:key outputs #:allow-other-keys)
539 (let* ((out (assoc-ref outputs "out"))
540 (dup (append-map (cut find-files out <>)
541 '("^kill" "^uptime"))))
542 (for-each delete-file dup)
543 #t))))))
544 (inputs `(("ncurses" ,ncurses)))
545 (home-page "https://gitlab.com/procps-ng/procps/")
35ec07c7 546 (synopsis "Utilities that give information about processes")
e47e3eff 547 (description
35b9e423 548 "Procps is the package that has a bunch of small useful utilities
e47e3eff
LC
549that give information about processes using the Linux /proc file system.
550The package includes the programs ps, top, vmstat, w, kill, free,
551slabtop, and skill.")
3ac73271 552 (license license:gpl2)))
e47e3eff 553
5d5c4278
NK
554(define-public usbutils
555 (package
556 (name "usbutils")
557 (version "006")
558 (source
559 (origin
560 (method url-fetch)
561 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
562 "usbutils-" version ".tar.xz"))
563 (sha256
564 (base32
565 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
566 (build-system gnu-build-system)
567 (inputs
c4c4cc05
JD
568 `(("libusb" ,libusb)))
569 (native-inputs
570 `(("pkg-config" ,pkg-config)))
5d5c4278
NK
571 (home-page "http://www.linux-usb.org/")
572 (synopsis
573 "Tools for working with USB devices, such as lsusb")
574 (description
575 "Tools for working with USB devices, such as lsusb.")
3ac73271 576 (license license:gpl2+)))
0750452a
LC
577
578(define-public e2fsprogs
579 (package
580 (name "e2fsprogs")
7409c8d4 581 (version "1.42.13")
0750452a
LC
582 (source (origin
583 (method url-fetch)
7409c8d4
MW
584 (uri (string-append
585 "mirror://kernel.org/linux/kernel/people/tytso/"
586 name "/v" version "/"
587 name "-" version ".tar.xz"))
0750452a
LC
588 (sha256
589 (base32
7409c8d4 590 "1ix0b83zgw5n0p2grh2961c6796m92yr2jqc2sbr23x3lfsp8r71"))
7c594a2c
LC
591 (modules '((guix build utils)))
592 (snippet
593 '(substitute* "MCONFIG.in"
594 (("INSTALL_SYMLINK = /bin/sh")
595 "INSTALL_SYMLINK = sh")))))
0750452a 596 (build-system gnu-build-system)
c4c4cc05 597 (inputs `(("util-linux" ,util-linux)))
f57d2639 598 (native-inputs `(("pkg-config" ,pkg-config)
7c594a2c 599 ("texinfo" ,texinfo))) ;for the libext2fs Info manual
0750452a 600 (arguments
097e012b 601 '(;; util-linux is the preferred source for some of the libraries and
c44ed26c 602 ;; commands, so disable them (see, e.g.,
a124bbd2 603 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
c44ed26c
LC
604 #:configure-flags '("--disable-libblkid"
605 "--disable-libuuid" "--disable-uuidd"
606 "--disable-fsck"
7c594a2c
LC
607
608 ;; Install libext2fs et al.
609 "--enable-elf-shlibs")
610
611 #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
612 (assoc-ref %outputs "out")
613 "/lib"))
ddfc2fd8
LC
614
615 #:phases (alist-cons-before
0750452a
LC
616 'configure 'patch-shells
617 (lambda _
618 (substitute* "configure"
619 (("/bin/sh (.*)parse-types.sh" _ dir)
620 (string-append (which "sh") " " dir
621 "parse-types.sh")))
622 (substitute* (find-files "." "^Makefile.in$")
623 (("#!/bin/sh")
624 (string-append "#!" (which "sh")))))
1c975f60
LC
625 (alist-cons-after
626 'install 'install-libs
853c2f18
LC
627 (lambda* (#:key outputs #:allow-other-keys)
628 (let* ((out (assoc-ref outputs "out"))
629 (lib (string-append out "/lib")))
630 (and (zero? (system* "make" "install-libs"))
631
632 ;; Make the .a writable so that 'strip' works.
633 ;; Failing to do that, due to debug symbols, we
634 ;; retain a reference to the final
635 ;; linux-libre-headers, which refer to the
636 ;; bootstrap binaries.
637 (let ((archives (find-files lib "\\.a$")))
638 (for-each (lambda (file)
639 (chmod file #o666))
640 archives)
641 #t))))
1c975f60 642 %standard-phases))
0750452a
LC
643
644 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
645 ;; they fail because we get an extra line that says "Can't check if
8f65585b 646 ;; file system is mounted due to missing mtab file".
0750452a
LC
647 #:tests? #f))
648 (home-page "http://e2fsprogs.sourceforge.net/")
35ec07c7 649 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
0750452a
LC
650 (description
651 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
3ac73271
LC
652 (license (list license:gpl2 ;programs
653 license:lgpl2.0 ;libext2fs
654 license:x11)))) ;libuuid
d8482ad0 655
e48977e7
LC
656(define e2fsprogs/static
657 (static-package
658 (package (inherit e2fsprogs)
659 (arguments
660 ;; Do not build shared libraries.
661 (substitute-keyword-arguments (package-arguments e2fsprogs)
662 ((#:configure-flags _)
663 '(list "--disable-blkid"))
664 ((#:make-flags _)
665 '(list)))))))
666
e102f940
LC
667(define-public e2fsck/static
668 (package
669 (name "e2fsck-static")
0997771a 670 (version (package-version e2fsprogs))
e102f940
LC
671 (build-system trivial-build-system)
672 (source #f)
673 (arguments
674 `(#:modules ((guix build utils))
675 #:builder
676 (begin
677 (use-modules (guix build utils)
678 (ice-9 ftw)
679 (srfi srfi-26))
680
681 (let ((source (string-append (assoc-ref %build-inputs "e2fsprogs")
682 "/sbin"))
683 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
684 (mkdir-p bin)
685 (with-directory-excursion bin
686 (for-each (lambda (file)
687 (copy-file (string-append source "/" file)
688 file)
689 (remove-store-references file)
690 (chmod file #o555))
691 (scandir source (cut string-prefix? "fsck." <>))))))))
e48977e7 692 (inputs `(("e2fsprogs" ,e2fsprogs/static)))
e102f940
LC
693 (synopsis "Statically-linked fsck.* commands from e2fsprogs")
694 (description
695 "This package provides statically-linked command of fsck.ext[234] taken
696from the e2fsprogs package. It is meant to be used in initrds.")
0997771a
LC
697 (home-page (package-home-page e2fsprogs))
698 (license (package-license e2fsprogs))))
e102f940 699
7c0a9104
LC
700(define-public extundelete
701 (package
702 (name "extundelete")
703 (version "0.2.4")
704 (source (origin
705 (method url-fetch)
706 (uri (string-append "mirror://sourceforge/extundelete/"
de67e922
LF
707 "extundelete/" version "/extundelete-"
708 version ".tar.bz2"))
7c0a9104
LC
709 (sha256
710 (base32
711 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
712 (build-system gnu-build-system)
713 (inputs `(("e2fsprogs" ,e2fsprogs)))
714 (home-page "http://extundelete.sourceforge.net/")
715 (synopsis "Recover deleted files from ext2/3/4 partitions")
716 (description
717 "Extundelete is a set of tools that can recover deleted files from an
718ext3 or ext4 partition.")
3ac73271 719 (license license:gpl2)))
7c0a9104 720
1c975f60
LC
721(define-public zerofree
722 (package
723 (name "zerofree")
724 (version "1.0.3")
725 (home-page "http://intgat.tigress.co.uk/rmy/uml/")
726 (source (origin
727 (method url-fetch)
728 (uri (string-append home-page name "-" version
729 ".tgz"))
730 (sha256
731 (base32
732 "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs"))))
733 (build-system gnu-build-system)
734 (arguments
735 '(#:phases (alist-replace
736 'install
737 (lambda* (#:key outputs #:allow-other-keys)
738 (let* ((out (assoc-ref outputs "out"))
739 (bin (string-append out "/bin")))
740 (mkdir-p bin)
741 (copy-file "zerofree"
742 (string-append bin "/zerofree"))
743 (chmod (string-append bin "/zerofree")
744 #o555)
745 #t))
746 (alist-delete 'configure %standard-phases))
747 #:tests? #f)) ;no tests
748 (inputs `(("libext2fs" ,e2fsprogs)))
749 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
750 (description
751 "The zerofree command scans the free blocks in an ext2 file system and
752fills any non-zero blocks with zeroes. This is a useful way to make disk
753images more compressible.")
3ac73271 754 (license license:gpl2)))
1c975f60 755
d8482ad0
LC
756(define-public strace
757 (package
758 (name "strace")
759 (version "4.7")
760 (source (origin
761 (method url-fetch)
de67e922
LF
762 (uri (string-append "mirror://sourceforge/strace/strace/" version
763 "/strace-" version ".tar.xz"))
d8482ad0
LC
764 (sha256
765 (base32
766 "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764"))))
767 (build-system gnu-build-system)
c4c4cc05 768 (native-inputs `(("perl" ,perl)))
d8482ad0
LC
769 (home-page "http://strace.sourceforge.net/")
770 (synopsis "System call tracer for Linux")
771 (description
772 "strace is a system call tracer, i.e. a debugging tool which prints out a
773trace of all the system calls made by a another process/program.")
3ac73271 774 (license license:bsd-3)))
ba04571a 775
e1e27737
TUBK
776(define-public ltrace
777 (package
778 (name "ltrace")
779 (version "0.7.3")
780 (source (origin
781 (method url-fetch)
782 (uri (string-append "http://www.ltrace.org/ltrace_" version
783 ".orig.tar.bz2"))
784 (sha256
785 (base32
786 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
787 (build-system gnu-build-system)
788 (inputs `(("libelf" ,libelf)))
789 (arguments
790 ;; Compilation uses -Werror by default, but it fails.
791 '(#:configure-flags '("--disable-werror")))
792 (home-page "http://www.ltrace.org/")
793 (synopsis "Library call tracer for Linux")
794 (description
795 "ltrace intercepts and records dynamic library calls which are called by
796an executed process and the signals received by that process. It can also
797intercept and print the system calls executed by the program.")
3ac73271 798 (license license:gpl2+)))
e1e27737 799
ba04571a
LC
800(define-public alsa-lib
801 (package
802 (name "alsa-lib")
803 (version "1.0.27.1")
804 (source (origin
805 (method url-fetch)
806 (uri (string-append
807 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
808 version ".tar.bz2"))
809 (sha256
810 (base32
bcd94e19 811 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
fc1adab1 812 (patches (search-patches "alsa-lib-mips-atomic-fix.patch"))))
ba04571a
LC
813 (build-system gnu-build-system)
814 (home-page "http://www.alsa-project.org/")
815 (synopsis "The Advanced Linux Sound Architecture libraries")
816 (description
817 "The Advanced Linux Sound Architecture (ALSA) provides audio and
818MIDI functionality to the Linux-based operating system.")
3ac73271 819 (license license:lgpl2.1+)))
10afdf50 820
17b293a0
LC
821(define-public alsa-utils
822 (package
823 (name "alsa-utils")
43043f23 824 (version "1.1.2")
17b293a0
LC
825 (source (origin
826 (method url-fetch)
992b527d
EF
827 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
828 name "-" version ".tar.bz2"))
17b293a0
LC
829 (sha256
830 (base32
43043f23 831 "0wcha78c2sm8qqk5r3w83cvm8fp6fb1zpd35kmcm24kxhz007xks"))))
17b293a0
LC
832 (build-system gnu-build-system)
833 (arguments
834 ;; XXX: Disable man page creation until we have DocBook.
835 '(#:configure-flags (list "--disable-xmlto"
f2817d43
LC
836
837 ;; The udev rule is responsible for restoring
838 ;; the volume.
17b293a0
LC
839 (string-append "--with-udev-rules-dir="
840 (assoc-ref %outputs "out")
841 "/lib/udev/rules.d"))
49165145
EF
842 #:phases
843 (modify-phases %standard-phases
844 (add-before
845 'install 'pre-install
846 (lambda _
847 ;; Don't try to mkdir /var/lib/alsa.
848 (substitute* "Makefile"
849 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
850 "true\n")))))))
17b293a0
LC
851 (inputs
852 `(("libsamplerate" ,libsamplerate)
853 ("ncurses" ,ncurses)
854 ("alsa-lib" ,alsa-lib)
855 ("xmlto" ,xmlto)
1dba6407 856 ("gettext" ,gnu-gettext)))
17b293a0
LC
857 (home-page "http://www.alsa-project.org/")
858 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
859 (description
860 "The Advanced Linux Sound Architecture (ALSA) provides audio and
861MIDI functionality to the Linux-based operating system.")
862
863 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
864 ;; GPLv2-only.
3ac73271 865 (license license:gpl2)))
17b293a0 866
10afdf50
LC
867(define-public iptables
868 (package
869 (name "iptables")
ac9fc78f 870 (version "1.4.21")
10afdf50
LC
871 (source (origin
872 (method url-fetch)
873 (uri (string-append
874 "http://www.netfilter.org/projects/iptables/files/iptables-"
875 version ".tar.bz2"))
876 (sha256
877 (base32
ac9fc78f 878 "1q6kg7sf0pgpq0qhab6sywl23cngxxfzc9zdzscsba8x09l4q02j"))))
10afdf50 879 (build-system gnu-build-system)
50c26d9e
SB
880 (arguments
881 '(#:tests? #f ; no test suite
882 #:configure-flags ; add $libdir to the RUNPATH of executables
883 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
10afdf50
LC
884 (home-page "http://www.netfilter.org/projects/iptables/index.html")
885 (synopsis "Program to configure the Linux IP packet filtering rules")
886 (description
887 "iptables is the userspace command line program used to configure the
35e4b3d5 888Linux 2.4.x and later IPv4 packet filtering ruleset (firewall). It is targeted at
10afdf50
LC
889system administrators. Since Network Address Translation is also configured
890from the packet filter ruleset, iptables is used for this, too. The iptables
891package also includes ip6tables. ip6tables is used for configuring the IPv6
892packet filter.")
3ac73271 893 (license license:gpl2+)))
90a0048f
LC
894
895(define-public iproute
896 (package
897 (name "iproute2")
75cd4b05 898 (version "4.4.0")
90a0048f 899 (source (origin
75cd4b05
AK
900 (method url-fetch)
901 (uri (string-append
902 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
903 version ".tar.xz"))
904 (sha256
905 (base32
906 "05351m4m0whsivlblvs3m0nz5q9v6r06ik80z27gf6ca51kw74dw"))))
90a0048f
LC
907 (build-system gnu-build-system)
908 (arguments
909 `(#:tests? #f ; no test suite
910 #:make-flags (let ((out (assoc-ref %outputs "out")))
911 (list "DESTDIR="
912 (string-append "LIBDIR=" out "/lib")
913 (string-append "SBINDIR=" out "/sbin")
914 (string-append "CONFDIR=" out "/etc")
915 (string-append "DOCDIR=" out "/share/doc/"
916 ,name "-" ,version)
917 (string-append "MANDIR=" out "/share/man")))
b53e44fb
AK
918 #:phases (modify-phases %standard-phases
919 (add-before 'install 'pre-install
920 (lambda _
921 ;; Don't attempt to create /var/lib/arpd.
922 (substitute* "Makefile"
923 (("^.*ARPDDIR.*$") "")))))))
90a0048f
LC
924 (inputs
925 `(("iptables" ,iptables)
c4c4cc05
JD
926 ("db4" ,bdb)))
927 (native-inputs
928 `(("pkg-config" ,pkg-config)
90a0048f
LC
929 ("flex" ,flex)
930 ("bison" ,bison)))
931 (home-page
932 "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2")
933 (synopsis
9e771e3b 934 "Utilities for controlling TCP/IP networking and traffic in Linux")
90a0048f
LC
935 (description
936 "Iproute2 is a collection of utilities for controlling TCP/IP
937networking and traffic with the Linux kernel.
938
939Most network configuration manuals still refer to ifconfig and route as the
940primary network configuration tools, but ifconfig is known to behave
941inadequately in modern network environments. They should be deprecated, but
942most distros still include them. Most network configuration systems make use
943of ifconfig and thus provide a limited feature set. The /etc/net project aims
944to support most modern network technologies, as it doesn't use ifconfig and
945allows a system administrator to make use of all iproute2 features, including
946traffic control.
947
948iproute2 is usually shipped in a package called iproute or iproute2 and
949consists of several tools, of which the most important are ip and tc. ip
950controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
951tools print detailed usage messages and are accompanied by a set of
952manpages.")
3ac73271 953 (license license:gpl2+)))
85e0dc6a
LC
954
955(define-public net-tools
956 ;; XXX: This package is basically unmaintained, but it provides a few
957 ;; commands not yet provided by Inetutils, such as 'route', so we have to
958 ;; live with it.
959 (package
960 (name "net-tools")
961 (version "1.60")
6b55ee88 962 (home-page "http://net-tools.sourceforge.net/")
85e0dc6a
LC
963 (source (origin
964 (method url-fetch)
6b55ee88
LC
965 (uri (list (string-append
966 "mirror://sourceforge/net-tools/net-tools-"
967 version ".tar.bz2")
968 (string-append
969 "http://distro.ibiblio.org/rootlinux/rootlinux-ports"
970 "/base/net-tools/net-tools-1.60.tar.bz2")))
85e0dc6a
LC
971 (sha256
972 (base32
177088a3 973 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
fc1adab1 974 (patches (search-patches "net-tools-bitrot.patch"))))
85e0dc6a
LC
975 (build-system gnu-build-system)
976 (arguments
c9e0a44e
LC
977 '(#:modules ((guix build gnu-build-system)
978 (guix build utils)
979 (srfi srfi-1)
980 (srfi srfi-26))
981 #:phases (alist-cons-after
cd143df0 982 'unpack 'patch
85e0dc6a
LC
983 (lambda* (#:key inputs #:allow-other-keys)
984 (define (apply-patch file)
9a224ac2 985 (zero? (system* "patch" "-p1" "--force"
85e0dc6a
LC
986 "--input" file)))
987
988 (let ((patch.gz (assoc-ref inputs "patch")))
989 (format #t "applying Debian patch set '~a'...~%"
990 patch.gz)
991 (system (string-append "gunzip < " patch.gz " > the-patch"))
85e0dc6a
LC
992 (and (apply-patch "the-patch")
993 (for-each apply-patch
994 (find-files "debian/patches"
995 "\\.patch")))))
996 (alist-replace
997 'configure
998 (lambda* (#:key outputs #:allow-other-keys)
999 (let ((out (assoc-ref outputs "out")))
1000 (mkdir-p (string-append out "/bin"))
1001 (mkdir-p (string-append out "/sbin"))
1002
1003 ;; Pretend we have everything...
1004 (system "yes | make config")
1005
a153ff80
MW
1006 ;; ... except for the things we don't have.
1007 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1008 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1009 ;; that have been removed.
85e0dc6a 1010 (substitute* '("config.make" "config.h")
a153ff80 1011 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
c9e0a44e
LC
1012 (alist-cons-after
1013 'install 'remove-redundant-commands
1014 (lambda* (#:key outputs #:allow-other-keys)
1015 ;; Remove commands and man pages redundant with
1016 ;; Inetutils.
1017 (let* ((out (assoc-ref outputs "out"))
1018 (dup (append-map (cut find-files out <>)
1019 '("^hostname"
1020 "^(yp|nis|dns)?domainname"))))
1021 (for-each delete-file dup)
1022 #t))
1023 %standard-phases)))
85e0dc6a
LC
1024
1025 ;; Binaries that depend on libnet-tools.a don't declare that
1026 ;; dependency, making it parallel-unsafe.
1027 #:parallel-build? #f
1028
1029 #:tests? #f ; no test suite
0d55c356
MW
1030 #:make-flags (let ((out (assoc-ref %outputs "out")))
1031 (list "CC=gcc"
1032 (string-append "BASEDIR=" out)
1033 (string-append "INSTALLNLSDIR=" out "/share/locale")
1034 (string-append "mandir=/share/man")))))
85e0dc6a
LC
1035
1036 ;; Use the big Debian patch set (the thing does not even compile out of
1037 ;; the box.)
1038 (inputs `(("patch" ,(origin
1039 (method url-fetch)
1040 (uri
1041 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
1042 (sha256
1043 (base32
1044 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
1dba6407 1045 (native-inputs `(("gettext" ,gnu-gettext)))
85e0dc6a
LC
1046
1047 (synopsis "Tools for controlling the network subsystem in Linux")
1048 (description
1049 "This package includes the important tools for controlling the network
1050subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
1051netstat, rarp and route. Additionally, this package contains utilities
1052relating to particular network hardware types (plipconfig, slattach) and
1053advanced aspects of IP configuration (iptunnel, ipmaddr).")
3ac73271 1054 (license license:gpl2+)))
c762e82e
LC
1055
1056(define-public libcap
1057 (package
1058 (name "libcap")
f6c2d05c 1059 (version "2.24")
c762e82e
LC
1060 (source (origin
1061 (method url-fetch)
c762e82e 1062 (uri (string-append
f6c2d05c
LC
1063 "mirror://kernel.org/linux/libs/security/linux-privs/"
1064 "libcap2/libcap-" version ".tar.xz"))
c762e82e
LC
1065 (sha256
1066 (base32
f6c2d05c 1067 "0rbc9qbqs5bp9am9s9g83wxj5k4ixps2agy9dxr1v1fwg27mdr6f"))))
c762e82e 1068 (build-system gnu-build-system)
6d889daf
SB
1069 (arguments '(#:phases
1070 (modify-phases %standard-phases
1071 (replace 'configure
1072 ;; Add $libdir to the RUNPATH of executables.
1073 (lambda _
1074 (substitute* "Make.Rules"
1075 (("LDFLAGS := #-g")
1076 (string-append "LDFLAGS := -Wl,-rpath="
1077 %output "/lib"))))))
c762e82e
LC
1078 #:tests? #f ; no 'check' target
1079 #:make-flags (list "lib=lib"
1080 (string-append "prefix="
1081 (assoc-ref %outputs "out"))
1082 "RAISE_SETFCAP=no")))
1083 (native-inputs `(("perl" ,perl)))
1084 (inputs `(("attr" ,attr)))
1085 (home-page "https://sites.google.com/site/fullycapable/")
1086 (synopsis "Library for working with POSIX capabilities")
1087 (description
35b9e423 1088 "Libcap2 provides a programming interface to POSIX capabilities on
c762e82e
LC
1089Linux-based operating systems.")
1090
1091 ;; License is BSD-3 or GPLv2, at the user's choice.
3ac73271 1092 (license license:gpl2)))
215b6431
LC
1093
1094(define-public bridge-utils
1095 (package
1096 (name "bridge-utils")
1097 (version "1.5")
1098 (source (origin
1099 (method url-fetch)
de67e922
LF
1100 (uri (string-append "mirror://sourceforge/bridge/bridge/"
1101 "bridge-utils-" version ".tar.gz"))
215b6431
LC
1102 (sha256
1103 (base32
1104 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1105 (build-system gnu-build-system)
1106
1107 ;; The tarball lacks all the generated files.
1108 (native-inputs `(("autoconf" ,autoconf)
1109 ("automake" ,automake)))
1110 (arguments
722ec722
MW
1111 '(#:phases (alist-cons-after
1112 'unpack 'bootstrap
215b6431 1113 (lambda _
e5c8e4f3
DT
1114 ;; Fix "field ‘ip6’ has incomplete type" errors.
1115 (substitute* "libbridge/libbridge.h"
1116 (("#include <linux/if_bridge.h>")
1117 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1118
1119 ;; Ensure that the entire build fails if one of the
1120 ;; sub-Makefiles fails.
1121 (substitute* "Makefile.in"
1122 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1123 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1124
215b6431
LC
1125 (zero? (system* "autoreconf" "-vf")))
1126 %standard-phases)
1127 #:tests? #f)) ; no 'check' target
1128
1129 (home-page
1130 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1131 (synopsis "Manipulate Ethernet bridges")
1132 (description
1133 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1134to connect two Ethernet segments together in a protocol independent way.
1135Packets are forwarded based on Ethernet address, rather than IP address (like
1136a router). Since forwarding is done at Layer 2, all protocols can go
1137transparently through a bridge.")
3ac73271 1138 (license license:gpl2+)))
3cc20675
LC
1139
1140(define-public libnl
1141 (package
1142 (name "libnl")
bdac3d4b 1143 (version "3.2.25")
3cc20675
LC
1144 (source (origin
1145 (method url-fetch)
1146 (uri (string-append
1147 "http://www.infradead.org/~tgr/libnl/files/libnl-"
1148 version ".tar.gz"))
1149 (sha256
1150 (base32
bdac3d4b 1151 "1icfrv8yihcb74as1gcgmp0wfpdq632q2zvbvqqvjms9cy87bswb"))))
3cc20675
LC
1152 (build-system gnu-build-system)
1153 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
1154 (home-page "http://www.infradead.org/~tgr/libnl/")
1155 (synopsis "NetLink protocol library suite")
1156 (description
1157 "The libnl suite is a collection of libraries providing APIs to netlink
69b4ffcf 1158protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
3cc20675
LC
1159between the kernel and user space processes. It was designed to be a more
1160flexible successor to ioctl to provide mainly networking related kernel
1161configuration and monitoring interfaces.")
1162
1163 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1164 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
3ac73271 1165 (license license:gpl2)))
023fef7d 1166
65cd77db
MW
1167(define-public iw
1168 (package
1169 (name "iw")
2f9e312a 1170 (version "4.3")
65cd77db
MW
1171 (source (origin
1172 (method url-fetch)
1173 (uri (string-append
2f9e312a 1174 "mirror://kernel.org/software/network/iw/iw-"
65cd77db
MW
1175 version ".tar.xz"))
1176 (sha256
1177 (base32
2f9e312a 1178 "085jyvrxzarvn5jl0fk618jjxy50nqx7ifngszc4jxk6a4ddibd6"))))
65cd77db
MW
1179 (build-system gnu-build-system)
1180 (native-inputs `(("pkg-config" ,pkg-config)))
1181 (inputs `(("libnl" ,libnl)))
1182 (arguments
1183 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1184 "CC=gcc")
1185 #:phases (alist-delete 'configure %standard-phases)))
2f9e312a 1186 (home-page "https://wireless.wiki.kernel.org/")
65cd77db
MW
1187 (synopsis "Tool for configuring wireless devices")
1188 (description
1189 "iw is a new nl80211 based CLI configuration utility for wireless
2f9e312a 1190devices. It replaces @code{iwconfig}, which is deprecated.")
3ac73271 1191 (license license:isc)))
65cd77db 1192
023fef7d
LC
1193(define-public powertop
1194 (package
1195 (name "powertop")
ebacb0de 1196 (version "2.8")
023fef7d
LC
1197 (source
1198 (origin
1199 (method url-fetch)
1200 (uri (string-append
bd60e4e2 1201 "https://01.org/sites/default/files/downloads/powertop/powertop-"
023fef7d
LC
1202 version ".tar.gz"))
1203 (sha256
1204 (base32
ebacb0de 1205 "0nlwazxbnn0k6q5f5b09wdhw0f194lpzkp3l7vxansqhfczmcyx8"))))
023fef7d 1206 (build-system gnu-build-system)
4c48bf55
ML
1207 (arguments
1208 '(#:phases
1209 (modify-phases %standard-phases
1210 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1211 ;; allow calibrating the network interface in GuixSD.
1212 (add-after 'unpack 'patch-absolute-file-names
1213 (lambda* (#:key inputs #:allow-other-keys)
1214 (let ((kmod (assoc-ref inputs "kmod")))
1215 (substitute* (find-files "src" "\\.cpp$")
1216 ;; Give the right 'modprobe' file name so that essential
1217 ;; modules such as msr.ko can be loaded.
1218 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1219 ;; These programs are only needed to calibrate, so using
1220 ;; relative file names avoids adding extra inputs. When they
1221 ;; are missing powertop gracefully handles it.
1222 (("/usr/bin/hcitool") "hcitool")
1223 (("/usr/bin/xset") "xset")
1224 (("/usr/sbin/hciconfig") "hciconfig"))
1225 #t))))))
023fef7d 1226 (inputs
4c48bf55
ML
1227 `(("kmod" ,kmod)
1228 ("libnl" ,libnl)
023fef7d 1229 ("ncurses" ,ncurses)
4c48bf55
ML
1230 ("pciutils" ,pciutils)
1231 ("zlib" ,zlib)))
c4c4cc05 1232 (native-inputs
ebacb0de 1233 `(("pkg-config" ,pkg-config)))
023fef7d
LC
1234 (home-page "https://01.org/powertop/")
1235 (synopsis "Analyze power consumption on Intel-based laptops")
1236 (description
1237 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1238power management. In addition to being a diagnostic tool, PowerTOP also has
1239an interactive mode where the user can experiment various power management
1240settings for cases where the operating system has not enabled these
1241settings.")
3ac73271 1242 (license license:gpl2)))
6869e5c9
LC
1243
1244(define-public aumix
1245 (package
1246 (name "aumix")
1247 (version "2.9.1")
1248 (source (origin
1249 (method url-fetch)
1250 (uri (string-append
1251 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1252 version ".tar.bz2"))
1253 (sha256
1254 (base32
1255 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1256 (build-system gnu-build-system)
1257 (inputs `(("ncurses" ,ncurses)))
1258 (home-page "http://www.jpj.net/~trevor/aumix.html")
1259 (synopsis "Audio mixer for X and the console")
1260 (description
1261 "Aumix adjusts an audio mixer from X, the console, a terminal,
1262the command line or a script.")
3ac73271 1263 (license license:gpl2+)))
7c0dbe78
SHT
1264
1265(define-public iotop
1266 (package
1267 (name "iotop")
1268 (version "0.6")
1269 (source
1270 (origin
1271 (method url-fetch)
1272 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1273 version ".tar.gz"))
1274 (sha256 (base32
1275 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1276 (build-system python-build-system)
1277 (arguments
35cebf01 1278 ;; The setup.py script expects python-2.
7c0dbe78 1279 `(#:python ,python-2
35cebf01 1280 ;; There are currently no checks in the package.
7c0dbe78
SHT
1281 #:tests? #f))
1282 (native-inputs `(("python" ,python-2)))
1283 (home-page "http://guichaz.free.fr/iotop/")
1284 (synopsis
1285 "Displays the IO activity of running processes")
1286 (description
1287 "Iotop is a Python program with a top like user interface to show the
1288processes currently causing I/O.")
3ac73271 1289 (license license:gpl2+)))
e30835e2
LC
1290
1291(define-public fuse
1292 (package
1293 (name "fuse")
0e9bc883 1294 (version "2.9.6")
e30835e2
LC
1295 (source (origin
1296 (method url-fetch)
0e9bc883
LF
1297 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1298 "download/fuse-" version
1299 "/fuse-" version ".tar.gz"))
e30835e2
LC
1300 (sha256
1301 (base32
0e9bc883 1302 "0szi2vlsjxg03y4ji51jks34p269jqj5ify6l0ajsqq6f6y8pd0c"))))
e30835e2 1303 (build-system gnu-build-system)
b148bd71 1304 (inputs `(("util-linux" ,util-linux)))
e30835e2
LC
1305 (arguments
1306 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1307 (assoc-ref %outputs "out")
1308 "/sbin")
1309 (string-append "INIT_D_PATH="
1310 (assoc-ref %outputs "out")
1311 "/etc/init.d")
9a4efac9
LC
1312
1313 ;; The rule makes /dev/fuse 666.
e30835e2
LC
1314 (string-append "UDEV_RULES_PATH="
1315 (assoc-ref %outputs "out")
9a4efac9 1316 "/lib/udev/rules.d"))
b148bd71
LC
1317 #:phases (alist-cons-before
1318 'build 'set-file-names
1319 (lambda* (#:key inputs #:allow-other-keys)
1320 ;; libfuse calls out to mount(8) and umount(8). Make sure
1321 ;; it refers to the right ones.
1322 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1323 (("/bin/(u?)mount" _ maybe-u)
1324 (string-append (assoc-ref inputs "util-linux")
1325 "/bin/" maybe-u "mount")))
1326 (substitute* '("util/mount.fuse.c")
1327 (("/bin/sh")
bd663902
LC
1328 (which "sh")))
1329
1330 ;; This hack leads libfuse to search for 'fusermount' in
1331 ;; $PATH, where it may find a setuid-root binary, instead of
1332 ;; trying solely $out/sbin/fusermount and failing because
1333 ;; it's not setuid.
1334 (substitute* "lib/Makefile"
1335 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1336 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
b148bd71 1337 %standard-phases)))
0e9bc883 1338 (home-page "https://github.com/libfuse/libfuse")
e30835e2
LC
1339 (synopsis "Support file systems implemented in user space")
1340 (description
1341 "As a consequence of its monolithic design, file system code for Linux
1342normally goes into the kernel itself---which is not only a robustness issue,
1343but also an impediment to system extensibility. FUSE, for \"file systems in
1344user space\", is a kernel module and user-space library that tries to address
1345part of this problem by allowing users to run file system implementations as
1346user-space processes.")
3ac73271
LC
1347 (license (list license:lgpl2.1 ;library
1348 license:gpl2+)))) ;command-line utilities
220193ad
LC
1349
1350(define-public unionfs-fuse
1351 (package
1352 (name "unionfs-fuse")
1353 (version "0.26")
1354 (source (origin
1355 (method url-fetch)
1356 (uri (string-append
1357 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
1358 version ".tar.xz"))
1359 (sha256
1360 (base32
1361 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1362 (build-system cmake-build-system)
1363 (inputs `(("fuse" ,fuse)))
1364 (arguments '(#:tests? #f)) ; no tests
1365 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1366 (synopsis "User-space union file system")
1367 (description
1368 "UnionFS-FUSE is a flexible union file system implementation in user
1369space, using the FUSE library. Mounting a union file system allows you to
1370\"aggregate\" the contents of several directories into a single mount point.
1371UnionFS-FUSE additionally supports copy-on-write.")
3ac73271 1372 (license license:bsd-3)))
ed748588 1373
0b7a0c20
LC
1374(define fuse-static
1375 (package (inherit fuse)
1376 (name "fuse-static")
1377 (source (origin (inherit (package-source fuse))
1378 (modules '((guix build utils)))
1379 (snippet
1380 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1381 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1382 ;; it doesn't do that, allowing us to remove the dependency on
1383 ;; util-linux (something that is useful in initrds.)
1384 '(substitute* '("lib/mount_util.c"
1385 "util/mount_util.c")
1386 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1387 "0")
1388 (("/bin/")
1389 "")))))))
1390
ed748588
LC
1391(define-public unionfs-fuse/static
1392 (package (inherit unionfs-fuse)
1393 (synopsis "User-space union file system (statically linked)")
1394 (name (string-append (package-name unionfs-fuse) "-static"))
1395 (source (origin (inherit (package-source unionfs-fuse))
1396 (modules '((guix build utils)))
1397 (snippet
1398 ;; Add -ldl to the libraries, because libfuse.a needs that.
1399 '(substitute* "src/CMakeLists.txt"
1400 (("target_link_libraries(.*)\\)" _ libs)
1401 (string-append "target_link_libraries"
1402 libs " dl)"))))))
1403 (arguments
1404 '(#:tests? #f
1456cff1
LC
1405 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1406 #:phases (alist-cons-after
1407 'install 'post-install
1408 (lambda* (#:key outputs #:allow-other-keys)
1409 (let* ((out (assoc-ref outputs "out"))
1410 (exe (string-append out "/bin/unionfs")))
1411 ;; By default, 'unionfs' keeps references to
1412 ;; $glibc/share/locale and similar stuff. Remove them.
1413 (remove-store-references exe)))
1414 %standard-phases)))
0b7a0c20 1415 (inputs `(("fuse" ,fuse-static)))))
67b66003 1416
db288efa
LC
1417(define-public sshfs-fuse
1418 (package
1419 (name "sshfs-fuse")
b58c1b2d 1420 (version "2.8")
db288efa
LC
1421 (source (origin
1422 (method url-fetch)
b58c1b2d
EF
1423 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
1424 "download/sshfs_" version
1425 "/sshfs-" version ".tar.gz"))
db288efa
LC
1426 (sha256
1427 (base32
b58c1b2d 1428 "08mdd4rs7yys7hmyig6i08qlid76p17xlvrh64k7wsrfs1s92s3z"))))
db288efa
LC
1429 (build-system gnu-build-system)
1430 (inputs
1431 `(("fuse" ,fuse)
1432 ("glib" ,glib)))
1433 (native-inputs
1434 `(("pkg-config" ,pkg-config)))
1435 (home-page "http://fuse.sourceforge.net/sshfs.html")
1436 (synopsis "Mount remote file systems over SSH")
1437 (description
1438 "This is a file system client based on the SSH File Transfer Protocol.
1439Since most SSH servers already support this protocol it is very easy to set
1440up: on the server side there's nothing to do; on the client side mounting the
1441file system is as easy as logging into the server with an SSH client.")
3ac73271 1442 (license license:gpl2+)))
db288efa 1443
67b66003
LC
1444(define-public numactl
1445 (package
1446 (name "numactl")
e35dff97 1447 (version "2.0.11")
67b66003
LC
1448 (source (origin
1449 (method url-fetch)
1450 (uri (string-append
1451 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1452 version
1453 ".tar.gz"))
1454 (sha256
1455 (base32
e35dff97 1456 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
67b66003
LC
1457 (build-system gnu-build-system)
1458 (arguments
e35dff97 1459 '(;; There's a 'test' target, but it requires NUMA support in the kernel
67b66003
LC
1460 ;; to run, which we can't assume to have.
1461 #:tests? #f))
b0015064 1462
35dfcdd7
AE
1463 ;; NUMA is apparently not supported on armhf, see
1464 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1465 (supported-systems (delete "armhf-linux" %supported-systems))
67b66003
LC
1466 (home-page "http://oss.sgi.com/projects/libnuma/")
1467 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1468 (description
1469 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1470memory is not all in one place. The numactl program allows you to run your
1471application program on specific CPU's and memory nodes. It does this by
1472supplying a NUMA memory policy to the operating system before running your
1473program.
1474
1475The package contains other commands, such as numademo, numastat and memhog.
1476The numademo command provides a quick overview of NUMA performance on your
1477system.")
3ac73271
LC
1478 (license (list license:gpl2 ;programs
1479 license:lgpl2.1)))) ;library
b10e9ff6
LC
1480
1481(define-public kbd
1482 (package
1483 (name "kbd")
a78daf5e 1484 (version "2.0.3")
b10e9ff6
LC
1485 (source (origin
1486 (method url-fetch)
1487 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
710b4928 1488 version ".tar.xz"))
b10e9ff6
LC
1489 (sha256
1490 (base32
a78daf5e 1491 "0ppv953gn2zylcagr4z6zg5y2x93dxrml29plypg6xgbq3hrv2bs"))
c8f60748
LC
1492 (modules '((guix build utils)))
1493 (snippet
f2cdcafb
LC
1494 '(begin
1495 (substitute* "tests/Makefile.in"
1496 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1497 (("@VERSION@")
1498 "[@]VERSION[@]"))
1499 (substitute* '("src/unicode_start" "src/unicode_stop")
1500 ;; Assume the Coreutils are in $PATH.
1501 (("/usr/bin/tty")
1502 "tty"))))))
b10e9ff6
LC
1503 (build-system gnu-build-system)
1504 (arguments
5953d2b7
AK
1505 '(#:phases
1506 (modify-phases %standard-phases
1507 (add-before 'build 'pre-build
1508 (lambda* (#:key inputs #:allow-other-keys)
1509 (let ((gzip (assoc-ref %build-inputs "gzip"))
1510 (bzip2 (assoc-ref %build-inputs "bzip2")))
1511 (substitute* "src/libkeymap/findfile.c"
1512 (("gzip")
1513 (string-append gzip "/bin/gzip"))
1514 (("bzip2")
1515 (string-append bzip2 "/bin/bzip2"))))))
1516 (add-after 'install 'post-install
1517 (lambda* (#:key outputs #:allow-other-keys)
1518 ;; Make sure these programs find their comrades.
1519 (let* ((out (assoc-ref outputs "out"))
1520 (bin (string-append out "/bin")))
1521 (for-each (lambda (prog)
1522 (wrap-program (string-append bin "/" prog)
1523 `("PATH" ":" prefix (,bin))))
1524 '("unicode_start" "unicode_stop"))))))))
b10e9ff6 1525 (inputs `(("check" ,check)
f61e0e79
LC
1526 ("gzip" ,gzip)
1527 ("bzip2" ,bzip2)
b10e9ff6
LC
1528 ("pam" ,linux-pam)))
1529 (native-inputs `(("pkg-config" ,pkg-config)))
1530 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1531 (synopsis "Linux keyboard utilities and keyboard maps")
1532 (description
1533 "This package contains keytable files and keyboard utilities compatible
1534for systems using the Linux kernel. This includes commands such as
1535'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
3ac73271 1536 (license license:gpl2+)))
de0b620e
LC
1537
1538(define-public inotify-tools
1539 (package
1540 (name "inotify-tools")
1541 (version "3.13")
1542 (source (origin
1543 (method url-fetch)
1544 (uri (string-append
1545 "mirror://sourceforge/inotify-tools/inotify-tools/"
1546 version "/inotify-tools-" version ".tar.gz"))
1547 (sha256
1548 (base32
1549 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1550 (build-system gnu-build-system)
1551 (home-page "http://inotify-tools.sourceforge.net/")
1552 (synopsis "Monitor file accesses")
1553 (description
1554 "The inotify-tools packages provides a C library and command-line tools
1555to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3ac73271 1556 (license license:gpl2+)))
e062d542
AE
1557
1558(define-public kmod
1559 (package
1560 (name "kmod")
ac52b72d 1561 (version "22")
e062d542
AE
1562 (source (origin
1563 (method url-fetch)
1564 (uri
1565 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1566 "kmod-" version ".tar.xz"))
1567 (sha256
1568 (base32
ac52b72d 1569 "10lzfkmnpq6a43a3gkx7x633njh216w0bjwz31rv8a1jlgg1sfxs"))
fc1adab1 1570 (patches (search-patches "kmod-module-directory.patch"))))
e062d542
AE
1571 (build-system gnu-build-system)
1572 (native-inputs
1573 `(("pkg-config" ,pkg-config)))
1574 (inputs
f61e0e79
LC
1575 `(("xz" ,xz)
1576 ("zlib" ,zlib)))
e062d542
AE
1577 (arguments
1578 `(#:tests? #f ; FIXME: Investigate test failures
4a8b4c25
LC
1579 #:configure-flags '("--with-xz" "--with-zlib")
1580 #:phases (alist-cons-after
1581 'install 'install-modprobe&co
1582 (lambda* (#:key outputs #:allow-other-keys)
1583 (let* ((out (assoc-ref outputs "out"))
1584 (bin (string-append out "/bin")))
1585 (for-each (lambda (tool)
1586 (symlink "kmod"
1587 (string-append bin "/" tool)))
1588 '("insmod" "rmmod" "lsmod" "modprobe"
1589 "modinfo" "depmod"))))
1590 %standard-phases)))
e062d542
AE
1591 (home-page "https://www.kernel.org/")
1592 (synopsis "Kernel module tools")
35b9e423 1593 (description "Kmod is a set of tools to handle common tasks with Linux
e062d542
AE
1594kernel modules like insert, remove, list, check properties, resolve
1595dependencies and aliases.
1596
1597These tools are designed on top of libkmod, a library that is shipped with
1598kmod. The aim is to be compatible with tools, configurations and indices
1599from the module-init-tools project.")
3ac73271 1600 (license license:gpl2+))) ; library under lgpl2.1+
d7d42d6b 1601
7fa715e7
LC
1602(define-public eudev
1603 ;; The post-systemd fork, maintained by Gentoo.
fe32c7f7 1604 (package
7fa715e7 1605 (name "eudev")
e75230c1 1606 (version "3.1.5")
7fa715e7
LC
1607 (source (origin
1608 (method url-fetch)
1609 (uri (string-append
1610 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1611 version ".tar.gz"))
1612 (sha256
1613 (base32
e75230c1 1614 "0akg9gcc3c2p56xbhlvbybqavcprly5q0bvk655zwl6d62j8an7p"))
fc1adab1 1615 (patches (search-patches "eudev-rules-directory.patch"))))
fe32c7f7
MW
1616 (build-system gnu-build-system)
1617 (native-inputs
1618 `(("pkg-config" ,pkg-config)
e75230c1
SB
1619 ("perl" ,perl)
1620 ("gperf" ,gperf)))
fe32c7f7 1621 (inputs
255f7308
LC
1622 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
1623 ;; and similar; it also installs the '60-persistent-storage.rules' file,
1624 ;; which contains the rules to do that.
1625 `(("util-linux" ,util-linux) ;for blkid
1626 ("kmod" ,kmod)))
e1921a38 1627 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
fe32c7f7
MW
1628 (synopsis "Userspace device management")
1629 (description "Udev is a daemon which dynamically creates and removes
1630device nodes from /dev/, handles hotplug events and loads drivers at boot
1631time.")
3ac73271 1632 (license license:gpl2+)))
7fa715e7 1633
66269d47
LC
1634(define-public lvm2
1635 (package
1636 (name "lvm2")
1637 (version "2.02.109")
1638 (source (origin
1639 (method url-fetch)
1640 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1641 version ".tgz"))
1642 (sha256
1643 (base32
1644 "1rv5ivg0l1w3nwzwdkqixm96h5bzg7ib4rr196ysb2lw42jmpjbv"))
1645 (modules '((guix build utils)))
1646 (snippet
1647 '(begin
1648 (use-modules (guix build utils))
1649
1650 ;; Honor sysconfdir.
1651 (substitute* "make.tmpl.in"
1652 (("confdir = .*$")
1653 "confdir = @sysconfdir@\n")
1654 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1655 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
1656 (build-system gnu-build-system)
1657 (native-inputs
1658 `(("pkg-config" ,pkg-config)
1659 ("procps" ,procps))) ;tests use 'pgrep'
1660 (inputs
8fcaf8b1 1661 `(("udev" ,eudev)))
66269d47
LC
1662 (arguments
1663 '(#:phases (alist-cons-after
1664 'configure 'set-makefile-shell
1665 (lambda _
1666 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1667 ;; expected.
1668 (setenv "SHELL" (which "sh"))
1669
1670 ;; Replace /bin/sh with the right file name.
1671 (patch-makefile-SHELL "make.tmpl"))
1672 %standard-phases)
1673
1674 #:configure-flags (list (string-append "--sysconfdir="
1675 (assoc-ref %outputs "out")
1676 "/etc/lvm")
1677 "--enable-udev_sync"
f2817d43
LC
1678 "--enable-udev_rules"
1679
1680 ;; Make sure programs such as 'dmsetup' can
1681 ;; find libdevmapper.so.
1682 (string-append "LDFLAGS=-Wl,-rpath="
1683 (assoc-ref %outputs "out")
1684 "/lib"))
66269d47
LC
1685
1686 ;; The tests use 'mknod', which requires root access.
1687 #:tests? #f))
1688 (home-page "http://sourceware.org/lvm2/")
1689 (synopsis "Logical volume management for Linux")
1690 (description
1691 "LVM2 is the logical volume management tool set for Linux-based systems.
1692This package includes the user-space libraries and tools, including the device
1693mapper. Kernel components are part of Linux-libre.")
1694
1695 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
1696 ;; Command-line tools are GPLv2.
3ac73271 1697 (license (list license:gpl2 license:lgpl2.1))))
66269d47 1698
000f7559
DT
1699(define-public wireless-tools
1700 (package
1701 (name "wireless-tools")
1702 (version "30.pre9")
1703 (source (origin
1704 (method url-fetch)
1705 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
1706 version ".tar.gz"))
1707 (sha256
1708 (base32
ec01f22d 1709 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
ec01f22d 1710 (snippet
c2099a4c
MW
1711 '(begin
1712 ;; Remove the older header files that are not free software.
1713 (for-each (lambda (n)
1714 (delete-file (format #f "wireless.~a.h" n)))
1715 '(10 11 12 13 14 15 16 17 18 19 20))
1716 #t))))
000f7559
DT
1717 (build-system gnu-build-system)
1718 (arguments
c2099a4c
MW
1719 `(#:make-flags
1720 (list (string-append "PREFIX=" %output)
1721 (string-append "INSTALL_MAN=" %output "/share/man")
1722 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
1723 "BUILD_STATIC=")
1724 #:phases (modify-phases %standard-phases
1725 (delete 'configure))
000f7559
DT
1726 #:tests? #f))
1727 (synopsis "Tools for manipulating Linux Wireless Extensions")
fb9b7ce2
LC
1728 (description "Wireless Tools are used to manipulate the now-deprecated
1729Linux Wireless Extensions; consider using 'iw' instead. The Wireless
1730Extension was an interface allowing you to set Wireless LAN specific
1731parameters and get the specific stats. It is deprecated in favor the nl80211
1732interface.")
000f7559 1733 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
c2099a4c
MW
1734 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
1735 ;; other files are distributed under gpl2.
3ac73271 1736 (license (list license:gpl2 license:lgpl2.1+))))
30016044 1737
cc205dac
LC
1738(define-public crda
1739 (package
1740 (name "crda")
1741 (version "3.18")
1742 (source (origin
1743 (method url-fetch)
1744 (uri (string-append "mirror://kernel.org/software/network/crda/"
1745 "crda-" version ".tar.xz"))
1746 (sha256
1747 (base32
1748 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
fc1adab1 1749 (patches (search-patches "crda-optional-gcrypt.patch"))))
cc205dac
LC
1750 (build-system gnu-build-system)
1751 (arguments
1752 '(#:phases (modify-phases %standard-phases
1753 (delete 'configure)
1754 (add-before
1755 'build 'no-werror-no-ldconfig
1756 (lambda _
1757 (substitute* "Makefile"
1758 (("-Werror") "")
1759 (("ldconfig") "true"))
1760 #t))
1761 (add-before
1762 'build 'set-regulator-db-file-name
1763 (lambda* (#:key inputs #:allow-other-keys)
1764 ;; Tell CRDA where to find our database.
1765 (let ((regdb (assoc-ref inputs "wireless-regdb")))
1766 (substitute* "crda.c"
1767 (("\"/lib/crda/regulatory.bin\"")
1768 (string-append "\"" regdb
1769 "/lib/crda/regulatory.bin\"")))
1770 #t))))
1771 #:test-target "verify"
1772 #:make-flags (let ((out (assoc-ref %outputs "out"))
1773 (regdb (assoc-ref %build-inputs "wireless-regdb")))
1774 (list "CC=gcc" "V=1"
1775
1776 ;; Disable signature-checking on 'regulatory.bin'.
1777 ;; The reason is that this simplifies maintenance
1778 ;; on our side (no need to manage a distro key
1779 ;; pair), and we can guarantee integrity of
1780 ;; 'regulatory.bin' by other means anyway, such as
1781 ;; 'guix gc --verify'. See
1782 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
1783 ;; for a discssion.
1784 "USE_OPENSSL=0"
1785
1786 (string-append "PREFIX=" out)
1787 (string-append "SBINDIR=" out "/sbin/")
1788 (string-append "UDEV_RULE_DIR="
1789 out "/lib/udev/rules.d")
1790 (string-append "LDFLAGS=-Wl,-rpath="
1791 out "/lib -L.")
1792 (string-append "REG_BIN=" regdb
1793 "/lib/crda/regulatory.bin")))))
1794 (native-inputs `(("pkg-config" ,pkg-config)
1795 ("python" ,python-2)
1796 ("wireless-regdb" ,wireless-regdb)))
1797 (inputs `(("libnl" ,libnl)))
1798 (home-page
1799 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
1800 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
1801 (description
1802 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
1803communication between the kernel Linux and user space for regulatory
1804compliance.")
3ac73271 1805 (license license:copyleft-next)))
cc205dac 1806
c80b4a3e
LC
1807(define-public wireless-regdb
1808 (package
1809 (name "wireless-regdb")
9a12ca77 1810 (version "2016.05.02")
c80b4a3e
LC
1811 (source (origin
1812 (method url-fetch)
1813 (uri (string-append
1814 "mirror://kernel.org/software/network/wireless-regdb/"
1815 "wireless-regdb-" version ".tar.xz"))
1816 (sha256
1817 (base32
9a12ca77 1818 "07n6gcwfbddz3awbdflv3dhxjszsqq2lrdwih0a0ahcliac4qry9"))
5568151f
LC
1819
1820 ;; We're building 'regulatory.bin' by ourselves.
1821 (snippet '(delete-file "regulatory.bin"))))
c80b4a3e
LC
1822 (build-system gnu-build-system)
1823 (arguments
1824 '(#:phases (modify-phases %standard-phases
1825 (delete 'configure))
5568151f
LC
1826
1827 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
1828 ;; is computed and can be equal to 'maintainer-clean'; when that
1829 ;; happens, we can end up deleting the 'regulatory.bin' file that we
1830 ;; just built. Thus, build things sequentially.
1831 #:parallel-build? #f
1832
c80b4a3e
LC
1833 #:tests? #f ;no tests
1834 #:make-flags (let ((out (assoc-ref %outputs "out")))
1835 (list (string-append "PREFIX=" out)
1836 (string-append "LSB_ID=GuixSD")
1837 (string-append "DISTRO_PUBKEY=/dev/null")
1838 (string-append "DISTRO_PRIVKEY=/dev/null")
1839 (string-append "REGDB_PUBKEY=/dev/null")
1840
1841 ;; Leave that empty so that db2bin.py doesn't try
1842 ;; to sign 'regulatory.bin'. This allows us to
1843 ;; avoid managing a key pair for the whole distro.
1844 (string-append "REGDB_PRIVKEY=")))))
1845 (native-inputs `(("python" ,python-2)))
1846 (home-page
1847 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
1848 (synopsis "Wireless regulatory database")
1849 (description
1850 "This package contains the wireless regulatory database Central
1851Regulatory Database Agent (CRDA) daemon. The database contains information on
1852country-specific regulations for the wireless spectrum.")
3ac73271 1853 (license license:isc)))
c80b4a3e 1854
30016044
MW
1855(define-public lm-sensors
1856 (package
1857 (name "lm-sensors")
1858 (version "3.3.5")
1859 (source (origin
1860 (method url-fetch)
ee6a5d0e
AE
1861 (uri (list (string-append
1862 "ftp://ftp.netroedge.com/pub/lm-sensors/"
1863 "lm_sensors-" version ".tar.bz2")
1864 (string-append
1865 "http://pkgs.fedoraproject.org/repo/pkgs/"
1866 "lm_sensors/lm_sensors-3.3.5.tar.bz2/"
1867 "da506dedceb41822e64865f6ba34828a/"
1868 "lm_sensors-3.3.5.tar.bz2")))
30016044
MW
1869 (sha256
1870 (base32
1871 "1ksgrynxgrq590nb2fwxrl1gwzisjkqlyg3ljfd1al0ibrk6mbjx"))
fc1adab1 1872 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
30016044
MW
1873 (build-system gnu-build-system)
1874 (inputs `(("rrdtool" ,rrdtool)
1875 ("perl" ,perl)
1876 ("kmod" ,kmod)
1877 ("gnuplot" ,gnuplot)))
1878 (native-inputs `(("pkg-config" ,pkg-config)
1879 ("flex" ,flex)
1880 ("bison" ,bison)
1881 ("which" ,which)))
1882 (arguments
1883 `(#:tests? #f ; no 'check' target
1884 #:make-flags (list (string-append "PREFIX=" %output)
1885 (string-append "ETCDIR=" %output "/etc")
1886 (string-append "MANDIR=" %output "/share/man"))
1887 #:phases
1888 (alist-delete
1889 'configure
1890 (alist-cons-before
1891 'build 'patch-exec-paths
1892 (lambda* (#:key inputs outputs #:allow-other-keys)
1893 (substitute* "prog/detect/sensors-detect"
1894 (("`uname")
1895 (string-append "`" (assoc-ref inputs "coreutils")
1896 "/bin/uname"))
1897 (("(`|\")modprobe" all open-quote)
1898 (string-append open-quote
1899 (assoc-ref inputs "kmod")
1900 "/bin/modprobe")))
1901 (substitute* '("prog/pwm/pwmconfig"
1902 "prog/pwm/fancontrol")
1903 (("gnuplot")
1904 (string-append (assoc-ref inputs "gnuplot")
1905 "/bin/gnuplot"))
1906 (("cat ")
1907 (string-append (assoc-ref inputs "coreutils")
1908 "/bin/cat "))
1909 (("egrep ")
1910 (string-append (assoc-ref inputs "grep")
1911 "/bin/egrep "))
1912 (("sed -e")
1913 (string-append (assoc-ref inputs "sed")
1914 "/bin/sed -e"))
1915 (("cut -d")
1916 (string-append (assoc-ref inputs "coreutils")
1917 "/bin/cut -d"))
1918 (("sleep ")
1919 (string-append (assoc-ref inputs "coreutils")
1920 "/bin/sleep "))
1921 (("readlink -f")
1922 (string-append (assoc-ref inputs "coreutils")
1923 "/bin/readlink -f"))))
1924 %standard-phases))))
3a04d5d4 1925 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
30016044
MW
1926 (synopsis "Utilities to read temperature/voltage/fan sensors")
1927 (description
35b9e423 1928 "Lm-sensors is a hardware health monitoring package for Linux. It allows
30016044
MW
1929you to access information from temperature, voltage, and fan speed sensors.
1930It works with most newer systems.")
3ac73271 1931 (license license:gpl2+)))
b087d413 1932
f5b2a53d
RW
1933(define-public i2c-tools
1934 (package
1935 (name "i2c-tools")
1936 (version "3.1.1")
1937 (source (origin
1938 (method url-fetch)
1939 (uri (string-append
f32274a7 1940 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
f5b2a53d
RW
1941 version ".tar.bz2"))
1942 (sha256
1943 (base32
1944 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
1945 (build-system gnu-build-system)
1946 (arguments
1947 `(#:tests? #f ; no 'check' target
1948 #:make-flags (list (string-append "prefix=" %output)
1949 "CC=gcc")
1950 ;; no configure script
1951 #:phases (alist-delete 'configure %standard-phases)))
bccf27cb
RW
1952 (inputs
1953 `(("perl" ,perl)))
f32274a7 1954 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
f5b2a53d
RW
1955 (synopsis "I2C tools for Linux")
1956 (description
1957 "The i2c-tools package contains a heterogeneous set of I2C tools for
1958Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
1959EEPROM decoding scripts, EEPROM programming tools, and a python module for
1960SMBus access.")
3ac73271 1961 (license license:gpl2+)))
f5b2a53d 1962
b087d413
MW
1963(define-public xsensors
1964 (package
1965 (name "xsensors")
1966 (version "0.70")
1967 (source (origin
1968 (method url-fetch)
1969 (uri (string-append
1970 "http://www.linuxhardware.org/xsensors/xsensors-"
1971 version ".tar.gz"))
1972 (sha256
1973 (base32
1974 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
1975 (build-system gnu-build-system)
1976 (inputs `(("lm-sensors" ,lm-sensors)
1977 ("gtk" ,gtk+-2)))
1978 (native-inputs `(("pkg-config" ,pkg-config)))
1979 (arguments
1980 `(#:phases (alist-cons-before
1981 'configure 'enable-deprecated
1982 (lambda _
1983 (substitute* "src/Makefile.in"
1984 (("-DGDK_DISABLE_DEPRECATED") "")
1985 (("-DGTK_DISABLE_DEPRECATED") "")))
1986 (alist-cons-before
1987 'configure 'remove-Werror
1988 (lambda _
1989 (substitute* '("configure" "src/Makefile.in")
1990 (("-Werror") "")))
1991 %standard-phases))))
1992 (home-page "http://www.linuxhardware.org/xsensors/")
1993 (synopsis "Hardware health information viewer")
1994 (description
35b9e423 1995 "Xsensors reads data from the libsensors library regarding hardware
b087d413
MW
1996health such as temperature, voltage and fan speed and displays the information
1997in a digital read-out.")
3ac73271 1998 (license license:gpl2+)))
b62fe07f
LC
1999
2000(define-public perf
2001 (package
2002 (name "perf")
2003 (version (package-version linux-libre))
2004 (source (package-source linux-libre))
2005 (build-system gnu-build-system)
2006 (arguments
2007 '(#:phases (alist-replace
2008 'configure
2009 (lambda* (#:key inputs #:allow-other-keys)
2010 (setenv "SHELL_PATH" (which "bash"))
2011 (chdir "tools/perf"))
2012 %standard-phases)
2013 #:make-flags (list (string-append "DESTDIR="
2014 (assoc-ref %outputs "out"))
2af29d23
LC
2015 "WERROR=0"
2016
2017 ;; By default, 'config/Makefile' uses lib64 on
2018 ;; x86_64. Work around that.
2019 "lib=lib")
b62fe07f
LC
2020 #:tests? #f)) ;no tests
2021 (native-inputs
2022 `(("pkg-config" ,pkg-config)
2023 ("bison" ,bison)
2024 ("flex" ,flex)
2025
2026 ;; There are build scripts written in these languages.
2027 ("perl" ,perl)
2028 ("python" ,python-2)))
2029 (inputs
b1fb4b23 2030 `(("slang" ,slang) ;for the interactive TUI
b62fe07f 2031 ;; ("newt" ,newt)
6c030d10 2032 ("python" ,python-2) ;'perf' links against libpython
b62fe07f
LC
2033 ("elfutils" ,elfutils)
2034
d7ece67a
LC
2035 ;; Documentation.
2036 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2037 ("libxslt" ,libxslt)
2038 ("docbook-xml" ,docbook-xml)
2039 ("docbook-xsl" ,docbook-xsl)
2040 ("xmlto" ,xmlto)
2041 ("asciidoc" ,asciidoc)))
b62fe07f
LC
2042 (home-page "https://perf.wiki.kernel.org/")
2043 (synopsis "Linux profiling with performance counters")
2044 (description
2045 "perf is a tool suite for profiling using hardware performance counters,
2046with support in the Linux kernel. perf can instrument CPU performance
2047counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2048of lightweight profiling. This package contains the user-land tools and in
2049particular the 'perf' command.")
2050 (license (package-license linux-libre))))
c09e60e4
DT
2051
2052(define-public pflask
2053 (package
2054 (name "pflask")
2055 (version "0.2")
2056 (source (origin
2057 (method url-fetch)
2058 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2059 version ".tar.gz"))
f586c877 2060 (file-name (string-append name "-" version ".tar.gz"))
c09e60e4
DT
2061 (sha256
2062 (base32
2063 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2064 (build-system cmake-build-system)
2065 (arguments
2066 '(#:tests? #f)) ; no tests
2067 (home-page "http://ghedo.github.io/pflask/")
2068 (synopsis "Simple tool for creating Linux namespace containers")
2069 (description "pflask is a simple tool for creating Linux namespace
2070containers. It can be used for running a command or even booting an OS inside
2071an isolated container, created with the help of Linux namespaces. It is
2072similar in functionality to chroot, although pflask provides better isolation
2073thanks to the use of namespaces.")
3ac73271 2074 (license license:bsd-2)))
288084d5
MW
2075
2076(define-public hdparm
2077 (package
2078 (name "hdparm")
2079 (version "9.45")
2080 (source (origin
2081 (method url-fetch)
de67e922 2082 (uri (string-append "mirror://sourceforge/" name "/" name "/"
288084d5
MW
2083 name "-" version ".tar.gz"))
2084 (sha256
2085 (base32
2086 "0sc6yf3k6sd7n6a2ig2my9fjlqpak3znlyw7jw4cz5d9asm1rc13"))))
2087 (build-system gnu-build-system)
2088 (arguments
2089 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2090 (list (string-append "binprefix=" out)
2091 (string-append "manprefix=" out)
2092 "CC=gcc"))
2093 #:phases (alist-delete 'configure %standard-phases)
2094 #:tests? #f)) ; no test suite
2095 (home-page "http://sourceforge.net/projects/hdparm/")
e881752c 2096 (synopsis "Tune hard disk parameters for high performance")
288084d5
MW
2097 (description
2098 "Get/set device parameters for Linux SATA/IDE drives. It's primary use
e881752c 2099is for enabling irq-unmasking and IDE multiple-mode.")
3ac73271 2100 (license (license:non-copyleft "file://LICENSE.TXT"))))
288084d5 2101
c755c854
MW
2102(define-public rfkill
2103 (package
2104 (name "rfkill")
2105 (version "0.5")
2106 (source (origin
2107 (method url-fetch)
2108 (uri (string-append "mirror://kernel.org/software/network/"
2109 name "/" name "-" version ".tar.xz"))
2110 (sha256
2111 (base32
2112 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2113 (build-system gnu-build-system)
2114 (arguments
2115 `(#:make-flags (list "CC=gcc"
2116 (string-append "PREFIX=" %output))
2117 #:phases (modify-phases %standard-phases
2118 (delete 'configure))
2119 #:tests? #f))
2120 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2121 (synopsis "Tool for enabling and disabling wireless devices")
2122 (description
2123 "rfkill is a simple tool for accessing the rfkill device interface,
2124which is used to enable and disable wireless networking devices, typically
2125WLAN, Bluetooth and mobile broadband.")
3ac73271
LC
2126 (license (license:non-copyleft "file://COPYING"
2127 "See COPYING in the distribution."))))
c755c854 2128
dc9bdb1e
ML
2129(define-public acpi
2130 (package
2131 (name "acpi")
2132 (version "1.7")
2133 (source (origin
2134 (method url-fetch)
de67e922
LF
2135 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2136 version "/" name "-" version ".tar.gz"))
dc9bdb1e
ML
2137 (sha256
2138 (base32
2139 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2140 (build-system gnu-build-system)
2141 (home-page "http://acpiclient.sourceforge.net")
2142 (synopsis "Display information on ACPI devices")
2143 (description "@code{acpi} attempts to replicate the functionality of the
2144\"old\" @code{apm} command on ACPI systems, including battery and thermal
2145information. It does not support ACPI suspending, only displays information
2146about ACPI devices.")
2147 (license license:gpl2+)))
2148
57a516d3
LC
2149(define-public acpid
2150 (package
2151 (name "acpid")
2152 (version "2.0.23")
2153 (source (origin
2154 (method url-fetch)
2155 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2156 version ".tar.xz"))
2157 (sha256
2158 (base32
2159 "1vl7c6vc724v4jwki17czgj6lnrknnj1a6llm8gkl32i2gnam5j3"))))
2160 (build-system gnu-build-system)
2161 (home-page "http://sourceforge.net/projects/acpid2/")
2162 (synopsis "Daemon for delivering ACPI events to user-space programs")
2163 (description
2164 "acpid is designed to notify user-space programs of Advanced
2165Configuration and Power Interface (ACPI) events. acpid should be started
2166during the system boot, and will run as a background process. When an ACPI
2167event is received from the kernel, acpid will examine the list of rules
2168specified in /etc/acpi/events and execute the rules that match the event.")
3ac73271 2169 (license license:gpl2+)))
37f5caec
TUBK
2170
2171(define-public sysfsutils
2172 (package
2173 (name "sysfsutils")
2174 (version "2.1.0")
2175 (source
2176 (origin
2177 (method url-fetch)
2178 (uri
2179 (string-append
2180 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2181 version ".tar.gz"))
2182 (sha256
2183 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2184 (build-system gnu-build-system)
2185 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2186 (synopsis "System utilities based on Linux sysfs")
2187 (description
8f65585b 2188 "These are a set of utilities built upon sysfs, a virtual file system in
37f5caec
TUBK
2189Linux kernel versions 2.5+ that exposes a system's device tree. The package
2190also contains the libsysfs library.")
2191 ;; The library is under lgpl2.1+ (all files say "or any later version").
2192 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3ac73271 2193 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
a9a1a40b
TUBK
2194
2195(define-public sysfsutils-1
2196 (package
2197 (inherit sysfsutils)
2198 (version "1.3.0")
2199 (source
2200 (origin
2201 (method url-fetch)
2202 (uri
2203 (string-append
2204 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2205 "/sysfsutils-" version ".tar.gz"))
2206 (sha256
2207 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2208 (modules '((guix build utils)))
2209 (snippet
2210 '(begin
2211 (substitute* "Makefile.in"
2212 (("includedir = /usr/include/sysfs")
2213 "includedir = @includedir@"))
2214 (substitute* "configure"
2215 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2216 (string-append "includedir='" orig "/sysfs'")))))))
2217 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
e6caa52d
TUBK
2218
2219(define-public cpufrequtils
2220 (package
2221 (name "cpufrequtils")
2222 (version "0.3")
2223 (source
2224 (origin
2225 (method url-fetch)
2226 (uri
2227 (string-append
2228 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2229 version ".tar.gz"))
2230 (sha256
2231 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
fc1adab1 2232 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
e6caa52d
TUBK
2233 (build-system gnu-build-system)
2234 (native-inputs
2235 `(("sysfsutils" ,sysfsutils-1)))
2236 (arguments
2237 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2238 (assoc-ref %outputs "out") "/lib"))))
2239 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2240 (synopsis "Utilities to get and set CPU frequency on Linux")
2241 (description
e881752c 2242 "The cpufrequtils suite contains utilities to retrieve CPU frequency
e6caa52d
TUBK
2243information, and set the CPU frequency if supported, using the cpufreq
2244capabilities of the Linux kernel.")
3ac73271 2245 (license license:gpl2)))
0a588bf9
SB
2246
2247(define-public libraw1394
2248 (package
2249 (name "libraw1394")
2250 (version "2.1.0")
2251 (source (origin
2252 (method url-fetch)
2253 (uri (string-append
2254 "mirror://kernel.org/linux/libs/ieee1394/"
2255 name "-" version ".tar.xz"))
2256 (sha256
2257 (base32
2258 "0kwnf4ha45c04mhc4yla672aqmvqqihxix1gvblns5cd2pc2cc8b"))))
2259 (build-system gnu-build-system)
2260 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2261 (synopsis "Interface library for the Linux IEEE1394 drivers")
2262 (description
2263 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2264the Linux IEEE-1394 subsystem, which provides direct access to the connected
22651394 buses to user space. Through libraw1394/raw1394, applications can directly
2266send to and receive from other nodes without requiring a kernel driver for the
2267protocol in question.")
3ac73271 2268 (license license:lgpl2.1+)))
68e3c29d
SB
2269
2270(define-public libavc1394
2271 (package
2272 (name "libavc1394")
2273 (version "0.5.4")
2274 (source (origin
2275 (method url-fetch)
de67e922 2276 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
68e3c29d
SB
2277 name "-" version ".tar.gz"))
2278 (sha256
2279 (base32
2280 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2281 (build-system gnu-build-system)
2282 (native-inputs
2283 `(("pkg-config" ,pkg-config)))
2284 (propagated-inputs
2285 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2286 (home-page "http://sourceforge.net/projects/libavc1394/")
2287 (synopsis "AV/C protocol library for IEEE 1394")
2288 (description
2289 "Libavc1394 is a programming interface to the AV/C specification from
69b4ffcf 2290the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3ac73271 2291 (license license:lgpl2.1+)))
3f7bf86a
SB
2292
2293(define-public libiec61883
2294 (package
2295 (name "libiec61883")
2296 (version "1.2.0")
2297 (source (origin
2298 (method url-fetch)
2299 (uri (string-append
2300 "mirror://kernel.org/linux/libs/ieee1394/"
2301 name "-" version ".tar.xz"))
2302 (sha256
2303 (base32
2304 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2305 (build-system gnu-build-system)
2306 (native-inputs
2307 `(("pkg-config" ,pkg-config)))
2308 (propagated-inputs
2309 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2310 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2311 (synopsis "Isochronous streaming media library for IEEE 1394")
2312 (description
2313 "The libiec61883 library provides a higher level API for streaming DV,
2314MPEG-2 and audio over Linux IEEE 1394.")
3ac73271 2315 (license license:lgpl2.1+)))
69159125
MW
2316
2317(define-public mdadm
2318 (package
2319 (name "mdadm")
30897c60 2320 (version "3.4")
69159125
MW
2321 (source (origin
2322 (method url-fetch)
2323 (uri (string-append
2324 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2325 version ".tar.xz"))
2326 (sha256
2327 (base32
30897c60 2328 "0248v9f28mrbwabl94ck22gfim29sqhkf70wrpfi52nk4x3bxl17"))))
69159125
MW
2329 (build-system gnu-build-system)
2330 (inputs
2331 `(("udev" ,eudev)))
2332 (arguments
2333 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2334 (list "INSTALL=install"
2335 "CHECK_RUN_DIR=0"
2336 ;; TODO: tell it where to find 'sendmail'
2337 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2338 (string-append "BINDIR=" out "/sbin")
2339 (string-append "MANDIR=" out "/share/man")
2340 (string-append "UDEVDIR=" out "/lib/udev")))
2341 #:phases (alist-cons-before
2342 'build 'patch-program-paths
2343 (lambda* (#:key inputs #:allow-other-keys)
2344 (let ((coreutils (assoc-ref inputs "coreutils")))
2345 (substitute* "udev-md-raid-arrays.rules"
2346 (("/usr/bin/(readlink|basename)" all program)
2347 (string-append coreutils "/bin/" program)))))
d76f44e8
LC
2348 (alist-cons-before
2349 'build 'remove-W-error
2350 (lambda _
2351 ;; We cannot build with -Werror on i686 due to a
2352 ;; 'sign-compare' warning in util.c.
2353 (substitute* "Makefile"
2354 (("-Werror") ""))
2355 #t)
2356 (alist-delete 'configure %standard-phases)))
69159125
MW
2357 ;;tests must be done as root
2358 #:tests? #f))
2359 (home-page "http://neil.brown.name/blog/mdadm")
2360 (synopsis "Tool for managing Linux Software RAID arrays")
2361 (description
2362 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2363assemble, report on, and monitor arrays. It can also move spares between raid
2364arrays when needed.")
3ac73271 2365 (license license:gpl2+)))
01ccdfb6
SB
2366
2367(define-public libaio
2368 (package
2369 (name "libaio")
2370 (version "0.3.110")
2371 (source (origin
2372 (method url-fetch)
2373 (uri (list
2374 (string-append "mirror://debian/pool/main/liba/libaio/"
2375 name "_" version ".orig.tar.gz")
2376 (string-append "https://fedorahosted.org/releases/l/i/libaio/"
2377 name "-" version ".tar.gz")))
2378 (sha256
2379 (base32
2380 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2381 (build-system gnu-build-system)
2382 (arguments
2383 '(#:make-flags
2384 (list "CC=gcc" (string-append "prefix=" %output))
2385 #:test-target "partcheck" ; need root for a full 'check'
2386 #:phases
2387 (alist-delete 'configure %standard-phases))) ; no configure script
2388 (home-page "http://lse.sourceforge.net/io/aio.html")
2389 (synopsis "Linux-native asynchronous I/O access library")
2390 (description
2391 "This library enables userspace to use Linux kernel asynchronous I/O
2392system calls, important for the performance of databases and other advanced
2393applications.")
3ac73271 2394 (license license:lgpl2.1+)))
eb7c43c3 2395
81b98756
RW
2396(define-public sbc
2397 (package
2398 (name "sbc")
2399 (version "1.3")
2400 (source (origin
2401 (method url-fetch)
2402 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
2403 name "-" version ".tar.xz"))
2404 (sha256
2405 (base32
2406 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
2407 (build-system gnu-build-system)
2408 (inputs
2409 `(("libsndfile" ,libsndfile)))
2410 (native-inputs
2411 `(("pkg-config" ,pkg-config)))
2412 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
2413 (synopsis "Bluetooth subband audio codec")
2414 (description
2415 "The SBC is a digital audio encoder and decoder used to transfer data to
2416Bluetooth audio output devices like headphones or loudspeakers.")
2417 (license license:gpl2+)))
2418
eb7c43c3
DT
2419(define-public bluez
2420 (package
2421 (name "bluez")
c8092046 2422 (version "5.40")
eb7c43c3
DT
2423 (source (origin
2424 (method url-fetch)
2425 (uri (string-append
e9eb24b1 2426 "mirror://kernel.org/linux/bluetooth/bluez-"
eb7c43c3
DT
2427 version ".tar.xz"))
2428 (sha256
2429 (base32
c8092046 2430 "09ywk3lvgis0nbi0d5z8d4qp5r33lzwnd6bdakacmbsm420qpnns"))))
eb7c43c3
DT
2431 (build-system gnu-build-system)
2432 (arguments
2433 '(#:configure-flags
2434 (let ((out (assoc-ref %outputs "out")))
f3dbc626
SB
2435 (list "--sysconfdir=/etc"
2436 "--localstatedir=/var"
2437 "--enable-library"
53142109 2438 "--disable-systemd"
eb7c43c3
DT
2439 ;; Install dbus/udev files to the correct location.
2440 (string-append "--with-dbusconfdir=" out "/etc")
87a16de7
SB
2441 (string-append "--with-udevdir=" out "/lib/udev")))
2442 #:phases
2443 (modify-phases %standard-phases
2444 (add-after 'install 'post-install
2445 (lambda* (#:key inputs outputs #:allow-other-keys)
2446 (let* ((out (assoc-ref outputs "out"))
2447 (servicedir (string-append out "/share/dbus-1/services"))
2448 (service "obexd/src/org.bluez.obex.service")
2449 (rule (string-append
2450 out "/lib/udev/rules.d/97-hid2hci.rules")))
2451 ;; Install the obex dbus service file.
2452 (substitute* service
2453 (("/bin/false")
2454 (string-append out "/libexec/bluetooth/obexd")))
2455 (install-file service servicedir)
2456 ;; Fix paths in the udev rule.
2457 (substitute* rule
2458 (("hid2hci --method")
2459 (string-append out "/lib/udev/hid2hci --method"))
2460 (("/sbin/udevadm")
2461 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
2462 #t))))))
eb7c43c3
DT
2463 (native-inputs
2464 `(("pkg-config" ,pkg-config)
2465 ("gettext" ,gnu-gettext)))
2466 (inputs
2467 `(("glib" ,glib)
2468 ("dbus" ,dbus)
2469 ("eudev" ,eudev)
2470 ("libical" ,libical)
2471 ("readline" ,readline)))
2472 (home-page "http://www.bluez.org/")
2473 (synopsis "Linux Bluetooth protocol stack")
2474 (description
2475 "BlueZ provides support for the core Bluetooth layers and protocols. It
2476is flexible, efficient and uses a modular implementation.")
3ac73271 2477 (license license:gpl2+)))
3d890318
LC
2478
2479(define-public fuse-exfat
2480 (package
2481 (name "fuse-exfat")
2482 (version "1.1.0")
2483 (source (origin
2484 (method url-fetch)
2485 (uri "https://docs.google.com/uc?export=download&\
2486id=0B7CLI-REKbE3VTdaa0EzTkhYdU0")
2487 (sha256
2488 (base32
2489 "0glmgwrf0nv09am54i6s35ksbvrywrwc51w6q32mv5by8475530r"))
2490 (file-name (string-append name "-" version ".tar.gz"))))
2491 (build-system gnu-build-system)
2492 (native-inputs
2493 `(("scons" ,scons)
2494 ("pkg-config" ,pkg-config)))
2495 (inputs
2496 `(("fuse" ,fuse)))
2497 (arguments
2498 '(#:tests? #f ;no test suite
2499
2500 ;; XXX: Factorize with 'exfat-utils'.
2501 #:phases (modify-phases %standard-phases
2502 (delete 'configure)
2503 (add-after 'unpack 'scons-propagate-environment
2504 (lambda _
2505 ;; Modify the SConstruct file to arrange for
2506 ;; environment variables to be propagated.
2507 (substitute* "SConstruct"
2508 (("^env = Environment\\(")
2509 "env = Environment(ENV=os.environ, "))))
2510 (replace 'build
2511 (lambda _
2512 (zero? (system* "scons"))))
2513 (replace 'install
2514 (lambda* (#:key outputs #:allow-other-keys)
2515 (let* ((out (assoc-ref outputs "out"))
2516 (bin (string-append out "/bin"))
2517 (man8 (string-append out
2518 "/share/man/man8")))
2519 (mkdir-p bin)
2520 (mkdir-p man8)
2521 (for-each (lambda (file)
2522 (copy-file
2523 file
2524 (string-append man8 "/"
2525 (basename file))))
2526 (find-files "." "\\.8$"))
2527 (zero? (system* "scons" "install"
2528 (string-append "DESTDIR="
2529 bin)))))))))
2530 (home-page "http://code.google.com/p/exfat/")
2531 (synopsis "Mount exFAT file systems")
2532 (description
2533 "This package provides a FUSE-based file system that provides read and
2534write access to exFAT devices.")
3ac73271 2535 (license license:gpl2+)))
53ec8d48
LC
2536
2537(define-public gpm
2538 (package
2539 (name "gpm")
2540 (version "1.20.7")
2541 (source (origin
2542 (method url-fetch)
2543 (uri (string-append
2544 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
2545 version ".tar.bz2"))
2546 (sha256
2547 (base32
2548 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
2549 (build-system gnu-build-system)
2550 (arguments
2551 '(#:phases (modify-phases %standard-phases
2552 (add-before 'configure 'bootstrap
2553 (lambda _
2554 ;; The tarball was not generated with 'make dist' so we
2555 ;; need to bootstrap things ourselves.
2556 (and (zero? (system* "./autogen.sh"))
2557 (begin
2558 (patch-makefile-SHELL "Makefile.include.in")
2559 #t)))))
2560
2561 ;; Make sure programs find libgpm.so.
2562 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2563 (assoc-ref %outputs "out")
2564 "/lib"))))
2565 (native-inputs
2566 `(("texinfo" ,texinfo)
2567 ("bison" ,bison)
2568 ("flex" ,flex)
2569 ("autoconf" ,autoconf)
2570 ("automake" ,automake)
2571 ("libtool" ,libtool)))
2572 (home-page "http://www.nico.schottelius.org/software/gpm/")
2573 (synopsis "Mouse support for the Linux console")
2574 (description
2575 "The GPM (general-purpose mouse) daemon is a mouse server for
2576applications running on the Linux console. It allows users to select items
2577and copy/paste text in the console and in xterm.")
3ac73271 2578 (license license:gpl2+)))
fc686f9a
TGR
2579
2580(define-public btrfs-progs
2581 (package
2582 (name "btrfs-progs")
5e814f63 2583 (version "4.7.2")
fc686f9a
TGR
2584 (source (origin
2585 (method url-fetch)
2586 (uri (string-append "mirror://kernel.org/linux/kernel/"
2587 "people/kdave/btrfs-progs/"
2588 "btrfs-progs-v" version ".tar.xz"))
2589 (sha256
2590 (base32
5e814f63 2591 "03z6zgvjb94jk0q1xx2hicznfxj5c8xyyw5xqmh05rpz8ghwk6zl"))))
fc686f9a 2592 (build-system gnu-build-system)
7cad981d
TGR
2593 (outputs '("out"
2594 "static")) ; static versions of binaries in "out" (~16MiB!)
fc686f9a 2595 (arguments
7cad981d
TGR
2596 '(#:phases (modify-phases %standard-phases
2597 (add-after 'build 'build-static
2598 (lambda _ (zero? (system* "make" "static"))))
2599 (add-after 'install 'install-static
2600 (let ((staticbin (string-append (assoc-ref %outputs "static")
2601 "/bin")))
2602 (lambda _
2603 (zero? (system* "make"
2604 (string-append "bindir=" staticbin)
2605 "install-static"))))))
2606 #:test-target "test"
fc686f9a
TGR
2607 #:parallel-tests? #f)) ; tests fail when run in parallel
2608 (inputs `(("e2fsprogs" ,e2fsprogs)
2609 ("libblkid" ,util-linux)
7cad981d 2610 ("libblkid:static" ,util-linux "static")
fc686f9a 2611 ("libuuid" ,util-linux)
7cad981d 2612 ("libuuid:static" ,util-linux "static")
fc686f9a
TGR
2613 ("zlib" ,zlib)
2614 ("lzo" ,lzo)))
2615 (native-inputs `(("pkg-config" ,pkg-config)
2616 ("asciidoc" ,asciidoc)
2617 ("xmlto" ,xmlto)
2618 ;; For building documentation
2619 ("libxml2" ,libxml2)
2620 ("docbook-xml" ,docbook-xml)
48b7e4a6 2621 ("docbook-xsl" ,docbook-xsl)
49dbe696 2622 ;; For tests
48b7e4a6 2623 ("which" ,which)))
fc686f9a
TGR
2624 (home-page "https://btrfs.wiki.kernel.org/")
2625 (synopsis "Create and manage btrfs copy-on-write file systems")
8f65585b 2626 (description "Btrfs is a copy-on-write (CoW) file system for Linux aimed at
fc686f9a
TGR
2627implementing advanced features while focusing on fault tolerance, repair and
2628easy administration.")
68bcac6b
LF
2629 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
2630 ;; GPL2: Everything else.
2631 (license (list license:gpl2 license:gpl2+))))
08e9daf5
TGR
2632
2633(define-public freefall
2634 (package
2635 (name "freefall")
2636 (version (package-version linux-libre))
2637 (source (package-source linux-libre))
2638 (build-system gnu-build-system)
2639 (arguments
2640 '(#:phases (modify-phases %standard-phases
2641 (add-after 'unpack 'enter-subdirectory
2642 (lambda _
2643 (chdir "tools/laptop/freefall")))
2644 (delete 'configure)
2645 (add-before 'build 'increase-timeout
2646 (lambda _
2647 ;; The default of 2 seconds is too low: it assumes an
2648 ;; open lid and AC power without actually checking.
2649 (substitute* "freefall.c"
2650 (("alarm\\(2\\)") "alarm(5)")))))
2651 #:make-flags (list (string-append "PREFIX="
2652 (assoc-ref %outputs "out")))
2653 #:tests? #f)) ;no tests
2654 (home-page (package-home-page linux-libre))
2655 (synopsis "Free-fall protection for spinning laptop hard drives")
2656 (description
2657 "Prevents shock damage to the internal spinning hard drive(s) of some
2658HP and Dell laptops. When sudden movement is detected, all input/output
2659operations on the drive are suspended and its heads are parked on the ramp,
2660where they are less likely to cause damage to the spinning disc. Requires a
2661drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
2662feature, and a laptop with an accelerometer. It has no effect on SSDs.")
2663 (license license:gpl2)))
d17ae8c0
NG
2664
2665(define-public thinkfan
2666 (package
2667 (name "thinkfan")
2668 (version "0.9.3")
2669 (source (origin
2670 (method url-fetch)
2671 (uri (string-append "mirror://sourceforge/thinkfan/"
de67e922 2672 "/thinkfan-" version ".tar.gz"))
d17ae8c0
NG
2673 (sha256
2674 (base32
2675 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
2676 (modules '((guix build utils)))
2677 ;; Fix erroneous man page location in Makefile leading to
2678 ;; a compilation failure.
2679 (snippet
2680 '(substitute* "CMakeLists.txt"
2681 (("thinkfan\\.1") "src/thinkfan.1")))))
2682 (build-system cmake-build-system)
2683 (arguments
2684 `(#:modules ((guix build cmake-build-system)
2685 (guix build utils)
2686 (srfi srfi-26))
2687 #:tests? #f ;no test target
2688 #:configure-flags
2689 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
2690 `("-DUSE_ATASMART:BOOL=ON")
2691 #:phases
2692 (modify-phases %standard-phases
75e56aed
NG
2693 ;; Install scripts for various foreign init systems. Also fix
2694 ;; hard-coded path for daemon.
d17ae8c0
NG
2695 (add-after 'install 'install-rc-scripts
2696 (lambda* (#:key outputs #:allow-other-keys)
75e56aed
NG
2697 (let ((out (assoc-ref outputs "out"))
2698 (files (find-files
2699 (string-append "../thinkfan-" ,version "/rcscripts")
2700 ".*")))
2701 (substitute* files
2702 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
2703 (string-append out "/sbin/" name)))
2704 (for-each (cute install-file <>
2705 (string-append out "/share/thinkfan"))
2706 files))
d17ae8c0
NG
2707 #t)))))
2708 (inputs
2709 `(("libatasmart" ,libatasmart)))
2710 (home-page "http://thinkfan.sourceforge.net/")
2711 (synopsis "Simple fan control program")
2712 (description
2713 "Thinkfan is a simple fan control program. It reads temperatures,
2714checks them against configured limits and switches to appropriate (also
2715pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
2716other @code{hwmon} driver that enables temperature reading and fan control
2717from userspace.")
2718 (license license:gpl3+)))
91231156
LC
2719
2720(define-public ntfs-3g
2721 (package
2722 (name "ntfs-3g")
2723 (version "2016.2.22")
2724 (source (origin
2725 (method url-fetch)
2726 (uri (string-append "https://tuxera.com/opensource/"
2727 "ntfs-3g_ntfsprogs-" version ".tgz"))
2728 (sha256
2729 (base32
2730 "180y5y09h30ryf2vim8j30a2npwz1iv9ly5yjmh3wjdkwh2jrdyp"))
2731 (modules '((guix build utils)))
2732 (snippet
2733 ;; Install under $prefix.
2734 '(substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
2735 (("/sbin")
2736 "@sbindir@")))))
2737 (build-system gnu-build-system)
2738 (inputs `(("util-linux" ,util-linux)
2739 ("fuse" ,fuse))) ;libuuid
2740 (native-inputs `(("pkg-config" ,pkg-config)))
2741 (arguments
2742 '(#:configure-flags (list "--exec-prefix=${prefix}"
2743 "--with-fuse=external" ;use our own FUSE
2744 "--enable-mount-helper"
2745 "--enable-posix-acls"
2746 "--enable-xattr-mappings")))
2747 (home-page "http://www.tuxera.com/community/open-source-ntfs-3g/")
2748 (synopsis "Read-write access to NTFS file systems")
2749 (description
2750 "NTFS-3G provides read-write access to NTFS file systems, which are
2751commonly found on Microsoft Windows. It is implemented as a FUSE file system.
2752The package provides additional NTFS tools.")
2753 (license license:gpl2+)))
9b0942c1
DC
2754
2755(define-public rng-tools
2756 (package
2757 (name "rng-tools")
2758 (version "5")
2759 (source (origin
2760 (method url-fetch)
2761 (uri (string-append
2762 "http://downloads.sourceforge.net/sourceforge/gkernel/"
2763 "rng-tools-" version ".tar.gz"))
2764 (sha256
2765 (base32
2766 "13h7lc8wl9khhvkr0i3bl5j9bapf8anhqis1lcnwxg1vc2v058b0"))))
2767 (build-system gnu-build-system)
2768 (synopsis "Random number generator daemon")
2769 (description
2770 "Monitor a hardware random number generator, and supply entropy
2771from that to the system kernel's @file{/dev/random} machinery.")
2772 (home-page "http://sourceforge.net/projects/gkernel")
2773 ;; The source package is offered under the GPL2+, but the files
2774 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
2775 (license (list license:gpl2 license:gpl2+))))
58d6a1f2
TGR
2776
2777(define-public cpupower
2778 (package
2779 (name "cpupower")
2780 (version (package-version linux-libre))
2781 (source (package-source linux-libre))
2782 (build-system gnu-build-system)
2783 (arguments
2784 '(#:phases (modify-phases %standard-phases
2785 (add-after 'unpack 'enter-subdirectory
2786 (lambda _
2787 (chdir "tools/power/cpupower")))
2788 (delete 'configure)
2789 (add-before 'build 'fix-makefiles
2790 (lambda _
2791 (substitute* "Makefile"
2792 (("/usr/") "/")
2793 (("/bin/(install|pwd)" _ command) command))
2794 (substitute* "bench/Makefile"
2795 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
2796 #:make-flags (let ((out (assoc-ref %outputs "out")))
2797 (list (string-append "DESTDIR=" out)
2798 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
2799 "docdir=/share/doc/cpupower"
2800 "confdir=$(docdir)/examples"
2801 ;; The Makefile recommends the following changes
2802 "DEBUG=false"
2803 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
2804 #:tests? #f)) ;no tests
2805 (native-inputs `(("gettext" ,gnu-gettext)))
2806 (inputs `(("pciutils" ,pciutils)))
2807 (home-page (package-home-page linux-libre))
2808 (synopsis "CPU frequency and voltage scaling tools for Linux")
2809 (description
2810 "cpupower is a set of user-space tools that use the cpufreq feature of the
2811Linux kernel to retrieve and control processor features related to power saving,
2812such as frequency and voltage scaling.")
2813 (license license:gpl2)))
2b76f135
TGR
2814
2815(define-public haveged
2816 (package
2817 (name "haveged")
2818 (version "1.9.1")
2819 (source
2820 (origin
2821 (method url-fetch)
2822 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
2823 version ".tar.gz"))
2824 (sha256
2825 (base32
2826 "059pxlfd4l5dqhd6r3lynzfz4wby2f17294fy17pi9j2jpnn68ww"))))
2827 (build-system gnu-build-system)
2828 (home-page "http://www.issihosts.com/haveged")
2829 (synopsis "Entropy source for the Linux random number generator")
2830 (description
2831 "haveged generates an unpredictable stream of random numbers for use by
2832Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
2833standard mechanisms for filling the entropy pool may not be sufficient for
2834systems with high needs or limited user interaction, such as headless servers.
2835@command{haveged} runs as a privileged daemon, harvesting randomness from the
2836indirect effects of hardware events on hidden processor state using the HArdware
2837Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
2838its environment and provides the same built-in test suite for the output stream
2839as used on certified hardware security devices.")
2840 (license (list (license:non-copyleft "file://nist/mconf.h")
2841 (license:non-copyleft "file://nist/packtest.c")
2842 license:public-domain ; nist/dfft.c
2843 license:gpl3+)))) ; everything else
e385e957
TGR
2844
2845(define-public ecryptfs-utils
2846 (package
2847 (name "ecryptfs-utils")
2848 (version "111")
2849 (source
2850 (origin
2851 (method url-fetch)
2852 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
2853 version "/+download/ecryptfs-utils_"
2854 version ".orig.tar.gz"))
2855 (sha256
2856 (base32
2857 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
2858 (build-system gnu-build-system)
2859 (arguments
2860 `(#:configure-flags (list "--disable-pywrap")))
2861 (native-inputs
2862 `(("intltool" ,intltool)
2863 ("perl" ,perl) ; for pod2man
2864 ("pkg-config" ,pkg-config)))
2865 (inputs
2866 `(("keyutils" ,keyutils)
2867 ("linux-pam" ,linux-pam)
2868 ("nss" ,nss)))
2869 (home-page "http://ecryptfs.org/")
2870 (synopsis "eCryptfs cryptographic file system utilities")
2871 (description
2872 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
2873Each file's cryptographic meta-data is stored inside the file itself, along
2874with the encrypted contents. This allows individual encrypted files to be
2875copied between hosts and still be decrypted with the proper key. eCryptfs is a
2876native Linux file system, and has been part of the Linux kernel since version
28772.6.19. This package contains the userland utilities to manage it.")
2878 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
2879 ;; grant additional permission to link with OpenSSL.
2880 (license license:gpl2+)))
cff0adec
DC
2881
2882(define-public libnfsidmap
2883 (package
2884 (name "libnfsidmap")
2885 (version "0.25")
2886 (source (origin
2887 (method url-fetch)
2888 (uri (string-append
2889 "http://www.citi.umich.edu/projects/nfsv4/linux/"
2890 name "/" name "-" version ".tar.gz"))
2891 (sha256
2892 (base32
2893 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
2894 (build-system gnu-build-system)
2895 (arguments
2896 `(#:configure-flags (list
2897 (string-append "--with-pluginpath="
2898 (assoc-ref %outputs "out")
2899 "/lib/libnfsidmap"))))
2900 (home-page
2901 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
2902 (synopsis
2903 "NFSv4 support library for name/ID mapping")
2904 (description "Libnfsidmap is a library holding mulitiple methods of
2905mapping names to ids and visa versa, mainly for NFSv4. It provides an
2906extensible array of mapping functions, currently consisting of two choices:
2907the default @code{nsswitch} and the experimental @code{umich_ldap}.")
2908 (license (license:non-copyleft "file://COPYING"
2909 "See COPYING in the distribution."))))
035d3593
DC
2910
2911(define-public module-init-tools
2912 (package
2913 (name "module-init-tools")
2914 (version "3.16")
2915 (source (origin
2916 (method url-fetch)
2917 (uri (string-append
2918 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
2919 "module-init-tools-" version ".tar.bz2"))
2920 (sha256
2921 (base32
2922 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
2923 (patches (search-patches "module-init-tools-moduledir.patch"))))
2924 (build-system gnu-build-system)
2925 (arguments
2926 ;; FIXME: The upstream tarball lacks man pages, and building them would
2927 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
2928 ;; but they vanished. In the meantime, fake it.
2929 '(#:phases (alist-cons-before
2930 'configure 'fake-docbook
2931 (lambda _
2932 (substitute* "Makefile.in"
2933 (("^DOCBOOKTOMAN.*$")
2934 "DOCBOOKTOMAN = true\n")))
2935 %standard-phases)))
2936 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
2937 (synopsis "Tools for loading and managing Linux kernel modules")
2938 (description
2939 "Tools for loading and managing Linux kernel modules, such as `modprobe',
2940`insmod', `lsmod', and more.")
2941 (license license:gpl2+)))
dd65f3b7
TGR
2942
2943(define-public mcelog
2944 (package
2945 (name "mcelog")
2946 (version "141")
2947 (source (origin
2948 (method url-fetch)
2949 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
2950 "mcelog.git/snapshot/v" version ".tar.gz"))
2951 (sha256
2952 (base32
2953 "0ws8blq0prj7slcaljyaxxq20kgmlakzac0ri1pvh24xs1jn2xxg"))
2954 (file-name (string-append name "-" version ".tar.gz"))
2955 (modules '((guix build utils)))
2956 (snippet
2957 ;; The snapshots lack a .git directory, breaking ‘git describe’.
2958 `(substitute* "Makefile"
2959 (("\"unknown\"") (string-append "\"v" ,version "\""))))))
2960 (build-system gnu-build-system)
2961 (arguments
2962 `(#:phases (modify-phases %standard-phases
2963 (delete 'configure)) ; no configure script
2964 #:make-flags (let ((out (assoc-ref %outputs "out")))
2965 (list "CC=gcc"
2966 (string-append "prefix=" out)
2967 (string-append "DOCDIR=" out "/share/doc/mcelog")
2968 "etcprefix=$(DOCDIR)/examples"))
2969 ;; The tests will only run as root on certain supported CPU models.
2970 #:tests? #f))
2971 (supported-systems (list "i686-linux" "x86_64-linux"))
2972 (home-page "http://mcelog.org/")
2973 (synopsis "Machine check monitor for x86 Linux systems")
2974 (description
2975 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
2976and other hardware errors on x86 systems. It can also perform user-defined
2977tasks, such as bringing bad pages off-line, when configurable error thresholds
2978are exceeded.")
2979 (license license:gpl2)))