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