gnu: Add rtl8821ce-linux-module.
[jackhill/guix/guix.git] / gnu / packages / linux.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
5 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
7 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
8 ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
10 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com>
12 ;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org>
13 ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
14 ;;; Copyright © 2016, 2018, 2019, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
15 ;;; Copyright © 2016, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
16 ;;; Copyright © 2016 David Craven <david@craven.ch>
17 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
18 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
19 ;;; Copyright © 2016, 2018 Rene Saavedra <pacoon@protonmail.com>
20 ;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
21 ;;; Copyright © 2016, 2017 ng0 <ng0@n0.is>
22 ;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
23 ;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
24 ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
25 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
26 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
27 ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
28 ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
29 ;;; Copyright © 2017 Dave Love <fx@gnu.org>
30 ;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
31 ;;; Copyright © 2018, 2020 Brendan Tildesley <mail@brendan.scot>
32 ;;; Copyright © 2018 Manuel Graf <graf@init.at>
33 ;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
34 ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
35 ;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
36 ;;; Copyright © 2019, 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
37 ;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com>
38 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
39 ;;; Copyright © 2019, 2020 Brice Waegeneire <brice@waegenei.re>
40 ;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
41 ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
42 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
43 ;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
44 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
45 ;;;
46 ;;; This file is part of GNU Guix.
47 ;;;
48 ;;; GNU Guix is free software; you can redistribute it and/or modify it
49 ;;; under the terms of the GNU General Public License as published by
50 ;;; the Free Software Foundation; either version 3 of the License, or (at
51 ;;; your option) any later version.
52 ;;;
53 ;;; GNU Guix is distributed in the hope that it will be useful, but
54 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
55 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
56 ;;; GNU General Public License for more details.
57 ;;;
58 ;;; You should have received a copy of the GNU General Public License
59 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
60
61 (define-module (gnu packages linux)
62 #:use-module (gnu packages)
63 #:use-module (gnu packages acl)
64 #:use-module (gnu packages admin)
65 #:use-module (gnu packages algebra)
66 #:use-module (gnu packages attr)
67 #:use-module (gnu packages audio)
68 #:use-module (gnu packages autotools)
69 #:use-module (gnu packages backup)
70 #:use-module (gnu packages base)
71 #:use-module (gnu packages bash)
72 #:use-module (gnu packages bison)
73 #:use-module (gnu packages calendar)
74 #:use-module (gnu packages check)
75 #:use-module (gnu packages crypto)
76 #:use-module (gnu packages cryptsetup)
77 #:use-module (gnu packages compression)
78 #:use-module (gnu packages dbm)
79 #:use-module (gnu packages datastructures)
80 #:use-module (gnu packages docbook)
81 #:use-module (gnu packages documentation)
82 #:use-module (gnu packages elf)
83 #:use-module (gnu packages flex)
84 #:use-module (gnu packages file)
85 #:use-module (gnu packages freedesktop)
86 #:use-module (gnu packages gcc)
87 #:use-module (gnu packages gettext)
88 #:use-module (gnu packages glib)
89 #:use-module (gnu packages golang)
90 #:use-module (gnu packages gperf)
91 #:use-module (gnu packages gstreamer)
92 #:use-module (gnu packages gtk)
93 #:use-module (gnu packages haskell-apps)
94 #:use-module (gnu packages haskell-xyz)
95 #:use-module (gnu packages libunwind)
96 #:use-module (gnu packages libusb)
97 #:use-module (gnu packages man)
98 #:use-module (gnu packages maths)
99 #:use-module (gnu packages multiprecision)
100 #:use-module (gnu packages ncurses)
101 #:use-module (gnu packages netpbm)
102 #:use-module (gnu packages networking)
103 #:use-module (gnu packages ninja)
104 #:use-module (gnu packages nss)
105 #:use-module (gnu packages perl)
106 #:use-module (gnu packages pciutils)
107 #:use-module (gnu packages pkg-config)
108 #:use-module (gnu packages popt)
109 #:use-module (gnu packages pulseaudio)
110 #:use-module (gnu packages python)
111 #:use-module (gnu packages python-xyz)
112 #:use-module (gnu packages readline)
113 #:use-module (gnu packages rrdtool)
114 #:use-module (gnu packages samba)
115 #:use-module (gnu packages sdl)
116 #:use-module (gnu packages serialization)
117 #:use-module (gnu packages slang)
118 #:use-module (gnu packages texinfo)
119 #:use-module (gnu packages tls)
120 #:use-module (gnu packages valgrind)
121 #:use-module (gnu packages video)
122 #:use-module (gnu packages web)
123 #:use-module (gnu packages xiph)
124 #:use-module (gnu packages xml)
125 #:use-module (gnu packages xdisorg)
126 #:use-module (gnu packages xorg)
127 #:use-module (gnu packages groff)
128 #:use-module (gnu packages rsync)
129 #:use-module (gnu packages selinux)
130 #:use-module (gnu packages swig)
131 #:use-module (guix build-system cmake)
132 #:use-module (guix build-system gnu)
133 #:use-module (guix build-system go)
134 #:use-module (guix build-system meson)
135 #:use-module (guix build-system python)
136 #:use-module (guix build-system trivial)
137 #:use-module (guix build-system linux-module)
138 #:use-module (guix download)
139 #:use-module (guix git-download)
140 #:use-module ((guix licenses) #:prefix license:)
141 #:use-module (guix packages)
142 #:use-module (guix gexp)
143 #:use-module (guix store)
144 #:use-module (guix monads)
145 #:use-module (guix utils)
146 #:use-module (srfi srfi-1)
147 #:use-module (srfi srfi-2)
148 #:use-module (srfi srfi-26)
149 #:use-module (ice-9 match))
150
151 (define-public (system->linux-architecture arch)
152 "Return the Linux architecture name for ARCH, a Guix system name such as
153 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
154 (let ((arch (car (string-split arch #\-))))
155 (cond ((string=? arch "i686") "i386")
156 ((string-prefix? "mips" arch) "mips")
157 ((string-prefix? "arm" arch) "arm")
158 ((string-prefix? "aarch64" arch) "arm64")
159 ((string-prefix? "alpha" arch) "alpha")
160 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
161 ((string-prefix? "s390" arch) "s390")
162 ((string-prefix? "riscv" arch) "riscv")
163 (else arch))))
164
165 (define-public (system->defconfig system)
166 "Some systems (notably powerpc-linux) require a special target for kernel
167 defconfig. Return the appropriate make target if applicable, otherwise return
168 \"defconfig\"."
169 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
170 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
171 (else "defconfig")))
172
173 \f
174 ;;;
175 ;;; Kernel source code deblobbing.
176 ;;;
177
178 (define (linux-libre-deblob-scripts version
179 deblob-hash
180 deblob-check-hash)
181 (list (version-major+minor version)
182 (origin
183 (method url-fetch)
184 (uri (string-append "https://linux-libre.fsfla.org"
185 "/pub/linux-libre/releases/" version "-gnu/"
186 "deblob-" (version-major+minor version)))
187 (sha256 deblob-hash))
188 (origin
189 (method url-fetch)
190 (uri (string-append "https://linux-libre.fsfla.org"
191 "/pub/linux-libre/releases/" version "-gnu/"
192 "deblob-check"))
193 (sha256 deblob-check-hash))))
194
195 (define deblob-scripts-5.6
196 (linux-libre-deblob-scripts
197 "5.6.7"
198 (base32 "196fdbfy1f8zbmnv0ik720snig2bacsh7hfyvgbmlsfk3cil2zgv")
199 (base32 "1g0bi3c8xzy1vz6w1xbpkb3a26bqn9d1yphcqz2ki4aikra81wid")))
200
201 (define deblob-scripts-5.4
202 (linux-libre-deblob-scripts
203 "5.4.37"
204 (base32 "0ckxn7k5zgcqk30dq943bnamr6a6zjbw2aqjl3x30f4kvh5f6k25")
205 (base32 "10qb890is4z58vr8czh3xx69q62l3b3j38y410kgiw8nii3zx5lr")))
206
207 (define deblob-scripts-4.19
208 (linux-libre-deblob-scripts
209 "4.19.103"
210 (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy")
211 (base32 "1w2wgxblpq09i33qmqgw5v3r5rm9vkkygr6m0sgv4zgczk9s29wr")))
212
213 (define deblob-scripts-4.14
214 (linux-libre-deblob-scripts
215 "4.14.170"
216 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
217 (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky")))
218
219 (define deblob-scripts-4.9
220 (linux-libre-deblob-scripts
221 "4.9.213"
222 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
223 (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2")))
224
225 (define deblob-scripts-4.4
226 (linux-libre-deblob-scripts
227 "4.4.213"
228 (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw")
229 (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf")))
230
231 (define* (computed-origin-method gexp-promise hash-algo hash
232 #:optional (name "source")
233 #:key (system (%current-system))
234 (guile (default-guile)))
235 "Return a derivation that executes the G-expression that results
236 from forcing GEXP-PROMISE."
237 (mlet %store-monad ((guile (package->derivation guile system)))
238 (gexp->derivation (or name "computed-origin")
239 (force gexp-promise)
240 #:graft? #f ;nothing to graft
241 #:system system
242 #:guile-for-build guile)))
243
244 (define (make-linux-libre-source version
245 upstream-source
246 deblob-scripts)
247 "Return a 'computed' origin that generates a Linux-libre tarball from the
248 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
249 (match deblob-scripts
250 ((deblob-version (? origin? deblob) (? origin? deblob-check))
251 (unless (string=? deblob-version (version-major+minor version))
252 ;; The deblob script cannot be expected to work properly on a
253 ;; different version (major+minor) of Linux, even if no errors
254 ;; are signaled during execution.
255 (error "deblob major+minor version mismatch"))
256 (origin
257 (method computed-origin-method)
258 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
259 (sha256 #f)
260 (uri
261 (delay
262 (with-imported-modules '((guix build utils))
263 #~(begin
264 (use-modules (guix build utils)
265 (srfi srfi-1)
266 (ice-9 match)
267 (ice-9 ftw))
268 (let ((dir (string-append "linux-" #$version)))
269
270 (mkdir "/tmp/bin")
271 (set-path-environment-variable
272 "PATH" '("bin")
273 (list "/tmp"
274 #+(canonical-package bash)
275 #+(canonical-package coreutils)
276 #+(canonical-package diffutils)
277 #+(canonical-package findutils)
278 #+(canonical-package patch)
279 #+(canonical-package xz)
280 #+(canonical-package sed)
281 #+(canonical-package grep)
282 #+(canonical-package bzip2)
283 #+(canonical-package gzip)
284 #+(canonical-package tar)
285 ;; The comments in the 'deblob-check' script
286 ;; claim that it supports Python 2 and 3, but
287 ;; in fact it fails when run in Python 3 as
288 ;; of version 5.1.3.
289 #+python-2))
290
291 (with-directory-excursion "/tmp/bin"
292
293 (copy-file #+deblob "deblob")
294 (chmod "deblob" #o755)
295 (substitute* "deblob"
296 (("/bin/sh") (which "sh")))
297
298 (copy-file #+deblob-check "deblob-check")
299 (chmod "deblob-check" #o755)
300 (substitute* "deblob-check"
301 (("/bin/sh") (which "sh"))
302 (("/bin/sed") (which "sed"))
303 (("/usr/bin/python") (which "python"))))
304
305 (if (file-is-directory? #+upstream-source)
306 (begin
307 (format #t "Copying upstream linux source...~%")
308 (force-output)
309 (invoke "cp" "--archive" #+upstream-source dir)
310 (invoke "chmod" "--recursive" "u+w" dir))
311 (begin
312 (format #t "Unpacking upstream linux tarball...~%")
313 (force-output)
314 (invoke "tar" "xf" #$upstream-source)
315 (match (scandir "."
316 (lambda (name)
317 (and (not (member name '("." "..")))
318 (file-is-directory? name))))
319 ((unpacked-dir)
320 (unless (string=? dir unpacked-dir)
321 (rename-file unpacked-dir dir)))
322 (dirs
323 (error "multiple directories found" dirs)))))
324
325 (with-directory-excursion dir
326 (setenv "PYTHON" (which "python"))
327 (format #t "Running deblob script...~%")
328 (force-output)
329 (invoke "/tmp/bin/deblob"))
330
331 (format #t "~%Packing new Linux-libre tarball...~%")
332 (force-output)
333 (invoke "tar" "cvfa" #$output
334 ;; Avoid non-determinism in the archive.
335 "--mtime=@0"
336 "--owner=root:0"
337 "--group=root:0"
338 "--sort=name"
339 "--hard-dereference"
340 dir))))))))))
341
342 \f
343 ;;;
344 ;;; Kernel sources.
345 ;;;
346
347 (define (linux-libre-urls version)
348 "Return a list of URLs for Linux-Libre VERSION."
349 (list (string-append
350 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
351 version "-gnu/linux-libre-" version "-gnu.tar.xz")
352
353 ;; XXX: Work around <http://bugs.gnu.org/14851>.
354 (string-append
355 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
356 version "-gnu.tar.xz")
357
358 ;; Maybe this URL will become valid eventually.
359 (string-append
360 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
361 version "-gnu.tar.xz")))
362
363 (define (%upstream-linux-source version hash)
364 (origin
365 (method url-fetch)
366 (uri (string-append "mirror://kernel.org"
367 "/linux/kernel/v" (version-major version) ".x/"
368 "linux-" version ".tar.xz"))
369 (sha256 hash)))
370
371
372 (define-public linux-libre-5.6-version "5.6.11")
373 (define-public linux-libre-5.6-pristine-source
374 (let ((version linux-libre-5.6-version)
375 (hash (base32 "1ahv4a3mnszqs3qcnwmhbvjgis1jg37anj5jvn70i7s2k6z6rpfn")))
376 (make-linux-libre-source version
377 (%upstream-linux-source version hash)
378 deblob-scripts-5.6)))
379
380 (define-public linux-libre-5.4-version "5.4.39")
381 (define-public linux-libre-5.4-pristine-source
382 (let ((version linux-libre-5.4-version)
383 (hash (base32 "1j35yf1nilb9z7lw8w2drpww7q2zy8zfr0ip8hwcbcd7c5d9chai")))
384 (make-linux-libre-source version
385 (%upstream-linux-source version hash)
386 deblob-scripts-5.4)))
387
388 (define-public linux-libre-4.19-version "4.19.121")
389 (define-public linux-libre-4.19-pristine-source
390 (let ((version linux-libre-4.19-version)
391 (hash (base32 "11bhjdaihhc42xhf4qxdkkjznc0i6igh0ahjbzr3fb8bmq9sirgv")))
392 (make-linux-libre-source version
393 (%upstream-linux-source version hash)
394 deblob-scripts-4.19)))
395
396 (define-public linux-libre-4.14-version "4.14.179")
397 (define-public linux-libre-4.14-pristine-source
398 (let ((version linux-libre-4.14-version)
399 (hash (base32 "10arrj3ppbxkn15yxqpxlz4k8yp2afzbfpp2nwfy6klhjiffp9sx")))
400 (make-linux-libre-source version
401 (%upstream-linux-source version hash)
402 deblob-scripts-4.14)))
403
404 (define-public linux-libre-4.9-version "4.9.222")
405 (define-public linux-libre-4.9-pristine-source
406 (let ((version linux-libre-4.9-version)
407 (hash (base32 "0aajgflf96bj7chbd83rdmgcdwd025c6mz6li4cwbfx7xcb91kjc")))
408 (make-linux-libre-source version
409 (%upstream-linux-source version hash)
410 deblob-scripts-4.9)))
411
412 (define-public linux-libre-4.4-version "4.4.222")
413 (define-public linux-libre-4.4-pristine-source
414 (let ((version linux-libre-4.4-version)
415 (hash (base32 "02zxy5vjxgrqs0mkz5aj70v6pazhif7x5cm26rf8zh4idpmhk2zh")))
416 (make-linux-libre-source version
417 (%upstream-linux-source version hash)
418 deblob-scripts-4.4)))
419
420 (define %boot-logo-patch
421 ;; Linux-Libre boot logo featuring Freedo and a gnu.
422 (origin
423 (method url-fetch)
424 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
425 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
426 (sha256
427 (base32
428 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
429
430 (define %linux-libre-arm-export-__sync_icache_dcache-patch
431 (origin
432 (method url-fetch)
433 (uri (string-append
434 "https://salsa.debian.org/kernel-team/linux"
435 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
436 "/debian/patches/bugfix/arm/"
437 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
438 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
439 (sha256
440 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
441
442 (define (source-with-patches source patches)
443 (origin
444 (inherit source)
445 (patches (append (origin-patches source)
446 patches))))
447
448 (define-public linux-libre-5.6-source
449 (source-with-patches linux-libre-5.6-pristine-source
450 (list %boot-logo-patch
451 %linux-libre-arm-export-__sync_icache_dcache-patch
452 ;; Pinebook Pro patch from linux-next,
453 ;; can be dropped for linux-libre 5.7
454 (search-patch
455 "linux-libre-support-for-Pinebook-Pro.patch"))))
456
457 (define-public linux-libre-5.4-source
458 (source-with-patches linux-libre-5.4-pristine-source
459 (list %boot-logo-patch
460 %linux-libre-arm-export-__sync_icache_dcache-patch
461 ;; Pinebook Pro patch from linux-next,
462 ;; can be dropped for linux-libre 5.7
463 (search-patch
464 "linux-libre-support-for-Pinebook-Pro.patch"))))
465
466 (define-public linux-libre-4.19-source
467 (source-with-patches linux-libre-4.19-pristine-source
468 (list %boot-logo-patch
469 %linux-libre-arm-export-__sync_icache_dcache-patch)))
470
471 (define-public linux-libre-4.14-source
472 (source-with-patches linux-libre-4.14-pristine-source
473 (list %boot-logo-patch)))
474
475 (define-public linux-libre-4.9-source
476 (source-with-patches linux-libre-4.9-pristine-source
477 (list %boot-logo-patch)))
478
479 (define-public linux-libre-4.4-source
480 (source-with-patches linux-libre-4.4-pristine-source
481 (list %boot-logo-patch)))
482
483 \f
484 ;;;
485 ;;; Kernel headers.
486 ;;;
487
488 (define (make-linux-libre-headers version hash-string)
489 (make-linux-libre-headers* version
490 (origin
491 (method url-fetch)
492 (uri (linux-libre-urls version))
493 (sha256 (base32 hash-string)))))
494
495 (define (make-linux-libre-headers* version source)
496 (package
497 (name "linux-libre-headers")
498 (version version)
499 (source source)
500 (build-system gnu-build-system)
501 (native-inputs `(("perl" ,perl)
502 ,@(if (version>=? version "4.16")
503 `(("flex" ,flex)
504 ("bison" ,bison))
505 '())
506 ,@(if (version>=? version "5.3")
507 `(("rsync" ,rsync))
508 '())))
509 (arguments
510 `(#:modules ((guix build gnu-build-system)
511 (guix build utils)
512 (srfi srfi-1))
513 #:phases
514 (modify-phases %standard-phases
515 (delete 'configure)
516 (replace 'build
517 (lambda _
518 (let ((arch ,(system->linux-architecture
519 (or (%current-target-system)
520 (%current-system))))
521 (defconfig ,(system->defconfig
522 (or (%current-target-system)
523 (%current-system)))))
524 (setenv "ARCH" arch)
525 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
526 (invoke "make" defconfig)
527 (invoke "make" "mrproper" "headers_check"))))
528 (replace 'install
529 (lambda* (#:key outputs #:allow-other-keys)
530 (let ((out (assoc-ref outputs "out")))
531 (invoke "make"
532 (string-append "INSTALL_HDR_PATH=" out)
533 "headers_install")
534
535 (mkdir (string-append out "/include/config"))
536 (call-with-output-file
537 (string-append out
538 "/include/config/kernel.release")
539 (lambda (p)
540 (format p "~a-default~%" ,version)))
541
542 ;; Remove the '.install' and '..install.cmd' files; the
543 ;; latter contains store paths, which pulls in bootstrap
544 ;; binaries in the build environment, and prevents bit
545 ;; reproducibility for the bootstrap binaries.
546 (for-each delete-file (find-files out "\\.install"))
547
548 #t))))
549 #:allowed-references ()
550 #:tests? #f))
551 (home-page "https://www.gnu.org/software/linux-libre/")
552 (synopsis "GNU Linux-Libre kernel headers")
553 (description "Headers of the Linux-Libre kernel.")
554 (license license:gpl2)))
555
556 (define-public linux-libre-headers-5.6
557 (make-linux-libre-headers* linux-libre-5.6-version
558 linux-libre-5.6-source))
559
560 (define-public linux-libre-headers-5.4
561 (make-linux-libre-headers* linux-libre-5.4-version
562 linux-libre-5.4-source))
563
564 (define-public linux-libre-headers-4.19
565 (make-linux-libre-headers* linux-libre-4.19-version
566 linux-libre-4.19-source))
567
568 (define-public linux-libre-headers-4.14
569 (make-linux-libre-headers* linux-libre-4.14-version
570 linux-libre-4.14-source))
571
572 (define-public linux-libre-headers-4.9
573 (make-linux-libre-headers* linux-libre-4.9-version
574 linux-libre-4.9-source))
575
576 (define-public linux-libre-headers-4.4
577 (make-linux-libre-headers* linux-libre-4.4-version
578 linux-libre-4.4-source))
579
580 ;; The following package is used in the early bootstrap, and thus must be kept
581 ;; stable and with minimal build requirements.
582 (define-public linux-libre-headers-4.19.56
583 (make-linux-libre-headers "4.19.56"
584 "1zqiic55viy065lhnkmhn33sz3bbbr2ykbm5f92yzd8lpc9zl7yx"))
585
586 (define-public linux-libre-headers linux-libre-headers-4.19.56)
587
588 \f
589 ;;;
590 ;;; Kernel configurations.
591 ;;;
592
593 (define* (kernel-config arch #:key variant)
594 "Return the absolute file name of the Linux-Libre build configuration file
595 for ARCH and optionally VARIANT, or #f if there is no such configuration."
596 (let* ((name (string-append (if variant (string-append variant "-") "")
597 (if (string=? "i386" arch) "i686" arch) ".conf"))
598 (file (string-append "linux-libre/" name)))
599 (search-auxiliary-file file)))
600
601 (define %default-extra-linux-options
602 `(;; Some very mild hardening.
603 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
604 ;; All kernels should have NAMESPACES options enabled
605 ("CONFIG_NAMESPACES" . #t)
606 ("CONFIG_UTS_NS" . #t)
607 ("CONFIG_IPC_NS" . #t)
608 ("CONFIG_USER_NS" . #t)
609 ("CONFIG_PID_NS" . #t)
610 ("CONFIG_NET_NS" . #t)
611 ;; Modules required for initrd:
612 ("CONFIG_NET_9P" . m)
613 ("CONFIG_NET_9P_VIRTIO" . m)
614 ("CONFIG_VIRTIO_BLK" . m)
615 ("CONFIG_VIRTIO_NET" . m)
616 ("CONFIG_VIRTIO_PCI" . m)
617 ("CONFIG_VIRTIO_BALLOON" . m)
618 ("CONFIG_VIRTIO_MMIO" . m)
619 ("CONFIG_FUSE_FS" . m)
620 ("CONFIG_CIFS" . m)
621 ("CONFIG_9P_FS" . m)))
622
623 (define (config->string options)
624 (string-join (map (match-lambda
625 ((option . 'm)
626 (string-append option "=m"))
627 ((option . #t)
628 (string-append option "=y"))
629 ((option . #f)
630 (string-append option "=n")))
631 options)
632 "\n"))
633
634 \f
635 ;;;
636 ;;; Kernel package utilities.
637 ;;;
638
639 (define* (make-linux-libre version hash-string supported-systems
640 #:key
641 ;; A function that takes an arch and a variant.
642 ;; See kernel-config for an example.
643 (extra-version #f)
644 (configuration-file #f)
645 (defconfig "defconfig")
646 (extra-options %default-extra-linux-options)
647 (patches (list %boot-logo-patch)))
648 (make-linux-libre* version
649 (origin
650 (method url-fetch)
651 (uri (linux-libre-urls version))
652 (sha256 (base32 hash-string))
653 (patches patches))
654 supported-systems
655 #:extra-version extra-version
656 #:configuration-file configuration-file
657 #:defconfig defconfig
658 #:extra-options extra-options))
659
660 (define* (make-linux-libre* version source supported-systems
661 #:key
662 ;; A function that takes an arch and a variant.
663 ;; See kernel-config for an example.
664 (extra-version #f)
665 (configuration-file #f)
666 (defconfig "defconfig")
667 (extra-options %default-extra-linux-options))
668 (package
669 (name (if extra-version
670 (string-append "linux-libre-" extra-version)
671 "linux-libre"))
672 (version version)
673 (source source)
674 (supported-systems supported-systems)
675 (build-system gnu-build-system)
676 (native-inputs
677 `(("perl" ,perl)
678 ("bc" ,bc)
679 ("openssl" ,openssl)
680 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
681 ("flex" ,flex)
682 ("bison" ,bison)
683
684 ;; These are needed to compile the GCC plugins.
685 ("gmp" ,gmp)
686 ("mpfr" ,mpfr)
687 ("mpc" ,mpc)
688
689 ,@(match (and configuration-file
690 (configuration-file
691 (system->linux-architecture
692 (or (%current-target-system) (%current-system)))
693 #:variant (version-major+minor version)))
694 (#f ;no config for this platform
695 '())
696 ((? string? config)
697 `(("kconfig" ,config))))))
698 (arguments
699 `(#:modules ((guix build gnu-build-system)
700 (guix build utils)
701 (srfi srfi-1)
702 (srfi srfi-26)
703 (ice-9 ftw)
704 (ice-9 match))
705 #:phases
706 (modify-phases %standard-phases
707 (add-after 'unpack 'patch-/bin/pwd
708 (lambda _
709 (substitute* (find-files "." "^Makefile(\\.include)?$")
710 (("/bin/pwd") "pwd"))
711 #t))
712 (replace 'configure
713 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
714 ;; On AArch64 (at least), we need to remove glibc headers from
715 ;; CPATH (they are still available as "system headers"), so that
716 ;; the kernel can override uint64_t. See
717 ;; <https://bugs.gnu.org/37593>. This is also true when
718 ;; cross-compiling, except in that case, cross-libc must be
719 ;; removed from CROSS_CPATH.
720 (let ((var ,(if (%current-target-system)
721 "CROSS_CPATH"
722 "CPATH"))
723 (libc ,(if (%current-target-system)
724 "cross-libc"
725 "libc")))
726 (setenv var
727 (string-join
728 (remove
729 (cut string-prefix? (assoc-ref inputs libc) <>)
730 (string-split (getenv var) #\:))
731 ":"))
732 (format #t "environment variable `~a' changed to `~a'~%"
733 var (getenv var)))
734
735 ;; Avoid introducing timestamps
736 (setenv "KCONFIG_NOTIMESTAMP" "1")
737 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
738
739 ;; Set ARCH and CROSS_COMPILE
740 (let ((arch ,(system->linux-architecture
741 (or (%current-target-system)
742 (%current-system)))))
743 (setenv "ARCH" arch)
744 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
745
746 (when target
747 (setenv "CROSS_COMPILE" (string-append target "-"))
748 (format #t "`CROSS_COMPILE' set to `~a'~%"
749 (getenv "CROSS_COMPILE"))))
750
751 (setenv "EXTRA_VERSION" ,extra-version)
752
753 (let ((build (assoc-ref %standard-phases 'build))
754 (config (assoc-ref (or native-inputs inputs) "kconfig")))
755
756 ;; Use a custom kernel configuration file or a default
757 ;; configuration file.
758 (if config
759 (begin
760 (copy-file config ".config")
761 (chmod ".config" #o666))
762 (invoke "make" ,defconfig))
763
764 ;; Appending works even when the option wasn't in the
765 ;; file. The last one prevails if duplicated.
766 (let ((port (open-file ".config" "a"))
767 (extra-configuration ,(config->string extra-options)))
768 (display extra-configuration port)
769 (close-port port))
770
771 (invoke "make" "oldconfig"))))
772 (replace 'install
773 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
774 (let* ((out (assoc-ref outputs "out"))
775 (moddir (string-append out "/lib/modules"))
776 (dtbdir (string-append out "/lib/dtbs")))
777 ;; Install kernel image, kernel configuration and link map.
778 (for-each (lambda (file) (install-file file out))
779 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
780 ;; Install device tree files
781 (unless (null? (find-files "." "\\.dtb$"))
782 (mkdir-p dtbdir)
783 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
784 "dtbs_install"))
785 ;; Install kernel modules
786 (mkdir-p moddir)
787 (invoke "make"
788 ;; Disable depmod because the Guix system's module directory
789 ;; is an union of potentially multiple packages. It is not
790 ;; possible to use depmod to usefully calculate a dependency
791 ;; graph while building only one of those packages.
792 "DEPMOD=true"
793 (string-append "MODULE_DIR=" moddir)
794 (string-append "INSTALL_PATH=" out)
795 (string-append "INSTALL_MOD_PATH=" out)
796 "INSTALL_MOD_STRIP=1"
797 "modules_install")
798 (let* ((versions (filter (lambda (name)
799 (not (string-prefix? "." name)))
800 (scandir moddir)))
801 (version (match versions
802 ((x) x))))
803 ;; There are symlinks to the build and source directory,
804 ;; both of which will point to target /tmp/guix-build*
805 ;; and thus not be useful in a profile. Delete the symlinks.
806 (false-if-file-not-found
807 (delete-file (string-append moddir "/" version "/build")))
808 (false-if-file-not-found
809 (delete-file (string-append moddir "/" version "/source"))))
810 #t))))
811 #:tests? #f))
812 (home-page "https://www.gnu.org/software/linux-libre/")
813 (synopsis "100% free redistribution of a cleaned Linux kernel")
814 (description
815 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
816 It has been modified to remove all non-free binary blobs.")
817 (license license:gpl2)))
818
819 \f
820 ;;;
821 ;;; Generic kernel packages.
822 ;;;
823
824 (define-public linux-libre-5.4
825 (make-linux-libre* linux-libre-5.4-version
826 linux-libre-5.4-source
827 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
828 #:configuration-file kernel-config))
829
830 (define-public linux-libre-version linux-libre-5.4-version)
831 (define-public linux-libre-pristine-source linux-libre-5.4-pristine-source)
832 (define-public linux-libre-source linux-libre-5.4-source)
833 (define-public linux-libre linux-libre-5.4)
834
835 (define-public linux-libre-4.19
836 (make-linux-libre* linux-libre-4.19-version
837 linux-libre-4.19-source
838 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
839 #:configuration-file kernel-config))
840
841 (define-public linux-libre-4.14
842 (make-linux-libre* linux-libre-4.14-version
843 linux-libre-4.14-source
844 '("x86_64-linux" "i686-linux" "armhf-linux")
845 #:configuration-file kernel-config))
846
847 (define-public linux-libre-4.9
848 (make-linux-libre* linux-libre-4.9-version
849 linux-libre-4.9-source
850 '("x86_64-linux" "i686-linux")
851 #:configuration-file kernel-config))
852
853 (define-public linux-libre-4.4
854 (make-linux-libre* linux-libre-4.4-version
855 linux-libre-4.4-source
856 '("x86_64-linux" "i686-linux")
857 #:configuration-file kernel-config
858 #:extra-options
859 (append
860 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
861 ;; This option was removed upstream in version 4.7.
862 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
863 %default-extra-linux-options)))
864
865 \f
866 ;;;
867 ;;; Specialized kernel variants.
868 ;;;
869
870 (define-public linux-libre-arm-generic
871 (make-linux-libre* linux-libre-version
872 linux-libre-source
873 '("armhf-linux")
874 #:defconfig "multi_v7_defconfig"
875 #:extra-version "arm-generic"
876 #:extra-options
877 (append
878 `(;; needed to fix the RTC on rockchip platforms
879 ("CONFIG_RTC_DRV_RK808" . #t))
880 %default-extra-linux-options)))
881
882 (define-public linux-libre-arm-generic-5.6
883 (make-linux-libre* linux-libre-5.6-version
884 linux-libre-5.6-source
885 '("armhf-linux")
886 #:defconfig "multi_v7_defconfig"
887 #:extra-version "arm-generic"
888 #:extra-options
889 (append
890 `(;; needed to fix the RTC on rockchip platforms
891 ("CONFIG_RTC_DRV_RK808" . #t))
892 %default-extra-linux-options)))
893
894 (define-public linux-libre-arm-veyron
895 (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic))
896
897 (define-public linux-libre-arm-generic-4.19
898 (make-linux-libre* linux-libre-4.19-version
899 linux-libre-4.19-source
900 '("armhf-linux")
901 #:defconfig "multi_v7_defconfig"
902 #:extra-version "arm-generic"))
903
904 (define-public linux-libre-arm-generic-4.14
905 (make-linux-libre* linux-libre-4.14-version
906 linux-libre-4.14-source
907 '("armhf-linux")
908 #:defconfig "multi_v7_defconfig"
909 #:extra-version "arm-generic"))
910
911 (define-public linux-libre-arm-omap2plus
912 (make-linux-libre* linux-libre-version
913 linux-libre-source
914 '("armhf-linux")
915 #:defconfig "omap2plus_defconfig"
916 #:extra-version "arm-omap2plus"))
917
918 (define-public linux-libre-arm-omap2plus-4.19
919 (make-linux-libre* linux-libre-4.19-version
920 linux-libre-4.19-source
921 '("armhf-linux")
922 #:defconfig "omap2plus_defconfig"
923 #:extra-version "arm-omap2plus"))
924
925 (define-public linux-libre-arm-omap2plus-4.14
926 (make-linux-libre* linux-libre-4.14-version
927 linux-libre-4.14-source
928 '("armhf-linux")
929 #:defconfig "omap2plus_defconfig"
930 #:extra-version "arm-omap2plus"))
931
932 (define-public linux-libre-arm64-generic
933 (make-linux-libre* linux-libre-version
934 linux-libre-source
935 '("aarch64-linux")
936 #:defconfig "defconfig"
937 #:extra-version "arm64-generic"
938 #:extra-options
939 (append
940 `(;; needed to fix the RTC on rockchip platforms
941 ("CONFIG_RTC_DRV_RK808" . #t))
942 %default-extra-linux-options)))
943
944 (define-public linux-libre-arm64-generic-5.6
945 (make-linux-libre* linux-libre-5.6-version
946 linux-libre-5.6-source
947 '("aarch64-linux")
948 #:defconfig "defconfig"
949 #:extra-version "arm64-generic"
950 #:extra-options
951 (append
952 `(;; needed to fix the RTC on rockchip platforms
953 ("CONFIG_RTC_DRV_RK808" . #t))
954 %default-extra-linux-options)))
955
956 (define-public linux-libre-riscv64-generic
957 (make-linux-libre* linux-libre-version
958 linux-libre-source
959 '("riscv64-linux")
960 #:extra-version "riscv64-generic"))
961
962 \f
963 ;;;
964 ;;; Linux kernel modules.
965 ;;;
966
967 (define-public acpi-call-linux-module
968 (let ((commit "70b9c80bd700e6a4d10797eaac9fd34b7e8cbd4a")
969 (revision "0"))
970 (package
971 (name "acpi-call-linux-module")
972 (version (git-version "3.17" revision commit))
973 (source
974 (origin
975 (method git-fetch)
976 (uri (git-reference
977 (url "https://github.com/teleshoes/acpi_call.git")
978 (commit commit)))
979 (file-name (git-file-name name version))
980 (sha256
981 (base32 "09c1vw6vcrkqxbwhpgfgpj4d1grzn4qq6ka8pwwzm7cvm405xj7x"))))
982 (build-system linux-module-build-system)
983 (arguments
984 `(#:tests? #f ; no tests
985 #:phases
986 (modify-phases %standard-phases
987 (add-after 'install 'install-documentation
988 (lambda* (#:key outputs #:allow-other-keys)
989 (let* ((out (assoc-ref outputs "out"))
990 (doc (string-append out "/share/doc/" ,name "-" ,version)))
991 (for-each (lambda (file)
992 (let ((target (string-append doc "/" file)))
993 (mkdir-p (dirname target))
994 (copy-recursively file target)))
995 (list "README.md" "examples"))
996 #t))))))
997 (home-page "https://github.com/teleshoes/acpi_call")
998 (synopsis "Linux kernel module to perform ACPI method calls")
999 (description
1000 "This simple Linux kernel module allows calls from user space to any
1001 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
1002 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
1003 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
1004 and @code{ACPI_BUFFER}.
1005
1006 It grants direct and undocumented access to your hardware that may cause damage
1007 and should be used with caution, especially on untested models.")
1008 (license license:gpl3+)))) ; see README.md (no licence headers)
1009
1010 (define-public rtl8812au-aircrack-ng-linux-module
1011 (let ((commit "945d6ed6505c32f0993b1dba576388e92e78101b")
1012 (revision "0"))
1013 (package
1014 (name "rtl8812au-aircrack-ng-linux-module")
1015 (version (git-version "5.6.4.2" revision commit))
1016 (source
1017 (origin
1018 (method git-fetch)
1019 (uri (git-reference
1020 (url "https://github.com/aircrack-ng/rtl8812au.git")
1021 (commit commit)))
1022 (file-name (git-file-name name version))
1023 (sha256
1024 (base32 "1pjws7qb5l4z9k80vgz4zdxmqhbwxjjrmkpf0hijf821byyddvi7"))
1025 (modules '((guix build utils)))
1026 (snippet
1027 '(begin
1028 ;; Remove bundled tarballs, APKs, word lists, speadsheets,
1029 ;; and other unnecessary unlicenced things.
1030 (for-each delete-file-recursively (list "android"
1031 "docs"
1032 "tools"))
1033 #t))))
1034 (build-system linux-module-build-system)
1035 (arguments
1036 `(#:phases
1037 (modify-phases %standard-phases
1038 (replace 'build
1039 (lambda* (#:key inputs make-flags #:allow-other-keys)
1040 (apply invoke "make"
1041 (string-append "KSRC="
1042 (assoc-ref inputs "linux-module-builder")
1043 "/lib/modules/build")
1044 (or make-flags '())))))
1045 #:tests? #f)) ; no test suite
1046 (supported-systems '("x86_64-linux" "i686-linux"))
1047 (home-page "https://github.com/aircrack-ng/rtl8812au")
1048 (synopsis "Linux driver for Realtek USB wireless network adapters")
1049 (description
1050 "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
1051 network adapters, modified by the aircrack-ng project to support monitor mode
1052 and frame injection. It provides a @code{88XXau} kernel module that supports
1053 RTL8812AU, RTL8821AU, and RTL8814AU chips.")
1054 (license license:gpl2+))))
1055
1056 (define-public rtl8821ce-linux-module
1057 (let ((commit "69765eb288a8dfad3b055b906760b53e02ab1dea")
1058 (revision "0"))
1059 (package
1060 (name "rtl8821ce-linux-module")
1061 (version (git-version "0.0.0" revision commit))
1062 (source
1063 (origin
1064 (method git-fetch)
1065 (uri (git-reference
1066 (url "https://github.com/tomaspinho/rtl8821ce.git")
1067 (commit commit)))
1068 (file-name (git-file-name name version))
1069 (sha256
1070 (base32
1071 "17jiw25k74kv5lnvgycvj2g1n06hbrpjz6p4znk4a62g136rhn4s"))))
1072 (build-system linux-module-build-system)
1073 (arguments
1074 `(#:phases
1075 (modify-phases %standard-phases
1076 (replace 'build
1077 (lambda* (#:key (make-flags '()) inputs #:allow-other-keys)
1078 (setenv "CC" "gcc")
1079 (invoke "make"
1080 (string-append "KSRC="
1081 (assoc-ref inputs "linux-module-builder")
1082 "/lib/modules/build")))))
1083 #:tests? #f))
1084 (home-page "https://github.com/tomaspinho/rtl8821ce")
1085 (synopsis "Linux driver for Realtek RTL8821CE wireless network adapters")
1086 (description "This is Realtek's RTL8821CE Linux driver for wireless
1087 network adapters.")
1088 (license license:gpl2))))
1089
1090 (define-public vhba-module
1091 (package
1092 (name "vhba-module")
1093 (version "20200106")
1094 (source (origin
1095 (method url-fetch)
1096 (uri (string-append
1097 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
1098 version ".tar.bz2"))
1099 (sha256
1100 (base32
1101 "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr"))))
1102 (build-system linux-module-build-system)
1103 (arguments
1104 ;; TODO: No tests?
1105 `(#:tests? #f))
1106 (home-page "https://cdemu.sourceforge.io/")
1107 (synopsis "Kernel module that emulates SCSI devices")
1108 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
1109 between the CDemu userspace daemon and linux kernel.")
1110 (license license:gpl2+)))
1111
1112 (define-public ddcci-driver-linux
1113 (package
1114 (name "ddcci-driver-linux")
1115 (version "0.3.3")
1116 (source
1117 (origin
1118 (method git-fetch)
1119 (uri
1120 (git-reference
1121 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
1122 (commit (string-append "v" version))))
1123 (file-name (git-file-name name version))
1124 (sha256
1125 (base32
1126 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
1127 (build-system linux-module-build-system)
1128 (arguments
1129 `(#:tests? #f ; no tests
1130 #:phases
1131 (modify-phases %standard-phases
1132 (replace 'build
1133 (lambda args
1134 (for-each
1135 (lambda (module)
1136 (with-directory-excursion module
1137 (apply (assoc-ref %standard-phases 'build) args)))
1138 '("ddcci" "ddcci-backlight"))
1139 #t))
1140 (replace 'install
1141 (lambda args
1142 (for-each
1143 (lambda (module)
1144 (with-directory-excursion module
1145 (apply (assoc-ref %standard-phases 'install) args)))
1146 '("ddcci" "ddcci-backlight"))
1147 #t)))))
1148 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
1149 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
1150 (description "This package provides two Linux kernel drivers, ddcci and
1151 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
1152 interface. The ddcci module creates a character device for each DDC/CI
1153 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
1154 module allows the control of the backlight level or luminance property when
1155 supported under @file{/sys/class/backlight/}.")
1156 (license license:gpl2+)))
1157
1158 \f
1159 ;;;
1160 ;;; Pluggable authentication modules (PAM).
1161 ;;;
1162
1163 (define-public linux-pam
1164 (package
1165 (name "linux-pam")
1166 (version "1.3.1")
1167 (source
1168 (origin
1169 (method url-fetch)
1170 (uri (string-append
1171 "https://github.com/linux-pam/linux-pam/releases/download/v"
1172 version "/Linux-PAM-" version ".tar.xz"))
1173 (sha256
1174 (base32
1175 "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
1176 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1177
1178 (build-system gnu-build-system)
1179 (native-inputs
1180 `(("flex" ,flex)
1181
1182 ;; TODO: optional dependencies
1183 ;; ("libxcrypt" ,libxcrypt)
1184 ;; ("cracklib" ,cracklib)
1185 ))
1186 (arguments
1187 `(;; Most users, such as `shadow', expect the headers to be under
1188 ;; `security'.
1189 #:configure-flags (list (string-append "--includedir="
1190 (assoc-ref %outputs "out")
1191 "/include/security")
1192
1193 ;; XXX: <rpc/rpc.h> is missing from glibc when
1194 ;; cross-compiling, so we have to disable NIS
1195 ;; support altogether.
1196 ,@(if (%current-target-system)
1197 '("--disable-nis")
1198 '()))
1199
1200 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1201 ;; isn't available.
1202 #:tests? #f))
1203 (home-page "http://www.linux-pam.org/")
1204 (synopsis "Pluggable authentication modules for Linux")
1205 (description
1206 "A *Free* project to implement OSF's RFC 86.0.
1207 Pluggable authentication modules are small shared object files that can
1208 be used through the PAM API to perform tasks, like authenticating a user
1209 at login. Local and dynamic reconfiguration are its key features.")
1210 (license license:bsd-3)))
1211
1212 (define-public linux-pam-1.2
1213 (package
1214 (inherit linux-pam)
1215 (version "1.2.1")
1216 (source
1217 (origin
1218 (method url-fetch)
1219 (uri (string-append
1220 "http://www.linux-pam.org/library/"
1221 "Linux-PAM-" version ".tar.bz2"))
1222 (sha256
1223 (base32
1224 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1225 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1226
1227
1228 ;;;
1229 ;;; Miscellaneous.
1230 ;;;
1231
1232 (define-public psmisc
1233 (package
1234 (name "psmisc")
1235 (version "23.3")
1236 (source
1237 (origin
1238 (method url-fetch)
1239 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1240 version ".tar.xz"))
1241 (sha256
1242 (base32 "16i7qzjmm6g0lzha8yzpfrlcxnvkgh95hkq9gdjd4zmzb8d0wxa1"))))
1243 (build-system gnu-build-system)
1244 (arguments
1245 `(,@(if (%current-target-system)
1246 '(#:configure-flags
1247 (list
1248 "ac_cv_func_malloc_0_nonnull=yes"
1249 "ac_cv_func_realloc_0_nonnull=yes"))
1250 '())))
1251 (inputs `(("ncurses" ,ncurses)))
1252 (home-page "https://gitlab.com/psmisc/psmisc")
1253 (synopsis "Small utilities that use the proc file system")
1254 (description
1255 "This PSmisc package is a set of some small useful utilities that
1256 use the proc file system. We're not about changing the world, but
1257 providing the system administrator with some help in common tasks.")
1258 (license license:gpl2+)))
1259
1260 (define-public util-linux
1261 (package
1262 (name "util-linux")
1263 (version "2.34")
1264 (source (origin
1265 (method url-fetch)
1266 (uri (string-append "mirror://kernel.org/linux/utils/"
1267 "util-linux/v" (version-major+minor version) "/"
1268 "util-linux-" version ".tar.xz"))
1269 (sha256
1270 (base32
1271 "1db2kydkwjmvgd1glkcba3adhidxw0f1x735dcjdpdjjf869sgvl"))
1272 (patches (search-patches "util-linux-tests.patch"))
1273 (modules '((guix build utils)))
1274 (snippet
1275 ;; We take 'nologin' from Shadow, the 'logger' program from
1276 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1277 '(begin
1278 (substitute* "configure"
1279 (("build_nologin=yes") "build_nologin=no")
1280 (("build_logger=yes") "build_logger=no")
1281 (("build_kill=yes") "build_kill=no"))
1282 #t))))
1283 (build-system gnu-build-system)
1284 (outputs '("out"
1285 "static")) ;>2 MiB of static .a libraries
1286 (arguments
1287 `(#:configure-flags (list "--disable-use-tty-group"
1288 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1289 ;; Don't try to chown root:root mount and umount
1290 "--disable-makeinstall-chown"
1291 ;; Install completions where our
1292 ;; bash-completion package expects them.
1293 (string-append "--with-bashcompletiondir="
1294 (assoc-ref %outputs "out")
1295 "/etc/bash_completion.d"))
1296 #:phases (modify-phases %standard-phases
1297 (add-before 'build 'set-umount-file-name
1298 (lambda* (#:key outputs #:allow-other-keys)
1299 ;; Tell 'eject' the right file name of 'umount'.
1300 (let ((out (assoc-ref outputs "out")))
1301 (substitute* "sys-utils/eject.c"
1302 (("\"/bin/umount\"")
1303 (string-append "\"" out "/bin/umount\"")))
1304 #t)))
1305 (add-before 'check 'pre-check
1306 (lambda* (#:key inputs outputs #:allow-other-keys)
1307 (let ((out (assoc-ref outputs "out"))
1308 (net (assoc-ref inputs "net-base")))
1309 ;; Change the test to refer to the right file.
1310 (substitute* "tests/ts/misc/mcookie"
1311 (("/etc/services")
1312 (string-append net "/etc/services")))
1313 #t)))
1314 (add-after 'install 'move-static-libraries
1315 (lambda* (#:key outputs #:allow-other-keys)
1316 (let ((out (assoc-ref outputs "out"))
1317 (static (assoc-ref outputs "static")))
1318 (mkdir-p (string-append static "/lib"))
1319 (with-directory-excursion out
1320 (for-each (lambda (file)
1321 (rename-file file
1322 (string-append static "/"
1323 file)))
1324 (find-files "lib" "\\.a$"))
1325
1326 ;; Remove references to the static library from the '.la'
1327 ;; files so that Libtool does the right thing when both
1328 ;; the shared and static library is available.
1329 (substitute* (find-files "lib" "\\.la$")
1330 (("old_library=.*") "old_library=''\n")))
1331
1332 #t))))))
1333 (inputs `(("zlib" ,zlib)
1334 ("ncurses" ,ncurses)
1335
1336 ;; XXX: This is so that the 'pre-check' phase can find it.
1337 ,@(if (%current-target-system)
1338 `(("net-base" ,net-base))
1339 '())))
1340 (native-inputs
1341 `(("perl" ,perl)
1342 ("net-base" ,net-base))) ;for tests
1343 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1344 (synopsis "Collection of utilities for the Linux kernel")
1345 (description "Util-linux is a diverse collection of Linux kernel
1346 utilities. It provides dmesg and includes tools for working with file systems,
1347 block devices, UUIDs, TTYs, and many other tools.")
1348
1349 ;; Note that util-linux doesn't use the same license for all the
1350 ;; code. GPLv2+ is the default license for a code without an
1351 ;; explicitly defined license.
1352 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1353 license:bsd-4 license:public-domain))))
1354
1355 ;; util-linux optionally supports udev, which allows lsblk to read file system
1356 ;; metadata without special privileges. Add it as a separate package to avoid
1357 ;; a circular dependency, and to keep the size small.
1358 (define-public util-linux+udev
1359 (package/inherit
1360 util-linux
1361 (name "util-linux-with-udev")
1362 (inputs
1363 `(("udev" ,eudev)
1364 ,@(package-inputs util-linux)))))
1365
1366 (define-public ddate
1367 (package
1368 (name "ddate")
1369 (version "0.2.2")
1370 (source (origin
1371 (method url-fetch)
1372 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
1373 version ".tar.gz"))
1374 (file-name (string-append name "-" version ".tar.gz"))
1375 (sha256
1376 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
1377 (build-system cmake-build-system)
1378 (arguments '(#:tests? #f))
1379 (home-page "https://github.com/bo0ts/ddate")
1380 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1381 (description
1382 "ddate displays the Discordian date and holidays of a given date.
1383 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1384 by Robert Shea and Robert Anton Wilson.")
1385 (license license:public-domain)))
1386
1387 (define-public fbset
1388 (package
1389 (name "fbset")
1390 (version "2.1")
1391 (source
1392 (origin
1393 (method url-fetch)
1394 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
1395 version ".tar.gz"))
1396 (sha256
1397 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
1398 (build-system gnu-build-system)
1399 (arguments
1400 '(#:modules ((guix build gnu-build-system)
1401 (guix build utils)
1402 (srfi srfi-26))
1403 #:phases
1404 (modify-phases %standard-phases
1405 (delete 'configure) ; no configure script
1406 (add-before 'install 'pre-install
1407 (lambda* (#:key outputs #:allow-other-keys)
1408 (let ((out (assoc-ref outputs "out")))
1409 (substitute* "Makefile"
1410 (("mknod ") "true ")
1411 ;; The Makefile doesn't honour PREFIX or similar.
1412 (("/usr") out))
1413 (mkdir out)
1414 (with-directory-excursion out
1415 (for-each mkdir-p (list "sbin"
1416 "man/man5"
1417 "man/man8")))
1418 #t)))
1419 (add-after 'install 'install-fb.modes
1420 (lambda* (#:key outputs #:allow-other-keys)
1421 (let* ((out (assoc-ref outputs "out"))
1422 (etc (string-append out "/etc")))
1423 (for-each (cut install-file <> etc)
1424 (find-files "etc" "^fb\\.modes"))
1425 (symlink "fb.modes.ATI"
1426 (string-append etc "/fb.modes"))
1427 #t))))
1428 ;; Parallel building races to create modes.tab.c.
1429 #:parallel-build? #f
1430 #:tests? #f)) ; no test suite
1431 (native-inputs
1432 `(("bison" ,bison)
1433 ("flex" ,flex)))
1434 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
1435 (synopsis "Show and modify Linux frame buffer settings")
1436 (description
1437 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
1438 different kinds of graphic displays. The @command{fbset} utility can query and
1439 change various device settings such as depth, virtual resolution, and timing
1440 parameters.")
1441 (license license:gpl2)))
1442
1443 (define-public procps
1444 (package
1445 (name "procps")
1446 (version "3.3.16")
1447 (source (origin
1448 (method url-fetch)
1449 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1450 "procps-ng-" version ".tar.xz"))
1451 (sha256
1452 (base32
1453 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
1454 (build-system gnu-build-system)
1455 (arguments
1456 '(#:modules ((guix build utils)
1457 (guix build gnu-build-system)
1458 (srfi srfi-1)
1459 (srfi srfi-26))
1460 #:phases
1461 (modify-phases %standard-phases
1462 (add-after
1463 'install 'post-install
1464 ;; Remove commands and man pages redudant with
1465 ;; Coreutils.
1466 (lambda* (#:key outputs #:allow-other-keys)
1467 (let* ((out (assoc-ref outputs "out"))
1468 (dup (append-map (cut find-files out <>)
1469 '("^kill" "^uptime"))))
1470 (for-each delete-file dup)
1471 #t))))))
1472 (inputs `(("ncurses" ,ncurses)))
1473 (home-page "https://gitlab.com/procps-ng/procps/")
1474 (synopsis "Utilities that give information about processes")
1475 (description
1476 "Procps is the package that has a bunch of small useful utilities
1477 that give information about processes using the Linux /proc file system.
1478 The package includes the programs ps, top, vmstat, w, kill, free,
1479 slabtop, and skill.")
1480 (license license:gpl2)))
1481
1482 (define-public usbutils
1483 (package
1484 (name "usbutils")
1485 (version "012")
1486 (source
1487 (origin
1488 (method url-fetch)
1489 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1490 "usbutils-" version ".tar.xz"))
1491 (sha256
1492 (base32 "0iiy0q7fzikavmdsjsb0sl9kp3gfh701qwyjjccvqh0qz4jlcqw8"))))
1493 (build-system gnu-build-system)
1494 (outputs (list "out" "python"))
1495 (arguments
1496 `(#:phases
1497 (modify-phases %standard-phases
1498 (add-before 'bootstrap 'patch-bootstrap-scripts
1499 (lambda _
1500 (substitute* "usbhid-dump/bootstrap"
1501 (("/bin/bash") (which "bash")))
1502
1503 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1504 (substitute* "autogen.sh"
1505 (("^\\./configure.*") ""))
1506 #t))
1507 (add-after 'install 'separate-python-output
1508 ;; Separating one Python script shaves more than 106 MiB from :out.
1509 (lambda* (#:key outputs #:allow-other-keys)
1510 (let ((out (assoc-ref outputs "out"))
1511 (out:python (assoc-ref outputs "python")))
1512 (for-each (lambda (file)
1513 (let ((old (string-append out "/" file))
1514 (new (string-append out:python "/" file)))
1515 (mkdir-p (dirname new))
1516 (rename-file old new)))
1517 (list "bin/lsusb.py"))
1518 #t))))))
1519 (inputs
1520 `(("eudev" ,eudev)
1521 ("libusb" ,libusb)
1522 ("python" ,python)))
1523 (native-inputs
1524 `(("autoconf" ,autoconf)
1525 ("automake" ,automake)
1526 ("libtool" ,libtool)
1527 ("pkg-config" ,pkg-config)))
1528 (home-page "http://www.linux-usb.org/")
1529 (synopsis
1530 "Tools for working with USB devices, such as lsusb")
1531 (description
1532 "Tools for working with USB devices, such as lsusb.")
1533 (license license:gpl2+)))
1534
1535 (define-public e2fsprogs
1536 (package
1537 (name "e2fsprogs")
1538 (version "1.45.6")
1539 (source (origin
1540 (method url-fetch)
1541 (uri (string-append
1542 "mirror://kernel.org/linux/kernel/people/tytso/"
1543 "e2fsprogs/v" version "/"
1544 "e2fsprogs-" version ".tar.xz"))
1545 (sha256
1546 (base32
1547 "0mj2yizwygs7xww8jfy5mxjn8ww4pvc0b1hg1p2vsnirailsx9zz"))))
1548 (build-system gnu-build-system)
1549 (inputs `(("util-linux" ,util-linux)))
1550 (native-inputs `(("pkg-config" ,pkg-config)
1551 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1552
1553 ;; For tests.
1554 ("perl" ,perl)
1555 ("procps" ,procps)))
1556 (arguments
1557 '(;; util-linux is the preferred source for some of the libraries and
1558 ;; commands, so disable them (see, e.g.,
1559 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1560 #:configure-flags (list "--disable-libblkid"
1561 "--disable-libuuid" "--disable-uuidd"
1562 "--disable-fsck"
1563
1564 ;; Use symlinks instead of hard links for
1565 ;; 'fsck.extN' etc. This makes the resulting nar
1566 ;; smaller and is preserved across copies.
1567 "--enable-symlink-install"
1568
1569 (string-append "LDFLAGS=-Wl,-rpath="
1570 (assoc-ref %outputs "out")
1571 "/lib")
1572
1573 ;; Install libext2fs et al.
1574 "--enable-elf-shlibs")
1575
1576 #:phases
1577 (modify-phases %standard-phases
1578 (add-before 'configure 'patch-shells
1579 (lambda _
1580 (substitute* "configure"
1581 (("/bin/sh (.*)parse-types.sh" _ dir)
1582 (string-append (which "sh") " " dir
1583 "parse-types.sh")))
1584 (substitute* "MCONFIG.in"
1585 (("INSTALL_SYMLINK = /bin/sh")
1586 "INSTALL_SYMLINK = sh"))
1587 (substitute* (find-files "." "^Makefile.in$")
1588 (("#!/bin/sh")
1589 (string-append "#!" (which "sh"))))
1590 #t))
1591 (add-after 'install 'install-libs
1592 (lambda* (#:key outputs #:allow-other-keys)
1593 (let* ((out (assoc-ref outputs "out"))
1594 (lib (string-append out "/lib")))
1595 (invoke "make" "install-libs")
1596
1597 ;; Make the .a writable so that 'strip' works.
1598 ;; Failing to do that, due to debug symbols, we
1599 ;; retain a reference to the final
1600 ;; linux-libre-headers, which refer to the
1601 ;; bootstrap binaries.
1602 (let ((archives (find-files lib "\\.a$")))
1603 (for-each (lambda (file)
1604 (chmod file #o666))
1605 archives))
1606 #t))))))
1607 (home-page "http://e2fsprogs.sourceforge.net/")
1608 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
1609 (description
1610 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
1611 (license (list license:gpl2 ;programs
1612 license:lgpl2.0 ;libext2fs
1613 license:x11)))) ;libuuid
1614
1615 (define e2fsprogs/static
1616 (static-package
1617 (package (inherit e2fsprogs)
1618 (arguments
1619 ;; Do not build shared libraries.
1620 (substitute-keyword-arguments (package-arguments e2fsprogs)
1621 ((#:configure-flags _)
1622 '(list "--disable-blkid"))
1623 ((#:make-flags _)
1624 '(list)))))))
1625
1626 (define-public e2fsck/static
1627 (package
1628 (name "e2fsck-static")
1629 (version (package-version e2fsprogs))
1630 (build-system trivial-build-system)
1631 (source #f)
1632 (inputs
1633 `(("e2fsprogs" ,e2fsprogs/static)))
1634 (arguments
1635 `(#:modules ((guix build utils))
1636 #:builder
1637 (begin
1638 (use-modules (guix build utils)
1639 (ice-9 ftw)
1640 (srfi srfi-26))
1641
1642 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
1643 "/sbin/e2fsck"))
1644 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
1645 (mkdir-p bin)
1646 (with-directory-excursion bin
1647 (copy-file e2fsck "e2fsck")
1648 (remove-store-references "e2fsck")
1649 (chmod "e2fsck" #o555))
1650 #t))))
1651 (home-page (package-home-page e2fsprogs))
1652 (synopsis "Statically-linked e2fsck command from e2fsprogs")
1653 (description "This package provides statically-linked e2fsck command taken
1654 from the e2fsprogs package. It is meant to be used in initrds.")
1655 (license (package-license e2fsprogs))))
1656
1657 (define-public extundelete
1658 (package
1659 (name "extundelete")
1660 (version "0.2.4")
1661 (source
1662 (origin
1663 (method url-fetch)
1664 (uri (string-append "mirror://sourceforge/extundelete/"
1665 "extundelete/" version "/extundelete-"
1666 version ".tar.bz2"))
1667 (sha256
1668 (base32
1669 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
1670 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
1671 (build-system gnu-build-system)
1672 (inputs `(("e2fsprogs" ,e2fsprogs)))
1673 (home-page "http://extundelete.sourceforge.net/")
1674 (synopsis "Recover deleted files from ext2/3/4 partitions")
1675 (description
1676 "Extundelete is a set of tools that can recover deleted files from an
1677 ext3 or ext4 partition.")
1678 (license license:gpl2)))
1679
1680 (define-public zerofree
1681 (package
1682 (name "zerofree")
1683 (version "1.1.1")
1684 (home-page "https://frippery.org/uml/")
1685 (source (origin
1686 (method url-fetch)
1687 (uri (string-append home-page name "-" version
1688 ".tgz"))
1689 (sha256
1690 (base32
1691 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1692 (build-system gnu-build-system)
1693 (arguments
1694 '(#:phases
1695 (modify-phases %standard-phases
1696 (delete 'configure) ; no configure script
1697 (replace 'install
1698 ;; The Makefile lacks an ‘install’ target.
1699 (lambda* (#:key outputs #:allow-other-keys)
1700 (let* ((out (assoc-ref outputs "out"))
1701 (bin (string-append out "/bin")))
1702 (chmod "zerofree" #o555)
1703 (install-file "zerofree" bin)
1704 #t))))
1705 #:tests? #f)) ; no tests
1706 (inputs `(("libext2fs" ,e2fsprogs)))
1707 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
1708 (description
1709 "Zerofree finds the unallocated blocks with non-zero value content in an
1710 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
1711 This is a simple way to make disk images more compressible.
1712 Zerofree requires the file system to be unmounted or mounted read-only.")
1713 (license license:gpl2)))
1714
1715 (define-public strace
1716 (package
1717 (name "strace")
1718 (version "5.5")
1719 (home-page "https://strace.io")
1720 (source (origin
1721 (method url-fetch)
1722 (uri (string-append home-page "/files/" version
1723 "/strace-" version ".tar.xz"))
1724 (sha256
1725 (base32
1726 "1zrhpzjlgfwfl8dd53llswmmharm5rbi0zch7lln5sjris69an4z"))))
1727 (build-system gnu-build-system)
1728 (arguments
1729 '(#:phases
1730 (modify-phases %standard-phases
1731 (add-after 'unpack 'patch-/bin/sh
1732 (lambda _
1733 (substitute* "strace.c"
1734 (("/bin/sh") (which "sh")))
1735 #t)))
1736 ;; Don't fail if the architecture doesn't support different personalities.
1737 #:configure-flags '("--enable-mpers=check")
1738 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
1739 #:parallel-tests? #f)) ; undeterministic failures
1740 (native-inputs `(("perl" ,perl)))
1741 (synopsis "System call tracer for Linux")
1742 (description
1743 "strace is a system call tracer, i.e. a debugging tool which prints out a
1744 trace of all the system calls made by a another process/program.")
1745 (license license:lgpl2.1+)))
1746
1747 (define-public ltrace
1748 (package
1749 (name "ltrace")
1750 (version "0.7.3")
1751 (source (origin
1752 (method url-fetch)
1753 (uri (string-append "http://www.ltrace.org/ltrace_" version
1754 ".orig.tar.bz2"))
1755 (sha256
1756 (base32
1757 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
1758 (build-system gnu-build-system)
1759 (inputs `(("libelf" ,libelf)))
1760 (arguments
1761 ;; Compilation uses -Werror by default, but it fails.
1762 '(#:configure-flags '("--disable-werror")))
1763 (home-page "https://www.ltrace.org/")
1764 (synopsis "Library call tracer for Linux")
1765 (description
1766 "ltrace intercepts and records dynamic library calls which are called by
1767 an executed process and the signals received by that process. It can also
1768 intercept and print the system calls executed by the program.")
1769 (license license:gpl2+)))
1770
1771 (define-public alsa-lib
1772 (package
1773 (name "alsa-lib")
1774 (version "1.2.2")
1775 (source (origin
1776 (method url-fetch)
1777 (uri (string-append
1778 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
1779 version ".tar.bz2"))
1780 (sha256
1781 (base32
1782 "1v5kb8jyvrpkvvq7dq8hfbmcj68lml97i4s0prxpfx2mh3c57s6q"))))
1783 (build-system gnu-build-system)
1784 (arguments
1785 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
1786 (assoc-ref %outputs "out")
1787 "/lib"))))
1788 (home-page "https://www.alsa-project.org/")
1789 (synopsis "The Advanced Linux Sound Architecture libraries")
1790 (description
1791 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1792 MIDI functionality to the Linux-based operating system.")
1793 (license license:lgpl2.1+)))
1794
1795 (define-public alsa-utils
1796 (package
1797 (name "alsa-utils")
1798 (version "1.2.2")
1799 (source (origin
1800 (method url-fetch)
1801 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
1802 name "-" version ".tar.bz2"))
1803 (sha256
1804 (base32
1805 "1wz460by17rmxrcydn583rd4lhj6wlvqs6x1j5pdzxn5g3app024"))))
1806 (build-system gnu-build-system)
1807 (arguments
1808 ;; XXX: Disable man page creation until we have DocBook.
1809 '(#:configure-flags (list "--disable-xmlto"
1810
1811 ;; The udev rule is responsible for restoring
1812 ;; the volume.
1813 (string-append "--with-udev-rules-dir="
1814 (assoc-ref %outputs "out")
1815 "/lib/udev/rules.d"))
1816 #:phases
1817 (modify-phases %standard-phases
1818 (add-before 'check 'disable-broken-test
1819 (lambda _
1820 ;; XXX: The 1.1.8 release tarball is missing a header that's
1821 ;; required for this test to work. Fixed in 1.1.9.
1822 (substitute* "axfer/test/Makefile"
1823 ((".*container-test.*") ""))
1824 #t))
1825 (add-before
1826 'install 'pre-install
1827 (lambda _
1828 ;; Don't try to mkdir /var/lib/alsa.
1829 (substitute* "Makefile"
1830 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
1831 "true\n"))
1832 #t)))))
1833 (inputs
1834 `(("libsamplerate" ,libsamplerate)
1835 ("ncurses" ,ncurses)
1836 ("alsa-lib" ,alsa-lib)
1837 ("xmlto" ,xmlto)
1838 ("gettext" ,gettext-minimal)))
1839 (home-page "http://www.alsa-project.org/")
1840 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
1841 (description
1842 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1843 MIDI functionality to the Linux-based operating system.")
1844
1845 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
1846 ;; GPLv2-only.
1847 (license license:gpl2)))
1848
1849 (define-public alsa-plugins
1850 (package
1851 (name "alsa-plugins")
1852 (version "1.2.2")
1853 (source (origin
1854 (method url-fetch)
1855 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1856 name "-" version ".tar.bz2"))
1857 (sha256
1858 (base32
1859 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
1860 (build-system gnu-build-system)
1861 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1862 ;; be split, there are references to both in files.
1863 ;; TODO: Remove OSS related plugins, they add support to run native
1864 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1865 ;; obsolete.
1866 (outputs '("out" "pulseaudio" "jack"))
1867 (arguments
1868 `(#:configure-flags '(;; Do not install a "local" configuration targeted
1869 ;; for /etc/alsa. On Guix System plugins are loaded from
1870 ;; the ALSA service, and other distributions likely
1871 ;; won't use these files.
1872 "--with-alsalconfdir=/tmp/noop")
1873 #:phases
1874 (modify-phases %standard-phases
1875 (add-after 'install 'split
1876 (lambda* (#:key inputs outputs #:allow-other-keys)
1877 ;; Distribute the binaries to the various outputs.
1878 (let* ((out (assoc-ref outputs "out"))
1879 (jack (assoc-ref outputs "jack"))
1880 (jacklib (string-append jack "/lib/alsa-lib"))
1881 (pua (assoc-ref outputs "pulseaudio"))
1882 (pualib (string-append pua "/lib/alsa-lib")))
1883 ;; For jack.
1884 (mkdir-p jacklib)
1885 (for-each (lambda (file)
1886 (rename-file file (string-append jacklib "/" (basename file))))
1887 (find-files out ".*jack\\.(la|so)"))
1888 ;; For pulseaudio.
1889 (mkdir-p pualib)
1890 (for-each (lambda (file)
1891 (rename-file file (string-append pualib "/" (basename file))))
1892 (find-files out ".*pulse\\.(la|so)"))
1893 #t))))))
1894 (inputs
1895 `(("alsa-lib" ,alsa-lib)
1896 ("jack" ,jack-1)
1897 ("speex" ,speex) ; libspeexdsp resampling plugin
1898 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1899 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1900 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1901 (native-inputs
1902 `(("pkg-config" ,pkg-config)))
1903 (home-page "http://www.alsa-project.org/")
1904 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1905 (description
1906 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1907 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1908 by providing additional plugins which include: upmixing, downmixing, jackd and
1909 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1910 external rate conversion.")
1911 (license (list license:gpl2+
1912 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1913 license:lgpl2.1+))))
1914
1915 (define-public iptables
1916 (package
1917 (name "iptables")
1918 (version "1.8.4")
1919 (source (origin
1920 (method url-fetch)
1921 (uri (string-append
1922 "mirror://netfilter.org/iptables/iptables-"
1923 version ".tar.bz2"))
1924 (sha256
1925 (base32
1926 "0z0mgs1ghvn3slc868mgbf2g26njgrzcy5ggyb5w4i55j1a3lflr"))))
1927 (build-system gnu-build-system)
1928 (native-inputs
1929 `(("pkg-config" ,pkg-config)
1930 ("flex" ,flex)
1931 ("bison" ,bison)))
1932 (inputs
1933 `(("libmnl" ,libmnl)
1934 ("libnftnl" ,libnftnl)))
1935 (arguments
1936 '(#:tests? #f ; no test suite
1937 #:configure-flags ; add $libdir to the RUNPATH of executables
1938 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1939 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1940 (synopsis "Programs to configure Linux IP packet filtering rules")
1941 (description
1942 "@command{iptables} is the user-space command line program used to
1943 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
1944 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
1945
1946 This package also includes @command{ip6tables}, which is used to configure the
1947 IPv6 packet filter.
1948
1949 Both commands are targeted at system administrators.")
1950 (license license:gpl2+)))
1951
1952 (define-public lsscsi
1953 (package
1954 (name "lsscsi")
1955 (version "0.31")
1956 (source (origin
1957 (method url-fetch)
1958 (uri (string-append
1959 "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
1960 (sha256
1961 (base32
1962 "1ry2y34xmpgxdbfbyvs8cjmbx0fn222yjdab87wj21q60nab5p75"))))
1963 (build-system gnu-build-system)
1964 (synopsis "Lists information about SCSI or NVMe devices in Linux")
1965 (home-page "http://sg.danny.cz/scsi/lsscsi.html")
1966 (description
1967 "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
1968 also list NVMe namespaces or controllers and show the relationship between a
1969 device's primary node name, its SCSI generic (sg) node name and its kernel
1970 name.")
1971 (license license:gpl2)))
1972
1973 (define-public ebtables
1974 (package
1975 (name "ebtables")
1976 (version "2.0.11")
1977 (source (origin
1978 (method url-fetch)
1979 (uri (string-append
1980 "mirror://netfilter.org/ebtables/ebtables-"
1981 version ".tar.gz"))
1982 (sha256
1983 (base32
1984 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
1985 (build-system gnu-build-system)
1986 (inputs
1987 `(("perl" ,perl)
1988 ("iptables" ,iptables)))
1989 (synopsis "Ethernet bridge frame table administration")
1990 (home-page "https://ebtables.netfilter.org/")
1991 (description
1992 "ebtables is an application program used to set up and maintain the
1993 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1994 analogous to the iptables application, but less complicated, due to the fact
1995 that the Ethernet protocol is much simpler than the IP protocol.")
1996 (license license:gpl2+)))
1997
1998 (define-public iproute
1999 (package
2000 (name "iproute2")
2001 (version "5.5.0")
2002 (source (origin
2003 (method url-fetch)
2004 (uri (string-append
2005 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
2006 version ".tar.xz"))
2007 (sha256
2008 (base32
2009 "0ywg70f98wgfai35jl47xzpjp45a6n7crja4vc8ql85cbi1l7ids"))))
2010 (build-system gnu-build-system)
2011 (arguments
2012 `( ;; There is a test suite, but it wants network namespaces and sudo.
2013 #:tests? #f
2014 #:make-flags (let ((out (assoc-ref %outputs "out")))
2015 (list "DESTDIR="
2016 (string-append "BASH_COMPDIR=" out
2017 "/etc/bash_completion.d")
2018 (string-append "LIBDIR=" out "/lib")
2019 (string-append "HDRDIR=" out "/include")
2020 (string-append "SBINDIR=" out "/sbin")
2021 (string-append "CONFDIR=" out "/etc")
2022 (string-append "DOCDIR=" out "/share/doc/"
2023 ,name "-" ,version)
2024 (string-append "MANDIR=" out "/share/man")))
2025 #:phases (modify-phases %standard-phases
2026 (add-before 'install 'pre-install
2027 (lambda _
2028 ;; Don't attempt to create /var/lib/arpd.
2029 (substitute* "Makefile"
2030 (("^.*ARPDDIR.*$") ""))
2031 #t)))))
2032 (inputs
2033 `(("db4" ,bdb)
2034 ("iptables" ,iptables)
2035 ("libmnl" ,libmnl)))
2036 (native-inputs
2037 `(("bison" ,bison)
2038 ("flex" ,flex)
2039 ("pkg-config" ,pkg-config)))
2040 ;; For tests.
2041 ;; ("libmnl" ,libmnl)
2042 ;; ("util-linux" ,util-linux)
2043 (home-page
2044 "https://wiki.linuxfoundation.org/networking/iproute2")
2045 (synopsis
2046 "Utilities for controlling TCP/IP networking and traffic in Linux")
2047 (description
2048 "Iproute2 is a collection of utilities for controlling TCP/IP networking
2049 and traffic with the Linux kernel. The most important of these are
2050 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
2051 control.
2052
2053 Most network configuration manuals still refer to ifconfig and route as the
2054 primary network configuration tools, but ifconfig is known to behave
2055 inadequately in modern network environments, and both should be deprecated.")
2056 (license license:gpl2+)))
2057
2058 (define-public net-tools
2059 ;; XXX: This package is basically unmaintained, but it provides a few
2060 ;; commands not yet provided by Inetutils, such as 'route', so we have to
2061 ;; live with it.
2062 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
2063 (revision "0"))
2064 (package
2065 (name "net-tools")
2066 (version (string-append "1.60-" revision "." (string-take commit 7)))
2067 (source (origin
2068 (method url-fetch)
2069 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
2070 "n/ne/net-tools/code.git/net-tools-code-"
2071 commit ".zip"))
2072 (file-name (string-append name "-" version ".zip"))
2073 (sha256
2074 (base32
2075 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
2076 (home-page "http://net-tools.sourceforge.net/")
2077 (build-system gnu-build-system)
2078 (arguments
2079 '(#:modules ((guix build gnu-build-system)
2080 (guix build utils)
2081 (srfi srfi-1)
2082 (srfi srfi-26))
2083 #:phases
2084 (modify-phases %standard-phases
2085 (replace 'configure
2086 (lambda* (#:key outputs #:allow-other-keys)
2087 (let ((out (assoc-ref outputs "out")))
2088 (mkdir-p (string-append out "/bin"))
2089 (mkdir-p (string-append out "/sbin"))
2090
2091 ;; Pretend we have everything...
2092 (system "yes | make config")
2093
2094 ;; ... except for the things we don't have.
2095 ;; HAVE_AFDECnet requires libdnet, which we don't have.
2096 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
2097 ;; that have been removed.
2098 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
2099 ;; think about adding them later.
2100 (substitute* '("config.make" "config.h")
2101 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
2102 ""))
2103 #t)))
2104 (add-after 'install 'remove-redundant-commands
2105 (lambda* (#:key outputs #:allow-other-keys)
2106 ;; Remove commands and man pages redundant with Inetutils.
2107 (let* ((out (assoc-ref outputs "out"))
2108 (dup (append-map (cut find-files out <>)
2109 '("^hostname"
2110 "^(yp|nis|dns)?domainname"))))
2111 (for-each delete-file dup)
2112 #t))))
2113 ;; Binaries that depend on libnet-tools.a don't declare that
2114 ;; dependency, making it parallel-unsafe.
2115 #:parallel-build? #f
2116
2117 #:tests? #f ; no test suite
2118 #:make-flags (let ((out (assoc-ref %outputs "out")))
2119 (list "CC=gcc"
2120 (string-append "BASEDIR=" out)
2121 (string-append "INSTALLNLSDIR=" out "/share/locale")
2122 (string-append "mandir=/share/man")))))
2123 (native-inputs `(("gettext" ,gettext-minimal)
2124 ("unzip" ,unzip)))
2125 (synopsis "Tools for controlling the network subsystem in Linux")
2126 (description
2127 "This package includes the important tools for controlling the network
2128 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
2129 route. Additionally, this package contains utilities relating to particular
2130 network hardware types (plipconfig, slattach) and advanced aspects of IP
2131 configuration (iptunnel, ipmaddr).")
2132 (license license:gpl2+))))
2133
2134 (define-public libcap
2135 (package
2136 (name "libcap")
2137 (version "2.27")
2138 (source (origin
2139 (method url-fetch)
2140 (uri (string-append
2141 "mirror://kernel.org/linux/libs/security/linux-privs/"
2142 "libcap2/libcap-" version ".tar.xz"))
2143 (sha256
2144 (base32
2145 "0sj8kidl7qgf2qwxcbw1vadnlb30y4zvjzxswsmfdghq04npkhfs"))))
2146 (build-system gnu-build-system)
2147 (arguments '(#:phases
2148 (modify-phases %standard-phases
2149 (replace 'configure
2150 ;; Add $libdir to the RUNPATH of executables.
2151 (lambda _
2152 (substitute* "Make.Rules"
2153 (("LDFLAGS := #-g")
2154 (string-append "LDFLAGS := -Wl,-rpath="
2155 %output "/lib")))
2156 #t)))
2157 #:tests? #f ; no 'check' target
2158 #:make-flags (list "lib=lib"
2159 (string-append "prefix="
2160 (assoc-ref %outputs "out"))
2161 "RAISE_SETFCAP=no")))
2162 (native-inputs `(("perl" ,perl)))
2163 (inputs `(("attr" ,attr)))
2164 (home-page "https://sites.google.com/site/fullycapable/")
2165 (synopsis "Library for working with POSIX capabilities")
2166 (description
2167 "Libcap2 provides a programming interface to POSIX capabilities on
2168 Linux-based operating systems.")
2169
2170 ;; License is BSD-3 or GPLv2, at the user's choice.
2171 (license license:gpl2)))
2172
2173 (define-public bridge-utils
2174 (package
2175 (name "bridge-utils")
2176 (version "1.6")
2177 (source
2178 (origin
2179 (method url-fetch)
2180 (uri (string-append "mirror://kernel.org/linux/utils/net/bridge-utils/"
2181 "bridge-utils-" version ".tar.xz"))
2182 (sha256
2183 (base32 "1j16kr44csyr4yqxly26l1yw2bh4nkiasgwvask2i2gvsnsyyryc"))))
2184 (build-system gnu-build-system)
2185
2186 ;; The tarball lacks all the generated files.
2187 (native-inputs `(("autoconf" ,autoconf)
2188 ("automake" ,automake)))
2189 (arguments
2190 '(#:phases
2191 (modify-phases %standard-phases
2192 (add-before 'bootstrap 'patch-stuff
2193 (lambda _
2194 ;; Fix "field ‘ip6’ has incomplete type" errors.
2195 (substitute* "libbridge/libbridge.h"
2196 (("#include <linux/if_bridge.h>")
2197 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
2198
2199 ;; Ensure that the entire build fails if one of the
2200 ;; sub-Makefiles fails.
2201 (substitute* "Makefile.in"
2202 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
2203 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
2204
2205 #t)))
2206 #:tests? #f)) ; no 'check' target
2207
2208 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
2209 (synopsis "Manipulate Ethernet bridges")
2210 (description
2211 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2212 to connect two Ethernet segments together in a protocol independent way.
2213 Packets are forwarded based on Ethernet address, rather than IP address (like
2214 a router). Since forwarding is done at Layer 2, all protocols can go
2215 transparently through a bridge.")
2216 (license license:gpl2+)))
2217
2218 (define-public libnl
2219 (package
2220 (name "libnl")
2221 (version "3.5.0")
2222 (source (origin
2223 (method url-fetch)
2224 (uri (string-append
2225 "https://github.com/thom311/libnl/releases/download/"
2226 "libnl" (string-join (string-split version #\.) "_")
2227 "/libnl-" version ".tar.gz"))
2228 (sha256
2229 (base32
2230 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2231 (build-system gnu-build-system)
2232 (native-inputs
2233 `(("bison" ,bison)
2234 ("flex" ,flex)
2235 ("pkg-config" ,pkg-config)
2236 ("swig" ,swig)
2237 ("libnl3-doc"
2238 ,(origin
2239 (method url-fetch)
2240 (uri (string-append
2241 "https://github.com/thom311/libnl/releases/download/libnl"
2242 (string-join (string-split version #\.) "_")
2243 "/libnl-doc-" version ".tar.gz"))
2244 (sha256
2245 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2246 (inputs
2247 `(("python-2" ,python-2)
2248 ("python-3" ,python-3)))
2249 (outputs '("out" "doc" "python2" "python3"))
2250 (arguments
2251 `(#:modules ((guix build gnu-build-system)
2252 (guix build utils)
2253 (srfi srfi-1))
2254 #:phases
2255 (modify-phases %standard-phases
2256 (add-after 'install 'install-python
2257 (lambda* (#:key outputs #:allow-other-keys)
2258 (define (python-inst python)
2259 (invoke python "setup.py" "build")
2260 (invoke python "setup.py" "install"
2261 (string-append "--prefix="
2262 (assoc-ref %outputs python)))
2263 (invoke python "setup.py" "clean"))
2264 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2265 (assoc-ref %outputs "out")))
2266 (with-directory-excursion "./python"
2267 (for-each python-inst '("python2" "python3")))
2268 #t))
2269 (add-after 'install 'install-doc
2270 (lambda* (#:key inputs outputs #:allow-other-keys)
2271 (let ((dest (string-append (assoc-ref outputs "doc")
2272 "/share/doc/libnl")))
2273 (mkdir-p dest)
2274 (invoke "tar" "xf" (assoc-ref inputs "libnl3-doc")
2275 "--strip-components=1" "-C" dest)))))))
2276 (home-page "https://www.infradead.org/~tgr/libnl/")
2277 (synopsis "NetLink protocol library suite")
2278 (description
2279 "The libnl suite is a collection of libraries providing APIs to netlink
2280 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
2281 between the kernel and user space processes. It was designed to be a more
2282 flexible successor to ioctl to provide mainly networking related kernel
2283 configuration and monitoring interfaces.")
2284
2285 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2286 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2287 (license license:gpl2)))
2288
2289 (define-public iw
2290 (package
2291 (name "iw")
2292 (version "4.14")
2293 (source (origin
2294 (method url-fetch)
2295 (uri (string-append
2296 "mirror://kernel.org/software/network/iw/iw-"
2297 version ".tar.xz"))
2298 (sha256
2299 (base32
2300 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2301 (build-system gnu-build-system)
2302 (native-inputs `(("pkg-config" ,pkg-config)))
2303 (inputs `(("libnl" ,libnl)))
2304 (arguments
2305 `(#:make-flags
2306 (let* ((target ,(%current-target-system))
2307 (gcc (if target (string-append target "-gcc") "gcc"))
2308 (pkg-config (if target
2309 (string-append target "-pkg-config")
2310 "pkg-config")))
2311 (list
2312 (string-append "CC=" gcc)
2313 (string-append "PKG_CONFIG="
2314 (assoc-ref %build-inputs "pkg-config")
2315 "/bin/" pkg-config)
2316 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
2317 #:phases (modify-phases %standard-phases (delete 'configure))))
2318 (home-page "https://wireless.wiki.kernel.org/")
2319 (synopsis "Tool for configuring wireless devices")
2320 (description
2321 "iw is a new nl80211 based CLI configuration utility for wireless
2322 devices. It replaces @code{iwconfig}, which is deprecated.")
2323 (license license:isc)))
2324
2325 (define-public powertop
2326 (package
2327 (name "powertop")
2328 (version "2.12")
2329 (source
2330 (origin
2331 (method url-fetch)
2332 (uri (string-append "https://01.org/sites/default/files/downloads/"
2333 "powertop-" version ".tar.gz"))
2334 (sha256
2335 (base32 "1kiiwa5p2r7h1lzcf53xq61ckaa4wk565s9fs6vw4bfk84y3mfsw"))))
2336 (build-system gnu-build-system)
2337 (arguments
2338 '(#:phases
2339 (modify-phases %standard-phases
2340 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2341 ;; allow calibrating the network interface in Guix System.
2342 (add-after 'unpack 'patch-absolute-file-names
2343 (lambda* (#:key inputs #:allow-other-keys)
2344 (let ((kmod (assoc-ref inputs "kmod")))
2345 (substitute* (find-files "src" "\\.cpp$")
2346 ;; Give the right 'modprobe' file name so that essential
2347 ;; modules such as msr.ko can be loaded.
2348 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2349 ;; These programs are only needed to calibrate, so using
2350 ;; relative file names avoids adding extra inputs. When they
2351 ;; are missing powertop gracefully handles it.
2352 (("/usr/bin/hcitool") "hcitool")
2353 (("/usr/bin/xset") "xset")
2354 (("/usr/sbin/hciconfig") "hciconfig"))
2355 #t))))))
2356 (inputs
2357 `(("kmod" ,kmod)
2358 ("libnl" ,libnl)
2359 ("ncurses" ,ncurses)
2360 ("pciutils" ,pciutils)
2361 ("zlib" ,zlib)))
2362 (native-inputs
2363 `(("pkg-config" ,pkg-config)))
2364 (home-page "https://01.org/powertop/")
2365 (synopsis "Analyze power consumption on Intel-based laptops")
2366 (description
2367 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2368 power management. In addition to being a diagnostic tool, PowerTOP also has
2369 an interactive mode where the user can experiment various power management
2370 settings for cases where the operating system has not enabled these
2371 settings.")
2372 (license license:gpl2)))
2373
2374 (define-public aumix
2375 (package
2376 (name "aumix")
2377 (version "2.9.1")
2378 (source (origin
2379 (method url-fetch)
2380 (uri (string-append
2381 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2382 version ".tar.bz2"))
2383 (sha256
2384 (base32
2385 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2386 (build-system gnu-build-system)
2387 (inputs `(("ncurses" ,ncurses)))
2388 (home-page "http://www.jpj.net/~trevor/aumix.html")
2389 (synopsis "Audio mixer for X and the console")
2390 (description
2391 "Aumix adjusts an audio mixer from X, the console, a terminal,
2392 the command line or a script.")
2393 (license license:gpl2+)))
2394
2395 (define-public iotop
2396 (package
2397 (name "iotop")
2398 (version "0.6")
2399 (source
2400 (origin
2401 (method url-fetch)
2402 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2403 version ".tar.gz"))
2404 (sha256 (base32
2405 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2406 (build-system python-build-system)
2407 (arguments
2408 '(#:phases
2409 (modify-phases %standard-phases
2410 (add-after 'unpack 'fix-build-with-python3
2411 (lambda _
2412 (substitute* "setup.py"
2413 (("itervalues") "values"))
2414 #t)))
2415 ;; There are currently no checks in the package.
2416 #:tests? #f))
2417 (native-inputs `(("python" ,python)))
2418 (home-page "http://guichaz.free.fr/iotop/")
2419 (synopsis
2420 "Displays the IO activity of running processes")
2421 (description
2422 "Iotop is a Python program with a top like user interface to show the
2423 processes currently causing I/O.")
2424 (license license:gpl2+)))
2425
2426 (define-public fuse
2427 (package
2428 (name "fuse")
2429 (version "2.9.9")
2430 (source (origin
2431 (method url-fetch)
2432 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2433 "download/fuse-" version
2434 "/fuse-" version ".tar.gz"))
2435 (sha256
2436 (base32
2437 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
2438 (patches (search-patches "fuse-overlapping-headers.patch"))))
2439 (build-system gnu-build-system)
2440 (inputs `(("util-linux" ,util-linux)))
2441 (arguments
2442 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2443 (assoc-ref %outputs "out")
2444 "/sbin")
2445 (string-append "INIT_D_PATH="
2446 (assoc-ref %outputs "out")
2447 "/etc/init.d")
2448
2449 ;; The rule makes /dev/fuse 666.
2450 (string-append "UDEV_RULES_PATH="
2451 (assoc-ref %outputs "out")
2452 "/lib/udev/rules.d"))
2453 #:phases
2454 (modify-phases %standard-phases
2455 (add-before 'build 'set-file-names
2456 (lambda* (#:key inputs #:allow-other-keys)
2457 ;; libfuse calls out to mount(8) and umount(8). Make sure
2458 ;; it refers to the right ones.
2459 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2460 (("/bin/(u?)mount" _ maybe-u)
2461 (string-append (assoc-ref inputs "util-linux")
2462 "/bin/" maybe-u "mount")))
2463 (substitute* '("util/mount.fuse.c")
2464 (("/bin/sh")
2465 (which "sh")))
2466
2467 ;; This hack leads libfuse to search for 'fusermount' in
2468 ;; $PATH, where it may find a setuid-root binary, instead of
2469 ;; trying solely $out/sbin/fusermount and failing because
2470 ;; it's not setuid.
2471 (substitute* "lib/Makefile"
2472 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2473 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2474 #t)))))
2475 (home-page "https://github.com/libfuse/libfuse")
2476 (synopsis "Support file systems implemented in user space")
2477 (description
2478 "As a consequence of its monolithic design, file system code for Linux
2479 normally goes into the kernel itself---which is not only a robustness issue,
2480 but also an impediment to system extensibility. FUSE, for \"file systems in
2481 user space\", is a kernel module and user-space library that tries to address
2482 part of this problem by allowing users to run file system implementations as
2483 user-space processes.")
2484 (license (list license:lgpl2.1 ;library
2485 license:gpl2+)))) ;command-line utilities
2486
2487 (define-public unionfs-fuse
2488 (package
2489 (name "unionfs-fuse")
2490 (version "2.0")
2491 (source (origin
2492 (method git-fetch)
2493 (uri (git-reference
2494 (url "https://github.com/rpodgorny/unionfs-fuse")
2495 (commit (string-append "v" version))))
2496 (file-name (git-file-name name version))
2497 (sha256
2498 (base32
2499 "0lb8zgdxnjy2fjr2284hvdfn7inc1in44ynzgcr66x54bxzvynj6"))))
2500 (build-system cmake-build-system)
2501 (native-inputs
2502 `(("python" ,python)))
2503 (inputs `(("fuse" ,fuse)))
2504 (arguments
2505 ;; The tests were never actually run ("collected 0 items"), but in recent
2506 ;; versions of pytest that causes an error.
2507 '(#:tests? #f))
2508 (home-page "https://github.com/rpodgorny/unionfs-fuse")
2509 (synopsis "User-space union file system")
2510 (description
2511 "UnionFS-FUSE is a flexible union file system implementation in user
2512 space, using the FUSE library. Mounting a union file system allows you to
2513 \"aggregate\" the contents of several directories into a single mount point.
2514 UnionFS-FUSE additionally supports copy-on-write.")
2515 (license license:bsd-3)))
2516
2517 (define fuse-static
2518 (package (inherit fuse)
2519 (name "fuse-static")
2520 (source (origin (inherit (package-source fuse))
2521 (modules '((guix build utils)))
2522 (snippet
2523 '(begin
2524 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
2525 ;; updated. Change calls to 'mtab_needs_update' to 0 so
2526 ;; that it doesn't do that, allowing us to remove the
2527 ;; dependency on util-linux (something that is useful in
2528 ;; initrds.)
2529 (substitute* '("lib/mount_util.c"
2530 "util/mount_util.c")
2531 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
2532 "0")
2533 (("/bin/")
2534 ""))
2535 #t))))))
2536
2537 (define-public unionfs-fuse/static
2538 (package (inherit unionfs-fuse)
2539 (synopsis "User-space union file system (statically linked)")
2540 (name (string-append (package-name unionfs-fuse) "-static"))
2541 (source (origin (inherit (package-source unionfs-fuse))
2542 (modules '((guix build utils)))
2543 (snippet
2544 '(begin
2545 ;; Add -ldl to the libraries, because libfuse.a needs that.
2546 (substitute* "src/CMakeLists.txt"
2547 (("target_link_libraries(.*)\\)" _ libs)
2548 (string-append "target_link_libraries"
2549 libs " dl)")))
2550 #t))))
2551 (arguments
2552 '(#:tests? #f
2553 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
2554 #:phases
2555 (modify-phases %standard-phases
2556 (add-after 'install 'post-install
2557 (lambda* (#:key outputs #:allow-other-keys)
2558 (let* ((out (assoc-ref outputs "out"))
2559 (exe (string-append out "/bin/unionfs")))
2560 ;; By default, 'unionfs' keeps references to
2561 ;; $glibc/share/locale and similar stuff. Remove them.
2562 (remove-store-references exe)
2563
2564 ;; 'unionfsctl' has references to glibc as well. Since
2565 ;; we don't need it, remove it.
2566 (delete-file (string-append out "/bin/unionfsctl"))
2567 #t))))))
2568 (inputs `(("fuse" ,fuse-static)))))
2569
2570 (define-public sshfs
2571 (package
2572 (name "sshfs")
2573 (version "2.10")
2574 (source (origin
2575 (method url-fetch)
2576 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
2577 "download/sshfs-" version "/sshfs-" version
2578 ".tar.gz"))
2579 (sha256
2580 (base32
2581 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
2582 (build-system gnu-build-system)
2583 (inputs
2584 `(("fuse" ,fuse)
2585 ("glib" ,glib)))
2586 (native-inputs
2587 `(("pkg-config" ,pkg-config)))
2588 (home-page "https://github.com/libfuse/sshfs")
2589 (synopsis "Mount remote file systems over SSH")
2590 (description
2591 "This is a file system client based on the SSH File Transfer Protocol.
2592 Since most SSH servers already support this protocol it is very easy to set
2593 up: on the server side there's nothing to do; on the client side mounting the
2594 file system is as easy as logging into the server with an SSH client.")
2595 (license license:gpl2+)))
2596
2597 (define-public sshfs-fuse
2598 (package (inherit sshfs)
2599 (name "sshfs-fuse")
2600 (properties `((superseded . ,sshfs)))))
2601
2602 (define-public archivemount
2603 (package
2604 (name "archivemount")
2605 (version "0.8.12")
2606 (source
2607 (origin
2608 (method url-fetch)
2609 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
2610 "archivemount-" version ".tar.gz"))
2611 (sha256
2612 (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
2613 (build-system gnu-build-system)
2614 (inputs `(("fuse" ,fuse)
2615 ("libarchive" ,libarchive)))
2616 (native-inputs `(("pkg-config" ,pkg-config)))
2617 (home-page "https://www.cybernoia.de/software/archivemount.html")
2618 (synopsis "Tool for mounting archive files with FUSE")
2619 (description "archivemount is a FUSE-based file system for Unix variants,
2620 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
2621 mount point where it can be read from or written to as with any other file
2622 system. This makes accessing the contents of the archive, which may be
2623 compressed, transparent to other programs, without decompressing them.")
2624 (license license:lgpl2.0+)))
2625
2626 (define-public numactl
2627 (package
2628 (name "numactl")
2629 (version "2.0.13")
2630 (source (origin
2631 (method url-fetch)
2632 (uri (string-append
2633 "https://github.com/numactl/numactl/releases/download/v"
2634 version "/numactl-" version ".tar.gz"))
2635 (sha256
2636 (base32
2637 "16lcypvcmx1ydkpi2s82kqhg13kak7qhpbnj8hd9bdbyhr5ja7lr"))))
2638 (build-system gnu-build-system)
2639 (arguments
2640 '(;; There's a 'test' target, but it requires NUMA support in the kernel
2641 ;; to run, which we can't assume to have.
2642 #:tests? #f))
2643
2644 ;; NUMA is apparently not supported on armhf, see
2645 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
2646 (supported-systems (delete "armhf-linux" %supported-systems))
2647 (home-page "https://github.com/numactl/numactl")
2648 (synopsis "Tools for non-uniform memory access (NUMA) machines")
2649 (description
2650 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
2651 memory is not all in one place. The @command{numactl} program allows you to
2652 run your application program on specific CPUs and memory nodes. It does this
2653 by supplying a NUMA memory policy to the operating system before running your
2654 program.
2655
2656 The package contains other commands, such as @command{numastat},
2657 @command{memhog}, and @command{numademo} which provides a quick overview of
2658 NUMA performance on your system.")
2659 (license (list license:gpl2 ;programs
2660 license:lgpl2.1)))) ;library
2661
2662 (define-public kbd-neo
2663 (package
2664 (name "kbd-neo")
2665 (version "2486")
2666 (source
2667 (origin
2668 (method url-fetch)
2669 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
2670 version "/linux/console/neo.map"))
2671 (file-name (string-append name "-" version ".map"))
2672 (sha256
2673 (base32
2674 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
2675 (build-system trivial-build-system)
2676 (arguments
2677 `(#:modules ((guix build utils))
2678 #:builder (begin
2679 (use-modules (guix build utils))
2680 (let ((out (string-append %output "/share/keymaps"))
2681 (source (assoc-ref %build-inputs "source")))
2682 (mkdir-p out)
2683 (copy-file source (string-append out "/neo.map"))
2684 #t))))
2685 (home-page "https://neo-layout.org")
2686 (synopsis "Neo2 console layout")
2687 (description
2688 "Kbd-neo provides the Neo2 keyboard layout for use with
2689 @command{loadkeys(1)} from @code{kbd(4)}.")
2690 ;; The file is located in an svn directory, the entire content of
2691 ;; the directory is licensed as GPL3.
2692 (license license:gpl3+)))
2693
2694 (define-public kbd
2695 (package
2696 (name "kbd")
2697 (version "2.0.4")
2698 (source (origin
2699 (method url-fetch)
2700 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
2701 version ".tar.xz"))
2702 (sha256
2703 (base32
2704 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
2705 (modules '((guix build utils)))
2706 (snippet
2707 '(begin
2708 (substitute* "tests/Makefile.in"
2709 ;; The '%: %.in' rule incorrectly uses @VERSION@.
2710 (("@VERSION@")
2711 "[@]VERSION[@]"))
2712 (substitute* '("src/unicode_start" "src/unicode_stop")
2713 ;; Assume the Coreutils are in $PATH.
2714 (("/usr/bin/tty")
2715 "tty"))
2716 #t))))
2717 (build-system gnu-build-system)
2718 (arguments
2719 '(#:phases
2720 (modify-phases %standard-phases
2721 (add-before 'build 'pre-build
2722 (lambda* (#:key inputs #:allow-other-keys)
2723 (let ((gzip (assoc-ref %build-inputs "gzip"))
2724 (bzip2 (assoc-ref %build-inputs "bzip2")))
2725 (substitute* "src/libkeymap/findfile.c"
2726 (("gzip")
2727 (string-append gzip "/bin/gzip"))
2728 (("bzip2")
2729 (string-append bzip2 "/bin/bzip2")))
2730 #t)))
2731 (add-after 'install 'post-install
2732 (lambda* (#:key outputs #:allow-other-keys)
2733 ;; Make sure these programs find their comrades.
2734 (let* ((out (assoc-ref outputs "out"))
2735 (bin (string-append out "/bin")))
2736 (for-each (lambda (prog)
2737 (wrap-program (string-append bin "/" prog)
2738 `("PATH" ":" prefix (,bin))))
2739 '("unicode_start" "unicode_stop"))
2740 #t))))))
2741 (inputs `(("check" ,check)
2742 ("gzip" ,gzip)
2743 ("bzip2" ,bzip2)
2744 ("pam" ,linux-pam)))
2745 (native-search-paths
2746 (list (search-path-specification
2747 (variable "LOADKEYS_KEYMAP_PATH")
2748 ;; Append ‘/**’ to recursively search all directories. One can then
2749 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
2750 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
2751 (files (list "share/keymaps/**")))))
2752 (native-inputs `(("pkg-config" ,pkg-config)))
2753 (home-page "http://kbd-project.org/")
2754 (synopsis "Linux keyboard utilities and keyboard maps")
2755 (description
2756 "This package contains keytable files and keyboard utilities compatible
2757 for systems using the Linux kernel. This includes commands such as
2758 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
2759 (license license:gpl2+)))
2760
2761 (define-public loadkeys-static
2762 (package
2763 (inherit kbd)
2764 (name "loadkeys-static")
2765 (arguments
2766 (substitute-keyword-arguments (package-arguments kbd)
2767 ((#:configure-flags flags ''())
2768 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
2769 "--disable-vlock" ;so we don't need libpam
2770 "--disable-libkeymap")
2771 ,flags))
2772 ((#:make-flags flags ''())
2773 `(cons "LDFLAGS=-all-static" ,flags))
2774 ((#:phases phases '%standard-phases)
2775 `(modify-phases ,phases
2776 (replace 'install
2777 (lambda* (#:key outputs #:allow-other-keys)
2778 (let ((out (assoc-ref outputs "out")))
2779 ;; The binary keeps references to gzip, among other things,
2780 ;; which we don't need in the initrd, so strip references.
2781 (remove-store-references "src/loadkeys")
2782
2783 (install-file "src/loadkeys"
2784 (string-append out "/bin"))
2785 #t)))
2786 (delete 'post-install)))
2787 ((#:strip-flags _ '())
2788 ''("--strip-all"))
2789 ((#:allowed-references _ '())
2790 '())))
2791
2792 (synopsis "Statically-linked @command{loadkeys} program")
2793
2794 ;; This package is meant to be used internally in the initrd so don't
2795 ;; expose it.
2796 (properties '((hidden? . #t)))))
2797
2798 (define-public inotify-tools
2799 (package
2800 (name "inotify-tools")
2801 (version "3.20.1")
2802 (source (origin
2803 (method git-fetch)
2804 (uri (git-reference
2805 (url "https://github.com/rvoicilas/inotify-tools.git")
2806 (commit version)))
2807 (file-name (git-file-name name version))
2808 (sha256
2809 (base32
2810 "14dci1i4mhsd5sa33k8h3ayphk19kizynh5ql9ryibdpmcanfiyq"))))
2811 (build-system gnu-build-system)
2812 (native-inputs
2813 `(("autoconf" ,autoconf)
2814 ("automake" ,automake)
2815 ("libtool" ,libtool)))
2816 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
2817 (synopsis "Monitor file accesses")
2818 (description
2819 "The inotify-tools packages provides a C library and command-line tools
2820 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
2821 (license license:gpl2+)))
2822
2823 (define-public kmod
2824 (package
2825 (name "kmod")
2826 (version "26")
2827 (source (origin
2828 (method url-fetch)
2829 (uri
2830 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
2831 "kmod-" version ".tar.xz"))
2832 (sha256
2833 (base32
2834 "17dvrls70nr3b3x1wm8pwbqy4r8a5c20m0dhys8mjhsnpg425fsp"))
2835 (patches (search-patches "kmod-module-directory.patch"))))
2836 (build-system gnu-build-system)
2837 (native-inputs
2838 `(("pkg-config" ,pkg-config)))
2839 (inputs
2840 `(("xz" ,xz)
2841 ("zlib" ,zlib)))
2842 (arguments
2843 `(#:tests? #f ; FIXME: Investigate test failures
2844 #:configure-flags '("--with-xz" "--with-zlib")
2845 #:phases
2846 (modify-phases %standard-phases
2847 (add-after 'install 'install-modprobe&co
2848 (lambda* (#:key outputs #:allow-other-keys)
2849 (let* ((out (assoc-ref outputs "out"))
2850 (bin (string-append out "/bin")))
2851 (for-each (lambda (tool)
2852 (symlink "kmod"
2853 (string-append bin "/" tool)))
2854 '("insmod" "rmmod" "lsmod" "modprobe"
2855 "modinfo" "depmod"))
2856 #t))))))
2857 (home-page "https://www.kernel.org/")
2858 (synopsis "Kernel module tools")
2859 (description "Kmod is a set of tools to handle common tasks with Linux
2860 kernel modules like insert, remove, list, check properties, resolve
2861 dependencies and aliases.
2862
2863 These tools are designed on top of libkmod, a library that is shipped with
2864 kmod. The aim is to be compatible with tools, configurations and indices
2865 from the module-init-tools project.")
2866 (license license:gpl2+))) ; library under lgpl2.1+
2867
2868 (define-public earlyoom
2869 (package
2870 (name "earlyoom")
2871 (version "1.3.1")
2872 (source (origin
2873 (method git-fetch)
2874 (uri (git-reference
2875 (url "https://github.com/rfjakob/earlyoom.git")
2876 (commit (string-append "v" version))))
2877 (file-name (git-file-name name version))
2878 (sha256
2879 (base32
2880 "06sd3jpkdrwqbphsf8jrgs5rxfi7j3xjmygjjvj4xjk4gncz7r2i"))))
2881 (build-system gnu-build-system)
2882 (arguments
2883 `(#:phases (modify-phases %standard-phases
2884 (delete 'configure)
2885 (add-before 'check 'set-home
2886 (lambda _
2887 (setenv "HOME" (getcwd))
2888 #t))
2889 (add-after 'build 'install-contribs
2890 ;; Install what seems useful from the contrib directory.
2891 (lambda* (#:key outputs #:allow-other-keys)
2892 (let* ((out (assoc-ref outputs "out"))
2893 (contrib (string-append
2894 out "/share/earlyoom/contrib")))
2895 (install-file "contrib/notify_all_users.py" contrib)
2896 #t))))
2897 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
2898 (list "CC=gcc"
2899 (string-append "VERSION=v" ,version)
2900 (string-append "PREFIX=" prefix)
2901 (string-append "SYSCONFDIR=" prefix "/etc")))
2902 #:test-target "test"))
2903 (native-inputs `(("go" ,go) ;for the test suite
2904 ("pandoc" ,ghc-pandoc))) ;to generate the manpage
2905 (home-page "https://github.com/rfjakob/earlyoom")
2906 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
2907 (description "Early OOM is a minimalist out of memory (OOM) daemon that
2908 runs in user space and provides a more responsive and configurable alternative
2909 to the in-kernel OOM killer.")
2910 (license license:expat)))
2911
2912 (define-public eudev
2913 ;; The post-systemd fork, maintained by Gentoo.
2914 (package
2915 (name "eudev")
2916 (version "3.2.9")
2917 (source (origin
2918 (method git-fetch)
2919 (uri (git-reference (url "https://github.com/gentoo/eudev")
2920 (commit (string-append "v" version))))
2921 (file-name (git-file-name name version))
2922 (sha256
2923 (base32
2924 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
2925 (patches (search-patches "eudev-rules-directory.patch"))))
2926 (build-system gnu-build-system)
2927 (arguments
2928 '(#:phases
2929 (modify-phases %standard-phases
2930 (add-after 'unpack 'make-source-writable
2931 (lambda _
2932 ;; XXX: Git checkouts are read-only, but this package needs to
2933 ;; modify some of its files.
2934 (for-each make-file-writable (find-files "."))
2935 #t))
2936 (add-before 'bootstrap 'patch-file-names
2937 (lambda* (#:key inputs #:allow-other-keys)
2938 (substitute* "man/make.sh"
2939 (("/usr/bin/xsltproc")
2940 (string-append (assoc-ref inputs "xsltproc")
2941 "/bin/xsltproc")))
2942 #t))
2943 (add-after 'install 'move-static-library
2944 (lambda* (#:key outputs #:allow-other-keys)
2945 (let* ((out (assoc-ref outputs "out"))
2946 (static (assoc-ref outputs "static"))
2947 (source (string-append out "/lib/libudev.a"))
2948 (target (string-append static "/lib/libudev.a")))
2949 (mkdir-p (dirname target))
2950 (link source target)
2951 (delete-file source)
2952 ;; Remove reference to the static library from the .la file
2953 ;; such that Libtool looks for it in the usual places.
2954 (substitute* (string-append out "/lib/libudev.la")
2955 (("old_library=.*")
2956 "old_library=''\n"))
2957 #t)))
2958 (add-after 'install 'build-hwdb
2959 (lambda* (#:key outputs #:allow-other-keys)
2960 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2961 ;; similar tools to display product names.
2962 (let ((out (assoc-ref outputs "out")))
2963 (invoke (string-append out "/bin/udevadm")
2964 "hwdb" "--update")))))
2965 #:configure-flags (list "--enable-manpages")))
2966 (native-inputs
2967 `(("autoconf" ,autoconf)
2968 ("automake" ,automake)
2969 ("gperf" ,gperf)
2970 ("libtool" ,libtool)
2971 ("pkg-config" ,pkg-config)
2972 ;; For tests.
2973 ("perl" ,perl)
2974 ("python" ,python-wrapper)
2975 ;; For documentation.
2976 ("docbook-xml" ,docbook-xml-4.2)
2977 ("docbook-xsl" ,docbook-xsl)
2978 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2979 ("xsltproc" ,libxslt)))
2980 (inputs
2981 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2982 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2983 ;; which contains the rules to do that.
2984 `(("util-linux" ,util-linux) ;for blkid
2985 ("kmod" ,kmod)))
2986 (outputs '("out" "static"))
2987 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
2988 (synopsis "Userspace device management")
2989 (description "Udev is a daemon which dynamically creates and removes
2990 device nodes from /dev/, handles hotplug events and loads drivers at boot
2991 time.")
2992 (license license:gpl2+)))
2993
2994 ;; TODO: Merge with eudev on the next rebuild cycle.
2995 (define-public eudev/btrfs-fix
2996 (package/inherit
2997 eudev
2998 (version (string-append (package-version eudev) "-1"))
2999 (arguments
3000 (substitute-keyword-arguments (package-arguments eudev)
3001 ((#:phases phases '%standard-phases)
3002 `(modify-phases ,phases
3003 (add-before 'configure 'patch-bindir-in-btrfs-rules
3004 (lambda* (#:key outputs #:allow-other-keys)
3005 ;; The "@bindir@" substitution incorrectly expands to a literal
3006 ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work
3007 ;; around it.
3008 (let ((out (assoc-ref outputs "out")))
3009 (substitute* "rules/64-btrfs.rules.in"
3010 (("@bindir@")
3011 (string-append out "/bin")))
3012 #t)))))))))
3013
3014 (define-public python-evdev
3015 (package
3016 (name "python-evdev")
3017 (version "1.3.0")
3018 (source
3019 (origin
3020 (method url-fetch)
3021 (uri (pypi-uri "evdev" version))
3022 (sha256
3023 (base32 "0kb3636yaw9l8xi8s184w0r0n9ic5dw3b8hx048jf9fpzss4kimi"))))
3024 (build-system python-build-system)
3025 (native-inputs
3026 `(("kernel-headers" ,linux-libre-headers)))
3027 (arguments
3028 `(#:tests? #f ;no rule for tests
3029 #:phases
3030 (modify-phases %standard-phases
3031 (add-before 'build 'fix-hard-coded-directory
3032 (lambda* (#:key inputs #:allow-other-keys)
3033 (substitute* "setup.py"
3034 (("/usr/include/linux")
3035 (string-append
3036 (assoc-ref inputs "kernel-headers") "/include/linux")))
3037 #t)))))
3038 (home-page "https://github.com/gvalkov/python-evdev")
3039 (synopsis "Bindings to the Linux input handling subsystem")
3040 (description
3041 "Python-evdev provides bindings to the generic input event interface in
3042 Linux. The @code{evdev} interface serves the purpose of passing events
3043 generated in the kernel directly to userspace through character devices that
3044 are typically located in @file{/dev/input/}.
3045
3046 This package also comes with bindings to @code{uinput}, the userspace input
3047 subsystem. @code{uinput} allows userspace programs to create and handle input
3048 devices that can inject events directly into the input subsystem.")
3049 (license license:bsd-3)))
3050
3051 (define-public lvm2
3052 (package
3053 (name "lvm2")
3054 (version "2.03.08")
3055 (source (origin
3056 (method url-fetch)
3057 (uri (list (string-append "ftp://sourceware.org/pub/lvm2/LVM2."
3058 version ".tgz")
3059 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
3060 version ".tgz")))
3061 (sha256
3062 (base32
3063 "1j0yis658564rk1ddabkl8vbavp0fdd10gd6qhgyzc3akzf620kf"))
3064 (modules '((guix build utils)))
3065 (snippet
3066 '(begin
3067 (use-modules (guix build utils))
3068
3069 ;; Honor sysconfdir.
3070 (substitute* "make.tmpl.in"
3071 (("^confdir = .*$")
3072 "confdir = @sysconfdir@\n")
3073 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
3074 "DEFAULT_SYS_DIR = @sysconfdir@"))
3075 #t))
3076 (patches (search-patches "lvm2-static-link.patch"))))
3077 (build-system gnu-build-system)
3078 (native-inputs
3079 `(("pkg-config" ,pkg-config)
3080 ("procps" ,procps))) ;tests use 'pgrep'
3081 (inputs
3082 `(("libaio" ,libaio)
3083 ("udev" ,eudev)))
3084 (arguments
3085 '(#:phases
3086 (modify-phases %standard-phases
3087 (add-after 'configure 'set-makefile-shell
3088 (lambda _
3089 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
3090 ;; expected.
3091 (setenv "SHELL" (which "sh"))
3092
3093 ;; Replace /bin/sh with the right file name.
3094 (patch-makefile-SHELL "make.tmpl")
3095 #t)))
3096
3097 #:configure-flags (list (string-append "--sysconfdir="
3098 (assoc-ref %outputs "out")
3099 "/etc/lvm")
3100 "--enable-udev_sync"
3101 "--enable-udev_rules"
3102 "--enable-pkgconfig"
3103 "--enable-cmdlib"
3104 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
3105
3106 ;; Make sure programs such as 'dmsetup' can
3107 ;; find libdevmapper.so.
3108 (string-append "LDFLAGS=-Wl,-rpath="
3109 (assoc-ref %outputs "out")
3110 "/lib,-rpath="
3111 (assoc-ref %outputs "out")
3112 "/lib/device-mapper"))
3113
3114 ;; The tests use 'mknod', which requires root access.
3115 #:tests? #f))
3116 (home-page "https://sourceware.org/lvm2/")
3117 (synopsis "Logical volume management for Linux")
3118 (description
3119 "LVM2 is the logical volume management tool set for Linux-based systems.
3120 This package includes the user-space libraries and tools, including the device
3121 mapper. Kernel components are part of Linux-libre.")
3122
3123 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
3124 ;; Command-line tools are GPLv2.
3125 (license (list license:gpl2 license:lgpl2.1))))
3126
3127 (define-public lvm2-static
3128 (package
3129 (inherit lvm2)
3130 (name "lvm2-static")
3131
3132 ;; Propagate udev because libdevmapper.a depends on libudev.
3133 (propagated-inputs `(("udev:static" ,eudev "static")))
3134
3135 (arguments
3136 (substitute-keyword-arguments (package-arguments lvm2)
3137 ((#:configure-flags flags '())
3138 ;; LVM2 doesn't use Libtool, hence the custom option.
3139 `(append '("--enable-static_link")
3140 ;; Building dmeventd statically is complicated due to a
3141 ;; requirement on libdevmapper.a, which is being phased out
3142 ;; in favor of libdevice-mapper.a, which in turn is is not
3143 ;; easily made available at dmeventd build time. Just ignore
3144 ;; it until the situation improves.
3145 (delete "--enable-dmeventd" ,flags)))
3146 ((#:phases phases)
3147 `(modify-phases ,phases
3148 (add-before 'configure 'adjust-Makefile
3149 (lambda _
3150 ;; These fixes are related to the upstream libdm->device_mapper
3151 ;; migration and will hopefully be fixed upstream in due time.
3152 (substitute* "tools/Makefile.in"
3153 ;; This variable is empty in a static configuration and causes
3154 ;; an erroneous GCC command line.
3155 (("-L\\$\\(interfacebuilddir\\)") "")
3156 ;; Remove obsolete reference to libdevmapper.a.
3157 (("-ldevmapper") ""))
3158 #t))))))
3159 (synopsis "Logical volume management for Linux (statically linked)")))
3160
3161 (define-public wireless-tools
3162 (package
3163 (name "wireless-tools")
3164 (version "30.pre9")
3165 (source (origin
3166 (method url-fetch)
3167 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
3168 version ".tar.gz"))
3169 (sha256
3170 (base32
3171 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
3172 (snippet
3173 '(begin
3174 ;; Remove the older header files that are not free software.
3175 (for-each (lambda (n)
3176 (delete-file (format #f "wireless.~a.h" n)))
3177 '(10 11 12 13 14 15 16 17 18 19 20))
3178 #t))))
3179 (build-system gnu-build-system)
3180 (arguments
3181 `(#:make-flags
3182 (list (string-append "PREFIX=" %output)
3183 (string-append "INSTALL_MAN=" %output "/share/man")
3184 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
3185 "BUILD_STATIC=")
3186 #:phases
3187 (modify-phases %standard-phases
3188 (replace 'configure
3189 (lambda* (#:key target #:allow-other-keys)
3190 (when ,(%current-target-system)
3191 ;; Cross-compilation: use the cross tools.
3192 (substitute* (find-files "." "Makefile")
3193 (("CC = .*$")
3194 (string-append "CC = " target "-gcc\n"))
3195 (("AR = .*$")
3196 (string-append "AR = " target "-ar\n"))
3197 (("RANLIB = .*$")
3198 (string-append "RANLIB = " target "-ranlib\n"))))
3199 #t)))
3200 #:tests? #f))
3201 (synopsis "Tools for manipulating Linux Wireless Extensions")
3202 (description "Wireless Tools are used to manipulate the now-deprecated
3203 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
3204 Extension was an interface allowing you to set Wireless LAN specific
3205 parameters and get the specific stats. It is deprecated in favor the nl80211
3206 interface.")
3207 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
3208 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
3209 ;; other files are distributed under gpl2.
3210 (license (list license:gpl2 license:lgpl2.1+))))
3211
3212 (define-public crda
3213 (package
3214 (name "crda")
3215 (version "3.18")
3216 (source (origin
3217 (method url-fetch)
3218 (uri (string-append "mirror://kernel.org/software/network/crda/"
3219 "crda-" version ".tar.xz"))
3220 (sha256
3221 (base32
3222 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
3223 (patches (search-patches "crda-optional-gcrypt.patch"))))
3224 (build-system gnu-build-system)
3225 (arguments
3226 '(#:phases (modify-phases %standard-phases
3227 (delete 'configure)
3228 (add-after 'unpack 'gzip-determinism
3229 (lambda _
3230 (substitute* "Makefile"
3231 (("gzip") "gzip --no-name"))
3232 #t))
3233 (add-before
3234 'build 'no-werror-no-ldconfig
3235 (lambda _
3236 (substitute* "Makefile"
3237 (("-Werror") "")
3238 (("ldconfig") "true"))
3239 #t))
3240 (add-before
3241 'build 'set-regulator-db-file-name
3242 (lambda* (#:key inputs #:allow-other-keys)
3243 ;; Tell CRDA where to find our database.
3244 (let ((regdb (assoc-ref inputs "wireless-regdb")))
3245 (substitute* "crda.c"
3246 (("\"/lib/crda/regulatory.bin\"")
3247 (string-append "\"" regdb
3248 "/lib/crda/regulatory.bin\"")))
3249 #t))))
3250 #:test-target "verify"
3251 #:make-flags (let ((out (assoc-ref %outputs "out"))
3252 (regdb (assoc-ref %build-inputs "wireless-regdb")))
3253 (list "CC=gcc" "V=1"
3254
3255 ;; Disable signature-checking on 'regulatory.bin'.
3256 ;; The reason is that this simplifies maintenance
3257 ;; on our side (no need to manage a distro key
3258 ;; pair), and we can guarantee integrity of
3259 ;; 'regulatory.bin' by other means anyway, such as
3260 ;; 'guix gc --verify'. See
3261 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
3262 ;; for a discssion.
3263 "USE_OPENSSL=0"
3264
3265 (string-append "PREFIX=" out)
3266 (string-append "SBINDIR=" out "/sbin/")
3267 (string-append "UDEV_RULE_DIR="
3268 out "/lib/udev/rules.d")
3269 (string-append "LDFLAGS=-Wl,-rpath="
3270 out "/lib -L.")
3271 (string-append "REG_BIN=" regdb
3272 "/lib/crda/regulatory.bin")))))
3273 (native-inputs `(("pkg-config" ,pkg-config)
3274 ("wireless-regdb" ,wireless-regdb)))
3275 (inputs `(("libnl" ,libnl)))
3276 (home-page
3277 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
3278 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
3279 (description
3280 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
3281 communication between the kernel Linux and user space for regulatory
3282 compliance.")
3283 (license license:copyleft-next)))
3284
3285 (define-public wireless-regdb
3286 (package
3287 (name "wireless-regdb")
3288 (version "2019.06.03")
3289 (source (origin
3290 (method url-fetch)
3291 (uri (string-append
3292 "mirror://kernel.org/software/network/wireless-regdb/"
3293 "wireless-regdb-" version ".tar.xz"))
3294 (sha256
3295 (base32
3296 "1gslvh0aqdkv48jyr2ddq153mw28i7qz2ybrjj9qvkk3dgc7x4fd"))
3297
3298 ;; We're building 'regulatory.bin' by ourselves.
3299 (snippet '(begin
3300 (delete-file "regulatory.bin")
3301 #t))))
3302 (build-system gnu-build-system)
3303 (arguments
3304 '(#:phases
3305 (modify-phases %standard-phases
3306 (add-after 'unpack 'gzip-determinism
3307 (lambda _
3308 (substitute* "Makefile"
3309 (("gzip") "gzip --no-name"))
3310 #t))
3311 (add-after 'unpack 'omit-signature
3312 (lambda _
3313 (substitute* "Makefile"
3314 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
3315 ;; don't provide (see below). Disable it.
3316 ((" regulatory\\.db\\.p7s") "")
3317 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
3318 ;; but ‘make install’ depends only on the latter while installing
3319 ;; both (and failing). Depend on it explicitly.
3320 (("^install: " all) (string-append all "regulatory.db ")))
3321 #t))
3322 (delete 'configure)) ; no configure script
3323
3324 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
3325 ;; is computed and can be equal to 'maintainer-clean'; when that
3326 ;; happens, we can end up deleting the 'regulatory.bin' file that we
3327 ;; just built. Thus, build things sequentially.
3328 #:parallel-build? #f
3329
3330 #:tests? #f ; no tests
3331 #:make-flags
3332 (let ((out (assoc-ref %outputs "out")))
3333 (list (string-append "PREFIX=" out)
3334 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
3335
3336 ;; Leave this empty so that db2bin.py doesn't try to sign
3337 ;; ‘regulatory.bin’. This allows us to avoid managing a key
3338 ;; pair for the whole distribution.
3339 (string-append "REGDB_PRIVKEY=")
3340 ;; Don't generate a public key for the same reason. These are
3341 ;; used as Makefile targets and can't be the empty string.
3342 (string-append "REGDB_PUBCERT=/dev/null")
3343 (string-append "REGDB_PUBKEY=/dev/null")))))
3344 (native-inputs
3345 `(("python" ,python-wrapper)))
3346 (home-page
3347 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
3348 (synopsis "Wireless regulatory database")
3349 (description
3350 "This package contains the wireless regulatory database Central
3351 Regulatory Database Agent (CRDA) daemon. The database contains information on
3352 country-specific regulations for the wireless spectrum.")
3353 (license license:isc)))
3354
3355 (define-public lm-sensors
3356 (package
3357 (name "lm-sensors")
3358 (version "3.6.0")
3359 (source
3360 (origin
3361 (method git-fetch)
3362 (uri (git-reference
3363 (url "https://github.com/groeck/lm-sensors.git")
3364 (commit (string-append "V" (string-join
3365 (string-split version #\.) "-")))))
3366 (file-name (git-file-name name version))
3367 (sha256
3368 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
3369 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
3370 (build-system gnu-build-system)
3371 (inputs `(("rrdtool" ,rrdtool)
3372 ("perl" ,perl)
3373 ("kmod" ,kmod)
3374 ("gnuplot" ,gnuplot)))
3375 (native-inputs `(("pkg-config" ,pkg-config)
3376 ("flex" ,flex)
3377 ("bison" ,bison)
3378 ("which" ,which)))
3379 (outputs '("lib" ; avoid perl in closure
3380 "out"))
3381 (arguments
3382 `(#:tests? #f ; no 'check' target
3383 #:make-flags (list (string-append "PREFIX=" %output)
3384 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
3385 (string-append "INCLUDEDIR="
3386 (assoc-ref %outputs "lib") "/include")
3387 (string-append "MANDIR=" %output "/share/man")
3388 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
3389 #:phases
3390 (modify-phases %standard-phases
3391 (delete 'configure)
3392 (add-before 'build 'patch-exec-paths
3393 (lambda* (#:key inputs outputs #:allow-other-keys)
3394 (substitute* "prog/detect/sensors-detect"
3395 (("`uname")
3396 (string-append "`" (assoc-ref inputs "coreutils")
3397 "/bin/uname"))
3398 (("(`|\")modprobe" all open-quote)
3399 (string-append open-quote
3400 (assoc-ref inputs "kmod")
3401 "/bin/modprobe")))
3402 (substitute* '("prog/pwm/pwmconfig"
3403 "prog/pwm/fancontrol")
3404 (("gnuplot")
3405 (string-append (assoc-ref inputs "gnuplot")
3406 "/bin/gnuplot"))
3407 (("cat ")
3408 (string-append (assoc-ref inputs "coreutils")
3409 "/bin/cat "))
3410 (("grep ")
3411 (string-append (assoc-ref inputs "grep")
3412 "/bin/grep "))
3413 (("sed -e")
3414 (string-append (assoc-ref inputs "sed")
3415 "/bin/sed -e"))
3416 (("cut -d")
3417 (string-append (assoc-ref inputs "coreutils")
3418 "/bin/cut -d"))
3419 (("sleep ")
3420 (string-append (assoc-ref inputs "coreutils")
3421 "/bin/sleep "))
3422 (("readlink -f")
3423 (string-append (assoc-ref inputs "coreutils")
3424 "/bin/readlink -f")))
3425 #t)))))
3426 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
3427 (synopsis "Utilities to read temperature/voltage/fan sensors")
3428 (description
3429 "Lm-sensors is a hardware health monitoring package for Linux. It allows
3430 you to access information from temperature, voltage, and fan speed sensors.
3431 It works with most newer systems.")
3432 (license license:gpl2+)))
3433
3434 (define-public iucode-tool
3435 (package
3436 (name "iucode-tool")
3437 (version "2.3.1")
3438 (source (origin
3439 (method url-fetch)
3440 (uri (string-append "https://gitlab.com/iucode-tool/releases"
3441 "/raw/latest/iucode-tool_" version ".tar.xz"))
3442 (sha256
3443 (base32
3444 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
3445 (build-system gnu-build-system)
3446 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
3447 (synopsis "Manipulate Intel microcode bundles")
3448 (description
3449 "@command{iucode_tool} is a utility to work with microcode packages for
3450 Intel processors. It can convert between formats, extract specific versions,
3451 create a firmware image suitable for the Linux kernel, and more.")
3452 ;; cpuid.h is available for i686, x86_64, and ia64.
3453 (supported-systems '("i686-linux" "x86_64-linux"))
3454 (license license:gpl2+)))
3455
3456 (define-public i2c-tools
3457 (package
3458 (name "i2c-tools")
3459 (version "3.1.1")
3460 (source (origin
3461 (method url-fetch)
3462 (uri (string-append
3463 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
3464 version ".tar.bz2"))
3465 (sha256
3466 (base32
3467 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
3468 (build-system gnu-build-system)
3469 (arguments
3470 `(#:tests? #f ; no 'check' target
3471 #:make-flags (list (string-append "prefix=" %output)
3472 "CC=gcc")
3473 ;; no configure script
3474 #:phases (modify-phases %standard-phases (delete 'configure))))
3475 (inputs
3476 `(("perl" ,perl)))
3477 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
3478 (synopsis "I2C tools for Linux")
3479 (description
3480 "The i2c-tools package contains a heterogeneous set of I2C tools for
3481 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
3482 EEPROM decoding scripts, EEPROM programming tools, and a python module for
3483 SMBus access.")
3484 (license license:gpl2+)))
3485
3486 (define-public xsensors
3487 (package
3488 (name "xsensors")
3489 (version "0.70")
3490 (source (origin
3491 (method url-fetch)
3492 (uri (string-append
3493 "http://www.linuxhardware.org/xsensors/xsensors-"
3494 version ".tar.gz"))
3495 (sha256
3496 (base32
3497 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
3498 (build-system gnu-build-system)
3499 (inputs `(("lm-sensors" ,lm-sensors "lib")
3500 ("gtk" ,gtk+-2)))
3501 (native-inputs `(("pkg-config" ,pkg-config)))
3502 (arguments
3503 `(#:phases
3504 (modify-phases %standard-phases
3505 (add-before 'configure 'enable-deprecated
3506 (lambda _
3507 (substitute* "src/Makefile.in"
3508 (("-DGDK_DISABLE_DEPRECATED") "")
3509 (("-DGTK_DISABLE_DEPRECATED") ""))
3510 #t))
3511 (add-before 'configure 'remove-Werror
3512 (lambda _
3513 (substitute* '("configure" "src/Makefile.in")
3514 (("-Werror") ""))
3515 #t)))))
3516 (home-page "http://www.linuxhardware.org/xsensors/")
3517 (synopsis "Hardware health information viewer")
3518 (description
3519 "Xsensors reads data from the libsensors library regarding hardware
3520 health such as temperature, voltage and fan speed and displays the information
3521 in a digital read-out.")
3522 (license license:gpl2+)))
3523
3524 (define-public perf
3525 (package
3526 (name "perf")
3527 (version (package-version linux-libre))
3528 (source (package-source linux-libre))
3529 (build-system gnu-build-system)
3530 (arguments
3531 '(#:phases
3532 (modify-phases %standard-phases
3533 (replace 'configure
3534 (lambda* (#:key inputs #:allow-other-keys)
3535 (setenv "SHELL_PATH" (which "bash"))
3536 (chdir "tools/perf")
3537 #t)))
3538 #:make-flags (list (string-append "prefix="
3539 (assoc-ref %outputs "out"))
3540 ;; Make sure the kernel headers are treated as system
3541 ;; headers to suppress warnings from those.
3542 (string-append "C_INCLUDE_PATH="
3543 (assoc-ref %build-inputs "kernel-headers")
3544 "/include")
3545 "WERROR=0"
3546
3547 ;; By default, 'config/Makefile' uses lib64 on
3548 ;; x86_64. Work around that.
3549 "lib=lib")
3550 #:tests? #f)) ;no tests
3551 (native-inputs
3552 `(("pkg-config" ,pkg-config)
3553 ("bison" ,bison)
3554 ("flex" ,flex)
3555
3556 ;; There are build scripts written in these languages.
3557 ("perl" ,perl)
3558 ("python" ,python-2)))
3559 (inputs
3560 `(("slang" ,slang) ;for the interactive TUI
3561 ;; ("newt" ,newt)
3562 ("python" ,python-2) ;'perf' links against libpython
3563 ("elfutils" ,elfutils)
3564 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
3565 ("libunwind" ,libunwind) ;better stack walking
3566 ("numactl" ,numactl) ;for 'perf bench numa mem'
3567
3568 ;; Documentation.
3569 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3570 ("docbook-xsl" ,docbook-xsl)
3571 ("xmlto" ,xmlto)
3572 ("asciidoc" ,asciidoc)))
3573 (home-page "https://perf.wiki.kernel.org/")
3574 (synopsis "Linux profiling with performance counters")
3575 (description
3576 "perf is a tool suite for profiling using hardware performance counters,
3577 with support in the Linux kernel. perf can instrument CPU performance
3578 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3579 of lightweight profiling. This package contains the user-land tools and in
3580 particular the @code{perf} command.")
3581 (license (package-license linux-libre))))
3582
3583 (define-public pflask
3584 (package
3585 (name "pflask")
3586 (version "0.2")
3587 (source (origin
3588 (method url-fetch)
3589 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
3590 version ".tar.gz"))
3591 (file-name (string-append name "-" version ".tar.gz"))
3592 (sha256
3593 (base32
3594 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
3595 (build-system cmake-build-system)
3596 (arguments
3597 '(#:tests? #f)) ; no tests
3598 (home-page "https://ghedo.github.io/pflask/")
3599 (synopsis "Simple tool for creating Linux namespace containers")
3600 (description "pflask is a simple tool for creating Linux namespace
3601 containers. It can be used for running a command or even booting an OS inside
3602 an isolated container, created with the help of Linux namespaces. It is
3603 similar in functionality to chroot, although pflask provides better isolation
3604 thanks to the use of namespaces.")
3605 (license license:bsd-2)))
3606
3607 (define-public singularity
3608 (package
3609 (name "singularity")
3610 (version "2.6.1")
3611 (source (origin
3612 (method url-fetch)
3613 (uri (string-append "https://github.com/singularityware/singularity/"
3614 "releases/download/" version
3615 "/singularity-" version ".tar.gz"))
3616 (sha256
3617 (base32
3618 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
3619 (modules '((guix build utils)))
3620 (snippet
3621 '(begin
3622 ;; Do not create directories in /var.
3623 (substitute* "Makefile.in"
3624 (("\\$\\(MAKE\\) .*install-data-hook") ""))
3625
3626 ;; The original source overrides PATH so that it points to
3627 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
3628 ;; on Guix System. Leave PATH unchanged so we refer to the
3629 ;; installed Coreutils, grep, etc.
3630 (substitute* "bin/singularity.in"
3631 (("^PATH=.*" all)
3632 (string-append "#" all "\n")))
3633
3634 (substitute* (find-files "libexec/cli" "\\.exec$")
3635 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
3636 _ program)
3637 (string-append "/run/setuid-programs/singularity-"
3638 program "-helper")))
3639
3640 ;; These squashfs mount options are apparently no longer
3641 ;; supported since Linux-libre 5.4.5.
3642 (substitute* "src/lib/image/squashfs/mount.c"
3643 (("\"errors=remount-ro\"")
3644 "NULL"))
3645 #t))))
3646 (build-system gnu-build-system)
3647 (arguments
3648 `(#:configure-flags '("--localstatedir=/var")
3649 #:phases
3650 (modify-phases %standard-phases
3651 (add-after 'unpack 'patch-reference-to-squashfs-tools
3652 (lambda _
3653 (substitute* "libexec/cli/build.exec"
3654 (("if ! singularity_which mksquashfs") "if 0")
3655 (("if ! mksquashfs")
3656 (string-append "if ! " (which "mksquashfs"))))
3657 #t))
3658 (add-after 'install 'set-PATH
3659 (lambda* (#:key inputs outputs #:allow-other-keys)
3660 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
3661 (let ((out (assoc-ref outputs "out"))
3662 (coreutils (assoc-ref inputs "coreutils")))
3663 (wrap-program (string-append out "/bin/singularity")
3664 `("PATH" ":" = (,(string-append coreutils "/bin"))))
3665 (substitute* (string-append out "/bin/run-singularity")
3666 (("/usr/bin/env singularity")
3667 (string-append (which "env") " "
3668 out "/bin/singularity")))
3669 #t))))))
3670 (inputs
3671 `(("libarchive" ,libarchive)
3672 ("python" ,python-wrapper)
3673 ("zlib" ,zlib)
3674 ("squashfs-tools" ,squashfs-tools)))
3675 (home-page "https://singularity.lbl.gov/")
3676 (synopsis "Container platform")
3677 (description "Singularity is a container platform supporting a number of
3678 container image formats. It can build SquashFS container images or import
3679 existing Docker images. Singularity requires kernel support for container
3680 isolation or root privileges.")
3681 (license license:bsd-3)))
3682
3683 (define-public hdparm
3684 (package
3685 (name "hdparm")
3686 (version "9.58")
3687 (source (origin
3688 (method url-fetch)
3689 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
3690 "hdparm-" version ".tar.gz"))
3691 (sha256
3692 (base32
3693 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
3694 (build-system gnu-build-system)
3695 (arguments
3696 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3697 (list (string-append "binprefix=" out)
3698 (string-append "manprefix=" out)
3699 "CC=gcc"))
3700 #:phases
3701 (modify-phases %standard-phases
3702 (delete 'configure)) ; no configure script
3703 #:tests? #f)) ; no test suite
3704 (home-page "https://sourceforge.net/projects/hdparm/")
3705 (synopsis "View and tune ATA disk drive parameters")
3706 (description
3707 "@command{hdparm} is a command-line utility to control ATA controllers and
3708 disk drives. It can increase performance and/or reliability by careful tuning
3709 of hardware settings like power and acoustic management, DMA modes, and caching.
3710 It can also display detailed device information, or be used as a simple
3711 performance benchmarking tool.
3712
3713 @command{hdparm} provides a command line interface to various Linux kernel
3714 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
3715 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
3716 Translation (@dfn{SAT}) are also supported.")
3717 (license (license:non-copyleft "file://LICENSE.TXT"))))
3718
3719 (define-public nvme-cli
3720 (package
3721 (name "nvme-cli")
3722 (version "1.10.1")
3723 (home-page "https://github.com/linux-nvme/nvme-cli")
3724 (source (origin
3725 (method git-fetch)
3726 (uri (git-reference
3727 (url home-page)
3728 (commit (string-append "v" version))))
3729 (sha256
3730 (base32 "12wp2wxmsw2v8m9bhvwvdbhdgx1md8iilhbl19sfzz2araiwi2x8"))
3731 (file-name (git-file-name name version))))
3732 (build-system gnu-build-system)
3733 (arguments
3734 `(#:make-flags (list "CC=gcc")
3735 #:phases (modify-phases %standard-phases
3736 (delete 'configure) ; No ./configure script
3737 (replace 'install
3738 (lambda _
3739 (invoke "make" "install-spec" "PREFIX="
3740 (string-append "DESTDIR=" %output)))))
3741 #:tests? #f)) ; The tests require sysfs, which is not accessible from
3742 ; the build environment
3743 (synopsis "NVM-Express user space tooling for Linux")
3744 (description "Nvme-cli is a utility to provide standards compliant tooling
3745 for NVM-Express drives. It was made specifically for Linux as it relies on the
3746 IOCTLs defined by the mainline kernel driver.")
3747 (license license:gpl2+)))
3748
3749 (define-public rfkill
3750 (package
3751 (name "rfkill")
3752 (version "0.5")
3753 (source (origin
3754 (method url-fetch)
3755 (uri (string-append "mirror://kernel.org/software/network/"
3756 name "/" name "-" version ".tar.xz"))
3757 (sha256
3758 (base32
3759 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
3760 (build-system gnu-build-system)
3761 (arguments
3762 `(#:make-flags (list "CC=gcc"
3763 (string-append "PREFIX=" %output))
3764 #:phases (modify-phases %standard-phases
3765 (delete 'configure))
3766 #:tests? #f))
3767 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
3768 (synopsis "Tool for enabling and disabling wireless devices")
3769 (description
3770 "rfkill is a simple tool for accessing the rfkill device interface,
3771 which is used to enable and disable wireless networking devices, typically
3772 WLAN, Bluetooth and mobile broadband.")
3773 (license (license:non-copyleft "file://COPYING"
3774 "See COPYING in the distribution."))
3775 ;; rfkill is part of util-linux as of 2.31.
3776 (properties `((superseded . ,util-linux)))))
3777
3778 (define-public acpi
3779 (package
3780 (name "acpi")
3781 (version "1.7")
3782 (source (origin
3783 (method url-fetch)
3784 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
3785 version "/" name "-" version ".tar.gz"))
3786 (sha256
3787 (base32
3788 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
3789 (build-system gnu-build-system)
3790 (home-page "http://acpiclient.sourceforge.net")
3791 (synopsis "Display information on ACPI devices")
3792 (description "@code{acpi} attempts to replicate the functionality of the
3793 \"old\" @code{apm} command on ACPI systems, including battery and thermal
3794 information. It does not support ACPI suspending, only displays information
3795 about ACPI devices.")
3796 (license license:gpl2+)))
3797
3798 (define-public acpid
3799 (package
3800 (name "acpid")
3801 (version "2.0.32")
3802 (source (origin
3803 (method url-fetch)
3804 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
3805 version ".tar.xz"))
3806 (sha256
3807 (base32
3808 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
3809 (build-system gnu-build-system)
3810 (home-page "https://sourceforge.net/projects/acpid2/")
3811 (synopsis "Daemon for delivering ACPI events to user-space programs")
3812 (description
3813 "acpid is designed to notify user-space programs of Advanced
3814 Configuration and Power Interface (ACPI) events. acpid should be started
3815 during the system boot, and will run as a background process. When an ACPI
3816 event is received from the kernel, acpid will examine the list of rules
3817 specified in /etc/acpi/events and execute the rules that match the event.")
3818 (license license:gpl2+)))
3819
3820 (define-public sysfsutils
3821 (package
3822 (name "sysfsutils")
3823 (version "2.1.0")
3824 (source
3825 (origin
3826 (method url-fetch)
3827 (uri
3828 (string-append
3829 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
3830 version ".tar.gz"))
3831 (sha256
3832 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
3833 (build-system gnu-build-system)
3834 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
3835 (synopsis "System utilities based on Linux sysfs")
3836 (description
3837 "These are a set of utilities built upon sysfs, a virtual file system in
3838 Linux kernel versions 2.5+ that exposes a system's device tree. The package
3839 also contains the libsysfs library.")
3840 ;; The library is under lgpl2.1+ (all files say "or any later version").
3841 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3842 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
3843
3844 (define-public sysfsutils-1
3845 (package
3846 (inherit sysfsutils)
3847 (version "1.3.0")
3848 (source
3849 (origin
3850 (method url-fetch)
3851 (uri
3852 (string-append
3853 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
3854 "/sysfsutils-" version ".tar.gz"))
3855 (sha256
3856 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
3857 (modules '((guix build utils)))
3858 (snippet
3859 '(begin
3860 (substitute* "Makefile.in"
3861 (("includedir = /usr/include/sysfs")
3862 "includedir = @includedir@"))
3863 (substitute* "configure"
3864 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
3865 (string-append "includedir='" orig "/sysfs'")))
3866 #t))))
3867 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
3868
3869 (define-public cpufrequtils
3870 (package
3871 (name "cpufrequtils")
3872 (version "0.3")
3873 (source
3874 (origin
3875 (method url-fetch)
3876 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
3877 "cpufrequtils-" version ".tar.gz"))
3878 (sha256
3879 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
3880 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
3881 (build-system gnu-build-system)
3882 (native-inputs
3883 `(("sysfsutils" ,sysfsutils-1)))
3884 (arguments
3885 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3886 (assoc-ref %outputs "out") "/lib"))))
3887 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
3888 (synopsis "Utilities to get and set CPU frequency on Linux")
3889 (description
3890 "The cpufrequtils suite contains utilities to retrieve CPU frequency
3891 information, and set the CPU frequency if supported, using the cpufreq
3892 capabilities of the Linux kernel.")
3893 (license license:gpl2)))
3894
3895 (define-public libraw1394
3896 (package
3897 (name "libraw1394")
3898 (version "2.1.2")
3899 (source (origin
3900 (method url-fetch)
3901 (uri (string-append
3902 "mirror://kernel.org/linux/libs/ieee1394/"
3903 name "-" version ".tar.xz"))
3904 (sha256
3905 (base32
3906 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
3907 (build-system gnu-build-system)
3908 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3909 (synopsis "Interface library for the Linux IEEE1394 drivers")
3910 (description
3911 "Libraw1394 is the only supported interface to the kernel side raw1394 of
3912 the Linux IEEE-1394 subsystem, which provides direct access to the connected
3913 1394 buses to user space. Through libraw1394/raw1394, applications can directly
3914 send to and receive from other nodes without requiring a kernel driver for the
3915 protocol in question.")
3916 (license license:lgpl2.1+)))
3917
3918 (define-public libavc1394
3919 (package
3920 (name "libavc1394")
3921 (version "0.5.4")
3922 (source (origin
3923 (method url-fetch)
3924 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
3925 name "-" version ".tar.gz"))
3926 (sha256
3927 (base32
3928 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
3929 (build-system gnu-build-system)
3930 (native-inputs
3931 `(("pkg-config" ,pkg-config)))
3932 (propagated-inputs
3933 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3934 (home-page "https://sourceforge.net/projects/libavc1394/")
3935 (synopsis "AV/C protocol library for IEEE 1394")
3936 (description
3937 "Libavc1394 is a programming interface to the AV/C specification from
3938 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3939 (license license:lgpl2.1+)))
3940
3941 (define-public libiec61883
3942 (package
3943 (name "libiec61883")
3944 (version "1.2.0")
3945 (source (origin
3946 (method url-fetch)
3947 (uri (string-append
3948 "mirror://kernel.org/linux/libs/ieee1394/"
3949 name "-" version ".tar.xz"))
3950 (sha256
3951 (base32
3952 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
3953 (build-system gnu-build-system)
3954 (native-inputs
3955 `(("pkg-config" ,pkg-config)))
3956 (propagated-inputs
3957 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
3958 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3959 (synopsis "Isochronous streaming media library for IEEE 1394")
3960 (description
3961 "The libiec61883 library provides a higher level API for streaming DV,
3962 MPEG-2 and audio over Linux IEEE 1394.")
3963 (license license:lgpl2.1+)))
3964
3965 (define-public mdadm
3966 (package
3967 (name "mdadm")
3968 (version "4.1")
3969 (source (origin
3970 (method url-fetch)
3971 (uri (string-append
3972 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
3973 version ".tar.xz"))
3974 (sha256
3975 (base32
3976 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
3977 (build-system gnu-build-system)
3978 (inputs
3979 `(("udev" ,eudev)))
3980 (arguments
3981 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3982 (list "CC=gcc"
3983 "INSTALL=install"
3984 "CHECK_RUN_DIR=0"
3985 ;; TODO: tell it where to find 'sendmail'
3986 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
3987 (string-append "BINDIR=" out "/sbin")
3988 (string-append "MANDIR=" out "/share/man")
3989 (string-append "UDEVDIR=" out "/lib/udev")))
3990 #:phases
3991 (modify-phases %standard-phases
3992 (add-before 'build 'patch-program-paths
3993 (lambda* (#:key inputs #:allow-other-keys)
3994 (let ((coreutils (assoc-ref inputs "coreutils")))
3995 (substitute* "udev-md-raid-arrays.rules"
3996 (("/usr/bin/(readlink|basename)" all program)
3997 (string-append coreutils "/bin/" program))))
3998 #t))
3999 (add-before 'build 'remove-W-error
4000 (lambda _
4001 ;; We cannot build with -Werror on i686 due to a
4002 ;; 'sign-compare' warning in util.c.
4003 (substitute* "Makefile"
4004 (("-Werror") ""))
4005 #t))
4006 (delete 'configure))
4007 ;;tests must be done as root
4008 #:tests? #f))
4009 (home-page "http://neil.brown.name/blog/mdadm")
4010 (synopsis "Tool for managing Linux Software RAID arrays")
4011 (description
4012 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
4013 assemble, report on, and monitor arrays. It can also move spares between raid
4014 arrays when needed.")
4015 (license license:gpl2+)))
4016
4017 (define-public mdadm-static
4018 (package
4019 (inherit mdadm)
4020 (name "mdadm-static")
4021 (arguments
4022 (substitute-keyword-arguments (package-arguments mdadm)
4023 ((#:make-flags flags)
4024 `(cons "LDFLAGS = -static" ,flags))
4025 ((#:phases phases)
4026 `(modify-phases ,phases
4027 (add-after 'install 'remove-cruft
4028 (lambda* (#:key outputs #:allow-other-keys)
4029 (let* ((out (assoc-ref outputs "out"))
4030 (precious? (lambda (file)
4031 (member file '("." ".." "sbin"))))
4032 (directories (scandir out (negate precious?))))
4033 (with-directory-excursion out
4034 (for-each delete-file-recursively directories)
4035 (remove-store-references "sbin/mdadm")
4036 (delete-file "sbin/mdmon")
4037 #t))))))
4038 ((#:modules modules %gnu-build-system-modules)
4039 `((ice-9 ftw) ,@modules))
4040 ((#:strip-flags _ '())
4041 ''("--strip-all")) ;strip a few extra KiB
4042 ((#:allowed-references _ '("out"))
4043 '("out")))) ;refer only self
4044 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
4045
4046 (define-public multipath-tools
4047 (package
4048 (name "multipath-tools")
4049 (version "0.8.3")
4050 (source (origin
4051 (method url-fetch)
4052 (uri (string-append "https://git.opensvc.com/?p=multipath-tools/"
4053 ".git;a=snapshot;h=" version ";sf=tgz"))
4054 (file-name (string-append name "-" version ".tar.gz"))
4055 (sha256
4056 (base32
4057 "1c6ay97wlfv1fl0y8hcfpxhkps14hlnw9gzmj7884micsp7pa9yv"))
4058 (modules '((guix build utils)))
4059 (snippet
4060 '(begin
4061 ;; Drop bundled valgrind headers.
4062 (delete-file-recursively "third-party")
4063 (substitute* '("multipathd/main.c"
4064 "libmultipath/debug.c")
4065 (("#include \"../third-party/")
4066 "#include \""))
4067 #t))))
4068 (build-system gnu-build-system)
4069 (arguments
4070 '(#:tests? #f ; no tests
4071 #:make-flags (list "CC=gcc"
4072 (string-append "DESTDIR="
4073 (assoc-ref %outputs "out"))
4074 "SYSTEMDPATH=lib"
4075 ;; Add the libaio headers to GCCs system header
4076 ;; search path to suppress -Werror=cast-qual on
4077 ;; the included headers.
4078 (string-append "C_INCLUDE_PATH="
4079 (assoc-ref %build-inputs "libaio")
4080 "/include")
4081 (string-append "LDFLAGS=-Wl,-rpath="
4082 (assoc-ref %outputs "out")
4083 "/lib"))
4084 #:phases
4085 (modify-phases %standard-phases
4086 (add-after 'unpack 'patch-source
4087 (lambda* (#:key inputs #:allow-other-keys)
4088 (let ((lvm2 (assoc-ref inputs "lvm2"))
4089 (udev (assoc-ref inputs "udev")))
4090 (substitute* "Makefile.inc"
4091 (("\\$\\(prefix\\)/usr") "$(prefix)")
4092 ;; Do not save timestamp to avoid gzip "timestamp
4093 ;; out-of-range" warnings.
4094 (("gzip -9") "gzip -9n"))
4095 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
4096 (("/usr/include/libdevmapper.h")
4097 (string-append lvm2 "/include/libdevmapper.h"))
4098 (("/usr/include/libudev.h")
4099 (string-append udev "/include/libudev.h")))
4100 #t)))
4101 (delete 'configure)))) ; no configure script
4102 (native-inputs
4103 `(("perl" ,perl)
4104 ("pkg-config" ,pkg-config)
4105 ("valgrind" ,valgrind)))
4106 (inputs
4107 `(("json-c" ,json-c)
4108 ("libaio" ,libaio)
4109 ("liburcu" ,liburcu)
4110 ("lvm2" ,lvm2)
4111 ("readline" ,readline)
4112 ("udev" ,eudev)))
4113 (home-page "http://christophe.varoqui.free.fr/")
4114 (synopsis "Access block devices through multiple paths")
4115 (description
4116 "This package provides the following binaries to drive the
4117 Linux Device Mapper multipathing driver:
4118 @enumerate
4119 @item @command{multipath} - Device mapper target autoconfig.
4120 @item @command{multipathd} - Multipath daemon.
4121 @item @command{mpathpersist} - Manages SCSI persistent reservations on
4122 @code{dm} multipath devices.
4123 @item @command{kpartx} - Create device maps from partition tables.
4124 @end enumerate")
4125 (license (list license:gpl2+ ; main distribution
4126 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
4127
4128 (define-public libaio
4129 (package
4130 (name "libaio")
4131 (version "0.3.112")
4132 (source (origin
4133 (method url-fetch)
4134 (uri (list
4135 (string-append "https://releases.pagure.org/libaio/"
4136 name "-" version ".tar.gz")))
4137 (sha256
4138 (base32
4139 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
4140 (build-system gnu-build-system)
4141 (arguments
4142 '(#:make-flags
4143 (list "CC=gcc" (string-append "prefix=" %output))
4144 #:test-target "partcheck" ; need root for a full 'check'
4145 #:phases
4146 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
4147 (home-page "https://pagure.io/libaio")
4148 (synopsis "Linux-native asynchronous I/O access library")
4149 (description
4150 "This library enables userspace to use Linux kernel asynchronous I/O
4151 system calls, important for the performance of databases and other advanced
4152 applications.")
4153 (license license:lgpl2.1+)))
4154
4155 (define-public blktrace
4156 ;; Take a newer commit to get the fix for CVE-2018-10689.
4157 (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
4158 (revision "1"))
4159 (package
4160 (name "blktrace")
4161 (version (git-version "1.2.0" revision commit))
4162 (home-page
4163 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
4164 (source (origin
4165 (method git-fetch)
4166 (uri (git-reference
4167 (url home-page)
4168 (commit commit)))
4169 (sha256
4170 (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
4171 (file-name (git-file-name name version))))
4172 (build-system gnu-build-system)
4173 (arguments
4174 '(#:make-flags
4175 (list "CC=gcc" (string-append "prefix=" %output))
4176 #:tests? #f ; no tests
4177 #:phases
4178 (modify-phases %standard-phases
4179 (delete 'configure) ; no configure script
4180 (add-after 'unpack 'fix-gnuplot-path
4181 (lambda* (#:key inputs #:allow-other-keys)
4182 (let ((gnuplot (assoc-ref inputs "gnuplot")))
4183 (substitute* "btt/bno_plot.py"
4184 (("gnuplot %s")
4185 (string-append gnuplot "/bin/gnuplot %s")))
4186 #t))))))
4187 (inputs
4188 `(("libaio" ,libaio)
4189 ("gnuplot" ,gnuplot)
4190 ("python" ,python-wrapper))) ;for 'bno_plot.py'
4191 (synopsis "Block layer IO tracing mechanism")
4192 (description "Blktrace is a block layer IO tracing mechanism which provides
4193 detailed information about request queue operations to user space. It extracts
4194 event traces from the kernel (via the relaying through the debug file system).")
4195 (license license:gpl2))))
4196
4197 (define-public sbc
4198 (package
4199 (name "sbc")
4200 (version "1.4")
4201 (source (origin
4202 (method url-fetch)
4203 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
4204 version ".tar.xz"))
4205 (sha256
4206 (base32
4207 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
4208 (build-system gnu-build-system)
4209 (inputs
4210 `(("libsndfile" ,libsndfile)))
4211 (native-inputs
4212 `(("pkg-config" ,pkg-config)))
4213 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
4214 (synopsis "Bluetooth subband audio codec")
4215 (description
4216 "The SBC is a digital audio encoder and decoder used to transfer data to
4217 Bluetooth audio output devices like headphones or loudspeakers.")
4218 (license license:gpl2+)))
4219
4220 (define-public bluez
4221 (package
4222 (name "bluez")
4223 (replacement bluez/fixed)
4224 (version "5.53")
4225 (source (origin
4226 (method url-fetch)
4227 (uri (string-append
4228 "mirror://kernel.org/linux/bluetooth/bluez-"
4229 version ".tar.xz"))
4230 (sha256
4231 (base32
4232 "1g1qg6dz6hl3csrmz75ixr12lwv836hq3ckb259svvrg62l2vaiq"))))
4233 (build-system gnu-build-system)
4234 (arguments
4235 `(#:configure-flags
4236 (let ((out (assoc-ref %outputs "out")))
4237 (list "--sysconfdir=/etc"
4238 "--localstatedir=/var"
4239 "--enable-library"
4240 "--disable-systemd"
4241 ;; Install dbus/udev files to the correct location.
4242 (string-append "--with-dbusconfdir=" out "/etc")
4243 (string-append "--with-udevdir=" out "/lib/udev")))
4244 #:phases
4245 (modify-phases %standard-phases
4246 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
4247 ;; issue (discussion on upstream mailing list:
4248 ;; https://marc.info/?t=149578476300002&r=1&w=2)
4249 (add-before 'check 'skip-wonky-test
4250 (lambda _
4251 (substitute* "unit/test-gatt.c"
4252 (("tester_init\\(&argc, &argv\\);") "return 77;"))
4253 #t))
4254 (add-after 'install 'post-install
4255 (lambda* (#:key inputs outputs #:allow-other-keys)
4256 (let* ((out (assoc-ref outputs "out"))
4257 (servicedir (string-append out "/share/dbus-1/services"))
4258 (service "obexd/src/org.bluez.obex.service")
4259 (rule (string-append
4260 out "/lib/udev/rules.d/97-hid2hci.rules")))
4261 ;; Install the obex dbus service file.
4262 (substitute* service
4263 (("/bin/false")
4264 (string-append out "/libexec/bluetooth/obexd")))
4265 (install-file service servicedir)
4266 ;; Fix paths in the udev rule.
4267 (substitute* rule
4268 (("hid2hci --method")
4269 (string-append out "/lib/udev/hid2hci --method"))
4270 (("/sbin/udevadm")
4271 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
4272 #t))))))
4273 (native-inputs
4274 `(("pkg-config" ,pkg-config)
4275 ("gettext" ,gettext-minimal)))
4276 (inputs
4277 `(("glib" ,glib)
4278 ("dbus" ,dbus)
4279 ("eudev" ,eudev)
4280 ("libical" ,libical)
4281 ("readline" ,readline)))
4282 (home-page "http://www.bluez.org/")
4283 (synopsis "Linux Bluetooth protocol stack")
4284 (description
4285 "BlueZ provides support for the core Bluetooth layers and protocols. It
4286 is flexible, efficient and uses a modular implementation.")
4287 (license license:gpl2+)))
4288
4289 (define bluez/fixed
4290 (package
4291 (inherit bluez)
4292 (source (origin
4293 (inherit (package-source bluez))
4294 (patches (append (origin-patches (package-source bluez))
4295 (search-patches "bluez-CVE-2020-0556.patch")))))))
4296
4297 (define-public fuse-exfat
4298 (package
4299 (name "fuse-exfat")
4300 (version "1.3.0")
4301 (source (origin
4302 (method url-fetch)
4303 (uri (string-append
4304 "https://github.com/relan/exfat/releases/download/v"
4305 version "/" name "-" version ".tar.gz"))
4306 (sha256
4307 (base32
4308 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
4309 (build-system gnu-build-system)
4310 (native-inputs
4311 `(("pkg-config" ,pkg-config)))
4312 (inputs
4313 `(("fuse" ,fuse)))
4314 (home-page "https://github.com/relan/exfat")
4315 (synopsis "Mount exFAT file systems")
4316 (description
4317 "This package provides a FUSE-based file system that provides read and
4318 write access to exFAT devices.")
4319 (license license:gpl2+)))
4320
4321 (define-public fuseiso
4322 (package
4323 (name "fuseiso")
4324 (version "20070708")
4325 (source (origin
4326 (method url-fetch)
4327 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
4328 version "/fuseiso-" version ".tar.bz2"))
4329 (sha256
4330 (base32
4331 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
4332 (build-system gnu-build-system)
4333 (native-inputs
4334 `(("pkg-config" ,pkg-config)))
4335 (inputs
4336 `(("fuse" ,fuse)
4337 ("glib" ,glib)
4338 ("zlib" ,zlib)))
4339 (home-page "https://sourceforge.net/projects/fuseiso/")
4340 (synopsis "Mount ISO file system images")
4341 (description
4342 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
4343 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
4344 Ridge, Joliet, and zisofs.")
4345 (license license:gpl2)))
4346
4347 (define-public gpm
4348 (package
4349 (name "gpm")
4350 (version "1.20.7")
4351 (source (origin
4352 (method url-fetch)
4353 (uri (string-append
4354 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
4355 version ".tar.bz2"))
4356 (patches (search-patches "gpm-glibc-2.26.patch"))
4357 (sha256
4358 (base32
4359 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
4360 (build-system gnu-build-system)
4361 (arguments
4362 '(#:phases (modify-phases %standard-phases
4363 (replace 'bootstrap
4364 (lambda _
4365 ;; The tarball was not generated with 'make dist' so we
4366 ;; need to bootstrap things ourselves.
4367 (substitute* "autogen.sh"
4368 (("/bin/sh") (which "sh")))
4369 (invoke "./autogen.sh")
4370 (patch-makefile-SHELL "Makefile.include.in")
4371 #t)))
4372
4373 ;; Make sure programs find libgpm.so.
4374 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4375 (assoc-ref %outputs "out")
4376 "/lib"))))
4377 (native-inputs
4378 `(("texinfo" ,texinfo)
4379 ("bison" ,bison)
4380 ("flex" ,flex)
4381 ("autoconf" ,autoconf)
4382 ("automake" ,automake)
4383 ("libtool" ,libtool)))
4384 (home-page "http://www.nico.schottelius.org/software/gpm/")
4385 (synopsis "Mouse support for the Linux console")
4386 (description
4387 "The GPM (general-purpose mouse) daemon is a mouse server for
4388 applications running on the Linux console. It allows users to select items
4389 and copy/paste text in the console and in xterm.")
4390 (license license:gpl2+)))
4391
4392 (define-public btrfs-progs
4393 (package
4394 (name "btrfs-progs")
4395 (version "5.6")
4396 (source (origin
4397 (method url-fetch)
4398 (uri (string-append "mirror://kernel.org/linux/kernel/"
4399 "people/kdave/btrfs-progs/"
4400 "btrfs-progs-v" version ".tar.xz"))
4401 (sha256
4402 (base32
4403 "0srg276yccfmqz0skmmga3vbqx4wiqsk1l6h86n6ryhxa9viqcm1"))))
4404 (build-system gnu-build-system)
4405 (outputs '("out"
4406 "static")) ; static versions of the binaries in "out"
4407 (arguments
4408 '(#:phases (modify-phases %standard-phases
4409 (add-after 'unpack 'patch-makefile
4410 (lambda* (#:key outputs #:allow-other-keys)
4411 (substitute* "Makefile"
4412 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
4413 (string-append (assoc-ref outputs "out")
4414 "/lib/udev/rules.d")))
4415 #t))
4416 (add-after 'build 'build-static
4417 (lambda _ (invoke "make" "static")))
4418 (add-after 'install 'install-bash-completion
4419 (lambda* (#:key outputs #:allow-other-keys)
4420 (let* ((out (assoc-ref outputs "out"))
4421 (bashcomp (string-append out "/etc/bash_completion.d")))
4422 (mkdir-p bashcomp)
4423 (copy-file "btrfs-completion"
4424 (string-append bashcomp "/btrfs"))
4425 #t)))
4426 (add-after 'install 'install-static
4427 (let ((staticbin (string-append (assoc-ref %outputs "static")
4428 "/bin")))
4429 (lambda _
4430 (invoke "make"
4431 (string-append "bindir=" staticbin)
4432 "install-static")))))
4433 #:tests? #f ; XXX: require the 'btrfs' kernel module.
4434 #:test-target "test"
4435 #:parallel-tests? #f)) ; tests fail when run in parallel
4436 (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
4437 ("libblkid" ,util-linux)
4438 ("libblkid:static" ,util-linux "static")
4439 ("libuuid" ,util-linux)
4440 ("libuuid:static" ,util-linux "static")
4441 ("lzo" ,lzo)
4442 ("zlib" ,zlib)
4443 ("zlib:static" ,zlib "static")
4444 ("zstd" ,zstd "lib")
4445 ("zstd:static" ,zstd "static")))
4446 (native-inputs `(("pkg-config" ,pkg-config)
4447 ("asciidoc" ,asciidoc)
4448 ("python" ,python)
4449 ("xmlto" ,xmlto)
4450 ;; For building documentation.
4451 ("libxml2" ,libxml2)
4452 ("docbook-xsl" ,docbook-xsl)
4453 ;; For tests.
4454 ("acl" ,acl)
4455 ("which" ,which)
4456 ("dmsetup" ,lvm2)
4457 ("udevadm" ,eudev)
4458 ;; The tests need 'grep' with perl regexp support.
4459 ("grep" ,grep)))
4460 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
4461 (synopsis "Create and manage btrfs copy-on-write file systems")
4462 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
4463 aimed at implementing advanced features while focusing on fault tolerance,
4464 repair and easy administration.")
4465 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
4466 ;; GPL2: Everything else.
4467 (license (list license:gpl2 license:gpl2+))))
4468
4469 (define-public btrfs-progs/static
4470 (package
4471 (name "btrfs-progs-static")
4472 (version (package-version btrfs-progs))
4473 (source #f)
4474 (build-system trivial-build-system)
4475 (inputs
4476 `(("btrfs-progs:static" ,btrfs-progs "static")))
4477 (arguments
4478 `(#:modules ((guix build utils))
4479 #:builder
4480 (begin
4481 (use-modules (guix build utils)
4482 (ice-9 ftw)
4483 (srfi srfi-26))
4484
4485 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
4486 (out (assoc-ref %outputs "out"))
4487 (source (string-append btrfs "/bin/btrfs.static"))
4488 (target (string-append out "/bin/btrfs")))
4489 (mkdir-p (dirname target))
4490 (copy-file source target)
4491 (remove-store-references target)
4492 (chmod target #o555)
4493 #t))))
4494 (home-page (package-home-page btrfs-progs))
4495 (synopsis "Statically-linked btrfs command from btrfs-progs")
4496 (description "This package provides the statically-linked @command{btrfs}
4497 from the btrfs-progs package. It is meant to be used in initrds.")
4498 (license (package-license btrfs-progs))))
4499
4500 (define-public cramfs-tools
4501 (package
4502 (name "cramfs-tools")
4503 (home-page "https://github.com/npitre/cramfs-tools")
4504 (version "2.1")
4505 (source (origin
4506 (method git-fetch)
4507 (uri (git-reference
4508 (url home-page)
4509 (commit (string-append "v" version))))
4510 (sha256
4511 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
4512 (file-name (git-file-name name version))))
4513 (build-system gnu-build-system)
4514 (arguments
4515 '(#:tests? #f ; No tests.
4516 #:phases
4517 (modify-phases %standard-phases
4518 (delete 'configure)
4519 (replace 'install
4520 (lambda* (#:key outputs #:allow-other-keys)
4521 (let ((out (assoc-ref outputs "out")))
4522 (install-file "mkcramfs" (string-append out "/sbin"))
4523 (install-file "cramfsck" (string-append out "/sbin")))
4524 #t)))))
4525 (inputs
4526 `(("zlib" ,zlib)))
4527 (synopsis "Tools to manage Cramfs file systems")
4528 (description "Cramfs is a Linux file system designed to be simple, small,
4529 and to compress things well. It is used on a number of embedded systems and
4530 small devices. This version has additional features such as uncompressed
4531 blocks and random block placement.")
4532 (license license:gpl2+)))
4533
4534 (define-public compsize
4535 (package
4536 (name "compsize")
4537 (version "1.3")
4538 (home-page "https://github.com/kilobyte/compsize")
4539 (source (origin
4540 (method git-fetch)
4541 (uri (git-reference
4542 (url home-page)
4543 (commit (string-append "v" version))))
4544 (sha256
4545 (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43"))
4546 (file-name (git-file-name name version))))
4547 (build-system gnu-build-system)
4548 (inputs
4549 `(("btrfs-progs" ,btrfs-progs)))
4550 (arguments
4551 `(#:tests? #f ; No tests.
4552 #:make-flags (list "CC=gcc")
4553 #:phases
4554 (modify-phases %standard-phases
4555 (delete 'configure)
4556 (replace 'install
4557 (lambda* (#:key outputs #:allow-other-keys)
4558 (let ((out (assoc-ref outputs "out")))
4559 (install-file "compsize" (string-append out "/bin"))
4560 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
4561 (synopsis "Find compression type/ratio on Btrfs files")
4562 (description "@command{compsize} takes a list of files (given as
4563 arguments) on a Btrfs file system and measures used compression types and
4564 effective compression ratio, producing a report.
4565
4566 A directory has no extents but has a (recursive) list of files. A non-regular
4567 file is silently ignored.
4568
4569 As it makes no sense to talk about compression ratio of a partial extent,
4570 every referenced extent is counted whole, exactly once -- no matter if you use
4571 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
4572 uncompressed size will not match the number given by @command{tar} or
4573 @command{du}. On the other hand, the space used should be accurate (although
4574 obviously it can be shared with files outside our set).")
4575 (license license:gpl2+)))
4576
4577 (define-public f2fs-tools-1.7
4578 (package
4579 (name "f2fs-tools")
4580 (version "1.7.0")
4581 (source (origin
4582 (method url-fetch)
4583 (uri (string-append
4584 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4585 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4586 (sha256
4587 (base32
4588 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
4589
4590 (build-system gnu-build-system)
4591 (arguments
4592 `(#:phases
4593 (modify-phases %standard-phases
4594 (add-after 'install 'install-headers
4595 (lambda* (#:key outputs #:allow-other-keys)
4596 (let* ((out (assoc-ref outputs "out"))
4597 (out-include (string-append out "/include")))
4598 (install-file "include/f2fs_fs.h" out-include)
4599 (install-file "mkfs/f2fs_format_utils.h" out-include)
4600 #t))))))
4601 (native-inputs
4602 `(("autoconf" ,autoconf)
4603 ("automake" ,automake)
4604 ("libtool" ,libtool)
4605 ("pkg-config" ,pkg-config)))
4606 (inputs
4607 `(("libuuid" ,util-linux)
4608 ("libselinux" ,libselinux)))
4609 (home-page "https://f2fs.wiki.kernel.org/")
4610 (synopsis "Userland tools for f2fs")
4611 (description
4612 "F2FS, the Flash-Friendly File System, is a modern file system
4613 designed to be fast and durable on flash devices such as solid-state
4614 disks and SD cards. This package provides the userland utilities.")
4615 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
4616 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
4617 (license (list license:gpl2 license:lgpl2.1))))
4618
4619 (define-public f2fs-tools
4620 (package
4621 (inherit f2fs-tools-1.7)
4622 (name "f2fs-tools")
4623 (version "1.13.0")
4624 (source (origin
4625 (method url-fetch)
4626 (uri (string-append
4627 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4628 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4629 (sha256
4630 (base32
4631 "0z9c0y3qq75iyqknl5k0v7v46l8c3pcifpqb0yqalrs24blkm7dk"))))
4632 (inputs
4633 `(("libuuid" ,util-linux)))))
4634
4635 (define-public f2fs-tools/static
4636 (static-package
4637 (package
4638 (inherit f2fs-tools)
4639 (name "f2fs-tools-static")
4640 (arguments
4641 `(#:configure-flags
4642 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
4643 (libuuid (assoc-ref %build-inputs "libuuid")))
4644 (list
4645 (string-append "libuuid_CFLAGS=-I" libuuid "/include")
4646 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
4647 (string-append "libblkid_CFLAGS=-I" libuuid "/include")
4648 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
4649 #:disallowed-references (,util-linux)
4650 #:phases
4651 (modify-phases %standard-phases ; TODO: f2fs phases.
4652 (add-after 'unpack 'make-static
4653 (lambda _
4654 (define (append-to-file name body)
4655 (let ((file (open-file name "a")))
4656 (display body file)
4657 (close-port file)))
4658 (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n")
4659 (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n")
4660 (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n")
4661 #t))
4662 (add-after 'install 'remove-store-references
4663 (lambda* (#:key outputs #:allow-other-keys)
4664 ;; Work around bug in our util-linux.
4665 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
4666 (remove-store-references (string-append (assoc-ref outputs "out")
4667 "/sbin/mkfs.f2fs"))
4668 #t)))))
4669 (inputs
4670 `(("libuuid:static" ,util-linux "static")
4671 ("libuuid" ,util-linux)))))) ; for include files
4672
4673 (define-public f2fs-fsck/static
4674 (package
4675 (name "f2fs-fsck-static")
4676 (version (package-version f2fs-tools/static))
4677 (source #f)
4678 (build-system trivial-build-system)
4679 (arguments
4680 `(#:modules ((guix build utils))
4681 #:builder
4682 (begin
4683 (use-modules (guix build utils)
4684 (ice-9 ftw)
4685 (srfi srfi-26))
4686 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
4687 (fsck "fsck.f2fs")
4688 (out (assoc-ref %outputs "out"))
4689 (sbin (string-append out "/sbin")))
4690 (mkdir-p sbin)
4691 (with-directory-excursion sbin
4692 (install-file (string-append f2fs-tools "/sbin/" fsck)
4693 ".")
4694 (remove-store-references fsck)
4695 (chmod fsck #o555))
4696 #t))))
4697 (inputs
4698 `(("f2fs-tools-static" ,f2fs-tools/static)))
4699 (home-page (package-home-page f2fs-tools/static))
4700 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
4701 (description "This package provides statically-linked fsck.f2fs command taken
4702 from the f2fs-tools package. It is meant to be used in initrds.")
4703 (license (package-license f2fs-tools/static))))
4704
4705 (define-public freefall
4706 (package
4707 (name "freefall")
4708 (version (package-version linux-libre))
4709 (source (package-source linux-libre))
4710 (build-system gnu-build-system)
4711 (arguments
4712 '(#:phases (modify-phases %standard-phases
4713 (add-after 'unpack 'enter-subdirectory
4714 (lambda _
4715 (chdir "tools/laptop/freefall")
4716 #t))
4717 (delete 'configure)
4718 (add-before 'build 'increase-timeout
4719 (lambda _
4720 ;; The default of 2 seconds is too low: it assumes an
4721 ;; open lid and AC power without actually checking.
4722 (substitute* "freefall.c"
4723 (("alarm\\(2\\)") "alarm(5)"))
4724 #t)))
4725 #:make-flags (list (string-append "PREFIX="
4726 (assoc-ref %outputs "out"))
4727 "CC=gcc")
4728 #:tests? #f)) ;no tests
4729 (home-page (package-home-page linux-libre))
4730 (synopsis "Free-fall protection for spinning laptop hard drives")
4731 (description
4732 "Prevents shock damage to the internal spinning hard drive(s) of some
4733 HP and Dell laptops. When sudden movement is detected, all input/output
4734 operations on the drive are suspended and its heads are parked on the ramp,
4735 where they are less likely to cause damage to the spinning disc. Requires a
4736 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
4737 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
4738 (license license:gpl2)))
4739
4740 (define-public thinkfan
4741 (package
4742 (name "thinkfan")
4743 (version "1.1")
4744 (source
4745 (origin
4746 (method git-fetch)
4747 (uri (git-reference
4748 (url "https://github.com/vmatare/thinkfan.git")
4749 (commit version)))
4750 (file-name (git-file-name name version))
4751 (sha256
4752 (base32 "1fxd1w3z65glw6y04myn7ihgswkx6sqnkky159mik4n96pfrsvr5"))))
4753 (build-system cmake-build-system)
4754 (arguments
4755 `(#:modules ((guix build cmake-build-system)
4756 (guix build utils)
4757 (srfi srfi-26))
4758 #:tests? #f ; no test target
4759 #:configure-flags
4760 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
4761 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
4762 ;; inefficient’.
4763 `("-DUSE_ATASMART:BOOL=ON")
4764 #:phases
4765 (modify-phases %standard-phases
4766 (add-after 'unpack 'create-init-scripts
4767 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
4768 ;; systemd to patch and install their service files. Fake their
4769 ;; presence rather than duplicating the build system below. Leave
4770 ;; things like ‘/bin/kill’ because they're not worth a dependency.
4771 ;; The sysvinit needs manual patching, but since upstream doesn't
4772 ;; even provide the option to install it: don't.
4773 (lambda* (#:key outputs #:allow-other-keys)
4774 (let* ((out (assoc-ref outputs "out"))
4775 (share (string-append out "/share/" ,name)))
4776 (substitute* "CMakeLists.txt"
4777 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
4778 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
4779 ;; That was easy! Now we just need to fix the destinations.
4780 (("/etc" directory)
4781 (string-append out directory)))
4782 #t))))))
4783 (native-inputs
4784 `(("pkg-config" ,pkg-config)))
4785 (inputs
4786 `(("libatasmart" ,libatasmart)
4787 ("yaml-cpp" ,yaml-cpp)))
4788 (home-page "http://thinkfan.sourceforge.net/")
4789 (synopsis "Simple fan control program")
4790 (description
4791 "Thinkfan is a simple fan control program. It reads temperatures,
4792 checks them against configured limits and switches to appropriate (also
4793 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
4794 other @code{hwmon} driver that enables temperature reading and fan control
4795 from userspace.")
4796 (license license:gpl3+)))
4797
4798 (define-public tpacpi-bat
4799 (package
4800 (name "tpacpi-bat")
4801 (version "3.1")
4802 (source
4803 (origin
4804 (method git-fetch)
4805 (uri (git-reference
4806 (url "https://github.com/teleshoes/tpacpi-bat.git")
4807 (commit (string-append "v" version))))
4808 (file-name (git-file-name name version))
4809 (sha256
4810 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
4811 (build-system gnu-build-system)
4812 (arguments
4813 `(#:tests? #f ; no test target
4814 #:phases
4815 (modify-phases %standard-phases
4816 (add-after 'unpack 'refer-to-inputs
4817 (lambda _
4818 (substitute* "tpacpi-bat"
4819 (("cat ")
4820 (format #f "~a " (which "cat")))
4821 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
4822 ;; loaded. That's the administrator's prerogative; disable it.
4823 (("system \"(modprobe .*)\"" _ match)
4824 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))
4825 #t))
4826 (delete 'configure) ; nothing to configure
4827 (delete 'build) ; nothing to build
4828 (replace 'install
4829 (lambda* (#:key outputs #:allow-other-keys)
4830 (let* ((out (assoc-ref outputs "out"))
4831 (bin (string-append out "/bin"))
4832 (doc (string-append out "/share/doc/" ,name "-" ,version)))
4833 (install-file "tpacpi-bat" bin)
4834
4835 ;; There's no man page. Install other forms of documentation.
4836 (for-each (lambda (file)
4837 (let ((target (string-append doc "/" file)))
4838 (mkdir-p (dirname target))
4839 (copy-recursively file target)))
4840 (list "battery_asl" "examples" "README.md"))
4841 #t))))))
4842 (inputs
4843 `(("perl" ,perl)))
4844 (home-page "https://github.com/teleshoes/tpacpi-bat")
4845 (synopsis "ThinkPad battery charge controller")
4846 (description
4847 "Tpacpi-bat is a command-line interface to control battery charging on
4848 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
4849 ThinkPad models released after 2011}, starting with the xx20 series. It can
4850 query and set the thresholds at which one or both batteries will start and stop
4851 charging, inhibit charging batteries for a set period of time, or force them to
4852 discharge when they otherwise would not.
4853
4854 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
4855 kernel module provided by the @code{acpi-call-linux-module} package, which must
4856 be installed and loaded separately. Only the original vendor firmware is
4857 supported.")
4858 (license license:gpl3+)))
4859
4860 (define-public ntfs-3g
4861 (package
4862 (name "ntfs-3g")
4863 (version "2017.3.23")
4864 (source (origin
4865 (method url-fetch)
4866 (uri (string-append "https://tuxera.com/opensource/"
4867 "ntfs-3g_ntfsprogs-" version ".tgz"))
4868 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
4869 (sha256
4870 (base32
4871 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
4872 (modules '((guix build utils)))
4873 (snippet '(begin
4874 ;; Install under $prefix.
4875 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
4876 (("/sbin")
4877 "@sbindir@"))
4878 #t))))
4879 (build-system gnu-build-system)
4880 (inputs `(("util-linux" ,util-linux)
4881 ("fuse" ,fuse))) ;libuuid
4882 (native-inputs `(("pkg-config" ,pkg-config)))
4883 (arguments
4884 '(#:configure-flags (list "--exec-prefix=${prefix}"
4885 "--with-fuse=external" ;use our own FUSE
4886 "--enable-mount-helper"
4887 "--enable-posix-acls"
4888 "--enable-xattr-mappings")
4889 #:phases
4890 (modify-phases %standard-phases
4891 ;; If users install ntfs-3g, they probably want to make it the
4892 ;; default driver as well, so we opt for sensible defaults and link
4893 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
4894 ;; mount NTFS file systems.)
4895 (add-after 'install 'install-link
4896 (lambda* (#:key outputs #:allow-other-keys)
4897 (let* ((out (assoc-ref outputs "out"))
4898 (sbin (string-append out "/sbin")))
4899 (symlink "mount.ntfs-3g"
4900 (string-append sbin "/mount.ntfs")))
4901 #t)))))
4902 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
4903 (synopsis "Read-write access to NTFS file systems")
4904 (description
4905 "NTFS-3G provides read-write access to NTFS file systems, which are
4906 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
4907 The package provides additional NTFS tools.")
4908 (license license:gpl2+)))
4909
4910 (define-public rdma-core
4911 (package
4912 (name "rdma-core")
4913 (version "26.0")
4914 (source (origin
4915 (method url-fetch)
4916 (uri (string-append "https://github.com/linux-rdma/rdma-core"
4917 "/releases/download/v" version "/rdma-core-"
4918 version ".tar.gz"))
4919 (sha256
4920 (base32
4921 "14raqwx4pkzghiwkx1v0dq338f7xqqx8rnsxlpdnngvjy1p5l79j"))))
4922 (build-system cmake-build-system)
4923 (arguments
4924 `(#:tests? #f ; no tests
4925 ;; Upstream uses the "ninja" build system and encourage distros
4926 ;; to do the same for consistency. They also recommend using the
4927 ;; "Release" build type.
4928 #:build-type "Release"
4929 #:configure-flags (list "-GNinja"
4930
4931 (string-append "-DRST2MAN_EXECUTABLE="
4932 (assoc-ref %build-inputs
4933 "python-docutils")
4934 "/bin/rst2man.py")
4935
4936 ;; On some configurations, the
4937 ;; IB_USER_MAD_REGISTER_AGENT ioctl, which is
4938 ;; used by default, would return ENODEV. To
4939 ;; avoid that, use 'write' instead of ioctls,
4940 ;; as suggested in 'CMakeList.txt'.
4941 "-DIOCTL_MODE=write")
4942 #:phases
4943 (modify-phases %standard-phases
4944 (replace 'build
4945 (lambda _
4946 (invoke "ninja"
4947 "-j" (number->string (parallel-job-count)))))
4948 (replace 'install
4949 (lambda _
4950 (invoke "ninja" "install"))))))
4951 (native-inputs
4952 `(("ninja" ,ninja)
4953 ("pkg-config" ,pkg-config)
4954 ("python" ,python-wrapper)
4955 ("python-docutils" ,python-docutils))) ;for 'rst2man'
4956 (inputs
4957 `(("libnl" ,libnl)
4958 ("udev" ,eudev)))
4959 (home-page "https://github.com/linux-rdma/rdma-core")
4960 (synopsis "Utilities and libraries for working with RDMA devices")
4961 (description
4962 "This package provides userspace components for the InfiniBand
4963 subsystem of the Linux kernel. Specifically it contains userspace
4964 libraries for the following device nodes:
4965
4966 @enumerate
4967 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
4968 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
4969 @item @file{/dev/infiniband/umadX} (@code{libibumad})
4970 @end enumerate
4971
4972 The following service daemons are also provided:
4973 @enumerate
4974 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
4975 @item @code{iwpmd} (for iWARP kernel providers)
4976 @item @code{ibacm} (for InfiniBand communication management assistant)
4977 @end enumerate")
4978 ;; All library code is dual licensed under GPL2 and a custom MIT
4979 ;; variant. The package also includes some components covered by
4980 ;; other licenses. Consult COPYING.md for full details.
4981 (license
4982 (list license:gpl2
4983 (license:x11-style "See COPYING.BSD_MIT in the distribution")
4984 license:bsd-2 ; Files referring to COPYING.BSD_FB
4985 license:cc0 ; most files in ccan/
4986 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
4987
4988 (define-public perftest
4989 (package
4990 (name "perftest")
4991 (version "4.4-0.4")
4992 (source
4993 (origin
4994 (method url-fetch)
4995 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
4996 version "/perftest-" version ".g0927198.tar.gz"))
4997 (sha256
4998 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
4999 (build-system gnu-build-system)
5000 (arguments
5001 `(#:phases
5002 (modify-phases %standard-phases
5003 (add-after 'unpack 'patch-header-paths
5004 (lambda _
5005 (substitute* '("src/raw_ethernet_fs_rate.c"
5006 "src/raw_ethernet_resources.c"
5007 "src/raw_ethernet_resources.h"
5008 "src/raw_ethernet_send_burst_lat.c"
5009 "src/raw_ethernet_send_bw.c"
5010 "src/raw_ethernet_send_lat.c")
5011 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
5012 #t)))))
5013 (inputs `(("rdma-core" ,rdma-core)))
5014 (home-page "https://github.com/linux-rdma/perftest/")
5015 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
5016 (description "This is a collection of tests written over uverbs intended for
5017 use as a performance micro-benchmark. The tests may be used for hardware or
5018 software tuning as well as for functional testing.
5019
5020 The collection contains a set of bandwidth and latency benchmark such as:
5021 @enumerate
5022 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
5023 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
5024 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
5025 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
5026 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
5027 @end enumerate")
5028 (license license:gpl2)))
5029
5030 (define-public rng-tools
5031 (package
5032 (name "rng-tools")
5033 (home-page "https://github.com/nhorman/rng-tools")
5034 (version "6.9")
5035 (source (origin
5036 (method git-fetch)
5037 (uri (git-reference (url home-page)
5038 (commit (string-append "v" version))))
5039 (file-name (git-file-name name version))
5040 (sha256
5041 (base32
5042 "065jf26s8zkicb95zc9ilksjdq9gqrh5vcx3mhi6mypbnamn6w98"))))
5043 (build-system gnu-build-system)
5044 (arguments
5045 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
5046 #:configure-flags '("--without-nistbeacon"
5047 "--without-pkcs11")))
5048 (native-inputs
5049 `(("autoconf" ,autoconf)
5050 ("automake" ,automake)
5051 ("pkg-config" ,pkg-config)))
5052 (inputs
5053 `(("libsysfs" ,sysfsutils)))
5054 (synopsis "Random number generator daemon")
5055 (description
5056 "Monitor a hardware random number generator, and supply entropy
5057 from that to the system kernel's @file{/dev/random} machinery.")
5058 ;; The source package is offered under the GPL2+, but the files
5059 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
5060 (license (list license:gpl2 license:gpl2+))))
5061
5062 (define-public cpupower
5063 (package
5064 (name "cpupower")
5065 (version (package-version linux-libre))
5066 (source (package-source linux-libre))
5067 (build-system gnu-build-system)
5068 (arguments
5069 '(#:phases (modify-phases %standard-phases
5070 (add-after 'unpack 'enter-subdirectory
5071 (lambda _
5072 (chdir "tools/power/cpupower")
5073 #t))
5074 (delete 'configure)
5075 (add-before 'build 'fix-makefiles
5076 (lambda _
5077 (substitute* "Makefile"
5078 (("/usr/") "/")
5079 (("/bin/(install|pwd)" _ command) command))
5080 (substitute* "bench/Makefile"
5081 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
5082 #t)))
5083 #:make-flags (let ((out (assoc-ref %outputs "out")))
5084 (list (string-append "DESTDIR=" out)
5085 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
5086 "libdir=/lib"
5087 "docdir=/share/doc/cpupower"
5088 "confdir=$(docdir)/examples"
5089 ;; The Makefile recommends the following changes
5090 "DEBUG=false"
5091 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
5092 #:tests? #f)) ;no tests
5093 (native-inputs `(("gettext" ,gettext-minimal)))
5094 (inputs `(("pciutils" ,pciutils)))
5095 (home-page (package-home-page linux-libre))
5096 (synopsis "CPU frequency and voltage scaling tools for Linux")
5097 (description
5098 "cpupower is a set of user-space tools that use the cpufreq feature of the
5099 Linux kernel to retrieve and control processor features related to power saving,
5100 such as frequency and voltage scaling.")
5101 (license license:gpl2)))
5102
5103 (define-public x86-energy-perf-policy
5104 (package
5105 (name "x86-energy-perf-policy")
5106 (version (package-version linux-libre))
5107 (source (package-source linux-libre))
5108 (build-system gnu-build-system)
5109 (arguments
5110 '(#:tests? #f
5111 #:phases
5112 (modify-phases %standard-phases
5113 (add-after 'unpack 'enter-subdirectory
5114 (lambda _
5115 (chdir "tools/power/x86/x86_energy_perf_policy")
5116 #t))
5117 (delete 'configure)
5118 (add-before 'build 'fix-makefile
5119 (lambda _
5120 (substitute* "Makefile" (("/usr") ""))
5121 #t)))
5122 #:make-flags
5123 (let ((out (assoc-ref %outputs "out")))
5124 (list (string-append "DESTDIR=" out)
5125 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
5126 (supported-systems '("i686-linux" "x86_64-linux"))
5127 (home-page (package-home-page linux-libre))
5128 (synopsis "Display and update Intel-CPU energy-performance policy")
5129 (description
5130 "@command{x86_energy_perf_policy} displays and updates energy-performance
5131 policy settings specific to Intel Architecture Processors. Settings are
5132 accessed via Model Specific Register (MSR) updates, no matter if the Linux
5133 cpufreq sub-system is enabled or not.")
5134 (license license:gpl2)))
5135
5136 (define-public haveged
5137 (package
5138 (name "haveged")
5139 (version "1.9.8")
5140 (source
5141 (origin
5142 (method git-fetch)
5143 (uri (git-reference
5144 (url "https://github.com/jirka-h/haveged.git")
5145 (commit (string-append "v" version))))
5146 (file-name (git-file-name name version))
5147 (sha256
5148 (base32 "1znr58fb3faq4nmrvc3c5whkc1f3chivm4vhicdwr9pdsyqqsd51"))))
5149 (build-system gnu-build-system)
5150 (home-page "https://www.issihosts.com/haveged")
5151 (synopsis "Entropy source for the Linux random number generator")
5152 (description
5153 "haveged generates an unpredictable stream of random numbers for use by
5154 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
5155 standard mechanisms for filling the entropy pool may not be sufficient for
5156 systems with high needs or limited user interaction, such as headless servers.
5157
5158 @command{haveged} runs as a privileged daemon, harvesting randomness from the
5159 indirect effects of hardware events on hidden processor state using the
5160 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
5161 It tunes itself to its environment and provides the same built-in test suite
5162 for the output stream as used on certified hardware security devices.
5163
5164 The quality of the randomness produced by this algorithm has not been proven.
5165 It is recommended to run it together with another entropy source like rngd, and
5166 not as a replacement for it.")
5167 (license (list (license:non-copyleft "file://nist/mconf.h")
5168 (license:non-copyleft "file://nist/packtest.c")
5169 license:public-domain ; nist/dfft.c
5170 license:gpl3+)))) ; everything else
5171
5172 (define-public ecryptfs-utils
5173 (package
5174 (name "ecryptfs-utils")
5175 (version "111")
5176 (source
5177 (origin
5178 (method url-fetch)
5179 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
5180 version "/+download/ecryptfs-utils_"
5181 version ".orig.tar.gz"))
5182 (sha256
5183 (base32
5184 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
5185 (build-system gnu-build-system)
5186 (arguments
5187 `(#:configure-flags (list "--disable-pywrap")
5188 #:phases
5189 (modify-phases %standard-phases
5190 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
5191 (lambda* (#:key inputs outputs #:allow-other-keys)
5192 (let ((out (assoc-ref outputs "out"))
5193 (utils-linux (assoc-ref inputs "utils-linux"))
5194 (cryptsetup (assoc-ref inputs "cryptsetup"))
5195 (linux-pam (assoc-ref inputs "linux-pam"))
5196 (lvm2 (assoc-ref inputs "lvm2")))
5197 (substitute* '("src/utils/ecryptfs-mount-private"
5198 "src/utils/ecryptfs-umount-private"
5199 "src/utils/ecryptfs-setup-private"
5200 "src/utils/ecryptfs-setup-swap"
5201 "src/utils/mount.ecryptfs.c"
5202 "src/utils/umount.ecryptfs.c"
5203 "src/pam_ecryptfs/pam_ecryptfs.c"
5204 "src/desktop/ecryptfs-mount-private.desktop.in"
5205 "src/desktop/ecryptfs-setup-private.desktop.in")
5206 (("/bin/mount")
5207 (string-append utils-linux "/bin/mount"))
5208 (("/bin/umount")
5209 (string-append utils-linux "/bin/umount"))
5210 (("/sbin/mount.ecryptfs_private")
5211 (string-append out "/sbin/mount.ecryptfs_private"))
5212 (("/sbin/umount.ecryptfs_private")
5213 (string-append out "/sbin/umount.ecryptfs_private"))
5214 (("/usr/bin/ecryptfs-mount-private")
5215 (string-append out "/bin/ecryptfs-mount-private"))
5216 (("/usr/bin/ecryptfs-rewrite-file")
5217 (string-append out "/bin/ecryptfs-rewrite-file"))
5218 (("/usr/bin/ecryptfs-setup-private")
5219 (string-append out "/bin/ecryptfs-setup-private"))
5220 (("/sbin/cryptsetup")
5221 (string-append cryptsetup "/sbin/cryptsetup"))
5222 (("/sbin/unix_chkpwd")
5223 (string-append linux-pam "/sbin/unix_chkpwd"))
5224 (("/sbin/dmsetup")
5225 (string-append lvm2 "/sbin/dmsetup")))))))))
5226 (native-inputs
5227 `(("intltool" ,intltool)
5228 ("perl" ,perl) ; for pod2man
5229 ("pkg-config" ,pkg-config)))
5230 (inputs
5231 `(("keyutils" ,keyutils)
5232 ("linux-pam" ,linux-pam)
5233 ("utils-linux" ,util-linux)
5234 ("cryptsetup" ,cryptsetup)
5235 ("lvm2" ,lvm2)
5236 ("nss" ,nss)))
5237 (home-page "https://ecryptfs.org/")
5238 (synopsis "eCryptfs cryptographic file system utilities")
5239 (description
5240 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
5241 Each file's cryptographic meta-data is stored inside the file itself, along
5242 with the encrypted contents. This allows individual encrypted files to be
5243 copied between hosts and still be decrypted with the proper key. eCryptfs is a
5244 native Linux file system, and has been part of the Linux kernel since version
5245 2.6.19. This package contains the userland utilities to manage it.")
5246 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
5247 ;; grant additional permission to link with OpenSSL.
5248 (license license:gpl2+)))
5249
5250 (define-public libnfsidmap
5251 (package
5252 (name "libnfsidmap")
5253 (version "0.27")
5254 (source
5255 (origin
5256 (method url-fetch)
5257 (uri (string-append "https://fedorapeople.org/~steved/"
5258 name "/" version "/" name "-" version ".tar.bz2"))
5259 (sha256
5260 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
5261 (build-system gnu-build-system)
5262 (arguments
5263 `(#:configure-flags (list
5264 (string-append "--with-pluginpath="
5265 (assoc-ref %outputs "out")
5266 "/lib/libnfsidmap"))))
5267 (native-inputs
5268 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
5269 (home-page
5270 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
5271 (synopsis "NFSv4 support library for name/ID mapping")
5272 (description "Libnfsidmap is a library holding mulitiple methods of
5273 mapping names to ids and visa versa, mainly for NFSv4. It provides an
5274 extensible array of mapping functions, currently consisting of two choices:
5275 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
5276 (license (license:non-copyleft "file://COPYING"
5277 "See COPYING in the distribution."))))
5278
5279 (define-public module-init-tools
5280 (package
5281 (name "module-init-tools")
5282 (version "3.16")
5283 (source (origin
5284 (method url-fetch)
5285 (uri (string-append
5286 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
5287 "module-init-tools-" version ".tar.bz2"))
5288 (sha256
5289 (base32
5290 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
5291 (patches (search-patches "module-init-tools-moduledir.patch"))))
5292 (build-system gnu-build-system)
5293 (arguments
5294 ;; FIXME: The upstream tarball lacks man pages, and building them would
5295 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
5296 ;; but they vanished. In the meantime, fake it.
5297 '(#:phases
5298 (modify-phases %standard-phases
5299 (add-before 'configure 'fake-docbook
5300 (lambda _
5301 (substitute* "Makefile.in"
5302 (("^DOCBOOKTOMAN.*$")
5303 "DOCBOOKTOMAN = true\n"))
5304 #t)))))
5305 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
5306 (synopsis "Tools for loading and managing Linux kernel modules")
5307 (description
5308 "Tools for loading and managing Linux kernel modules, such as
5309 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
5310 (license license:gpl2+)))
5311
5312 (define-public mcelog
5313 (package
5314 (name "mcelog")
5315 (version "168")
5316 (source (origin
5317 (method url-fetch)
5318 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
5319 "mcelog.git/snapshot/v" version ".tar.gz"))
5320 (sha256
5321 (base32
5322 "1c4faayg1gcm3002b2fdrfnv76z92mvfzccvx8w9crjp0d17sp24"))
5323 (file-name (string-append name "-" version ".tar.gz"))
5324 (modules '((guix build utils)))
5325 (snippet
5326 `(begin
5327 ;; The snapshots lack a .git directory,
5328 ;; breaking ‘git describe’.
5329 (substitute* "Makefile"
5330 (("\"unknown\"") (string-append "\"v" ,version "\"")))
5331 #t))))
5332 (build-system gnu-build-system)
5333 (arguments
5334 `(#:phases (modify-phases %standard-phases
5335 (delete 'configure)) ; no configure script
5336 #:make-flags (let ((out (assoc-ref %outputs "out")))
5337 (list "CC=gcc"
5338 (string-append "prefix=" out)
5339 (string-append "DOCDIR=" out "/share/doc/mcelog")
5340 "etcprefix=$(DOCDIR)/examples"))
5341 ;; The tests will only run as root on certain supported CPU models.
5342 #:tests? #f))
5343 (supported-systems (list "i686-linux" "x86_64-linux"))
5344 (home-page "https://mcelog.org/")
5345 (synopsis "Machine check monitor for x86 Linux systems")
5346 (description
5347 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
5348 and other hardware errors on x86 systems. It can also perform user-defined
5349 tasks, such as bringing bad pages off-line, when configurable error thresholds
5350 are exceeded.")
5351 (license license:gpl2)))
5352
5353 (define-public mtd-utils
5354 (package
5355 (name "mtd-utils")
5356 (version "2.1.1")
5357 (source (origin
5358 (method url-fetch)
5359 (uri (string-append
5360 "ftp://ftp.infradead.org/pub/mtd-utils/"
5361 "mtd-utils-" version ".tar.bz2"))
5362 (sha256
5363 (base32
5364 "1lijl89l7hljx8xx70vrz9srd3h41v5gh4b0lvqnlv831yvyh5cd"))))
5365 (arguments
5366 '(#:configure-flags '("--enable-unit-tests")))
5367 (native-inputs
5368 `(("cmocka" ,cmocka)
5369 ("pkg-config" ,pkg-config)))
5370 (inputs
5371 `(("acl" ,acl) ; extended attributes (xattr)
5372 ("libuuid" ,util-linux)
5373 ("lzo" ,lzo)
5374 ("openssl" ,openssl) ; optional crypto support
5375 ("zlib" ,zlib)
5376 ("zstd" ,zstd "lib")))
5377 (build-system gnu-build-system)
5378 (synopsis "MTD Flash Storage Utilities")
5379 (description "This package provides utilities for testing, partitioning, etc
5380 of flash storage.")
5381 (home-page "http://www.linux-mtd.infradead.org/")
5382 (license
5383 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
5384 license:mpl1.1 ; All ftl* files
5385 license:expat)))) ; libiniparser
5386
5387 (define-public libseccomp
5388 (package
5389 (name "libseccomp")
5390 (version "2.4.3")
5391 (source (origin
5392 (method url-fetch)
5393 (uri (string-append "https://github.com/seccomp/libseccomp/"
5394 "releases/download/v" version
5395 "/libseccomp-" version ".tar.gz"))
5396 (sha256
5397 (base32
5398 "07crwxqzvl5k2b90a47ii9wgvi09s9hsy5b5jddw9ylp351d25fg"))))
5399 (build-system gnu-build-system)
5400 (native-inputs
5401 `(("which" ,which)))
5402 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
5403 (description "The libseccomp library provides an easy to use, platform
5404 independent, interface to the Linux Kernel's syscall filtering mechanism. The
5405 libseccomp API is designed to abstract away the underlying BPF based syscall
5406 filter language and present a more conventional function-call based filtering
5407 interface that should be familiar to, and easily adopted by, application
5408 developers.")
5409 (home-page "https://github.com/seccomp/libseccomp")
5410 (license license:lgpl2.1)))
5411
5412 (define-public radeontop
5413 (package
5414 (name "radeontop")
5415 (version "1.2")
5416 (source
5417 (origin
5418 (method git-fetch)
5419 (uri (git-reference
5420 (url "https://github.com/clbr/radeontop.git")
5421 (commit (string-append "v" version))))
5422 (file-name (git-file-name name version))
5423 (sha256
5424 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
5425 (build-system gnu-build-system)
5426 (arguments
5427 `(#:phases (modify-phases %standard-phases
5428 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
5429 ;; dependency, and doesn't even work on release(!) tarballs.
5430 (add-after 'unpack 'report-correct-version
5431 (lambda _
5432 (substitute* "getver.sh"
5433 (("ver=unknown")
5434 (string-append "ver=" ,version)))
5435 #t))
5436 (delete 'configure)) ; no configure script
5437 #:make-flags (list "CC=gcc"
5438 (string-append "PREFIX=" %output))
5439 #:tests? #f)) ; no tests
5440 (native-inputs
5441 `(("gettext" ,gettext-minimal)
5442 ("pkg-config" ,pkg-config)))
5443 (inputs
5444 `(("libdrm" ,libdrm)
5445 ("libpciaccess" ,libpciaccess)
5446 ("libxcb" ,libxcb)
5447 ("ncurses" ,ncurses)))
5448 (home-page "https://github.com/clbr/radeontop/")
5449 (synopsis "Usage monitor for AMD Radeon graphics")
5450 (description "RadeonTop monitors resource consumption on supported AMD
5451 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
5452 a terminal or saved to a file for further processing. It measures both the
5453 activity of the GPU as a whole, which is also accurate during OpenCL
5454 computations, as well as separate component statistics that are only meaningful
5455 under OpenGL graphics workloads.")
5456 (license license:gpl3)))
5457
5458 (define-public efivar
5459 (package
5460 (name "efivar")
5461 (version "37")
5462 (source (origin
5463 (method url-fetch)
5464 (uri (string-append "https://github.com/rhboot/" name
5465 "/releases/download/" version "/" name
5466 "-" version ".tar.bz2"))
5467 (sha256
5468 (base32
5469 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
5470 (build-system gnu-build-system)
5471 (arguments
5472 `(;; Tests require a UEFI system and is not detected in the chroot.
5473 #:tests? #f
5474 #:make-flags (list (string-append "prefix=" %output)
5475 (string-append "libdir=" %output "/lib")
5476 "CC_FOR_BUILD=gcc"
5477 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5478 #:phases
5479 (modify-phases %standard-phases
5480 (delete 'configure)
5481 (add-before 'build 'kernel-headers-are-system-headers
5482 (lambda* (#:key inputs #:allow-other-keys)
5483 (let ((kernel-headers (assoc-ref inputs "kernel-headers")))
5484 ;; Make sure the kernel headers are treated as system headers
5485 ;; to suppress a conflict between "util.h" and <linux/fs.h>.
5486 (setenv "C_INCLUDE_PATH" (string-append kernel-headers "/include"))
5487 #t))))))
5488 (native-inputs
5489 `(("pkg-config" ,pkg-config)))
5490 (inputs
5491 `(("popt" ,popt)))
5492 (home-page "https://github.com/rhboot/efivar")
5493 (synopsis "Tool and library to manipulate EFI variables")
5494 (description "This package provides a library and a command line
5495 interface to the variable facility of UEFI boot firmware.")
5496 (license license:lgpl2.1+)))
5497
5498 (define-public efibootmgr
5499 (package
5500 (name "efibootmgr")
5501 (version "16")
5502 (source (origin
5503 (method url-fetch)
5504 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
5505 "/releases/download/" version "/efibootmgr"
5506 "-" version ".tar.bz2"))
5507 (sha256
5508 (base32
5509 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
5510 (build-system gnu-build-system)
5511 (arguments
5512 `(#:tests? #f ;no tests
5513 #:make-flags (list (string-append "prefix=" %output)
5514 (string-append "libdir=" %output "/lib")
5515 ;; EFIDIR denotes a subdirectory relative to the
5516 ;; EFI System Partition where the loader will be
5517 ;; installed (known as OS_VENDOR in the code).
5518 ;; GRUB overrides this, as such it's only used if
5519 ;; nothing else is specified on the command line.
5520 "EFIDIR=gnu"
5521 ;; Treat kernel headers as system headers to prevent
5522 ;; warnings about conflicting types.
5523 (string-append "C_INCLUDE_PATH="
5524 (assoc-ref %build-inputs "kernel-headers")
5525 "/include"))
5526 #:phases (modify-phases %standard-phases (delete 'configure))))
5527 (native-inputs
5528 `(("pkg-config" ,pkg-config)))
5529 (inputs
5530 `(("efivar" ,efivar)
5531 ("popt" ,popt)))
5532 (home-page "https://github.com/rhinstaller/efibootmgr")
5533 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
5534 (description
5535 "@code{efibootmgr} is a user-space application to modify the Intel
5536 Extensible Firmware Interface (EFI) Boot Manager. This application can
5537 create and destroy boot entries, change the boot order, change the next
5538 running boot option, and more.")
5539 (license license:gpl2+)))
5540
5541 (define-public sysstat
5542 (package
5543 (name "sysstat")
5544 (version "12.3.1")
5545 (source (origin
5546 (method url-fetch)
5547 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
5548 "sysstat-" version ".tar.xz"))
5549 (sha256
5550 (base32
5551 "1hf1sy7akribmgavadqccxpy49yv0zfb3m81d2bj6jf8pyzwcrbq"))))
5552 (build-system gnu-build-system)
5553 (arguments
5554 `(#:tests? #f ; No test suite.
5555 ;; Without this flag, it tries to install the man pages with group 'root'
5556 ;; and fails because /etc/passwd lacks an entry for the root user.
5557 #:configure-flags
5558 (list "--disable-file-attr"
5559 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
5560 #:phases
5561 (modify-phases %standard-phases
5562 ;; The build process tries to create '/var/lib/sa', so we skip that
5563 ;; instruction.
5564 (add-after 'build 'skip-touching-var
5565 (lambda _
5566 (substitute* "Makefile"
5567 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
5568 ""))
5569 #t)))))
5570 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
5571 (synopsis "Performance monitoring tools for Linux")
5572 (description "The sysstat utilities are a collection of performance
5573 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
5574 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
5575 @code{sadf} and @code{sa}.")
5576 (license license:gpl2+)))
5577
5578 (define-public light
5579 (package
5580 (name "light")
5581 (version "1.2.2")
5582 (source
5583 (origin
5584 (method git-fetch)
5585 (uri (git-reference
5586 (url "https://github.com/haikarainen/light.git")
5587 (commit (string-append "v" version))))
5588 (sha256
5589 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
5590 (file-name (git-file-name name version))))
5591 (build-system gnu-build-system)
5592 (arguments
5593 `(#:phases
5594 (modify-phases %standard-phases
5595 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
5596 (lambda* (#:key inputs #:allow-other-keys)
5597 (substitute* "90-backlight.rules"
5598 (("/bin/chgrp") (which "chgrp"))
5599 (("/bin/chmod") (which "chmod")))
5600 #t))
5601 (add-after 'install 'install-udev-rules
5602 (lambda* (#:key outputs #:allow-other-keys)
5603 (let ((out (assoc-ref outputs "out")))
5604 (install-file
5605 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
5606 #t))))))
5607 (native-inputs
5608 `(("autoconf" ,autoconf)
5609 ("automake" ,automake)))
5610 (home-page "https://haikarainen.github.io/light/")
5611 (synopsis "GNU/Linux application to control backlights")
5612 (description
5613 "Light is a program to send commands to screen backlight controllers
5614 under GNU/Linux. Features include:
5615
5616 @itemize
5617 @item It does not rely on X.
5618 @item Light can automatically figure out the best controller to use, making
5619 full use of underlying hardware.
5620 @item It is possible to set a minimum brightness value, as some controllers
5621 set the screen to be pitch black at a vaĺue of 0 (or higher).
5622 @end itemize
5623
5624 Light is the successor of lightscript.")
5625 (license license:gpl3+)))
5626
5627 (define-public brightnessctl
5628 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
5629 (package
5630 (name "brightnessctl")
5631 (version (git-version "0.4" "0" commit))
5632 (source (origin
5633 (method git-fetch)
5634 (uri (git-reference
5635 (url "https://github.com/Hummer12007/brightnessctl/")
5636 (commit commit)))
5637 (file-name (git-file-name name version))
5638 (sha256
5639 (base32
5640 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
5641 (build-system gnu-build-system)
5642 (arguments
5643 '(#:tests? #f ; no tests
5644 #:make-flags (list "CC=gcc"
5645 (string-append "PREFIX=" %output)
5646 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
5647 #:phases
5648 (modify-phases %standard-phases
5649 (delete 'configure)
5650 (add-after 'unpack 'adjust-udev-rules
5651 (lambda _
5652 (substitute* "90-brightnessctl.rules"
5653 (("/bin/") "/run/current-system/profile/bin/"))
5654 #t)))))
5655 (home-page "https://github.com/Hummer12007/brightnessctl")
5656 (synopsis "Backlight and LED brightness control")
5657 (description
5658 "This program allows you read and control device brightness. Devices
5659 include backlight and LEDs. It can also preserve current brightness before
5660 applying the operation, such as on lid close.
5661
5662 The appropriate permissions must be set on the backlight or LED control
5663 interface in sysfs, which can be accomplished with the included udev rules.")
5664 (license license:expat))))
5665
5666 (define-public tlp
5667 (package
5668 (name "tlp")
5669 (version "1.3.1")
5670 (source
5671 (origin
5672 (method git-fetch)
5673 (uri (git-reference
5674 (url "https://github.com/linrunner/TLP.git")
5675 (commit version)))
5676 (file-name (git-file-name name version))
5677 (sha256
5678 (base32 "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5"))))
5679 (native-inputs
5680 `(("shellcheck" ,shellcheck)))
5681 (inputs
5682 `(("bash" ,bash)
5683 ("dbus" ,dbus)
5684 ("ethtool" ,ethtool)
5685 ("eudev" ,eudev)
5686 ("grep" ,grep)
5687 ("hdparm" ,hdparm)
5688 ("inetutils" ,inetutils)
5689 ("iw" ,iw)
5690 ("kmod" ,kmod)
5691 ("pciutils" ,pciutils)
5692 ("perl" ,perl)
5693 ("rfkill" ,rfkill)
5694 ("sed" ,sed)
5695 ("usbutils" ,usbutils)
5696 ("util-linux" ,util-linux)
5697 ("wireless-tools" ,wireless-tools)
5698 ,@(if (let ((system (or (%current-target-system)
5699 (%current-system))))
5700 (or (string-prefix? "i686-" system)
5701 (string-prefix? "x86_64-" system)))
5702 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
5703 '())))
5704 (build-system gnu-build-system)
5705 (arguments
5706 ;; XXX: The full test suite is run with "checkall" but it requires
5707 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
5708 `(#:test-target "shellcheck"
5709 #:modules ((guix build gnu-build-system)
5710 (guix build utils)
5711 (srfi srfi-1))
5712 #:phases
5713 (modify-phases %standard-phases
5714 (delete 'configure) ; no configure script
5715 (add-before 'build 'setenv
5716 (lambda* (#:key outputs #:allow-other-keys)
5717 (let ((out (assoc-ref outputs "out")))
5718 (setenv "TLP_WITH_SYSTEMD" "0")
5719 (setenv "TLP_NO_INIT" "1")
5720 (setenv "TLP_NO_PMUTILS" "1")
5721 (setenv "TLP_SBIN" (string-append out "/bin"))
5722 (setenv "TLP_BIN" (string-append out "/bin"))
5723 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
5724 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
5725 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
5726 (setenv "TLP_CONFDEF"
5727 (string-append out "/share/tlp/defaults.conf"))
5728 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
5729 (setenv "TLP_ELOD"
5730 (string-append out "/lib/elogind/system-sleep"))
5731 (setenv "TLP_SHCPL"
5732 (string-append out "/share/bash-completion/completions"))
5733 (setenv "TLP_MAN" (string-append out "/share/man"))
5734 (setenv "TLP_META" (string-append out "/share/metainfo"))
5735 #t)))
5736 (add-before 'install 'fix-installation
5737 (lambda _
5738 ;; Stop the Makefile from trying to create system directories.
5739 (substitute* "Makefile"
5740 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
5741 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
5742 #t))
5743 (replace 'install
5744 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
5745 (add-after 'install 'wrap
5746 (lambda* (#:key inputs outputs #:allow-other-keys)
5747 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
5748 (bin-files (find-files bin ".*")))
5749 (define (bin-directory input-name)
5750 (let ((p (assoc-ref inputs input-name)))
5751 (and p (string-append p "/bin"))))
5752 (define (sbin-directory input-name)
5753 (string-append (assoc-ref inputs input-name) "/sbin"))
5754 (for-each (lambda (program)
5755 (wrap-program program
5756 `("PATH" ":" prefix
5757 ,(append
5758 (filter-map bin-directory
5759 '("bash"
5760 "coreutils"
5761 "dbus"
5762 "eudev"
5763 "grep"
5764 "inetutils"
5765 "kmod"
5766 "perl"
5767 "sed"
5768 "usbutils"
5769 "util-linux"
5770 "x86-energy-perf-policy"))
5771 (filter-map sbin-directory
5772 '("ethtool"
5773 "hdparm"
5774 "iw"
5775 "pciutils"
5776 "rfkill"
5777 "wireless-tools"))))))
5778 bin-files)
5779 #t))))))
5780 (home-page "https://linrunner.de/en/tlp/tlp.html")
5781 (synopsis "Power management tool for Linux")
5782 (description "TLP is a power management tool for Linux. It comes with
5783 a default configuration already optimized for battery life. Nevertheless,
5784 TLP is customizable to fulfil system requirements. TLP settings are applied
5785 every time the power supply source is changed.")
5786 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
5787 ;; rest is GPLv2+.
5788 (license (list license:gpl2+ license:gpl3+))))
5789
5790 (define-public lshw
5791 (package
5792 (name "lshw")
5793 (version "B.02.18")
5794 (source (origin
5795 (method url-fetch)
5796 (uri (string-append "https://www.ezix.org/software/"
5797 "files/lshw-" version
5798 ".tar.gz"))
5799 (sha256
5800 (base32
5801 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
5802 (build-system gnu-build-system)
5803 (arguments
5804 `(#:phases (modify-phases %standard-phases (delete 'configure))
5805 #:tests? #f ; no tests
5806 #:make-flags
5807 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
5808 (synopsis "List hardware information")
5809 (description
5810 "@command{lshw} (Hardware Lister) is a small tool to provide
5811 detailed information on the hardware configuration of the machine.
5812 It can report exact memory configuration, firmware version, mainboard
5813 configuration, CPU version and speed, cache configuration, bus speed,
5814 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
5815 machines (PowerMac G4 is known to work).")
5816 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
5817 (license license:gpl2+)))
5818
5819 (define-public libmnl
5820 (package
5821 (name "libmnl")
5822 (version "1.0.4")
5823 (source
5824 (origin
5825 (method url-fetch)
5826 (uri (string-append "mirror://netfilter.org/libmnl/"
5827 "libmnl-" version ".tar.bz2"))
5828 (sha256
5829 (base32
5830 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
5831 (build-system gnu-build-system)
5832 (home-page "https://www.netfilter.org/projects/libmnl/")
5833 (synopsis "Netlink utility library")
5834 (description "Libmnl is a minimalistic user-space library oriented to
5835 Netlink developers. There are a lot of common tasks in parsing, validating,
5836 constructing of both the Netlink header and TLVs that are repetitive and easy to
5837 get wrong. This library aims to provide simple helpers that allows you to
5838 re-use code and to avoid re-inventing the wheel.")
5839 (license license:lgpl2.1+)))
5840
5841 (define-public libnftnl
5842 (package
5843 (name "libnftnl")
5844 (version "1.1.5")
5845 (source
5846 (origin
5847 (method url-fetch)
5848 (uri (string-append "mirror://netfilter.org/libnftnl/"
5849 "libnftnl-" version ".tar.bz2"))
5850 (sha256
5851 (base32 "1wqlxf76bkqf3qhka9sw32qhb2ni20q1k6rn3iril2kw482lvpk6"))
5852 (patches
5853 (search-patches "libnftnl-dont-check-NFTNL_FLOWTABLE_SIZE.patch"))))
5854 (build-system gnu-build-system)
5855 (native-inputs
5856 `(("pkg-config" ,pkg-config)))
5857 (inputs
5858 `(("libmnl" ,libmnl)))
5859 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
5860 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
5861 (description "Libnftnl is a userspace library providing a low-level netlink
5862 programming interface to the in-kernel nf_tables subsystem. The library
5863 libnftnl has been previously known as libnftables. This library is currently
5864 used by nftables.")
5865 (license license:gpl2+)))
5866
5867 (define-public nftables
5868 (package
5869 (name "nftables")
5870 (version "0.9.3")
5871 (source
5872 (origin
5873 (method url-fetch)
5874 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
5875 version ".tar.bz2")
5876 (string-append "https://www.nftables.org/projects/nftables"
5877 "/files/nftables-" version ".tar.bz2")))
5878 (sha256
5879 (base32 "0y6vbqp6x8w165q65h4n9sba1406gaz0d4744gqszbm7w9f92swm"))))
5880 (build-system gnu-build-system)
5881 (arguments `(#:configure-flags
5882 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
5883 (inputs `(("gmp" ,gmp)
5884 ("libmnl" ,libmnl)
5885 ("libnftnl" ,libnftnl)
5886 ("readline" ,readline)))
5887 (native-inputs `(("pkg-config" ,pkg-config)
5888 ("bison" ,bison)
5889 ("flex" ,flex)))
5890 (home-page "https://www.nftables.org")
5891 (synopsis "Userspace utility for Linux packet filtering")
5892 (description "nftables is the project that aims to replace the existing
5893 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
5894 filtering framework, a new userspace utility and also a compatibility layer for
5895 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
5896 infrastructure such as the existing hooks, the connection tracking system, the
5897 userspace queueing component and the logging subsystem.")
5898 (license license:gpl2)))
5899
5900 (define-public proot
5901 (package
5902 (name "proot")
5903 (version "5.1.0")
5904 (source
5905 (origin
5906 (method git-fetch)
5907 (uri (git-reference
5908 (url "https://github.com/proot-me/PRoot.git")
5909 (commit (string-append "v" version))))
5910 (file-name (git-file-name name version))
5911 (sha256
5912 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
5913 (patches (search-patches "proot-test-fhs.patch"))))
5914 (build-system gnu-build-system)
5915 (arguments
5916 '(#:make-flags '("-C" "src")
5917
5918 #:phases (modify-phases %standard-phases
5919 (delete 'configure)
5920 (add-before 'build 'set-shell-file-name
5921 (lambda* (#:key inputs #:allow-other-keys)
5922 (substitute* (find-files "src" "\\.[ch]$")
5923 (("\"/bin/sh\"")
5924 (string-append "\""
5925 (assoc-ref inputs "bash")
5926 "/bin/sh\"")))
5927 #t))
5928 (add-before 'check 'fix-fhs-assumptions-in-tests
5929 (lambda _
5930 (substitute* "tests/test-c6b77b77.mk"
5931 (("/bin/bash") (which "bash"))
5932 (("/usr/bin/test") (which "test")))
5933 (substitute* '("tests/test-16573e73.c")
5934 (("/bin/([a-z-]+)" _ program)
5935 (which program)))
5936
5937 (substitute* (find-files "tests" "\\.sh$")
5938 ;; Some of the tests try to "bind-mount" /bin/true.
5939 (("-b /bin/true:")
5940 (string-append "-b " (which "true") ":"))
5941 ;; Likewise for /bin.
5942 (("-b /bin:") "-b /gnu:")
5943 ;; Others try to run /bin/sh.
5944 (("/bin/sh") (which "sh"))
5945 ;; Others assume /etc/fstab exists.
5946 (("/etc/fstab") "/etc/passwd"))
5947
5948 (substitute* "tests/GNUmakefile"
5949 (("-b /bin:") "-b /gnu:"))
5950
5951 ;; XXX: This test fails in an obscure corner case, just
5952 ;; skip it.
5953 (delete-file "tests/test-kkkkkkkk.c")
5954
5955 #t))
5956 (replace 'check
5957 (lambda _
5958 (let ((n (parallel-job-count)))
5959 ;; For some reason we get lots of segfaults with
5960 ;; seccomp support (x86_64, Linux-libre 4.11.0).
5961 (setenv "PROOT_NO_SECCOMP" "1")
5962
5963 ;; Most of the tests expect "/bin" to be in $PATH so
5964 ;; they can run things that live in $ROOTFS/bin.
5965 (setenv "PATH"
5966 (string-append (getenv "PATH") ":/bin"))
5967
5968 (invoke "make" "check" "-C" "tests"
5969 ;;"V=1"
5970 "-j" (number->string n)))))
5971 (replace 'install
5972 (lambda* (#:key outputs #:allow-other-keys)
5973 ;; The 'install' rule does nearly nothing.
5974 (let* ((out (assoc-ref outputs "out"))
5975 (man1 (string-append out "/share/man/man1")))
5976 ;; TODO: 'make install-care' (does not even
5977 ;; build currently.)
5978 (invoke "make" "-C" "src" "install"
5979 (string-append "PREFIX=" out))
5980
5981 (mkdir-p man1)
5982 (copy-file "doc/proot/man.1"
5983 (string-append man1 "/proot.1"))
5984 #t))))))
5985 (native-inputs `(("which" ,which)
5986
5987 ;; For 'mcookie', used by some of the tests.
5988 ("util-linux" ,util-linux)))
5989 (inputs `(("talloc" ,talloc)))
5990 (home-page "https://github.com/proot-me/PRoot")
5991 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
5992 (description
5993 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
5994 and @code{binfmt_misc}. This means that users don't need any privileges or
5995 setup to do things like using an arbitrary directory as the new root
5996 file system, making files accessible somewhere else in the file system
5997 hierarchy, or executing programs built for another CPU architecture
5998 transparently through QEMU user-mode. Also, developers can use PRoot as a
5999 generic process instrumentation engine thanks to its extension mechanism.
6000 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
6001 available in the kernel Linux.")
6002 (license license:gpl2+)))
6003
6004 (define-public proot-static
6005 (package
6006 (inherit proot)
6007 (name "proot-static")
6008 (synopsis
6009 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
6010 (inputs `(("talloc" ,talloc/static)))
6011 (arguments
6012 (substitute-keyword-arguments (package-arguments proot)
6013 ((#:make-flags flags)
6014 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
6015 ((#:phases phases)
6016 `(modify-phases ,phases
6017 (add-after 'strip 'remove-store-references
6018 (lambda* (#:key outputs #:allow-other-keys)
6019 (let* ((out (assoc-ref outputs "out")))
6020 (with-directory-excursion out
6021 (remove-store-references "bin/proot")
6022 #t))))))
6023 ((#:allowed-references _ '("out"))
6024 '("out"))))))
6025
6026 (define-public cpuid
6027 (package
6028 (name "cpuid")
6029 (version "20200211")
6030 (source (origin
6031 (method url-fetch)
6032 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
6033 version ".src.tar.gz"))
6034 (sha256
6035 (base32
6036 "06sjbqqp80l7nhsp6khglkzdp9qy4vhbvjxbfilznhsmrqiwlw55"))))
6037 (build-system gnu-build-system)
6038 (arguments
6039 '(#:make-flags '("CC=gcc")
6040 #:tests? #f ; no tests
6041 #:phases (modify-phases %standard-phases
6042 (delete 'configure) ; no configure script
6043 (add-before 'install 'fix-makefile
6044 (lambda* (#:key outputs #:allow-other-keys)
6045 (substitute* "Makefile"
6046 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
6047 ;; Make the compressed manpages writable so that the
6048 ;; reset-gzip-timestamps phase does not error out.
6049 (substitute* "Makefile"
6050 (("-m 444") "-m 644"))
6051 #t)))))
6052 (inputs `(("perl" ,perl)))
6053 (supported-systems '("i686-linux" "x86_64-linux"))
6054 (home-page "http://www.etallen.com/cpuid.html")
6055 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
6056 (description "cpuid dumps detailed information about the CPU(s) gathered
6057 from the CPUID instruction, and also determines the exact model of CPU(s). It
6058 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
6059 NexGen, Rise, and SiS CPUs.")
6060 (license license:gpl2+)))
6061
6062 (define-public jmtpfs
6063 (package
6064 (name "jmtpfs")
6065 (version "0.5")
6066 (source
6067 (origin
6068 (method url-fetch)
6069 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
6070 version ".tar.gz"))
6071 (file-name (string-append name "-" version ".tar.gz"))
6072 (sha256
6073 (base32
6074 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
6075 (build-system gnu-build-system)
6076 (inputs
6077 `(("file" ,file)
6078 ("fuse" ,fuse)
6079 ("libmtp" ,libmtp)))
6080 (native-inputs
6081 `(("pkg-config" ,pkg-config)))
6082 (home-page "https://github.com/JasonFerrara/jmtpfs")
6083 (synopsis "Use a FUSE file system to access data over MTP")
6084 (description "jmtpfs uses FUSE (file system in userspace) to provide access
6085 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
6086 the MTP device as a file system.")
6087 (license license:gpl3)))
6088
6089 (define-public procenv
6090 (package
6091 (name "procenv")
6092 (version "0.51")
6093 (source
6094 (origin
6095 (method url-fetch)
6096 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
6097 version ".tar.gz"))
6098 (file-name (string-append name "-" version ".tar.gz"))
6099 (sha256
6100 (base32 "1javw97yw0qvjmj14js8vw6nsfyf2xc0kfiyq5f2hsp0553w2cdq"))))
6101 (build-system gnu-build-system)
6102 (arguments `(#:configure-flags '("--disable-silent-rules")))
6103 (native-inputs `(("groff" ,groff) ; for tests
6104 ("pkg-config" ,pkg-config)))
6105 (inputs `(("check" ,check)
6106 ("expat" ,expat)
6107 ("libcap" ,libcap)
6108 ("libselinux" ,libselinux)))
6109 (synopsis "Utility to show process environment")
6110 (description "Procenv is a command-line tool that displays as much detail about
6111 itself and its environment as possible. It can be used as a test
6112 tool, to understand the type of environment a process runs in, and for
6113 comparing system environments.")
6114 (home-page "http://github.com/jamesodhunt/procenv/")
6115 (license license:gpl3+)))
6116
6117 (define-public libfabric
6118 (package
6119 (name "libfabric")
6120 (version "1.4.1")
6121 (source
6122 (origin
6123 (method url-fetch)
6124 (uri
6125 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
6126 version "/libfabric-" version ".tar.bz2"))
6127 (sha256
6128 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
6129 (build-system gnu-build-system)
6130 (inputs `(("rdma-core" ,rdma-core)
6131 ,@(match (%current-system)
6132 ((member (package-supported-systems psm))
6133 `(("psm" ,psm)))
6134 (_ `()))
6135 ("libnl" ,libnl)))
6136 (home-page "https://ofiwg.github.io/libfabric/")
6137 (synopsis "Open Fabric Interfaces")
6138 (description
6139 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
6140 communication services to applications. OFI is best described as a collection
6141 of libraries and applications used to export fabric services. The key
6142 components of OFI are: application interfaces, provider libraries, kernel
6143 services, daemons, and test applications.
6144
6145 Libfabric is a core component of OFI. It is the library that defines and
6146 exports the user-space API of OFI, and is typically the only software that
6147 applications deal with directly. It works in conjunction with provider
6148 libraries, which are often integrated directly into libfabric.")
6149 (license (list license:bsd-2 license:gpl2)))) ;dual
6150
6151 (define-public psm
6152 (package
6153 (name "psm")
6154 (version "3.3.20170428")
6155 (home-page "https://github.com/intel/psm")
6156 (source
6157 (origin
6158 (method git-fetch)
6159 (uri (git-reference (url home-page)
6160 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
6161 (file-name (string-append "psm-" version ".tar.gz"))
6162 (sha256
6163 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
6164 (patches (search-patches
6165 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
6166 "psm-ldflags.patch" ; build shared lib with LDFLAGS
6167 "psm-repro.patch" ; reproducibility
6168 "psm-disable-memory-stats.patch"))))
6169 (build-system gnu-build-system)
6170 (outputs '("out" "debug"))
6171 (inputs `(("libuuid" ,util-linux)))
6172 (arguments
6173 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
6174 ,(string-append "INSTALL_PREFIX=" %output)
6175 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6176 #:tests? #f
6177 #:phases (modify-phases %standard-phases
6178 (delete 'configure)
6179 (add-after 'unpack 'patch-/usr/include
6180 (lambda _
6181 (substitute* "Makefile"
6182 (("\\$\\{DESTDIR}/usr/include")
6183 (string-append %output "/include")))
6184 (substitute* "Makefile"
6185 (("/lib64") "/lib"))
6186 #t))
6187 (add-after 'unpack 'patch-sysmacros
6188 (lambda _
6189 (substitute* "ipath/ipath_proto.c"
6190 (("#include <sys/poll.h>" m)
6191 (string-append m "\n"
6192 "#include <sys/sysmacros.h>")))
6193 #t)))))
6194 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
6195 (description
6196 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
6197 communications interface for the True Scale family of products. PSM users are
6198 enabled with mechanisms necessary to implement higher level communications
6199 interfaces in parallel environments.")
6200 ;; Only Intel-compatable processors are supported.
6201 (supported-systems '("i686-linux" "x86_64-linux"))
6202 (license (list license:bsd-2 license:gpl2)))) ;dual
6203
6204 (define-public snapscreenshot
6205 (package
6206 (name "snapscreenshot")
6207 (version "1.0.14.3")
6208 (source
6209 (origin
6210 (method url-fetch)
6211 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
6212 name "-" version ".tar.bz2"))
6213 (sha256
6214 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
6215 (build-system gnu-build-system)
6216 (arguments
6217 `(#:make-flags
6218 (let ((out (assoc-ref %outputs "out")))
6219 (list (string-append "BINDIR=" out "/bin")
6220 (string-append "MANDIR=" out "/share/man")))
6221 #:tests? #f ; no test suite
6222 #:phases
6223 (modify-phases %standard-phases
6224 (delete 'configure) ; ./configure is a snarky no-op
6225 (add-before 'install 'fix-ownership
6226 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
6227 (lambda _
6228 (substitute* "depfun.mak"
6229 ((" -o bin -g bin ") " "))
6230 #t))
6231 (add-before 'install 'create-output-directories
6232 (lambda* (#:key outputs #:allow-other-keys)
6233 (let ((out (assoc-ref outputs "out")))
6234 (mkdir-p (string-append out "/share/man/man1"))
6235 #t))))))
6236 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
6237 (synopsis "Take screenshots of one or more Linux text consoles")
6238 (description
6239 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
6240 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
6241 relevant @file{/dev/vcs*} file(s).")
6242 (license license:gpl2)))
6243
6244 (define-public fbcat
6245 (package
6246 (name "fbcat")
6247 (version "0.5.1")
6248 (source
6249 (origin
6250 (method url-fetch)
6251 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
6252 version "/" name "-" version ".tar.gz"))
6253 (sha256
6254 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
6255 (build-system gnu-build-system)
6256 (inputs
6257 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
6258 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
6259 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
6260 `(("pnmtopng" ,netpbm)))
6261 (outputs (list "out" "fbgrab"))
6262 (arguments
6263 `(#:make-flags
6264 (list "CC=gcc"
6265 (string-append "PREFIX=" (assoc-ref %outputs "out")))
6266 #:tests? #f ; no tests
6267 #:phases
6268 (modify-phases %standard-phases
6269 (delete 'configure) ; no configure script
6270 (add-after 'build 'qualify-references
6271 (lambda* (#:key inputs outputs #:allow-other-keys)
6272 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
6273 (out (assoc-ref outputs "out")))
6274 (substitute* "fbgrab"
6275 (("fbcat" all)
6276 (string-append out "/bin/" all))
6277 (("pnmtopng" all)
6278 (string-append pnmtopng "/bin/" all)))
6279 #t)))
6280 (add-after 'install 'split-fbgrab-output
6281 (lambda* (#:key outputs #:allow-other-keys)
6282 (let* ((out (assoc-ref outputs "out"))
6283 (out:fbgrab (assoc-ref outputs "fbgrab")))
6284 (for-each (lambda (file)
6285 (let ((old (string-append out "/" file))
6286 (new (string-append out:fbgrab "/" file)))
6287 (mkdir-p (dirname new))
6288 (rename-file old new)))
6289 (list "bin/fbgrab"
6290 "share/man/man1/fbgrab.1"))
6291 #t))))))
6292 (home-page "https://jwilk.net/software/fbcat")
6293 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
6294 (description
6295 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
6296 a dump therof. It supports a wide range of drivers and pixel formats.
6297 @command{fbcat} can take screenshots of virtually any application that can be
6298 made to write its output to the framebuffer, including (but not limited to)
6299 text-mode or graphical applications that don't use a display server.
6300
6301 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
6302 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
6303 (license license:gpl2)))
6304
6305 (define-public libcgroup
6306 (package
6307 (name "libcgroup")
6308 (version "0.41")
6309 (source
6310 (origin
6311 (method url-fetch)
6312 (uri (string-append
6313 "mirror://sourceforge/libcg/" name "/"
6314 version "/" name "-" version ".tar.bz2"))
6315 (sha256
6316 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
6317 (build-system gnu-build-system)
6318 (arguments
6319 `(#:tests? #f))
6320 (native-inputs
6321 `(("bison" ,bison)
6322 ("flex" ,flex)))
6323 (inputs
6324 `(("linux-pam" ,linux-pam)))
6325 (home-page "https://sourceforge.net/projects/libcg/")
6326 (synopsis "Control groups management tools")
6327 (description "Control groups is Linux kernel method for process resource
6328 restriction, permission handling and more. This package provides userspace
6329 interface to this kernel feature.")
6330 (license license:lgpl2.1)))
6331
6332 (define-public mbpfan
6333 (package
6334 (name "mbpfan")
6335 (version "2.1.1")
6336 (source
6337 (origin
6338 (method git-fetch)
6339 (uri (git-reference
6340 (url "https://github.com/dgraziotin/mbpfan.git")
6341 (commit (string-append "v" version))))
6342 (file-name (git-file-name name version))
6343 (sha256
6344 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
6345 (build-system gnu-build-system)
6346 (arguments
6347 '(#:tests? #f ; tests ask to be run as root
6348 #:make-flags (let ((out (assoc-ref %outputs "out")))
6349 (list (string-append "DESTDIR=" out)
6350 "CC=gcc"))
6351 #:phases
6352 (modify-phases %standard-phases
6353 (add-after 'unpack 'patch-paths
6354 (lambda _
6355 (substitute* "Makefile"
6356 (("/usr") ""))
6357 #t))
6358 (delete 'configure)))) ; there's no configure phase
6359 (home-page "https://github.com/dgraziotin/mbpfan")
6360 (synopsis "Control fan speed on Macbooks")
6361 (description
6362 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
6363 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
6364 module. It can be executed as a daemon or in the foreground with root
6365 privileges.")
6366 (license license:gpl3+)))
6367
6368 (define-public psm2
6369 (package
6370 (name "psm2")
6371 (version "11.2.86")
6372 (source (origin
6373 (method git-fetch)
6374 (uri (git-reference
6375 (url "https://github.com/intel/opa-psm2.git")
6376 (commit (string-append "PSM2_" version))))
6377 (file-name (git-file-name name version))
6378 (sha256
6379 (base32
6380 "1hiqzcmc97lzhaqjva82vf8irgg038cciypsv2brw90ak09n6vwf"))))
6381 (build-system gnu-build-system)
6382 (arguments
6383 '(#:make-flags
6384 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6385 #:tests? #f
6386 #:phases (modify-phases %standard-phases
6387 (delete 'configure)
6388 (add-after 'unpack 'patch-Makefiles
6389 (lambda _
6390 (substitute* "Makefile"
6391 (("/lib64") "/lib")
6392 (("/usr") ""))
6393 (substitute* "compat/Makefile"
6394 (("/lib64") "/lib")
6395 (("/usr") ""))
6396 #t))
6397 (replace 'install
6398 (lambda _
6399 (setenv "DESTDIR" %output)
6400 (invoke "make" "install")
6401 #t)))))
6402 (inputs
6403 `(("rdma-core" ,rdma-core)
6404 ("numactl" ,numactl)))
6405 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
6406 (description
6407 "This package is low-level user-level Intel's communications interface.
6408 The PSM2 API is a high-performance vendor-specific protocol that provides a
6409 low-level communications interface for the Intel Omni-Path family of
6410 high-speed networking devices.")
6411 (home-page "https://github.com/intel/opa-psm2")
6412 ;; Only the x86_64 architecure is supported.
6413 (supported-systems '("x86_64-linux"))
6414 (license (list license:bsd-3 license:gpl2)))) ; dual
6415
6416 (define-public libpfm4
6417 (package
6418 (name "libpfm4")
6419 (version "4.9.0")
6420 (source (origin
6421 (method url-fetch)
6422 (uri (string-append "mirror://sourceforge/perfmon2/"
6423 name "/libpfm-" version ".tar.gz"))
6424 (sha256
6425 (base32
6426 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
6427 (build-system gnu-build-system)
6428 (arguments
6429 '(#:modules ((guix build utils)
6430 (guix build gnu-build-system))
6431 #:phases (modify-phases %standard-phases
6432 (delete 'configure)
6433 (delete 'check)
6434 (replace 'build
6435 (lambda* (#:key inputs outputs #:allow-other-keys)
6436 (let* ((out (assoc-ref outputs "out")))
6437 (setenv "CC" "gcc")
6438 (invoke "make")
6439 #t)))
6440 (replace 'install
6441 (lambda* (#:key outputs #:allow-other-keys)
6442 (let* ((out (assoc-ref outputs "out")))
6443 (invoke "make"
6444 (string-append "PREFIX=" out)
6445 "install")
6446 #t))))))
6447 (synopsis "Performance event monitoring library")
6448 (description
6449 "This package provides a library called libpfm4, which is used to develop
6450 monitoring tools exploiting the performance monitoring events such as those
6451 provided by the Performance Monitoring Unit (PMU) of modern processors.
6452
6453 Libpfm4 helps convert from an event name, expressed as a string, to the event
6454 encoding that is either the raw event as documented by the hardware vendor or
6455 the OS-specific encoding. In the latter case, the library is able to prepare
6456 the OS-specific data structures needed by the kernel to setup the event.
6457
6458 libpfm4 provides support for the @code{perf_events} interface, which was
6459 introduced in Linux 2.6.31.")
6460 (home-page "http://perfmon2.sourceforge.net/")
6461 (license license:expat)))
6462
6463 (define-public libnfnetlink
6464 (package
6465 (name "libnfnetlink")
6466 (version "1.0.1")
6467 (source (origin
6468 (method url-fetch)
6469 (uri (string-append
6470 "https://www.netfilter.org/projects/libnfnetlink/files/"
6471 "libnfnetlink-" version ".tar.bz2"))
6472 (sha256
6473 (base32
6474 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
6475 (build-system gnu-build-system)
6476 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
6477 (synopsis "Low-level netfilter netlink communication library")
6478 (description
6479 "@code{libnfnetlink} is the low-level library for netfilter related
6480 kernel/userspace communication. It provides a generic messaging
6481 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
6482 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
6483 management tools in userspace.")
6484 (license license:gpl2)))
6485
6486 (define-public go-netlink
6487 (package
6488 (name "go-netlink")
6489 (version "1.0.0")
6490 (source (origin
6491 (method git-fetch)
6492 (uri (git-reference
6493 (url "https://github.com/vishvananda/netlink.git")
6494 (commit (string-append "v" version))))
6495 (file-name (git-file-name name version))
6496 (sha256
6497 (base32
6498 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
6499 (build-system go-build-system)
6500 (arguments
6501 `(#:import-path "github.com/vishvananda/netlink"))
6502 (native-inputs
6503 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
6504 ("go-netns" ,go-netns)))
6505 (home-page "https://github.com/vishvananda/netlink")
6506 (synopsis "Simple netlink library for Go")
6507 (description "The netlink package provides a simple netlink library for
6508 Go. Netlink is the interface a user-space program in Linux uses to
6509 communicate with the kernel. It can be used to add and remove interfaces, set
6510 IP addresses and routes, and configure IPsec.")
6511 (license license:asl2.0)))
6512
6513 (define-public xfsprogs
6514 (package
6515 (name "xfsprogs")
6516 (version "5.2.1")
6517 (source (origin
6518 (method url-fetch)
6519 (uri (string-append
6520 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
6521 "xfsprogs-" version ".tar.gz"))
6522 (sha256
6523 (base32
6524 "0q5xd4gb9g83h82mg68cx616ifzl8qkzzlgg5xna698117ph3wky"))))
6525 (build-system gnu-build-system)
6526 (outputs (list "out" "python"))
6527 (arguments
6528 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
6529 #:phases
6530 (modify-phases %standard-phases
6531 (add-after 'install 'separate-python-output
6532 (lambda* (#:key outputs #:allow-other-keys)
6533 (let ((out (assoc-ref outputs "out"))
6534 (python (assoc-ref outputs "python")))
6535 (for-each
6536 (lambda (script)
6537 (mkdir-p (string-append python (dirname script)))
6538 (rename-file (string-append out script)
6539 (string-append python script)))
6540 (list "/sbin/xfs_scrub_all"))
6541 #t)))
6542 (add-after 'install 'install-headers
6543 (lambda _
6544 (invoke "make" "install-dev"))))))
6545 (native-inputs
6546 `(("gettext" ,gettext-minimal)))
6547 (inputs
6548 `(("libuuid" ,util-linux)
6549 ("python" ,python-wrapper)))
6550 (home-page "https://xfs.wiki.kernel.org/")
6551 (synopsis "XFS file system tools")
6552 (description "This package provides commands to create and check XFS
6553 file systems.")
6554 ;; The library "libhandle" and the headers in "xfslibs-dev" are
6555 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
6556 (license (list license:gpl2 license:lgpl2.1))))
6557
6558 (define-public genext2fs
6559 (package
6560 (name "genext2fs")
6561 (version "1.4.1-4")
6562 (source (origin
6563 (method git-fetch)
6564 (uri (git-reference
6565 (url "https://github.com/jeremie-koenig/genext2fs.git")
6566 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
6567 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
6568 (file-name (git-file-name name version))
6569 (sha256
6570 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
6571 (build-system gnu-build-system)
6572 (arguments
6573 `(#:phases
6574 (modify-phases %standard-phases
6575 (add-after 'unpack 'apply-debian-patches
6576 ;; Debian changes (the revision after ‘-’ in VERSION) are
6577 ;; maintained as separate patches. Apply those relevant to us.
6578 (lambda _
6579 (for-each
6580 (lambda (file-name)
6581 (invoke "patch" "-p1" "-i"
6582 (string-append "debian/patches/" file-name)))
6583 (list "blocksize+creator.diff" ; add -B/-o options
6584 "byteswap_fix.diff"))
6585 #t)))))
6586 (native-inputs
6587 `(("autoconf" ,autoconf)
6588 ("automake" ,automake)))
6589 (home-page "https://github.com/jeremie-koenig/genext2fs")
6590 (synopsis "Generate ext2 file system as a normal user")
6591 (description "This package provides a program to generate an ext2
6592 file system as a normal (non-root) user. It does not require you to mount
6593 the image file to copy files on it, nor does it require that you become
6594 the superuser to make device nodes.")
6595 (license license:gpl2)))
6596
6597 (define-public fakeroot
6598 (package
6599 (name "fakeroot")
6600 (version "1.24")
6601 (source (origin
6602 (method url-fetch)
6603 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
6604 "fakeroot/fakeroot_" version ".orig.tar.gz"))
6605 (file-name (string-append name "-" version ".tar.gz"))
6606 (sha256
6607 (base32
6608 "1vb6f93hjyqnwx8dc8mm3dgma7axgqk8s7sdsjs8l2rpc0qmn11f"))))
6609 (build-system gnu-build-system)
6610 (arguments
6611 `(#:phases
6612 (modify-phases %standard-phases
6613 (add-after 'configure 'patch-Makefile
6614 (lambda _
6615 ;; Note: The root of the problem is already in "Makefile.am".
6616 (substitute* "Makefile"
6617 (("/bin/sh") (which "sh")))
6618 #t))
6619 (add-after 'unpack 'patch-getopt
6620 (lambda* (#:key inputs #:allow-other-keys)
6621 (substitute* "scripts/fakeroot.in"
6622 (("getopt")
6623 (string-append (assoc-ref inputs "util-linux")
6624 "/bin/getopt")))
6625 #t))
6626 (add-before 'configure 'setenv
6627 (lambda _
6628 (setenv "LIBS" "-lacl")
6629 #t))
6630 (add-before 'check 'prepare-check
6631 (lambda _
6632 (setenv "SHELL" (which "bash"))
6633 (setenv "VERBOSE" "1")
6634 (substitute* "test/t.touchinstall"
6635 ;; We don't have the name of the root user, so use ID=0.
6636 (("grep root") "grep \"\\<0\\>\""))
6637 (substitute* "test/tartest"
6638 ;; We don't have the name of the root group, so use ID=0.
6639 (("ROOTGROUP=root") "ROOTGROUP=0")
6640 ;; We don't have the name of the daemon user, so use IDs.
6641 (("daemon:sys") "1:3")
6642 (("daemon:") "1:"))
6643 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
6644 (substitute* "test/compare-tar"
6645 (("tar -tvf") "tar --numeric-owner -tvf"))
6646 #t)))))
6647 (native-inputs
6648 `(("acl" ,acl)
6649 ("sharutils" ,sharutils) ; for the tests
6650 ("xz" ,xz))) ; for the tests
6651 (inputs
6652 `(("libcap" ,libcap)
6653 ("util-linux" ,util-linux)))
6654 (synopsis "Provides a fake root environment")
6655 (description "@command{fakeroot} runs a command in an environment where
6656 it appears to have root privileges for file manipulation. This is useful
6657 for allowing users to create archives (tar, ar, .deb etc.) with files in
6658 them with root permissions/ownership. Without fakeroot one would have to
6659 have root privileges to create the constituent files of the archives with
6660 the correct permissions and ownership, and then pack them up, or one would
6661 have to construct the archives directly, without using the archiver.")
6662 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
6663 (license license:gpl3+)))
6664
6665 (define-public inputattach
6666 (package
6667 (name "inputattach")
6668 (version "0.42.0")
6669 (source (origin
6670 (method git-fetch)
6671 (uri (git-reference
6672 (url "https://github.com/linuxwacom/input-wacom.git")
6673 (commit (string-append "input-wacom-" version))))
6674 (file-name (git-file-name name version))
6675 (sha256
6676 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
6677 (build-system gnu-build-system)
6678 (arguments
6679 `(#:phases
6680 (modify-phases %standard-phases
6681 (delete 'bootstrap)
6682 (delete 'configure)
6683 (replace 'build
6684 (lambda* (#:key inputs #:allow-other-keys)
6685 (with-directory-excursion "inputattach"
6686 (invoke (string-append (assoc-ref inputs "gcc")
6687 "/bin/gcc")
6688 "-O2" "-o" "inputattach" "inputattach.c"))
6689 #t))
6690 (delete 'check)
6691 (replace 'install
6692 (lambda* (#:key outputs #:allow-other-keys)
6693 (let ((target-dir (string-append
6694 (assoc-ref outputs "out")
6695 "/bin/")))
6696 (mkdir-p target-dir)
6697 (copy-file "inputattach/inputattach"
6698 (string-append target-dir
6699 "inputattach"))
6700 #t))))))
6701 (home-page "https://linuxwacom.github.io/")
6702 (synopsis "Dispatch input peripherals events to a device file")
6703 (description "inputattach dispatches input events from several device
6704 types and interfaces and translates so that the X server can use them.")
6705 (license license:gpl2+)))
6706
6707 (define-public pipewire
6708 (package
6709 (name "pipewire")
6710 (version "0.2.7")
6711 (source (origin
6712 (method git-fetch)
6713 (uri (git-reference
6714 (url "https://github.com/PipeWire/pipewire")
6715 (commit version)))
6716 (file-name (git-file-name name version))
6717 (sha256
6718 (base32
6719 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
6720 (build-system meson-build-system)
6721 (arguments
6722 '(#:configure-flags '("-Dsystemd=false")))
6723 (native-inputs
6724 `(("pkg-config" ,pkg-config)))
6725 (inputs
6726 `(("alsa-lib" ,alsa-lib)
6727 ("dbus" ,dbus)
6728 ("eudev" ,eudev)
6729 ("ffmpeg" ,ffmpeg)
6730 ("gstreamer" ,gstreamer)
6731 ("gst-plugins-base" ,gst-plugins-base)
6732 ("libva" ,libva)
6733 ("sbc" ,sbc)
6734 ("sdl2" ,sdl2)))
6735 (home-page "https://pipewire.org/")
6736 (synopsis "Server and user space API to deal with multimedia pipelines")
6737 (description
6738 "PipeWire is a project that aims to greatly improve handling of audio and
6739 video under Linux. It aims to support the usecases currently handled by both
6740 PulseAudio and Jack and at the same time provide same level of powerful handling
6741 of Video input and output. It also introduces a security model that makes
6742 interacting with audio and video devices from containerized applications easy,
6743 with supporting Flatpak applications being the primary goal. Alongside Wayland
6744 and Flatpak we expect PipeWire to provide a core building block for the future
6745 of Linux application development.")
6746 (license license:lgpl2.0+)))
6747
6748 (define-public ell
6749 (package
6750 (name "ell")
6751 (version "0.23")
6752 (source (origin
6753 (method git-fetch)
6754 (uri (git-reference
6755 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
6756 (commit version)))
6757 (file-name (git-file-name name version))
6758 (sha256
6759 (base32
6760 "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10"))))
6761 (build-system gnu-build-system)
6762 (arguments
6763 `(#:phases
6764 (modify-phases %standard-phases
6765 (add-after 'unpack 'fix-dbus-tests
6766 (lambda _
6767 (substitute* '("unit/test-dbus-message-fds.c"
6768 "unit/test-dbus-properties.c"
6769 "unit/test-dbus.c")
6770 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
6771 #t)))))
6772 (inputs
6773 `(("dbus" ,dbus)))
6774 (native-inputs
6775 `(("autoconf" ,autoconf)
6776 ("libtool" ,libtool)
6777 ("pkgconfig" ,pkg-config)
6778 ("automake" ,automake)))
6779 (home-page "https://01.org/ell")
6780 (synopsis "Embedded Linux Library")
6781 (description "The Embedded Linux* Library (ELL) provides core, low-level
6782 functionality for system daemons. It typically has no dependencies other than
6783 the Linux kernel, C standard library, and libdl (for dynamic linking). While
6784 ELL is designed to be efficient and compact enough for use on embedded Linux
6785 platforms, it is not limited to resource-constrained systems.")
6786 (license license:lgpl2.1+)))
6787
6788 (define-public lttng-ust
6789 (package
6790 (name "lttng-ust")
6791 (version "2.11.0")
6792 (source (origin
6793 (method url-fetch)
6794 (uri (string-append "https://lttng.org/files/lttng-ust/"
6795 "lttng-ust-" version ".tar.bz2"))
6796 (sha256
6797 (base32
6798 "1n646yz7882svf5a4ay3vqiiz3qjn3pgkkij9kk22871wp7q0ck8"))))
6799 (build-system gnu-build-system)
6800 (inputs
6801 `(("liburcu" ,liburcu)
6802 ("numactl" ,numactl)))
6803 (native-inputs
6804 `(("python" ,python-3)))
6805 (home-page "https://lttng.org/")
6806 (synopsis "LTTng userspace tracer libraries")
6807 (description "The user space tracing library, liblttng-ust, is the LTTng
6808 user space tracer. It receives commands from a session daemon, for example to
6809 enable and disable specific instrumentation points, and writes event records
6810 to ring buffers shared with a consumer daemon.")
6811 (license license:lgpl2.1+)))
6812
6813 (define-public kexec-tools
6814 (package
6815 (name "kexec-tools")
6816 (version "2.0.20")
6817 (source (origin
6818 (method url-fetch)
6819 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
6820 "/kexec/kexec-tools-" version ".tar.xz"))
6821 (sha256
6822 (base32
6823 "1j7qlhxk1rbv9jbj8wd6hb7zl8p2mp29ymrmccgmsi0m0dzhgn6s"))))
6824 (build-system gnu-build-system)
6825 (arguments
6826 ;; There are no automated tests.
6827 '(#:tests? #f))
6828 (home-page "https://projects.horms.net/projects/kexec/")
6829 (synopsis "Tools for booting directly into different kernels")
6830 (description "This package provides the @code{kexec} program and ancillary
6831 utilities. Using @code{kexec}, it is possible to boot directly into a new
6832 kernel from the context of an already-running kernel, bypassing the normal
6833 system boot process.")
6834 (license license:gpl2)))