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