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, 2020 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 Nikita <nikita@n0.is>
22 ;;; Copyright © 2017, 2018, 2020 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, 2019 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 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
46 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
47 ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
48 ;;; Copyright © 2020 John Soo <jsoo1@asu.edu>
49 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
50 ;;; Copyright © 2020 Anders Thuné <asse.97@gmail.com>
51 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
52 ;;; Copyright © 2020 Greg Hogan <code@greghogan.com>
53 ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
55 ;;; This file is part of GNU Guix.
57 ;;; GNU Guix is free software; you can redistribute it and/or modify it
58 ;;; under the terms of the GNU General Public License as published by
59 ;;; the Free Software Foundation; either version 3 of the License, or (at
60 ;;; your option) any later version.
62 ;;; GNU Guix is distributed in the hope that it will be useful, but
63 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
64 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
65 ;;; GNU General Public License for more details.
67 ;;; You should have received a copy of the GNU General Public License
68 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
70 (define-module (gnu packages linux)
71 #:use-module (gnu packages)
72 #:use-module (gnu packages acl)
73 #:use-module (gnu packages admin)
74 #:use-module (gnu packages algebra)
75 #:use-module (gnu packages audio)
76 #:use-module (gnu packages autotools)
77 #:use-module (gnu packages backup)
78 #:use-module (gnu packages base)
79 #:use-module (gnu packages bash)
80 #:use-module (gnu packages bison)
81 #:use-module (gnu packages boost)
82 #:use-module (gnu packages calendar)
83 #:use-module (gnu packages check)
84 #:use-module (gnu packages cpio)
85 #:use-module (gnu packages crypto)
86 #:use-module (gnu packages cryptsetup)
87 #:use-module (gnu packages compression)
88 #:use-module (gnu packages dbm)
89 #:use-module (gnu packages datastructures)
90 #:use-module (gnu packages docbook)
91 #:use-module (gnu packages documentation)
92 #:use-module (gnu packages elf)
93 #:use-module (gnu packages flex)
94 #:use-module (gnu packages file)
95 #:use-module (gnu packages freedesktop)
96 #:use-module (gnu packages gawk)
97 #:use-module (gnu packages gcc)
98 #:use-module (gnu packages gettext)
99 #:use-module (gnu packages glib)
100 #:use-module (gnu packages golang)
101 #:use-module (gnu packages gperf)
102 #:use-module (gnu packages gstreamer)
103 #:use-module (gnu packages gtk)
104 #:use-module (gnu packages haskell-apps)
105 #:use-module (gnu packages haskell-xyz)
106 #:use-module (gnu packages libunwind)
107 #:use-module (gnu packages libusb)
108 #:use-module (gnu packages llvm)
109 #:use-module (gnu packages lua)
110 #:use-module (gnu packages man)
111 #:use-module (gnu packages maths)
112 #:use-module (gnu packages multiprecision)
113 #:use-module (gnu packages ncurses)
114 #:use-module (gnu packages netpbm)
115 #:use-module (gnu packages networking)
116 #:use-module (gnu packages ninja)
117 #:use-module (gnu packages nss)
118 #:use-module (gnu packages perl)
119 #:use-module (gnu packages pciutils)
120 #:use-module (gnu packages pkg-config)
121 #:use-module (gnu packages popt)
122 #:use-module (gnu packages pulseaudio)
123 #:use-module (gnu packages python)
124 #:use-module (gnu packages python-xyz)
125 #:use-module (gnu packages readline)
126 #:use-module (gnu packages rrdtool)
127 #:use-module (gnu packages samba)
128 #:use-module (gnu packages sdl)
129 #:use-module (gnu packages serialization)
130 #:use-module (gnu packages slang)
131 #:use-module (gnu packages texinfo)
132 #:use-module (gnu packages tls)
133 #:use-module (gnu packages valgrind)
134 #:use-module (gnu packages video)
135 #:use-module (gnu packages vulkan)
136 #:use-module (gnu packages web)
137 #:use-module (gnu packages xiph)
138 #:use-module (gnu packages xml)
139 #:use-module (gnu packages xdisorg)
140 #:use-module (gnu packages xorg)
141 #:use-module (gnu packages groff)
142 #:use-module (gnu packages rsync)
143 #:use-module (gnu packages selinux)
144 #:use-module (gnu packages swig)
145 #:use-module (guix build-system cmake)
146 #:use-module (guix build-system gnu)
147 #:use-module (guix build-system go)
148 #:use-module (guix build-system meson)
149 #:use-module (guix build-system python)
150 #:use-module (guix build-system trivial)
151 #:use-module (guix build-system linux-module)
152 #:use-module (guix download)
153 #:use-module (guix git-download)
154 #:use-module ((guix licenses) #:prefix license:)
155 #:use-module (guix packages)
156 #:use-module (guix gexp)
157 #:use-module (guix store)
158 #:use-module (guix monads)
159 #:use-module (guix utils)
160 #:use-module (guix deprecation) ;for libcap/next
161 #:use-module (srfi srfi-1)
162 #:use-module (srfi srfi-2)
163 #:use-module (srfi srfi-26)
164 #:use-module (ice-9 match))
166 (define-public (system->linux-architecture arch)
167 "Return the Linux architecture name for ARCH, a Guix system name such as
168 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
169 (let ((arch (car (string-split arch #\-))))
170 (cond ((string=? arch "i686") "i386")
171 ((string-prefix? "mips" arch) "mips")
172 ((string-prefix? "arm" arch) "arm")
173 ((string-prefix? "aarch64" arch) "arm64")
174 ((string-prefix? "alpha" arch) "alpha")
175 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
176 ((string-prefix? "s390" arch) "s390")
177 ((string-prefix? "riscv" arch) "riscv")
180 (define-public (system->defconfig system)
181 "Some systems (notably powerpc-linux) require a special target for kernel
182 defconfig. Return the appropriate make target if applicable, otherwise return
184 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
185 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
190 ;;; Kernel source code deblobbing.
193 (define (linux-libre-deblob-scripts version
196 (list (version-major+minor version)
199 (uri (string-append "https://linux-libre.fsfla.org"
200 "/pub/linux-libre/releases/" version "-gnu/"
201 "deblob-" (version-major+minor version)))
202 (file-name (string-append "linux-libre-deblob-"
204 (sha256 deblob-hash))
207 (uri (string-append "https://linux-libre.fsfla.org"
208 "/pub/linux-libre/releases/" version "-gnu/"
210 (file-name (string-append "linux-libre-deblob-check-" version))
211 (sha256 deblob-check-hash))))
213 (define* (computed-origin-method gexp-promise hash-algo hash
214 #:optional (name "source")
215 #:key (system (%current-system))
216 (guile (default-guile)))
217 "Return a derivation that executes the G-expression that results
218 from forcing GEXP-PROMISE."
219 (mlet %store-monad ((guile (package->derivation guile system)))
220 (gexp->derivation (or name "computed-origin")
222 #:graft? #f ;nothing to graft
224 #:guile-for-build guile)))
226 (define (make-linux-libre-source version
229 "Return a 'computed' origin that generates a Linux-libre tarball from the
230 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
231 (match deblob-scripts
232 ((deblob-version (? origin? deblob) (? origin? deblob-check))
233 (unless (string=? deblob-version (version-major+minor version))
234 ;; The deblob script cannot be expected to work properly on a
235 ;; different version (major+minor) of Linux, even if no errors
236 ;; are signaled during execution.
237 (error "deblob major+minor version mismatch"))
239 (method computed-origin-method)
240 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
244 (with-imported-modules '((guix build utils))
246 (use-modules (guix build utils)
251 (setvbuf (current-output-port) 'line)
253 (let ((dir (string-append "linux-" #$version)))
256 (set-path-environment-variable
259 #+(canonical-package bash)
260 #+(canonical-package coreutils)
261 #+(canonical-package diffutils)
262 #+(canonical-package findutils)
263 #+(canonical-package patch)
264 #+(canonical-package xz)
265 #+(canonical-package sed)
266 #+(canonical-package grep)
267 #+(canonical-package bzip2)
268 #+(canonical-package gzip)
269 #+(canonical-package tar)
270 #+(canonical-package gawk)
273 (with-directory-excursion "/tmp/bin"
275 (copy-file #+deblob "deblob")
276 (chmod "deblob" #o755)
277 (substitute* "deblob"
278 (("/bin/sh") (which "sh")))
280 (copy-file #+deblob-check "deblob-check")
281 (chmod "deblob-check" #o755)
282 (substitute* "deblob-check"
283 (("/bin/sh") (which "sh"))
284 (("/bin/sed") (which "sed"))
285 (("/usr/bin/python") (which "python"))))
287 (if (file-is-directory? #+upstream-source)
289 (format #t "Copying upstream linux source...~%")
290 (invoke "cp" "--archive" #+upstream-source dir)
291 (invoke "chmod" "--recursive" "u+w" dir))
293 (format #t "Unpacking upstream linux tarball...~%")
294 (invoke "tar" "xf" #$upstream-source)
297 (and (not (member name '("." "..")))
298 (file-is-directory? name))))
300 (unless (string=? dir unpacked-dir)
301 (rename-file unpacked-dir dir)))
303 (error "multiple directories found" dirs)))))
305 (with-directory-excursion dir
306 (format #t "Running deblob script...~%")
307 (invoke "/tmp/bin/deblob"))
309 (format #t "~%Packing new Linux-libre tarball...~%")
310 (invoke "tar" "cvfa" #$output
311 ;; Avoid non-determinism in the archive.
319 (format #t "~%Scanning the generated tarball for blobs...~%")
320 (invoke "/tmp/bin/deblob-check" "--use-awk" "--list-blobs"
328 (define (linux-libre-urls version)
329 "Return a list of URLs for Linux-Libre VERSION."
331 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
332 version "-gnu/linux-libre-" version "-gnu.tar.xz")
334 ;; XXX: Work around <http://bugs.gnu.org/14851>.
336 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
337 version "-gnu.tar.xz")
339 ;; Maybe this URL will become valid eventually.
341 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
342 version "-gnu.tar.xz")))
344 (define (%upstream-linux-source version hash)
347 (uri (string-append "mirror://kernel.org"
348 "/linux/kernel/v" (version-major version) ".x/"
349 "linux-" version ".tar.xz"))
353 ;; The current "stable" kernel. That is, the most recently released major
355 (define-public linux-libre-5.9-version "5.9.14")
356 (define deblob-scripts-5.9
357 (linux-libre-deblob-scripts
358 linux-libre-5.9-version
359 (base32 "1l0iw2lp6alk0a8nvdafklyks83iiyw4b2r5xif84z47qfbydsis")
360 (base32 "0yb04a4j2wq3mwvks3cj7kcm2pscmfs29lrz3falkxpbvjxbbgq2")))
361 (define-public linux-libre-5.9-pristine-source
362 (let ((version linux-libre-5.9-version)
363 (hash (base32 "0jbb3rzbkh0l75zq9bnc60w55ryvrvcg7vw85fsbcwfzvi0zpz1r")))
364 (make-linux-libre-source version
365 (%upstream-linux-source version hash)
366 deblob-scripts-5.9)))
368 ;; The "longterm" kernels — the older releases with long-term upstream support.
369 ;; Here are the support timelines:
370 ;; <https://www.kernel.org/category/releases.html>
371 (define-public linux-libre-5.4-version "5.4.83")
372 (define deblob-scripts-5.4
373 (linux-libre-deblob-scripts
374 linux-libre-5.4-version
375 (base32 "0ckxn7k5zgcqk30dq943bnamr6a6zjbw2aqjl3x30f4kvh5f6k25")
376 (base32 "167zcfkw62pm6nv1xdvvhxw0ca724sywcywnv3z00189f8f8p3vg")))
377 (define-public linux-libre-5.4-pristine-source
378 (let ((version linux-libre-5.4-version)
379 (hash (base32 "1ik14pfgynkn1sjhgyhgmxjvviq0mgvk0ygj76w8mplkpc5rgv5y")))
380 (make-linux-libre-source version
381 (%upstream-linux-source version hash)
382 deblob-scripts-5.4)))
384 (define-public linux-libre-4.19-version "4.19.163")
385 (define deblob-scripts-4.19
386 (linux-libre-deblob-scripts
387 linux-libre-4.19-version
388 (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy")
389 (base32 "1jiaw0as1ippkrjdpd52657w5mz9qczg3y2hlra7m9k0xawwiqlf")))
390 (define-public linux-libre-4.19-pristine-source
391 (let ((version linux-libre-4.19-version)
392 (hash (base32 "1z65iwwyx2b01fncygckmhpxirzs52qfqmv3agirn4laxgjw9viy")))
393 (make-linux-libre-source version
394 (%upstream-linux-source version hash)
395 deblob-scripts-4.19)))
397 (define-public linux-libre-4.14-version "4.14.212")
398 (define deblob-scripts-4.14
399 (linux-libre-deblob-scripts
400 linux-libre-4.14-version
401 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
402 (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky")))
403 (define-public linux-libre-4.14-pristine-source
404 (let ((version linux-libre-4.14-version)
405 (hash (base32 "0y8ck8pfxm8862wi4cz8qp9x9b18yl448i8m7bpbphs290nc66qf")))
406 (make-linux-libre-source version
407 (%upstream-linux-source version hash)
408 deblob-scripts-4.14)))
410 (define-public linux-libre-4.9-version "4.9.248")
411 (define deblob-scripts-4.9
412 (linux-libre-deblob-scripts
413 linux-libre-4.9-version
414 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
415 (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2")))
416 (define-public linux-libre-4.9-pristine-source
417 (let ((version linux-libre-4.9-version)
418 (hash (base32 "1kzczy0lz3lnjkhvx90dgjmzn3d3y55qxlihiclkr4y9c602d1s6")))
419 (make-linux-libre-source version
420 (%upstream-linux-source version hash)
421 deblob-scripts-4.9)))
423 (define-public linux-libre-4.4-version "4.4.248")
424 (define deblob-scripts-4.4
425 (linux-libre-deblob-scripts
426 linux-libre-4.4-version
427 (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw")
428 (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf")))
429 (define-public linux-libre-4.4-pristine-source
430 (let ((version linux-libre-4.4-version)
431 (hash (base32 "1z1xbkm0z0v6k3scszii5hi24pn391332g0li93p3n1rnv74jap5")))
432 (make-linux-libre-source version
433 (%upstream-linux-source version hash)
434 deblob-scripts-4.4)))
436 (define %boot-logo-patch
437 ;; Linux-Libre boot logo featuring Freedo and a gnu.
440 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
441 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
444 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
446 (define %linux-libre-arm-export-__sync_icache_dcache-patch
450 "https://salsa.debian.org/kernel-team/linux"
451 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
452 "/debian/patches/bugfix/arm/"
453 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
454 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
456 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
458 (define (source-with-patches source patches)
461 (patches (append (origin-patches source)
464 (define-public linux-libre-5.9-source
465 (source-with-patches linux-libre-5.9-pristine-source
466 (list %boot-logo-patch
467 %linux-libre-arm-export-__sync_icache_dcache-patch)))
469 (define-public linux-libre-5.4-source
470 (source-with-patches linux-libre-5.4-pristine-source
471 (list %boot-logo-patch
472 %linux-libre-arm-export-__sync_icache_dcache-patch
473 ;; Pinebook Pro patch from linux-next,
474 ;; can be dropped for linux-libre 5.7
476 "linux-libre-support-for-Pinebook-Pro.patch"))))
478 (define-public linux-libre-4.19-source
479 (source-with-patches linux-libre-4.19-pristine-source
480 (list %boot-logo-patch
481 %linux-libre-arm-export-__sync_icache_dcache-patch)))
483 (define-public linux-libre-4.14-source
484 (source-with-patches linux-libre-4.14-pristine-source
485 (list %boot-logo-patch)))
487 (define-public linux-libre-4.9-source
488 (source-with-patches linux-libre-4.9-pristine-source
489 (list %boot-logo-patch)))
491 (define-public linux-libre-4.4-source
492 (source-with-patches linux-libre-4.4-pristine-source
493 (list %boot-logo-patch)))
500 (define (make-linux-libre-headers version hash-string)
501 (make-linux-libre-headers* version
504 (uri (linux-libre-urls version))
505 (sha256 (base32 hash-string)))))
507 (define (make-linux-libre-headers* version source)
509 (name "linux-libre-headers")
512 (build-system gnu-build-system)
513 (native-inputs `(("perl" ,perl)
514 ,@(if (version>=? version "4.16")
518 ,@(if (version>=? version "5.3")
522 `(#:modules ((guix build gnu-build-system)
526 (modify-phases %standard-phases
530 (let ((arch ,(system->linux-architecture
531 (or (%current-target-system)
533 (defconfig ,(system->defconfig
534 (or (%current-target-system)
535 (%current-system)))))
537 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
538 (invoke "make" defconfig)
539 (invoke "make" "mrproper" "headers_check"))))
541 (lambda* (#:key outputs #:allow-other-keys)
542 (let ((out (assoc-ref outputs "out")))
544 (string-append "INSTALL_HDR_PATH=" out)
547 (mkdir (string-append out "/include/config"))
548 (call-with-output-file
550 "/include/config/kernel.release")
552 (format p "~a-default~%" ,version)))
554 ;; Remove the '.install' and '..install.cmd' files; the
555 ;; latter contains store paths, which pulls in bootstrap
556 ;; binaries in the build environment, and prevents bit
557 ;; reproducibility for the bootstrap binaries.
558 (for-each delete-file (find-files out "\\.install"))
561 #:allowed-references ()
563 (home-page "https://www.gnu.org/software/linux-libre/")
564 (synopsis "GNU Linux-Libre kernel headers")
565 (description "Headers of the Linux-Libre kernel.")
566 (license license:gpl2)))
568 (define-public linux-libre-headers-5.9
569 (make-linux-libre-headers* linux-libre-5.9-version
570 linux-libre-5.9-source))
572 (define-public linux-libre-headers-5.4
573 (make-linux-libre-headers* linux-libre-5.4-version
574 linux-libre-5.4-source))
576 (define-public linux-libre-headers-4.19
577 (make-linux-libre-headers* linux-libre-4.19-version
578 linux-libre-4.19-source))
580 (define-public linux-libre-headers-4.14
581 (make-linux-libre-headers* linux-libre-4.14-version
582 linux-libre-4.14-source))
584 (define-public linux-libre-headers-4.9
585 (make-linux-libre-headers* linux-libre-4.9-version
586 linux-libre-4.9-source))
588 (define-public linux-libre-headers-4.4
589 (make-linux-libre-headers* linux-libre-4.4-version
590 linux-libre-4.4-source))
592 ;; The following package is used in the early bootstrap, and thus must be kept
593 ;; stable and with minimal build requirements.
594 (define-public linux-libre-headers-5.4.20
595 (make-linux-libre-headers "5.4.20"
596 "1qxhf6dmcwjblzx8fgn6vr10p38xw10iwh6d1y1v1mxb25y30b47"))
598 (define-public linux-libre-headers linux-libre-headers-5.4.20)
602 ;;; Kernel configurations.
605 (define* (kernel-config arch #:key variant)
606 "Return the absolute file name of the Linux-Libre build configuration file
607 for ARCH and optionally VARIANT, or #f if there is no such configuration."
608 (let* ((name (string-append (if variant (string-append variant "-") "")
609 (if (string=? "i386" arch) "i686" arch) ".conf"))
610 (file (string-append "linux-libre/" name)))
611 (search-auxiliary-file file)))
613 (define %default-extra-linux-options
614 `(;; Some very mild hardening.
615 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
616 ;; All kernels should have NAMESPACES options enabled
617 ("CONFIG_NAMESPACES" . #t)
618 ("CONFIG_UTS_NS" . #t)
619 ("CONFIG_IPC_NS" . #t)
620 ("CONFIG_USER_NS" . #t)
621 ("CONFIG_PID_NS" . #t)
622 ("CONFIG_NET_NS" . #t)
623 ;; Various options needed for elogind service:
624 ;; https://issues.guix.gnu.org/43078
625 ("CONFIG_CGROUP_FREEZER" . #t)
626 ("CONFIG_BLK_CGROUP" . #t)
627 ("CONFIG_CGROUP_WRITEBACK" . #t)
628 ("CONFIG_CGROUP_SCHED" . #t)
629 ("CONFIG_CGROUP_PIDS" . #t)
630 ("CONFIG_CGROUP_FREEZER" . #t)
631 ("CONFIG_CGROUP_DEVICE" . #t)
632 ("CONFIG_CGROUP_CPUACCT" . #t)
633 ("CONFIG_CGROUP_PERF" . #t)
634 ("CONFIG_SOCK_CGROUP_DATA" . #t)
635 ("CONFIG_BLK_CGROUP_IOCOST" . #t)
636 ("CONFIG_CGROUP_NET_PRIO" . #t)
637 ("CONFIG_CGROUP_NET_CLASSID" . #t)
638 ("CONFIG_MEMCG" . #t)
639 ("CONFIG_MEMCG_SWAP" . #t)
640 ("CONFIG_MEMCG_KMEM" . #t)
641 ("CONFIG_CPUSETS" . #t)
642 ("CONFIG_PROC_PID_CPUSET" . #t)
643 ;; Modules required for initrd:
644 ("CONFIG_NET_9P" . m)
645 ("CONFIG_NET_9P_VIRTIO" . m)
646 ("CONFIG_VIRTIO_BLK" . m)
647 ("CONFIG_VIRTIO_NET" . m)
648 ("CONFIG_VIRTIO_PCI" . m)
649 ("CONFIG_VIRTIO_BALLOON" . m)
650 ("CONFIG_VIRTIO_MMIO" . m)
651 ("CONFIG_FUSE_FS" . m)
653 ("CONFIG_9P_FS" . m)))
655 ;; See https://github.com/iovisor/bcc/blob/master/INSTALL.md#kernel-configuration
656 (define %bpf-extra-linux-options
657 `(;; Needed for probes
658 ("CONFIG_UPROBE_EVENTS" . #t)
659 ("CONFIG_KPROBE_EVENTS" . #t)
660 ;; kheaders module also helpful for tracing
661 ("CONFIG_IKHEADERS" . #t)
663 ("CONFIG_BPF_SYSCALL" . #t)
664 ("CONFIG_BPF_JIT_ALWAYS_ON" . #t)
665 ;; optional, for tc filters
666 ("CONFIG_NET_CLS_BPF" . m)
667 ;; optional, for tc actions
668 ("CONFIG_NET_ACT_BPF" . m)
669 ("CONFIG_BPF_JIT" . #t)
670 ;; for Linux kernel versions 4.1 through 4.6
671 ;; ("CONFIG_HAVE_BPF_JIT" . y)
672 ;; for Linux kernel versions 4.7 and later
673 ("CONFIG_HAVE_EBPF_JIT" . #t)
674 ;; optional, for kprobes
675 ("CONFIG_BPF_EVENTS" . #t)
677 ("CONFIG_IKHEADERS" . #t)))
679 (define (config->string options)
680 (string-join (map (match-lambda
682 (string-append option "=m"))
684 (string-append option "=y"))
686 (string-append option "=n")))
692 ;;; Kernel package utilities.
695 (define* (make-linux-libre version hash-string supported-systems
697 ;; A function that takes an arch and a variant.
698 ;; See kernel-config for an example.
700 (configuration-file #f)
701 (defconfig "defconfig")
702 (extra-options %default-extra-linux-options)
703 (patches (list %boot-logo-patch)))
704 (make-linux-libre* version
707 (uri (linux-libre-urls version))
708 (sha256 (base32 hash-string))
711 #:extra-version extra-version
712 #:configuration-file configuration-file
713 #:defconfig defconfig
714 #:extra-options extra-options))
716 (define* (make-linux-libre* version source supported-systems
718 ;; A function that takes an arch and a variant.
719 ;; See kernel-config for an example.
721 (configuration-file #f)
722 (defconfig "defconfig")
723 (extra-options %default-extra-linux-options))
725 (name (if extra-version
726 (string-append "linux-libre-" extra-version)
730 (supported-systems supported-systems)
731 (build-system gnu-build-system)
736 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
740 ;; These are needed to compile the GCC plugins.
745 ,@(match (and configuration-file
747 (system->linux-architecture
748 (or (%current-target-system) (%current-system)))
749 #:variant (version-major+minor version)))
750 (#f ;no config for this platform
753 `(("kconfig" ,config))))))
755 `(#:modules ((guix build gnu-build-system)
762 (modify-phases %standard-phases
763 (add-after 'unpack 'patch-/bin/pwd
765 (substitute* (find-files "." "^Makefile(\\.include)?$")
766 (("/bin/pwd") "pwd"))
769 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
770 ;; Avoid introducing timestamps
771 (setenv "KCONFIG_NOTIMESTAMP" "1")
772 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
774 ;; Set ARCH and CROSS_COMPILE
775 (let ((arch ,(system->linux-architecture
776 (or (%current-target-system)
777 (%current-system)))))
779 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
782 (setenv "CROSS_COMPILE" (string-append target "-"))
783 (format #t "`CROSS_COMPILE' set to `~a'~%"
784 (getenv "CROSS_COMPILE"))))
786 (setenv "EXTRA_VERSION" ,extra-version)
788 (let ((build (assoc-ref %standard-phases 'build))
789 (config (assoc-ref (or native-inputs inputs) "kconfig")))
791 ;; Use a custom kernel configuration file or a default
792 ;; configuration file.
795 (copy-file config ".config")
796 (chmod ".config" #o666))
797 (invoke "make" ,defconfig))
799 ;; Appending works even when the option wasn't in the
800 ;; file. The last one prevails if duplicated.
801 (let ((port (open-file ".config" "a"))
802 (extra-configuration ,(config->string extra-options)))
803 (display extra-configuration port)
806 (invoke "make" "oldconfig"))))
808 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
809 (let* ((out (assoc-ref outputs "out"))
810 (moddir (string-append out "/lib/modules"))
811 (dtbdir (string-append out "/lib/dtbs")))
812 ;; Install kernel image, kernel configuration and link map.
813 (for-each (lambda (file) (install-file file out))
814 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
815 ;; Install device tree files
816 (unless (null? (find-files "." "\\.dtb$"))
818 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
820 ;; Install kernel modules
823 ;; Disable depmod because the Guix system's module directory
824 ;; is an union of potentially multiple packages. It is not
825 ;; possible to use depmod to usefully calculate a dependency
826 ;; graph while building only one of those packages.
828 (string-append "MODULE_DIR=" moddir)
829 (string-append "INSTALL_PATH=" out)
830 (string-append "INSTALL_MOD_PATH=" out)
831 "INSTALL_MOD_STRIP=1"
833 (let* ((versions (filter (lambda (name)
834 (not (string-prefix? "." name)))
836 (version (match versions
838 ;; There are symlinks to the build and source directory,
839 ;; both of which will point to target /tmp/guix-build*
840 ;; and thus not be useful in a profile. Delete the symlinks.
841 (false-if-file-not-found
842 (delete-file (string-append moddir "/" version "/build")))
843 (false-if-file-not-found
844 (delete-file (string-append moddir "/" version "/source"))))
847 (home-page "https://www.gnu.org/software/linux-libre/")
848 (synopsis "100% free redistribution of a cleaned Linux kernel")
850 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
851 It has been modified to remove all non-free binary blobs.")
852 (license license:gpl2)))
856 ;;; Generic kernel packages.
859 (define-public linux-libre-5.9
860 (make-linux-libre* linux-libre-5.9-version
861 linux-libre-5.9-source
862 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
863 #:configuration-file kernel-config))
865 (define-public linux-libre-version linux-libre-5.9-version)
866 (define-public linux-libre-pristine-source linux-libre-5.9-pristine-source)
867 (define-public linux-libre-source linux-libre-5.9-source)
868 (define-public linux-libre linux-libre-5.9)
870 (define-public linux-libre-5.4
871 (make-linux-libre* linux-libre-5.4-version
872 linux-libre-5.4-source
873 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
874 #:configuration-file kernel-config))
876 (define-public linux-libre-4.19
877 (make-linux-libre* linux-libre-4.19-version
878 linux-libre-4.19-source
879 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
880 #:configuration-file kernel-config))
882 (define-public linux-libre-4.14
883 (make-linux-libre* linux-libre-4.14-version
884 linux-libre-4.14-source
885 '("x86_64-linux" "i686-linux" "armhf-linux")
886 #:configuration-file kernel-config))
888 (define-public linux-libre-4.9
889 (make-linux-libre* linux-libre-4.9-version
890 linux-libre-4.9-source
891 '("x86_64-linux" "i686-linux")
892 #:configuration-file kernel-config))
894 (define-public linux-libre-4.4
895 (make-linux-libre* linux-libre-4.4-version
896 linux-libre-4.4-source
897 '("x86_64-linux" "i686-linux")
898 #:configuration-file kernel-config
901 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
902 ;; This option was removed upstream in version 4.7.
903 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
904 %default-extra-linux-options)))
908 ;;; Specialized kernel variants.
911 (define-public linux-libre-arm-generic
912 (make-linux-libre* linux-libre-version
915 #:defconfig "multi_v7_defconfig"
916 #:extra-version "arm-generic"
919 `(;; needed to fix the RTC on rockchip platforms
920 ("CONFIG_RTC_DRV_RK808" . #t))
921 %default-extra-linux-options)))
923 (define-public linux-libre-arm-veyron
924 (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic))
926 (define-public linux-libre-arm-generic-5.4
927 (make-linux-libre* linux-libre-5.4-version
928 linux-libre-5.4-source
930 #:defconfig "multi_v7_defconfig"
931 #:extra-version "arm-generic"
934 `(;; needed to fix the RTC on rockchip platforms
935 ("CONFIG_RTC_DRV_RK808" . #t))
936 %default-extra-linux-options)))
938 (define-public linux-libre-arm-generic-4.19
939 (make-linux-libre* linux-libre-4.19-version
940 linux-libre-4.19-source
942 #:defconfig "multi_v7_defconfig"
943 #:extra-version "arm-generic"))
945 (define-public linux-libre-arm-generic-4.14
946 (make-linux-libre* linux-libre-4.14-version
947 linux-libre-4.14-source
949 #:defconfig "multi_v7_defconfig"
950 #:extra-version "arm-generic"))
952 (define-public linux-libre-arm-omap2plus
953 (make-linux-libre* linux-libre-version
956 #:defconfig "omap2plus_defconfig"
957 #:extra-version "arm-omap2plus"))
959 (define-public linux-libre-arm-omap2plus-4.19
960 (make-linux-libre* linux-libre-4.19-version
961 linux-libre-4.19-source
963 #:defconfig "omap2plus_defconfig"
964 #:extra-version "arm-omap2plus"))
966 (define-public linux-libre-arm-omap2plus-4.14
967 (make-linux-libre* linux-libre-4.14-version
968 linux-libre-4.14-source
970 #:defconfig "omap2plus_defconfig"
971 #:extra-version "arm-omap2plus"))
973 (define-public linux-libre-arm64-generic
974 (make-linux-libre* linux-libre-version
977 #:defconfig "defconfig"
978 #:extra-version "arm64-generic"
981 `(;; needed to fix the RTC on rockchip platforms
982 ("CONFIG_RTC_DRV_RK808" . #t)
983 ;; Pinebook display, battery, charger and usb
984 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
985 ("CONFIG_CHARGER_AXP20X" . m)
986 ("CONFIG_INPUT_AXP20X_PEK" . m)
987 ("CONFIG_CHARGER_AXP20X" . m)
988 ("CONFIG_BATTERY_AXP20X" . m)
989 ("CONFIG_PINCTRL_AXP209" . m)
990 ("CONFIG_AXP20X_POWER" . m)
991 ("CONFIG_AXP20X_ADC" . m))
992 %default-extra-linux-options)))
994 (define-public linux-libre-arm64-generic-5.4
995 (make-linux-libre* linux-libre-5.4-version
996 linux-libre-5.4-source
998 #:defconfig "defconfig"
999 #:extra-version "arm64-generic"
1002 `(;; needed to fix the RTC on rockchip platforms
1003 ("CONFIG_RTC_DRV_RK808" . #t))
1004 %default-extra-linux-options)))
1006 (define-public linux-libre-riscv64-generic
1007 (make-linux-libre* linux-libre-version
1010 #:extra-version "riscv64-generic"))
1012 (define-public linux-libre-mips64el-fuloong2e
1013 (make-linux-libre* linux-libre-version
1016 #:defconfig "fuloong2e_defconfig"
1017 #:extra-version "mips64el-fuloong2e"
1020 `(("CONFIG_OVERLAY_FS" . m))
1021 %default-extra-linux-options)))
1023 (define-public linux-libre-with-bpf
1024 (let ((base-linux-libre
1026 linux-libre-5.9-version
1027 linux-libre-5.9-source
1028 '("x86_64-linux" "i686-linux" "armhf-linux"
1029 "aarch64-linux" "riscv64-linux")
1030 #:extra-version "bpf"
1031 #:configuration-file kernel-config
1033 (append %bpf-extra-linux-options
1034 %default-extra-linux-options))))
1036 (inherit base-linux-libre)
1037 (inputs `(("cpio" ,cpio) ,@(package-inputs base-linux-libre))))))
1042 ;;; Linux kernel modules.
1045 (define-public acpi-call-linux-module
1047 (name "acpi-call-linux-module")
1053 (url "https://github.com/nix-community/acpi_call")
1054 (commit (string-append "v" version))))
1055 (file-name (git-file-name name version))
1057 (base32 "0mr4rjbv6fj4phf038addrgv32940bphghw2v9n1z4awvw7wzkbg"))))
1058 (build-system linux-module-build-system)
1060 `(#:tests? #f ; no tests
1062 (modify-phases %standard-phases
1063 (add-before 'install 'patch-shebangs-harder
1064 ;; The (only) shebangs in examples/ don't justify a reference.
1065 ;; However, do substitute a more portable one than the original.
1067 (substitute* (find-files "examples" ".")
1068 (("^(#! *)/[^ ]*/" _ shebang)
1069 (string-append shebang "/usr/bin/env ")))
1071 (add-after 'install 'install-documentation
1072 (lambda* (#:key outputs #:allow-other-keys)
1073 (let* ((out (assoc-ref outputs "out"))
1074 (doc (string-append out "/share/doc/" ,name "-" ,version)))
1075 (for-each (lambda (file)
1076 (let ((target (string-append doc "/" file)))
1077 (mkdir-p (dirname target))
1078 (copy-recursively file target)))
1079 (list "README.md" "examples"))
1081 (home-page "https://github.com/teleshoes/acpi_call")
1082 (synopsis "Linux kernel module to perform ACPI method calls")
1084 "This simple Linux kernel module allows calls from user space to any
1085 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
1086 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
1087 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
1088 and @code{ACPI_BUFFER}.
1090 It grants direct and undocumented access to your hardware that may cause damage
1091 and should be used with caution, especially on untested models.")
1092 (license license:gpl3+))) ; see README.md (no licence headers)
1094 (define-public rtl8812au-aircrack-ng-linux-module
1095 (let ((commit "e9fbf5c051453941bbc029810b893a6c010714e6")
1098 (name "rtl8812au-aircrack-ng-linux-module")
1099 (version (git-version "5.6.4.2" revision commit))
1104 (url "https://github.com/aircrack-ng/rtl8812au")
1106 (file-name (git-file-name name version))
1108 (base32 "0y71q7ajwz1w38gdmxd4p05hhkqndq504nndy6vfa16fxz6pqxhn"))
1109 (modules '((guix build utils)))
1112 ;; Remove bundled tarballs, APKs, word lists, speadsheets,
1113 ;; and other unnecessary unlicenced things.
1114 (for-each delete-file-recursively (list "android"
1118 (build-system linux-module-build-system)
1121 (list (string-append "KSRC="
1122 (assoc-ref %build-inputs "linux-module-builder")
1123 "/lib/modules/build"))
1125 (modify-phases %standard-phases
1127 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1128 (apply invoke "make" make-flags))))
1129 #:tests? #f)) ; no test suite
1130 (supported-systems '("x86_64-linux" "i686-linux"))
1131 (home-page "https://github.com/aircrack-ng/rtl8812au")
1132 (synopsis "Linux driver for Realtek USB wireless network adapters")
1134 "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
1135 network adapters, modified by the aircrack-ng project to support monitor mode
1136 and frame injection. It provides a @code{88XXau} kernel module that supports
1137 RTL8812AU, RTL8821AU, and RTL8814AU chips.")
1138 (license license:gpl2+))))
1140 (define-public rtl8821ce-linux-module
1141 (let ((commit "fe97b5003f2f3dd070f76ec38c00b83798c1cdea")
1144 (name "rtl8821ce-linux-module")
1145 (version (git-version "0.0.0" revision commit))
1150 (url "https://github.com/tomaspinho/rtl8821ce")
1152 (file-name (git-file-name name version))
1155 "10mrp63npbqb39c442vx8mra278hw7sczb3b6bjrpr3gan6ljshn"))))
1156 (build-system linux-module-build-system)
1160 (string-append "KSRC="
1161 (assoc-ref %build-inputs "linux-module-builder")
1162 "/lib/modules/build"))
1164 (modify-phases %standard-phases
1166 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1167 (apply invoke "make" make-flags))))
1168 #:tests? #f)) ; no test suite
1169 (home-page "https://github.com/tomaspinho/rtl8821ce")
1170 (synopsis "Linux driver for Realtek RTL8821CE wireless network adapters")
1171 (description "This is Realtek's RTL8821CE Linux driver for wireless
1173 (license license:gpl2))))
1175 (define-public vhba-module
1177 (name "vhba-module")
1178 (version "20200106")
1182 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
1183 version ".tar.bz2"))
1186 "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr"))))
1187 (build-system linux-module-build-system)
1191 (home-page "https://cdemu.sourceforge.io/")
1192 (synopsis "Kernel module that emulates SCSI devices")
1193 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
1194 between the CDemu userspace daemon and linux kernel.")
1195 (license license:gpl2+)))
1197 (define-public bbswitch-module
1198 ;; Use "develop" branch since stable release does not build on Linux >= 5.6.
1199 ;; See https://github.com/Bumblebee-Project/bbswitch/issues/205.
1200 (let ((commit "ddbd243638c7bc2baecf43a78aff46cdc12e9b2e"))
1202 (name "bbswitch-module")
1203 (version (git-version "0.8" "1" commit))
1207 (url "https://github.com/Bumblebee-Project/bbswitch")
1209 (file-name (git-file-name name version))
1212 "1pgldnza7mzd0flrxg4q69dwbq1fhl58m5c62ary5drb0xyf3lqb"))))
1213 (build-system linux-module-build-system)
1217 (home-page "https://github.com/Bumblebee-Project/bbswitch")
1218 (synopsis "Kernel module that disables discrete Nvidia graphics cards")
1219 (description "The bbswitch module provides a way to toggle the Nvidia
1220 graphics card on Optimus laptops.")
1221 (license license:gpl2))))
1223 (define-public ddcci-driver-linux
1225 (name "ddcci-driver-linux")
1232 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
1233 (commit (string-append "v" version))))
1234 (file-name (git-file-name name version))
1237 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
1238 (build-system linux-module-build-system)
1240 `(#:tests? #f ; no tests
1242 (modify-phases %standard-phases
1247 (with-directory-excursion module
1248 (apply (assoc-ref %standard-phases 'build) args)))
1249 '("ddcci" "ddcci-backlight"))
1255 (with-directory-excursion module
1256 (apply (assoc-ref %standard-phases 'install) args)))
1257 '("ddcci" "ddcci-backlight"))
1259 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
1260 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
1261 (description "This package provides two Linux kernel drivers, ddcci and
1262 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
1263 interface. The ddcci module creates a character device for each DDC/CI
1264 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
1265 module allows the control of the backlight level or luminance property when
1266 supported under @file{/sys/class/backlight/}.")
1267 (license license:gpl2+)))
1269 (define-public v4l2loopback-linux-module
1271 (name "v4l2loopback-linux-module")
1276 (url "https://github.com/umlaeute/v4l2loopback")
1277 (commit (string-append "v" version))))
1278 (file-name (git-file-name name version))
1281 "1qi4l6yam8nrlmc3zwkrz9vph0xsj1cgmkqci4652mbpbzigg7vn"))))
1282 (build-system linux-module-build-system)
1284 `(#:tests? #f)) ; no test suite
1285 (home-page "https://github.com/umlaeute/v4l2loopback")
1286 (synopsis "Linux kernel module to create virtual V4L2 video devices")
1288 "This Linux module creates virtual video devices. @acronym{V4L2, Video
1289 for Linux 2} applications will treat these as ordinary video devices but read
1290 video data generated by another application, instead of a hardware device such
1293 This lets you apply nifty effects to your Jitsi video, for example, but also
1294 allows some more serious things like adding streaming capabilities to an
1295 application by hooking GStreamer into the loopback device.")
1296 (license license:gpl2+)))
1300 ;;; Pluggable authentication modules (PAM).
1303 (define-public linux-pam
1311 "https://github.com/linux-pam/linux-pam/releases/download/v"
1312 version "/Linux-PAM-" version ".tar.xz"))
1315 "0d6hvz6lpkac08hw5wnlhfdm0fhqd0n6jf6v7fz3jhg6a6694vfd"))
1316 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1318 (build-system gnu-build-system)
1322 ;; TODO: optional dependencies
1323 ;; ("libxcrypt" ,libxcrypt)
1324 ;; ("cracklib" ,cracklib)
1327 `(;; Most users, such as `shadow', expect the headers to be under
1329 #:configure-flags (list (string-append "--includedir="
1330 (assoc-ref %outputs "out")
1331 "/include/security")
1333 ;; XXX: <rpc/rpc.h> is missing from glibc when
1334 ;; cross-compiling, so we have to disable NIS
1335 ;; support altogether.
1336 ,@(if (%current-target-system)
1340 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1343 (home-page "http://www.linux-pam.org/")
1344 (synopsis "Pluggable authentication modules for Linux")
1346 "A *Free* project to implement OSF's RFC 86.0.
1347 Pluggable authentication modules are small shared object files that can
1348 be used through the PAM API to perform tasks, like authenticating a user
1349 at login. Local and dynamic reconfiguration are its key features.")
1350 (license license:bsd-3)))
1352 (define-public linux-pam-1.2
1360 "http://www.linux-pam.org/library/"
1361 "Linux-PAM-" version ".tar.bz2"))
1364 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1365 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1367 (define-public python-pamela
1369 (name "python-pamela")
1373 ;; Tests not distributed in pypi release.
1376 (url "https://github.com/minrk/pamela")
1378 (file-name (git-file-name name version))
1381 "0cg3w6np1fbjpvzhv54xg567hpf38szwp2d4gvzb9r736nxbv0vr"))))
1382 (build-system python-build-system)
1384 '(#:tests? #f ; Test suite isn't designed to be run inside a container.
1386 (modify-phases %standard-phases
1387 (add-after 'unpack 'hardcode-pam.so
1388 (lambda* (#:key inputs #:allow-other-keys)
1389 (let ((pam (assoc-ref inputs "linux-pam")))
1390 (substitute* "pamela.py"
1391 (("find_library\\(\"pam\")")
1392 (string-append "'" pam "/lib/libpam.so'")))
1395 (lambda* (#:key tests? #:allow-other-keys)
1397 (if (file-exists? "test_pamela.py")
1398 (invoke "py.test" "--assert=plain" "test_pamela.py")
1399 (invoke "python" "-m" "pamela" "-a" "`whoami`"))
1402 `(("linux-pam" ,linux-pam)))
1404 `(("python-pytest" ,python-pytest)))
1405 (home-page "https://github.com/minrk/pamela")
1406 (synopsis "PAM interface using ctypes")
1407 (description "This package provides a PAM interface using @code{ctypes}.")
1408 (license license:expat)))
1415 (define-public powerstat
1422 (uri (string-append "https://kernel.ubuntu.com/~cking/tarballs/"
1423 "powerstat/powerstat-" version ".tar.gz"))
1425 (base32 "0r355b9syqa2nhfy8ksvxyy5d58v0isf983842js091s6liy0x7g"))))
1426 (build-system gnu-build-system)
1429 (list (string-append "CC=" ,(cc-for-target))
1430 (string-append "prefix=" (assoc-ref %outputs "out")))
1431 #:tests? #f ; no test suite
1433 (modify-phases %standard-phases
1434 (add-after 'unpack 'respect-$prefix
1435 ;; https://bugs.launchpad.net/ubuntu/+source/powerstat/+bug/1877744
1437 (substitute* "Makefile"
1438 (("DIR=/usr/") "DIR=$(prefix)/"))
1440 (delete 'configure)))) ; no configure script
1441 (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
1442 (synopsis "Measure system power consumption")
1444 "Powerstat measures and reports your computer's power consumption in real
1445 time. On mobile PCs, it uses ACPI battery information to measure the power
1446 drain of the entire system.
1448 Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
1449 domain measurements. These are available only on some hardware such as Intel
1450 Sandybridge and newer, and cover only part of the machine's components such as
1451 CPU, DRAM, and graphics. However, they provide accurate and immediate readings
1452 and don't require a battery at all.
1454 The output is like @command{vmstat} but also shows power consumption statistics:
1455 at the end of a run, @command{powerstat} will calculate the average, standard
1456 deviation, and minimum and maximum values. It can show a nice histogram too.")
1457 (license license:gpl2)))
1459 (define-public psmisc
1466 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1469 (base32 "16i7qzjmm6g0lzha8yzpfrlcxnvkgh95hkq9gdjd4zmzb8d0wxa1"))))
1470 (build-system gnu-build-system)
1472 `(,@(if (%current-target-system)
1475 "ac_cv_func_malloc_0_nonnull=yes"
1476 "ac_cv_func_realloc_0_nonnull=yes"))
1478 (inputs `(("ncurses" ,ncurses)))
1479 (home-page "https://gitlab.com/psmisc/psmisc")
1480 (synopsis "Small utilities that use the proc file system")
1482 "This PSmisc package is a set of some small useful utilities that
1483 use the proc file system. We're not about changing the world, but
1484 providing the system administrator with some help in common tasks.")
1485 (license license:gpl2+)))
1487 (define-public util-linux
1493 (uri (string-append "mirror://kernel.org/linux/utils/"
1494 "util-linux/v" (version-major+minor version) "/"
1495 "util-linux-" version ".tar.xz"))
1498 "1yfpy6bkab4jw61mpx48gfy24yrqp4a7arvpis8csrkk53fkxpnr"))
1499 (patches (search-patches "util-linux-tests.patch"))
1500 (modules '((guix build utils)))
1502 ;; We take 'nologin' from Shadow, the 'logger' program from
1503 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1505 (substitute* "configure"
1506 (("build_nologin=yes") "build_nologin=no")
1507 (("build_logger=yes") "build_logger=no")
1508 (("build_kill=yes") "build_kill=no"))
1510 (build-system gnu-build-system)
1511 (outputs '("out" ;6.4 MiB executables and documentation
1512 "lib" ;8.8 MiB shared libraries, headers and locales
1513 "static")) ;2.9 MiB static .a libraries
1515 `(#:configure-flags (list "--disable-use-tty-group"
1516 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1517 ;; Don't try to chown root:root mount and umount
1518 "--disable-makeinstall-chown"
1519 "--localstatedir=/var"
1520 (string-append "--localedir="
1521 (assoc-ref %outputs "lib")
1523 ;; Install completions where our
1524 ;; bash-completion package expects them.
1525 (string-append "--with-bashcompletiondir="
1526 (assoc-ref %outputs "out")
1527 "/etc/bash_completion.d"))
1528 #:phases (modify-phases %standard-phases
1529 (add-before 'configure 'patch-build-scripts
1530 (lambda* (#:key outputs #:allow-other-keys)
1531 (substitute* "configure"
1532 ;; The build system assumes that we want to install
1533 ;; libraries below $exec_prefix when $libdir does not
1534 ;; match any of the "usual" locations. Fix that.
1535 (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
1536 "usrlib_execdir=$libdir"))
1538 (add-before 'build 'set-umount-file-name
1539 (lambda* (#:key outputs #:allow-other-keys)
1540 ;; Tell 'eject' the right file name of 'umount'.
1541 (let ((out (assoc-ref outputs "out")))
1542 (substitute* "sys-utils/eject.c"
1543 (("\"/bin/umount\"")
1544 (string-append "\"" out "/bin/umount\"")))
1546 (add-before 'check 'pre-check
1547 (lambda* (#:key inputs outputs #:allow-other-keys)
1548 (let ((out (assoc-ref outputs "out"))
1549 (net (assoc-ref inputs "net-base")))
1550 ;; Change the test to refer to the right file.
1551 (substitute* "tests/ts/misc/mcookie"
1553 (string-append net "/etc/services")))
1555 ;; The C.UTF-8 locale does not exist in our libc.
1556 (substitute* "tests/ts/column/invalid-multibyte"
1557 (("C\\.UTF-8") "en_US.utf8"))
1559 ;; TODO: Remove the conditional on the next rebuild cycle.
1560 ,@(if (string-prefix? "arm" (%current-system))
1561 '((add-before 'check 'disable-setarch-test
1563 ;; The setarch tests are unreliable in QEMU's
1564 ;; user-mode emulation, which is our primary
1565 ;; method of building ARMv7 packages.
1566 ;; <https://github.com/karelzak/util-linux/issues/601>
1567 (substitute* "tests/ts/misc/setarch"
1568 (("ts_init_subtest.*" all)
1571 "ts_skip \"setarch tests are unreliable under QEMU\"")))
1574 (add-after 'install 'move-static-libraries
1575 (lambda* (#:key outputs #:allow-other-keys)
1576 (let ((lib (assoc-ref outputs "lib"))
1577 (static (assoc-ref outputs "static")))
1579 ;; Move static libraries to the "static" output.
1580 (mkdir-p (string-append static "/lib"))
1581 (with-directory-excursion lib
1582 (for-each (lambda (file)
1584 (string-append static "/"
1586 (find-files "lib" "\\.a$"))
1588 ;; Remove references to the static library from the '.la'
1589 ;; files so that Libtool does the right thing when both
1590 ;; the shared and static library is available.
1591 (substitute* (find-files "lib" "\\.la$")
1592 (("old_library=.*") "old_library=''\n")))
1595 (add-after 'install 'adjust-pkg-config-files
1596 (lambda* (#:key outputs #:allow-other-keys)
1597 (let ((lib (assoc-ref outputs "lib")))
1598 ;; Drop the unused "prefix=" and "exec_prefix=" variables from
1599 ;; the pkg-config files to avoid a cyclic reference on "out".
1600 (substitute* (find-files (string-append lib "/lib/pkgconfig")
1602 (("^(exec_)?prefix=.*") "")))
1604 (inputs `(("zlib" ,zlib)
1605 ("ncurses" ,ncurses)
1607 ;; XXX: This is so that the 'pre-check' phase can find it.
1608 ,@(if (%current-target-system)
1609 `(("net-base" ,net-base))
1613 ("net-base" ,net-base))) ;for tests
1614 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1615 (synopsis "Collection of utilities for the Linux kernel")
1616 (description "Util-linux is a diverse collection of Linux kernel
1617 utilities. It provides dmesg and includes tools for working with file systems,
1618 block devices, UUIDs, TTYs, and many other tools.")
1620 ;; Note that util-linux doesn't use the same license for all the
1621 ;; code. GPLv2+ is the default license for a code without an
1622 ;; explicitly defined license.
1623 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1624 license:bsd-4 license:public-domain))))
1626 ;; util-linux optionally supports udev, which allows lsblk to read file system
1627 ;; metadata without special privileges. Add it as a separate package to avoid
1628 ;; a circular dependency, and to keep the size small.
1629 (define-public util-linux+udev
1632 (name "util-linux-with-udev")
1635 ,@(package-inputs util-linux)))))
1637 (define-public ddate
1644 (url "https://github.com/bo0ts/ddate")
1645 (commit (string-append "v" version))))
1646 (file-name (git-file-name name version))
1648 (base32 "1qchxnxvghbma6gp1g78wnjxsri0b72ha9axyk31cplssl7yn73f"))))
1649 (build-system cmake-build-system)
1650 (arguments '(#:tests? #f))
1651 (home-page "https://github.com/bo0ts/ddate")
1652 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1654 "ddate displays the Discordian date and holidays of a given date.
1655 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1656 by Robert Shea and Robert Anton Wilson.")
1657 (license license:public-domain)))
1659 (define-public fbset
1666 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
1669 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
1670 (build-system gnu-build-system)
1672 '(#:modules ((guix build gnu-build-system)
1676 (modify-phases %standard-phases
1677 (delete 'configure) ; no configure script
1678 (add-before 'install 'pre-install
1679 (lambda* (#:key outputs #:allow-other-keys)
1680 (let ((out (assoc-ref outputs "out")))
1681 (substitute* "Makefile"
1682 (("mknod ") "true ")
1683 ;; The Makefile doesn't honour PREFIX or similar.
1686 (with-directory-excursion out
1687 (for-each mkdir-p (list "sbin"
1691 (add-after 'install 'install-fb.modes
1692 (lambda* (#:key outputs #:allow-other-keys)
1693 (let* ((out (assoc-ref outputs "out"))
1694 (etc (string-append out "/etc")))
1695 (for-each (cut install-file <> etc)
1696 (find-files "etc" "^fb\\.modes"))
1697 (symlink "fb.modes.ATI"
1698 (string-append etc "/fb.modes"))
1700 ;; Parallel building races to create modes.tab.c.
1701 #:parallel-build? #f
1702 #:tests? #f)) ; no test suite
1706 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
1707 (synopsis "Show and modify Linux frame buffer settings")
1709 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
1710 different kinds of graphic displays. The @command{fbset} utility can query and
1711 change various device settings such as depth, virtual resolution, and timing
1713 (license license:gpl2)))
1715 (define-public procps
1721 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1722 "procps-ng-" version ".tar.xz"))
1725 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
1726 (build-system gnu-build-system)
1728 `(#:modules ((guix build utils)
1729 (guix build gnu-build-system)
1732 ,@(if (%current-target-system)
1735 "ac_cv_func_malloc_0_nonnull=yes"
1736 "ac_cv_func_realloc_0_nonnull=yes"))
1739 (modify-phases %standard-phases
1741 'install 'post-install
1742 ;; Remove commands and man pages redudant with
1744 (lambda* (#:key outputs #:allow-other-keys)
1745 (let* ((out (assoc-ref outputs "out"))
1746 (dup (append-map (cut find-files out <>)
1747 '("^kill" "^uptime"))))
1748 (for-each delete-file dup)
1750 (inputs `(("ncurses" ,ncurses)))
1751 (home-page "https://gitlab.com/procps-ng/procps/")
1752 (synopsis "Utilities that give information about processes")
1754 "Procps is the package that has a bunch of small useful utilities
1755 that give information about processes using the Linux /proc file system.
1756 The package includes the programs ps, top, vmstat, w, kill, free,
1757 slabtop, and skill.")
1758 (license license:gpl2)))
1760 (define-public usbutils
1767 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1768 "usbutils-" version ".tar.xz"))
1770 (base32 "0f0klk6d3hmbpf6p4dcwa1qjzblmkhbxs1wsw87aidvqri7lj8wy"))))
1771 (build-system gnu-build-system)
1772 (outputs (list "out" "python"))
1775 (modify-phases %standard-phases
1776 (add-before 'bootstrap 'patch-bootstrap-scripts
1778 (substitute* "usbhid-dump/bootstrap"
1779 (("/bin/sh") (which "sh")))
1781 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1782 (substitute* "autogen.sh"
1783 (("^\\./configure.*") ""))
1785 (add-after 'install 'separate-python-output
1786 ;; Separating one Python script shaves more than 106 MiB from :out.
1787 (lambda* (#:key outputs #:allow-other-keys)
1788 (let ((out (assoc-ref outputs "out"))
1789 (out:python (assoc-ref outputs "python")))
1790 (for-each (lambda (file)
1791 (let ((old (string-append out "/" file))
1792 (new (string-append out:python "/" file)))
1793 (mkdir-p (dirname new))
1794 (rename-file old new)))
1795 (list "bin/lsusb.py"))
1800 ("python" ,python)))
1802 `(("autoconf" ,autoconf)
1803 ("automake" ,automake)
1804 ("libtool" ,libtool)
1805 ("pkg-config" ,pkg-config)))
1806 (home-page "http://www.linux-usb.org/")
1808 "Tools for working with USB devices, such as lsusb")
1810 "Tools for working with USB devices, such as lsusb.")
1811 (license license:gpl2+)))
1813 (define-public e2fsprogs
1820 "mirror://kernel.org/linux/kernel/people/tytso/"
1821 "e2fsprogs/v" version "/"
1822 "e2fsprogs-" version ".tar.xz"))
1825 "0mj2yizwygs7xww8jfy5mxjn8ww4pvc0b1hg1p2vsnirailsx9zz"))))
1826 (build-system gnu-build-system)
1827 (inputs `(("util-linux" ,util-linux "lib")))
1828 (native-inputs `(("pkg-config" ,pkg-config)
1829 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1833 ("procps" ,procps)))
1835 '(;; util-linux is the preferred source for some of the libraries and
1836 ;; commands, so disable them (see, e.g.,
1837 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1838 #:configure-flags (list "--disable-libblkid"
1839 "--disable-libuuid" "--disable-uuidd"
1842 ;; Use symlinks instead of hard links for
1843 ;; 'fsck.extN' etc. This makes the resulting nar
1844 ;; smaller and is preserved across copies.
1845 "--enable-symlink-install"
1847 (string-append "LDFLAGS=-Wl,-rpath="
1848 (assoc-ref %outputs "out")
1851 ;; Install libext2fs et al.
1852 "--enable-elf-shlibs")
1855 (modify-phases %standard-phases
1856 (add-before 'configure 'patch-shells
1858 (substitute* "configure"
1859 (("/bin/sh (.*)parse-types.sh" _ dir)
1860 (string-append (which "sh") " " dir
1862 (substitute* "MCONFIG.in"
1863 (("INSTALL_SYMLINK = /bin/sh")
1864 "INSTALL_SYMLINK = sh"))
1865 (substitute* (find-files "." "^Makefile.in$")
1867 (string-append "#!" (which "sh"))))
1869 (add-after 'install 'install-libs
1870 (lambda* (#:key outputs #:allow-other-keys)
1871 (let* ((out (assoc-ref outputs "out"))
1872 (lib (string-append out "/lib")))
1873 (invoke "make" "install-libs")
1875 ;; Make the .a writable so that 'strip' works.
1876 ;; Failing to do that, due to debug symbols, we
1877 ;; retain a reference to the final
1878 ;; linux-libre-headers, which refer to the
1879 ;; bootstrap binaries.
1880 (let ((archives (find-files lib "\\.a$")))
1881 (for-each (lambda (file)
1885 (home-page "http://e2fsprogs.sourceforge.net/")
1886 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
1888 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
1889 (license (list license:gpl2 ;programs
1890 license:lgpl2.0 ;libext2fs
1891 license:x11)))) ;libuuid
1893 (define e2fsprogs/static
1895 (package (inherit e2fsprogs)
1897 ;; Do not build shared libraries.
1898 (substitute-keyword-arguments (package-arguments e2fsprogs)
1899 ((#:configure-flags _)
1900 '(list "--disable-blkid"))
1904 (define-public e2fsck/static
1906 (name "e2fsck-static")
1907 (version (package-version e2fsprogs))
1908 (build-system trivial-build-system)
1911 `(("e2fsprogs" ,e2fsprogs/static)))
1913 `(#:modules ((guix build utils))
1916 (use-modules (guix build utils)
1920 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
1922 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
1924 (with-directory-excursion bin
1925 (copy-file e2fsck "e2fsck")
1926 (remove-store-references "e2fsck")
1927 (chmod "e2fsck" #o555))
1929 (home-page (package-home-page e2fsprogs))
1930 (synopsis "Statically-linked e2fsck command from e2fsprogs")
1931 (description "This package provides statically-linked e2fsck command taken
1932 from the e2fsprogs package. It is meant to be used in initrds.")
1933 (license (package-license e2fsprogs))))
1935 (define-public extundelete
1937 (name "extundelete")
1942 (uri (string-append "mirror://sourceforge/extundelete/"
1943 "extundelete/" version "/extundelete-"
1944 version ".tar.bz2"))
1947 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
1948 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
1949 (build-system gnu-build-system)
1950 (inputs `(("e2fsprogs" ,e2fsprogs)))
1951 (home-page "http://extundelete.sourceforge.net/")
1952 (synopsis "Recover deleted files from ext2/3/4 partitions")
1954 "Extundelete is a set of tools that can recover deleted files from an
1955 ext3 or ext4 partition.")
1956 (license license:gpl2)))
1958 (define-public zerofree
1962 (home-page "https://frippery.org/uml/")
1965 (uri (string-append home-page name "-" version
1969 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1970 (build-system gnu-build-system)
1973 (modify-phases %standard-phases
1974 (delete 'configure) ; no configure script
1976 ;; The Makefile lacks an ‘install’ target.
1977 (lambda* (#:key outputs #:allow-other-keys)
1978 (let* ((out (assoc-ref outputs "out"))
1979 (bin (string-append out "/bin")))
1980 (chmod "zerofree" #o555)
1981 (install-file "zerofree" bin)
1983 #:tests? #f)) ; no tests
1984 (inputs `(("libext2fs" ,e2fsprogs)))
1985 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
1987 "Zerofree finds the unallocated blocks with non-zero value content in an
1988 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
1989 This is a simple way to make disk images more compressible.
1990 Zerofree requires the file system to be unmounted or mounted read-only.")
1991 (license license:gpl2)))
1993 (define-public strace
1997 (home-page "https://strace.io")
2000 (uri (string-append home-page "/files/" version
2001 "/strace-" version ".tar.xz"))
2004 "1abs3svkg9985f4jrxx34sj1dcpsf95vv1a0g01c777zgygncjnz"))))
2005 (build-system gnu-build-system)
2008 (modify-phases %standard-phases
2009 (add-after 'unpack 'patch-/bin/sh
2011 (substitute* "strace.c"
2012 (("/bin/sh") (which "sh")))
2014 (add-after 'unpack 'disable-failing-tests
2016 ;; XXX These hang forever even if the test time-out is extended.
2017 (substitute* "tests/Makefile.in"
2018 (("^\tstrace-DD?D?\\.test \\\\.*") ""))
2020 ;; Don't fail if the architecture doesn't support different personalities.
2021 #:configure-flags '("--enable-mpers=check")
2022 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
2023 #:parallel-tests? #f)) ; undeterministic failures
2024 (native-inputs `(("perl" ,perl)))
2025 (synopsis "System call tracer for Linux")
2027 "strace is a system call tracer, i.e. a debugging tool which prints out a
2028 trace of all the system calls made by a another process/program.")
2029 (license license:lgpl2.1+)))
2031 (define-public ltrace
2037 (uri (string-append "http://www.ltrace.org/ltrace_" version
2041 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
2042 (build-system gnu-build-system)
2043 (inputs `(("libelf" ,libelf)))
2045 ;; Compilation uses -Werror by default, but it fails.
2046 '(#:configure-flags '("--disable-werror")))
2047 (home-page "https://www.ltrace.org/")
2048 (synopsis "Library call tracer for Linux")
2050 "ltrace intercepts and records dynamic library calls which are called by
2051 an executed process and the signals received by that process. It can also
2052 intercept and print the system calls executed by the program.")
2053 (license license:gpl2+)))
2055 (define-public alsa-lib
2062 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
2063 version ".tar.bz2"))
2066 "1xq8d48wfy59qw4x7383j32n8j5njndw5hcgnmlg9pvclphlnmgp"))))
2067 (build-system gnu-build-system)
2069 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2070 (assoc-ref %outputs "out")
2072 (home-page "https://www.alsa-project.org/")
2073 (synopsis "The Advanced Linux Sound Architecture libraries")
2075 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2076 MIDI functionality to the Linux-based operating system.")
2077 (license license:lgpl2.1+)))
2079 (define-public alsa-utils
2085 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
2086 name "-" version ".tar.bz2"))
2089 "09m4dnn4kplawprd2bl15nwa0b4r1brab3x44ga7f1fyk7aw5zwq"))))
2090 (build-system gnu-build-system)
2092 ;; XXX: Disable man page creation until we have DocBook.
2093 '(#:configure-flags (list "--disable-xmlto"
2095 ;; The udev rule is responsible for restoring
2097 (string-append "--with-udev-rules-dir="
2098 (assoc-ref %outputs "out")
2099 "/lib/udev/rules.d"))
2101 (modify-phases %standard-phases
2102 (add-before 'check 'disable-broken-test
2104 ;; XXX: The 1.1.8 release tarball is missing a header that's
2105 ;; required for this test to work. Fixed in 1.1.9.
2106 (substitute* "axfer/test/Makefile"
2107 ((".*container-test.*") ""))
2110 'install 'pre-install
2112 ;; Don't try to mkdir /var/lib/alsa.
2113 (substitute* "Makefile"
2114 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
2118 `(("gettext" ,gettext-minimal)))
2120 `(("libsamplerate" ,libsamplerate)
2121 ("ncurses" ,ncurses)
2122 ("alsa-lib" ,alsa-lib)
2124 (home-page "http://www.alsa-project.org/")
2125 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
2127 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2128 MIDI functionality to the Linux-based operating system.")
2130 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
2132 (license license:gpl2)))
2134 (define-public alsa-plugins
2136 (name "alsa-plugins")
2140 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
2141 name "-" version ".tar.bz2"))
2144 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
2145 (build-system gnu-build-system)
2146 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
2147 ;; be split, there are references to both in files.
2148 ;; TODO: Remove OSS related plugins, they add support to run native
2149 ;; ALSA applications on OSS however we do not offer OSS and OSS is
2151 (outputs '("out" "pulseaudio" "jack"))
2152 (native-search-paths
2153 (list (search-path-specification
2154 (variable "ALSA_PLUGIN_DIR")
2155 (files '("lib/alsa-lib"))
2158 `(#:configure-flags '(;; Do not install a "local" configuration targeted
2159 ;; for /etc/alsa. On Guix System plugins are loaded from
2160 ;; the ALSA service, and other distributions likely
2161 ;; won't use these files.
2162 "--with-alsalconfdir=/tmp/noop")
2164 (modify-phases %standard-phases
2165 (add-after 'install 'split
2166 (lambda* (#:key inputs outputs #:allow-other-keys)
2167 ;; Distribute the binaries to the various outputs.
2168 (let* ((out (assoc-ref outputs "out"))
2169 (jack (assoc-ref outputs "jack"))
2170 (jacklib (string-append jack "/lib/alsa-lib"))
2171 (pua (assoc-ref outputs "pulseaudio"))
2172 (pualib (string-append pua "/lib/alsa-lib")))
2175 (for-each (lambda (file)
2176 (rename-file file (string-append jacklib "/" (basename file))))
2177 (find-files out ".*jack\\.(la|so)"))
2180 (for-each (lambda (file)
2181 (rename-file file (string-append pualib "/" (basename file))))
2182 (find-files out ".*pulse\\.(la|so)"))
2185 `(("alsa-lib" ,alsa-lib)
2187 ("speex" ,speex) ; libspeexdsp resampling plugin
2188 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
2189 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
2190 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
2192 `(("pkg-config" ,pkg-config)))
2193 (home-page "http://www.alsa-project.org/")
2194 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
2196 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2197 MIDI functionality to the Linux-based operating system. This package enhances ALSA
2198 by providing additional plugins which include: upmixing, downmixing, jackd and
2199 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
2200 external rate conversion.")
2201 (license (list license:gpl2+
2202 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
2203 license:lgpl2.1+))))
2205 (define-public iptables
2212 (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
2214 (string-append "https://www.netfilter.org/projects/iptables/"
2215 "files/iptables-" version ".tar.bz2")))
2217 (base32 "0rvp0k8a72h2snrdx48cfn75bfa0ycrd2xl3kjysbymq7q6gxx50"))))
2218 (build-system gnu-build-system)
2220 `(("pkg-config" ,pkg-config)
2224 `(("libmnl" ,libmnl)
2225 ("libnftnl" ,libnftnl)))
2227 '(#:tests? #f ; no test suite
2228 #:configure-flags ; add $libdir to the RUNPATH of executables
2229 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
2230 (home-page "https://www.netfilter.org/projects/iptables/index.html")
2231 (synopsis "Programs to configure Linux IP packet filtering rules")
2233 "@command{iptables} is the user-space command line program used to
2234 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
2235 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
2237 This package also includes @command{ip6tables}, which is used to configure the
2240 Both commands are targeted at system administrators.")
2241 (license license:gpl2+)))
2243 (define-public lsscsi
2250 "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
2253 "1ry2y34xmpgxdbfbyvs8cjmbx0fn222yjdab87wj21q60nab5p75"))))
2254 (build-system gnu-build-system)
2255 (synopsis "Lists information about SCSI or NVMe devices in Linux")
2256 (home-page "http://sg.danny.cz/scsi/lsscsi.html")
2258 "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
2259 also list NVMe namespaces or controllers and show the relationship between a
2260 device's primary node name, its SCSI generic (sg) node name and its kernel
2262 (license license:gpl2)))
2264 (define-public ebtables
2271 "mirror://netfilter.org/ebtables/ebtables-"
2275 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
2276 (build-system gnu-build-system)
2279 ("iptables" ,iptables)))
2280 (synopsis "Ethernet bridge frame table administration")
2281 (home-page "https://ebtables.netfilter.org/")
2283 "ebtables is an application program used to set up and maintain the
2284 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
2285 analogous to the iptables application, but less complicated, due to the fact
2286 that the Ethernet protocol is much simpler than the IP protocol.")
2287 (license license:gpl2+)))
2289 (define-public iproute
2296 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
2300 "1kys6dmhrl43iaq95n5sh02p39d7bq8i5y672qrzgwnwpjaaqpd2"))))
2301 (build-system gnu-build-system)
2303 `( ;; There is a test suite, but it wants network namespaces and sudo.
2305 #:make-flags (let ((out (assoc-ref %outputs "out")))
2307 (string-append "BASH_COMPDIR=" out
2308 "/etc/bash_completion.d")
2309 (string-append "LIBDIR=" out "/lib")
2310 (string-append "HDRDIR=" out "/include")
2311 (string-append "SBINDIR=" out "/sbin")
2312 (string-append "CONFDIR=" out "/etc")
2313 (string-append "DOCDIR=" out "/share/doc/"
2315 (string-append "MANDIR=" out "/share/man")))
2316 #:phases (modify-phases %standard-phases
2317 (add-before 'install 'pre-install
2319 ;; Don't attempt to create /var/lib/arpd.
2320 (substitute* "Makefile"
2321 (("^.*ARPDDIR.*$") ""))
2325 ("iptables" ,iptables)
2326 ("libmnl" ,libmnl)))
2330 ("pkg-config" ,pkg-config)))
2332 ;; ("libmnl" ,libmnl)
2333 ;; ("util-linux" ,util-linux)
2335 "https://wiki.linuxfoundation.org/networking/iproute2")
2337 "Utilities for controlling TCP/IP networking and traffic in Linux")
2339 "Iproute2 is a collection of utilities for controlling TCP/IP networking
2340 and traffic with the Linux kernel. The most important of these are
2341 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
2344 Most network configuration manuals still refer to ifconfig and route as the
2345 primary network configuration tools, but ifconfig is known to behave
2346 inadequately in modern network environments, and both should be deprecated.")
2347 (license license:gpl2+)))
2349 (define-public net-tools
2350 ;; XXX: This package is basically unmaintained, but it provides a few
2351 ;; commands not yet provided by Inetutils, such as 'route', so we have to
2353 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
2357 (version (string-append "1.60-" revision "." (string-take commit 7)))
2360 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
2361 "n/ne/net-tools/code.git/net-tools-code-"
2363 (file-name (string-append name "-" version ".zip"))
2366 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
2367 (home-page "http://net-tools.sourceforge.net/")
2368 (build-system gnu-build-system)
2370 `(#:modules ((guix build gnu-build-system)
2375 (modify-phases %standard-phases
2377 (lambda* (#:key outputs #:allow-other-keys)
2378 (let ((out (assoc-ref outputs "out")))
2379 (mkdir-p (string-append out "/bin"))
2380 (mkdir-p (string-append out "/sbin"))
2382 ;; Pretend we have everything...
2383 (system "yes | make config")
2385 ;; ... except for the things we don't have.
2386 ;; HAVE_AFDECnet requires libdnet, which we don't have.
2387 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
2388 ;; that have been removed.
2389 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
2390 ;; think about adding them later.
2391 (substitute* '("config.make" "config.h")
2392 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
2395 (add-after 'install 'remove-redundant-commands
2396 (lambda* (#:key outputs #:allow-other-keys)
2397 ;; Remove commands and man pages redundant with Inetutils.
2398 (let* ((out (assoc-ref outputs "out"))
2399 (dup (append-map (cut find-files out <>)
2401 "^(yp|nis|dns)?domainname"))))
2402 (for-each delete-file dup)
2404 ;; Binaries that depend on libnet-tools.a don't declare that
2405 ;; dependency, making it parallel-unsafe.
2406 #:parallel-build? #f
2408 #:tests? #f ; no test suite
2409 #:make-flags (let ((out (assoc-ref %outputs "out")))
2410 (list ,(string-append "CC=" (cc-for-target))
2411 (string-append "BASEDIR=" out)
2412 (string-append "INSTALLNLSDIR=" out "/share/locale")
2413 (string-append "mandir=/share/man")))))
2414 (native-inputs `(("gettext" ,gettext-minimal)
2416 (supported-systems (delete "i586-gnu" %supported-systems))
2417 (synopsis "Tools for controlling the network subsystem in Linux")
2419 "This package includes the important tools for controlling the network
2420 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
2421 route. Additionally, this package contains utilities relating to particular
2422 network hardware types (plipconfig, slattach) and advanced aspects of IP
2423 configuration (iptunnel, ipmaddr).")
2424 (license license:gpl2+))))
2426 (define-public libcap-2.31
2433 "mirror://kernel.org/linux/libs/security/linux-privs/"
2434 "libcap2/libcap-" version ".tar.xz"))
2437 "0ikwm0kngrqa4ci80lqnrkk17kg09q7dxrz28y0gm5qw3vj8s266"))))
2438 (build-system gnu-build-system)
2439 (arguments '(#:phases
2440 (modify-phases %standard-phases
2442 ;; Add $libdir to the RUNPATH of executables.
2444 (substitute* "Make.Rules"
2446 (string-append "LDFLAGS := -Wl,-rpath="
2449 #:test-target "test"
2450 #:make-flags (list "lib=lib"
2451 (string-append "prefix="
2452 (assoc-ref %outputs "out"))
2453 "RAISE_SETFCAP=no")))
2454 (native-inputs `(("perl" ,perl)))
2455 (supported-systems (delete "i586-gnu" %supported-systems))
2456 (home-page "https://sites.google.com/site/fullycapable/")
2457 (synopsis "Library for working with POSIX capabilities")
2459 "Libcap2 provides a programming interface to POSIX capabilities on
2460 Linux-based operating systems.")
2462 ;; License is BSD-3 or GPLv2, at the user's choice.
2463 (license license:gpl2)))
2465 ;; libcap 2.31 has problems with newer kernels, so provide this newer variant.
2466 ;; Keep the old libcap around to avoid rebuilding 'coreutils' and 'avahi'.
2467 ;; To be merged with libcap on the next rebuild cycle.
2468 (define-public libcap
2470 (inherit libcap-2.31)
2475 "mirror://kernel.org/linux/libs/security/linux-privs/"
2476 "libcap2/libcap-" version ".tar.xz"))
2479 "1qf80lifygbnxwvqjf8jz5j24n6fqqx4ixnkbf76xs2vrmcq664j"))))
2481 (substitute-keyword-arguments (package-arguments libcap-2.31)
2483 `(modify-phases ,phases
2486 ;; Add $libdir to the RUNPATH of executables.
2487 (substitute* "Make.Rules"
2488 (("LDFLAGS \\?= #-g")
2489 (string-append "LDFLAGS ?= -Wl,-rpath="
2493 (define-deprecated libcap/next libcap)
2494 (export libcap/next)
2496 (define-public bridge-utils
2498 (name "bridge-utils")
2503 (uri (string-append "mirror://kernel.org/linux/kernel/people/shemminger/"
2504 "bridge-utils/bridge-utils-" version ".tar.xz"))
2506 (base32 "0zlrigizac2nfwgvksm92v4wafrpgxlbci3gwimc795ib7k8g6ck"))))
2507 (build-system gnu-build-system)
2509 ;; The tarball lacks all the generated files.
2510 (native-inputs `(("autoconf" ,autoconf)
2511 ("automake" ,automake)))
2514 (modify-phases %standard-phases
2515 (add-before 'bootstrap 'patch-stuff
2517 ;; Fix "field ‘ip6’ has incomplete type" errors.
2518 (substitute* "libbridge/libbridge.h"
2519 (("#include <linux/if_bridge.h>")
2520 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
2522 ;; Ensure that the entire build fails if one of the
2523 ;; sub-Makefiles fails.
2524 (substitute* "Makefile.in"
2525 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
2526 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
2529 #:tests? #f)) ; no 'check' target
2531 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
2532 (synopsis "Manipulate Ethernet bridges")
2534 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2535 to connect two Ethernet segments together in a protocol independent way.
2536 Packets are forwarded based on Ethernet address, rather than IP address (like
2537 a router). Since forwarding is done at Layer 2, all protocols can go
2538 transparently through a bridge.")
2539 (license license:gpl2+)))
2541 (define-public libnl
2548 "https://github.com/thom311/libnl/releases/download/"
2549 "libnl" (string-join (string-split version #\.) "_")
2550 "/libnl-" version ".tar.gz"))
2553 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2554 (build-system gnu-build-system)
2558 ("pkg-config" ,pkg-config)
2564 "https://github.com/thom311/libnl/releases/download/libnl"
2565 (string-join (string-split version #\.) "_")
2566 "/libnl-doc-" version ".tar.gz"))
2568 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2569 (outputs `("out" "doc"))
2572 (modify-phases %standard-phases
2573 (add-after 'install 'install-doc
2574 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
2575 (let ((dest (string-append (assoc-ref outputs "doc")
2576 "/share/doc/libnl")))
2578 (invoke "tar" "xf" (assoc-ref
2579 (or native-inputs inputs)
2581 "--strip-components=1" "-C" dest)))))))
2582 (home-page "https://www.infradead.org/~tgr/libnl/")
2583 (synopsis "NetLink protocol library suite")
2585 "The libnl suite is a collection of libraries providing APIs to netlink
2586 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
2587 between the kernel and user space processes. It was designed to be a more
2588 flexible successor to ioctl to provide mainly networking related kernel
2589 configuration and monitoring interfaces.")
2591 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2592 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2593 (license license:gpl2)))
2595 ;; libnl python extensions used to be outputs of libnl. However, as
2596 ;; cross-compiling python extensions is currently broken, create separate
2597 ;; packages for libnl python extensions.
2598 (define (libnl-python-package python)
2599 (let ((name (string-append "libnl-" python)))
2604 ((string=? python "python2")
2605 `(("python-2" ,python-2)))
2606 ((string=? python "python3")
2607 `(("python-3" ,python-3))))))
2608 (propagated-inputs `(("libnl" ,libnl)))
2611 `(#:modules ((guix build gnu-build-system)
2615 (modify-phases %standard-phases
2617 (lambda* (#:key inputs outputs #:allow-other-keys)
2618 (define (python-inst python)
2619 (invoke python "setup.py" "build")
2620 (invoke python "setup.py" "install"
2621 (string-append "--prefix="
2622 (assoc-ref %outputs "out")))
2623 (invoke python "setup.py" "clean"))
2624 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2625 (assoc-ref inputs "libnl")))
2626 (with-directory-excursion "./python" (python-inst ,python))
2629 (define-public libnl-python2 (libnl-python-package "python2"))
2630 (define-public libnl-python3 (libnl-python-package "python3"))
2639 "mirror://kernel.org/software/network/iw/iw-"
2643 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2644 (build-system gnu-build-system)
2645 (native-inputs `(("pkg-config" ,pkg-config)))
2646 (inputs `(("libnl" ,libnl)))
2649 (let* ((target ,(%current-target-system))
2650 (pkg-config (if target
2651 (string-append target "-pkg-config")
2654 ,(string-append "CC=" (cc-for-target))
2655 (string-append "PKG_CONFIG="
2656 (assoc-ref %build-inputs "pkg-config")
2658 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
2659 #:phases (modify-phases %standard-phases (delete 'configure))))
2660 (home-page "https://wireless.wiki.kernel.org/")
2661 (synopsis "Tool for configuring wireless devices")
2663 "iw is a new nl80211 based CLI configuration utility for wireless
2664 devices. It replaces @code{iwconfig}, which is deprecated.")
2665 (license license:isc)))
2667 (define-public powertop
2674 (uri (string-append "https://01.org/sites/default/files/downloads/"
2675 "powertop-" version ".tar.gz"))
2677 (base32 "0y1ixw8v17fdb1ima0zshrd0rh4zxdh10r93nrrvq6d4lhn9jpx6"))))
2678 (build-system gnu-build-system)
2681 (modify-phases %standard-phases
2682 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2683 ;; allow calibrating the network interface in Guix System.
2684 (add-after 'unpack 'patch-absolute-file-names
2685 (lambda* (#:key inputs #:allow-other-keys)
2686 (let ((kmod (assoc-ref inputs "kmod")))
2687 (substitute* (find-files "src" "\\.cpp$")
2688 ;; Give the right 'modprobe' file name so that essential
2689 ;; modules such as msr.ko can be loaded.
2690 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2691 ;; These programs are only needed to calibrate, so using
2692 ;; relative file names avoids adding extra inputs. When they
2693 ;; are missing powertop gracefully handles it.
2694 (("/usr/bin/hcitool") "hcitool")
2695 (("/usr/bin/xset") "xset")
2696 (("/usr/sbin/hciconfig") "hciconfig"))
2701 ("ncurses" ,ncurses)
2702 ("pciutils" ,pciutils)
2705 `(("pkg-config" ,pkg-config)))
2706 (home-page "https://01.org/powertop/")
2707 (synopsis "Analyze power consumption on Intel-based laptops")
2709 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2710 power management. In addition to being a diagnostic tool, PowerTOP also has
2711 an interactive mode where the user can experiment various power management
2712 settings for cases where the operating system has not enabled these
2714 (license license:gpl2)))
2716 (define-public aumix
2723 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2724 version ".tar.bz2"))
2727 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2728 (build-system gnu-build-system)
2729 (inputs `(("ncurses" ,ncurses)))
2730 (home-page "http://www.jpj.net/~trevor/aumix.html")
2731 (synopsis "Audio mixer for X and the console")
2733 "Aumix adjusts an audio mixer from X, the console, a terminal,
2734 the command line or a script.")
2735 (license license:gpl2+)))
2737 (define-public iotop
2744 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2747 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2748 (build-system python-build-system)
2751 (modify-phases %standard-phases
2752 (add-after 'unpack 'fix-build-with-python3
2754 (substitute* "setup.py"
2755 (("itervalues") "values"))
2757 ;; There are currently no checks in the package.
2759 (native-inputs `(("python" ,python)))
2760 (home-page "http://guichaz.free.fr/iotop/")
2762 "Displays the IO activity of running processes")
2764 "Iotop is a Python program with a top like user interface to show the
2765 processes currently causing I/O.")
2766 (license license:gpl2+)))
2774 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2775 "download/fuse-" version
2776 "/fuse-" version ".tar.gz"))
2779 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
2780 (patches (search-patches "fuse-overlapping-headers.patch"))))
2781 (build-system gnu-build-system)
2782 (inputs `(("util-linux" ,util-linux)))
2784 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2785 (assoc-ref %outputs "out")
2787 (string-append "INIT_D_PATH="
2788 (assoc-ref %outputs "out")
2791 ;; The rule makes /dev/fuse 666.
2792 (string-append "UDEV_RULES_PATH="
2793 (assoc-ref %outputs "out")
2794 "/lib/udev/rules.d"))
2796 (modify-phases %standard-phases
2797 (add-before 'build 'set-file-names
2798 (lambda* (#:key inputs #:allow-other-keys)
2799 ;; libfuse calls out to mount(8) and umount(8). Make sure
2800 ;; it refers to the right ones.
2801 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2802 (("/bin/(u?)mount" _ maybe-u)
2803 (string-append (assoc-ref inputs "util-linux")
2804 "/bin/" maybe-u "mount")))
2805 (substitute* '("util/mount.fuse.c")
2809 ;; This hack leads libfuse to search for 'fusermount' in
2810 ;; $PATH, where it may find a setuid-root binary, instead of
2811 ;; trying solely $out/sbin/fusermount and failing because
2813 (substitute* "lib/Makefile"
2814 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2815 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2817 (supported-systems (delete "i586-gnu" %supported-systems))
2818 (home-page "https://github.com/libfuse/libfuse")
2819 (synopsis "Support file systems implemented in user space")
2821 "As a consequence of its monolithic design, file system code for Linux
2822 normally goes into the kernel itself---which is not only a robustness issue,
2823 but also an impediment to system extensibility. FUSE, for \"file systems in
2824 user space\", is a kernel module and user-space library that tries to address
2825 part of this problem by allowing users to run file system implementations as
2826 user-space processes.")
2827 (license (list license:lgpl2.1 ;library
2828 license:gpl2+)))) ;command-line utilities
2830 (define-public unionfs-fuse
2832 (name "unionfs-fuse")
2837 (url "https://github.com/rpodgorny/unionfs-fuse")
2838 (commit (string-append "v" version))))
2839 (file-name (git-file-name name version))
2842 "0bwx70x834qgqh53vqp18bhbxbsny80hz922rbgj8k9wj7cbfilm"))))
2843 (build-system cmake-build-system)
2845 `(("python" ,python)))
2846 (inputs `(("fuse" ,fuse)))
2848 ;; The tests were never actually run ("collected 0 items"), but in recent
2849 ;; versions of pytest that causes an error.
2851 (home-page "https://github.com/rpodgorny/unionfs-fuse")
2852 (synopsis "User-space union file system")
2854 "UnionFS-FUSE is a flexible union file system implementation in user
2855 space, using the FUSE library. Mounting a union file system allows you to
2856 \"aggregate\" the contents of several directories into a single mount point.
2857 UnionFS-FUSE additionally supports copy-on-write.")
2858 (license license:bsd-3)))
2861 (package (inherit fuse)
2862 (name "fuse-static")
2863 (source (origin (inherit (package-source fuse))
2864 (modules '((guix build utils)))
2867 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
2868 ;; updated. Change calls to 'mtab_needs_update' to 0 so
2869 ;; that it doesn't do that, allowing us to remove the
2870 ;; dependency on util-linux (something that is useful in
2872 (substitute* '("lib/mount_util.c"
2873 "util/mount_util.c")
2874 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
2880 (define-public unionfs-fuse/static
2881 (package (inherit unionfs-fuse)
2882 (synopsis "User-space union file system (statically linked)")
2883 (name (string-append (package-name unionfs-fuse) "-static"))
2884 (source (origin (inherit (package-source unionfs-fuse))
2885 (modules '((guix build utils)))
2888 ;; Add -ldl to the libraries, because libfuse.a needs that.
2889 (substitute* "src/CMakeLists.txt"
2890 (("target_link_libraries(.*)\\)" _ libs)
2891 (string-append "target_link_libraries"
2896 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
2898 (modify-phases %standard-phases
2899 (add-after 'install 'post-install
2900 (lambda* (#:key outputs #:allow-other-keys)
2901 (let* ((out (assoc-ref outputs "out"))
2902 (exe (string-append out "/bin/unionfs")))
2903 ;; By default, 'unionfs' keeps references to
2904 ;; $glibc/share/locale and similar stuff. Remove them.
2905 (remove-store-references exe)
2907 ;; 'unionfsctl' has references to glibc as well. Since
2908 ;; we don't need it, remove it.
2909 (delete-file (string-append out "/bin/unionfsctl"))
2911 (inputs `(("fuse" ,fuse-static)))))
2913 (define-public sshfs
2919 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
2920 "download/sshfs-" version "/sshfs-" version
2924 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
2925 (build-system gnu-build-system)
2930 `(("pkg-config" ,pkg-config)))
2931 (home-page "https://github.com/libfuse/sshfs")
2932 (synopsis "Mount remote file systems over SSH")
2934 "This is a file system client based on the SSH File Transfer Protocol.
2935 Since most SSH servers already support this protocol it is very easy to set
2936 up: on the server side there's nothing to do; on the client side mounting the
2937 file system is as easy as logging into the server with an SSH client.")
2938 (license license:gpl2+)))
2940 (define-public sshfs-fuse
2941 (package (inherit sshfs)
2943 (properties `((superseded . ,sshfs)))))
2945 (define-public archivemount
2947 (name "archivemount")
2952 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
2953 "archivemount-" version ".tar.gz"))
2955 (base32 "1cy5b6qril9c3ry6fv7ir87s8iyy5vxxmbyx90dm86fbra0vjaf5"))))
2956 (build-system gnu-build-system)
2957 (inputs `(("fuse" ,fuse)
2958 ("libarchive" ,libarchive)))
2959 (native-inputs `(("pkg-config" ,pkg-config)))
2960 (home-page "https://www.cybernoia.de/software/archivemount.html")
2961 (synopsis "Tool for mounting archive files with FUSE")
2962 (description "archivemount is a FUSE-based file system for Unix variants,
2963 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
2964 mount point where it can be read from or written to as with any other file
2965 system. This makes accessing the contents of the archive, which may be
2966 compressed, transparent to other programs, without decompressing them.")
2967 (license license:lgpl2.0+)))
2969 (define-public numactl
2976 "https://github.com/numactl/numactl/releases/download/v"
2977 version "/numactl-" version ".tar.gz"))
2980 "1xngddsph43bxljywahi9d44fxr022slsap4hh91w8xnq54d2sw2"))))
2981 (build-system gnu-build-system)
2983 '(;; There's a 'test' target, but it requires NUMA support in the kernel
2984 ;; to run, which we can't assume to have.
2987 ;; NUMA is apparently not supported on armhf, see
2988 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
2989 (supported-systems (delete "armhf-linux" %supported-systems))
2990 (home-page "https://github.com/numactl/numactl")
2991 (synopsis "Tools for non-uniform memory access (NUMA) machines")
2993 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
2994 memory is not all in one place. The @command{numactl} program allows you to
2995 run your application program on specific CPUs and memory nodes. It does this
2996 by supplying a NUMA memory policy to the operating system before running your
2999 The package contains other commands, such as @command{numastat},
3000 @command{memhog}, and @command{numademo} which provides a quick overview of
3001 NUMA performance on your system.")
3002 (license (list license:gpl2 ;programs
3003 license:lgpl2.1)))) ;library
3005 (define-public kbd-neo
3012 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
3013 version "/linux/console/neo.map"))
3014 (file-name (string-append name "-" version ".map"))
3017 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
3018 (build-system trivial-build-system)
3020 `(#:modules ((guix build utils))
3022 (use-modules (guix build utils))
3023 (let ((out (string-append %output "/share/keymaps"))
3024 (source (assoc-ref %build-inputs "source")))
3026 (copy-file source (string-append out "/neo.map"))
3028 (home-page "https://neo-layout.org")
3029 (synopsis "Neo2 console layout")
3031 "Kbd-neo provides the Neo2 keyboard layout for use with
3032 @command{loadkeys(1)} from @code{kbd(4)}.")
3033 ;; The file is located in an svn directory, the entire content of
3034 ;; the directory is licensed as GPL3.
3035 (license license:gpl3+)))
3043 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
3047 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
3048 (modules '((guix build utils)))
3051 (substitute* "tests/Makefile.in"
3052 ;; The '%: %.in' rule incorrectly uses @VERSION@.
3055 (substitute* '("src/unicode_start" "src/unicode_stop")
3056 ;; Assume the Coreutils are in $PATH.
3060 (build-system gnu-build-system)
3063 (modify-phases %standard-phases
3064 (add-before 'build 'pre-build
3065 (lambda* (#:key inputs #:allow-other-keys)
3066 (let ((gzip (assoc-ref %build-inputs "gzip"))
3067 (bzip2 (assoc-ref %build-inputs "bzip2")))
3068 (substitute* "src/libkeymap/findfile.c"
3070 (string-append gzip "/bin/gzip"))
3072 (string-append bzip2 "/bin/bzip2")))
3074 (add-after 'install 'post-install
3075 (lambda* (#:key outputs #:allow-other-keys)
3076 ;; Make sure these programs find their comrades.
3077 (let* ((out (assoc-ref outputs "out"))
3078 (bin (string-append out "/bin")))
3079 (for-each (lambda (prog)
3080 (wrap-program (string-append bin "/" prog)
3081 `("PATH" ":" prefix (,bin))))
3082 '("unicode_start" "unicode_stop"))
3084 (inputs `(("check" ,check)
3087 ("pam" ,linux-pam)))
3088 (native-search-paths
3089 (list (search-path-specification
3090 (variable "LOADKEYS_KEYMAP_PATH")
3091 ;; Append ‘/**’ to recursively search all directories. One can then
3092 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
3093 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
3094 (files (list "share/keymaps/**")))))
3095 (native-inputs `(("pkg-config" ,pkg-config)))
3096 (home-page "http://kbd-project.org/")
3097 (synopsis "Linux keyboard utilities and keyboard maps")
3099 "This package contains keytable files and keyboard utilities compatible
3100 for systems using the Linux kernel. This includes commands such as
3101 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
3102 (license license:gpl2+)))
3104 (define-public loadkeys-static
3107 (name "loadkeys-static")
3109 (substitute-keyword-arguments (package-arguments kbd)
3110 ((#:configure-flags flags ''())
3111 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
3112 "--disable-vlock" ;so we don't need libpam
3113 "--disable-libkeymap")
3115 ((#:make-flags flags ''())
3116 `(cons "LDFLAGS=-all-static" ,flags))
3117 ((#:phases phases '%standard-phases)
3118 `(modify-phases ,phases
3120 (lambda* (#:key outputs #:allow-other-keys)
3121 (let ((out (assoc-ref outputs "out")))
3122 ;; The binary keeps references to gzip, among other things,
3123 ;; which we don't need in the initrd, so strip references.
3124 (remove-store-references "src/loadkeys")
3126 (install-file "src/loadkeys"
3127 (string-append out "/bin"))
3129 (delete 'post-install)))
3130 ((#:strip-flags _ '())
3132 ((#:allowed-references _ '())
3135 (synopsis "Statically-linked @command{loadkeys} program")
3137 ;; This package is meant to be used internally in the initrd so don't
3139 (properties '((hidden? . #t)))))
3141 (define-public inotify-tools
3143 (name "inotify-tools")
3144 (version "3.20.11.0")
3148 (url "https://github.com/rvoicilas/inotify-tools")
3150 (file-name (git-file-name name version))
3153 "1m8avqccrhm38krlhp88a7v949f3hrzx060bbrr5dp5qw2nmw9j2"))))
3154 (build-system gnu-build-system)
3156 `(("autoconf" ,autoconf)
3157 ("automake" ,automake)
3158 ("libtool" ,libtool)))
3161 (list "--disable-static")))
3162 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
3163 (synopsis "Monitor file accesses")
3165 "The inotify-tools packages provides a C library and command-line tools
3166 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3167 (license license:gpl2+)))
3176 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
3177 "kmod-" version ".tar.xz"))
3180 "035wzfzjx4nwidk747p8n085mgkvy531ppn16krrajx2dkqzply1"))
3181 (patches (search-patches "kmod-module-directory.patch"))))
3182 (build-system gnu-build-system)
3184 `(("pkg-config" ,pkg-config)))
3189 `(#:configure-flags '("--with-xz" "--with-zlib"
3190 "--disable-test-modules")
3192 (modify-phases %standard-phases
3193 (add-after 'unpack 'disable-tests
3195 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
3196 (substitute* "Makefile.in"
3197 (("testsuite/test-modprobe") "")
3198 (("testsuite/test-depmod") "")
3199 (("testsuite/test-blacklist") ""))
3201 (add-after 'install 'install-modprobe&co
3202 (lambda* (#:key outputs #:allow-other-keys)
3203 (let* ((out (assoc-ref outputs "out"))
3204 (bin (string-append out "/bin")))
3205 (for-each (lambda (tool)
3207 (string-append bin "/" tool)))
3208 '("insmod" "rmmod" "lsmod" "modprobe"
3209 "modinfo" "depmod"))
3211 (supported-systems (delete "i586-gnu" %supported-systems))
3212 (home-page "https://www.kernel.org/")
3213 (synopsis "Kernel module tools")
3214 (description "Kmod is a set of tools to handle common tasks with Linux
3215 kernel modules like insert, remove, list, check properties, resolve
3216 dependencies and aliases.
3218 These tools are designed on top of libkmod, a library that is shipped with
3219 kmod. The aim is to be compatible with tools, configurations and indices
3220 from the module-init-tools project.")
3221 (license license:gpl2+))) ; library under lgpl2.1+
3223 (define-public earlyoom
3230 (url "https://github.com/rfjakob/earlyoom")
3231 (commit (string-append "v" version))))
3232 (file-name (git-file-name name version))
3235 "16iyn51xlrsbshc7p5xl2338yyfzknaqc538sa7mamgccqwgyvvq"))))
3236 (build-system gnu-build-system)
3239 (modify-phases %standard-phases
3240 (delete 'configure) ; no configure script
3241 (add-before 'check 'set-go-HOME
3243 (setenv "HOME" (getcwd))
3245 (add-before 'check 'disable-failing-test
3247 ;; This test relies on writing to /proc/%d/oom_score_adj.
3248 (substitute* "testsuite_cli_test.go"
3250 (string-append "skipped" match)))
3252 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
3253 (list ,(string-append "CC=" (cc-for-target))
3254 (string-append "VERSION=v" ,version)
3255 (string-append "PREFIX=" prefix)
3256 (string-append "SYSCONFDIR=" prefix "/etc")))
3257 #:test-target "test"))
3258 (native-inputs `(("go" ,go) ;for the test suite
3259 ("pandoc" ,pandoc))) ;to generate the manpage
3260 (home-page "https://github.com/rfjakob/earlyoom")
3261 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
3262 (description "Early OOM is a minimalist out of memory (OOM) daemon that
3263 runs in user space and provides a more responsive and configurable alternative
3264 to the in-kernel OOM killer.")
3265 (license license:expat)))
3267 (define-public eudev
3268 ;; The post-systemd fork, maintained by Gentoo.
3274 (uri (git-reference (url "https://github.com/gentoo/eudev")
3275 (commit (string-append "v" version))))
3276 (file-name (git-file-name name version))
3279 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
3280 (patches (search-patches "eudev-rules-directory.patch"))))
3281 (build-system gnu-build-system)
3284 (modify-phases %standard-phases
3285 (add-after 'unpack 'make-source-writable
3287 ;; XXX: Git checkouts are read-only, but this package needs to
3288 ;; modify some of its files.
3289 (for-each make-file-writable (find-files "."))
3291 (add-before 'bootstrap 'patch-file-names
3292 (lambda* (#:key inputs native-inputs #:allow-other-keys)
3293 (substitute* "man/make.sh"
3294 (("/usr/bin/xsltproc")
3295 (string-append (assoc-ref
3296 (or native-inputs inputs) "xsltproc")
3299 (add-before 'configure 'patch-bindir-in-btrfs-rules
3300 (lambda* (#:key outputs #:allow-other-keys)
3301 ;; The "@bindir@" substitution incorrectly expands to a literal
3302 ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work
3304 (let ((out (assoc-ref outputs "out")))
3305 (substitute* "rules/64-btrfs.rules.in"
3307 (string-append out "/bin")))
3309 (add-after 'install 'move-static-library
3310 (lambda* (#:key outputs #:allow-other-keys)
3311 (let* ((out (assoc-ref outputs "out"))
3312 (static (assoc-ref outputs "static"))
3313 (source (string-append out "/lib/libudev.a"))
3314 (target (string-append static "/lib/libudev.a")))
3315 (mkdir-p (dirname target))
3316 (link source target)
3317 (delete-file source)
3318 ;; Remove reference to the static library from the .la file
3319 ;; such that Libtool looks for it in the usual places.
3320 (substitute* (string-append out "/lib/libudev.la")
3322 "old_library=''\n"))
3324 (add-after 'install 'build-hwdb
3325 (lambda* (#:key outputs #:allow-other-keys)
3326 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
3327 ;; similar tools to display product names.
3329 ;; XXX: This can't be done when cross-compiling. Find another way
3330 ;; to generate hwdb.bin for cross-built systems.
3331 (let ((out (assoc-ref outputs "out")))
3332 ,@(if (%current-target-system)
3334 '((invoke (string-append out "/bin/udevadm")
3335 "hwdb" "--update")))))))
3336 #:configure-flags (list "--enable-manpages")))
3338 `(("autoconf" ,autoconf)
3339 ("automake" ,automake)
3341 ("libtool" ,libtool)
3342 ("pkg-config" ,pkg-config)
3345 ("python" ,python-wrapper)
3346 ;; For documentation.
3347 ("docbook-xml" ,docbook-xml-4.2)
3348 ("docbook-xsl" ,docbook-xsl)
3349 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3350 ("xsltproc" ,libxslt)))
3352 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
3353 ;; and similar; it also installs the '60-persistent-storage.rules' file,
3354 ;; which contains the rules to do that.
3355 `(("util-linux" ,util-linux "lib") ;for blkid
3357 (outputs '("out" "static"))
3358 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
3359 (synopsis "Userspace device management")
3360 (description "Udev is a daemon which dynamically creates and removes
3361 device nodes from /dev/, handles hotplug events and loads drivers at boot
3363 (license license:gpl2+)))
3365 (define-public python-evdev
3367 (name "python-evdev")
3372 (uri (pypi-uri "evdev" version))
3374 (base32 "0kb3636yaw9l8xi8s184w0r0n9ic5dw3b8hx048jf9fpzss4kimi"))))
3375 (build-system python-build-system)
3377 `(("kernel-headers" ,linux-libre-headers)))
3379 `(#:tests? #f ;no rule for tests
3381 (modify-phases %standard-phases
3382 (add-before 'build 'fix-hard-coded-directory
3383 (lambda* (#:key inputs #:allow-other-keys)
3384 (substitute* "setup.py"
3385 (("/usr/include/linux")
3387 (assoc-ref inputs "kernel-headers") "/include/linux")))
3389 (home-page "https://github.com/gvalkov/python-evdev")
3390 (synopsis "Bindings to the Linux input handling subsystem")
3392 "Python-evdev provides bindings to the generic input event interface in
3393 Linux. The @code{evdev} interface serves the purpose of passing events
3394 generated in the kernel directly to userspace through character devices that
3395 are typically located in @file{/dev/input/}.
3397 This package also comes with bindings to @code{uinput}, the userspace input
3398 subsystem. @code{uinput} allows userspace programs to create and handle input
3399 devices that can inject events directly into the input subsystem.")
3400 (license license:bsd-3)))
3408 (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2."
3410 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
3414 "1l0fkn9abrgk5mfn6jfh9qhdr86b59l1c5pk6lp8jh0491d69las"))
3415 (modules '((guix build utils)))
3418 (use-modules (guix build utils))
3420 ;; Honor sysconfdir.
3421 (substitute* "make.tmpl.in"
3423 "confdir = @sysconfdir@\n")
3424 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
3425 "DEFAULT_SYS_DIR = @sysconfdir@"))
3427 (patches (search-patches "lvm2-static-link.patch"))))
3428 (build-system gnu-build-system)
3430 `(("pkg-config" ,pkg-config)
3431 ("procps" ,procps))) ;tests use 'pgrep'
3433 `(("libaio" ,libaio)
3437 (modify-phases %standard-phases
3438 (add-after 'configure 'set-makefile-shell
3440 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
3442 (setenv "SHELL" (which "sh"))
3444 ;; Replace /bin/sh with the right file name.
3445 (patch-makefile-SHELL "make.tmpl")
3448 #:configure-flags (list (string-append "--sysconfdir="
3449 (assoc-ref %outputs "out")
3451 "--enable-udev_sync"
3452 "--enable-udev_rules"
3453 "--enable-pkgconfig"
3455 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
3457 ;; Make sure programs such as 'dmsetup' can
3458 ;; find libdevmapper.so.
3459 (string-append "LDFLAGS=-Wl,-rpath="
3460 (assoc-ref %outputs "out")
3462 (assoc-ref %outputs "out")
3463 "/lib/device-mapper")
3464 ;; This is needed when cross-compiling.
3465 ,@(if (%current-target-system)
3466 '("ac_cv_func_malloc_0_nonnull=yes"
3467 "ac_cv_func_realloc_0_nonnull=yes")
3470 ;; The tests use 'mknod', which requires root access.
3472 (supported-systems (delete "i586-gnu" %supported-systems))
3473 (home-page "https://sourceware.org/lvm2/")
3474 (synopsis "Logical volume management for Linux")
3476 "LVM2 is the logical volume management tool set for Linux-based systems.
3477 This package includes the user-space libraries and tools, including the device
3478 mapper. Kernel components are part of Linux-libre.")
3480 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
3481 ;; Command-line tools are GPLv2.
3482 (license (list license:gpl2 license:lgpl2.1))))
3484 (define-public lvm2-static
3487 (name "lvm2-static")
3489 ;; Propagate udev because libdevmapper.a depends on libudev.
3490 (propagated-inputs `(("udev:static" ,eudev "static")))
3493 (substitute-keyword-arguments (package-arguments lvm2)
3494 ((#:configure-flags flags '())
3495 ;; LVM2 doesn't use Libtool, hence the custom option.
3496 `(append '("--enable-static_link")
3497 ;; Building dmeventd statically is complicated due to a
3498 ;; requirement on libdevmapper.a, which is being phased out
3499 ;; in favor of libdevice-mapper.a, which in turn is is not
3500 ;; easily made available at dmeventd build time. Just ignore
3501 ;; it until the situation improves.
3502 (delete "--enable-dmeventd" ,flags)))
3504 `(modify-phases ,phases
3505 (add-before 'configure 'adjust-Makefile
3507 ;; These fixes are related to the upstream libdm->device_mapper
3508 ;; migration and will hopefully be fixed upstream in due time.
3509 (substitute* "tools/Makefile.in"
3510 ;; This variable is empty in a static configuration and causes
3511 ;; an erroneous GCC command line.
3512 (("-L\\$\\(interfacebuilddir\\)") "")
3513 ;; Remove obsolete reference to libdevmapper.a.
3514 (("-ldevmapper") ""))
3516 (synopsis "Logical volume management for Linux (statically linked)")))
3518 (define-public thin-provisioning-tools
3520 (name "thin-provisioning-tools")
3526 (url "https://github.com/jthornber/thin-provisioning-tools")
3527 (commit (string-append "v" version))))
3528 (file-name (git-file-name name version))
3530 (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19"))))
3531 (build-system gnu-build-system)
3533 ;; Doesn't build with --enable-testing due to a function name collision
3534 ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released.
3537 `(("automake" ,automake)
3538 ("autoreconf" ,autoconf)))
3542 ("libaio" ,libaio)))
3543 (synopsis "Tools for manipulating the metadata of device-mapper targets")
3544 (description "A suite of tools for manipulating the metadata of the
3545 dm-thin, dm-cache and dm-era device-mapper targets.")
3546 (home-page "https://github.com/jthornber/thin-provisioning-tools")
3547 (license license:gpl3+)))
3549 (define-public wireless-tools
3551 (name "wireless-tools")
3555 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
3559 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
3562 ;; Remove the older header files that are not free software.
3563 (for-each (lambda (n)
3564 (delete-file (format #f "wireless.~a.h" n)))
3565 '(10 11 12 13 14 15 16 17 18 19 20))
3567 (build-system gnu-build-system)
3570 (list (string-append "PREFIX=" %output)
3571 (string-append "INSTALL_MAN=" %output "/share/man")
3572 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
3575 (modify-phases %standard-phases
3577 (lambda* (#:key target #:allow-other-keys)
3578 (when ,(%current-target-system)
3579 ;; Cross-compilation: use the cross tools.
3580 (substitute* (find-files "." "Makefile")
3582 (string-append "CC = " target "-gcc\n"))
3584 (string-append "AR = " target "-ar\n"))
3586 (string-append "RANLIB = " target "-ranlib\n"))))
3589 (synopsis "Tools for manipulating Linux Wireless Extensions")
3590 (description "Wireless Tools are used to manipulate the now-deprecated
3591 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
3592 Extension was an interface allowing you to set Wireless LAN specific
3593 parameters and get the specific stats. It is deprecated in favor the nl80211
3595 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
3596 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
3597 ;; other files are distributed under gpl2.
3598 (license (list license:gpl2 license:lgpl2.1+))))
3606 (uri (string-append "mirror://kernel.org/software/network/crda/"
3607 "crda-" version ".tar.xz"))
3610 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
3611 (patches (search-patches "crda-optional-gcrypt.patch"))))
3612 (build-system gnu-build-system)
3614 `(#:phases (modify-phases %standard-phases
3616 (add-after 'unpack 'gzip-determinism
3618 (substitute* "Makefile"
3619 (("gzip") "gzip --no-name"))
3621 ,@(if (%current-target-system)
3623 'unpack 'fix-pkg-config
3624 (lambda* (#:key target #:allow-other-keys)
3628 (string-append target "-pkg-config")))
3632 'build 'no-werror-no-ldconfig
3634 (substitute* "Makefile"
3636 (("ldconfig") "true"))
3639 'build 'set-regulator-db-file-name
3640 (lambda* (#:key native-inputs inputs #:allow-other-keys)
3641 ;; Tell CRDA where to find our database.
3642 (let ((regdb (assoc-ref (or native-inputs inputs)
3644 (substitute* "crda.c"
3645 (("\"/lib/crda/regulatory.bin\"")
3646 (string-append "\"" regdb
3647 "/lib/crda/regulatory.bin\"")))
3649 #:test-target "verify"
3650 #:make-flags (let ((out (assoc-ref %outputs "out"))
3651 (regdb (assoc-ref %build-inputs "wireless-regdb")))
3653 (string-append "CC=" ,(cc-for-target))
3656 ;; Disable signature-checking on 'regulatory.bin'.
3657 ;; The reason is that this simplifies maintenance
3658 ;; on our side (no need to manage a distro key
3659 ;; pair), and we can guarantee integrity of
3660 ;; 'regulatory.bin' by other means anyway, such as
3661 ;; 'guix gc --verify'. See
3662 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
3666 (string-append "PREFIX=" out)
3667 (string-append "SBINDIR=" out "/sbin/")
3668 (string-append "UDEV_RULE_DIR="
3669 out "/lib/udev/rules.d")
3670 (string-append "LDFLAGS=-Wl,-rpath="
3672 (string-append "REG_BIN=" regdb
3673 "/lib/crda/regulatory.bin")
3675 (native-inputs `(("pkg-config" ,pkg-config)
3676 ("wireless-regdb" ,wireless-regdb)))
3677 (inputs `(("libnl" ,libnl)))
3679 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
3680 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
3682 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
3683 communication between the kernel Linux and user space for regulatory
3685 (license license:copyleft-next)))
3687 (define-public wireless-regdb
3689 (name "wireless-regdb")
3690 (version "2020.04.29")
3694 "mirror://kernel.org/software/network/wireless-regdb/"
3695 "wireless-regdb-" version ".tar.xz"))
3698 "0yicda474ygahv8da18h1p4yf42s6x2f208mlwcw4xsrxld07zc9"))
3700 ;; We're building 'regulatory.bin' by ourselves.
3702 (delete-file "regulatory.bin")
3704 (build-system gnu-build-system)
3707 (modify-phases %standard-phases
3708 (add-after 'unpack 'gzip-determinism
3710 (substitute* "Makefile"
3711 (("gzip") "gzip --no-name"))
3713 (add-after 'unpack 'omit-signature
3715 (substitute* "Makefile"
3716 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
3717 ;; don't provide (see below). Disable it.
3718 ((" regulatory\\.db\\.p7s") "")
3719 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
3720 ;; but ‘make install’ depends only on the latter while installing
3721 ;; both (and failing). Depend on it explicitly.
3722 (("^install: " all) (string-append all "regulatory.db ")))
3724 (delete 'configure)) ; no configure script
3726 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
3727 ;; is computed and can be equal to 'maintainer-clean'; when that
3728 ;; happens, we can end up deleting the 'regulatory.bin' file that we
3729 ;; just built. Thus, build things sequentially.
3730 #:parallel-build? #f
3732 #:tests? #f ; no tests
3734 (let ((out (assoc-ref %outputs "out")))
3735 (list (string-append "PREFIX=" out)
3736 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
3738 ;; Leave this empty so that db2bin.py doesn't try to sign
3739 ;; ‘regulatory.bin’. This allows us to avoid managing a key
3740 ;; pair for the whole distribution.
3741 (string-append "REGDB_PRIVKEY=")
3742 ;; Don't generate a public key for the same reason. These are
3743 ;; used as Makefile targets and can't be the empty string.
3744 (string-append "REGDB_PUBCERT=/dev/null")
3745 (string-append "REGDB_PUBKEY=/dev/null")))))
3747 `(("python" ,python-wrapper)))
3749 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
3750 (synopsis "Wireless regulatory database")
3752 "This package contains the wireless regulatory database Central
3753 Regulatory Database Agent (CRDA) daemon. The database contains information on
3754 country-specific regulations for the wireless spectrum.")
3755 (license license:isc)))
3757 (define-public lm-sensors
3765 (url "https://github.com/groeck/lm-sensors")
3766 (commit (string-append "V" (string-join
3767 (string-split version #\.) "-")))))
3768 (file-name (git-file-name name version))
3770 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
3771 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
3772 (build-system gnu-build-system)
3773 (inputs `(("rrdtool" ,rrdtool)
3776 ("gnuplot" ,gnuplot)))
3777 (native-inputs `(("pkg-config" ,pkg-config)
3781 (outputs '("lib" ; avoid perl in closure
3784 `(#:tests? #f ; no 'check' target
3785 #:make-flags (list (string-append "PREFIX=" %output)
3786 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
3787 (string-append "INCLUDEDIR="
3788 (assoc-ref %outputs "lib") "/include")
3789 (string-append "MANDIR=" %output "/share/man")
3790 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
3792 (modify-phases %standard-phases
3794 (add-before 'build 'patch-exec-paths
3795 (lambda* (#:key inputs outputs #:allow-other-keys)
3796 (substitute* "prog/detect/sensors-detect"
3798 (string-append "`" (assoc-ref inputs "coreutils")
3800 (("(`|\")modprobe" all open-quote)
3801 (string-append open-quote
3802 (assoc-ref inputs "kmod")
3804 (substitute* '("prog/pwm/pwmconfig"
3805 "prog/pwm/fancontrol")
3807 (string-append (assoc-ref inputs "gnuplot")
3810 (string-append (assoc-ref inputs "coreutils")
3813 (string-append (assoc-ref inputs "grep")
3816 (string-append (assoc-ref inputs "sed")
3819 (string-append (assoc-ref inputs "coreutils")
3822 (string-append (assoc-ref inputs "coreutils")
3825 (string-append (assoc-ref inputs "coreutils")
3826 "/bin/readlink -f")))
3828 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
3829 (synopsis "Utilities to read temperature/voltage/fan sensors")
3831 "Lm-sensors is a hardware health monitoring package for Linux. It allows
3832 you to access information from temperature, voltage, and fan speed sensors.
3833 It works with most newer systems.")
3834 (license license:gpl2+)))
3836 (define-public iucode-tool
3838 (name "iucode-tool")
3842 (uri (string-append "https://gitlab.com/iucode-tool/releases"
3843 "/raw/latest/iucode-tool_" version ".tar.xz"))
3846 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
3847 (build-system gnu-build-system)
3848 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
3849 (synopsis "Manipulate Intel microcode bundles")
3851 "@command{iucode_tool} is a utility to work with microcode packages for
3852 Intel processors. It can convert between formats, extract specific versions,
3853 create a firmware image suitable for the Linux kernel, and more.")
3854 ;; cpuid.h is available for i686, x86_64, and ia64.
3855 (supported-systems '("i686-linux" "x86_64-linux"))
3856 (license license:gpl2+)))
3858 (define-public i2c-tools
3865 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
3866 version ".tar.bz2"))
3869 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
3870 (build-system gnu-build-system)
3872 `(#:tests? #f ; no 'check' target
3873 #:make-flags (list (string-append "prefix=" %output)
3874 ,(string-append "CC=" (cc-for-target)))
3875 ;; No configure script.
3876 #:phases (modify-phases %standard-phases (delete 'configure))))
3879 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
3880 (synopsis "I2C tools for Linux")
3882 "The i2c-tools package contains a heterogeneous set of I2C tools for
3883 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
3884 EEPROM decoding scripts, EEPROM programming tools, and a python module for
3886 (license license:gpl2+)))
3888 (define-public xsensors
3895 "http://www.linuxhardware.org/xsensors/xsensors-"
3899 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
3900 (build-system gnu-build-system)
3901 (inputs `(("lm-sensors" ,lm-sensors "lib")
3903 (native-inputs `(("pkg-config" ,pkg-config)))
3906 (modify-phases %standard-phases
3907 (add-before 'configure 'enable-deprecated
3909 (substitute* "src/Makefile.in"
3910 (("-DGDK_DISABLE_DEPRECATED") "")
3911 (("-DGTK_DISABLE_DEPRECATED") ""))
3913 (add-before 'configure 'remove-Werror
3915 (substitute* '("configure" "src/Makefile.in")
3918 (home-page "http://www.linuxhardware.org/xsensors/")
3919 (synopsis "Hardware health information viewer")
3921 "Xsensors reads data from the libsensors library regarding hardware
3922 health such as temperature, voltage and fan speed and displays the information
3923 in a digital read-out.")
3924 (license license:gpl2+)))
3929 (version (package-version linux-libre))
3930 (source (package-source linux-libre))
3931 (build-system gnu-build-system)
3934 (modify-phases %standard-phases
3936 (lambda* (#:key inputs #:allow-other-keys)
3937 (setenv "SHELL_PATH" (which "bash"))
3938 (chdir "tools/perf")
3940 #:make-flags (list (string-append "prefix="
3941 (assoc-ref %outputs "out"))
3945 ;; By default, 'config/Makefile' uses lib64 on
3946 ;; x86_64. Work around that.
3948 #:tests? #f)) ;no tests
3950 `(("pkg-config" ,pkg-config)
3954 ;; There are build scripts written in these languages.
3956 ("python2" ,python-2)
3957 ("python3" ,python-3)))
3959 `(("slang" ,slang) ;for the interactive TUI
3961 ("python" ,python-2) ;'perf' links against libpython
3962 ("elfutils" ,elfutils)
3963 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
3964 ("libunwind" ,libunwind) ;better stack walking
3965 ("numactl" ,numactl) ;for 'perf bench numa mem'
3968 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3969 ("docbook-xsl" ,docbook-xsl)
3971 ("asciidoc" ,asciidoc)))
3972 (home-page "https://perf.wiki.kernel.org/")
3973 (synopsis "Linux profiling with performance counters")
3975 "perf is a tool suite for profiling using hardware performance counters,
3976 with support in the Linux kernel. perf can instrument CPU performance
3977 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3978 of lightweight profiling. This package contains the user-land tools and in
3979 particular the @code{perf} command.")
3980 (license (package-license linux-libre))))
3982 (define-public pflask
3989 (url "https://github.com/ghedo/pflask")
3990 (commit (string-append "v" version))))
3991 (file-name (git-file-name name version))
3994 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
3995 (build-system cmake-build-system)
3997 '(#:tests? #f)) ; no tests
3998 (home-page "https://ghedo.github.io/pflask/")
3999 (synopsis "Simple tool for creating Linux namespace containers")
4000 (description "pflask is a simple tool for creating Linux namespace
4001 containers. It can be used for running a command or even booting an OS inside
4002 an isolated container, created with the help of Linux namespaces. It is
4003 similar in functionality to chroot, although pflask provides better isolation
4004 thanks to the use of namespaces.")
4005 (license license:bsd-2)))
4007 (define-public singularity
4009 (name "singularity")
4013 (uri (string-append "https://github.com/singularityware/singularity/"
4014 "releases/download/" version
4015 "/singularity-" version ".tar.gz"))
4018 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
4019 (modules '((guix build utils)))
4022 ;; Do not create directories in /var.
4023 (substitute* "Makefile.in"
4024 (("\\$\\(MAKE\\) .*install-data-hook") ""))
4026 ;; The original source overrides PATH so that it points to
4027 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
4028 ;; on Guix System. Leave PATH unchanged so we refer to the
4029 ;; installed Coreutils, grep, etc.
4030 (substitute* "bin/singularity.in"
4032 (string-append "#" all "\n")))
4034 (substitute* (find-files "libexec/cli" "\\.exec$")
4035 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
4037 (string-append "/run/setuid-programs/singularity-"
4038 program "-helper")))
4040 ;; These squashfs mount options are apparently no longer
4041 ;; supported since Linux-libre 5.4.5.
4042 (substitute* "src/lib/image/squashfs/mount.c"
4043 (("\"errors=remount-ro\"")
4046 (build-system gnu-build-system)
4048 `(#:configure-flags '("--localstatedir=/var")
4050 (modify-phases %standard-phases
4051 (add-after 'unpack 'patch-references
4053 (substitute* "libexec/cli/build.exec.in"
4054 (("-mksquashfs") (string-append "-" (which "mksquashfs"))))
4055 (substitute* (append
4056 (find-files "libexec" "functions")
4057 (find-files "libexec/bootstrap-scripts" ".*sh$")
4058 (find-files "libexec/cli" ".*exec$"))
4060 (string-append "| " (which "grep") " "))
4062 (string-append (which "egrep") " "))
4064 (string-append " " (which "sed") " ")))
4066 (add-after 'install 'set-PATH
4067 (lambda* (#:key inputs outputs #:allow-other-keys)
4068 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
4069 (let ((out (assoc-ref outputs "out"))
4070 (coreutils (assoc-ref inputs "coreutils")))
4071 (wrap-program (string-append out "/bin/singularity")
4072 `("PATH" ":" = (,(string-append coreutils "/bin"))))
4073 (substitute* (string-append out "/bin/run-singularity")
4074 (("/usr/bin/env singularity")
4075 (string-append (which "env") " "
4076 out "/bin/singularity")))
4079 `(("libarchive" ,libarchive)
4080 ("python" ,python-wrapper)
4082 ("squashfs-tools" ,squashfs-tools)))
4083 (home-page "https://singularity.lbl.gov/")
4084 (synopsis "Container platform")
4085 (description "Singularity is a container platform supporting a number of
4086 container image formats. It can build SquashFS container images or import
4087 existing Docker images. Singularity requires kernel support for container
4088 isolation or root privileges.")
4089 (license license:bsd-3)))
4091 (define-public hdparm
4097 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
4098 "hdparm-" version ".tar.gz"))
4101 "1k1mcv7naiacw1y6bdd1adnjfiq1kkx2ivsadjwmlkg4fff775w3"))))
4102 (build-system gnu-build-system)
4105 (let ((out (assoc-ref %outputs "out")))
4106 (list (string-append "binprefix=" out)
4107 (string-append "manprefix=" out)
4108 ,(string-append "CC=" (cc-for-target))
4109 ;; Let Guix strip the binaries and not break cross-compilation.
4112 (modify-phases %standard-phases
4113 (delete 'configure)) ; no configure script
4114 #:tests? #f)) ; no test suite
4115 (home-page "https://sourceforge.net/projects/hdparm/")
4116 (synopsis "View and tune ATA disk drive parameters")
4118 "@command{hdparm} is a command-line utility to control ATA controllers and
4119 disk drives. It can increase performance and/or reliability by careful tuning
4120 of hardware settings like power and acoustic management, DMA modes, and caching.
4121 It can also display detailed device information, or be used as a simple
4122 performance benchmarking tool.
4124 @command{hdparm} provides a command line interface to various Linux kernel
4125 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
4126 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
4127 Translation (@dfn{SAT}) are also supported.")
4128 (license (license:non-copyleft "file://LICENSE.TXT"))))
4130 (define-public nvme-cli
4134 (home-page "https://github.com/linux-nvme/nvme-cli")
4139 (commit (string-append "v" version))))
4141 (base32 "1d538kp841bjh8h8d9q7inqz56rdcwb3m78zfx8607ddykv7wcqb"))
4142 (file-name (git-file-name name version))))
4143 (build-system gnu-build-system)
4146 (list ,(string-append "CC=" (cc-for-target)))
4147 #:phases (modify-phases %standard-phases
4148 (delete 'configure) ; no ./configure script
4151 (invoke "make" "install-spec" "PREFIX="
4152 (string-append "DESTDIR=" %output)))))
4153 ;; The tests require sysfs, which is not accessible from from the build
4156 (synopsis "NVM-Express user space tooling for Linux")
4157 (description "Nvme-cli is a utility to provide standards compliant tooling
4158 for NVM-Express drives. It was made specifically for Linux as it relies on the
4159 IOCTLs defined by the mainline kernel driver.")
4160 (license license:gpl2+)))
4162 (define-public rfkill
4168 (uri (string-append "mirror://kernel.org/software/network/"
4169 name "/" name "-" version ".tar.xz"))
4172 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
4173 (build-system gnu-build-system)
4175 `(#:make-flags (list "CC=gcc"
4176 (string-append "PREFIX=" %output))
4177 #:phases (modify-phases %standard-phases
4178 (delete 'configure))
4180 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
4181 (synopsis "Tool for enabling and disabling wireless devices")
4183 "rfkill is a simple tool for accessing the rfkill device interface,
4184 which is used to enable and disable wireless networking devices, typically
4185 WLAN, Bluetooth and mobile broadband.")
4186 (license (license:non-copyleft "file://COPYING"
4187 "See COPYING in the distribution."))
4188 ;; rfkill is part of util-linux as of 2.31.
4189 (properties `((superseded . ,util-linux)))))
4197 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
4198 version "/" name "-" version ".tar.gz"))
4201 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
4202 (build-system gnu-build-system)
4203 (home-page "http://acpiclient.sourceforge.net")
4204 (synopsis "Display information on ACPI devices")
4205 (description "@code{acpi} attempts to replicate the functionality of the
4206 \"old\" @code{apm} command on ACPI systems, including battery and thermal
4207 information. It does not support ACPI suspending, only displays information
4208 about ACPI devices.")
4209 (license license:gpl2+)))
4211 (define-public acpid
4217 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
4221 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
4222 (build-system gnu-build-system)
4223 (home-page "https://sourceforge.net/projects/acpid2/")
4224 (synopsis "Daemon for delivering ACPI events to user-space programs")
4226 "acpid is designed to notify user-space programs of Advanced
4227 Configuration and Power Interface (ACPI) events. acpid should be started
4228 during the system boot, and will run as a background process. When an ACPI
4229 event is received from the kernel, acpid will examine the list of rules
4230 specified in /etc/acpi/events and execute the rules that match the event.")
4231 (license license:gpl2+)))
4233 (define-public sysfsutils
4242 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
4245 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
4246 (build-system gnu-build-system)
4247 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
4248 (synopsis "System utilities based on Linux sysfs")
4250 "These are a set of utilities built upon sysfs, a virtual file system in
4251 Linux kernel versions 2.5+ that exposes a system's device tree. The package
4252 also contains the libsysfs library.")
4253 ;; The library is under lgpl2.1+ (all files say "or any later version").
4254 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
4255 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
4257 (define-public sysfsutils-1
4259 (inherit sysfsutils)
4266 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
4267 "/sysfsutils-" version ".tar.gz"))
4269 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
4270 (modules '((guix build utils)))
4273 (substitute* "Makefile.in"
4274 (("includedir = /usr/include/sysfs")
4275 "includedir = @includedir@"))
4276 (substitute* "configure"
4277 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
4278 (string-append "includedir='" orig "/sysfs'")))
4280 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
4282 (define-public cpufrequtils
4284 (name "cpufrequtils")
4289 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
4290 "cpufrequtils-" version ".tar.gz"))
4292 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
4293 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
4294 (build-system gnu-build-system)
4296 `(("sysfsutils" ,sysfsutils-1)))
4298 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4299 (assoc-ref %outputs "out") "/lib"))))
4300 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
4301 (synopsis "Utilities to get and set CPU frequency on Linux")
4303 "The cpufrequtils suite contains utilities to retrieve CPU frequency
4304 information, and set the CPU frequency if supported, using the cpufreq
4305 capabilities of the Linux kernel.")
4306 (license license:gpl2)))
4308 (define-public libraw1394
4315 "mirror://kernel.org/linux/libs/ieee1394/"
4316 name "-" version ".tar.xz"))
4319 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
4320 (build-system gnu-build-system)
4321 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4322 (synopsis "Interface library for the Linux IEEE1394 drivers")
4324 "Libraw1394 is the only supported interface to the kernel side raw1394 of
4325 the Linux IEEE-1394 subsystem, which provides direct access to the connected
4326 1394 buses to user space. Through libraw1394/raw1394, applications can directly
4327 send to and receive from other nodes without requiring a kernel driver for the
4328 protocol in question.")
4329 (license license:lgpl2.1+)))
4331 (define-public libavc1394
4337 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
4338 name "-" version ".tar.gz"))
4341 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
4342 (build-system gnu-build-system)
4344 `(("pkg-config" ,pkg-config)))
4346 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
4347 (home-page "https://sourceforge.net/projects/libavc1394/")
4348 (synopsis "AV/C protocol library for IEEE 1394")
4350 "Libavc1394 is a programming interface to the AV/C specification from
4351 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
4352 (license license:lgpl2.1+)))
4354 (define-public libiec61883
4356 (name "libiec61883")
4361 "mirror://kernel.org/linux/libs/ieee1394/"
4362 name "-" version ".tar.xz"))
4365 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
4366 (build-system gnu-build-system)
4368 `(("pkg-config" ,pkg-config)))
4370 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
4371 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4372 (synopsis "Isochronous streaming media library for IEEE 1394")
4374 "The libiec61883 library provides a higher level API for streaming DV,
4375 MPEG-2 and audio over Linux IEEE 1394.")
4376 (license license:lgpl2.1+)))
4378 (define-public mdadm
4385 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
4389 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
4390 (build-system gnu-build-system)
4394 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
4395 (list ,(string-append "CC=" (cc-for-target))
4398 ;; TODO: tell it where to find 'sendmail'
4399 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
4400 (string-append "BINDIR=" out "/sbin")
4401 (string-append "MANDIR=" out "/share/man")
4402 (string-append "UDEVDIR=" out "/lib/udev")))
4404 (modify-phases %standard-phases
4405 (add-before 'build 'patch-program-paths
4406 (lambda* (#:key native-inputs inputs #:allow-other-keys)
4407 (let ((coreutils (assoc-ref (or native-inputs inputs)
4409 (substitute* "udev-md-raid-arrays.rules"
4410 (("/usr/bin/(readlink|basename)" all program)
4411 (string-append coreutils "/bin/" program))))
4413 (add-before 'build 'remove-W-error
4415 ;; We cannot build with -Werror on i686 due to a
4416 ;; 'sign-compare' warning in util.c.
4417 (substitute* "Makefile"
4420 (delete 'configure))
4421 ;;tests must be done as root
4423 (supported-systems (delete "i586-gnu" %supported-systems))
4424 (home-page "http://neil.brown.name/blog/mdadm")
4425 (synopsis "Tool for managing Linux Software RAID arrays")
4427 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
4428 assemble, report on, and monitor arrays. It can also move spares between raid
4429 arrays when needed.")
4430 (license license:gpl2+)))
4432 (define-public mdadm-static
4435 (name "mdadm-static")
4437 (substitute-keyword-arguments (package-arguments mdadm)
4438 ((#:make-flags flags)
4439 `(cons "LDFLAGS = -static" ,flags))
4441 `(modify-phases ,phases
4442 (add-after 'install 'remove-cruft
4443 (lambda* (#:key outputs #:allow-other-keys)
4444 (let* ((out (assoc-ref outputs "out"))
4445 (precious? (lambda (file)
4446 (member file '("." ".." "sbin"))))
4447 (directories (scandir out (negate precious?))))
4448 (with-directory-excursion out
4449 (for-each delete-file-recursively directories)
4450 (remove-store-references "sbin/mdadm")
4451 (delete-file "sbin/mdmon")
4453 ((#:modules modules %gnu-build-system-modules)
4454 `((ice-9 ftw) ,@modules))
4455 ((#:strip-flags _ '())
4456 ''("--strip-all")) ;strip a few extra KiB
4457 ((#:allowed-references _ '("out"))
4458 '("out")))) ;refer only self
4459 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
4461 (define-public multipath-tools
4463 (name "multipath-tools")
4468 (url "https://git.opensvc.com/multipath-tools/.git")
4470 (file-name (git-file-name name version))
4473 "0gipg0z79h76j0f449cx4wcrfsv69ravjlpphsac11h302g3nrvg"))
4474 (modules '((guix build utils)))
4477 ;; Drop bundled valgrind headers.
4478 (delete-file-recursively "third-party")
4479 (substitute* '("multipathd/main.c"
4480 "libmultipath/debug.c")
4481 (("#include \"../third-party/")
4484 (build-system gnu-build-system)
4486 '(#:test-target "test"
4487 #:parallel-build? #f ;XXX: broken in 0.8.4
4488 #:make-flags (list "CC=gcc"
4489 (string-append "DESTDIR="
4490 (assoc-ref %outputs "out"))
4491 ;; Install Udev rules below this directory, relative
4494 (string-append "LDFLAGS=-Wl,-rpath="
4495 (assoc-ref %outputs "out")
4498 (modify-phases %standard-phases
4499 (add-after 'unpack 'patch-source
4500 (lambda* (#:key inputs #:allow-other-keys)
4501 (let ((lvm2 (assoc-ref inputs "lvm2"))
4502 (udev (assoc-ref inputs "udev")))
4503 (substitute* "Makefile.inc"
4504 (("\\$\\(prefix\\)/usr") "$(prefix)")
4505 ;; Do not save timestamp to avoid gzip "timestamp
4506 ;; out-of-range" warnings.
4507 (("gzip -9") "gzip -9n"))
4508 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
4509 (("/usr/include/libdevmapper.h")
4510 (string-append lvm2 "/include/libdevmapper.h"))
4511 (("/usr/include/libudev.h")
4512 (string-append udev "/include/libudev.h")))
4514 (add-after 'unpack 'fix-maybe-uninitialized-variable
4516 ;; This variable gets initialized later if needed, but GCC 7
4517 ;; fails to notice. Should be fixed for > 0.8.4.
4518 ;; https://www.redhat.com/archives/dm-devel/2020-March/msg00137.html
4519 (substitute* "libmultipath/structs_vec.c"
4520 (("bool is_queueing;")
4521 "bool is_queueing = false;"))
4523 (add-after 'unpack 'fix-linking-tests
4525 ;; Add missing linker flag for -lmpathcmd. This should be fixed
4526 ;; for versions > 0.8.4.
4527 (substitute* "tests/Makefile"
4528 (("-lmultipath -lcmocka")
4529 "-lmultipath -L$(mpathcmddir) -lmpathcmd -lcmocka"))
4531 (add-after 'unpack 'skip-failing-tests
4533 ;; This test and the module's setup() test an arbitrary block
4534 ;; device node name, but the build environment has none.
4535 (substitute* "tests/devt.c"
4536 (("return get_one_devt.*") "return 0;\n")
4537 (("cmocka_unit_test\\(test_devt2devname_devt_good\\),") ""))
4538 ;; The above triggers -Werror=unused-function. Ignore it.
4539 (substitute* "tests/Makefile"
4540 (("CFLAGS \\+= " match)
4541 (string-append match "-Wno-error=unused-function ")))
4543 (delete 'configure)))) ; no configure script
4546 ("pkg-config" ,pkg-config)
4547 ("valgrind" ,valgrind)
4550 ("cmocka" ,cmocka)))
4552 `(("json-c" ,json-c)
4554 ("liburcu" ,liburcu)
4556 ("readline" ,readline)
4558 (home-page "http://christophe.varoqui.free.fr/")
4559 (synopsis "Access block devices through multiple paths")
4561 "This package provides the following binaries to drive the
4562 Linux Device Mapper multipathing driver:
4564 @item @command{multipath} - Device mapper target autoconfig.
4565 @item @command{multipathd} - Multipath daemon.
4566 @item @command{mpathpersist} - Manages SCSI persistent reservations on
4567 @code{dm} multipath devices.
4568 @item @command{kpartx} - Create device maps from partition tables.
4570 (license (list license:gpl2+ ; main distribution
4571 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
4573 (define-public libaio
4580 (string-append "https://releases.pagure.org/libaio/"
4581 name "-" version ".tar.gz")))
4584 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
4585 (build-system gnu-build-system)
4588 (let ((target ,(%current-target-system)))
4589 (list (string-append "prefix=" %output)
4592 (string-append (assoc-ref %build-inputs "cross-gcc")
4593 "/bin/" target "-gcc")
4595 #:test-target "partcheck" ; need root for a full 'check'
4597 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
4598 (home-page "https://pagure.io/libaio")
4599 (synopsis "Linux-native asynchronous I/O access library")
4601 "This library enables userspace to use Linux kernel asynchronous I/O
4602 system calls, important for the performance of databases and other advanced
4604 (license license:lgpl2.1+)))
4606 (define-public blktrace
4607 ;; Take a newer commit to get the fix for CVE-2018-10689.
4608 (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
4612 (version (git-version "1.2.0" revision commit))
4614 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
4621 (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
4622 (file-name (git-file-name name version))))
4623 (build-system gnu-build-system)
4626 (list ,(string-append "CC=" (cc-for-target))
4627 (string-append "prefix=" %output))
4628 #:tests? #f ; no tests
4630 (modify-phases %standard-phases
4631 (delete 'configure) ; no configure script
4632 (add-after 'unpack 'fix-gnuplot-path
4633 (lambda* (#:key inputs #:allow-other-keys)
4634 (let ((gnuplot (assoc-ref inputs "gnuplot")))
4635 (substitute* "btt/bno_plot.py"
4637 (string-append gnuplot "/bin/gnuplot %s")))
4640 `(("libaio" ,libaio)
4641 ("gnuplot" ,gnuplot)
4642 ("python" ,python-wrapper))) ;for 'bno_plot.py'
4643 (synopsis "Block layer IO tracing mechanism")
4644 (description "Blktrace is a block layer IO tracing mechanism which provides
4645 detailed information about request queue operations to user space. It extracts
4646 event traces from the kernel (via the relaying through the debug file system).")
4647 (license license:gpl2))))
4655 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
4659 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
4660 (build-system gnu-build-system)
4662 `(("libsndfile" ,libsndfile)))
4664 `(("pkg-config" ,pkg-config)))
4665 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
4666 (synopsis "Bluetooth subband audio codec")
4668 "The SBC is a digital audio encoder and decoder used to transfer data to
4669 Bluetooth audio output devices like headphones or loudspeakers.")
4670 (license license:gpl2+)))
4672 (define-public bluez
4679 "mirror://kernel.org/linux/bluetooth/bluez-"
4683 "124v9s4y1s7s6klx5vlmzpk1jlr4x84ch7r7scm7x2f42dqp2qw8"))))
4684 (build-system gnu-build-system)
4687 (let ((out (assoc-ref %outputs "out")))
4688 (list "--sysconfdir=/etc"
4689 "--localstatedir=/var"
4692 ;; TODO: is this needed? Not installed by default since 5.55.
4694 ;; Install dbus/udev files to the correct location.
4695 (string-append "--with-dbusconfdir=" out "/etc")
4696 (string-append "--with-udevdir=" out "/lib/udev")))
4698 (modify-phases %standard-phases
4699 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
4700 ;; issue (discussion on upstream mailing list:
4701 ;; https://marc.info/?t=149578476300002&r=1&w=2)
4702 (add-before 'check 'skip-wonky-test
4704 (substitute* "unit/test-gatt.c"
4705 (("tester_init\\(&argc, &argv\\);") "return 77;"))
4707 (add-after 'install 'post-install
4708 (lambda* (#:key inputs outputs #:allow-other-keys)
4709 (let* ((out (assoc-ref outputs "out"))
4710 (servicedir (string-append out "/share/dbus-1/services"))
4711 (service "obexd/src/org.bluez.obex.service")
4712 (rule (string-append
4713 out "/lib/udev/rules.d/97-hid2hci.rules")))
4714 ;; Install the obex dbus service file.
4715 (substitute* service
4717 (string-append out "/libexec/bluetooth/obexd")))
4718 (install-file service servicedir)
4719 ;; Fix paths in the udev rule.
4721 (("hid2hci --method")
4722 (string-append out "/lib/udev/hid2hci --method"))
4724 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
4727 `(("pkg-config" ,pkg-config)
4728 ("gettext" ,gettext-minimal)))
4733 ("libical" ,libical)
4734 ("readline" ,readline)))
4735 (home-page "http://www.bluez.org/")
4736 (synopsis "Linux Bluetooth protocol stack")
4738 "BlueZ provides support for the core Bluetooth layers and protocols. It
4739 is flexible, efficient and uses a modular implementation.")
4740 (license license:gpl2+)))
4742 (define-public fuse-exfat
4749 "https://github.com/relan/exfat/releases/download/v"
4750 version "/" name "-" version ".tar.gz"))
4753 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
4754 (build-system gnu-build-system)
4756 `(("pkg-config" ,pkg-config)))
4759 (home-page "https://github.com/relan/exfat")
4760 (synopsis "Mount exFAT file systems")
4762 "This package provides a FUSE-based file system that provides read and
4763 write access to exFAT devices.")
4764 (license license:gpl2+)))
4766 (define-public fuseiso
4769 (version "20070708")
4772 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
4773 version "/fuseiso-" version ".tar.bz2"))
4776 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
4777 (build-system gnu-build-system)
4779 `(("pkg-config" ,pkg-config)))
4784 (home-page "https://sourceforge.net/projects/fuseiso/")
4785 (synopsis "Mount ISO file system images")
4787 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
4788 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
4789 Ridge, Joliet, and zisofs.")
4790 (license license:gpl2)))
4799 "https://www.nico.schottelius.org/software/gpm/archives/"
4800 "gpm-" version ".tar.bz2"))
4801 (patches (search-patches "gpm-glibc-2.26.patch"))
4804 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
4805 (build-system gnu-build-system)
4807 '(#:phases (modify-phases %standard-phases
4810 ;; The tarball was not generated with 'make dist' so we
4811 ;; need to bootstrap things ourselves.
4812 (substitute* "autogen.sh"
4813 (("/bin/sh") (which "sh")))
4814 (invoke "./autogen.sh")
4815 (patch-makefile-SHELL "Makefile.include.in")
4818 ;; Make sure programs find libgpm.so.
4819 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4820 (assoc-ref %outputs "out")
4823 `(("texinfo" ,texinfo)
4826 ("autoconf" ,autoconf)
4827 ("automake" ,automake)
4828 ("libtool" ,libtool)))
4829 (home-page "https://www.nico.schottelius.org/software/gpm/")
4830 (synopsis "Mouse support for the Linux console")
4832 "The GPM (general-purpose mouse) daemon is a mouse server for
4833 applications running on the Linux console. It allows users to select items
4834 and copy/paste text in the console and in xterm.")
4835 (license license:gpl2+)))
4837 (define-public btrfs-progs
4839 (name "btrfs-progs")
4843 (uri (string-append "mirror://kernel.org/linux/kernel/"
4844 "people/kdave/btrfs-progs/"
4845 "btrfs-progs-v" version ".tar.xz"))
4848 "14d7hz07kfczfgmy1ixkgccjn393gpkjn7givz5kwxddcnk5i4xq"))))
4849 (build-system gnu-build-system)
4851 "static")) ; static versions of the binaries in "out"
4853 '(#:phases (modify-phases %standard-phases
4854 (add-after 'unpack 'patch-makefile
4855 (lambda* (#:key outputs #:allow-other-keys)
4856 (substitute* "Makefile"
4857 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
4858 (string-append (assoc-ref outputs "out")
4859 "/lib/udev/rules.d")))
4861 (add-after 'build 'build-static
4862 (lambda _ (invoke "make" "static")))
4863 (add-after 'install 'install-bash-completion
4864 (lambda* (#:key outputs #:allow-other-keys)
4865 (let* ((out (assoc-ref outputs "out"))
4866 (bashcomp (string-append out "/etc/bash_completion.d")))
4868 (copy-file "btrfs-completion"
4869 (string-append bashcomp "/btrfs"))
4871 (add-after 'install 'install-static
4872 (let ((staticbin (string-append (assoc-ref %outputs "static")
4876 (string-append "bindir=" staticbin)
4877 "install-static")))))
4878 #:tests? #f ; XXX: require the 'btrfs' kernel module.
4879 #:test-target "test"
4880 #:parallel-tests? #f)) ; tests fail when run in parallel
4881 (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
4883 ("util-linux:lib" ,util-linux "lib") ;for libblkid and libuuid
4884 ("util-linux:static" ,util-linux "static") ;ditto
4886 ("zlib:static" ,zlib "static")
4887 ("zstd" ,zstd "lib")
4888 ("zstd:static" ,zstd "static")))
4889 (native-inputs `(("pkg-config" ,pkg-config)
4890 ("asciidoc" ,asciidoc)
4893 ;; For building documentation.
4894 ("libxml2" ,libxml2)
4895 ("docbook-xsl" ,docbook-xsl)
4901 ;; The tests need 'grep' with perl regexp support.
4903 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
4904 (synopsis "Create and manage btrfs copy-on-write file systems")
4905 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
4906 aimed at implementing advanced features while focusing on fault tolerance,
4907 repair and easy administration.")
4908 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
4909 ;; GPL2: Everything else.
4910 (license (list license:gpl2 license:gpl2+))))
4912 (define-public btrfs-progs/static
4914 (name "btrfs-progs-static")
4915 (version (package-version btrfs-progs))
4917 (build-system trivial-build-system)
4919 `(("btrfs-progs:static" ,btrfs-progs "static")))
4921 `(#:modules ((guix build utils))
4924 (use-modules (guix build utils)
4928 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
4929 (out (assoc-ref %outputs "out"))
4930 (source (string-append btrfs "/bin/btrfs.static"))
4931 (target (string-append out "/bin/btrfs")))
4932 (mkdir-p (dirname target))
4933 (copy-file source target)
4934 (remove-store-references target)
4935 (chmod target #o555)
4937 (home-page (package-home-page btrfs-progs))
4938 (synopsis "Statically-linked btrfs command from btrfs-progs")
4939 (description "This package provides the statically-linked @command{btrfs}
4940 from the btrfs-progs package. It is meant to be used in initrds.")
4941 (license (package-license btrfs-progs))))
4943 (define-public cramfs-tools
4945 (name "cramfs-tools")
4946 (home-page "https://github.com/npitre/cramfs-tools")
4952 (commit (string-append "v" version))))
4954 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
4955 (file-name (git-file-name name version))))
4956 (build-system gnu-build-system)
4958 '(#:tests? #f ; No tests.
4960 (modify-phases %standard-phases
4963 (lambda* (#:key outputs #:allow-other-keys)
4964 (let ((out (assoc-ref outputs "out")))
4965 (install-file "mkcramfs" (string-append out "/sbin"))
4966 (install-file "cramfsck" (string-append out "/sbin")))
4970 (synopsis "Tools to manage Cramfs file systems")
4971 (description "Cramfs is a Linux file system designed to be simple, small,
4972 and to compress things well. It is used on a number of embedded systems and
4973 small devices. This version has additional features such as uncompressed
4974 blocks and random block placement.")
4975 (license license:gpl2+)))
4977 (define-public compsize
4981 (home-page "https://github.com/kilobyte/compsize")
4986 (commit (string-append "v" version))))
4988 (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43"))
4989 (file-name (git-file-name name version))))
4990 (build-system gnu-build-system)
4992 `(("btrfs-progs" ,btrfs-progs)))
4994 `(#:tests? #f ; No tests.
4995 #:make-flags (list "CC=gcc")
4997 (modify-phases %standard-phases
5000 (lambda* (#:key outputs #:allow-other-keys)
5001 (let ((out (assoc-ref outputs "out")))
5002 (install-file "compsize" (string-append out "/bin"))
5003 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
5004 (synopsis "Find compression type/ratio on Btrfs files")
5005 (description "@command{compsize} takes a list of files (given as
5006 arguments) on a Btrfs file system and measures used compression types and
5007 effective compression ratio, producing a report.
5009 A directory has no extents but has a (recursive) list of files. A non-regular
5010 file is silently ignored.
5012 As it makes no sense to talk about compression ratio of a partial extent,
5013 every referenced extent is counted whole, exactly once -- no matter if you use
5014 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
5015 uncompressed size will not match the number given by @command{tar} or
5016 @command{du}. On the other hand, the space used should be accurate (although
5017 obviously it can be shared with files outside our set).")
5018 (license license:gpl2+)))
5020 (define-public f2fs-tools-1.7
5027 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
5028 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
5031 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
5033 (build-system gnu-build-system)
5036 (modify-phases %standard-phases
5037 (add-after 'install 'install-headers
5038 (lambda* (#:key outputs #:allow-other-keys)
5039 (let* ((out (assoc-ref outputs "out"))
5040 (out-include (string-append out "/include")))
5041 (install-file "include/f2fs_fs.h" out-include)
5042 (install-file "mkfs/f2fs_format_utils.h" out-include)
5045 `(("autoconf" ,autoconf)
5046 ("automake" ,automake)
5047 ("libtool" ,libtool)
5048 ("pkg-config" ,pkg-config)))
5050 `(("libuuid" ,util-linux "lib")
5051 ("libselinux" ,libselinux)))
5052 (home-page "https://f2fs.wiki.kernel.org/")
5053 (synopsis "Userland tools for f2fs")
5055 "F2FS, the Flash-Friendly File System, is a modern file system
5056 designed to be fast and durable on flash devices such as solid-state
5057 disks and SD cards. This package provides the userland utilities.")
5058 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
5059 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
5060 (license (list license:gpl2 license:lgpl2.1))))
5062 (define-public f2fs-tools
5064 (inherit f2fs-tools-1.7)
5070 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
5071 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
5074 "0z9c0y3qq75iyqknl5k0v7v46l8c3pcifpqb0yqalrs24blkm7dk"))))
5076 `(("libuuid" ,util-linux "lib")))))
5078 (define-public f2fs-tools/static
5081 (inherit f2fs-tools)
5082 (name "f2fs-tools-static")
5085 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
5086 (libuuid (assoc-ref %build-inputs "libuuid")))
5088 (string-append "libuuid_CFLAGS=-I" libuuid "/include")
5089 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
5090 (string-append "libblkid_CFLAGS=-I" libuuid "/include")
5091 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
5092 #:disallowed-references (,util-linux)
5094 (modify-phases %standard-phases ; TODO: f2fs phases.
5095 (add-after 'unpack 'make-static
5097 (define (append-to-file name body)
5098 (let ((file (open-file name "a")))
5101 (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n")
5102 (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n")
5103 (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n")
5105 (add-after 'install 'remove-store-references
5106 (lambda* (#:key outputs #:allow-other-keys)
5107 ;; Work around bug in our util-linux.
5108 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
5109 (remove-store-references (string-append (assoc-ref outputs "out")
5113 `(("libuuid:static" ,util-linux "static")
5114 ("libuuid" ,util-linux "lib")))))) ; for include files
5116 (define-public f2fs-fsck/static
5118 (name "f2fs-fsck-static")
5119 (version (package-version f2fs-tools/static))
5121 (build-system trivial-build-system)
5123 `(#:modules ((guix build utils))
5126 (use-modules (guix build utils)
5129 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
5131 (out (assoc-ref %outputs "out"))
5132 (sbin (string-append out "/sbin")))
5134 (with-directory-excursion sbin
5135 (install-file (string-append f2fs-tools "/sbin/" fsck)
5137 (remove-store-references fsck)
5141 `(("f2fs-tools-static" ,f2fs-tools/static)))
5142 (home-page (package-home-page f2fs-tools/static))
5143 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
5144 (description "This package provides statically-linked fsck.f2fs command taken
5145 from the f2fs-tools package. It is meant to be used in initrds.")
5146 (license (package-license f2fs-tools/static))))
5148 (define-public freefall
5151 (version (package-version linux-libre))
5152 (source (package-source linux-libre))
5153 (build-system gnu-build-system)
5155 '(#:phases (modify-phases %standard-phases
5156 (add-after 'unpack 'enter-subdirectory
5158 (chdir "tools/laptop/freefall")
5161 (add-before 'build 'increase-timeout
5163 ;; The default of 2 seconds is too low: it assumes an
5164 ;; open lid and AC power without actually checking.
5165 (substitute* "freefall.c"
5166 (("alarm\\(2\\)") "alarm(5)"))
5168 #:make-flags (list (string-append "PREFIX="
5169 (assoc-ref %outputs "out"))
5171 #:tests? #f)) ;no tests
5172 (home-page (package-home-page linux-libre))
5173 (synopsis "Free-fall protection for spinning laptop hard drives")
5175 "Prevents shock damage to the internal spinning hard drive(s) of some
5176 HP and Dell laptops. When sudden movement is detected, all input/output
5177 operations on the drive are suspended and its heads are parked on the ramp,
5178 where they are less likely to cause damage to the spinning disc. Requires a
5179 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
5180 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
5181 (license license:gpl2)))
5183 (define-public thinkfan
5191 (url "https://github.com/vmatare/thinkfan")
5193 (file-name (git-file-name name version))
5195 (base32 "18vgm5w5pjnpipa34j4x87q10695w2jnqwvc2f027afy7mnzw7kz"))))
5196 (build-system cmake-build-system)
5198 `(#:modules ((guix build cmake-build-system)
5201 #:tests? #f ; no test target
5203 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
5204 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
5206 `("-DUSE_ATASMART:BOOL=ON")
5208 (modify-phases %standard-phases
5209 (add-after 'unpack 'create-init-scripts
5210 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
5211 ;; systemd to patch and install their service files. Fake their
5212 ;; presence rather than duplicating the build system below. Leave
5213 ;; things like ‘/bin/kill’ because they're not worth a dependency.
5214 ;; The sysvinit needs manual patching, but since upstream doesn't
5215 ;; even provide the option to install it: don't.
5216 (lambda* (#:key outputs #:allow-other-keys)
5217 (let* ((out (assoc-ref outputs "out"))
5218 (share (string-append out "/share/" ,name)))
5219 (substitute* "CMakeLists.txt"
5220 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
5221 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
5222 ;; That was easy! Now we just need to fix the destinations.
5224 (string-append out directory)))
5227 `(("pkg-config" ,pkg-config)))
5229 `(("libatasmart" ,libatasmart)
5230 ("yaml-cpp" ,yaml-cpp)))
5231 (home-page "https://github.com/vmatare/thinkfan")
5232 (synopsis "Simple fan control program")
5234 "Thinkfan is a simple fan control program. It reads temperatures,
5235 checks them against configured limits and switches to appropriate (also
5236 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
5237 other @code{hwmon} driver that enables temperature reading and fan control
5239 (license license:gpl3+)))
5241 (define-public tpacpi-bat
5249 (url "https://github.com/teleshoes/tpacpi-bat")
5250 (commit (string-append "v" version))))
5251 (file-name (git-file-name name version))
5253 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
5254 (build-system gnu-build-system)
5256 `(#:tests? #f ; no test target
5258 (modify-phases %standard-phases
5259 (add-after 'unpack 'refer-to-inputs
5261 (substitute* "tpacpi-bat"
5263 (format #f "~a " (which "cat")))
5264 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
5265 ;; loaded. That's the administrator's prerogative; disable it.
5266 (("system \"(modprobe .*)\"" _ match)
5267 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))
5269 (delete 'configure) ; nothing to configure
5270 (delete 'build) ; nothing to build
5272 (lambda* (#:key outputs #:allow-other-keys)
5273 (let* ((out (assoc-ref outputs "out"))
5274 (bin (string-append out "/bin"))
5275 (doc (string-append out "/share/doc/" ,name "-" ,version)))
5276 (install-file "tpacpi-bat" bin)
5278 ;; There's no man page. Install other forms of documentation.
5279 (for-each (lambda (file)
5280 (let ((target (string-append doc "/" file)))
5281 (mkdir-p (dirname target))
5282 (copy-recursively file target)))
5283 (list "battery_asl" "examples" "README.md"))
5287 (home-page "https://github.com/teleshoes/tpacpi-bat")
5288 (synopsis "ThinkPad battery charge controller")
5290 "Tpacpi-bat is a command-line interface to control battery charging on
5291 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
5292 ThinkPad models released after 2011}, starting with the xx20 series. It can
5293 query and set the thresholds at which one or both batteries will start and stop
5294 charging, inhibit charging batteries for a set period of time, or force them to
5295 discharge when they otherwise would not.
5297 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
5298 kernel module provided by the @code{acpi-call-linux-module} package, which must
5299 be installed and loaded separately. Only the original vendor firmware is
5301 (license license:gpl3+)))
5303 (define-public ntfs-3g
5306 (version "2017.3.23")
5309 (uri (string-append "https://tuxera.com/opensource/"
5310 "ntfs-3g_ntfsprogs-" version ".tgz"))
5311 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
5314 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
5315 (modules '((guix build utils)))
5317 ;; Install under $prefix.
5318 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
5322 (build-system gnu-build-system)
5323 (inputs `(("util-linux" ,util-linux)
5324 ("fuse" ,fuse))) ;libuuid
5325 (native-inputs `(("pkg-config" ,pkg-config)))
5327 '(#:configure-flags (list "--disable-static"
5328 "--exec-prefix=${prefix}"
5329 "--with-fuse=external" ;use our own FUSE
5330 "--enable-mount-helper"
5331 "--enable-posix-acls"
5332 "--enable-xattr-mappings")
5334 (modify-phases %standard-phases
5335 ;; If users install ntfs-3g, they probably want to make it the
5336 ;; default driver as well, so we opt for sensible defaults and link
5337 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
5338 ;; mount NTFS file systems.)
5339 (add-after 'install 'install-link
5340 (lambda* (#:key outputs #:allow-other-keys)
5341 (let* ((out (assoc-ref outputs "out"))
5342 (sbin (string-append out "/sbin")))
5343 (symlink "mount.ntfs-3g"
5344 (string-append sbin "/mount.ntfs")))
5346 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
5347 (synopsis "Read-write access to NTFS file systems")
5349 "NTFS-3G provides read-write access to NTFS file systems, which are
5350 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
5351 The package provides additional NTFS tools.")
5352 (license license:gpl2+)))
5354 (define-public rdma-core
5360 (uri (string-append "https://github.com/linux-rdma/rdma-core"
5361 "/releases/download/v" version "/rdma-core-"
5365 "14raqwx4pkzghiwkx1v0dq338f7xqqx8rnsxlpdnngvjy1p5l79j"))))
5366 (build-system cmake-build-system)
5368 `(#:tests? #f ; no tests
5369 ;; Upstream uses the "ninja" build system and encourage distros
5370 ;; to do the same for consistency. They also recommend using the
5371 ;; "Release" build type.
5372 #:build-type "Release"
5373 #:configure-flags (list "-GNinja"
5375 (string-append "-DRST2MAN_EXECUTABLE="
5376 (assoc-ref %build-inputs
5380 ;; On some configurations, the
5381 ;; IB_USER_MAD_REGISTER_AGENT ioctl, which is
5382 ;; used by default, would return ENODEV. To
5383 ;; avoid that, use 'write' instead of ioctls,
5384 ;; as suggested in 'CMakeList.txt'.
5385 "-DIOCTL_MODE=write")
5387 (modify-phases %standard-phases
5391 "-j" (number->string (parallel-job-count)))))
5394 (invoke "ninja" "install"))))))
5397 ("pkg-config" ,pkg-config)
5398 ("python" ,python-wrapper)
5399 ("python-docutils" ,python-docutils))) ;for 'rst2man'
5403 (home-page "https://github.com/linux-rdma/rdma-core")
5404 (synopsis "Utilities and libraries for working with RDMA devices")
5406 "This package provides userspace components for the InfiniBand
5407 subsystem of the Linux kernel. Specifically it contains userspace
5408 libraries for the following device nodes:
5411 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
5412 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
5413 @item @file{/dev/infiniband/umadX} (@code{libibumad})
5416 The following service daemons are also provided:
5418 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
5419 @item @code{iwpmd} (for iWARP kernel providers)
5420 @item @code{ibacm} (for InfiniBand communication management assistant)
5422 ;; All library code is dual licensed under GPL2 and a custom MIT
5423 ;; variant. The package also includes some components covered by
5424 ;; other licenses. Consult COPYING.md for full details.
5427 (license:x11-style "See COPYING.BSD_MIT in the distribution")
5428 license:bsd-2 ; Files referring to COPYING.BSD_FB
5429 license:cc0 ; most files in ccan/
5430 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
5432 (define-public perftest
5439 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
5440 version "/perftest-" version ".g0927198.tar.gz"))
5442 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
5443 (build-system gnu-build-system)
5446 (modify-phases %standard-phases
5447 (add-after 'unpack 'patch-header-paths
5449 (substitute* '("src/raw_ethernet_fs_rate.c"
5450 "src/raw_ethernet_resources.c"
5451 "src/raw_ethernet_resources.h"
5452 "src/raw_ethernet_send_burst_lat.c"
5453 "src/raw_ethernet_send_bw.c"
5454 "src/raw_ethernet_send_lat.c")
5455 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
5457 (inputs `(("rdma-core" ,rdma-core)))
5458 (home-page "https://github.com/linux-rdma/perftest/")
5459 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
5460 (description "This is a collection of tests written over uverbs intended for
5461 use as a performance micro-benchmark. The tests may be used for hardware or
5462 software tuning as well as for functional testing.
5464 The collection contains a set of bandwidth and latency benchmark such as:
5466 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
5467 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
5468 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
5469 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
5470 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
5472 (license license:gpl2)))
5474 (define-public rng-tools
5477 (home-page "https://github.com/nhorman/rng-tools")
5481 (uri (git-reference (url home-page)
5482 (commit (string-append "v" version))))
5483 (file-name (git-file-name name version))
5486 "0hbml37yxs0fs69g7f2x4ixq61z0029swy99rn7ykma9mi6b7ni9"))))
5487 (build-system gnu-build-system)
5489 `(;; Disable support for various hardware entropy sources as they need
5490 ;; dependencies that are not yet in Guix, and would significantly
5491 ;; increase closure size.
5492 #:configure-flags '("--without-nistbeacon"
5494 "--without-rtlsdr")))
5496 `(("autoconf" ,autoconf)
5497 ("automake" ,automake)
5498 ("pkg-config" ,pkg-config)))
5500 `(("libsysfs" ,sysfsutils)
5501 ("openssl" ,openssl)))
5502 (synopsis "Random number generator daemon")
5504 "Monitor a hardware random number generator, and supply entropy
5505 from that to the system kernel's @file{/dev/random} machinery.")
5506 ;; The source package is offered under the GPL2+, but the files
5507 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
5508 (license (list license:gpl2 license:gpl2+))))
5510 (define-public cpupower
5513 (version (package-version linux-libre))
5514 (source (package-source linux-libre))
5515 (build-system gnu-build-system)
5517 '(#:phases (modify-phases %standard-phases
5518 (add-after 'unpack 'enter-subdirectory
5520 (chdir "tools/power/cpupower")
5523 (add-before 'build 'fix-makefiles
5525 (substitute* "Makefile"
5527 (("/bin/(install|pwd)" _ command) command))
5528 (substitute* "bench/Makefile"
5529 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
5531 #:make-flags (let ((out (assoc-ref %outputs "out")))
5532 (list (string-append "DESTDIR=" out)
5533 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
5535 "docdir=/share/doc/cpupower"
5536 "confdir=$(docdir)/examples"
5537 ;; The Makefile recommends the following changes
5539 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
5540 #:tests? #f)) ;no tests
5541 (native-inputs `(("gettext" ,gettext-minimal)))
5542 (inputs `(("pciutils" ,pciutils)))
5543 (home-page (package-home-page linux-libre))
5544 (synopsis "CPU frequency and voltage scaling tools for Linux")
5546 "cpupower is a set of user-space tools that use the cpufreq feature of the
5547 Linux kernel to retrieve and control processor features related to power saving,
5548 such as frequency and voltage scaling.")
5549 (license license:gpl2)))
5551 (define-public x86-energy-perf-policy
5553 (name "x86-energy-perf-policy")
5554 (version (package-version linux-libre))
5555 (source (package-source linux-libre))
5556 (build-system gnu-build-system)
5560 (modify-phases %standard-phases
5561 (add-after 'unpack 'enter-subdirectory
5563 (chdir "tools/power/x86/x86_energy_perf_policy")
5566 (add-before 'build 'fix-makefile
5568 (substitute* "Makefile" (("/usr") ""))
5571 (let ((out (assoc-ref %outputs "out")))
5572 (list (string-append "DESTDIR=" out)
5573 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
5574 (supported-systems '("i686-linux" "x86_64-linux"))
5575 (home-page (package-home-page linux-libre))
5576 (synopsis "Display and update Intel-CPU energy-performance policy")
5578 "@command{x86_energy_perf_policy} displays and updates energy-performance
5579 policy settings specific to Intel Architecture Processors. Settings are
5580 accessed via Model Specific Register (MSR) updates, no matter if the Linux
5581 cpufreq sub-system is enabled or not.")
5582 (license license:gpl2)))
5584 (define-public haveged
5592 (url "https://github.com/jirka-h/haveged")
5593 (commit (string-append "v" version))))
5594 (file-name (git-file-name name version))
5596 (base32 "0g3hcvpky76cabgcfqh65fay7nnjkms32sgmlf33q969833hijqz"))))
5597 (build-system gnu-build-system)
5598 (home-page "https://www.issihosts.com/haveged")
5599 (synopsis "Entropy source for the Linux random number generator")
5601 "haveged generates an unpredictable stream of random numbers for use by
5602 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
5603 standard mechanisms for filling the entropy pool may not be sufficient for
5604 systems with high needs or limited user interaction, such as headless servers.
5606 @command{haveged} runs as a privileged daemon, harvesting randomness from the
5607 indirect effects of hardware events on hidden processor state using the
5608 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
5609 It tunes itself to its environment and provides the same built-in test suite
5610 for the output stream as used on certified hardware security devices.
5612 The quality of the randomness produced by this algorithm has not been proven.
5613 It is recommended to run it together with another entropy source like rngd, and
5614 not as a replacement for it.")
5615 (license (list (license:non-copyleft "file://nist/mconf.h")
5616 (license:non-copyleft "file://nist/packtest.c")
5617 license:public-domain ; nist/dfft.c
5618 license:gpl3+)))) ; everything else
5620 (define-public ecryptfs-utils
5622 (name "ecryptfs-utils")
5627 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
5628 version "/+download/ecryptfs-utils_"
5629 version ".orig.tar.gz"))
5632 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
5633 (build-system gnu-build-system)
5635 `(#:configure-flags (list "--disable-pywrap")
5637 (modify-phases %standard-phases
5638 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
5639 (lambda* (#:key inputs outputs #:allow-other-keys)
5640 (let ((out (assoc-ref outputs "out"))
5641 (utils-linux (assoc-ref inputs "utils-linux"))
5642 (cryptsetup (assoc-ref inputs "cryptsetup"))
5643 (linux-pam (assoc-ref inputs "linux-pam"))
5644 (lvm2 (assoc-ref inputs "lvm2")))
5645 (substitute* '("src/utils/ecryptfs-mount-private"
5646 "src/utils/ecryptfs-umount-private"
5647 "src/utils/ecryptfs-setup-private"
5648 "src/utils/ecryptfs-setup-swap"
5649 "src/utils/mount.ecryptfs.c"
5650 "src/utils/umount.ecryptfs.c"
5651 "src/pam_ecryptfs/pam_ecryptfs.c"
5652 "src/desktop/ecryptfs-mount-private.desktop.in"
5653 "src/desktop/ecryptfs-setup-private.desktop.in")
5655 (string-append utils-linux "/bin/mount"))
5657 (string-append utils-linux "/bin/umount"))
5658 (("/sbin/mount.ecryptfs_private")
5659 (string-append out "/sbin/mount.ecryptfs_private"))
5660 (("/sbin/umount.ecryptfs_private")
5661 (string-append out "/sbin/umount.ecryptfs_private"))
5662 (("/usr/bin/ecryptfs-mount-private")
5663 (string-append out "/bin/ecryptfs-mount-private"))
5664 (("/usr/bin/ecryptfs-rewrite-file")
5665 (string-append out "/bin/ecryptfs-rewrite-file"))
5666 (("/usr/bin/ecryptfs-setup-private")
5667 (string-append out "/bin/ecryptfs-setup-private"))
5668 (("/sbin/cryptsetup")
5669 (string-append cryptsetup "/sbin/cryptsetup"))
5670 (("/sbin/unix_chkpwd")
5671 (string-append linux-pam "/sbin/unix_chkpwd"))
5673 (string-append lvm2 "/sbin/dmsetup")))))))))
5675 `(("intltool" ,intltool)
5676 ("perl" ,perl) ; for pod2man
5677 ("pkg-config" ,pkg-config)))
5679 `(("keyutils" ,keyutils)
5680 ("linux-pam" ,linux-pam)
5681 ("utils-linux" ,util-linux)
5682 ("cryptsetup" ,cryptsetup)
5685 (home-page "https://ecryptfs.org/")
5686 (synopsis "eCryptfs cryptographic file system utilities")
5688 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
5689 Each file's cryptographic meta-data is stored inside the file itself, along
5690 with the encrypted contents. This allows individual encrypted files to be
5691 copied between hosts and still be decrypted with the proper key. eCryptfs is a
5692 native Linux file system, and has been part of the Linux kernel since version
5693 2.6.19. This package contains the userland utilities to manage it.")
5694 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
5695 ;; grant additional permission to link with OpenSSL.
5696 (license license:gpl2+)))
5698 (define-public libnfsidmap
5700 (name "libnfsidmap")
5705 (uri (string-append "https://fedorapeople.org/~steved/"
5706 name "/" version "/" name "-" version ".tar.bz2"))
5708 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
5709 (build-system gnu-build-system)
5711 `(#:configure-flags (list
5712 (string-append "--with-pluginpath="
5713 (assoc-ref %outputs "out")
5714 "/lib/libnfsidmap"))))
5716 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
5718 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
5719 (synopsis "NFSv4 support library for name/ID mapping")
5720 (description "Libnfsidmap is a library holding mulitiple methods of
5721 mapping names to ids and visa versa, mainly for NFSv4. It provides an
5722 extensible array of mapping functions, currently consisting of two choices:
5723 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
5724 (license (license:non-copyleft "file://COPYING"
5725 "See COPYING in the distribution."))))
5727 (define-public module-init-tools
5729 (name "module-init-tools")
5734 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
5735 "module-init-tools-" version ".tar.bz2"))
5738 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
5739 (patches (search-patches "module-init-tools-moduledir.patch"))))
5740 (build-system gnu-build-system)
5742 ;; FIXME: The upstream tarball lacks man pages, and building them would
5743 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
5744 ;; but they vanished. In the meantime, fake it.
5746 (modify-phases %standard-phases
5747 (add-before 'configure 'fake-docbook
5749 (substitute* "Makefile.in"
5750 (("^DOCBOOKTOMAN.*$")
5751 "DOCBOOKTOMAN = true\n"))
5753 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
5754 (synopsis "Tools for loading and managing Linux kernel modules")
5756 "Tools for loading and managing Linux kernel modules, such as
5757 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
5758 (license license:gpl2+)))
5760 (define-public mcelog
5766 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
5767 "mcelog.git/snapshot/v" version ".tar.gz"))
5770 "1a1j4lsvql3aiqbkdn10hhpvmhavhlr9qkh2scxcv1kn7rvvclih"))
5771 (file-name (string-append name "-" version ".tar.gz"))
5772 (modules '((guix build utils)))
5775 ;; The snapshots lack a .git directory,
5776 ;; breaking ‘git describe’.
5777 (substitute* "Makefile"
5778 (("\"unknown\"") (string-append "\"v" ,version "\"")))
5780 (build-system gnu-build-system)
5782 `(#:phases (modify-phases %standard-phases
5783 (delete 'configure)) ; no configure script
5784 #:make-flags (let ((out (assoc-ref %outputs "out")))
5786 (string-append "prefix=" out)
5787 (string-append "DOCDIR=" out "/share/doc/"
5789 "etcprefix=$(DOCDIR)/examples"))
5790 ;; The tests will only run as root on certain supported CPU models.
5792 (supported-systems (list "i686-linux" "x86_64-linux"))
5793 (home-page "https://mcelog.org/")
5794 (synopsis "Machine check monitor for x86 Linux systems")
5796 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
5797 systems running the kernel Linux. It can also perform user-defined tasks, such
5798 as bringing bad pages off-line, when configurable error thresholds are
5800 (license license:gpl2)))
5802 (define-public mtd-utils
5809 "ftp://ftp.infradead.org/pub/mtd-utils/"
5810 "mtd-utils-" version ".tar.bz2"))
5813 "1mp9fqgnz5r69s8ly98ry6k2blqnaqpllwi8m930dm0n8zrwbm4a"))))
5815 '(#:configure-flags '("--enable-unit-tests")))
5817 `(("cmocka" ,cmocka)
5818 ("pkg-config" ,pkg-config)))
5820 `(("acl" ,acl) ; extended attributes (xattr)
5821 ("libuuid" ,util-linux "lib")
5823 ("openssl" ,openssl) ; optional crypto support
5825 ("zstd" ,zstd "lib")))
5826 (build-system gnu-build-system)
5827 (synopsis "MTD Flash Storage Utilities")
5828 (description "This package provides utilities for testing, partitioning, etc
5830 (home-page "http://www.linux-mtd.infradead.org/")
5832 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
5833 license:mpl1.1 ; All ftl* files
5834 license:expat)))) ; libiniparser
5836 (define-public libseccomp
5842 (uri (string-append "https://github.com/seccomp/libseccomp/"
5843 "releases/download/v" version
5844 "/libseccomp-" version ".tar.gz"))
5847 "0m8dlg1v7kflcxvajs4p76p275qwsm2abbf5mfapkakp7hw7wc7f"))))
5848 (build-system gnu-build-system)
5850 '(#:configure-flags '("--disable-static")
5851 #:phases (modify-phases %standard-phases
5852 (add-before 'check 'skip-load-test
5854 ;; This test does a native system call and fails when
5855 ;; run under QEMU user-mode emulation. Just skip it.
5856 (delete-file "tests/52-basic-load.tests")
5861 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
5862 (description "The libseccomp library provides an easy to use, platform
5863 independent, interface to the Linux Kernel's syscall filtering mechanism. The
5864 libseccomp API is designed to abstract away the underlying BPF based syscall
5865 filter language and present a more conventional function-call based filtering
5866 interface that should be familiar to, and easily adopted by, application
5868 (home-page "https://github.com/seccomp/libseccomp")
5869 (license license:lgpl2.1)))
5871 (define-public radeontop
5879 (url "https://github.com/clbr/radeontop")
5880 (commit (string-append "v" version))))
5881 (file-name (git-file-name name version))
5883 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
5884 (build-system gnu-build-system)
5886 `(#:phases (modify-phases %standard-phases
5887 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
5888 ;; dependency, and doesn't even work on release(!) tarballs.
5889 (add-after 'unpack 'report-correct-version
5891 (substitute* "getver.sh"
5893 (string-append "ver=" ,version)))
5895 (delete 'configure)) ; no configure script
5896 #:make-flags (list "CC=gcc"
5897 (string-append "PREFIX=" %output))
5898 #:tests? #f)) ; no tests
5900 `(("gettext" ,gettext-minimal)
5901 ("pkg-config" ,pkg-config)))
5903 `(("libdrm" ,libdrm)
5904 ("libpciaccess" ,libpciaccess)
5906 ("ncurses" ,ncurses)))
5907 (home-page "https://github.com/clbr/radeontop/")
5908 (synopsis "Usage monitor for AMD Radeon graphics")
5909 (description "RadeonTop monitors resource consumption on supported AMD
5910 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
5911 a terminal or saved to a file for further processing. It measures both the
5912 activity of the GPU as a whole, which is also accurate during OpenCL
5913 computations, as well as separate component statistics that are only meaningful
5914 under OpenGL graphics workloads.")
5915 (license license:gpl3)))
5917 (define-public efivar
5923 (uri (string-append "https://github.com/rhboot/" name
5924 "/releases/download/" version "/" name
5925 "-" version ".tar.bz2"))
5928 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
5929 (build-system gnu-build-system)
5931 `(;; Tests require a UEFI system and is not detected in the chroot.
5933 #:make-flags (list (string-append "prefix=" %output)
5934 (string-append "libdir=" %output "/lib")
5936 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5938 (modify-phases %standard-phases
5939 (delete 'configure))))
5941 `(("pkg-config" ,pkg-config)))
5944 (home-page "https://github.com/rhboot/efivar")
5945 (synopsis "Tool and library to manipulate EFI variables")
5946 (description "This package provides a library and a command line
5947 interface to the variable facility of UEFI boot firmware.")
5948 (license license:lgpl2.1+)))
5950 (define-public efibootmgr
5956 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
5957 "/releases/download/" version "/efibootmgr"
5958 "-" version ".tar.bz2"))
5961 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
5962 (build-system gnu-build-system)
5964 `(#:tests? #f ;no tests
5965 #:make-flags (list (string-append "prefix=" %output)
5966 (string-append "libdir=" %output "/lib")
5967 ;; EFIDIR denotes a subdirectory relative to the
5968 ;; EFI System Partition where the loader will be
5969 ;; installed (known as OS_VENDOR in the code).
5970 ;; GRUB overrides this, as such it's only used if
5971 ;; nothing else is specified on the command line.
5973 #:phases (modify-phases %standard-phases (delete 'configure))))
5975 `(("pkg-config" ,pkg-config)))
5977 `(("efivar" ,efivar)
5979 (home-page "https://github.com/rhinstaller/efibootmgr")
5980 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
5982 "@code{efibootmgr} is a user-space application to modify the Intel
5983 Extensible Firmware Interface (EFI) Boot Manager. This application can
5984 create and destroy boot entries, change the boot order, change the next
5985 running boot option, and more.")
5986 (license license:gpl2+)))
5988 (define-public sysstat
5995 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
5996 "sysstat-" version ".tar.xz"))
5998 (base32 "02yf2c9n56c3ic72r4p4kb99zjxr8fldvsnmcy7s262izx78vbr4"))))
5999 (build-system gnu-build-system)
6001 `(#:tests? #f ; no test suite.
6002 ;; Without this flag, it tries to install the man pages with group 'root'
6003 ;; and fails because /etc/passwd lacks an entry for the root user.
6005 (list "--disable-file-attr"
6006 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
6008 (modify-phases %standard-phases
6009 ;; The build process tries to create '/var/lib/sa', so we skip that
6011 (add-after 'build 'skip-touching-var
6013 (substitute* "Makefile"
6014 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
6017 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
6018 (synopsis "Performance monitoring tools for Linux")
6019 (description "The sysstat utilities are a collection of performance
6020 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
6021 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
6022 @code{sadf} and @code{sa}.")
6023 (license license:gpl2+)))
6025 (define-public light
6033 (url "https://github.com/haikarainen/light")
6034 (commit (string-append "v" version))))
6036 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
6037 (file-name (git-file-name name version))))
6038 (build-system gnu-build-system)
6041 (modify-phases %standard-phases
6042 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
6043 (lambda* (#:key inputs #:allow-other-keys)
6044 (substitute* "90-backlight.rules"
6045 (("/bin/chgrp") (which "chgrp"))
6046 (("/bin/chmod") (which "chmod")))
6048 (add-after 'install 'install-udev-rules
6049 (lambda* (#:key outputs #:allow-other-keys)
6050 (let ((out (assoc-ref outputs "out")))
6052 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
6055 `(("autoconf" ,autoconf)
6056 ("automake" ,automake)))
6057 (home-page "https://haikarainen.github.io/light/")
6058 (synopsis "GNU/Linux application to control backlights")
6060 "Light is a program to send commands to screen backlight controllers
6061 under GNU/Linux. Features include:
6064 @item It does not rely on X.
6065 @item Light can automatically figure out the best controller to use, making
6066 full use of underlying hardware.
6067 @item It is possible to set a minimum brightness value, as some controllers
6068 set the screen to be pitch black at a value of 0 (or higher).
6070 (license license:gpl3+)))
6072 (define-public brightnessctl
6074 (name "brightnessctl")
6076 (home-page "https://github.com/Hummer12007/brightnessctl")
6079 (uri (git-reference (url home-page) (commit version)))
6080 (file-name (git-file-name name version))
6083 "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq"))))
6084 (build-system gnu-build-system)
6086 `(#:tests? #f ; no tests
6087 #:make-flags (list (string-append "CC=" ,(cc-for-target))
6088 (string-append "PREFIX=" %output)
6089 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
6091 (modify-phases %standard-phases
6093 (add-after 'unpack 'adjust-udev-rules
6095 (substitute* "90-brightnessctl.rules"
6096 (("/bin/") "/run/current-system/profile/bin/"))
6098 (synopsis "Backlight and LED brightness control")
6100 "This program allows you read and control device brightness. Devices
6101 include backlight and LEDs. It can also preserve current brightness before
6102 applying the operation, such as on lid close.
6104 The appropriate permissions must be set on the backlight or LED control
6105 interface in sysfs, which can be accomplished with the included udev rules.")
6106 (license license:expat)))
6116 (url "https://github.com/linrunner/TLP")
6118 (file-name (git-file-name name version))
6120 (base32 "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5"))))
6122 `(("shellcheck" ,shellcheck)))
6126 ("ethtool" ,ethtool)
6130 ("inetutils" ,inetutils)
6133 ("pciutils" ,pciutils)
6137 ("usbutils" ,usbutils)
6138 ("util-linux" ,util-linux)
6139 ("wireless-tools" ,wireless-tools)
6140 ,@(if (let ((system (or (%current-target-system)
6141 (%current-system))))
6142 (or (string-prefix? "i686-" system)
6143 (string-prefix? "x86_64-" system)))
6144 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
6146 (build-system gnu-build-system)
6148 ;; XXX: The full test suite is run with "checkall" but it requires
6149 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
6150 `(#:test-target "shellcheck"
6151 #:modules ((guix build gnu-build-system)
6155 (modify-phases %standard-phases
6156 (delete 'configure) ; no configure script
6157 (add-before 'build 'setenv
6158 (lambda* (#:key outputs #:allow-other-keys)
6159 (let ((out (assoc-ref outputs "out")))
6160 (setenv "TLP_WITH_SYSTEMD" "0")
6161 (setenv "TLP_NO_INIT" "1")
6162 (setenv "TLP_NO_PMUTILS" "1")
6163 (setenv "TLP_SBIN" (string-append out "/bin"))
6164 (setenv "TLP_BIN" (string-append out "/bin"))
6165 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
6166 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
6167 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
6168 (setenv "TLP_CONFDEF"
6169 (string-append out "/share/tlp/defaults.conf"))
6170 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
6172 (string-append out "/lib/elogind/system-sleep"))
6174 (string-append out "/share/bash-completion/completions"))
6175 (setenv "TLP_MAN" (string-append out "/share/man"))
6176 (setenv "TLP_META" (string-append out "/share/metainfo"))
6178 (add-before 'install 'fix-installation
6180 ;; Stop the Makefile from trying to create system directories.
6181 (substitute* "Makefile"
6182 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
6183 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
6186 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
6187 (add-after 'install 'wrap
6188 (lambda* (#:key inputs outputs #:allow-other-keys)
6189 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
6190 (bin-files (find-files bin ".*")))
6191 (define (bin-directory input-name)
6192 (let ((p (assoc-ref inputs input-name)))
6193 (and p (string-append p "/bin"))))
6194 (define (sbin-directory input-name)
6195 (string-append (assoc-ref inputs input-name) "/sbin"))
6196 (for-each (lambda (program)
6197 (wrap-program program
6200 (filter-map bin-directory
6212 "x86-energy-perf-policy"))
6213 (filter-map sbin-directory
6219 "wireless-tools"))))))
6222 (home-page "https://linrunner.de/en/tlp/tlp.html")
6223 (synopsis "Power management tool for Linux")
6224 (description "TLP is a power management tool for Linux. It comes with
6225 a default configuration already optimized for battery life. Nevertheless,
6226 TLP is customizable to fulfil system requirements. TLP settings are applied
6227 every time the power supply source is changed.")
6228 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
6230 (license (list license:gpl2+ license:gpl3+))))
6235 (version "B.02.19.2")
6238 (uri (string-append "https://www.ezix.org/software/"
6239 "files/lshw-" version
6243 "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
6244 (build-system gnu-build-system)
6246 `(#:phases (modify-phases %standard-phases (delete 'configure))
6247 #:tests? #f ; no tests
6249 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
6250 (synopsis "List hardware information")
6252 "@command{lshw} (Hardware Lister) is a small tool to provide
6253 detailed information on the hardware configuration of the machine.
6254 It can report exact memory configuration, firmware version, mainboard
6255 configuration, CPU version and speed, cache configuration, bus speed,
6256 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
6257 machines (PowerMac G4 is known to work).")
6258 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
6259 (license license:gpl2+)))
6261 (define-public libmnl
6268 (uri (string-append "mirror://netfilter.org/libmnl/"
6269 "libmnl-" version ".tar.bz2"))
6272 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
6273 (build-system gnu-build-system)
6274 (home-page "https://www.netfilter.org/projects/libmnl/")
6275 (synopsis "Netlink utility library")
6276 (description "Libmnl is a minimalistic user-space library oriented to
6277 Netlink developers. There are a lot of common tasks in parsing, validating,
6278 constructing of both the Netlink header and TLVs that are repetitive and easy to
6279 get wrong. This library aims to provide simple helpers that allows you to
6280 re-use code and to avoid re-inventing the wheel.")
6281 (license license:lgpl2.1+)))
6283 (define-public libnftnl
6290 (uri (string-append "mirror://netfilter.org/libnftnl/"
6291 "libnftnl-" version ".tar.bz2"))
6293 (base32 "04dp797llg3cqzivwrql30wg9mfr0ngnp0v5gs7jcdmp11dzm8q4"))))
6294 (build-system gnu-build-system)
6296 `(("pkg-config" ,pkg-config)))
6298 `(("libmnl" ,libmnl)))
6299 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
6300 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
6301 (description "Libnftnl is a userspace library providing a low-level netlink
6302 programming interface to the in-kernel nf_tables subsystem. The library
6303 libnftnl has been previously known as libnftables. This library is currently
6305 (license license:gpl2+)))
6307 (define-public nftables
6314 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
6316 (string-append "https://www.nftables.org/projects/nftables"
6317 "/files/nftables-" version ".tar.bz2")))
6319 (base32 "1c1c2475nifncv0ng8z77h2dpanlsx0bhqm15k00jb3a6a68lszy"))))
6320 (build-system gnu-build-system)
6321 (arguments `(#:configure-flags
6322 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
6323 (inputs `(("gmp" ,gmp)
6325 ("libnftnl" ,libnftnl)
6326 ("readline" ,readline)))
6327 (native-inputs `(("pkg-config" ,pkg-config)
6330 (home-page "https://www.nftables.org")
6331 (synopsis "Userspace utility for Linux packet filtering")
6332 (description "nftables is the project that aims to replace the existing
6333 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
6334 filtering framework, a new userspace utility and also a compatibility layer for
6335 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
6336 infrastructure such as the existing hooks, the connection tracking system, the
6337 userspace queueing component and the logging subsystem.")
6338 (license license:gpl2)))
6340 (define-public proot
6348 (url "https://github.com/proot-me/PRoot")
6349 (commit (string-append "v" version))))
6350 (file-name (git-file-name name version))
6352 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
6353 (patches (search-patches "proot-test-fhs.patch"))))
6354 (build-system gnu-build-system)
6356 '(#:make-flags '("-C" "src")
6358 #:phases (modify-phases %standard-phases
6360 (add-before 'build 'set-shell-file-name
6361 (lambda* (#:key inputs #:allow-other-keys)
6362 (substitute* (find-files "src" "\\.[ch]$")
6365 (assoc-ref inputs "bash")
6368 (add-before 'check 'fix-fhs-assumptions-in-tests
6370 (substitute* "tests/test-c6b77b77.mk"
6371 (("/bin/bash") (which "bash"))
6372 (("/usr/bin/test") (which "test")))
6373 (substitute* '("tests/test-16573e73.c")
6374 (("/bin/([a-z-]+)" _ program)
6377 (substitute* (find-files "tests" "\\.sh$")
6378 ;; Some of the tests try to "bind-mount" /bin/true.
6380 (string-append "-b " (which "true") ":"))
6381 ;; Likewise for /bin.
6382 (("-b /bin:") "-b /gnu:")
6383 ;; Others try to run /bin/sh.
6384 (("/bin/sh") (which "sh"))
6385 ;; Others assume /etc/fstab exists.
6386 (("/etc/fstab") "/etc/passwd"))
6388 (substitute* "tests/GNUmakefile"
6389 (("-b /bin:") "-b /gnu:"))
6391 ;; XXX: This test fails in an obscure corner case, just
6393 (delete-file "tests/test-kkkkkkkk.c")
6398 (let ((n (parallel-job-count)))
6399 ;; For some reason we get lots of segfaults with
6400 ;; seccomp support (x86_64, Linux-libre 4.11.0).
6401 (setenv "PROOT_NO_SECCOMP" "1")
6403 ;; Most of the tests expect "/bin" to be in $PATH so
6404 ;; they can run things that live in $ROOTFS/bin.
6406 (string-append (getenv "PATH") ":/bin"))
6408 (invoke "make" "check" "-C" "tests"
6410 "-j" (number->string n)))))
6412 (lambda* (#:key outputs #:allow-other-keys)
6413 ;; The 'install' rule does nearly nothing.
6414 (let* ((out (assoc-ref outputs "out"))
6415 (man1 (string-append out "/share/man/man1")))
6416 ;; TODO: 'make install-care' (does not even
6417 ;; build currently.)
6418 (invoke "make" "-C" "src" "install"
6419 (string-append "PREFIX=" out))
6422 (copy-file "doc/proot/man.1"
6423 (string-append man1 "/proot.1"))
6425 (native-inputs `(("which" ,which)
6427 ;; For 'mcookie', used by some of the tests.
6428 ("util-linux" ,util-linux)
6430 ;; XXX: Choose the old coreutils because its 'stat'
6431 ;; program does not use statx(2) when running 'stat -c
6432 ;; %a' or similar, which PRoot doesn't properly support.
6433 ("coreutils-old" ,coreutils-8.30)
6435 ;; XXX: 'test-c6b77b77.sh' runs 'make' and that leads
6436 ;; make 4.3 to segfault.
6437 ("make-old" ,gnu-make-4.2)))
6438 (inputs `(("talloc" ,talloc)))
6439 (home-page "https://github.com/proot-me/PRoot")
6440 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
6442 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
6443 and @code{binfmt_misc}. This means that users don't need any privileges or
6444 setup to do things like using an arbitrary directory as the new root
6445 file system, making files accessible somewhere else in the file system
6446 hierarchy, or executing programs built for another CPU architecture
6447 transparently through QEMU user-mode. Also, developers can use PRoot as a
6448 generic process instrumentation engine thanks to its extension mechanism.
6449 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
6450 available in the kernel Linux.")
6451 (license license:gpl2+)))
6453 (define-public proot-static
6456 (name "proot-static")
6458 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
6459 (inputs `(("talloc" ,talloc/static)))
6461 (substitute-keyword-arguments (package-arguments proot)
6462 ((#:make-flags flags)
6463 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
6465 `(modify-phases ,phases
6466 (add-after 'strip 'remove-store-references
6467 (lambda* (#:key outputs #:allow-other-keys)
6468 (let* ((out (assoc-ref outputs "out")))
6469 (with-directory-excursion out
6470 (remove-store-references "bin/proot")
6472 ((#:allowed-references _ '("out"))
6475 (define-public cpuid
6478 (version "20201006")
6481 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
6482 version ".src.tar.gz"))
6485 "19jnkh57f979b78ak5mpxmdvnkgc33r55cw9shgd2hc380b3zi8k"))))
6486 (build-system gnu-build-system)
6489 (list (string-append "CC=" ,(cc-for-target)))
6490 #:tests? #f ; no tests
6491 #:phases (modify-phases %standard-phases
6492 (delete 'configure) ; no configure script
6493 (add-before 'install 'fix-makefile
6494 (lambda* (#:key outputs #:allow-other-keys)
6495 (substitute* "Makefile"
6496 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
6497 ;; Make the compressed manpages writable so that the
6498 ;; reset-gzip-timestamps phase does not error out.
6499 (substitute* "Makefile"
6500 (("-m 444") "-m 644"))
6502 (inputs `(("perl" ,perl)))
6503 (supported-systems '("i686-linux" "x86_64-linux"))
6504 (home-page "http://www.etallen.com/cpuid.html")
6505 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
6506 (description "cpuid dumps detailed information about the CPU(s) gathered
6507 from the CPUID instruction, and also determines the exact model of CPU(s). It
6508 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
6509 NexGen, Rise, and SiS CPUs.")
6510 (license license:gpl2+)))
6512 (define-public jmtpfs
6520 (url "https://github.com/JasonFerrara/jmtpfs")
6521 (commit (string-append "v" version))))
6522 (file-name (git-file-name name version))
6525 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
6526 (build-system gnu-build-system)
6530 ("libmtp" ,libmtp)))
6532 `(("pkg-config" ,pkg-config)))
6533 (home-page "https://github.com/JasonFerrara/jmtpfs")
6534 (synopsis "Use a FUSE file system to access data over MTP")
6535 (description "jmtpfs uses FUSE (file system in userspace) to provide access
6536 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
6537 the MTP device as a file system.")
6538 (license license:gpl3)))
6540 (define-public procenv
6548 (url "https://github.com/jamesodhunt/procenv")
6550 (file-name (git-file-name name version))
6552 (base32 "1ilrsw1rc85w29mkbkmm5n5w427gapv43yrjzvkb4kc9xhscgdjn"))))
6553 (build-system gnu-build-system)
6554 (arguments `(#:configure-flags '("--disable-silent-rules")))
6556 `(("pkg-config" ,pkg-config)
6564 ("libselinux" ,libselinux)))
6565 (synopsis "Utility to show process environment")
6566 (description "Procenv is a command-line tool that displays as much detail about
6567 itself and its environment as possible. It can be used as a test
6568 tool, to understand the type of environment a process runs in, and for
6569 comparing system environments.")
6570 (home-page "https://github.com/jamesodhunt/procenv/")
6571 (license license:gpl3+)))
6573 (define-public libfabric
6581 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
6582 version "/libfabric-" version ".tar.bz2"))
6584 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
6585 (build-system gnu-build-system)
6586 (inputs `(("rdma-core" ,rdma-core)
6587 ,@(match (%current-system)
6588 ((member (package-supported-systems psm))
6592 (home-page "https://ofiwg.github.io/libfabric/")
6593 (synopsis "Open Fabric Interfaces")
6595 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
6596 communication services to applications. OFI is best described as a collection
6597 of libraries and applications used to export fabric services. The key
6598 components of OFI are: application interfaces, provider libraries, kernel
6599 services, daemons, and test applications.
6601 Libfabric is a core component of OFI. It is the library that defines and
6602 exports the user-space API of OFI, and is typically the only software that
6603 applications deal with directly. It works in conjunction with provider
6604 libraries, which are often integrated directly into libfabric.")
6605 (license (list license:bsd-2 license:gpl2)))) ;dual
6610 (version "3.3.20170428")
6611 (home-page "https://github.com/intel/psm")
6615 (uri (git-reference (url home-page)
6616 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
6617 (file-name (string-append "psm-" version ".tar.gz"))
6619 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
6620 (patches (search-patches
6621 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
6622 "psm-ldflags.patch" ; build shared lib with LDFLAGS
6623 "psm-repro.patch" ; reproducibility
6624 "psm-disable-memory-stats.patch"))))
6625 (build-system gnu-build-system)
6626 (outputs '("out" "debug"))
6627 (inputs `(("libuuid" ,util-linux "lib")))
6629 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
6630 ,(string-append "INSTALL_PREFIX=" %output)
6631 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6633 #:phases (modify-phases %standard-phases
6635 (add-after 'unpack 'patch-/usr/include
6637 (substitute* "Makefile"
6638 (("\\$\\{DESTDIR}/usr/include")
6639 (string-append %output "/include")))
6640 (substitute* "Makefile"
6641 (("/lib64") "/lib"))
6643 (add-after 'unpack 'patch-sysmacros
6645 (substitute* "ipath/ipath_proto.c"
6646 (("#include <sys/poll.h>" m)
6647 (string-append m "\n"
6648 "#include <sys/sysmacros.h>")))
6650 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
6652 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
6653 communications interface for the True Scale family of products. PSM users are
6654 enabled with mechanisms necessary to implement higher level communications
6655 interfaces in parallel environments.")
6656 ;; Only Intel-compatable processors are supported.
6657 (supported-systems '("i686-linux" "x86_64-linux"))
6658 (license (list license:bsd-2 license:gpl2)))) ;dual
6660 (define-public snapscreenshot
6662 (name "snapscreenshot")
6663 (version "1.0.14.3")
6667 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
6668 name "-" version ".tar.bz2"))
6670 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
6671 (build-system gnu-build-system)
6674 (let ((out (assoc-ref %outputs "out")))
6675 (list (string-append "BINDIR=" out "/bin")
6676 (string-append "MANDIR=" out "/share/man")))
6677 #:tests? #f ; no test suite
6679 (modify-phases %standard-phases
6680 (delete 'configure) ; ./configure is a snarky no-op
6681 (add-before 'install 'fix-ownership
6682 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
6684 (substitute* "depfun.mak"
6685 ((" -o bin -g bin ") " "))
6687 (add-before 'install 'create-output-directories
6688 (lambda* (#:key outputs #:allow-other-keys)
6689 (let ((out (assoc-ref outputs "out")))
6690 (mkdir-p (string-append out "/share/man/man1"))
6692 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
6693 (synopsis "Take screenshots of one or more Linux text consoles")
6695 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
6696 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
6697 relevant @file{/dev/vcs*} file(s).")
6698 (license license:gpl2)))
6700 (define-public fbcat
6707 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
6708 version "/" name "-" version ".tar.gz"))
6710 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
6711 (build-system gnu-build-system)
6713 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
6714 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
6715 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
6716 `(("pnmtopng" ,netpbm)))
6717 (outputs (list "out" "fbgrab"))
6721 (string-append "PREFIX=" (assoc-ref %outputs "out")))
6722 #:tests? #f ; no tests
6724 (modify-phases %standard-phases
6725 (delete 'configure) ; no configure script
6726 (add-after 'build 'qualify-references
6727 (lambda* (#:key inputs outputs #:allow-other-keys)
6728 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
6729 (out (assoc-ref outputs "out")))
6730 (substitute* "fbgrab"
6732 (string-append out "/bin/" all))
6734 (string-append pnmtopng "/bin/" all)))
6736 (add-after 'install 'split-fbgrab-output
6737 (lambda* (#:key outputs #:allow-other-keys)
6738 (let* ((out (assoc-ref outputs "out"))
6739 (out:fbgrab (assoc-ref outputs "fbgrab")))
6740 (for-each (lambda (file)
6741 (let ((old (string-append out "/" file))
6742 (new (string-append out:fbgrab "/" file)))
6743 (mkdir-p (dirname new))
6744 (rename-file old new)))
6746 "share/man/man1/fbgrab.1"))
6748 (home-page "https://jwilk.net/software/fbcat")
6749 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
6751 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
6752 a dump therof. It supports a wide range of drivers and pixel formats.
6753 @command{fbcat} can take screenshots of virtually any application that can be
6754 made to write its output to the framebuffer, including (but not limited to)
6755 text-mode or graphical applications that don't use a display server.
6757 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
6758 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
6759 (license license:gpl2)))
6761 (define-public libcgroup
6769 "mirror://sourceforge/libcg/" name "/"
6770 version "/" name "-" version ".tar.bz2"))
6772 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
6773 (build-system gnu-build-system)
6780 `(("linux-pam" ,linux-pam)))
6781 (home-page "https://sourceforge.net/projects/libcg/")
6782 (synopsis "Control groups management tools")
6783 (description "Control groups is Linux kernel method for process resource
6784 restriction, permission handling and more. This package provides userspace
6785 interface to this kernel feature.")
6786 (license license:lgpl2.1)))
6788 (define-public mbpfan
6796 (url "https://github.com/dgraziotin/mbpfan")
6797 (commit (string-append "v" version))))
6798 (file-name (git-file-name name version))
6800 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
6801 (build-system gnu-build-system)
6803 `(#:tests? #f ; tests ask to be run as root
6804 #:make-flags (let ((out (assoc-ref %outputs "out")))
6805 (list (string-append "DESTDIR=" out)
6806 ,(string-append "CC=" (cc-for-target))))
6808 (modify-phases %standard-phases
6809 (add-after 'unpack 'patch-paths
6811 (substitute* "Makefile"
6814 (delete 'configure)))) ; there's no configure phase
6815 (home-page "https://github.com/dgraziotin/mbpfan")
6816 (synopsis "Control fan speed on Macbooks")
6818 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
6819 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
6820 module. It can be executed as a daemon or in the foreground with root
6822 (license license:gpl3+)))
6831 (url "https://github.com/intel/opa-psm2")
6832 (commit (string-append "PSM2_" version))))
6833 (file-name (git-file-name name version))
6836 "1hiqzcmc97lzhaqjva82vf8irgg038cciypsv2brw90ak09n6vwf"))))
6837 (build-system gnu-build-system)
6840 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6842 #:phases (modify-phases %standard-phases
6844 (add-after 'unpack 'patch-Makefiles
6846 (substitute* "Makefile"
6849 (substitute* "compat/Makefile"
6855 (setenv "DESTDIR" %output)
6856 (invoke "make" "install")
6859 `(("rdma-core" ,rdma-core)
6860 ("numactl" ,numactl)))
6861 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
6863 "This package is low-level user-level Intel's communications interface.
6864 The PSM2 API is a high-performance vendor-specific protocol that provides a
6865 low-level communications interface for the Intel Omni-Path family of
6866 high-speed networking devices.")
6867 (home-page "https://github.com/intel/opa-psm2")
6868 ;; Only the x86_64 architecure is supported.
6869 (supported-systems '("x86_64-linux"))
6870 (license (list license:bsd-3 license:gpl2)))) ; dual
6872 (define-public libpfm4
6878 (uri (string-append "mirror://sourceforge/perfmon2/"
6879 name "/libpfm-" version ".tar.gz"))
6882 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
6883 (build-system gnu-build-system)
6885 '(#:modules ((guix build utils)
6886 (guix build gnu-build-system))
6887 #:phases (modify-phases %standard-phases
6891 (lambda* (#:key inputs outputs #:allow-other-keys)
6892 (let* ((out (assoc-ref outputs "out")))
6897 (lambda* (#:key outputs #:allow-other-keys)
6898 (let* ((out (assoc-ref outputs "out")))
6900 (string-append "PREFIX=" out)
6903 (synopsis "Performance event monitoring library")
6905 "This package provides a library called libpfm4, which is used to develop
6906 monitoring tools exploiting the performance monitoring events such as those
6907 provided by the Performance Monitoring Unit (PMU) of modern processors.
6909 Libpfm4 helps convert from an event name, expressed as a string, to the event
6910 encoding that is either the raw event as documented by the hardware vendor or
6911 the OS-specific encoding. In the latter case, the library is able to prepare
6912 the OS-specific data structures needed by the kernel to setup the event.
6914 libpfm4 provides support for the @code{perf_events} interface, which was
6915 introduced in Linux 2.6.31.")
6916 (home-page "http://perfmon2.sourceforge.net/")
6917 (license license:expat)))
6919 (define-public libnfnetlink
6921 (name "libnfnetlink")
6926 "https://www.netfilter.org/projects/libnfnetlink/files/"
6927 "libnfnetlink-" version ".tar.bz2"))
6930 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
6931 (build-system gnu-build-system)
6932 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
6933 (synopsis "Low-level netfilter netlink communication library")
6935 "@code{libnfnetlink} is the low-level library for netfilter related
6936 kernel/userspace communication. It provides a generic messaging
6937 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
6938 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
6939 management tools in userspace.")
6940 (license license:gpl2)))
6942 (define-public go-netlink
6949 (url "https://github.com/vishvananda/netlink")
6950 (commit (string-append "v" version))))
6951 (file-name (git-file-name name version))
6954 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
6955 (build-system go-build-system)
6957 `(#:import-path "github.com/vishvananda/netlink"))
6959 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
6960 ("go-netns" ,go-netns)))
6961 (home-page "https://github.com/vishvananda/netlink")
6962 (synopsis "Simple netlink library for Go")
6963 (description "The netlink package provides a simple netlink library for
6964 Go. Netlink is the interface a user-space program in Linux uses to
6965 communicate with the kernel. It can be used to add and remove interfaces, set
6966 IP addresses and routes, and configure IPsec.")
6967 (license license:asl2.0)))
6969 (define-public xfsprogs
6976 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
6977 "xfsprogs-" version ".tar.gz"))
6980 "13xkn9jpmwp4fm9r68vhgznkmxhnv83n2b39mhy2qdaph90w2a1l"))))
6981 (build-system gnu-build-system)
6982 (outputs (list "out" "python"))
6984 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
6986 (modify-phases %standard-phases
6987 (add-after 'install 'separate-python-output
6988 (lambda* (#:key outputs #:allow-other-keys)
6989 (let ((out (assoc-ref outputs "out"))
6990 (python (assoc-ref outputs "python")))
6993 (mkdir-p (string-append python (dirname script)))
6994 (rename-file (string-append out script)
6995 (string-append python script)))
6996 (list "/sbin/xfs_scrub_all"))
6998 (add-after 'install 'install-headers
7000 (invoke "make" "install-dev"))))))
7002 `(("gettext" ,gettext-minimal)))
7004 `(("libuuid" ,util-linux "lib")
7005 ("python" ,python-wrapper)))
7006 (home-page "https://xfs.wiki.kernel.org/")
7007 (synopsis "XFS file system tools")
7008 (description "This package provides commands to create and check XFS
7010 ;; The library "libhandle" and the headers in "xfslibs-dev" are
7011 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
7012 (license (list license:gpl2 license:lgpl2.1))))
7014 (define-public genext2fs
7021 (url "https://github.com/jeremie-koenig/genext2fs")
7022 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
7023 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
7024 (file-name (git-file-name name version))
7026 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
7027 (build-system gnu-build-system)
7030 (modify-phases %standard-phases
7031 (add-after 'unpack 'apply-debian-patches
7032 ;; Debian changes (the revision after ‘-’ in VERSION) are
7033 ;; maintained as separate patches. Apply those relevant to us.
7037 (invoke "patch" "-p1" "-i"
7038 (string-append "debian/patches/" file-name)))
7039 (list "blocksize+creator.diff" ; add -B/-o options
7040 "byteswap_fix.diff"))
7043 `(("autoconf" ,autoconf)
7044 ("automake" ,automake)))
7045 (home-page "https://github.com/jeremie-koenig/genext2fs")
7046 (synopsis "Generate ext2 file system as a normal user")
7047 (description "This package provides a program to generate an ext2
7048 file system as a normal (non-root) user. It does not require you to mount
7049 the image file to copy files on it, nor does it require that you become
7050 the superuser to make device nodes.")
7051 (license license:gpl2)))
7053 (define-public fakeroot
7058 ;; There are no tags in the repository, so take this snapshot.
7060 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
7061 "fakeroot/fakeroot_" version ".orig.tar.gz"))
7062 (file-name (string-append name "-" version ".tar.gz"))
7065 "0v4m3v1bdqvblwj3vqsb3mllgbci6dsgsydq6765nzvz6n1kd44f"))))
7066 (build-system gnu-build-system)
7069 (modify-phases %standard-phases
7072 ;; The "preroll" script takes care of Autoconf and also
7073 ;; prepares the translated manuals.
7074 (invoke "sh" "./preroll")))
7075 (add-after 'configure 'patch-Makefile
7077 ;; Note: The root of the problem is already in "Makefile.am".
7078 (substitute* "Makefile"
7079 (("/bin/sh") (which "sh")))
7081 (add-after 'unpack 'patch-script
7082 (lambda* (#:key inputs #:allow-other-keys)
7083 (substitute* "scripts/fakeroot.in"
7085 (string-append (assoc-ref inputs "util-linux")
7088 (string-append (assoc-ref inputs "sed")
7091 (string-append (assoc-ref inputs "coreutils")
7094 (add-before 'configure 'setenv
7096 (setenv "LIBS" "-lacl")
7098 (add-before 'check 'prepare-check
7100 (setenv "SHELL" (which "bash"))
7101 (setenv "VERBOSE" "1")
7102 (substitute* "test/t.touchinstall"
7103 ;; We don't have the name of the root user, so use ID=0.
7104 (("grep root") "grep \"\\<0\\>\""))
7105 (substitute* "test/tartest"
7106 ;; We don't have the name of the root group, so use ID=0.
7107 (("ROOTGROUP=root") "ROOTGROUP=0")
7108 ;; We don't have the name of the daemon user, so use IDs.
7109 (("daemon:sys") "1:3")
7111 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
7112 (substitute* "test/compare-tar"
7113 (("tar -tvf") "tar --numeric-owner -tvf"))
7116 `(;; For bootstrapping the package.
7117 ("autoconf" ,autoconf)
7118 ("automake" ,automake)
7119 ("libtool" ,libtool)
7120 ("gettext" ,gettext-minimal)
7124 ("sharutils" ,sharutils)
7129 ("util-linux" ,util-linux)
7131 ("coreutils" ,coreutils)))
7132 (synopsis "Provides a fake root environment")
7133 (description "@command{fakeroot} runs a command in an environment where
7134 it appears to have root privileges for file manipulation. This is useful
7135 for allowing users to create archives (tar, ar, .deb etc.) with files in
7136 them with root permissions/ownership. Without fakeroot one would have to
7137 have root privileges to create the constituent files of the archives with
7138 the correct permissions and ownership, and then pack them up, or one would
7139 have to construct the archives directly, without using the archiver.")
7140 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
7141 (license license:gpl3+)))
7143 (define-public fakechroot
7150 "https://github.com/dex4er/fakechroot/releases/download/"
7151 version "/fakechroot-" version ".tar.gz"))
7154 "1aijkd0b45wav25v01qhw8zxwa3pl0nnp9fabmmy1nlx7hr09gas"))))
7155 (build-system gnu-build-system)
7157 ;; XXX: The tests heavily assume they run on an FHS system so for now
7160 #:configure-flags '("--disable-static")))
7161 (synopsis "Emulate @code{chroot} by overriding file system calls")
7163 "@command{fakechroot} runs a command in an environment were is additional
7164 possibility to use @code{chroot} command without root privileges. This is
7165 useful for allowing users to create own chrooted environment with possibility
7166 to install another packages without need for root privileges.
7168 It works by providing @file{libfakechroot.so}, a shared library meant to be
7169 set as @code{LD_PRELOAD} to override the C library file system functions.")
7170 (home-page "https://github.com/dex4er/fakechroot/")
7171 (license license:lgpl2.1+)))
7173 (define-public inputattach
7175 (name "inputattach")
7180 (url "https://github.com/linuxwacom/input-wacom")
7181 (commit (string-append "input-wacom-" version))))
7182 (file-name (git-file-name name version))
7184 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
7185 (build-system gnu-build-system)
7188 (modify-phases %standard-phases
7192 (lambda* (#:key inputs #:allow-other-keys)
7193 (with-directory-excursion "inputattach"
7194 (invoke (string-append (assoc-ref inputs "gcc")
7196 "-O2" "-o" "inputattach" "inputattach.c"))
7200 (lambda* (#:key outputs #:allow-other-keys)
7201 (let ((target-dir (string-append
7202 (assoc-ref outputs "out")
7204 (mkdir-p target-dir)
7205 (copy-file "inputattach/inputattach"
7206 (string-append target-dir
7209 (home-page "https://linuxwacom.github.io/")
7210 (synopsis "Dispatch input peripherals events to a device file")
7211 (description "inputattach dispatches input events from several device
7212 types and interfaces and translates so that the X server can use them.")
7213 (license license:gpl2+)))
7215 (define-public pipewire
7222 (url "https://github.com/PipeWire/pipewire")
7224 (file-name (git-file-name name version))
7227 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
7228 (build-system meson-build-system)
7230 '(#:configure-flags '("-Dsystemd=false")))
7232 `(("pkg-config" ,pkg-config)))
7234 `(("alsa-lib" ,alsa-lib)
7238 ("gstreamer" ,gstreamer)
7239 ("gst-plugins-base" ,gst-plugins-base)
7243 (home-page "https://pipewire.org/")
7244 (synopsis "Server and user space API to deal with multimedia pipelines")
7246 "PipeWire is a project that aims to greatly improve handling of audio and
7247 video under Linux. It aims to support the usecases currently handled by both
7248 PulseAudio and Jack and at the same time provide same level of powerful handling
7249 of Video input and output. It also introduces a security model that makes
7250 interacting with audio and video devices from containerized applications easy,
7251 with supporting Flatpak applications being the primary goal. Alongside Wayland
7252 and Flatpak we expect PipeWire to provide a core building block for the future
7253 of Linux application development.")
7254 (license license:lgpl2.0+)))
7256 (define-public pipewire-0.3
7264 (url "https://github.com/PipeWire/pipewire")
7266 (file-name (git-file-name name version))
7269 "19j5kmb7iaivkq2agfzncfm2qms41ckqi0ddxvhpc91ihwprdc5w"))))
7272 (list (string-append "-Dudevrulesdir=" (assoc-ref %outputs "out")
7273 "/lib/udev/rules.d")
7276 (modify-phases %standard-phases
7277 ;; Skip shrink-runpath, otherwise validate-runpath fails.
7278 (delete 'shrink-runpath))))
7280 (append (package-inputs pipewire)
7283 ("pulseaudio" ,pulseaudio)
7284 ("vulkan-loader" ,vulkan-loader)
7285 ("vulkan-headers" ,vulkan-headers))))))
7294 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
7296 (file-name (git-file-name name version))
7299 "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10"))))
7300 (build-system gnu-build-system)
7303 (modify-phases %standard-phases
7304 (add-after 'unpack 'fix-dbus-tests
7306 (substitute* '("unit/test-dbus-message-fds.c"
7307 "unit/test-dbus-properties.c"
7309 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
7314 `(("autoconf" ,autoconf)
7315 ("libtool" ,libtool)
7316 ("pkgconfig" ,pkg-config)
7317 ("automake" ,automake)))
7318 (home-page "https://01.org/ell")
7319 (synopsis "Embedded Linux Library")
7320 (description "The Embedded Linux* Library (ELL) provides core, low-level
7321 functionality for system daemons. It typically has no dependencies other than
7322 the Linux kernel, C standard library, and libdl (for dynamic linking). While
7323 ELL is designed to be efficient and compact enough for use on embedded Linux
7324 platforms, it is not limited to resource-constrained systems.")
7325 (license license:lgpl2.1+)))
7327 (define-public lttng-ust
7333 (uri (string-append "https://lttng.org/files/lttng-ust/"
7334 "lttng-ust-" version ".tar.bz2"))
7337 "1n646yz7882svf5a4ay3vqiiz3qjn3pgkkij9kk22871wp7q0ck8"))))
7338 (build-system gnu-build-system)
7340 `(("liburcu" ,liburcu)
7341 ("numactl" ,numactl)))
7343 `(("python" ,python-3)))
7344 (home-page "https://lttng.org/")
7345 (synopsis "LTTng userspace tracer libraries")
7346 (description "The user space tracing library, liblttng-ust, is the LTTng
7347 user space tracer. It receives commands from a session daemon, for example to
7348 enable and disable specific instrumentation points, and writes event records
7349 to ring buffers shared with a consumer daemon.")
7350 (license license:lgpl2.1+)))
7352 (define-public kexec-tools
7354 (name "kexec-tools")
7358 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
7359 "/kexec/kexec-tools-" version ".tar.xz"))
7362 "1j7qlhxk1rbv9jbj8wd6hb7zl8p2mp29ymrmccgmsi0m0dzhgn6s"))))
7363 (build-system gnu-build-system)
7365 ;; There are no automated tests.
7367 (home-page "https://projects.horms.net/projects/kexec/")
7368 (synopsis "Tools for booting directly into different kernels")
7369 (description "This package provides the @code{kexec} program and ancillary
7370 utilities. Using @code{kexec}, it is possible to boot directly into a new
7371 kernel from the context of an already-running kernel, bypassing the normal
7372 system boot process.")
7373 (license license:gpl2)))
7375 (define-public cachefilesd
7377 (name "cachefilesd")
7382 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
7383 "/cachefilesd.git/snapshot/cachefilesd-"
7387 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
7388 (build-system gnu-build-system)
7391 `(#:tests? #f ; there are no tests
7393 (let ((prefix-dir (lambda (var dir)
7394 (string-append var "=" %output "/" dir))))
7395 (list (string-append "CC=" ,(cc-for-target))
7396 (prefix-dir "SBINDIR" "sbin/")
7397 (prefix-dir "ETCDIR" "etc/")
7398 (prefix-dir "MANDIR" "share/man/")))
7399 #:phases (modify-phases %standard-phases (delete 'configure))))
7400 (home-page "https://people.redhat.com/~dhowells/cachefs/")
7401 (synopsis "CacheFiles userspace management daemon")
7402 (description "@code{cachefilesd} is a userspace daemon that manages the
7403 cache data store that is used by network file systems such as @code{AFS} and
7404 @code{NFS} to cache data locally on disk. The content of the cache is
7405 persistent over reboots.")
7406 (license license:gpl2+)))
7408 (define-public libbpf
7416 (url "https://github.com/libbpf/libbpf")
7417 (commit (string-append "v" version))))
7418 (file-name (git-file-name name version))
7421 "18l0gff7nm841mwhr7bc7x863xcyvwh58zl7mc0amnsjqlbrvqg7"))))
7422 (build-system gnu-build-system)
7424 `(("pkg-config" ,pkg-config)))
7426 ;; In Requires.private of libbpf.pc.
7427 `(("libelf" ,libelf)
7430 `(#:tests? #f ; no tests
7433 (string-append "PREFIX=" (assoc-ref %outputs "out"))
7434 (string-append "LIBDIR=$(PREFIX)/lib")
7436 "CC=" (assoc-ref %build-inputs "gcc") "/bin/gcc"))
7438 (modify-phases %standard-phases
7440 (add-before 'build 'pre-build
7441 (lambda* (#:key inputs #:allow-other-keys)
7442 (substitute* "scripts/check-reallocarray.sh"
7444 (string-append (assoc-ref inputs "coreutils") rm)))
7447 (home-page "https://github.com/libbpf/libbpf")
7448 (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
7450 "Libbpf supports building BPF CO-RE-enabled applications, which, in
7451 contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
7453 (license `(,license:lgpl2.1 ,license:bsd-2))))
7463 (url "https://github.com/iovisor/bcc")
7464 (commit (string-append "v" version))))
7465 (file-name (git-file-name name version))
7468 "1d5j9zanffa1c7lpi5fcrdlx1n7hy86xl82fam2xqr0s41q4ipxw"))))
7469 (build-system cmake-build-system)
7474 `(("clang-toolchain" ,clang-toolchain)
7475 ("libbpf" ,(package-source libbpf))
7476 ;; LibElf required but libelf does not contain
7477 ;; archives, only object files.
7478 ;; https://github.com/iovisor/bcc/issues/504
7479 ("elfutils" ,elfutils)
7480 ("linux-libre-headers" ,linux-libre-headers)
7482 ("python-wrapper" ,python-wrapper)))
7484 `(;; Tests all require root permissions and a "standard" file hierarchy.
7487 (let ((revision ,version))
7488 `(,(string-append "-DREVISION=" revision)))
7490 (modify-phases %standard-phases
7491 ;; FIXME: Use "-DCMAKE_USE_LIBBPF_PACKAGE=ON".
7492 (add-after 'unpack 'copy-libbpf
7493 (lambda* (#:key inputs #:allow-other-keys)
7494 (delete-file-recursively "src/cc/libbpf")
7496 (assoc-ref inputs "libbpf") "src/cc/libbpf")))
7497 (add-after 'copy-libbpf 'substitute-libbc
7498 (lambda* (#:key outputs #:allow-other-keys)
7499 (substitute* "src/python/bcc/libbcc.py"
7500 (("(libbcc\\.so.*)\\b" _ libbcc)
7502 (assoc-ref outputs "out") "/lib/" libbcc)))))
7503 (add-after 'install 'wrap-tools
7504 (lambda* (#:key outputs #:allow-other-keys)
7505 (use-modules (ice-9 textual-ports))
7506 (let* ((out (assoc-ref outputs "out"))
7507 (lib (string-append out "/lib"))
7508 (tools (string-append out "/share/bcc/tools"))
7510 (lambda (filename _)
7511 (call-with-input-file filename
7513 (string-contains (get-line port)
7516 (lambda (python-executable)
7517 (format #t "Wrapping: ~A.~%" python-executable)
7518 (wrap-program python-executable
7519 `("PYTHONPATH" ":" prefix
7520 (,(string-append lib
7522 ,(version-major+minor
7523 (package-version python))
7524 "/site-packages")))))
7525 (find-files tools python-executable?))
7527 (home-page "https://github.com/iovisor/bcc")
7528 (synopsis "Tools for BPF on Linux")
7530 "BCC is a toolkit for creating efficient kernel tracing and manipulation
7531 programs, and includes several useful tools and examples. It makes use of
7532 extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
7533 that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
7535 (license license:asl2.0)))
7537 (define-public bpftrace
7545 (url "https://github.com/iovisor/bpftrace")
7546 (commit (string-append "v" version))))
7547 (file-name (git-file-name name version))
7549 (base32 "0y4qgm2cpccrsm20rnh92hqplddqsc5q5zhw9nqn2igm3h9i0z7h"))
7550 (patches (search-patches "bpftrace-disable-bfd-disasm.patch"))))
7551 (build-system cmake-build-system)
7557 ("clang-toolchain" ,clang-toolchain)
7558 ("elfutils" ,elfutils)
7560 ("linux-libre-headers" ,linux-libre-headers)))
7562 `(#:tests? #f ;Tests require googletest sources.
7564 '("-DBUILD_TESTING=OFF"
7565 ;; FIXME: libbfd misses some link dependencies, when fixed, remove
7566 ;; the associated patch.
7567 "-DHAVE_BFD_DISASM=OFF")))
7568 (home-page "https://github.com/iovisor/bpftrace")
7569 (synopsis "High-level tracing language for Linux eBPF")
7571 "bpftrace is a high-level tracing language for Linux enhanced Berkeley
7572 Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses
7573 LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for
7574 interacting with the Linux BPF system, as well as existing Linux tracing
7575 capabilities: kernel dynamic tracing (kprobes), user-level dynamic
7576 tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk
7577 and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was
7578 created by Alastair Robertson.")
7579 (license license:asl2.0)))
7581 (define-public ttyebus-linux-module
7582 (let ((revision "0")
7583 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))
7585 (name "ttyebus-linux-module")
7586 (version (git-version "1.5" revision commit))
7591 (url "https://github.com/eBUS/ttyebus")
7592 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")))
7593 (file-name (git-file-name name version))
7596 "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani"))))
7597 (supported-systems '("armhf-linux" "aarch64-linux"))
7598 (build-system linux-module-build-system)
7601 (home-page "https://github.com/eBUS/ttyebus")
7602 (synopsis "Low-latency Raspberry Pi UART driver")
7603 (description "This package provides a Linux kernel module that will
7604 provide a serial device @code{/dev/ttyebus} with almost no latency upon
7605 receiving. It is dedicated to the PL011 UART of the Raspberry Pi.")
7606 (license license:gpl3+))))
7608 (define-public ipset
7614 (uri (string-append "https://ipset.netfilter.org/ipset-" version ".tar.bz2"))
7617 "02mkp7vmsh609dcp02xi290sxmsgq2fsch3875dxkwfxkrl16p5p"))))
7618 (build-system gnu-build-system)
7620 `(("libmnl" ,libmnl)))
7622 `(("pkg-config" ,pkg-config)))
7624 `(#:configure-flags '("--with-kmod=no")))
7625 (home-page "https://ipset.netfilter.org/")
7626 (synopsis "Administration tool for IP sets")
7627 (description "IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel which
7628 can be administered by the ipset utility. Depending on the type,
7629 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
7630 IP addresses with MAC addresses in a way which ensures lightning speed
7631 when matching an entry against a set.
7635 @item store multiple IP addresses or port numbers and match against the entire
7636 collection using a single iptables rule.
7637 @item dynamically update iptables rules against IP addresses or ports without
7638 performance penalty.
7639 @item express complex IP address and ports based rulesets with a single
7640 iptables rule and benefit from the speed of IP sets.
7642 then IP sets may be the proper tool for you.")
7643 (license license:gpl2+)))
7645 (define-public liburing
7652 (url "https://git.kernel.dk/liburing")
7653 (commit (string-append "liburing-" version))))
7654 (file-name (git-file-name name version))
7657 "15z44l7y4c6s6dlf7v8lq4znlsjbja2r4ifbni0l8cdcnq0w3zh3"))))
7658 (build-system gnu-build-system)
7660 `(;; Tests are dependent on kernel version and features
7663 (modify-phases %standard-phases
7665 ;; configure fails if it is followed by SHELL, CONFIG_SHELL,
7666 ;; --enable-fast-install, and --build
7667 (lambda* (#:key outputs #:allow-other-keys)
7668 (let ((out (assoc-ref outputs "out")))
7669 (setenv "SHELL" (which "sh"))
7670 (setenv "CONFIG_SHELL" (which "sh"))
7671 (invoke "./configure" (string-append "--prefix=" out))))))))
7672 (home-page "https://github.com/axboe/liburing")
7673 (synopsis "Interface to the Linux kernel @code{io_uring} interface")
7674 (description "This is the io_uring library, liburing. liburing provides
7675 helpers to setup and teardown io_uring instances, and also a simplified
7676 interface for applications that don't need (or want) to deal with the full
7677 kernel side implementation.")
7678 (license license:expat)))