1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012-2021, 2021-2022 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, 2022 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016 Christine Lemmer-Webber <cwebber@dustycloud.org>
10 ;;; Copyright © 2016–2022 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-2022 Nicolas Goaziou <mail@nicolasgoaziou.fr>
15 ;;; Copyright © 2016, 2018, 2019, 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
16 ;;; Copyright © 2016 David Craven <david@craven.ch>
17 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
18 ;;; Copyright © 2016-2022 Marius Bakke <marius@gnu.org>
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, 2021, 2022 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, 2021 Mathieu Othacehe <othacehe@gnu.org>
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, 2019 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, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
37 ;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com>
38 ;;; Copyright © 2019, 2020, 2021 Brice Waegeneire <brice@waegenei.re>
39 ;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
40 ;;; Copyright © 2020, 2021 Oleg Pykhalov <go.wigust@gmail.com>
41 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
42 ;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
43 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
44 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
45 ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
46 ;;; Copyright © 2020 John Soo <jsoo1@asu.edu>
47 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
48 ;;; Copyright © 2020 Anders Thuné <asse.97@gmail.com>
49 ;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
50 ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
51 ;;; Copyright © 2020 David Dashyan <mail@davie.li>
52 ;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net>
53 ;;; Copyright © 2021 Solene Rapenne <solene@perso.pw>
54 ;;; Copyright © 2021 B. Wilson <elaexuotee@wilsonb.com>
55 ;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
56 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
57 ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
58 ;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
59 ;;; Copyright © 2021 Felix Gruber <felgru@posteo.net>
60 ;;; Copyright © 2021 Josselin Poiret <josselin.poiret@protonmail.ch>
61 ;;; Copyright © 2021 Olivier Dion <olivier.dion@polymtl.ca>
62 ;;; Copyright © 2021 Solene Rapenne <solene@perso.pw>
63 ;;; Copyright © 2021, 2022 Petr Hodina <phodina@protonmail.com>
64 ;;; Copyright © 2022 Artyom V. Poptsov <poptsov.artyom@gmail.com>
65 ;;; Copyright © 2022 Rene Saavedra <nanuui@protonmail.com>
66 ;;; Copyright © 2022 muradm <mail@muradm.net>
69 ;;; This file is part of GNU Guix.
71 ;;; GNU Guix is free software; you can redistribute it and/or modify it
72 ;;; under the terms of the GNU General Public License as published by
73 ;;; the Free Software Foundation; either version 3 of the License, or (at
74 ;;; your option) any later version.
76 ;;; GNU Guix is distributed in the hope that it will be useful, but
77 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
78 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
79 ;;; GNU General Public License for more details.
81 ;;; You should have received a copy of the GNU General Public License
82 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
84 (define-module (gnu packages linux)
85 #:use-module (gnu packages)
86 #:use-module (gnu packages acl)
87 #:use-module (gnu packages admin)
88 #:use-module (gnu packages algebra)
89 #:use-module (gnu packages audio)
90 #:use-module (gnu packages autotools)
91 #:use-module (gnu packages avahi)
92 #:use-module (gnu packages backup)
93 #:use-module (gnu packages base)
94 #:use-module (gnu packages bash)
95 #:use-module (gnu packages bison)
96 #:use-module (gnu packages boost)
97 #:use-module (gnu packages calendar)
98 #:use-module (gnu packages check)
99 #:use-module (gnu packages cpio)
100 #:use-module (gnu packages crypto)
101 #:use-module (gnu packages cryptsetup)
102 #:use-module (gnu packages compression)
103 #:use-module (gnu packages databases)
104 #:use-module (gnu packages datastructures)
105 #:use-module (gnu packages dbm)
106 #:use-module (gnu packages docbook)
107 #:use-module (gnu packages documentation)
108 #:use-module (gnu packages elf)
109 #:use-module (gnu packages flex)
110 #:use-module (gnu packages file)
111 #:use-module (gnu packages freedesktop)
112 #:use-module (gnu packages gawk)
113 #:use-module (gnu packages gcc)
114 #:use-module (gnu packages gettext)
115 #:use-module (gnu packages glib)
116 #:use-module (gnu packages gnome)
117 #:use-module (gnu packages gnupg)
118 #:use-module (gnu packages golang)
119 #:use-module (gnu packages gperf)
120 #:use-module (gnu packages gstreamer)
121 #:use-module (gnu packages gtk)
122 #:use-module (gnu packages haskell-apps)
123 #:use-module (gnu packages haskell-xyz)
124 #:use-module (gnu packages libunwind)
125 #:use-module (gnu packages libusb)
126 #:use-module (gnu packages llvm)
127 #:use-module (gnu packages lua)
128 #:use-module (gnu packages man)
129 #:use-module (gnu packages maths)
130 #:use-module (gnu packages multiprecision)
131 #:use-module (gnu packages ncurses)
132 #:use-module (gnu packages netpbm)
133 #:use-module (gnu packages networking)
134 #:use-module (gnu packages ninja)
135 #:use-module (gnu packages nss)
136 #:use-module (gnu packages onc-rpc)
137 #:use-module (gnu packages perl)
138 #:use-module (gnu packages pciutils)
139 #:use-module (gnu packages pkg-config)
140 #:use-module (gnu packages popt)
141 #:use-module (gnu packages pulseaudio)
142 #:use-module (gnu packages python)
143 #:use-module (gnu packages python-xyz)
144 #:use-module (gnu packages readline)
145 #:use-module (gnu packages rrdtool)
146 #:use-module (gnu packages samba)
147 #:use-module (gnu packages sdl)
148 #:use-module (gnu packages serialization)
149 #:use-module (gnu packages slang)
150 #:use-module (gnu packages sqlite)
151 #:use-module (gnu packages texinfo)
152 #:use-module (gnu packages textutils)
153 #:use-module (gnu packages tls)
154 #:use-module (gnu packages valgrind)
155 #:use-module (gnu packages video)
156 #:use-module (gnu packages vulkan)
157 #:use-module (gnu packages web)
158 #:use-module (gnu packages xiph)
159 #:use-module (gnu packages xml)
160 #:use-module (gnu packages xdisorg)
161 #:use-module (gnu packages xorg)
162 #:use-module (gnu packages groff)
163 #:use-module (gnu packages selinux)
164 #:use-module (gnu packages sphinx)
165 #:use-module (gnu packages swig)
166 #:use-module (guix platform)
167 #:use-module (guix build-system cmake)
168 #:use-module (guix build-system copy)
169 #:use-module (guix build-system gnu)
170 #:use-module (guix build-system go)
171 #:use-module (guix build-system meson)
172 #:use-module (guix build-system python)
173 #:use-module (guix build-system trivial)
174 #:use-module (guix build-system linux-module)
175 #:use-module (guix download)
176 #:use-module (guix git-download)
177 #:use-module ((guix licenses) #:prefix license:)
178 #:use-module (guix packages)
179 #:use-module (guix gexp)
180 #:use-module (guix store)
181 #:use-module (guix monads)
182 #:use-module (guix utils)
183 #:use-module (guix deprecation) ;for libcap/next
184 #:use-module (srfi srfi-1)
185 #:use-module (srfi srfi-2)
186 #:use-module (srfi srfi-26)
187 #:use-module (ice-9 match)
188 #:use-module (ice-9 regex))
190 (define-public (system->defconfig system)
191 "Some systems (notably powerpc-linux) require a special target for kernel
192 defconfig. Return the appropriate make target if applicable, otherwise return
194 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
195 ((string-prefix? "powerpc64-" system) "ppc64_defconfig")
196 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
201 ;;; Kernel source code deblobbing.
204 (define (linux-libre-deblob-scripts version gnu-revision
207 (list (version-major+minor version)
210 (uri (string-append "https://linux-libre.fsfla.org"
211 "/pub/linux-libre/releases/" version "-" gnu-revision "/"
212 "deblob-" (version-major+minor version)))
213 (file-name (string-append "linux-libre-deblob-"
214 version "-" gnu-revision))
215 (sha256 deblob-hash))
218 (uri (string-append "https://linux-libre.fsfla.org"
219 "/pub/linux-libre/releases/" version "-" gnu-revision "/"
221 (file-name (string-append "linux-libre-deblob-check-" version "-" gnu-revision))
222 (sha256 deblob-check-hash))))
224 ;; XXXX: Workaround 'snippet' limitations
225 (define computed-origin-method (@@ (guix packages) computed-origin-method))
227 (define (make-linux-libre-source version
230 "Return a 'computed' origin that generates a Linux-libre tarball from the
231 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
232 (match deblob-scripts
233 ((deblob-version (? origin? deblob) (? origin? deblob-check))
234 (unless (string=? deblob-version (version-major+minor version))
235 ;; The deblob script cannot be expected to work properly on a
236 ;; different version (major+minor) of Linux, even if no errors
237 ;; are signaled during execution.
238 (error "deblob major+minor version mismatch"))
240 (method computed-origin-method)
241 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
245 (with-imported-modules '((guix build utils))
247 (use-modules (guix build utils)
252 (setvbuf (current-output-port) 'line)
254 (let ((dir (string-append "linux-" #$version)))
257 (set-path-environment-variable
260 #+(canonical-package bash)
261 #+(canonical-package coreutils)
262 #+(canonical-package diffutils)
263 #+(canonical-package findutils)
264 #+(canonical-package patch)
265 #+(canonical-package xz)
266 #+(canonical-package sed)
267 #+(canonical-package grep)
268 #+(canonical-package bzip2)
269 #+(canonical-package gzip)
270 #+(canonical-package tar)
271 #+(canonical-package gawk)
274 (with-directory-excursion "/tmp/bin"
276 (copy-file #+deblob "deblob")
277 (chmod "deblob" #o755)
278 (substitute* "deblob"
279 (("/bin/sh") (which "sh")))
281 (copy-file #+deblob-check "deblob-check")
282 (chmod "deblob-check" #o755)
283 (substitute* "deblob-check"
284 (("/bin/sh") (which "sh"))
285 (("/bin/sed") (which "sed"))
286 (("/usr/bin/python") (which "python"))))
288 (if (file-is-directory? #+upstream-source)
290 (format #t "Copying upstream linux source...~%")
291 (invoke "cp" "--archive" #+upstream-source dir)
292 (invoke "chmod" "--recursive" "u+w" dir))
294 (format #t "Unpacking upstream linux tarball...~%")
295 (invoke "tar" "xf" #$upstream-source)
298 (and (not (member name '("." "..")))
299 (file-is-directory? name))))
301 (unless (string=? dir unpacked-dir)
302 (rename-file unpacked-dir dir)))
304 (error "multiple directories found" dirs)))))
306 (with-directory-excursion dir
307 (format #t "Running deblob script...~%")
308 (invoke "/tmp/bin/deblob"))
310 (format #t "~%Packing new Linux-libre tarball...~%")
311 (invoke "tar" "cvfa" #$output
312 ;; Avoid non-determinism in the archive.
320 (format #t "~%Scanning the generated tarball for blobs...~%")
321 (invoke "/tmp/bin/deblob-check" "--use-awk" "--list-blobs"
329 (define (linux-libre-urls version gnu-revision)
330 "Return a list of URLs for Linux-Libre VERSION."
332 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
333 version "-" gnu-revision "/linux-libre-" version "-" gnu-revision ".tar.xz")
335 ;; XXX: Work around <http://bugs.gnu.org/14851>.
337 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
338 version "-" gnu-revision ".tar.xz")
340 ;; Maybe this URL will become valid eventually.
342 "mirror://gnu/linux-libre/" version "-" gnu-revision "/linux-libre-"
343 version "-" gnu-revision ".tar.xz")))
345 (define (%upstream-linux-source version hash)
348 (uri (string-append "mirror://kernel.org"
349 "/linux/kernel/v" (version-major version) ".x/"
350 "linux-" version ".tar.xz"))
353 ;; The current "stable" kernels. That is, the most recently released major
354 ;; versions that are still supported upstream.
356 (define-public linux-libre-5.19-version "5.19.5")
357 (define-public linux-libre-5.19-gnu-revision "gnu")
358 (define deblob-scripts-5.19
359 (linux-libre-deblob-scripts
360 linux-libre-5.19-version
361 linux-libre-5.19-gnu-revision
362 (base32 "0a4pln89nbxiniykm14kyqmnn79gfgj22dr3h94w917xhidq7gp1")
363 (base32 "1ph67fvg5qvlkh4cynrrmvkngkb0sw6k90b1mwy9466s24khn05i")))
364 (define-public linux-libre-5.19-pristine-source
365 (let ((version linux-libre-5.19-version)
366 (hash (base32 "1g9p4m9w9y0y1gk6vzqvsxzwqspbm10mmhd8n1mhal1yz721qgwc")))
367 (make-linux-libre-source version
368 (%upstream-linux-source version hash)
369 deblob-scripts-5.19)))
372 (define-public linux-libre-5.18-version "5.18.19")
373 (define-public linux-libre-5.18-gnu-revision "gnu")
374 (define deblob-scripts-5.18
375 (linux-libre-deblob-scripts
376 linux-libre-5.18-version
377 linux-libre-5.18-gnu-revision
378 (base32 "09aikdhij4d89wqd8mmkdr0nrfwqz6dx3n74qm6wx815rfngd2dz")
379 (base32 "03w1p49rf7sqsxvwpdndqa0k9hc9748rplyqiiw1q6cbdjficwyw")))
380 (define-public linux-libre-5.18-pristine-source
381 (let ((version linux-libre-5.18-version)
382 (hash (base32 "1mc8zhiw0v7fka64mydpdrxkrvy0jyqggq5lghw3pyqj2wjrpw6z")))
383 (make-linux-libre-source version
384 (%upstream-linux-source version hash)
385 deblob-scripts-5.18)))
387 ;; The "longterm" kernels — the older releases with long-term upstream support.
388 ;; Here are the support timelines:
389 ;; <https://www.kernel.org/category/releases.html>
390 (define-public linux-libre-5.15-version "5.15.63")
391 (define-public linux-libre-5.15-gnu-revision "gnu")
392 (define deblob-scripts-5.15
393 (linux-libre-deblob-scripts
394 linux-libre-5.15-version
395 linux-libre-5.15-gnu-revision
396 (base32 "1n57mz5agvf1d0ggbg080d7hvx8p9y0iqxkq4ypg10a7n96zy7y5")
397 (base32 "1r189c704jvizk452zcsm9v3g27ybjcjchjwxazsy3nx0wdwx7si")))
398 (define-public linux-libre-5.15-pristine-source
399 (let ((version linux-libre-5.15-version)
400 (hash (base32 "0hbkxgadz0vcslni4r46yc202wcnxblcfvkcph1017b2b8gcvlvd")))
401 (make-linux-libre-source version
402 (%upstream-linux-source version hash)
403 deblob-scripts-5.15)))
405 (define-public linux-libre-5.10-version "5.10.139")
406 (define-public linux-libre-5.10-gnu-revision "gnu1")
407 (define deblob-scripts-5.10
408 (linux-libre-deblob-scripts
409 linux-libre-5.10-version
410 linux-libre-5.10-gnu-revision
411 (base32 "0mw7qn77y9c6wrnw4rjvf75cpm1w6n1aqqhf8cnghcb97p2yxxrf")
412 (base32 "1981axxswghza3iadp94q54y8w30h9w9vyq4cbjiiv9alvbv0pb8")))
413 (define-public linux-libre-5.10-pristine-source
414 (let ((version linux-libre-5.10-version)
415 (hash (base32 "1wdyk1w8lr5l4d038bd44rdndxjvfcva2n51h2i38jd4fp12l00w")))
416 (make-linux-libre-source version
417 (%upstream-linux-source version hash)
418 deblob-scripts-5.10)))
420 (define-public linux-libre-5.4-version "5.4.211")
421 (define-public linux-libre-5.4-gnu-revision "gnu1")
422 (define deblob-scripts-5.4
423 (linux-libre-deblob-scripts
424 linux-libre-5.4-version
425 linux-libre-5.4-gnu-revision
426 (base32 "1nlgk8ajb5wl3aa96h9a0pb9j5a5wmrbpk63varn557x1d00r7wj")
427 (base32 "1vnjbdyssa7dwyjl9kg35alwvf7yh597cl74yr1wy2gk5bc9paw6")))
428 (define-public linux-libre-5.4-pristine-source
429 (let ((version linux-libre-5.4-version)
430 (hash (base32 "1v1dgsk66fi6x6v9k6hg9ik3f3b3pv7a3gk8mybmgm9cnx0k5d5z")))
431 (make-linux-libre-source version
432 (%upstream-linux-source version hash)
433 deblob-scripts-5.4)))
435 (define-public linux-libre-4.19-version "4.19.256")
436 (define-public linux-libre-4.19-gnu-revision "gnu1")
437 (define deblob-scripts-4.19
438 (linux-libre-deblob-scripts
439 linux-libre-4.19-version
440 linux-libre-4.19-gnu-revision
441 (base32 "06pqv050bkii0hc2v7ymny5264w1bca8db0dp1pw9mfmjg865am5")
442 (base32 "00i91lx938nqlgy63hiricqd0fnbbf26vgya9c5lb7m1f4x324im")))
443 (define-public linux-libre-4.19-pristine-source
444 (let ((version linux-libre-4.19-version)
445 (hash (base32 "0jgm7ydha9achbcq3a6q85wq1nz4qg7phx122jzk0mqb1339bpk7")))
446 (make-linux-libre-source version
447 (%upstream-linux-source version hash)
448 deblob-scripts-4.19)))
450 (define-public linux-libre-4.14-version "4.14.291")
451 (define-public linux-libre-4.14-gnu-revision "gnu1")
452 (define deblob-scripts-4.14
453 (linux-libre-deblob-scripts
454 linux-libre-4.14-version
455 linux-libre-4.14-gnu-revision
456 (base32 "02rxvr0gmxb3zfsyyzdmzgfq04gkdkv1cc38md0xfl0mxzdzdfyk")
457 (base32 "00i91lx938nqlgy63hiricqd0fnbbf26vgya9c5lb7m1f4x324im")))
458 (define-public linux-libre-4.14-pristine-source
459 (let ((version linux-libre-4.14-version)
460 (hash (base32 "15h76l81zn733g8dc6gsymf52nz325plhminv3m4x3klwhav34zc")))
461 (make-linux-libre-source version
462 (%upstream-linux-source version hash)
463 deblob-scripts-4.14)))
465 (define-public linux-libre-4.9-version "4.9.326")
466 (define-public linux-libre-4.9-gnu-revision "gnu1")
467 (define deblob-scripts-4.9
468 (linux-libre-deblob-scripts
469 linux-libre-4.9-version
470 linux-libre-4.9-gnu-revision
471 (base32 "0nai5m4rbh37qaj1xf2qj7656l2gacfh0847q5d07y22b048fq5n")
472 (base32 "0bib3641dbcqdkx3anna3caxnsg3nw9cnmhcklq0s93g3m57041h")))
473 (define-public linux-libre-4.9-pristine-source
474 (let ((version linux-libre-4.9-version)
475 (hash (base32 "0yw83a8nk5abjsvqrz8m2sj699c228j2f2wr5q8m95vgqzfw5wrb")))
476 (make-linux-libre-source version
477 (%upstream-linux-source version hash)
478 deblob-scripts-4.9)))
480 (define %boot-logo-patch
481 ;; Linux-Libre boot logo featuring Freedo and a gnu.
484 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
485 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
488 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
490 (define %linux-libre-arm-export-__sync_icache_dcache-patch
494 "https://salsa.debian.org/kernel-team/linux"
495 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
496 "/debian/patches/bugfix/arm/"
497 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
498 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
500 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
502 (define (source-with-patches source patches)
505 (patches (append (origin-patches source)
508 (define-public linux-libre-5.19-source
509 (source-with-patches linux-libre-5.19-pristine-source
510 (list %boot-logo-patch
511 %linux-libre-arm-export-__sync_icache_dcache-patch)))
513 (define-public linux-libre-5.18-source
514 (source-with-patches linux-libre-5.18-pristine-source
515 (list %boot-logo-patch
516 %linux-libre-arm-export-__sync_icache_dcache-patch)))
518 (define-public linux-libre-5.15-source
519 (source-with-patches linux-libre-5.15-pristine-source
520 (list %boot-logo-patch
521 %linux-libre-arm-export-__sync_icache_dcache-patch)))
523 (define-public linux-libre-5.10-source
524 (source-with-patches linux-libre-5.10-pristine-source
525 (list %boot-logo-patch
526 %linux-libre-arm-export-__sync_icache_dcache-patch)))
528 (define-public linux-libre-5.4-source
529 (source-with-patches linux-libre-5.4-pristine-source
530 (list %boot-logo-patch
531 %linux-libre-arm-export-__sync_icache_dcache-patch
532 ;; Pinebook Pro patch from linux-next,
533 ;; can be dropped for linux-libre 5.7
535 "linux-libre-support-for-Pinebook-Pro.patch"))))
537 (define-public linux-libre-4.19-source
538 (source-with-patches linux-libre-4.19-pristine-source
539 (list %boot-logo-patch
540 %linux-libre-arm-export-__sync_icache_dcache-patch)))
542 (define-public linux-libre-4.14-source
543 (source-with-patches linux-libre-4.14-pristine-source
544 (list %boot-logo-patch)))
546 (define-public linux-libre-4.9-source
547 (source-with-patches linux-libre-4.9-pristine-source
548 (list %boot-logo-patch)))
555 (define (make-linux-libre-headers version gnu-revision hash-string)
556 (make-linux-libre-headers* version gnu-revision
559 (uri (linux-libre-urls version gnu-revision))
560 (sha256 (base32 hash-string)))))
562 (define (make-linux-libre-headers* version gnu-revision source)
564 (name "linux-libre-headers")
567 (build-system gnu-build-system)
568 (native-inputs `(("perl" ,perl)
569 ,@(if (version>=? version "4.16")
574 `(#:modules ((guix build gnu-build-system)
579 (modify-phases %standard-phases
583 (let ((arch ,(platform-linux-architecture
584 (lookup-platform-by-target-or-system
585 (or (%current-target-system)
586 (%current-system)))))
587 (defconfig ,(system->defconfig
588 (or (%current-target-system)
590 (make-target ,(if (version>=? version "5.3")
594 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
595 (invoke "make" defconfig)
596 (invoke "make" "mrproper" make-target))))
598 (lambda* (#:key outputs #:allow-other-keys)
599 (let ((out (assoc-ref outputs "out")))
601 ;; Mimic the quiet_cmd_headers_install target to avoid a
602 ;; dependency on rsync.
603 (for-each (lambda (file)
604 (let ((destination (string-append
606 ;; Drop the 'usr/include' prefix.
607 (match (string-split file #\/)
609 (string-join path "/"))))))
610 (format #t "`~a' -> `~a'~%" file destination)
611 (install-file file (dirname destination))))
612 (find-files "usr/include" "\\.h$"))
614 (mkdir (string-append out "/include/config"))
615 (call-with-output-file
617 "/include/config/kernel.release")
619 (format p "~a-default~%" ,version)))))))
620 #:allowed-references ()
622 (home-page "https://www.gnu.org/software/linux-libre/")
623 (synopsis "GNU Linux-Libre kernel headers")
624 (description "Headers of the Linux-Libre kernel.")
625 (license license:gpl2)))
627 (define-public linux-libre-headers-5.19
628 (make-linux-libre-headers* linux-libre-5.19-version
629 linux-libre-5.19-gnu-revision
630 linux-libre-5.19-source))
632 (define-public linux-libre-headers-5.18
633 (make-linux-libre-headers* linux-libre-5.18-version
634 linux-libre-5.18-gnu-revision
635 linux-libre-5.18-source))
637 (define-public linux-libre-headers-5.15
638 (make-linux-libre-headers* linux-libre-5.15-version
639 linux-libre-5.15-gnu-revision
640 linux-libre-5.15-source))
642 (define-public linux-libre-headers-5.10
643 (make-linux-libre-headers* linux-libre-5.10-version
644 linux-libre-5.10-gnu-revision
645 linux-libre-5.10-source))
647 (define-public linux-libre-headers-5.4
648 (make-linux-libre-headers* linux-libre-5.4-version
649 linux-libre-5.4-gnu-revision
650 linux-libre-5.4-source))
652 (define-public linux-libre-headers-4.19
653 (make-linux-libre-headers* linux-libre-4.19-version
654 linux-libre-4.19-gnu-revision
655 linux-libre-4.19-source))
657 (define-public linux-libre-headers-4.14
658 (make-linux-libre-headers* linux-libre-4.14-version
659 linux-libre-4.14-gnu-revision
660 linux-libre-4.14-source))
662 (define-public linux-libre-headers-4.9
663 (make-linux-libre-headers* linux-libre-4.9-version
664 linux-libre-4.9-gnu-revision
665 linux-libre-4.9-source))
667 ;; The following package is used in the early bootstrap, and thus must be kept
668 ;; stable and with minimal build requirements.
669 (define-public linux-libre-headers-5.10.35
670 (make-linux-libre-headers "5.10.35" "gnu"
671 "0q2rnchad55d49f3rajrkazz0fcjv1irwrdb1hwjnl01fzm2gjk3"))
673 (define-public linux-libre-headers linux-libre-headers-5.10.35)
677 ;;; Kernel configurations.
680 (define* (kernel-config arch #:key variant)
681 "Return the absolute file name of the Linux-Libre build configuration file
682 for ARCH and optionally VARIANT, or #f if there is no such configuration."
683 (let* ((name (string-append (if variant (string-append variant "-") "")
684 (if (string=? "i386" arch) "i686" arch) ".conf"))
685 (file (string-append "linux-libre/" name)))
686 (search-auxiliary-file file)))
688 (define %default-extra-linux-options
689 `(;; Make the kernel config available at /proc/config.gz
690 ("CONFIG_IKCONFIG" . #t)
691 ("CONFIG_IKCONFIG_PROC" . #t)
692 ;; Some very mild hardening.
693 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
694 ;; All kernels should have NAMESPACES options enabled
695 ("CONFIG_NAMESPACES" . #t)
696 ("CONFIG_UTS_NS" . #t)
697 ("CONFIG_IPC_NS" . #t)
698 ("CONFIG_USER_NS" . #t)
699 ("CONFIG_PID_NS" . #t)
700 ("CONFIG_NET_NS" . #t)
701 ;; Various options needed for elogind service:
702 ;; https://issues.guix.gnu.org/43078
703 ("CONFIG_CGROUP_FREEZER" . #t)
704 ("CONFIG_BLK_CGROUP" . #t)
705 ("CONFIG_CGROUP_WRITEBACK" . #t)
706 ("CONFIG_CGROUP_SCHED" . #t)
707 ("CONFIG_CGROUP_PIDS" . #t)
708 ("CONFIG_CGROUP_FREEZER" . #t)
709 ("CONFIG_CGROUP_DEVICE" . #t)
710 ("CONFIG_CGROUP_CPUACCT" . #t)
711 ("CONFIG_CGROUP_PERF" . #t)
712 ("CONFIG_SOCK_CGROUP_DATA" . #t)
713 ("CONFIG_BLK_CGROUP_IOCOST" . #t)
714 ("CONFIG_CGROUP_NET_PRIO" . #t)
715 ("CONFIG_CGROUP_NET_CLASSID" . #t)
716 ("CONFIG_MEMCG" . #t)
717 ("CONFIG_MEMCG_SWAP" . #t)
718 ("CONFIG_MEMCG_KMEM" . #t)
719 ("CONFIG_CPUSETS" . #t)
720 ("CONFIG_PROC_PID_CPUSET" . #t)
721 ;; Allow disk encryption by default
722 ("CONFIG_DM_CRYPT" . m)
723 ;; Modules required for initrd:
724 ("CONFIG_NET_9P" . m)
725 ("CONFIG_NET_9P_VIRTIO" . m)
726 ("CONFIG_VIRTIO_BLK" . m)
727 ("CONFIG_VIRTIO_NET" . m)
728 ("CONFIG_VIRTIO_PCI" . m)
729 ("CONFIG_VIRTIO_BALLOON" . m)
730 ("CONFIG_VIRTIO_MMIO" . m)
731 ("CONFIG_FUSE_FS" . m)
733 ("CONFIG_9P_FS" . m)))
735 ;; See https://github.com/iovisor/bcc/blob/master/INSTALL.md#kernel-configuration
736 (define %bpf-extra-linux-options
737 `(;; Needed for probes
738 ("CONFIG_UPROBE_EVENTS" . #t)
739 ("CONFIG_KPROBE_EVENTS" . #t)
740 ;; kheaders module also helpful for tracing
741 ("CONFIG_IKHEADERS" . #t)
743 ("CONFIG_BPF_SYSCALL" . #t)
744 ("CONFIG_BPF_JIT_ALWAYS_ON" . #t)
745 ;; optional, for tc filters
746 ("CONFIG_NET_CLS_BPF" . m)
747 ;; optional, for tc actions
748 ("CONFIG_NET_ACT_BPF" . m)
749 ("CONFIG_BPF_JIT" . #t)
750 ;; for Linux kernel versions 4.1 through 4.6
751 ;; ("CONFIG_HAVE_BPF_JIT" . y)
752 ;; for Linux kernel versions 4.7 and later
753 ("CONFIG_HAVE_EBPF_JIT" . #t)
754 ;; optional, for kprobes
755 ("CONFIG_BPF_EVENTS" . #t)
757 ("CONFIG_IKHEADERS" . #t)))
759 (define (config->string options)
760 (string-join (map (match-lambda
762 (string-append option "=m"))
764 (string-append option "=y"))
766 (string-append option "=n"))
768 (string-append option "=\"" string "\"")))
774 ;;; Kernel package utilities.
777 (define* (make-linux-libre version gnu-revision hash-string supported-systems
780 ;; A function that takes an arch and a variant.
781 ;; See kernel-config for an example.
782 (configuration-file #f)
783 (defconfig "defconfig")
784 (extra-options %default-extra-linux-options)
785 (patches (list %boot-logo-patch)))
786 (make-linux-libre* version gnu-revision
789 (uri (linux-libre-urls version gnu-revision))
790 (sha256 (base32 hash-string))
793 #:extra-version extra-version
794 #:configuration-file configuration-file
795 #:defconfig defconfig
796 #:extra-options extra-options))
798 (define* (make-linux-libre* version gnu-revision source supported-systems
801 ;; A function that takes an arch and a variant.
802 ;; See kernel-config for an example.
803 (configuration-file #f)
804 (defconfig "defconfig")
805 (extra-options %default-extra-linux-options))
807 (name (if extra-version
808 (string-append "linux-libre-" extra-version)
812 (supported-systems supported-systems)
813 (build-system gnu-build-system)
818 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
822 ;; These are needed to compile the GCC plugins.
827 ,@(match (let ((arch (platform-linux-architecture
828 (lookup-platform-by-target-or-system
829 (or (%current-target-system)
830 (%current-system))))))
831 (and configuration-file arch
834 #:variant (version-major+minor version))))
835 (#f ;no config for this platform
838 `(("kconfig" ,config))))))
840 (list #:modules '((guix build gnu-build-system)
847 #~(modify-phases %standard-phases
848 (add-after 'unpack 'patch-/bin/pwd
850 (substitute* (find-files "." "^Makefile(\\.include)?$")
851 (("/bin/pwd") "pwd"))))
853 (lambda* (#:key inputs target #:allow-other-keys)
854 ;; Avoid introducing timestamps.
855 (setenv "KCONFIG_NOTIMESTAMP" "1")
856 (setenv "KBUILD_BUILD_TIMESTAMP"
857 (getenv "SOURCE_DATE_EPOCH"))
859 ;; Other variables useful for reproducibility.
860 (setenv "KBUILD_BUILD_USER" "guix")
861 (setenv "KBUILD_BUILD_HOST" "guix")
863 ;; Set ARCH and CROSS_COMPILE.
864 (let ((arch #$(platform-linux-architecture
865 (lookup-platform-by-target-or-system
866 (or (%current-target-system)
867 (%current-system))))))
869 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
872 (setenv "CROSS_COMPILE" (string-append target "-"))
873 (format #t "`CROSS_COMPILE' set to `~a'~%"
874 (getenv "CROSS_COMPILE"))))
876 (setenv "EXTRAVERSION"
878 (string-append "-" extra-version)))
880 (let ((build (assoc-ref %standard-phases 'build))
881 (config (assoc-ref inputs "kconfig")))
883 ;; Use a custom kernel configuration file or a default
884 ;; configuration file.
887 (copy-file config ".config")
888 (chmod ".config" #o666))
889 (invoke "make" #$defconfig))
891 ;; Appending works even when the option wasn't in the
892 ;; file. The last one prevails if duplicated.
893 (let ((port (open-file ".config" "a"))
894 (extra-configuration #$(config->string extra-options)))
895 (display extra-configuration port)
898 (invoke "make" "oldconfig"))))
900 (lambda* (#:key inputs native-inputs #:allow-other-keys)
901 (let ((moddir (string-append #$output "/lib/modules"))
902 (dtbdir (string-append #$output "/lib/dtbs")))
903 ;; Install kernel image, kernel configuration and link map.
904 (for-each (lambda (file) (install-file file #$output))
905 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
906 ;; Install device tree files
907 (unless (null? (find-files "." "\\.dtb$"))
909 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
911 ;; Install kernel modules
914 ;; Disable depmod because the Guix system's
915 ;; module directory is an union of potentially
916 ;; multiple packages. It is not possible to use
917 ;; depmod to usefully calculate a dependency
918 ;; graph while building only one of them.
920 (string-append "MODULE_DIR=" moddir)
921 (string-append "INSTALL_PATH=" #$output)
922 (string-append "INSTALL_MOD_PATH=" #$output)
923 "INSTALL_MOD_STRIP=1"
925 (let* ((versions (filter (lambda (name)
926 (not (string-prefix? "." name)))
928 (version (match versions
930 ;; There are symlinks to the build and source directory.
931 ;; Both will point to target /tmp/guix-build* and thus
932 ;; not be useful in a profile. Delete the symlinks.
933 (false-if-file-not-found
935 (string-append moddir "/" version "/build")))
936 (false-if-file-not-found
938 (string-append moddir "/" version "/source"))))))))
940 (home-page "https://www.gnu.org/software/linux-libre/")
941 (synopsis "100% free redistribution of a cleaned Linux kernel")
943 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
944 It has been modified to remove all non-free binary blobs.")
945 (license license:gpl2)
946 (properties '((max-silent-time . 3600))))) ;don't timeout on blob scan.
950 ;;; Generic kernel packages.
953 (define-public linux-libre-5.19
954 (make-linux-libre* linux-libre-5.19-version
955 linux-libre-5.19-gnu-revision
956 linux-libre-5.19-source
957 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
958 #:configuration-file kernel-config))
960 (define-public linux-libre-5.18
961 (make-linux-libre* linux-libre-5.18-version
962 linux-libre-5.18-gnu-revision
963 linux-libre-5.18-source
964 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
965 #:configuration-file kernel-config))
967 (define-public linux-libre-version linux-libre-5.18-version)
968 (define-public linux-libre-gnu-revision linux-libre-5.18-gnu-revision)
969 (define-public linux-libre-pristine-source linux-libre-5.18-pristine-source)
970 (define-public linux-libre-source linux-libre-5.18-source)
971 (define-public linux-libre linux-libre-5.18)
973 (define-public linux-libre-5.15
974 (make-linux-libre* linux-libre-5.15-version
975 linux-libre-5.15-gnu-revision
976 linux-libre-5.15-source
977 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
978 #:configuration-file kernel-config))
980 (define-public linux-libre-5.10
981 (make-linux-libre* linux-libre-5.10-version
982 linux-libre-5.10-gnu-revision
983 linux-libre-5.10-source
984 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
985 #:configuration-file kernel-config))
987 (define-public linux-libre-5.4
988 (make-linux-libre* linux-libre-5.4-version
989 linux-libre-5.4-gnu-revision
990 linux-libre-5.4-source
991 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
992 #:configuration-file kernel-config))
994 (define-public linux-libre-4.19
995 (make-linux-libre* linux-libre-4.19-version
996 linux-libre-4.19-gnu-revision
997 linux-libre-4.19-source
998 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
999 #:configuration-file kernel-config))
1001 (define-public linux-libre-4.14
1002 (make-linux-libre* linux-libre-4.14-version
1003 linux-libre-4.14-gnu-revision
1004 linux-libre-4.14-source
1005 '("x86_64-linux" "i686-linux" "armhf-linux")
1006 #:configuration-file kernel-config))
1008 (define-public linux-libre-4.9
1009 (make-linux-libre* linux-libre-4.9-version
1010 linux-libre-4.9-gnu-revision
1011 linux-libre-4.9-source
1012 '("x86_64-linux" "i686-linux")
1013 #:configuration-file kernel-config))
1015 ;; Linux-Libre-LTS points to the *newest* released long-term support version of
1017 ;; Reference: https://jxself.org/linux-libre/
1019 (define-public linux-libre-lts-version linux-libre-5.15-version)
1020 (define-public linux-libre-lts-gnu-revision linux-libre-5.15-gnu-revision)
1021 (define-public linux-libre-lts-pristine-source linux-libre-5.15-pristine-source)
1022 (define-public linux-libre-lts-source linux-libre-5.15-source)
1023 (define-public linux-libre-lts linux-libre-5.15)
1027 ;;; Specialized kernel variants.
1030 (define-public linux-libre-arm-generic
1031 (make-linux-libre* linux-libre-version
1032 linux-libre-gnu-revision
1035 #:defconfig "multi_v7_defconfig"
1036 #:extra-version "arm-generic"
1039 `(;; needed to fix the RTC on rockchip platforms
1040 ("CONFIG_RTC_DRV_RK808" . #t))
1041 %default-extra-linux-options)))
1043 (define-public linux-libre-arm-generic-5.10
1044 (make-linux-libre* linux-libre-5.10-version
1045 linux-libre-5.10-gnu-revision
1046 linux-libre-5.10-source
1048 #:defconfig "multi_v7_defconfig"
1049 #:extra-version "arm-generic"
1052 `(;; needed to fix the RTC on rockchip platforms
1053 ("CONFIG_RTC_DRV_RK808" . #t))
1054 %default-extra-linux-options)))
1056 (define-public linux-libre-arm-generic-5.4
1057 (make-linux-libre* linux-libre-5.4-version
1058 linux-libre-5.4-gnu-revision
1059 linux-libre-5.4-source
1061 #:defconfig "multi_v7_defconfig"
1062 #:extra-version "arm-generic"
1065 `(;; needed to fix the RTC on rockchip platforms
1066 ("CONFIG_RTC_DRV_RK808" . #t))
1067 %default-extra-linux-options)))
1069 (define-public linux-libre-arm-generic-4.19
1070 (make-linux-libre* linux-libre-4.19-version
1071 linux-libre-4.19-gnu-revision
1072 linux-libre-4.19-source
1074 #:defconfig "multi_v7_defconfig"
1075 #:extra-version "arm-generic"))
1077 (define-public linux-libre-arm-generic-4.14
1078 (make-linux-libre* linux-libre-4.14-version
1079 linux-libre-4.14-gnu-revision
1080 linux-libre-4.14-source
1082 #:defconfig "multi_v7_defconfig"
1083 #:extra-version "arm-generic"))
1085 (define-public linux-libre-arm-omap2plus
1086 (make-linux-libre* linux-libre-version
1087 linux-libre-gnu-revision
1090 #:defconfig "omap2plus_defconfig"
1091 #:extra-version "arm-omap2plus"))
1093 (define-public linux-libre-arm-omap2plus-4.19
1094 (make-linux-libre* linux-libre-4.19-version
1095 linux-libre-4.19-gnu-revision
1096 linux-libre-4.19-source
1098 #:defconfig "omap2plus_defconfig"
1099 #:extra-version "arm-omap2plus"))
1101 (define-public linux-libre-arm-omap2plus-4.14
1102 (make-linux-libre* linux-libre-4.14-version
1103 linux-libre-4.14-gnu-revision
1104 linux-libre-4.14-source
1106 #:defconfig "omap2plus_defconfig"
1107 #:extra-version "arm-omap2plus"))
1109 (define-public linux-libre-arm64-generic
1110 (make-linux-libre* linux-libre-version
1111 linux-libre-gnu-revision
1114 #:defconfig "defconfig"
1115 #:extra-version "arm64-generic"
1118 `(;; needed to fix the RTC on rockchip platforms
1119 ("CONFIG_RTC_DRV_RK808" . #t)
1120 ;; Pinebook display, battery, charger and usb
1121 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1122 ("CONFIG_CHARGER_AXP20X" . m)
1123 ("CONFIG_INPUT_AXP20X_PEK" . m)
1124 ("CONFIG_CHARGER_AXP20X" . m)
1125 ("CONFIG_BATTERY_AXP20X" . m)
1126 ("CONFIG_PINCTRL_AXP209" . m)
1127 ("CONFIG_AXP20X_POWER" . m)
1128 ("CONFIG_AXP20X_ADC" . m)
1129 ;; Pinebook PRO battery and sound support
1130 ("CONFIG_BATTERY_CW2015" . m)
1131 ("CONFIG_CHARGER_GPIO" . m)
1132 ("CONFIG_SND_SOC_ES8316" . m))
1133 %default-extra-linux-options)))
1135 (define-public linux-libre-arm64-generic-5.10
1136 (make-linux-libre* linux-libre-5.10-version
1137 linux-libre-5.10-gnu-revision
1138 linux-libre-5.10-source
1140 #:defconfig "defconfig"
1141 #:extra-version "arm64-generic"
1144 `(;; needed to fix the RTC on rockchip platforms
1145 ("CONFIG_RTC_DRV_RK808" . #t)
1146 ;; Pinebook display, battery, charger and usb
1147 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1148 ("CONFIG_CHARGER_AXP20X" . m)
1149 ("CONFIG_INPUT_AXP20X_PEK" . m)
1150 ("CONFIG_CHARGER_AXP20X" . m)
1151 ("CONFIG_BATTERY_AXP20X" . m)
1152 ("CONFIG_PINCTRL_AXP209" . m)
1153 ("CONFIG_AXP20X_POWER" . m)
1154 ("CONFIG_AXP20X_ADC" . m)
1155 ;; Pinebook PRO battery and sound support
1156 ("CONFIG_BATTERY_CW2015" . m)
1157 ("CONFIG_CHARGER_GPIO" . m)
1158 ("CONFIG_SND_SOC_ES8316" . m))
1159 %default-extra-linux-options)))
1161 (define-public linux-libre-arm64-generic-5.4
1162 (make-linux-libre* linux-libre-5.4-version
1163 linux-libre-5.4-gnu-revision
1164 linux-libre-5.4-source
1166 #:defconfig "defconfig"
1167 #:extra-version "arm64-generic"
1170 `(;; needed to fix the RTC on rockchip platforms
1171 ("CONFIG_RTC_DRV_RK808" . #t))
1172 %default-extra-linux-options)))
1174 (define-public linux-libre-riscv64-generic
1175 (make-linux-libre* linux-libre-version
1176 linux-libre-gnu-revision
1179 #:extra-version "riscv64-generic"))
1181 (define-public linux-libre-mips64el-fuloong2e
1182 (make-linux-libre* linux-libre-version
1183 linux-libre-gnu-revision
1186 #:defconfig "fuloong2e_defconfig"
1187 #:extra-version "mips64el-fuloong2e"
1190 `(("CONFIG_OVERLAY_FS" . m))
1191 %default-extra-linux-options)))
1193 (define-public linux-libre-with-bpf
1194 (let ((base-linux-libre
1196 linux-libre-5.18-version
1197 linux-libre-5.18-gnu-revision
1198 linux-libre-5.18-source
1199 '("x86_64-linux" "i686-linux" "armhf-linux"
1200 "aarch64-linux" "riscv64-linux")
1201 #:extra-version "bpf"
1202 #:configuration-file kernel-config
1204 (append %bpf-extra-linux-options
1205 %default-extra-linux-options))))
1207 (inherit base-linux-libre)
1208 (inputs (modify-inputs (package-inputs base-linux-libre)
1214 ;;; Linux kernel modules.
1217 (define-public acpi-call-linux-module
1219 (name "acpi-call-linux-module")
1225 (url "https://github.com/nix-community/acpi_call")
1226 (commit (string-append "v" version))))
1227 (file-name (git-file-name name version))
1229 (base32 "09ljx0jl987753r2kjqj5kxms95bijw0xn14kf82ryn38ck5c8cf"))))
1230 (build-system linux-module-build-system)
1232 (list #:tests? #f ; no tests
1234 #~(modify-phases %standard-phases
1235 (add-before 'install 'patch-shebangs-harder
1236 ;; The (only) shebangs in examples/ don't justify a reference.
1237 ;; However, do substitute a slightly more portable one.
1239 (substitute* (find-files "examples" ".")
1240 (("^(#! *)/[^ ]*/" _ shebang)
1241 (string-append shebang "/usr/bin/env ")))))
1242 (add-after 'install 'install-documentation
1244 (let* ((doc (string-append #$output "/share/doc/"
1245 #$name "-" #$version)))
1246 (for-each (lambda (file)
1247 (let ((target (string-append doc "/" file)))
1248 (mkdir-p (dirname target))
1249 (copy-recursively file target)))
1250 (list "README.md" "examples"))))))))
1251 (home-page "https://github.com/nix-community/acpi_call")
1252 (synopsis "Linux kernel module to perform ACPI method calls")
1254 "This simple Linux kernel module allows calls from user space to any
1255 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
1256 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
1257 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
1258 and @code{ACPI_BUFFER}.
1260 It grants direct and undocumented access to your hardware that may cause damage
1261 and should be used with caution, especially on untested models.")
1262 (license license:gpl3+))) ; see README.md (no licence headers)
1264 (define-public corefreq
1272 (url "https://github.com/cyring/CoreFreq")
1274 (file-name (git-file-name name version))
1276 (base32 "1fpmrqjwxvjbs23r73agjs322fbi4v1013cncbfyk6lcjghxab76"))))
1277 (build-system linux-module-build-system)
1278 (outputs (list "out" "linux-module"))
1280 (list #:imported-modules `((guix build gnu-build-system)
1281 ,@%linux-module-build-system-modules)
1282 #:modules `((guix build linux-module-build-system)
1283 ((guix build gnu-build-system) #:prefix gnu:)
1286 #~(list (string-append "CC=" #$(cc-for-target))
1288 (string-append "PREFIX=" #$output))
1289 #:tests? #f ; no test suite
1291 #~(modify-phases %standard-phases
1292 (add-after 'unpack 'untangle-module-targets
1293 ;; Having to build everything in one pass would complicate the
1294 ;; definition. Let each build system handle what it's good at.
1296 (substitute* "Makefile"
1297 ((".*MAKE.*KERNELDIR.*") ""))))
1298 (add-after 'build 'gnu:build
1299 (assoc-ref gnu:%standard-phases 'build))
1300 (add-after 'install 'gnu:install
1301 (assoc-ref gnu:%standard-phases 'install))
1302 (add-after 'install 'separate-module
1303 (lambda* (#:key outputs #:allow-other-keys)
1304 ;; Adding INSTALL_MOD_PATH= to #:make-flags would still create an
1305 ;; empty <out>/lib/modules directory, so just do it all by hand.
1306 (let* ((out (assoc-ref outputs "out"))
1307 (module (assoc-ref outputs "linux-module")))
1308 (mkdir-p (string-append module "/lib"))
1309 (rename-file (string-append out "/lib/modules")
1310 (string-append module "/lib/modules")))))
1311 (add-after 'install 'install-README
1312 ;; There is no proper documentation. Provide something.
1313 (lambda* (#:key outputs #:allow-other-keys)
1314 (let* ((out (assoc-ref outputs "out"))
1315 (doc (string-append out "/share/doc/"
1316 #$name "-" #$version)))
1317 (install-file "README.md" doc)))))))
1318 (home-page "https://github.com/cyring/CoreFreq")
1320 "Measure performance data & tweak low-level settings on x86-64 CPUs")
1322 "CoreFreq is a CPU monitor that reports low-level processor settings and
1323 performance data with notably high precision by using a loadable Linux kernel
1324 module. Unlike most similar tools, it can be used to modify some settings if
1325 supported by the hardware and at your own risk. It's designed for 64-bit x86
1326 Intel processors (Atom, Core2, Nehalem, SandyBridge, and newer) and compatible
1327 architectures like AMD@tie{}Zen and Hygon@tie{}Dhyana.
1329 Supported processor features include:
1331 @item time spent in C-states, including C1/C3 Auto- and UnDemotion;
1332 @item core temperatures, voltage, and tweaking thermal limits;
1333 @item core frequencies, ratios, and base clock rate;
1334 @item enabling, disabling, and testing SpeedStep (EIST), Turbo Boost, and
1335 Hyper-Threading or SMT;
1336 @item enabling or disabling data cache prefetching;
1337 @item kernel assembly code to keep as near as possible readings of performance
1338 counters such as the @acronym{TSC, Time Stamp Counter}, @acronym{UCC, Unhalted
1339 Core Cycles}, and @acronym{URC, Unhalted Reference Cycles};
1340 @item the number of instructions per cycle or second (IPS, IPC, and CPI);
1341 @item memory controller geometry and RAM timings;
1342 @item running processes' CPU affinity.
1345 This package provides the @command{corefreqd} data collection daemon, the
1346 @command{corefreq-cli} client to visualise and control it in real time, and the
1347 @code{corefreqk} kernel module in its own separate output. Read the included
1348 @file{README.md} before loading it.")
1349 (supported-systems (list "x86_64-linux"))
1350 (license license:gpl2)))
1352 (define-public librem-ec-acpi-linux-module
1354 (name "librem-ec-acpi-linux-module")
1360 (url "https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms")
1361 (commit (string-append "v" version))))
1362 (file-name (git-file-name name version))
1364 (base32 "1qnbfj60i8nn2ahgj2zp5ixd79bb0wl1ld36x3igws2f3c0f5pfi"))))
1365 (build-system linux-module-build-system)
1367 (list #:tests? #f)) ; no test suite
1368 (home-page "https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms")
1369 (synopsis "Linux kernel module to control the Librem Embedded Controller")
1371 "This is the Linux kernel @acronym{ACPI, Advanced Configuration and Power
1372 Interface} platform driver for the @acronym{EC, Embedded Controller} firmware
1373 on Purism Librem laptop computers. It allows user-space control over the
1374 battery charging thresholds, keyboard backlight, fans and thermal monitors,
1375 and the notification, WiFi, and Bluetooth LED.")
1376 (license license:gpl2)))
1385 (url "https://github.com/lkrg-org/lkrg")
1386 (commit (string-append "v" version))))
1387 (file-name (git-file-name name version))
1390 "0yirb7n4mqv8cn0gziz1m7ymq00dhhy79j59jdgrx00b8rj57cfw"))))
1391 (build-system linux-module-build-system)
1393 (list #:linux linux-libre
1395 #:make-flags #~(list (string-append "CC="
1397 (string-append "SYSSRC="
1398 (assoc-ref %build-inputs
1399 "linux-module-builder")
1400 "/lib/modules/build"))))
1401 (inputs (list bash-minimal))
1402 (home-page "https://lkrg.org/")
1403 (synopsis "Linux Kernel Runtime Guard")
1405 "This package performs runtime integrity checking of the Linux kernel and
1406 detection of security vulnerability exploits against the kernel.")
1407 (license license:gpl2)))
1409 (define-public vhba-module
1411 (name "vhba-module")
1412 (version "20211218")
1417 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
1420 (base32 "1dkprnnya0i8121p7ip4g8cww99drk7fzbwcxx65x02jqk0siibj"))))
1421 (build-system linux-module-build-system)
1423 (list #:tests? #f)) ; no test suite
1424 (home-page "https://cdemu.sourceforge.io/")
1425 (synopsis "Linux kernel module that emulates SCSI devices")
1427 "The @acronym{VHBA, Virtual SCSI Host Bus Adapter} module is the link
1428 between the CDemu user-space daemon and the kernel Linux. It acts as a
1429 low-level SCSI driver that emulates a virtual SCSI adapter which can have
1430 multiple virtual devices attached to it. Its typical use with CDEmu is to
1431 emulate optical devices such as DVD and CD-ROM drives.")
1432 (license license:gpl2+)))
1434 (define-public bbswitch-module
1435 ;; Use "develop" branch since stable release does not build on Linux >= 5.6.
1436 ;; See https://github.com/Bumblebee-Project/bbswitch/issues/205.
1437 (let ((commit "ddbd243638c7bc2baecf43a78aff46cdc12e9b2e"))
1439 (name "bbswitch-module")
1440 (version (git-version "0.8" "1" commit))
1444 (url "https://github.com/Bumblebee-Project/bbswitch")
1446 (file-name (git-file-name name version))
1449 "1pgldnza7mzd0flrxg4q69dwbq1fhl58m5c62ary5drb0xyf3lqb"))))
1450 (build-system linux-module-build-system)
1452 (list #:tests? #f)) ; no test suite
1453 (home-page "https://github.com/Bumblebee-Project/bbswitch")
1454 (synopsis "Kernel module that disables discrete Nvidia graphics cards")
1455 (description "The bbswitch module provides a way to toggle the Nvidia
1456 graphics card on Optimus laptops.")
1457 (license license:gpl2))))
1459 (define-public ddcci-driver-linux
1461 (name "ddcci-driver-linux")
1468 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
1469 (commit (string-append "v" version))))
1470 (file-name (git-file-name name version))
1472 (base32 "1lww3mnqhxqzj0qbxzbwbq93v9zw49myp7p9ib873a5izbq8nadi"))))
1473 (build-system linux-module-build-system)
1475 (list #:tests? #f ; no tests
1477 #~(modify-phases %standard-phases
1482 (with-directory-excursion module
1483 (apply (assoc-ref %standard-phases 'build) args)))
1484 '("ddcci" "ddcci-backlight"))))
1489 (with-directory-excursion module
1490 (apply (assoc-ref %standard-phases 'install) args)))
1491 '("ddcci" "ddcci-backlight")))))))
1492 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
1493 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
1494 (description "This package provides two Linux kernel drivers, ddcci and
1495 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
1496 interface. The ddcci module creates a character device for each DDC/CI
1497 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
1498 module allows the control of the backlight level or luminance property when
1499 supported under @file{/sys/class/backlight/}.")
1500 (license license:gpl2+)))
1502 (define-public v4l2loopback-linux-module
1504 (name "v4l2loopback-linux-module")
1509 (url "https://github.com/umlaeute/v4l2loopback")
1510 (commit (string-append "v" version))))
1511 (file-name (git-file-name name version))
1514 "1qi4l6yam8nrlmc3zwkrz9vph0xsj1cgmkqci4652mbpbzigg7vn"))))
1515 (build-system linux-module-build-system)
1517 (list #:tests? #f)) ; no test suite
1518 (home-page "https://github.com/umlaeute/v4l2loopback")
1519 (synopsis "Linux kernel module to create virtual V4L2 video devices")
1521 "This Linux module creates virtual video devices. @acronym{V4L2, Video
1522 for Linux 2} applications will treat these as ordinary video devices but read
1523 video data generated by another application, instead of a hardware device such
1526 This lets you apply nifty effects to your Jitsi video, for example, but also
1527 allows some more serious things like adding streaming capabilities to an
1528 application by hooking GStreamer into the loopback device.")
1529 (license license:gpl2+)))
1531 (define-public xpadneo
1538 (url "https://github.com/atar-axis/xpadneo")
1539 (commit (string-append "v" version))))
1540 (file-name (git-file-name name version))
1543 "0xr0zx134s56h4ij6c3fh8ki0h58h61minbfxcl3sgpgxkh14ism"))))
1544 (build-system linux-module-build-system)
1546 (list #:tests? #f ; no `check' target
1547 #:source-directory "hid-xpadneo/src"
1549 #~(modify-phases %standard-phases
1550 (add-after 'install 'post-install
1552 (copy-recursively "hid-xpadneo/etc-modprobe.d"
1553 (string-append #$output "/etc/modprobe.d"))
1554 ;; udev-service-type takes its rules from /lib rather than
1555 ;; /etc, so copy it there instead
1556 (copy-recursively "hid-xpadneo/etc-udev-rules.d"
1557 (string-append #$output
1558 "/lib/udev/rules.d")))))))
1559 (home-page "https://atar-axis.github.io/xpadneo/")
1560 (synopsis "Xbox One Wireless Controller driver for the kernel Linux")
1562 "This package provides a driver for the XBox One S Wireless controller
1563 and some newer models when connected via Bluetooth. In addition to the included
1564 Linux kernel module, it also contains a modprobe configuration and udev rules,
1565 which need to be installed separately.")
1566 (license license:gpl3+)))
1570 ;;; Pluggable authentication modules (PAM).
1573 (define-public linux-pam
1581 "https://github.com/linux-pam/linux-pam/releases/download/v"
1582 version "/Linux-PAM-" version ".tar.xz"))
1585 "1z4jayf69qyyxln1gl6ch4qxfd66ib1g42garnrv2d8i1drl0790"))
1586 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1588 (build-system gnu-build-system)
1591 ;; TODO: optional dependencies
1592 ;; ("libxcrypt" ,libxcrypt)
1593 ;; ("cracklib" ,cracklib)
1596 `(;; Most users, such as `shadow', expect the headers to be under
1598 #:configure-flags (list (string-append "--includedir="
1599 (assoc-ref %outputs "out")
1600 "/include/security")
1602 ;; XXX: <rpc/rpc.h> is missing from glibc when
1603 ;; cross-compiling, so we have to disable NIS
1604 ;; support altogether.
1605 ,@(if (%current-target-system)
1609 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1612 (home-page "http://www.linux-pam.org/")
1613 (synopsis "Pluggable authentication modules for Linux")
1615 "A *Free* project to implement OSF's RFC 86.0.
1616 Pluggable authentication modules are small shared object files that can
1617 be used through the PAM API to perform tasks, like authenticating a user
1618 at login. Local and dynamic reconfiguration are its key features.")
1619 (license license:bsd-3)))
1621 (define-public python-pamela
1623 (name "python-pamela")
1627 ;; Tests not distributed in pypi release.
1630 (url "https://github.com/minrk/pamela")
1632 (file-name (git-file-name name version))
1635 "0cg3w6np1fbjpvzhv54xg567hpf38szwp2d4gvzb9r736nxbv0vr"))))
1636 (build-system python-build-system)
1638 '(#:tests? #f ; Test suite isn't designed to be run inside a container.
1640 (modify-phases %standard-phases
1641 (add-after 'unpack 'hardcode-pam.so
1642 (lambda* (#:key inputs #:allow-other-keys)
1643 (let ((pam (assoc-ref inputs "linux-pam")))
1644 (substitute* "pamela.py"
1645 (("find_library\\(\"pam\")")
1646 (string-append "'" pam "/lib/libpam.so'")))
1649 (lambda* (#:key tests? #:allow-other-keys)
1651 (if (file-exists? "test_pamela.py")
1652 (invoke "py.test" "--assert=plain" "test_pamela.py")
1653 (invoke "python" "-m" "pamela" "-a" "`whoami`"))
1658 (list python-pytest))
1659 (home-page "https://github.com/minrk/pamela")
1660 (synopsis "PAM interface using ctypes")
1661 (description "This package provides a PAM interface using @code{ctypes}.")
1662 (license license:expat)))
1664 (define-public pam-gnupg
1671 (url "https://github.com/cruegge/pam-gnupg")
1672 (commit (string-append "v" version))))
1673 (file-name (git-file-name name version))
1676 "1bf91gi6zmfzzmczxm7pajxdlgnikasvg5xsd3j0a368rcr7lf9l"))))
1677 (build-system gnu-build-system)
1679 (list gnupg linux-pam))
1681 (list autoconf automake libtool))
1683 `(#:tests? #f ;no tests suite
1685 (list (string-append "--with-moduledir="
1686 (assoc-ref %outputs "out") "/lib/security"))))
1688 (home-page "https://github.com/cruegge/pam-gnupg")
1689 (synopsis "Unlock GnuPG keys on login")
1690 (description "This package provides a PAM module that hands over your
1691 login password to @code{gpg-agent}. This can be useful if you are using a
1692 GnuPG-based password manager like @code{pass}.")
1693 (license license:gpl3+)))
1700 (define-public powercap
1708 (url "https://github.com/powercap/powercap")
1709 (commit (string-append "v" version))))
1710 (file-name (git-file-name name version))
1712 (base32 "1vs84fmhdc3w1541vp0f5ydvdsbg0amjdv2g2f8xdvaw01nakxsn"))))
1713 (build-system cmake-build-system)
1715 (list #:configure-flags
1716 #~(list "-DBUILD_SHARED_LIBS=ON")))
1717 (home-page "https://github.com/powercap/powercap")
1718 (synopsis "Utilities for accessing the powercap Linux kernel feature")
1719 (description "This package contains utilities for accessing the powercap
1720 Linux kernel feature through sysfs. It includes an implementation for working
1721 with Intel @acronym{RAPL, Running Average Power Limit}.
1722 It provides the commands @code{powercap-info} and @code{powercap-set}.")
1723 (license license:bsd-3)))
1725 (define-public powerstat
1733 (url "https://github.com/ColinIanKing/powerstat")
1734 (commit (string-append "V" version))))
1735 (file-name (git-file-name name version))
1737 (base32 "1ik5yv2bhz2hvyga4h1m28rf0xpi20zpqm4swhvskyf1g6qf381z"))))
1738 (build-system gnu-build-system)
1741 (list (string-append "CC=" ,(cc-for-target))
1742 (string-append "prefix=" (assoc-ref %outputs "out")))
1743 #:tests? #f ; no test suite
1745 (modify-phases %standard-phases
1746 (delete 'configure)))) ; no configure script
1747 (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
1748 (synopsis "Measure system power consumption")
1750 "Powerstat measures and reports your computer's power consumption in real
1751 time. On mobile PCs, it uses ACPI battery information to measure the power
1752 drain of the entire system.
1754 Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
1755 domain measurements. These are available only on some hardware such as Intel
1756 Sandybridge and newer, and cover only part of the machine's components such as
1757 CPU, DRAM, and graphics. However, they provide accurate and immediate readings
1758 and don't require a battery at all.
1760 The output is like @command{vmstat} but also shows power consumption statistics:
1761 at the end of a run, @command{powerstat} will calculate the average, standard
1762 deviation, and minimum and maximum values. It can show a nice histogram too.")
1763 (license license:gpl2)))
1765 (define-public psmisc
1772 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1775 (base32 "12z5786dnf37n8wvv73wdcqp3nvsqzhwdk3ajna0mag4yz1fqdyw"))))
1776 (build-system gnu-build-system)
1778 `(,@(if (%current-target-system)
1781 "ac_cv_func_malloc_0_nonnull=yes"
1782 "ac_cv_func_realloc_0_nonnull=yes"))
1784 (inputs (list ncurses))
1785 (home-page "https://gitlab.com/psmisc/psmisc")
1786 (synopsis "Small utilities that use the proc file system")
1788 "This PSmisc package is a set of some small useful utilities that
1789 use the proc file system. We're not about changing the world, but
1790 providing the system administrator with some help in common tasks.")
1791 (license license:gpl2+)))
1793 (define-public util-linux
1796 (replacement util-linux/fixed)
1800 (uri (string-append "mirror://kernel.org/linux/utils/"
1801 "util-linux/v" (version-major+minor version) "/"
1802 "util-linux-" version ".tar.xz"))
1805 "1ng9517c37mdp858425a4zyybma7dh7jrpd6z1z61yz7mb0n81va"))
1806 (patches (search-patches "util-linux-tests.patch"))
1807 (modules '((guix build utils)))
1809 ;; We take 'nologin' from Shadow, the 'logger' program from
1810 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1812 (substitute* "configure"
1813 (("build_nologin=yes") "build_nologin=no")
1814 (("build_logger=yes") "build_logger=no")
1815 (("build_kill=yes") "build_kill=no"))
1817 (build-system gnu-build-system)
1818 (outputs '("out" ;6.4 MiB executables and documentation
1819 "lib" ;8.8 MiB shared libraries, headers and locales
1820 "static")) ;2.9 MiB static .a libraries
1822 `(#:configure-flags (list "--disable-use-tty-group"
1824 "--enable-fs-paths-default="
1825 "/run/setuid-programs"
1826 ":/run/current-system/profile/sbin")
1827 ;; Don't try to chown root:root mount and umount
1828 "--disable-makeinstall-chown"
1829 "--localstatedir=/var"
1830 (string-append "--localedir="
1831 (assoc-ref %outputs "lib")
1833 ;; Install completions where our
1834 ;; bash-completion package expects them.
1835 (string-append "--with-bashcompletiondir="
1836 (assoc-ref %outputs "out")
1837 "/etc/bash_completion.d"))
1839 ;; FIXME: For now we cannot reliably run tests on GNU/Hurd:
1840 ;; <https://bugs.gnu.org/47791>.
1841 #:tests? ,(and (not (%current-target-system))
1842 (not (string-suffix? "-gnu" (%current-system))))
1844 #:phases (modify-phases %standard-phases
1845 (add-before 'configure 'patch-build-scripts
1846 (lambda* (#:key outputs #:allow-other-keys)
1847 (substitute* "configure"
1848 ;; The build system assumes that we want to install
1849 ;; libraries below $exec_prefix when $libdir does not
1850 ;; match any of the "usual" locations. Fix that.
1851 (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
1852 "usrlib_execdir=$libdir"))))
1853 (add-before 'build 'set-umount-file-name
1854 (lambda* (#:key outputs #:allow-other-keys)
1855 ;; Tell 'eject' the right file name of 'umount'.
1856 (let ((out (assoc-ref outputs "out")))
1857 (substitute* "sys-utils/eject.c"
1858 (("\"/bin/umount\"")
1859 (string-append "\"" out "/bin/umount\""))))))
1860 (add-before 'check 'pre-check
1861 (lambda* (#:key native-inputs inputs #:allow-other-keys)
1862 (let ((services (search-input-file (or native-inputs inputs)
1864 ;; Change the test to refer to the right file.
1865 (substitute* "tests/ts/misc/mcookie"
1869 ;; The C.UTF-8 locale does not exist in our libc.
1870 (substitute* "tests/ts/column/invalid-multibyte"
1871 (("C\\.UTF-8") "en_US.utf8")))))
1872 (add-before 'check 'disable-setarch-test
1874 ;; The setarch tests are unreliable in QEMU's user-mode
1875 ;; emulation, which is our primary method of building
1876 ;; ARMv7 packages. See
1877 ;; <https://github.com/karelzak/util-linux/issues/601>.
1878 (substitute* "tests/ts/misc/setarch"
1879 (("ts_init_subtest.*" all)
1882 "ts_skip \"setarch tests are unreliable under QEMU\"")))))
1883 (add-before 'check 'disable-lsns-test
1885 ;; The lsns tests can fail due to ioctl(_, NS_GET_USERNS)
1886 ;; returning ENOTTY, indicating this kernel does not
1887 ;; support user namespaces. Curiously, this test can fail
1888 ;; on i686 even if the same test passes on x86_64 on the
1889 ;; same machine. See <https://issues.guix.gnu.org/49933>.
1890 (delete-file "tests/ts/lsns/ioctl_ns")))
1891 (add-after 'install 'move-static-libraries
1892 (lambda* (#:key outputs #:allow-other-keys)
1893 (let ((lib (assoc-ref outputs "lib"))
1894 (static (assoc-ref outputs "static")))
1896 ;; Move static libraries to the "static" output.
1897 (mkdir-p (string-append static "/lib"))
1898 (with-directory-excursion lib
1899 (for-each (lambda (file)
1901 (string-append static "/"
1903 (find-files "lib" "\\.a$"))
1905 ;; Remove references to the static library from the '.la'
1906 ;; files so that Libtool does the right thing when both
1907 ;; the shared and static library is available.
1908 (substitute* (find-files "lib" "\\.la$")
1909 (("old_library=.*") "old_library=''\n"))))))
1910 (add-after 'install 'adjust-pkg-config-files
1911 (lambda* (#:key outputs #:allow-other-keys)
1912 (let ((lib (assoc-ref outputs "lib")))
1913 ;; Drop the unused "prefix=" and "exec_prefix=" variables from
1914 ;; the pkg-config files to avoid a cyclic reference on "out".
1915 (substitute* (find-files (string-append lib "/lib/pkgconfig")
1917 (("^(exec_)?prefix=.*") ""))))))))
1919 (list file ;for libmagic
1923 (list net-base ;for tests
1925 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1926 (synopsis "Collection of utilities for the Linux kernel")
1927 (description "Util-linux is a diverse collection of Linux kernel
1928 utilities. It provides dmesg and includes tools for working with file systems,
1929 block devices, UUIDs, TTYs, and many other tools.")
1931 (properties '((upstream-name . "util-linux")))
1932 ;; Note that util-linux doesn't use the same license for all the
1933 ;; code. GPLv2+ is the default license for a code without an
1934 ;; explicitly defined license.
1935 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1936 license:bsd-4 license:public-domain))))
1938 ;; util-linux optionally supports udev, which allows lsblk to read file system
1939 ;; metadata without special privileges. Add it as a separate package to avoid
1940 ;; a circular dependency, and to keep the size small.
1941 (define-public util-linux+udev
1944 (name "util-linux-with-udev")
1946 (modify-inputs (package-inputs util-linux)
1949 ;; This is mostly equivalent to the upstream release version v2.37.3, except
1950 ;; that the upstream tarball was generated improperly, which breaks the build.
1951 ;; There will not be a v2.37.3-fixed release or anything like that to fix it:
1952 ;; https://github.com/util-linux/util-linux/issues/1577
1953 (define-public util-linux/fixed
1956 (inherit util-linux)
1958 (inherit (package-source util-linux))
1959 (patches (append (search-patches "util-linux-CVE-2021-3995.patch"
1960 "util-linux-CVE-2021-3996.patch")
1961 (origin-patches (package-source util-linux)))))))))
1964 (define-public ddate
1971 (url "https://github.com/bo0ts/ddate")
1972 (commit (string-append "v" version))))
1973 (file-name (git-file-name name version))
1975 (base32 "1qchxnxvghbma6gp1g78wnjxsri0b72ha9axyk31cplssl7yn73f"))))
1976 (build-system cmake-build-system)
1977 (arguments '(#:tests? #f))
1978 (home-page "https://github.com/bo0ts/ddate")
1979 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1981 "ddate displays the Discordian date and holidays of a given date.
1982 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1983 by Robert Shea and Robert Anton Wilson.")
1984 (license license:public-domain)))
1986 (define-public fbset
1993 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
1996 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
1997 (build-system gnu-build-system)
1999 '(#:modules ((guix build gnu-build-system)
2003 (modify-phases %standard-phases
2004 (delete 'configure) ; no configure script
2005 (add-before 'install 'pre-install
2006 (lambda* (#:key outputs #:allow-other-keys)
2007 (let ((out (assoc-ref outputs "out")))
2008 (substitute* "Makefile"
2009 (("mknod ") "true ")
2010 ;; The Makefile doesn't honour PREFIX or similar.
2013 (with-directory-excursion out
2014 (for-each mkdir-p (list "sbin"
2018 (add-after 'install 'install-fb.modes
2019 (lambda* (#:key outputs #:allow-other-keys)
2020 (let* ((out (assoc-ref outputs "out"))
2021 (etc (string-append out "/etc")))
2022 (for-each (cut install-file <> etc)
2023 (find-files "etc" "^fb\\.modes"))
2024 (symlink "fb.modes.ATI"
2025 (string-append etc "/fb.modes"))
2027 ;; Parallel building races to create modes.tab.c.
2028 #:parallel-build? #f
2029 #:tests? #f)) ; no test suite
2032 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
2033 (synopsis "Show and modify Linux frame buffer settings")
2035 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
2036 different kinds of graphic displays. The @command{fbset} utility can query and
2037 change various device settings such as depth, virtual resolution, and timing
2039 (license license:gpl2)))
2041 (define-public procps
2047 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
2048 "procps-ng-" version ".tar.xz"))
2051 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
2052 (build-system gnu-build-system)
2054 `(#:modules ((guix build utils)
2055 (guix build gnu-build-system)
2058 ,@(if (%current-target-system)
2061 "ac_cv_func_malloc_0_nonnull=yes"
2062 "ac_cv_func_realloc_0_nonnull=yes"))
2065 (modify-phases %standard-phases
2067 'install 'post-install
2068 ;; Remove commands and man pages redudant with
2070 (lambda* (#:key outputs #:allow-other-keys)
2071 (let* ((out (assoc-ref outputs "out"))
2072 (dup (append-map (cut find-files out <>)
2073 '("^kill" "^uptime"))))
2074 (for-each delete-file dup)
2076 (inputs (list ncurses))
2077 (home-page "https://gitlab.com/procps-ng/procps/")
2078 (synopsis "Utilities that give information about processes")
2080 "Procps is the package that has a bunch of small useful utilities
2081 that give information about processes using the Linux /proc file system.
2082 The package includes the programs free, pgrep, pidof, pkill, pmap, ps, pwdx,
2083 slabtop, tload, top, vmstat, w, watch and sysctl.")
2084 (properties '((upstream-name . "procps-ng")))
2085 (license license:gpl2)))
2087 (define-public usbutils
2094 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
2095 "usbutils-" version ".tar.xz"))
2097 (base32 "0sgwfvr1b5w3ai1c0rmvzhk67y9vh7bq490rcxxj4q05svx9q1rs"))))
2098 (build-system gnu-build-system)
2099 (outputs (list "out" "python"))
2102 (modify-phases %standard-phases
2103 (add-before 'bootstrap 'patch-bootstrap-scripts
2105 (substitute* "usbhid-dump/bootstrap"
2106 (("/bin/sh") (which "sh")))))
2107 (add-after 'install 'separate-python-output
2108 ;; Separating one Python script shaves more than 106 MiB from :out.
2109 (lambda* (#:key outputs #:allow-other-keys)
2110 (let ((out (assoc-ref outputs "out"))
2111 (out:python (assoc-ref outputs "python")))
2112 (for-each (lambda (file)
2113 (let ((old (string-append out "/" file))
2114 (new (string-append out:python "/" file)))
2115 (mkdir-p (dirname new))
2116 (rename-file old new)))
2117 (list "bin/lsusb.py"))))))))
2119 (list eudev libusb python))
2121 (list autoconf automake libtool pkg-config))
2122 (home-page "http://www.linux-usb.org/")
2124 "Tools for working with USB devices, such as lsusb")
2126 "Tools for working with USB devices, such as lsusb.")
2127 (license license:gpl2+)))
2129 (define-public usbip-utils
2131 (name "usbip-utils")
2132 (version (package-version linux-libre))
2133 (source (package-source linux-libre))
2134 (build-system gnu-build-system)
2136 '(#:configure-flags '("--disable-static")
2137 #:phases (modify-phases %standard-phases
2138 (add-after 'unpack 'enter-subdirectory
2140 (chdir "tools/usb/usbip")
2143 `(("automake" ,automake)
2144 ("autoreconf" ,autoconf)
2145 ("libtool" ,libtool)))
2146 (inputs (list eudev))
2147 (home-page (package-home-page linux-libre))
2148 (synopsis "Utilities for sharing USB devices over IP networks")
2150 "The USB/IP protocol enables to pass USB device from a server to
2151 a client over the network. The server is a machine which shares an
2152 USB device and the client is a machine which uses USB device provided by
2153 a server over the network. The USB device may be either physical device
2154 connected to a server or software entity created on a server using USB
2155 gadget subsystem. The usbip-utils are userspace tools to used to handle
2156 connection and management on both side. The client needs the @file{vhci-hcd}
2157 Linux kernel module and the server needs the @file{usbip_host} Linux kernel
2159 (license license:gpl2)))
2161 (define-public e2fsprogs
2168 "mirror://kernel.org/linux/kernel/people/tytso/"
2169 "e2fsprogs/v" version "/"
2170 "e2fsprogs-" version ".tar.xz"))
2173 "04wp77fg842dhribgn0xvbd77idh0n7a839ga4bwy78v7i9l445i"))))
2174 (build-system gnu-build-system)
2175 (inputs (list `(,util-linux "lib")))
2176 (native-inputs (list pkg-config
2177 texinfo ;for the libext2fs Info manual
2182 '(;; util-linux is the preferred source for some of the libraries and
2183 ;; commands, so disable them (see, e.g.,
2184 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
2185 #:configure-flags (list "--disable-libblkid"
2186 "--disable-libuuid" "--disable-uuidd"
2189 ;; Use symlinks instead of hard links for
2190 ;; 'fsck.extN' etc. This makes the resulting nar
2191 ;; smaller and is preserved across copies.
2192 "--enable-symlink-install"
2194 (string-append "LDFLAGS=-Wl,-rpath="
2195 (assoc-ref %outputs "out")
2198 ;; Install libext2fs et al.
2199 "--enable-elf-shlibs")
2202 (modify-phases %standard-phases
2203 (add-before 'configure 'patch-shells
2205 (substitute* "configure"
2206 (("/bin/sh (.*)parse-types.sh" _ dir)
2207 (string-append (which "sh") " " dir
2209 (substitute* "MCONFIG.in"
2210 (("INSTALL_SYMLINK = /bin/sh")
2211 "INSTALL_SYMLINK = sh"))
2212 (substitute* (find-files "." "^Makefile.in$")
2214 (string-append "#!" (which "sh"))))))
2215 (add-after 'install 'install-libs
2216 (lambda* (#:key outputs #:allow-other-keys)
2217 (let* ((out (assoc-ref outputs "out"))
2218 (lib (string-append out "/lib")))
2219 (invoke "make" "install-libs")
2221 ;; Make the .a writable so that 'strip' works.
2222 ;; Failing to do that, due to debug symbols, we
2223 ;; retain a reference to the final
2224 ;; linux-libre-headers, which refer to the
2225 ;; bootstrap binaries.
2226 (let ((archives (find-files lib "\\.a$")))
2227 (for-each (lambda (file)
2230 (home-page "http://e2fsprogs.sourceforge.net/")
2231 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
2233 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
2234 (license (list license:gpl2 ;programs
2235 license:lgpl2.0 ;libext2fs
2236 license:x11)))) ;libuuid
2238 (define e2fsprogs/static
2240 (package (inherit e2fsprogs)
2242 ;; Do not build shared libraries.
2243 (substitute-keyword-arguments (package-arguments e2fsprogs)
2244 ((#:configure-flags _)
2245 '(list "--disable-blkid"))
2249 (define-public e2fsck/static
2251 (name "e2fsck-static")
2252 (version (package-version e2fsprogs))
2253 (build-system trivial-build-system)
2256 (list e2fsprogs/static))
2258 `(#:modules ((guix build utils))
2261 (use-modules (guix build utils)
2265 (let ((e2fsck (search-input-file %build-inputs "/sbin/e2fsck"))
2266 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
2268 (with-directory-excursion bin
2269 (copy-file e2fsck "e2fsck")
2270 (remove-store-references "e2fsck")
2271 (chmod "e2fsck" #o555))
2273 (home-page (package-home-page e2fsprogs))
2274 (synopsis "Statically-linked e2fsck command from e2fsprogs")
2275 (description "This package provides statically-linked e2fsck command taken
2276 from the e2fsprogs package. It is meant to be used in initrds.")
2277 (license (package-license e2fsprogs))))
2279 (define-public extundelete
2281 (name "extundelete")
2286 (uri (string-append "mirror://sourceforge/extundelete/"
2287 "extundelete/" version "/extundelete-"
2288 version ".tar.bz2"))
2291 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
2292 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
2293 (build-system gnu-build-system)
2294 (inputs (list e2fsprogs))
2295 (home-page "http://extundelete.sourceforge.net/")
2296 (synopsis "Recover deleted files from ext2/3/4 partitions")
2298 "Extundelete is a set of tools that can recover deleted files from an
2299 ext3 or ext4 partition.")
2300 (license license:gpl2)))
2302 (define-public zerofree
2306 (home-page "https://frippery.org/uml/")
2309 (uri (string-append home-page name "-" version
2313 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
2314 (build-system gnu-build-system)
2317 (modify-phases %standard-phases
2318 (delete 'configure) ; no configure script
2320 ;; The Makefile lacks an ‘install’ target.
2321 (lambda* (#:key outputs #:allow-other-keys)
2322 (let* ((out (assoc-ref outputs "out"))
2323 (bin (string-append out "/bin")))
2324 (chmod "zerofree" #o555)
2325 (install-file "zerofree" bin)
2327 #:tests? #f)) ; no tests
2328 (inputs `(("libext2fs" ,e2fsprogs)))
2329 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
2331 "Zerofree finds the unallocated blocks with non-zero value content in an
2332 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
2333 This is a simple way to make disk images more compressible.
2334 Zerofree requires the file system to be unmounted or mounted read-only.")
2335 (license license:gpl2)))
2337 (define-public strace
2341 (home-page "https://strace.io")
2344 (uri (string-append home-page "/files/" version
2345 "/strace-" version ".tar.xz"))
2348 "11qi7pdm0ldycsg9qhsa50icm219mmvy16yw1ih3s9f9kakkwab0"))
2349 (patches (search-patches "strace-readlink-tests.patch"))))
2350 (build-system gnu-build-system)
2353 (modify-phases %standard-phases
2354 (add-after 'unpack 'patch-/bin/sh
2356 (substitute* "src/strace.c"
2357 (("/bin/sh") (which "sh")))))
2358 (add-after 'unpack 'disable-failing-tests
2360 (substitute* "tests/Makefile.in"
2361 ;; XXX: These hang forever even if the test time-out is
2363 (("^\tstrace-DD?D?\\.test \\\\.*") "")
2364 (("^\tpidns-cache.test \\\\.*") "")
2365 (("^\t.*--pidns-translation.test \\\\.*") "")
2366 ;; This one fails with an encoding error.
2367 (("^\t.*net-yy-unix.test \\\\.*") "")))))
2368 ;; Don't fail if the architecture doesn't support different
2370 #:configure-flags '("--enable-mpers=check")
2371 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
2372 #:parallel-tests? #f)) ; undeterministic failures
2373 (native-inputs (list perl))
2374 (synopsis "System call tracer for Linux")
2376 "strace is a system call tracer, i.e. a debugging tool which prints out a
2377 trace of all the system calls made by a another process/program.")
2379 '((release-monitoring-url . "https://github.com/strace/strace/releases")))
2380 (license license:lgpl2.1+)))
2382 (define-public ltrace
2388 (uri (string-append "http://www.ltrace.org/ltrace_" version
2392 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
2393 (build-system gnu-build-system)
2394 (inputs `(("libelf" ,elfutils)))
2396 ;; Compilation uses -Werror by default, but it fails.
2397 '(#:configure-flags '("--disable-werror")))
2398 (home-page "https://www.ltrace.org/")
2399 (synopsis "Library call tracer for Linux")
2401 "ltrace intercepts and records dynamic library calls which are called by
2402 an executed process and the signals received by that process. It can also
2403 intercept and print the system calls executed by the program.")
2404 (license license:gpl2+)))
2406 (define-public alsa-ucm-conf
2408 (name "alsa-ucm-conf")
2413 "ftp://ftp.alsa-project.org/pub/lib/" name "-"
2414 version ".tar.bz2"))
2417 "0h6kzi1cfdqyxp4pwpqh5wb89c8s9wrgix315bvamffwfxf56frc"))))
2418 (build-system copy-build-system)
2421 '(("ucm" "share/alsa/ucm")
2422 ("ucm2" "share/alsa/ucm2"))))
2423 (home-page "https://www.alsa-project.org/wiki/Main_Page")
2424 (synopsis "The Advanced Linux Sound Architecture Use Case Manager")
2426 "This package contains Advanced Linux Sound Architecture Use Case Manager
2427 configuration of audio input/output names and routing for specific audio
2429 (license license:bsd-3)))
2431 (define-public alsa-topology-conf
2433 (name "alsa-topology-conf")
2438 "ftp://ftp.alsa-project.org/pub/lib/" name "-"
2439 version ".tar.bz2"))
2442 "01zdg6q4s6d01k39z96wi4vbhrfw1i2g4yi5dijwfk6a5vjfdq2m"))))
2443 (build-system copy-build-system)
2446 '(("topology" "share/alsa/topology"))))
2447 (home-page "https://www.alsa-project.org/wiki/Main_Page")
2448 (synopsis "The Advanced Linux Sound Architecture libraries")
2450 "This package contains Advanced Linux Sound Architecture topology
2451 configuration files that can be used for specific audio hardware.")
2452 (license license:bsd-3)))
2454 (define-public alsa-lib
2461 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
2462 version ".tar.bz2"))
2465 "1xq8d48wfy59qw4x7383j32n8j5njndw5hcgnmlg9pvclphlnmgp"))))
2466 (build-system gnu-build-system)
2468 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2469 (assoc-ref %outputs "out")
2472 (modify-phases %standard-phases
2473 (add-before 'install 'pre-install
2474 (lambda* (#:key inputs outputs #:allow-other-keys)
2476 (string-append (assoc-ref inputs "alsa-ucm-conf")))
2478 (string-append (assoc-ref inputs "alsa-topology-conf")))
2480 (string-append (assoc-ref outputs "out") "/share/alsa"))
2482 (string-append ucm "/share/alsa/ucm"))
2484 (string-append ucm "/share/alsa/ucm2"))
2486 (string-append topology "/share/alsa/topology")))
2488 (symlink ucm-share (string-append alsa "/ucm"))
2489 (symlink ucm2-share (string-append alsa "/ucm2"))
2490 (symlink topology-share (string-append alsa "/topology")))
2493 (list alsa-ucm-conf alsa-topology-conf))
2494 (home-page "https://www.alsa-project.org/wiki/Main_Page")
2495 (synopsis "The Advanced Linux Sound Architecture libraries")
2497 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2498 MIDI functionality to the Linux-based operating system.")
2499 (license license:lgpl2.1+)))
2501 (define-public alsa-utils
2507 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
2508 name "-" version ".tar.bz2"))
2511 "09m4dnn4kplawprd2bl15nwa0b4r1brab3x44ga7f1fyk7aw5zwq"))))
2512 (build-system gnu-build-system)
2514 ;; XXX: Disable man page creation until we have DocBook.
2515 '(#:configure-flags (list "--disable-xmlto"
2517 ;; The udev rule is responsible for restoring
2519 (string-append "--with-udev-rules-dir="
2520 (assoc-ref %outputs "out")
2521 "/lib/udev/rules.d"))
2523 (modify-phases %standard-phases
2524 (add-before 'check 'disable-broken-test
2526 ;; XXX: The 1.1.8 release tarball is missing a header that's
2527 ;; required for this test to work. Fixed in 1.1.9.
2528 (substitute* "axfer/test/Makefile"
2529 ((".*container-test.*") ""))
2532 'install 'pre-install
2534 ;; Don't try to mkdir /var/lib/alsa.
2535 (substitute* "Makefile"
2536 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
2540 `(("gettext" ,gettext-minimal)))
2542 (list libsamplerate ncurses alsa-lib xmlto))
2543 (home-page "http://www.alsa-project.org/")
2544 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
2546 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2547 MIDI functionality to the Linux-based operating system.")
2549 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
2551 (license license:gpl2)))
2553 (define-public alsa-plugins
2555 (name "alsa-plugins")
2559 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
2560 name "-" version ".tar.bz2"))
2563 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
2564 (build-system gnu-build-system)
2565 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
2566 ;; be split, there are references to both in files.
2567 ;; TODO: Remove OSS related plugins, they add support to run native
2568 ;; ALSA applications on OSS however we do not offer OSS and OSS is
2570 (outputs '("out" "pulseaudio" "jack"))
2571 (native-search-paths
2572 (list (search-path-specification
2573 (variable "ALSA_PLUGIN_DIR")
2574 (files '("lib/alsa-lib"))
2577 `(#:configure-flags '(;; Do not install a "local" configuration targeted
2578 ;; for /etc/alsa. On Guix System plugins are loaded from
2579 ;; the ALSA service, and other distributions likely
2580 ;; won't use these files.
2581 "--with-alsalconfdir=/tmp/noop")
2583 (modify-phases %standard-phases
2584 (add-after 'install 'split
2585 (lambda* (#:key inputs outputs #:allow-other-keys)
2586 ;; Distribute the binaries to the various outputs.
2587 (let* ((out (assoc-ref outputs "out"))
2588 (jack (assoc-ref outputs "jack"))
2589 (jacklib (string-append jack "/lib/alsa-lib"))
2590 (pua (assoc-ref outputs "pulseaudio"))
2591 (pualib (string-append pua "/lib/alsa-lib")))
2594 (for-each (lambda (file)
2595 (rename-file file (string-append jacklib "/" (basename file))))
2596 (find-files out ".*jack\\.(la|so)"))
2599 (for-each (lambda (file)
2600 (rename-file file (string-append pualib "/" (basename file))))
2601 (find-files out ".*pulse\\.(la|so)"))
2606 speex ; libspeexdsp resampling plugin
2607 libsamplerate ; libsamplerate resampling plugin
2608 ffmpeg ; libavcodec resampling plugin, a52 plugin
2609 pulseaudio)) ; PulseAudio plugin
2612 (home-page "http://www.alsa-project.org/")
2613 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
2615 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2616 MIDI functionality to the Linux-based operating system. This package enhances ALSA
2617 by providing additional plugins which include: upmixing, downmixing, jackd and
2618 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
2619 external rate conversion.")
2620 (license (list license:gpl2+
2621 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
2622 license:lgpl2.1+))))
2624 (define-public iptables
2631 (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
2633 (string-append "https://www.netfilter.org/projects/iptables/"
2634 "files/iptables-" version ".tar.bz2")))
2636 (base32 "1w6qx3sxzkv80shk21f63rq41c84irpx68k62m2cv629n1mwj2f1"))))
2637 (build-system gnu-build-system)
2639 (list pkg-config flex bison))
2641 (list libmnl libnftnl/fixed))
2643 (list #:tests? #f ; no test suite
2644 #:configure-flags ; add $libdir to the RUNPATH of executables
2645 ;; XXX TODO: Replace with simply #$OUTPUT on core-updates.
2646 #~(list (string-append "LDFLAGS=-Wl,-rpath="
2647 #$(if (%current-target-system)
2649 #~%output) "/lib"))))
2650 (home-page "https://www.netfilter.org/projects/iptables/index.html")
2651 (synopsis "Programs to configure Linux IP packet filtering rules")
2653 "@command{iptables} is the user-space command line program used to
2654 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
2655 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
2657 This package also includes @command{ip6tables}, which is used to configure the
2660 Both commands are targeted at system administrators.")
2661 (license license:gpl2+)))
2663 (define-public jitterentropy-rngd
2665 (name "jitterentropy-rngd")
2671 (url "https://github.com/smuellerDD/jitterentropy-rngd")
2672 (commit (string-append "v" version))))
2673 (file-name (git-file-name name version))
2675 (base32 "098hx09bsizin9405gh1c4rzbs2fr7qknqlr3glgyjpm3nm7bx28"))))
2676 (build-system gnu-build-system)
2678 `(#:tests? #f ; no test suite
2680 (list (string-append "CC=" ,(cc-for-target))
2681 (string-append "PREFIX=" (assoc-ref %outputs "out"))
2682 "UNITDIR=$(PREFIX)/lib/systemd/system")
2684 (modify-phases %standard-phases
2685 (delete 'configure)))) ; no ./configure script
2686 (home-page "https://www.chronox.de/jent.html")
2687 (synopsis "CPU jitter random number generator daemon")
2689 "This simple daemon feeds entropy from the CPU Jitter @acronym{RNG, random
2690 number generator} core to the kernel Linux's entropy estimator. This prevents
2691 the @file{/dev/random} device from blocking and should benefit users of the
2692 preferred @file{/dev/urandom} and @code{getrandom()} interfaces too.
2694 The CPU Jitter RNG itself is part of the kernel and claims to provide good
2695 entropy by collecting and magnifying differences in CPU execution time as
2696 measured by the high-resolution timer built into modern CPUs. It requires no
2697 additional hardware or external entropy source.
2699 The random bit stream generated by @command{jitterentropy-rngd} is not processed
2700 by a cryptographically secure whitening function. Nonetheless, its authors
2701 believe it to be a suitable source of cryptographically secure key material or
2702 other cryptographically sensitive data.
2704 If you agree with them, start this daemon as early as possible to provide
2705 properly seeded random numbers to services like SSH or those using TLS during
2706 early boot when entropy may be low, especially in virtualised environments.")
2707 (license (list license:bsd-3 ; or
2710 (define-public lsscsi
2717 "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
2720 "0jp458m2b3wckr18qkln69i01152qlwz33zm49103lq8fgx0n6d4"))))
2721 (build-system gnu-build-system)
2722 (synopsis "Lists information about SCSI or NVMe devices in Linux")
2723 (home-page "http://sg.danny.cz/scsi/lsscsi.html")
2725 "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
2726 also list NVMe namespaces or controllers and show the relationship between a
2727 device's primary node name, its SCSI generic (sg) node name and its kernel
2729 (license license:gpl2)))
2731 (define-public ebtables
2738 "mirror://netfilter.org/ebtables/ebtables-"
2742 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
2743 (build-system gnu-build-system)
2745 (list perl iptables))
2746 (synopsis "Ethernet bridge frame table administration")
2747 (home-page "https://ebtables.netfilter.org/")
2749 "ebtables is an application program used to set up and maintain the
2750 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
2751 analogous to the iptables application, but less complicated, due to the fact
2752 that the Ethernet protocol is much simpler than the IP protocol.")
2753 (license license:gpl2+)))
2755 (define-public iproute
2762 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
2766 "1zwin8sjnnwf2a9rjwzb3q8lkhcpy06s29sh05f5gxd7z6jy9qrq"))))
2767 (build-system gnu-build-system)
2769 `( ;; There is a test suite, but it wants network namespaces and sudo.
2771 #:make-flags (let ((out (assoc-ref %outputs "out")))
2773 (string-append "CC=" ,(cc-for-target))
2775 (string-append "BASH_COMPDIR=" out
2776 "/etc/bash_completion.d")
2777 (string-append "LIBDIR=" out "/lib")
2778 (string-append "HDRDIR=" out "/include")
2779 (string-append "SBINDIR=" out "/sbin")
2780 (string-append "CONFDIR=" out "/etc")
2781 (string-append "DOCDIR=" out "/share/doc/"
2783 (string-append "MANDIR=" out "/share/man")))
2784 #:phases (modify-phases %standard-phases
2785 (add-before 'install 'pre-install
2787 ;; Don't attempt to create /var/lib/arpd.
2788 (substitute* "Makefile"
2789 (("^.*ARPDDIR.*$") ""))
2791 (add-after 'unpack 'patch-configure
2793 (let ((target ,(%current-target-system)))
2794 (substitute* "configure"
2797 (string-append target "-pkg-config")
2802 ("iptables" ,iptables)
2803 ("libmnl" ,libmnl)))
2805 (list bison flex pkg-config))
2807 ;; ("libmnl" ,libmnl)
2808 ;; ("util-linux" ,util-linux)
2810 "https://wiki.linuxfoundation.org/networking/iproute2")
2812 "Utilities for controlling TCP/IP networking and traffic in Linux")
2814 "Iproute2 is a collection of utilities for controlling TCP/IP networking
2815 and traffic with the Linux kernel. The most important of these are
2816 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
2819 Most network configuration manuals still refer to ifconfig and route as the
2820 primary network configuration tools, but ifconfig is known to behave
2821 inadequately in modern network environments, and both should be deprecated.")
2822 (license license:gpl2+)))
2824 (define-public net-tools
2825 ;; XXX: This package is basically unmaintained, but it provides a few
2826 ;; commands not yet provided by Inetutils, such as 'route', so we have to
2828 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
2832 (version (string-append "1.60-" revision "." (string-take commit 7)))
2835 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
2836 "n/ne/net-tools/code.git/net-tools-code-"
2838 (file-name (string-append name "-" version ".zip"))
2841 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
2842 (home-page "http://net-tools.sourceforge.net/")
2843 (build-system gnu-build-system)
2845 `(#:modules ((guix build gnu-build-system)
2850 (modify-phases %standard-phases
2852 (lambda* (#:key outputs #:allow-other-keys)
2853 (let ((out (assoc-ref outputs "out")))
2854 (mkdir-p (string-append out "/bin"))
2855 (mkdir-p (string-append out "/sbin"))
2857 ;; Pretend we have everything...
2858 (system "yes | make config")
2860 ;; ... except for the things we don't have.
2861 ;; HAVE_AFDECnet requires libdnet, which we don't have.
2862 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
2863 ;; that have been removed.
2864 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
2865 ;; think about adding them later.
2866 (substitute* '("config.make" "config.h")
2867 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
2870 (add-after 'install 'remove-redundant-commands
2871 (lambda* (#:key outputs #:allow-other-keys)
2872 ;; Remove commands and man pages redundant with Inetutils.
2873 (let* ((out (assoc-ref outputs "out"))
2874 (dup (append-map (cut find-files out <>)
2876 "^(yp|nis|dns)?domainname"))))
2877 (for-each delete-file dup)
2879 ;; Binaries that depend on libnet-tools.a don't declare that
2880 ;; dependency, making it parallel-unsafe.
2881 #:parallel-build? #f
2883 #:tests? #f ; no test suite
2884 #:make-flags (let ((out (assoc-ref %outputs "out")))
2885 (list ,(string-append "CC=" (cc-for-target))
2886 (string-append "BASEDIR=" out)
2887 (string-append "INSTALLNLSDIR=" out "/share/locale")
2888 (string-append "mandir=/share/man")))))
2889 (native-inputs `(("gettext" ,gettext-minimal)
2891 (supported-systems (delete "i586-gnu" %supported-systems))
2892 (synopsis "Tools for controlling the network subsystem in Linux")
2894 "This package includes the important tools for controlling the network
2895 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
2896 route. Additionally, this package contains utilities relating to particular
2897 network hardware types (plipconfig, slattach) and advanced aspects of IP
2898 configuration (iptunnel, ipmaddr).")
2899 (license license:gpl2+))))
2901 (define-public libcap
2908 "mirror://kernel.org/linux/libs/security/linux-privs/"
2909 "libcap2/libcap-" version ".tar.xz"))
2912 "18l3pngsbaahdjzz01rmzrjgcqny4zld685fkq96mq5yr6m5n30r"))))
2913 (build-system gnu-build-system)
2916 #~(modify-phases %standard-phases
2917 (delete 'configure))
2918 #:test-target "test"
2921 (string-append "prefix=" #$output)
2922 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
2924 ;; Tell the makefile to use TARGET-gcc and friends
2925 ;; when cross-compiling.
2926 #$@(if (%current-target-system)
2927 `((string-append "CROSS_COMPILE="
2928 ,(%current-target-system) "-")
2931 (native-inputs (list perl))
2932 (supported-systems (delete "i586-gnu" %supported-systems))
2933 (home-page "https://sites.google.com/site/fullycapable/")
2934 (synopsis "Library for working with POSIX capabilities")
2936 "Libcap2 provides a programming interface to POSIX capabilities on
2937 Linux-based operating systems.")
2939 ;; License is BSD-3 or GPLv2, at the user's choice.
2940 (license license:gpl2)))
2942 (define-public bridge-utils
2944 (name "bridge-utils")
2949 (uri (string-append "mirror://kernel.org/linux/utils/net/"
2950 "bridge-utils/bridge-utils-" version ".tar.xz"))
2952 (base32 "03p6cmhm6cqhnfsfa1wv7frhb361y12daf7gr1h5qh51y7j8n7d6"))))
2953 (build-system gnu-build-system)
2955 ;; The tarball lacks all the generated files.
2956 (native-inputs (list autoconf automake))
2958 '(#:tests? #f)) ; no 'check' target
2960 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
2961 (synopsis "Manipulate Ethernet bridges")
2963 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2964 to connect two Ethernet segments together in a protocol independent way.
2965 Packets are forwarded based on Ethernet address, rather than IP address (like
2966 a router). Since forwarding is done at Layer 2, all protocols can go
2967 transparently through a bridge.")
2968 (license license:gpl2+)))
2970 (define-public libnl
2977 "https://github.com/thom311/libnl/releases/download/"
2978 "libnl" (string-join (string-split version #\.) "_")
2979 "/libnl-" version ".tar.gz"))
2982 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2983 (build-system gnu-build-system)
2987 ("pkg-config" ,pkg-config)
2993 "https://github.com/thom311/libnl/releases/download/libnl"
2994 (string-join (string-split version #\.) "_")
2995 "/libnl-doc-" version ".tar.gz"))
2997 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2998 (outputs `("out" "doc"))
3001 (modify-phases %standard-phases
3002 (add-after 'install 'install-doc
3003 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
3004 (let ((dest (string-append (assoc-ref outputs "doc")
3005 "/share/doc/libnl")))
3007 (invoke "tar" "xf" (assoc-ref
3008 (or native-inputs inputs)
3010 "--strip-components=1" "-C" dest)))))))
3011 (home-page "https://www.infradead.org/~tgr/libnl/")
3012 (synopsis "NetLink protocol library suite")
3014 "The libnl suite is a collection of libraries providing APIs to netlink
3015 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
3016 between the kernel and user space processes. It was designed to be a more
3017 flexible successor to ioctl to provide mainly networking related kernel
3018 configuration and monitoring interfaces.")
3020 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
3021 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
3022 (license license:gpl2)))
3024 ;; libnl python extensions used to be outputs of libnl. However, as
3025 ;; cross-compiling python extensions is currently broken, create separate
3026 ;; packages for libnl python extensions.
3027 (define (libnl-python-package python)
3028 (let ((name (string-append "libnl-" python)))
3033 ((string=? python "python2")
3034 `(("python-2" ,python-2)))
3035 ((string=? python "python3")
3036 `(("python-3" ,python-3))))))
3037 (propagated-inputs (list libnl))
3040 `(#:modules ((guix build gnu-build-system)
3044 (modify-phases %standard-phases
3046 (lambda* (#:key inputs outputs #:allow-other-keys)
3047 (define (python-inst python)
3048 (invoke python "setup.py" "build")
3049 (invoke python "setup.py" "install"
3050 (string-append "--prefix="
3051 (assoc-ref %outputs "out")))
3052 (invoke python "setup.py" "clean"))
3053 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
3054 (assoc-ref inputs "libnl")))
3055 (with-directory-excursion "./python" (python-inst ,python))
3058 (define-public libnl-python2 (libnl-python-package "python2"))
3059 (define-public libnl-python3 (libnl-python-package "python3"))
3068 "mirror://kernel.org/software/network/iw/iw-"
3072 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
3073 (build-system gnu-build-system)
3074 (native-inputs (list pkg-config))
3075 (inputs (list libnl))
3079 (string-append "CC=" #$(cc-for-target))
3080 (string-append "PKG_CONFIG=" #$(pkg-config-for-target))
3081 (string-append "PREFIX=" (assoc-ref %outputs "out")))
3083 #~(modify-phases %standard-phases
3084 (delete 'configure)))) ; no configure script
3085 (home-page "https://wireless.wiki.kernel.org/")
3086 (synopsis "Tool for configuring wireless devices")
3088 "iw is a new nl80211 based CLI configuration utility for wireless
3089 devices. It replaces @code{iwconfig}, which is deprecated.")
3090 (license license:isc)))
3092 (define-public powertop
3100 (url "https://github.com/fenrus75/powertop")
3101 (commit (string-append "v" version))))
3102 (file-name (git-file-name name version))
3104 (base32 "1zkr2y5nb1nr22nq8a3zli87iyfasfq6489p7h1k428pv8k45w4f"))))
3105 (build-system gnu-build-system)
3108 (list "LDFLAGS=-pthread")
3110 (modify-phases %standard-phases
3111 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
3112 ;; allow calibrating the network interface in Guix System.
3113 (add-after 'unpack 'patch-absolute-file-names
3114 (lambda* (#:key inputs #:allow-other-keys)
3115 (let ((kmod (assoc-ref inputs "kmod")))
3116 (substitute* (find-files "src" "\\.cpp$")
3117 ;; Give the right 'modprobe' file name so that essential
3118 ;; modules such as msr.ko can be loaded.
3119 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
3120 ;; These programs are only needed to calibrate, so using
3121 ;; relative file names avoids adding extra inputs. When they
3122 ;; are missing powertop gracefully handles it.
3123 (("/usr/bin/hcitool") "hcitool")
3124 (("/usr/bin/xset") "xset")
3125 (("/usr/sbin/hciconfig") "hciconfig"))
3128 (list kmod libnl ncurses pciutils zlib))
3130 `(("autoconf" ,autoconf)
3131 ("automake" ,automake)
3132 ("gettext" ,gettext-minimal)
3133 ("libtool" ,libtool)
3134 ("pkg-config" ,pkg-config)))
3135 (home-page "https://01.org/powertop/")
3136 (synopsis "Analyze power consumption on Intel-based laptops")
3138 "PowerTOP is a Linux tool to diagnose issues with power consumption and
3139 power management. In addition to being a diagnostic tool, PowerTOP also has
3140 an interactive mode where the user can experiment various power management
3141 settings for cases where the operating system has not enabled these
3143 (license license:gpl2)))
3145 (define-public aumix
3152 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
3153 version ".tar.bz2"))
3156 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
3157 (build-system gnu-build-system)
3159 ;; Allow compilation with GCC 10.
3160 '(#:configure-flags '("CFLAGS=-O2 -g -fcommon")))
3161 (inputs (list ncurses))
3162 (home-page "http://www.jpj.net/~trevor/aumix.html")
3163 (synopsis "Audio mixer for X and the console")
3165 "Aumix adjusts an audio mixer from X, the console, a terminal,
3166 the command line or a script.")
3167 (license license:gpl2+)))
3169 (define-public iotop-python
3170 ;; The last release is from 2013 and gives a misleading CONFIG_TASK_DELAY_ACCT
3171 ;; error on ‘newer’ kernels.
3172 (let ((revision "0")
3173 (commit "a14256a3ff74eeee59493ac088561f1bafab85a7"))
3175 (name "iotop-python")
3176 (version (git-version "0.6" revision commit))
3181 (url "https://repo.or.cz/iotop.git")
3183 (file-name (git-file-name name version))
3185 (base32 "00h5p8fk1zi237q8mqds8apqbis9iw0yih1hl0pr63dsnyzmmrpw"))))
3186 (build-system python-build-system)
3189 (modify-phases %standard-phases
3190 (add-after 'unpack 'fix-build-with-python3
3192 (substitute* "setup.py"
3193 (("itervalues") "values")))))
3194 ;; There are currently no checks in the package.
3196 (native-inputs (list python))
3197 (home-page "http://guichaz.free.fr/iotop/")
3199 "Displays the IO activity of running processes")
3201 "Iotop is a Python program with a top like user interface to show the
3202 processes currently causing I/O.")
3203 (license license:gpl2+))))
3205 (define-public iotop
3213 (url "https://github.com/Tomas-M/iotop")
3214 (commit (string-append "v" version))))
3215 (file-name (git-file-name name version))
3217 (base32 "04a77qir35s1bwvd39qddx2kfizdbf5jxlnz8zmy1cnrigbwcy1h"))))
3218 (build-system gnu-build-system)
3221 #~(list (string-append "CC=" #$(cc-for-target))
3222 (string-append "PREFIX=" #$output))
3223 #:tests? #f ; no tests
3225 #~(modify-phases %standard-phases
3226 (delete 'configure)))) ; no configure script
3227 (native-inputs (list pkg-config))
3228 (inputs (list ncurses))
3229 (home-page "https://github.com/Tomas-M/iotop")
3230 (synopsis "Interactive @command{top}-like input/output activity monitor")
3232 "iotop identifies which processes and threads are most responsible for
3233 @acronym{I/O, input/output} activity such as disc reads and writes. It sorts
3234 them in a live, interactive table overview similar to that of the well-known
3237 This information makes it much easier for an administrator to see which tasks
3238 are blocking others and adjust their priority (using @command{ionice}) or stop
3239 or kill them altogether.")
3240 (license license:gpl2+)))
3248 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
3249 "download/fuse-" version
3250 "/fuse-" version ".tar.gz"))
3253 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
3254 (patches (search-patches "fuse-overlapping-headers.patch"
3255 "fuse-glibc-2.34.patch"))))
3256 (build-system gnu-build-system)
3258 (list autoconf automake gettext-minimal libtool))
3260 (list bash-minimal util-linux))
3262 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
3263 (assoc-ref %outputs "out")
3265 (string-append "INIT_D_PATH="
3266 (assoc-ref %outputs "out")
3269 ;; The rule makes /dev/fuse 666.
3270 (string-append "UDEV_RULES_PATH="
3271 (assoc-ref %outputs "out")
3272 "/lib/udev/rules.d"))
3274 (modify-phases %standard-phases
3275 (add-before 'bootstrap 'force-bootstrap
3277 ;; Force a bootstrap to make the patch changes effective.
3278 (delete-file "configure")))
3279 (add-before 'build 'set-file-names
3280 (lambda* (#:key inputs #:allow-other-keys)
3281 ;; libfuse calls out to mount(8) and umount(8). Make sure
3282 ;; it refers to the right ones.
3283 (substitute* '("lib/mount_util.c" "util/mount_util.c")
3284 (("/bin/(u?)mount" _ maybe-u)
3285 (search-input-file inputs
3286 (string-append "bin/"
3288 (substitute* '("util/mount.fuse.c")
3290 (search-input-file inputs "/bin/sh")))
3292 ;; This hack leads libfuse to search for 'fusermount' in
3293 ;; $PATH, where it may find a setuid-root binary, instead of
3294 ;; trying solely $out/sbin/fusermount and failing because
3296 (substitute* "lib/Makefile"
3297 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
3298 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))))))
3299 (supported-systems (delete "i586-gnu" %supported-systems))
3300 (home-page "https://github.com/libfuse/libfuse")
3301 (synopsis "Support file systems implemented in user space")
3303 "As a consequence of its monolithic design, file system code for Linux
3304 normally goes into the kernel itself---which is not only a robustness issue,
3305 but also an impediment to system extensibility. FUSE, for \"file systems in
3306 user space\", is a kernel module and user-space library that tries to address
3307 part of this problem by allowing users to run file system implementations as
3308 user-space processes.")
3309 (license (list license:lgpl2.1 ;library
3310 license:gpl2+)))) ;command-line utilities
3312 (define-public fuse-3
3320 (string-append "https://github.com/libfuse/libfuse/releases/"
3321 "download/fuse-" version
3322 "/fuse-" version ".tar.xz"))
3325 "0rlnnsiw614qcmgy8xz67044gqc1pbvvf2yxjv44lh27bm487qmj"))))
3326 (build-system meson-build-system)
3330 (string-append "-Dudevrulesdir=" #$output "/udev/rules.d")
3334 ,#~(modify-phases %standard-phases
3335 (add-after 'unpack 'set-file-names
3336 (lambda* (#:key inputs #:allow-other-keys)
3337 ;; libfuse calls out to mount(8) and umount(8). Make sure
3338 ;; it refers to the right ones.
3339 (substitute* '("lib/mount_util.c")
3340 (("/bin/(u?)mount" _ maybe-u)
3341 (search-input-file inputs
3342 (string-append "bin/"
3344 (substitute* '("util/mount.fuse.c")
3346 (search-input-file inputs "/bin/sh")))
3348 ;; This hack leads libfuse to search for 'fusermount' in
3349 ;; $PATH, where it may find a setuid-root binary, instead of
3350 ;; trying solely $out/sbin/fusermount and failing because
3352 (substitute* "lib/meson.build"
3353 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
3354 "-DFUSERMOUNT_DIR=\"/var/empty\"'"))))
3355 (add-after 'unpack 'fix-install
3356 (lambda* (#:key inputs #:allow-other-keys)
3357 (substitute* '("util/meson.build")
3358 (("install_helper.sh") "true"))
3359 (substitute* '("util/meson.build")
3360 (("fuseconf_path = .*")
3361 "fuseconf_path = '/etc/fuse.conf'"))))
3362 (add-before 'configure 'set-paths
3363 (lambda* (#:key inputs outputs #:allow-other-keys)
3365 (string-append (getcwd) "/etc/init.d")))
3366 (setenv "MOUNT_FUSE_PATH"
3367 (string-append #$output "/sbin"))
3368 (setenv "UDEV_RULES_PATH"
3369 (string-append #$output
3370 "/lib/udev/rules.d"))))))))))
3372 (define-public unionfs-fuse
3374 (name "unionfs-fuse")
3379 (url "https://github.com/rpodgorny/unionfs-fuse")
3380 (commit (string-append "v" version))))
3381 (file-name (git-file-name name version))
3384 "1yigh8z1q6iq6yjyq7kl7vpbpjnxjld32apvjaw2bl44pqqg56hh"))))
3385 (build-system cmake-build-system)
3388 (inputs (list fuse))
3390 ;; The tests were never actually run ("collected 0 items"), but in recent
3391 ;; versions of pytest that causes an error.
3393 (home-page "https://github.com/rpodgorny/unionfs-fuse")
3394 (synopsis "User-space union file system")
3396 "UnionFS-FUSE is a flexible union file system implementation in user
3397 space, using the FUSE library. Mounting a union file system allows you to
3398 \"aggregate\" the contents of several directories into a single mount point.
3399 UnionFS-FUSE additionally supports copy-on-write.")
3400 (license license:bsd-3)))
3403 (package (inherit fuse)
3404 (name "fuse-static")
3405 (source (origin (inherit (package-source fuse))
3406 (modules '((guix build utils)))
3409 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
3410 ;; updated. Change calls to 'mtab_needs_update' to 0 so
3411 ;; that it doesn't do that, allowing us to remove the
3412 ;; dependency on util-linux (something that is useful in
3414 (substitute* '("lib/mount_util.c"
3415 "util/mount_util.c")
3416 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
3422 (define-public unionfs-fuse/static
3423 (package (inherit unionfs-fuse)
3424 (synopsis "User-space union file system (statically linked)")
3425 (name (string-append (package-name unionfs-fuse) "-static"))
3426 (source (origin (inherit (package-source unionfs-fuse))
3427 (modules '((guix build utils)))
3430 ;; Add -ldl to the libraries, because libfuse.a needs that.
3431 (substitute* "src/CMakeLists.txt"
3432 (("target_link_libraries(.*)\\)" _ libs)
3433 (string-append "target_link_libraries"
3438 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
3440 (modify-phases %standard-phases
3441 (add-after 'install 'post-install
3442 (lambda* (#:key outputs #:allow-other-keys)
3443 (let* ((out (assoc-ref outputs "out"))
3444 (exe (string-append out "/bin/unionfs")))
3445 ;; By default, 'unionfs' keeps references to
3446 ;; $glibc/share/locale and similar stuff. Remove them.
3447 (remove-store-references exe)
3449 ;; 'unionfsctl' has references to glibc as well. Since
3450 ;; we don't need it, remove it.
3451 (delete-file (string-append out "/bin/unionfsctl"))
3453 (inputs `(("fuse" ,fuse-static)))))
3455 (define-public sshfs
3461 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
3462 "download/sshfs-" version "/sshfs-" version
3466 "169fkilv060afgp9h7hvsbkg02bd1y77kmx06x0s7q1cvmxww62j"))))
3467 (build-system meson-build-system)
3469 ;; XXX: tests are skipped: FUSE kernel module does not seem to be loaded
3477 (home-page "https://github.com/libfuse/sshfs")
3478 (synopsis "Mount remote file systems over SSH")
3480 "This is a file system client based on the SSH File Transfer Protocol.
3481 Since most SSH servers already support this protocol it is very easy to set
3482 up: on the server side there's nothing to do; on the client side mounting the
3483 file system is as easy as logging into the server with an SSH client.")
3484 (license license:gpl2+)))
3486 (define-public sshfs-fuse
3487 (package (inherit sshfs)
3489 (properties `((superseded . ,sshfs)))))
3491 (define-public archivemount
3493 (name "archivemount")
3498 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
3499 "archivemount-" version ".tar.gz"))
3501 (base32 "1cy5b6qril9c3ry6fv7ir87s8iyy5vxxmbyx90dm86fbra0vjaf5"))))
3502 (build-system gnu-build-system)
3503 (inputs (list fuse libarchive))
3504 (native-inputs (list pkg-config))
3505 (home-page "https://www.cybernoia.de/software/archivemount.html")
3506 (synopsis "Tool for mounting archive files with FUSE")
3507 (description "archivemount is a FUSE-based file system for Unix variants,
3508 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
3509 mount point where it can be read from or written to as with any other file
3510 system. This makes accessing the contents of the archive, which may be
3511 compressed, transparent to other programs, without decompressing them.")
3512 (license license:lgpl2.0+)))
3514 (define-public numactl
3521 "https://github.com/numactl/numactl/releases/download/v"
3522 version "/numactl-" version ".tar.gz"))
3525 "1xngddsph43bxljywahi9d44fxr022slsap4hh91w8xnq54d2sw2"))))
3526 (build-system gnu-build-system)
3528 `(,@(if (target-riscv64?)
3529 `(#:make-flags (list "LDFLAGS=-latomic"))
3531 ;; There's a 'test' target, but it requires NUMA support in the kernel
3532 ;; to run, which we can't assume to have.
3534 (home-page "https://github.com/numactl/numactl")
3535 (synopsis "Tools for non-uniform memory access (NUMA) machines")
3537 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
3538 memory is not all in one place. The @command{numactl} program allows you to
3539 run your application program on specific CPUs and memory nodes. It does this
3540 by supplying a NUMA memory policy to the operating system before running your
3543 The package contains other commands, such as @command{numastat},
3544 @command{memhog}, and @command{numademo} which provides a quick overview of
3545 NUMA performance on your system.")
3546 (license (list license:gpl2 ;programs
3547 license:lgpl2.1)))) ;library
3549 (define-public kbd-neo
3556 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
3557 version "/linux/console/neo.map"))
3558 (file-name (string-append name "-" version ".map"))
3561 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
3562 (build-system trivial-build-system)
3564 `(#:modules ((guix build utils))
3566 (use-modules (guix build utils))
3567 (let ((out (string-append %output "/share/keymaps"))
3568 (source (assoc-ref %build-inputs "source")))
3570 (copy-file source (string-append out "/neo.map"))
3572 (home-page "https://neo-layout.org")
3573 (synopsis "Neo2 console layout")
3575 "Kbd-neo provides the Neo2 keyboard layout for use with
3576 @command{loadkeys(1)} from @code{kbd(4)}.")
3577 ;; The file is located in an svn directory, the entire content of
3578 ;; the directory is licensed as GPL3.
3579 (license license:gpl3+)))
3587 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
3591 "17wvrqz2kk0w87idinhyvd31ih1dp7ldfl2yfx7ailygb0279w2m"))
3592 (modules '((guix build utils)))
3595 (substitute* '("src/unicode_start" "src/unicode_stop")
3596 ;; Assume the Coreutils are in $PATH.
3599 (build-system gnu-build-system)
3602 (modify-phases %standard-phases
3603 (add-before 'build 'pre-build
3604 (lambda* (#:key inputs #:allow-other-keys)
3605 (let ((bzip2 (assoc-ref inputs "bzip2"))
3606 (gzip (assoc-ref inputs "gzip"))
3607 (xz (assoc-ref inputs "xz"))
3608 (zstd (assoc-ref inputs "zstd")))
3609 (substitute* "src/libkbdfile/kbdfile.c"
3610 (("bzip2") (string-append bzip2 "/bin/bzip2"))
3611 (("gzip") (string-append gzip "/bin/gzip"))
3612 (("xz -d") (string-append xz "/bin/xz -d"))
3613 (("zstd") (string-append zstd "/bin/zstd"))))))
3614 (add-after 'install 'post-install
3615 (lambda* (#:key outputs #:allow-other-keys)
3616 ;; Make sure these programs find their comrades.
3617 (let* ((out (assoc-ref outputs "out"))
3618 (bin (string-append out "/bin")))
3619 (for-each (lambda (prog)
3620 (wrap-program (string-append bin "/" prog)
3621 `("PATH" ":" prefix (,bin))))
3622 '("unicode_start" "unicode_stop"))))))))
3624 (list autoconf pkg-config))
3631 (native-search-paths
3632 (list (search-path-specification
3633 (variable "LOADKEYS_KEYMAP_PATH")
3634 ;; Append ‘/**’ to recursively search all directories. One can then
3635 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
3636 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
3637 (files (list "share/keymaps/**")))))
3638 (home-page "http://kbd-project.org/")
3639 (synopsis "Linux keyboard utilities and keyboard maps")
3641 "This package contains keytable files and keyboard utilities compatible
3642 for systems using the Linux kernel. This includes commands such as
3643 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
3644 (license license:gpl2+)))
3646 (define-public loadkeys-static
3649 (name "loadkeys-static")
3651 (substitute-keyword-arguments (package-arguments kbd)
3652 ((#:configure-flags flags ''())
3653 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
3654 "--disable-vlock" ;so we don't need libpam
3655 "--disable-libkeymap")
3657 ((#:make-flags flags ''())
3658 `(cons "LDFLAGS=-all-static -lrt -lpthread" ,flags))
3659 ((#:phases phases '%standard-phases)
3660 `(modify-phases ,phases
3662 (lambda* (#:key outputs #:allow-other-keys)
3663 (let ((out (assoc-ref outputs "out")))
3664 ;; The binary keeps references to gzip, among other things,
3665 ;; which we don't need in the initrd, so strip references.
3666 (remove-store-references "src/loadkeys")
3668 (install-file "src/loadkeys"
3669 (string-append out "/bin")))))
3670 (delete 'post-install)))
3671 ((#:strip-flags _ '())
3673 ((#:allowed-references _ '())
3676 (synopsis "Statically-linked @command{loadkeys} program")
3678 ;; This package is meant to be used internally in the initrd so don't
3680 (properties '((hidden? . #t)))))
3682 (define-public inotify-tools
3684 (name "inotify-tools")
3685 (version "3.22.6.0")
3689 (url "https://github.com/rvoicilas/inotify-tools")
3691 (file-name (git-file-name name version))
3694 "1j9j8k5zjp8m4cl53zjncnll9z4dnvzr4ygmfcjk0ci81i59b18i"))))
3695 (build-system gnu-build-system)
3697 (list autoconf automake libtool))
3700 (list "--disable-static")))
3701 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
3702 (synopsis "Monitor file accesses")
3704 "The inotify-tools packages provides a C library and command-line tools
3705 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3706 (license license:gpl2+)))
3715 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
3716 "kmod-" version ".tar.xz"))
3719 "0am54mi5rk72g5q7k6l6f36gw3r9vwgjmyna43ywcjhqmakyx00b"))
3720 (patches (search-patches "kmod-module-directory.patch"))))
3721 (build-system gnu-build-system)
3729 ("zstd-lib" ,zstd "lib")))
3731 `(#:configure-flags '("--with-xz" "--with-zlib" "--with-zstd"
3732 "--disable-test-modules")
3734 (modify-phases %standard-phases
3735 (add-after 'unpack 'disable-tests
3737 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
3738 (substitute* "Makefile.in"
3739 (("testsuite/test-modprobe") "")
3740 (("testsuite/test-depmod") "")
3741 (("testsuite/test-blacklist") ""))
3743 (add-after 'install 'install-modprobe&co
3744 (lambda* (#:key outputs #:allow-other-keys)
3745 (let* ((out (assoc-ref outputs "out"))
3746 (bin (string-append out "/bin")))
3747 (for-each (lambda (tool)
3749 (string-append bin "/" tool)))
3750 '("insmod" "rmmod" "lsmod" "modprobe"
3751 "modinfo" "depmod"))
3753 (supported-systems (delete "i586-gnu" %supported-systems))
3754 (home-page "https://www.kernel.org/")
3755 (synopsis "Kernel module tools")
3756 (description "Kmod is a set of tools to handle common tasks with Linux
3757 kernel modules like insert, remove, list, check properties, resolve
3758 dependencies and aliases.
3760 These tools are designed on top of libkmod, a library that is shipped with
3761 kmod. The aim is to be compatible with tools, configurations and indices
3762 from the module-init-tools project.")
3763 (license license:gpl2+))) ; library under lgpl2.1+
3765 (define-public earlyoom
3772 (url "https://github.com/rfjakob/earlyoom")
3773 (commit (string-append "v" version))))
3774 (file-name (git-file-name name version))
3777 "16iyn51xlrsbshc7p5xl2338yyfzknaqc538sa7mamgccqwgyvvq"))))
3778 (build-system gnu-build-system)
3782 #~(modify-phases %standard-phases
3783 (delete 'configure) ; no configure script
3784 (add-before 'check 'set-go-HOME
3786 (setenv "HOME" (getcwd))))
3787 (add-before 'check 'disable-failing-test
3789 ;; This test relies on writing to /proc/%d/oom_score_adj.
3790 (substitute* "testsuite_cli_test.go"
3792 (string-append "skipped" match))))))
3794 #~(list (string-append "CC=" #$(cc-for-target))
3795 (string-append "VERSION=v" #$version)
3796 (string-append "PREFIX=" #$output)
3797 (string-append "SYSCONFDIR=" #$output "/etc")
3799 #:test-target "test"))
3802 ;; To generate the manpage.
3803 (if (or (target-x86-64?) (target-x86-32?))
3807 ;; For the test suite.
3810 (home-page "https://github.com/rfjakob/earlyoom")
3811 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
3812 (description "Early OOM is a minimalist out of memory (OOM) daemon that
3813 runs in user space and provides a more responsive and configurable alternative
3814 to the in-kernel OOM killer.")
3815 (license license:expat)))
3817 (define-public eudev
3818 ;; The post-systemd fork, maintained by Gentoo.
3824 (uri (git-reference (url "https://github.com/gentoo/eudev")
3825 (commit (string-append "v" version))))
3826 (file-name (git-file-name name version))
3829 "0dzaqwjnl55f69ird57wb6skahc6l7zs1slsrzqqfhww33icp6av"))
3830 (patches (search-patches "eudev-rules-directory.patch"))))
3831 (build-system gnu-build-system)
3834 (modify-phases %standard-phases
3835 (add-before 'bootstrap 'patch-file-names
3836 (lambda* (#:key inputs native-inputs #:allow-other-keys)
3837 (substitute* "man/make.sh"
3838 (("/usr/bin/xsltproc")
3839 (string-append (assoc-ref
3840 (or native-inputs inputs) "xsltproc")
3841 "/bin/xsltproc")))))
3842 (add-after 'install 'move-static-library
3843 (lambda* (#:key outputs #:allow-other-keys)
3844 (let* ((out (assoc-ref outputs "out"))
3845 (static (assoc-ref outputs "static"))
3846 (source (string-append out "/lib/libudev.a"))
3847 (target (string-append static "/lib/libudev.a")))
3848 (mkdir-p (dirname target))
3849 (link source target)
3850 (delete-file source)
3851 ;; Remove reference to the static library from the .la file
3852 ;; such that Libtool looks for it in the usual places.
3853 (substitute* (string-append out "/lib/libudev.la")
3855 "old_library=''\n")))))
3856 (add-after 'install 'build-hwdb
3857 (lambda* (#:key outputs #:allow-other-keys)
3858 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
3859 ;; similar tools to display product names.
3861 ;; XXX: This can't be done when cross-compiling. Find another way
3862 ;; to generate hwdb.bin for cross-built systems.
3863 (let ((out (assoc-ref outputs "out")))
3864 ,@(if (%current-target-system)
3866 '((invoke (string-append out "/bin/udevadm")
3867 "hwdb" "--update")))))))
3868 #:configure-flags (list "--enable-manpages")))
3870 `(("autoconf" ,autoconf)
3871 ("automake" ,automake)
3873 ("libtool" ,libtool)
3874 ("pkg-config" ,pkg-config)
3877 ("python" ,python-wrapper)
3878 ;; For documentation.
3879 ("docbook-xml" ,docbook-xml-4.2)
3880 ("docbook-xsl" ,docbook-xsl)
3881 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3882 ("xsltproc" ,libxslt)))
3884 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
3885 ;; and similar; it also installs the '60-persistent-storage.rules' file,
3886 ;; which contains the rules to do that.
3887 (list `(,util-linux "lib") ;for blkid
3889 (outputs '("out" "static"))
3890 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
3891 (synopsis "Userspace device management")
3892 (description "Udev is a daemon which dynamically creates and removes
3893 device nodes from /dev/, handles hotplug events and loads drivers at boot
3895 (license license:gpl2+)))
3897 (define-public python-evdev
3899 (name "python-evdev")
3904 (uri (pypi-uri "evdev" version))
3906 (base32 "0kb3636yaw9l8xi8s184w0r0n9ic5dw3b8hx048jf9fpzss4kimi"))))
3907 (build-system python-build-system)
3909 `(#:tests? #f ;no rule for tests
3911 (modify-phases %standard-phases
3912 (add-before 'build 'fix-hard-coded-directory
3913 (lambda* (#:key inputs #:allow-other-keys)
3914 (substitute* "setup.py"
3915 (("/usr/include/linux")
3917 (assoc-ref inputs "kernel-headers") "/include/linux")))
3919 (home-page "https://github.com/gvalkov/python-evdev")
3920 (synopsis "Bindings to the Linux input handling subsystem")
3922 "Python-evdev provides bindings to the generic input event interface in
3923 Linux. The @code{evdev} interface serves the purpose of passing events
3924 generated in the kernel directly to userspace through character devices that
3925 are typically located in @file{/dev/input/}.
3927 This package also comes with bindings to @code{uinput}, the userspace input
3928 subsystem. @code{uinput} allows userspace programs to create and handle input
3929 devices that can inject events directly into the input subsystem.")
3930 (license license:bsd-3)))
3932 (define-public interception-tools
3934 (name "interception-tools")
3936 (home-page "https://gitlab.com/interception/linux/tools")
3941 (commit (string-append "v" version))))
3942 (file-name (git-file-name name version))
3945 "1sbidym6ld4c8cx2ww5i54zsv8v0kygv15zq1yimz44v4my605wf"))))
3946 (build-system cmake-build-system)
3950 (list boost libevdev eudev yaml-cpp))
3952 `(#:tests? #f)) ; no test suite
3953 (synopsis "Utilities for operating on input events of evdev devices")
3955 "Interception Tools provides a composable infrastructure on top of
3956 @code{libudev} and @code{libevdev}. The following utilities are provided:
3959 @item @command{udevmon} --- monitor input devices for launching tasks
3960 @item @command{intercept} --- redirect device input events to stdout
3961 @item @command{uinput} --- redirect device input events from stding to virtual device
3962 @item @command{mux} --- mux streams of input events
3964 ;; Dual-licensed under GPLv3+ or "something else" on request, per
3966 (license license:gpl3+)))
3968 (define-public interception-dual-function-keys
3970 (name "interception-dual-function-keys")
3972 (home-page "https://gitlab.com/interception/linux/plugins/dual-function-keys")
3978 (file-name (git-file-name name version))
3981 "0s49vbg3j4rwh78i8rx8qr7myql09p7b3lhrjl0p7dd98xp6ann6"))))
3982 (build-system gnu-build-system)
3984 (list libevdev yaml-cpp))
3986 `(#:make-flags (list ,(string-append "CC=" (cc-for-target))
3987 ,(string-append "CXX=" (cxx-for-target))
3988 (string-append "PREFIX=" %output))
3990 (modify-phases %standard-phases
3991 (add-after 'unpack 'fix-libevdev-path
3992 (lambda* (#:key inputs #:allow-other-keys)
3993 (let ((libevdev (assoc-ref inputs "libevdev")))
3994 (substitute* "config.mk"
3995 (("/usr/include/libevdev-1.0")
3996 (string-append libevdev "/include/libevdev-1.0")))
3998 ;; No configure script
3999 (delete 'configure))
4000 ;; No tests are included.
4002 (synopsis "Tap for one key, hold for another")
4004 "Dual Function Keys is a plugin for @code{interception-tools} that allows
4005 one to send arbitrary keycodes when a given key is tapped or held.")
4006 (license license:expat)))
4014 (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2."
4016 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
4020 "1m4xpda8vbyd89ca0w8nacvnl4j34yzsa625gn990fb5sh84ab44"))
4021 (modules '((guix build utils)))
4024 (use-modules (guix build utils))
4026 ;; Honor sysconfdir.
4027 (substitute* "make.tmpl.in"
4029 "confdir = @sysconfdir@\n")
4030 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
4031 "DEFAULT_SYS_DIR = @sysconfdir@"))
4033 (patches (search-patches "lvm2-static-link.patch"))))
4034 (build-system gnu-build-system)
4037 pkg-config procps)) ;tests use 'pgrep'
4039 `(("libaio" ,libaio)
4043 (modify-phases %standard-phases
4044 (add-after 'unpack 'update-config
4045 (lambda* (#:key inputs native-inputs #:allow-other-keys)
4046 (install-file (search-input-file
4047 (or native-inputs inputs) "/bin/config.sub")
4049 (install-file (search-input-file
4050 (or native-inputs inputs) "/bin/config.guess")
4052 (add-after 'configure 'set-makefile-shell
4054 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
4056 (setenv "SHELL" (which "sh"))
4058 ;; Replace /bin/sh with the right file name.
4059 (patch-makefile-SHELL "make.tmpl")
4062 #:configure-flags (list (string-append "--sysconfdir="
4063 (assoc-ref %outputs "out")
4065 "--enable-udev_sync"
4066 "--enable-udev_rules"
4067 "--enable-pkgconfig"
4069 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
4071 ;; Make sure programs such as 'dmsetup' can
4072 ;; find libdevmapper.so.
4073 (string-append "LDFLAGS=-Wl,-rpath="
4074 (assoc-ref %outputs "out")
4076 (assoc-ref %outputs "out")
4077 "/lib/device-mapper")
4078 ;; This is needed when cross-compiling.
4079 ,@(if (%current-target-system)
4080 '("ac_cv_func_malloc_0_nonnull=yes"
4081 "ac_cv_func_realloc_0_nonnull=yes")
4084 ;; The tests use 'mknod', which requires root access.
4086 (supported-systems (delete "i586-gnu" %supported-systems))
4087 (home-page "https://sourceware.org/lvm2/")
4088 (synopsis "Logical volume management for Linux")
4090 "LVM2 is the logical volume management tool set for Linux-based systems.
4091 This package includes the user-space libraries and tools, including the device
4092 mapper. Kernel components are part of Linux-libre.")
4094 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
4095 ;; Command-line tools are GPLv2.
4096 (license (list license:gpl2 license:lgpl2.1))))
4098 (define-public lvm2-static
4101 (name "lvm2-static")
4103 ;; Propagate udev because libdevmapper.a depends on libudev.
4104 (propagated-inputs `(("udev:static" ,eudev "static")))
4107 (substitute-keyword-arguments (package-arguments lvm2)
4108 ((#:configure-flags flags '())
4109 ;; LVM2 doesn't use Libtool, hence the custom option.
4110 `(append '("--enable-static_link")
4111 ;; Building dmeventd statically is complicated due to a
4112 ;; requirement on libdevmapper.a, which is being phased out
4113 ;; in favor of libdevice-mapper.a, which in turn is is not
4114 ;; easily made available at dmeventd build time. Just ignore
4115 ;; it until the situation improves.
4116 (delete "--enable-dmeventd" ,flags)))
4118 `(modify-phases ,phases
4119 (add-before 'configure 'adjust-Makefile
4121 ;; These fixes are related to the upstream libdm->device_mapper
4122 ;; migration and will hopefully be fixed upstream in due time.
4123 (substitute* "tools/Makefile.in"
4124 ;; This variable is empty in a static configuration and causes
4125 ;; an erroneous GCC command line.
4126 (("-L\\$\\(interfacebuilddir\\)") "")
4127 ;; Remove obsolete reference to libdevmapper.a.
4128 (("-ldevmapper") ""))
4130 (synopsis "Logical volume management for Linux (statically linked)")))
4132 (define-public thin-provisioning-tools
4134 (name "thin-provisioning-tools")
4140 (url "https://github.com/jthornber/thin-provisioning-tools")
4141 (commit (string-append "v" version))))
4142 (file-name (git-file-name name version))
4144 (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19"))))
4145 (build-system gnu-build-system)
4147 ;; Doesn't build with --enable-testing due to a function name collision
4148 ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released.
4151 `(("automake" ,automake)
4152 ("autoreconf" ,autoconf)))
4154 (list boost expat libaio))
4155 (synopsis "Tools for manipulating the metadata of device-mapper targets")
4156 (description "A suite of tools for manipulating the metadata of the
4157 dm-thin, dm-cache and dm-era device-mapper targets.")
4158 (home-page "https://github.com/jthornber/thin-provisioning-tools")
4159 (license license:gpl3+)))
4161 (define-public watchdogd
4168 (url "https://github.com/troglobit/watchdogd")
4170 (file-name (git-file-name name version))
4173 "05f7igavzimfgbh39fflbkmpya12r854n03dkyimwashcqwchx8f"))))
4174 (build-system gnu-build-system)
4175 (native-inputs (list autoconf automake libtool pkg-config))
4176 (inputs (list libconfuse libite libuev))
4177 (synopsis "Advanced system & process supervisor for Linux")
4178 (description "This package provides an advanced monitor of critical system
4179 resources, supervises the heartbeat of processes, records deadline
4180 transgressions, and initiates a controlled reset if needed.")
4181 (home-page "https://troglobit.com/projects/watchdogd/")
4182 (license license:isc)))
4184 (define-public wireless-tools
4186 (name "wireless-tools")
4191 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/"
4192 "Linux/wireless_tools." version ".tar.gz"))
4194 (base32 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
4197 ;; Remove the older header files that are not free software.
4198 (for-each (lambda (n)
4199 (delete-file (format #f "wireless.~a.h" n)))
4200 '(10 11 12 13 14 15 16 17 18 19 20))))))
4201 (build-system gnu-build-system)
4204 #~(list (string-append "PREFIX=" #$output)
4205 (string-append "INSTALL_MAN=" #$output "/share/man")
4206 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
4209 #~(modify-phases %standard-phases
4211 (lambda* (#:key target #:allow-other-keys)
4213 ;; Cross-compilation: use the cross tools.
4214 (substitute* (find-files "." "Makefile")
4216 (string-append "CC = " target "-gcc\n"))
4218 (string-append "AR = " target "-ar\n"))
4220 (string-append "RANLIB = " target "-ranlib\n")))))))
4222 (synopsis "Tools for manipulating Linux Wireless Extensions")
4223 (description "Wireless Tools are used to manipulate the now-deprecated
4224 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
4225 Extension was an interface allowing you to set Wireless LAN specific
4226 parameters and get the specific stats. It is deprecated in favor the nl80211
4228 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
4229 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
4230 ;; other files are distributed under gpl2.
4231 (license (list license:gpl2 license:lgpl2.1+))))
4239 (uri (string-append "mirror://kernel.org/software/network/crda/"
4240 "crda-" version ".tar.xz"))
4243 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
4244 (patches (search-patches "crda-optional-gcrypt.patch"))))
4245 (build-system gnu-build-system)
4247 `(#:phases (modify-phases %standard-phases
4249 (add-after 'unpack 'gzip-determinism
4251 (substitute* "Makefile"
4252 (("gzip") "gzip --no-name"))
4254 ,@(if (%current-target-system)
4256 'unpack 'fix-pkg-config
4257 (lambda* (#:key target #:allow-other-keys)
4261 (string-append target "-pkg-config")))
4265 'build 'no-werror-no-ldconfig
4267 (substitute* "Makefile"
4269 (("ldconfig") "true"))
4272 'build 'set-regulator-db-file-name
4273 (lambda* (#:key native-inputs inputs #:allow-other-keys)
4274 ;; Tell CRDA where to find our database.
4275 (let ((regdb (assoc-ref (or native-inputs inputs)
4277 (substitute* "crda.c"
4278 (("\"/lib/crda/regulatory.bin\"")
4279 (string-append "\"" regdb
4280 "/lib/crda/regulatory.bin\"")))
4282 #:test-target "verify"
4283 #:make-flags (let ((out (assoc-ref %outputs "out"))
4284 (regdb (assoc-ref %build-inputs "wireless-regdb")))
4286 (string-append "CC=" ,(cc-for-target))
4289 ;; Disable signature-checking on 'regulatory.bin'.
4290 ;; The reason is that this simplifies maintenance
4291 ;; on our side (no need to manage a distro key
4292 ;; pair), and we can guarantee integrity of
4293 ;; 'regulatory.bin' by other means anyway, such as
4294 ;; 'guix gc --verify'. See
4295 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
4299 (string-append "PREFIX=" out)
4300 (string-append "SBINDIR=" out "/sbin/")
4301 (string-append "UDEV_RULE_DIR="
4302 out "/lib/udev/rules.d")
4303 (string-append "LDFLAGS=-Wl,-rpath="
4305 (string-append "REG_BIN=" regdb
4306 "/lib/crda/regulatory.bin")
4308 (native-inputs (list pkg-config wireless-regdb))
4309 (inputs (list libnl))
4311 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
4312 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
4314 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
4315 communication between the kernel Linux and user space for regulatory
4317 (license license:copyleft-next)))
4319 (define-public wireless-regdb
4321 (name "wireless-regdb")
4322 (version "2020.11.20")
4326 "mirror://kernel.org/software/network/wireless-regdb/"
4327 "wireless-regdb-" version ".tar.xz"))
4330 "0liagyi6ppf5w474qk9j4jz5gbvvn8mc8al1dq4b1xrgv28485ml"))
4332 ;; We're building 'regulatory.bin' by ourselves.
4334 (delete-file "regulatory.bin")
4336 (build-system gnu-build-system)
4339 (modify-phases %standard-phases
4340 (add-after 'unpack 'gzip-determinism
4342 (substitute* "Makefile"
4343 (("gzip") "gzip --no-name"))
4345 (add-after 'unpack 'omit-signature
4347 (substitute* "Makefile"
4348 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
4349 ;; don't provide (see below). Disable it.
4350 ((" regulatory\\.db\\.p7s") "")
4351 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
4352 ;; but ‘make install’ depends only on the latter while installing
4353 ;; both (and failing). Depend on it explicitly.
4354 (("^install: " all) (string-append all "regulatory.db ")))
4356 (delete 'configure)) ; no configure script
4358 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
4359 ;; is computed and can be equal to 'maintainer-clean'; when that
4360 ;; happens, we can end up deleting the 'regulatory.bin' file that we
4361 ;; just built. Thus, build things sequentially.
4362 #:parallel-build? #f
4364 #:tests? #f ; no tests
4366 (let ((out (assoc-ref %outputs "out")))
4367 (list (string-append "PREFIX=" out)
4368 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
4370 ;; Leave this empty so that db2bin.py doesn't try to sign
4371 ;; ‘regulatory.bin’. This allows us to avoid managing a key
4372 ;; pair for the whole distribution.
4373 (string-append "REGDB_PRIVKEY=")
4374 ;; Don't generate a public key for the same reason. These are
4375 ;; used as Makefile targets and can't be the empty string.
4376 (string-append "REGDB_PUBCERT=/dev/null")
4377 (string-append "REGDB_PUBKEY=/dev/null")))))
4379 `(("python" ,python-wrapper)))
4381 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
4382 (synopsis "Wireless regulatory database")
4384 "This package contains the wireless regulatory database for the Central
4385 Regulatory Database Agent (CRDA). The database contains information on
4386 country-specific regulations for the wireless spectrum.")
4387 (license license:isc)))
4389 (define-public lm-sensors
4397 (url "https://github.com/groeck/lm-sensors")
4398 (commit (string-append "V" (string-join
4399 (string-split version #\.) "-")))))
4400 (file-name (git-file-name name version))
4402 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
4403 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
4404 (build-system gnu-build-system)
4405 (inputs (list rrdtool perl kmod gnuplot))
4406 (native-inputs (list pkg-config flex bison which))
4407 (outputs '("lib" ; avoid perl in closure
4410 `(#:tests? #f ; no 'check' target
4411 #:make-flags (list (string-append "PREFIX=" %output)
4412 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
4413 (string-append "INCLUDEDIR="
4414 (assoc-ref %outputs "lib") "/include")
4415 (string-append "MANDIR=" %output "/share/man")
4416 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
4418 (modify-phases %standard-phases
4420 (add-before 'build 'patch-exec-paths
4421 (lambda* (#:key inputs outputs #:allow-other-keys)
4422 (substitute* "prog/detect/sensors-detect"
4424 (string-append "`" (assoc-ref inputs "coreutils")
4426 (("(`|\")modprobe" all open-quote)
4427 (string-append open-quote
4428 (assoc-ref inputs "kmod")
4430 (substitute* '("prog/pwm/pwmconfig"
4431 "prog/pwm/fancontrol")
4433 (search-input-file inputs "/bin/gnuplot"))
4435 (string-append (search-input-file inputs "/bin/cat")
4438 (string-append (search-input-file inputs
4441 (string-trim-right match)))
4444 (string-append (search-input-file inputs "/bin/sed")
4447 (string-append (search-input-file inputs "/bin/cut")
4450 (string-append (search-input-file inputs "/bin/sleep")
4453 (string-append (search-input-file inputs "/bin/readlink")
4455 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
4456 (synopsis "Utilities to read temperature/voltage/fan sensors")
4458 "Lm-sensors is a hardware health monitoring package for Linux. It allows
4459 you to access information from temperature, voltage, and fan speed sensors.
4460 It works with most newer systems.")
4461 (license license:gpl2+)))
4463 (define-public iucode-tool
4465 (name "iucode-tool")
4469 (uri (string-append "https://gitlab.com/iucode-tool/releases"
4470 "/raw/latest/iucode-tool_" version ".tar.xz"))
4473 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
4474 (build-system gnu-build-system)
4475 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
4476 (synopsis "Manipulate Intel microcode bundles")
4478 "@command{iucode_tool} is a utility to work with microcode packages for
4479 Intel processors. It can convert between formats, extract specific versions,
4480 create a firmware image suitable for the Linux kernel, and more.")
4481 ;; cpuid.h is available for i686, x86_64, and ia64.
4482 (supported-systems '("i686-linux" "x86_64-linux"))
4483 (license license:gpl2+)))
4485 (define-public i2c-tools
4492 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
4496 "1y0fphjd5ah2j886x8i175r7viq0hmx666hyca0wi4dzrm290qxk"))))
4497 (build-system gnu-build-system)
4499 `(#:tests? #f ; no 'check' target
4501 ,#~(list (string-append "PREFIX=" #$output)
4502 (string-append "LDFLAGS+=-Wl,-rpath=" #$output "/lib")
4503 (string-append "CC=" #$(cc-for-target)))
4504 ;; No configure script.
4505 #:phases (modify-phases %standard-phases (delete 'configure))))
4508 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
4509 (synopsis "I2C tools for Linux")
4511 "The i2c-tools package contains a heterogeneous set of I2C tools for
4512 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
4513 EEPROM decoding scripts, EEPROM programming tools, and a python module for
4515 (license license:gpl2+)))
4517 (define-public i2c-tools-3
4525 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
4526 version ".tar.bz2"))
4528 (base32 "0hd4c1w8lnwc3j95h3vpd125170l1d4myspyrlpamqx6wbr6jpnv"))))
4530 (substitute-keyword-arguments (package-arguments i2c-tools)
4532 #~(list (string-append "prefix=" #$output)
4533 (string-append "CC=" #$(cc-for-target))))))))
4535 (define-public xsensors
4542 "http://www.linuxhardware.org/xsensors/xsensors-"
4546 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
4547 (build-system gnu-build-system)
4548 (inputs `(("lm-sensors" ,lm-sensors "lib")
4550 (native-inputs (list pkg-config))
4553 (modify-phases %standard-phases
4554 (add-before 'configure 'enable-deprecated
4556 (substitute* "src/Makefile.in"
4557 (("-DGDK_DISABLE_DEPRECATED") "")
4558 (("-DGTK_DISABLE_DEPRECATED") ""))
4560 (add-before 'configure 'remove-Werror
4562 (substitute* '("configure" "src/Makefile.in")
4565 (home-page "http://www.linuxhardware.org/xsensors/")
4566 (synopsis "Hardware health information viewer")
4568 "Xsensors reads data from the libsensors library regarding hardware
4569 health such as temperature, voltage and fan speed and displays the information
4570 in a digital read-out.")
4571 (license license:gpl2+)))
4576 (version (package-version linux-libre))
4577 (source (package-source linux-libre))
4578 (build-system gnu-build-system)
4581 (modify-phases %standard-phases
4583 (lambda* (#:key inputs #:allow-other-keys)
4584 (setenv "SHELL_PATH" (which "bash"))
4585 (chdir "tools/perf")
4587 ;; This file hard-codes file system layouts for specific distros
4588 ;; but not for ours; address that. With this change, one can run
4589 ;; "perf report --symfs=$HOME/.guix-profile" (without
4590 ;; "/lib/debug") and 'perf' should be able to find separate debug
4592 (substitute* "util/dso.c"
4595 #:make-flags (list (string-append "prefix="
4596 (assoc-ref %outputs "out"))
4600 ;; By default, 'config/Makefile' uses lib64 on
4601 ;; x86_64. Work around that.
4603 #:tests? #f)) ;no tests
4608 ;; There are build scripts written in these languages.
4613 (list slang ;for the interactive TUI
4615 python-2 ;'perf' links against libpython
4617 libiberty ;used alongside BDF for symbol demangling
4618 libunwind ;better stack walking
4619 numactl ;for 'perf bench numa mem'
4621 libxml2 ;for $XML_CATALOG_FILES
4625 (home-page "https://perf.wiki.kernel.org/")
4626 (synopsis "Linux profiling with performance counters")
4628 "perf is a tool suite for profiling using hardware performance counters,
4629 with support in the Linux kernel. perf can instrument CPU performance
4630 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
4631 of lightweight profiling. This package contains the user-land tools and in
4632 particular the @code{perf} command.")
4633 (license (package-license linux-libre))))
4635 (define-public pflask
4642 (url "https://github.com/ghedo/pflask")
4643 (commit (string-append "v" version))))
4644 (file-name (git-file-name name version))
4647 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
4648 (build-system cmake-build-system)
4650 '(#:tests? #f)) ; no tests
4651 (home-page "https://ghedo.github.io/pflask/")
4652 (synopsis "Simple tool for creating Linux namespace containers")
4653 (description "pflask is a simple tool for creating Linux namespace
4654 containers. It can be used for running a command or even booting an OS inside
4655 an isolated container, created with the help of Linux namespaces. It is
4656 similar in functionality to chroot, although pflask provides better isolation
4657 thanks to the use of namespaces.")
4658 (license license:bsd-2)))
4660 (define-public singularity
4662 (name "singularity")
4666 (uri (string-append "https://github.com/singularityware/singularity/"
4667 "releases/download/" version
4668 "/singularity-" version ".tar.gz"))
4671 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
4672 (modules '((guix build utils)))
4675 ;; Do not create directories in /var.
4676 (substitute* "Makefile.in"
4677 (("\\$\\(MAKE\\) .*install-data-hook") ""))
4679 ;; The original source overrides PATH so that it points to
4680 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
4681 ;; on Guix System. Leave PATH unchanged so we refer to the
4682 ;; installed Coreutils, grep, etc.
4683 (substitute* "bin/singularity.in"
4685 (string-append "#" all "\n")))
4687 (substitute* (find-files "libexec/cli" "\\.exec$")
4688 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
4690 (string-append "/run/setuid-programs/singularity-"
4691 program "-helper")))
4693 ;; These squashfs mount options are apparently no longer
4694 ;; supported since Linux-libre 5.4.5.
4695 (substitute* "src/lib/image/squashfs/mount.c"
4696 (("\"errors=remount-ro\"")
4699 (build-system gnu-build-system)
4701 `(#:configure-flags '("--localstatedir=/var")
4703 (modify-phases %standard-phases
4704 (add-after 'unpack 'patch-references
4706 (substitute* "libexec/cli/build.exec.in"
4707 (("-mksquashfs") (string-append "-" (which "mksquashfs"))))
4708 (substitute* (append
4709 (find-files "libexec" "functions")
4710 (find-files "libexec/bootstrap-scripts" ".*sh$")
4711 (find-files "libexec/cli" ".*exec$"))
4713 (string-append "| " (which "grep") " "))
4715 (string-append (which "egrep") " "))
4717 (string-append " " (which "sed") " ")))
4719 (add-after 'install 'set-PATH
4720 (lambda* (#:key inputs outputs #:allow-other-keys)
4721 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
4722 (let ((out (assoc-ref outputs "out"))
4723 (coreutils (assoc-ref inputs "coreutils")))
4724 (wrap-program (string-append out "/bin/singularity")
4725 `("PATH" ":" = (,(string-append coreutils "/bin"))))
4726 (substitute* (string-append out "/bin/run-singularity")
4727 (("/usr/bin/env singularity")
4728 (string-append (which "env") " "
4729 out "/bin/singularity")))
4732 `(("libarchive" ,libarchive)
4733 ("python" ,python-wrapper)
4735 ("squashfs-tools" ,squashfs-tools)))
4736 (home-page "https://singularity.lbl.gov/")
4737 (synopsis "Container platform")
4738 (description "Singularity is a container platform supporting a number of
4739 container image formats. It can build SquashFS container images or import
4740 existing Docker images. Singularity requires kernel support for container
4741 isolation or root privileges.")
4742 (license license:bsd-3)))
4744 (define-public hdparm
4750 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
4751 "hdparm-" version ".tar.gz"))
4754 "16l5mc6dpqkzhwsljyzks05pq89l2lw09qkx50ks1zn3a5lranri"))))
4755 (build-system gnu-build-system)
4758 #~(list (string-append "binprefix=" #$output)
4759 (string-append "manprefix=" #$output)
4760 (string-append "CC=" #$(cc-for-target))
4761 ;; Let Guix strip binaries and not break cross-compilation.
4764 #~(modify-phases %standard-phases
4765 (delete 'configure)) ; no configure script
4766 #:tests? #f)) ; no test suite
4767 (home-page "https://sourceforge.net/projects/hdparm/")
4768 (synopsis "View and tune ATA disk drive parameters")
4770 "@command{hdparm} is a command-line utility to control ATA controllers and
4771 disk drives. It can increase performance and/or reliability by careful tuning
4772 of hardware settings like power and acoustic management, DMA modes, and caching.
4773 It can also display detailed device information, or be used as a simple
4774 performance benchmarking tool.
4776 @command{hdparm} provides a command line interface to various Linux kernel
4777 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
4778 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
4779 Translation (@dfn{SAT}) are also supported.")
4780 (license (license:non-copyleft "file://LICENSE.TXT"))))
4782 (define-public nvme-cli
4786 (home-page "https://github.com/linux-nvme/nvme-cli")
4791 (commit (string-append "v" version))))
4793 (base32 "130x5cf6kkcnyg5qd35igii249ysfjnbxp1pxfwkickmqg3d007z"))
4794 (file-name (git-file-name name version))))
4795 (build-system gnu-build-system)
4798 #~(list (string-append "CC=" #$(cc-for-target)))
4800 #~(modify-phases %standard-phases
4801 (delete 'configure) ; no ./configure script
4804 (invoke "make" "install-spec" "PREFIX="
4805 (string-append "DESTDIR=" #$output)))))
4806 ;; The tests require sysfs, which is not accessible from from the
4807 ;; build environment.
4809 (synopsis "NVM-Express user space tooling for Linux")
4810 (description "Nvme-cli is a utility to provide standards compliant tooling
4811 for NVM-Express drives. It was made specifically for Linux as it relies on the
4812 IOCTLs defined by the mainline kernel driver.")
4813 (license license:gpl2+)))
4815 (define-public rfkill
4821 (uri (string-append "mirror://kernel.org/software/network/"
4822 name "/" name "-" version ".tar.xz"))
4825 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
4826 (build-system gnu-build-system)
4828 `(#:make-flags (list "CC=gcc"
4829 (string-append "PREFIX=" %output))
4830 #:phases (modify-phases %standard-phases
4831 (delete 'configure))
4833 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
4834 (synopsis "Tool for enabling and disabling wireless devices")
4836 "rfkill is a simple tool for accessing the rfkill device interface,
4837 which is used to enable and disable wireless networking devices, typically
4838 WLAN, Bluetooth and mobile broadband.")
4839 (license (license:non-copyleft "file://COPYING"
4840 "See COPYING in the distribution."))
4841 ;; rfkill is part of util-linux as of 2.31.
4842 (properties `((superseded . ,util-linux)))))
4850 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
4851 version "/" name "-" version ".tar.gz"))
4854 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
4855 (build-system gnu-build-system)
4856 (home-page "http://acpiclient.sourceforge.net")
4857 (synopsis "Display information on ACPI devices")
4858 (description "@code{acpi} attempts to replicate the functionality of the
4859 \"old\" @code{apm} command on ACPI systems, including battery and thermal
4860 information. It does not support ACPI suspending, only displays information
4861 about ACPI devices.")
4862 (license license:gpl2+)))
4864 (define-public acpid
4870 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
4874 "1s6vf8lqwrcqi14k0ww47pk1kifbvxin73ha7mk1njmk7qdzfmh8"))))
4875 (build-system gnu-build-system)
4876 (home-page "https://sourceforge.net/projects/acpid2/")
4877 (synopsis "Daemon for delivering ACPI events to user-space programs")
4879 "acpid is designed to notify user-space programs of Advanced
4880 Configuration and Power Interface (ACPI) events. acpid should be started
4881 during the system boot, and will run as a background process. When an ACPI
4882 event is received from the kernel, acpid will examine the list of rules
4883 specified in /etc/acpi/events and execute the rules that match the event.")
4884 (license license:gpl2+)))
4886 (define-public sysfsutils
4895 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
4898 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
4899 (build-system gnu-build-system)
4900 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
4901 (synopsis "System utilities based on Linux sysfs")
4903 "These are a set of utilities built upon sysfs, a virtual file system in
4904 Linux kernel versions 2.5+ that exposes a system's device tree. The package
4905 also contains the libsysfs library.")
4906 ;; The library is under lgpl2.1+ (all files say "or any later version").
4907 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
4908 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
4910 (define-public cpufrequtils
4911 (let ((commit "a2f0c39d5f21596bb9f5223e895c0ff210b265d0")
4914 (name "cpufrequtils")
4915 (version (git-version "008" revision commit ))
4921 (url "https://git.kernel.org/pub/scm/linux/kernel/git/brodo/cpufrequtils.git")
4923 (file-name (git-file-name name version))
4925 (base32 "01n2hp6v89cilqqvqvlcprphyhnljsjclh4h1zf3b1l7ypz29lbp"))))
4926 (build-system gnu-build-system)
4928 `(#:tests? #f ; no test suite
4930 (let ((out (assoc-ref %outputs "out")))
4931 (list "PROC=false" ; obsoleted by sysfs in Linux 2.6(!)
4932 (string-append "CC=" ,(cc-for-target))
4933 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
4935 (string-append "bindir=" out "/bin")
4936 (string-append "sbindir=" out "/sbin")
4937 (string-append "mandir=" out "/share/man")
4938 (string-append "includedir=" out "/include")
4939 (string-append "libdir=" out "/lib")
4940 (string-append "localedir=" out "/share/locale")
4941 (string-append "docdir=" out "/share/doc/" ,name)))
4943 (modify-phases %standard-phases
4944 (delete 'configure)))) ; no configure script
4946 `(("gettext" ,gettext-minimal)))
4948 "http://ftp.be.debian.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html")
4949 (synopsis "Utilities to get and set CPU frequency on Linux")
4951 "The cpufrequtils suite contains utilities to retrieve CPU frequency
4952 information, and set the CPU frequency if supported, using the cpufreq
4953 capabilities of the Linux kernel.")
4954 (license license:gpl2))))
4956 (define-public libite
4964 (url "https://github.com/troglobit/libite")
4965 (commit (string-append "v" version))))
4966 (file-name (git-file-name name version))
4968 (base32 "0i27ppb557kdc1hm7nf0f5r7sxvqma31pr57h79whl6qcp28gy4a"))))
4969 (build-system gnu-build-system)
4972 (list "--disable-static")
4974 (modify-phases %standard-phases
4975 (add-after 'unpack 'fix-tests
4976 (lambda* (#:key inputs #:allow-other-keys)
4977 ;; replace paths to the executables
4978 (substitute* "test/which.c"
4980 (search-input-file inputs "/bin/which"))
4983 (search-input-file inputs "/bin/ls") "\"")))
4984 ;; create pidfile in /tmp instead of /var
4985 (substitute* "test/pidfile.c" (("/var/tmp") "/tmp")))))))
4986 (native-inputs (list autoconf automake libtool which))
4987 (synopsis "Library providing missing pieces in GNU libc")
4988 (description "This package provides many of the missing pieces in GNU
4989 libc. Most notably the string functions: strlcpy(3), strlcat(3) and the *BSD
4990 sys/queue.h and sys/tree.h API's.")
4991 (home-page "https://troglobit.com/projects/libite/")
4992 (license license:expat)))
4994 (define-public libuev
5002 (url "https://github.com/troglobit/libuev")
5003 (commit (string-append "v" version))))
5004 (file-name (git-file-name name version))
5007 "0ih82lxfdcq179kknzdl5c8vi1l0n5j7yh68y8f6kwsrm457paf7"))))
5008 (build-system gnu-build-system)
5009 (native-inputs (list autoconf automake libtool))
5010 (synopsis "Lightweight event loop library for epoll family APIs")
5011 (description "This package provides small event loop that wraps the
5012 epoll family of APIs.")
5013 (home-page "https://troglobit.com/projects/libuev/")
5014 (license license:expat)))
5016 (define-public libraw1394
5023 "mirror://kernel.org/linux/libs/ieee1394/"
5024 name "-" version ".tar.xz"))
5027 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
5028 (build-system gnu-build-system)
5029 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
5030 (synopsis "Interface library for the Linux IEEE1394 drivers")
5032 "Libraw1394 is the only supported interface to the kernel side raw1394 of
5033 the Linux IEEE-1394 subsystem, which provides direct access to the connected
5034 1394 buses to user space. Through libraw1394/raw1394, applications can directly
5035 send to and receive from other nodes without requiring a kernel driver for the
5036 protocol in question.")
5037 (license license:lgpl2.1+)))
5039 (define-public libavc1394
5045 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
5046 name "-" version ".tar.gz"))
5049 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
5050 (build-system gnu-build-system)
5054 (list libraw1394)) ; required by libavc1394.pc
5055 (home-page "https://sourceforge.net/projects/libavc1394/")
5056 (synopsis "AV/C protocol library for IEEE 1394")
5058 "Libavc1394 is a programming interface to the AV/C specification from
5059 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
5060 (license license:lgpl2.1+)))
5062 (define-public libiec61883
5064 (name "libiec61883")
5069 "mirror://kernel.org/linux/libs/ieee1394/"
5070 name "-" version ".tar.xz"))
5073 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
5074 (build-system gnu-build-system)
5078 (list libraw1394)) ; required by libiec61883.pc
5079 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
5080 (synopsis "Isochronous streaming media library for IEEE 1394")
5082 "The libiec61883 library provides a higher level API for streaming DV,
5083 MPEG-2 and audio over Linux IEEE 1394.")
5084 (license license:lgpl2.1+)))
5086 (define-public mdadm
5093 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
5097 "07ghmibmbnkdy91ng87zdllzicm299l20dhs9m5bfjw6f1b22726"))))
5098 (build-system gnu-build-system)
5101 #~(list (string-append "CC=" #$(cc-for-target))
5104 ;; TODO: tell it where to find 'sendmail'
5105 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
5106 (string-append "BINDIR=" #$output "/sbin")
5107 (string-append "MANDIR=" #$output "/share/man")
5108 (string-append "UDEVDIR=" #$output "/lib/udev"))
5110 #~(modify-phases %standard-phases
5111 (add-before 'build 'patch-program-paths
5112 (lambda* (#:key native-inputs inputs #:allow-other-keys)
5113 (let ((coreutils (assoc-ref (or native-inputs inputs)
5115 (substitute* "udev-md-raid-arrays.rules"
5116 (("/usr/bin/(readlink|basename)" all program)
5117 (string-append coreutils "/bin/" program))))))
5118 (add-before 'build 'remove-W-error
5120 ;; We cannot build with -Werror on i686 due to a
5121 ;; 'sign-compare' warning in util.c.
5122 (substitute* "Makefile"
5124 (delete 'configure))
5125 ;; Tests must be run as root.
5129 (supported-systems (delete "i586-gnu" %supported-systems))
5130 (home-page "http://neil.brown.name/blog/mdadm")
5131 (synopsis "Tool for managing Linux Software RAID arrays")
5133 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
5134 assemble, report on, and monitor arrays. It can also move spares between raid
5135 arrays when needed.")
5136 (license license:gpl2+)))
5138 (define-public mdadm-static
5141 (name "mdadm-static")
5143 (substitute-keyword-arguments (package-arguments mdadm)
5144 ((#:make-flags flags)
5145 #~(cons* "LDFLAGS = -static"
5146 "CXFLAGS = -DNO_LIBUDEV"
5149 #~(modify-phases #$phases
5150 (add-after 'install 'remove-cruft
5151 (lambda* (#:key outputs #:allow-other-keys)
5152 (let* ((out (assoc-ref outputs "out"))
5153 (precious? (lambda (file)
5154 (member file '("." ".." "sbin"))))
5155 (directories (scandir out (negate precious?))))
5156 (with-directory-excursion out
5157 (for-each delete-file-recursively directories)
5158 (remove-store-references "sbin/mdadm")
5159 (delete-file "sbin/mdmon")))))))
5160 ((#:modules modules %gnu-build-system-modules)
5161 `((ice-9 ftw) ,@modules))
5162 ((#:strip-flags _ '())
5163 ''("--strip-all")) ;strip a few extra KiB
5164 ((#:allowed-references _ '("out"))
5165 '("out")))) ;refer only self
5166 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
5168 (define-public multipath-tools
5170 (name "multipath-tools")
5172 (home-page "https://github.com/opensvc/multipath-tools")
5175 (uri (git-reference (url home-page) (commit version)))
5176 (file-name (git-file-name name version))
5179 "09m3vs798qb3xk0v7s3hy0nhw0dznkxjb56671kqj961h7zhg47b"))
5180 (modules '((guix build utils)))
5183 ;; Drop bundled valgrind headers.
5184 (delete-file-recursively "third-party")
5185 (substitute* '("multipathd/main.c"
5186 "libmultipath/debug.c")
5187 (("#include \"../third-party/")
5189 (build-system gnu-build-system)
5192 #:test-target "test"
5193 #:parallel-build? #f ;XXX: broken since 0.8.4
5194 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
5195 (string-append "DESTDIR=" #$output)
5196 ;; Install Udev rules below this directory, relative
5200 #~(modify-phases %standard-phases
5201 (add-after 'unpack 'patch-source
5202 (lambda* (#:key inputs #:allow-other-keys)
5203 (let ((libdevmapper.h
5204 (search-input-file inputs "include/libdevmapper.h"))
5206 (search-input-file inputs "include/libudev.h")))
5207 (substitute* "Makefile.inc"
5208 (("/bin/echo") "echo")
5209 (("\\$\\(prefix\\)/usr") "$(prefix)")
5210 ;; Do not save timestamp to avoid gzip "timestamp
5211 ;; out-of-range" warnings.
5212 (("gzip -9") "gzip -9n"))
5213 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
5214 (("/usr/include/libdevmapper.h") libdevmapper.h)
5215 (("/usr/include/libudev.h") libudev.h)))))
5216 (add-after 'unpack 'skip-failing-tests
5218 ;; This test and the module's setup() test an arbitrary block
5219 ;; device node name, but the build environment has none.
5220 (substitute* "tests/devt.c"
5221 (("return get_one_devt.*") "return 0;\n")
5222 (("cmocka_unit_test\\(test_devt2devname_devt_good\\),") ""))
5223 ;; The above triggers -Werror=unused-function. Ignore it.
5224 (substitute* "tests/Makefile"
5225 (("CFLAGS \\+= " match)
5226 (string-append match "-Wno-error=unused-function ")))))
5227 (delete 'configure) ;no configure script
5228 (add-before 'build 'set-LDFLAGS
5230 ;; Note: this cannot be passed as a make flag because that will
5231 ;; override the build system LDFLAGS.
5233 (string-append "-Wl,-rpath=" #$output "/lib")))))))
5236 (list perl pkg-config valgrind
5246 (synopsis "Access block devices through multiple paths")
5248 "This package provides the following binaries to drive the
5249 Linux Device Mapper multipathing driver:
5251 @item @command{multipath} - Device mapper target autoconfig.
5252 @item @command{multipathd} - Multipath daemon.
5253 @item @command{mpathpersist} - Manages SCSI persistent reservations on
5254 @code{dm} multipath devices.
5255 @item @command{kpartx} - Create device maps from partition tables.
5257 (license (list license:gpl2+ ;main distribution
5258 license:lgpl2.0+)))) ;libmpathcmd/mpath_cmd.h
5260 (define-public libaio
5267 (string-append "https://releases.pagure.org/libaio/"
5268 name "-" version ".tar.gz")))
5271 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
5272 (build-system gnu-build-system)
5275 #~(let ((target #$(%current-target-system)))
5276 ;; XXX TODO: Replace with simply #$OUTPUT on core-updates.
5277 (list (string-append "prefix=" #$(if (%current-target-system)
5282 (string-append (assoc-ref %build-inputs
5284 "/bin/" target "-gcc")
5286 #:test-target "partcheck" ; need root for a full 'check'
5288 #~(modify-phases %standard-phases
5289 (delete 'configure) ; no configure script
5290 ;; TODO: Make this phase unconditional on core-updates.
5291 #$@(if (target-riscv64?)
5292 '((add-before 'check 'patch-for-riscv-support
5294 ;; Taken from the upstream repo:
5295 ;; https://pagure.io/libaio/c/f322f467c3cd2ac4d8d08a19bd281eabb65433b1?branch=master
5296 (substitute* "harness/cases/16.t"
5297 (("(elif defined\\(__aarch64__\\))" all)
5298 (string-append all " || defined(__riscv)"))
5299 (("(endif /* __aarch64__)" all)
5300 (string-append all " || __riscv "))))))
5302 (home-page "https://pagure.io/libaio")
5303 (synopsis "Linux-native asynchronous I/O access library")
5305 "This library enables userspace to use Linux kernel asynchronous I/O
5306 system calls, important for the performance of databases and other advanced
5308 (license license:lgpl2.1+)))
5310 (define-public blktrace
5311 ;; Take a newer commit to get the fix for CVE-2018-10689.
5312 (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
5316 (version (git-version "1.2.0" revision commit))
5318 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
5325 (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
5326 (file-name (git-file-name name version))))
5327 (build-system gnu-build-system)
5330 (list ,(string-append "CC=" (cc-for-target))
5331 (string-append "prefix=" %output))
5332 #:tests? #f ; no tests
5334 (modify-phases %standard-phases
5335 (delete 'configure) ; no configure script
5336 (add-after 'unpack 'fix-gnuplot-path
5337 (lambda* (#:key inputs #:allow-other-keys)
5338 (let ((gnuplot (assoc-ref inputs "gnuplot")))
5339 (substitute* "btt/bno_plot.py"
5341 (string-append gnuplot "/bin/gnuplot %s")))
5344 `(("libaio" ,libaio)
5345 ("gnuplot" ,gnuplot)
5346 ("python" ,python-wrapper))) ;for 'bno_plot.py'
5347 (synopsis "Block layer IO tracing mechanism")
5348 (description "Blktrace is a block layer IO tracing mechanism which provides
5349 detailed information about request queue operations to user space. It extracts
5350 event traces from the kernel (via the relaying through the debug file system).")
5351 (license license:gpl2))))
5359 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
5361 (patches (search-patches "sbc-fix-build-non-x86.patch"))
5364 "1liig5856crb331dps18mp0s13zbkv7yh007zqhq97m94fcddfhc"))))
5365 (build-system gnu-build-system)
5370 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
5371 (synopsis "Bluetooth subband audio codec")
5373 "The SBC is a digital audio encoder and decoder used to transfer data to
5374 Bluetooth audio output devices like headphones or loudspeakers.")
5375 (license license:gpl2+)))
5377 (define-public bluez
5384 "mirror://kernel.org/linux/bluetooth/bluez-"
5388 "0fs2kjsdhylxniqhii63i85fjszbqbz3iddwmgz4nmbr472xdbw3"))))
5389 (build-system gnu-build-system)
5392 (let ((out (assoc-ref %outputs "out")))
5393 (list "--sysconfdir=/etc"
5394 "--localstatedir=/var"
5397 ;; TODO: is this needed? Not installed by default since 5.55.
5399 ;; Install dbus/udev files to the correct location.
5400 (string-append "--with-dbusconfdir=" out "/etc")
5401 (string-append "--with-udevdir=" out "/lib/udev")))
5403 (modify-phases %standard-phases
5404 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
5405 ;; issue (discussion on upstream mailing list:
5406 ;; https://marc.info/?t=149578476300002&r=1&w=2)
5407 (add-before 'check 'skip-wonky-test
5409 (substitute* "unit/test-gatt.c"
5410 (("tester_init\\(&argc, &argv\\);") "return 77;"))
5412 (add-after 'install 'post-install
5413 (lambda* (#:key inputs outputs #:allow-other-keys)
5414 (let* ((out (assoc-ref outputs "out"))
5415 (servicedir (string-append out "/share/dbus-1/services"))
5416 (service "obexd/src/org.bluez.obex.service")
5417 (rule (string-append
5418 out "/lib/udev/rules.d/97-hid2hci.rules")))
5419 ;; Install the obex dbus service file.
5420 (substitute* service
5422 (string-append out "/libexec/bluetooth/obexd")))
5423 (install-file service servicedir)
5424 ;; Fix paths in the udev rule.
5426 (("hid2hci --method")
5427 (string-append out "/lib/udev/hid2hci --method"))
5429 (search-input-file inputs "/bin/udevadm")))
5432 `(("pkg-config" ,pkg-config)
5433 ("rst2man" ,python-docutils)
5434 ("gettext" ,gettext-minimal)))
5436 (list glib dbus eudev libical readline))
5437 (home-page "http://www.bluez.org/")
5438 (synopsis "Linux Bluetooth protocol stack")
5440 "BlueZ provides support for the core Bluetooth layers and protocols. It
5441 is flexible, efficient and uses a modular implementation.")
5442 (license license:gpl2+)))
5444 (define-public fuse-exfat
5451 "https://github.com/relan/exfat/releases/download/v"
5452 version "/" name "-" version ".tar.gz"))
5455 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
5456 (build-system gnu-build-system)
5461 (home-page "https://github.com/relan/exfat")
5462 (synopsis "Mount exFAT file systems")
5464 "This package provides a FUSE-based file system that provides read and
5465 write access to exFAT devices.")
5466 (license license:gpl2+)))
5468 (define-public fuseiso
5471 (version "20070708")
5474 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
5475 version "/fuseiso-" version ".tar.bz2"))
5478 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
5479 (build-system gnu-build-system)
5483 (list fuse glib zlib))
5484 (home-page "https://sourceforge.net/projects/fuseiso/")
5485 (synopsis "Mount ISO file system images")
5487 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
5488 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
5489 Ridge, Joliet, and zisofs.")
5490 (license license:gpl2)))
5499 "https://www.nico.schottelius.org/software/gpm/archives/"
5500 "gpm-" version ".tar.bz2"))
5501 (patches (search-patches "gpm-glibc-2.26.patch"))
5504 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))
5505 (modules '((guix build utils)))
5508 ;; Take a patch from upstream to fix building with -fno-common,
5509 ;; which is default in GCC 10:
5510 ;; https://github.com/telmich/gpm/pull/37
5511 (substitute* "src/headers/daemon.h"
5512 (("^time_t[[:blank:]]+last_selection_time;")
5513 "extern time_t last_selection_time;"))))))
5514 (build-system gnu-build-system)
5516 '(#:phases (modify-phases %standard-phases
5519 ;; The tarball was not generated with 'make dist' so we
5520 ;; need to bootstrap things ourselves.
5521 (substitute* "autogen.sh"
5522 (("/bin/sh") (which "sh")))
5523 (invoke "./autogen.sh")
5524 (patch-makefile-SHELL "Makefile.include.in")
5527 ;; Make sure programs find libgpm.so.
5528 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
5529 (assoc-ref %outputs "out")
5538 (home-page "https://www.nico.schottelius.org/software/gpm/")
5539 (synopsis "Mouse support for the Linux console")
5541 "The GPM (general-purpose mouse) daemon is a mouse server for
5542 applications running on the Linux console. It allows users to select items
5543 and copy/paste text in the console and in xterm.")
5544 (license license:gpl2+)))
5546 (define-public btrfs-progs
5548 (name "btrfs-progs")
5552 (uri (string-append "mirror://kernel.org/linux/kernel/"
5553 "people/kdave/btrfs-progs/"
5554 "btrfs-progs-v" version ".tar.xz"))
5557 "0mbj3j2fpjds9i9gm8kk8a20yjacc562ibd1v9a96bpmrxfag63f"))))
5558 (build-system gnu-build-system)
5560 "static")) ; static versions of the binaries in "out"
5563 ;; The ‘Python support’ was never actually installed by previous
5564 ;; versions of this package, but did prevent cross-compilation.
5565 (list "--disable-python")
5566 #:phases (modify-phases %standard-phases
5567 (add-after 'unpack 'patch-makefile
5568 (lambda* (#:key outputs #:allow-other-keys)
5569 (substitute* "Makefile"
5570 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
5571 (string-append (assoc-ref outputs "out")
5572 "/lib/udev/rules.d")))))
5573 (add-after 'build 'build-static
5574 (lambda _ (invoke "make" "static")))
5575 (add-after 'install 'install-bash-completion
5576 (lambda* (#:key outputs #:allow-other-keys)
5577 (let* ((out (assoc-ref outputs "out"))
5578 (bashcomp (string-append out "/etc/bash_completion.d")))
5580 (copy-file "btrfs-completion"
5581 (string-append bashcomp "/btrfs")))))
5582 (add-after 'install 'install-static
5583 (let ((staticbin (string-append (assoc-ref %outputs "static")
5587 (string-append "bindir=" staticbin)
5588 "install-static")))))
5589 #:tests? #f ; XXX: require the 'btrfs' kernel module.
5590 #:test-target "test"
5591 #:parallel-tests? #f)) ; tests fail when run in parallel
5592 (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
5595 ("util-linux:lib" ,util-linux "lib") ;for libblkid and libuuid
5596 ("util-linux:static" ,util-linux "static") ;ditto
5598 ("zlib:static" ,zlib "static")
5599 ("zstd" ,zstd "lib")
5600 ("zstd:static" ,zstd "static")))
5601 (native-inputs `(("pkg-config" ,pkg-config)
5602 ;; For building documentation.
5603 ("python-sphinx" ,python-sphinx)
5607 ("grep" ,grep) ; need Perl regexp support
5609 ("liburing" ,liburing)
5610 ("util-linux" ,util-linux) ; for fallocate
5612 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
5613 (synopsis "Create and manage btrfs copy-on-write file systems")
5614 (description "Btrfs is a @acronym{CoW, copy-on-write} file system for Linux
5615 aimed at implementing advanced features while focusing on fault tolerance,
5616 repair and easy administration.")
5617 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
5618 ;; GPL2: Everything else.
5619 (license (list license:gpl2 license:gpl2+))))
5621 (define-public btrfs-progs/static
5623 (name "btrfs-progs-static")
5624 (version (package-version btrfs-progs))
5626 (build-system trivial-build-system)
5628 `(("btrfs-progs:static" ,btrfs-progs "static")))
5630 `(#:modules ((guix build utils))
5633 (use-modules (guix build utils)
5637 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
5638 (out (assoc-ref %outputs "out"))
5639 (source (string-append btrfs "/bin/btrfs.static"))
5640 (target (string-append out "/bin/btrfs")))
5641 (mkdir-p (dirname target))
5642 (copy-file source target)
5643 (remove-store-references target)
5644 (chmod target #o555)
5646 (home-page (package-home-page btrfs-progs))
5647 (synopsis "Statically-linked btrfs command from btrfs-progs")
5648 (description "This package provides the statically-linked @command{btrfs}
5649 from the btrfs-progs package. It is meant to be used in initrds.")
5650 (license (package-license btrfs-progs))))
5652 (define-public cramfs-tools
5654 (name "cramfs-tools")
5655 (home-page "https://github.com/npitre/cramfs-tools")
5661 (commit (string-append "v" version))))
5663 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
5664 (file-name (git-file-name name version))))
5665 (build-system gnu-build-system)
5667 '(#:tests? #f ; No tests.
5669 (modify-phases %standard-phases
5672 (lambda* (#:key outputs #:allow-other-keys)
5673 (let ((out (assoc-ref outputs "out")))
5674 (install-file "mkcramfs" (string-append out "/sbin"))
5675 (install-file "cramfsck" (string-append out "/sbin")))
5679 (synopsis "Tools to manage Cramfs file systems")
5680 (description "Cramfs is a Linux file system designed to be simple, small,
5681 and to compress things well. It is used on a number of embedded systems and
5682 small devices. This version has additional features such as uncompressed
5683 blocks and random block placement.")
5684 (license license:gpl2+)))
5686 (define-public compsize
5690 (home-page "https://github.com/kilobyte/compsize")
5695 (commit (string-append "v" version))))
5697 (base32 "0vqnrwgpv6pc1yjl0g4gl71xyl6v0xl3pyqjanjpwps73c53azir"))
5698 (file-name (git-file-name name version))))
5699 (build-system gnu-build-system)
5703 `(#:tests? #f ; No tests.
5705 (list (string-append "CC=" ,(cc-for-target)))
5707 (modify-phases %standard-phases
5710 (lambda* (#:key outputs #:allow-other-keys)
5711 (let ((out (assoc-ref outputs "out")))
5712 (install-file "compsize" (string-append out "/bin"))
5713 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
5714 (synopsis "Find compression type/ratio on Btrfs files")
5715 (description "@command{compsize} takes a list of files (given as
5716 arguments) on a Btrfs file system and measures used compression types and
5717 effective compression ratio, producing a report.
5719 A directory has no extents but has a (recursive) list of files. A non-regular
5720 file is silently ignored.
5722 As it makes no sense to talk about compression ratio of a partial extent,
5723 every referenced extent is counted whole, exactly once -- no matter if you use
5724 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
5725 uncompressed size will not match the number given by @command{tar} or
5726 @command{du}. On the other hand, the space used should be accurate (although
5727 obviously it can be shared with files outside our set).")
5728 (license license:gpl2+)))
5730 (define-public f2fs-tools-1.7
5737 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
5738 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
5741 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
5743 (build-system gnu-build-system)
5745 `(#:configure-flags '("CFLAGS=-fcommon")
5747 (modify-phases %standard-phases
5748 (add-after 'install 'install-headers
5749 (lambda* (#:key outputs #:allow-other-keys)
5750 (let* ((out (assoc-ref outputs "out"))
5751 (out-include (string-append out "/include")))
5752 (install-file "include/f2fs_fs.h" out-include)
5753 (install-file "mkfs/f2fs_format_utils.h" out-include)
5756 (list autoconf automake libtool pkg-config))
5758 `(("libuuid" ,util-linux "lib")
5759 ("libselinux" ,libselinux)))
5760 (home-page "https://f2fs.wiki.kernel.org/")
5761 (synopsis "Userland tools for f2fs")
5763 "F2FS, the Flash-Friendly File System, is a modern file system
5764 designed to be fast and durable on flash devices such as solid-state
5765 disks and SD cards. This package provides the userland utilities.")
5766 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
5767 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
5768 (license (list license:gpl2 license:lgpl2.1))))
5770 (define-public f2fs-tools
5772 (inherit f2fs-tools-1.7)
5778 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
5779 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
5782 "1lab1446c78xsjwhpki7s85z4171m8p9279c8yhm4882wba674k1"))))
5784 `(("libuuid" ,util-linux "lib")))))
5786 (define-public f2fs-tools/static
5789 (inherit f2fs-tools)
5790 (name "f2fs-tools-static")
5793 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
5794 (libuuid (assoc-ref %build-inputs "libuuid")))
5796 (string-append "libuuid_CFLAGS=-I" libuuid "/include/uuid")
5797 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
5798 (string-append "libblkid_CFLAGS=-I" libuuid "/include/uuid "
5799 "-I" libuuid "/include/blkid")
5800 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
5801 #:disallowed-references (,util-linux)
5803 (modify-phases %standard-phases ; TODO: f2fs phases.
5804 (add-after 'unpack 'make-static
5806 (define (append-to-file name body)
5807 (let ((file (open-file name "a")))
5810 (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n")
5811 (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n")
5812 (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n")
5814 (add-after 'install 'remove-store-references
5815 (lambda* (#:key outputs #:allow-other-keys)
5816 ;; Work around bug in our util-linux.
5817 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
5818 (remove-store-references (string-append (assoc-ref outputs "out")
5822 `(("libuuid:static" ,util-linux "static")
5823 ("libuuid" ,util-linux "lib")))))) ; for include files
5825 (define-public f2fs-fsck/static
5827 (name "f2fs-fsck-static")
5828 (version (package-version f2fs-tools/static))
5830 (build-system trivial-build-system)
5832 `(#:modules ((guix build utils))
5835 (use-modules (guix build utils)
5838 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
5840 (out (assoc-ref %outputs "out"))
5841 (sbin (string-append out "/sbin")))
5843 (with-directory-excursion sbin
5844 (install-file (string-append f2fs-tools "/sbin/" fsck)
5846 (remove-store-references fsck)
5850 (list f2fs-tools/static))
5851 (home-page (package-home-page f2fs-tools/static))
5852 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
5853 (description "This package provides statically-linked fsck.f2fs command taken
5854 from the f2fs-tools package. It is meant to be used in initrds.")
5855 (license (package-license f2fs-tools/static))))
5857 (define-public freefall
5860 (version (package-version linux-libre))
5861 (source (package-source linux-libre))
5862 (build-system gnu-build-system)
5864 '(#:phases (modify-phases %standard-phases
5865 (add-after 'unpack 'enter-subdirectory
5867 (chdir "tools/laptop/freefall")
5870 (add-before 'build 'increase-timeout
5872 ;; The default of 2 seconds is too low: it assumes an
5873 ;; open lid and AC power without actually checking.
5874 (substitute* "freefall.c"
5875 (("alarm\\(2\\)") "alarm(5)"))
5877 #:make-flags (list (string-append "PREFIX="
5878 (assoc-ref %outputs "out"))
5880 #:tests? #f)) ;no tests
5881 (home-page (package-home-page linux-libre))
5882 (synopsis "Free-fall protection for spinning laptop hard drives")
5884 "Prevents shock damage to the internal spinning hard drive(s) of some
5885 HP and Dell laptops. When sudden movement is detected, all input/output
5886 operations on the drive are suspended and its heads are parked on the ramp,
5887 where they are less likely to cause damage to the spinning disc. Requires a
5888 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
5889 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
5890 (license license:gpl2)))
5892 (define-public thinkfan
5900 (url "https://github.com/vmatare/thinkfan")
5902 (file-name (git-file-name name version))
5904 (base32 "07l7cxbsyvy7awa1zk0zxng60749idvsx3535iginhkqxfzij4b9"))))
5905 (build-system cmake-build-system)
5908 #:modules '((guix build cmake-build-system)
5911 #:tests? #f ; no test target
5913 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
5914 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
5916 #~(list "-DUSE_ATASMART:BOOL=ON")
5918 #~(modify-phases %standard-phases
5919 (add-after 'unpack 'create-init-scripts
5920 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
5921 ;; systemd to patch and install their service files. Fake their
5922 ;; presence rather than duplicating the build system below. Leave
5923 ;; things like ‘/bin/kill’ because they're not worth a dependency.
5924 ;; The sysvinit needs manual patching, but since upstream doesn't
5925 ;; even provide the option to install it: don't.
5927 (substitute* "CMakeLists.txt"
5928 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
5929 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
5930 ;; That was easy! Now we just need to fix the destinations.
5932 (string-append #$output directory))))))))
5936 (list libatasmart yaml-cpp))
5937 (home-page "https://github.com/vmatare/thinkfan")
5938 (synopsis "Simple fan control program")
5940 "Thinkfan is a simple fan control program. It reads temperatures,
5941 checks them against configured limits and switches to appropriate (also
5942 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
5943 other @code{hwmon} driver that enables temperature reading and fan control
5945 (license license:gpl3+)))
5947 (define-public tpacpi-bat
5955 (url "https://github.com/teleshoes/tpacpi-bat")
5956 (commit (string-append "v" version))))
5957 (file-name (git-file-name name version))
5959 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
5960 (build-system gnu-build-system)
5962 `(#:tests? #f ; no test target
5964 (modify-phases %standard-phases
5965 (add-after 'unpack 'refer-to-inputs
5967 (substitute* "tpacpi-bat"
5969 (format #f "~a " (which "cat")))
5970 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
5971 ;; loaded. That's the administrator's prerogative; disable it.
5972 (("system \"(modprobe .*)\"" _ match)
5973 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))
5975 (delete 'configure) ; nothing to configure
5976 (delete 'build) ; nothing to build
5978 (lambda* (#:key outputs #:allow-other-keys)
5979 (let* ((out (assoc-ref outputs "out"))
5980 (bin (string-append out "/bin"))
5981 (doc (string-append out "/share/doc/" ,name "-" ,version)))
5982 (install-file "tpacpi-bat" bin)
5984 ;; There's no man page. Install other forms of documentation.
5985 (for-each (lambda (file)
5986 (let ((target (string-append doc "/" file)))
5987 (mkdir-p (dirname target))
5988 (copy-recursively file target)))
5989 (list "battery_asl" "examples" "README.md"))
5993 (home-page "https://github.com/teleshoes/tpacpi-bat")
5994 (synopsis "ThinkPad battery charge controller")
5996 "Tpacpi-bat is a command-line interface to control battery charging on
5997 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
5998 ThinkPad models released after 2011}, starting with the xx20 series. It can
5999 query and set the thresholds at which one or both batteries will start and stop
6000 charging, inhibit charging batteries for a set period of time, or force them to
6001 discharge when they otherwise would not.
6003 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
6004 kernel module provided by the @code{acpi-call-linux-module} package, which must
6005 be installed and loaded separately. Only the original vendor firmware is
6007 (license license:gpl3+)))
6012 ;; Tmon's ‘VERSION = 1.0’ hasn't been touched since 2013; the code has.
6013 (version (package-version linux-libre))
6014 (source (package-source linux-libre))
6015 (build-system gnu-build-system)
6017 `(#:tests? #f ; no test suite
6019 (list (string-append "CC=" ,(cc-for-target))
6020 (string-append "INSTALL_ROOT=" (assoc-ref %outputs "out"))
6023 (modify-phases %standard-phases
6024 (add-after 'unpack 'enter-subdirectory
6026 (chdir "tools/thermal/tmon")
6028 (add-after 'install 'install-man-page
6029 (lambda* (#:key outputs #:allow-other-keys)
6030 (let* ((out (assoc-ref outputs "out"))
6031 (man8 (string-append out "/share/man/man8")))
6032 (install-file "tmon.8" man8)
6034 (delete 'configure)))) ; no configure script
6037 (home-page (package-home-page linux-libre))
6038 (synopsis "Monitor and test the Linux thermal subsystem in real time")
6040 "Tmon is a tool to interact with the complex thermal subsystem of the
6041 kernel Linux. It helps visualize thermal relationships and real-time thermal
6042 data, tune and test cooling devices and sensors, and collect thermal data for
6045 As computers become smaller and more thermally constrained, more sensors are
6046 added and new cooling capabilities introduced. Thermal relationships can change
6047 dynamically. Their complexity grows exponentially among cooling devices, zones,
6048 sensors, and trip points.
6050 Linux exposes this relationship through @file{/sys/class/thermal} with a matrix
6051 of symbolic links, trip point bindings, and device instances. To traverse it
6052 by hand is no trivial task: @command{tmon} aims to make it understandable.")
6053 (license (list license:gpl2 ; the man page
6054 license:gpl2+)))) ; the actual rest
6056 (define-public turbostat
6059 ;; XXX turbostat reports a version like ‘20.09.30’ but using it here would
6060 ;; make it harder to benefit from ‘free’ linux-libre package updates.
6061 (version (package-version linux-libre))
6062 (source (package-source linux-libre))
6063 (build-system gnu-build-system)
6065 `(#:tests? #f ; no test suite
6067 (list (string-append "CC=" ,(cc-for-target))
6068 (string-append "PREFIX=" (assoc-ref %outputs "out")))
6070 (modify-phases %standard-phases
6071 (add-after 'unpack 'enter-subdirectory
6073 (chdir "tools/power/x86/turbostat")
6075 (delete 'configure)))) ; no configure script
6078 (supported-systems '("i686-linux" "x86_64-linux"))
6079 (home-page (package-home-page linux-libre))
6080 (synopsis "Report x86 processor frequency and idle statistics")
6082 "Turbostat reports x86 processor topology, frequency, idle power state
6083 statistics, temperature, and power consumption. Some information is unavailable
6084 on older processors.
6086 It can be used to identify machines that are inefficient in terms of power usage
6087 or idle time, report the rate of @acronym{SMI, system management interrupt}s
6088 occurring on the system, or verify the effects of power management tuning.
6090 @command{turbostat} reads hardware counters but doesn't write to them, so it
6091 won't interfere with the OS or other running processes---including multiple
6092 invocations of itself.")
6093 (license license:gpl2)))
6095 (define-public ntfs-3g
6098 (version "2022.5.17")
6101 (uri (string-append "https://tuxera.com/opensource/"
6102 "ntfs-3g_ntfsprogs-" version ".tgz"))
6105 "14zbsl7m32f796dkr334zbkj5rba7xa8smxb2ysf3095jyvgp284"))
6106 (modules '((guix build utils)))
6108 ;; Install under $prefix.
6109 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
6113 (build-system gnu-build-system)
6114 (inputs (list util-linux ; libuuid
6116 (native-inputs (list pkg-config))
6118 '(#:configure-flags (list "--disable-static"
6119 "--disable-ldconfig" ;not necessary
6120 "--exec-prefix=${prefix}"
6121 "--with-fuse=external" ;use our own FUSE
6122 "--enable-mount-helper"
6123 "--enable-posix-acls"
6124 "--enable-xattr-mappings")
6126 (modify-phases %standard-phases
6127 ;; If users install ntfs-3g, they probably want to make it the
6128 ;; default driver as well, so we opt for sensible defaults and link
6129 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
6130 ;; mount NTFS file systems.)
6131 (add-after 'install 'install-link
6132 (lambda* (#:key outputs #:allow-other-keys)
6133 (let* ((out (assoc-ref outputs "out"))
6134 (sbin (string-append out "/sbin")))
6135 (symlink "mount.ntfs-3g"
6136 (string-append sbin "/mount.ntfs")))
6138 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
6139 (synopsis "Read-write access to NTFS file systems")
6141 "NTFS-3G provides read-write access to NTFS file systems, which are
6142 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
6143 The package provides additional NTFS tools.")
6145 '((release-monitoring-url . "https://github.com/tuxera/ntfs-3g/releases")
6146 (upstream-name . "ntfs-3g_ntfsprogs")))
6147 (license license:gpl2+)))
6149 (define-public ntfs-3g/static
6153 (name "ntfs-3g-static")
6155 (substitute-keyword-arguments (package-arguments ntfs-3g)
6156 ((#:configure-flags flags)
6158 (list "--enable-really-static"
6159 ;; The FUSE driver isn't currently used by our initrd.
6160 "--disable-ntfs-3g")))
6162 `(modify-phases ,phases
6163 (add-after 'unpack 'make-really-static-really-static
6165 (substitute* "ntfsprogs/Makefile.in"
6166 ((" -static") " -all-static"))))
6167 (delete 'install-link))))))))
6169 (define-public ntfsfix/static
6171 (name "ntfsfix-static")
6172 (version (package-version ntfs-3g/static))
6174 (build-system trivial-build-system)
6176 `(#:modules ((guix build utils))
6179 (use-modules (guix build utils))
6180 (let* ((ntfs-3g (assoc-ref %build-inputs "ntfs-3g"))
6181 (out (assoc-ref %outputs "out"))
6182 (bin (string-append out "/bin")))
6183 (install-file (string-append ntfs-3g "/bin/ntfsfix") bin)
6184 (with-directory-excursion bin
6185 (remove-store-references "ntfsfix"))))))
6187 `(("ntfs-3g" ,ntfs-3g/static)))
6188 (home-page (package-home-page ntfs-3g/static))
6189 (synopsis "Statically linked @command{ntfsfix} from ntfs-3g")
6191 "This package provides a statically linked @command{ntfsfix} taken
6192 from the ntfs-3g package. It is meant to be used in initrds.")
6193 (license (package-license ntfs-3g/static))))
6195 (define-public rdma-core
6201 (uri (string-append "https://github.com/linux-rdma/rdma-core"
6202 "/releases/download/v" version "/rdma-core-"
6206 "1rah0v9gq9rksqd2c17nmydsxcjz178n7m2y4ricwlf5pq1b2yfi"))))
6207 (build-system cmake-build-system)
6209 `(#:tests? #f ; no tests
6210 ;; Upstream uses the "ninja" build system and encourage distros
6211 ;; to do the same for consistency.
6212 #:configure-flags (list "-GNinja"
6214 ,@(if (%current-target-system)
6216 "-DPKG_CONFIG_EXECUTABLE="
6219 (string-append "/bin/"
6220 ,(pkg-config-for-target)))))
6222 (string-append "-DRST2MAN_EXECUTABLE="
6223 (assoc-ref %build-inputs
6227 (modify-phases %standard-phases
6231 "-j" (number->string (parallel-job-count)))))
6234 (invoke "ninja" "install"))))))
6237 ("pkg-config" ,pkg-config)
6238 ("python" ,python-wrapper)
6239 ("python-docutils" ,python-docutils))) ;for 'rst2man'
6243 (home-page "https://github.com/linux-rdma/rdma-core")
6244 (synopsis "Utilities and libraries for working with RDMA devices")
6246 "This package provides userspace components for the InfiniBand
6247 subsystem of the Linux kernel. Specifically it contains userspace
6248 libraries for the following device nodes:
6251 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
6252 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
6253 @item @file{/dev/infiniband/umadX} (@code{libibumad})
6256 The following service daemons are also provided:
6258 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
6259 @item @code{iwpmd} (for iWARP kernel providers)
6260 @item @code{ibacm} (for InfiniBand communication management assistant)
6262 ;; All library code is dual licensed under GPL2 and a custom MIT
6263 ;; variant. The package also includes some components covered by
6264 ;; other licenses. Consult COPYING.md for full details.
6267 (license:x11-style "See COPYING.BSD_MIT in the distribution")
6268 license:bsd-2 ; Files referring to COPYING.BSD_FB
6269 license:cc0 ; most files in ccan/
6270 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
6272 (define-public perftest
6279 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
6280 version "/perftest-" version ".g0927198.tar.gz"))
6282 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
6283 (build-system gnu-build-system)
6286 (modify-phases %standard-phases
6287 (add-after 'unpack 'patch-header-paths
6289 (substitute* '("src/raw_ethernet_fs_rate.c"
6290 "src/raw_ethernet_resources.c"
6291 "src/raw_ethernet_resources.h"
6292 "src/raw_ethernet_send_burst_lat.c"
6293 "src/raw_ethernet_send_bw.c"
6294 "src/raw_ethernet_send_lat.c")
6295 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
6297 (inputs (list rdma-core))
6298 (home-page "https://github.com/linux-rdma/perftest/")
6299 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
6300 (description "This is a collection of tests written over uverbs intended for
6301 use as a performance micro-benchmark. The tests may be used for hardware or
6302 software tuning as well as for functional testing.
6304 The collection contains a set of bandwidth and latency benchmark such as:
6306 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
6307 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
6308 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
6309 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
6310 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
6312 (license license:gpl2)))
6314 (define-public rng-tools
6317 (home-page "https://github.com/nhorman/rng-tools")
6321 (uri (git-reference (url home-page)
6322 (commit (string-append "v" version))))
6323 (file-name (git-file-name name version))
6326 "0i00if7xknpm0dhkrm60rxzyyvq0vdibq7dvsd2ncm9pg098qvwj"))))
6327 (build-system gnu-build-system)
6329 `(;; Disable support for various hardware entropy sources as they need
6330 ;; dependencies that are not yet in Guix, and would significantly
6331 ;; increase closure size.
6332 #:configure-flags '("--without-nistbeacon"
6336 (modify-phases %standard-phases
6337 (add-before 'check 'disable-failing-test
6339 (substitute* "tests/Makefile"
6340 ;; This test requires a hwrng, rdrand, or tpm device.
6341 ;; Worse, it appears to fail if that isn't sufficiently random.
6342 (("\\brngtestjitter\\.sh\\b") " ")))))))
6344 (list autoconf automake pkg-config))
6346 (list sysfsutils openssl))
6347 (synopsis "Random number generator daemon")
6349 "Monitor a hardware random number generator, and supply entropy
6350 from that to the system kernel's @file{/dev/random} machinery.")
6351 ;; The source package is offered under the GPL2+, but the files
6352 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
6353 (license (list license:gpl2 license:gpl2+))))
6355 (define-public cpupower
6358 (version (package-version linux-libre))
6359 (source (package-source linux-libre))
6360 (build-system gnu-build-system)
6362 '(#:phases (modify-phases %standard-phases
6363 (add-after 'unpack 'enter-subdirectory
6365 (chdir "tools/power/cpupower")
6368 (add-before 'build 'fix-makefiles
6370 (substitute* "Makefile"
6372 (("/bin/(install|pwd)" _ command) command))
6373 (substitute* "bench/Makefile"
6374 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
6376 #:make-flags (let ((out (assoc-ref %outputs "out")))
6377 (list (string-append "DESTDIR=" out)
6378 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
6380 "docdir=/share/doc/cpupower"
6381 "confdir=$(docdir)/examples"
6382 ;; The Makefile recommends the following changes
6384 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
6385 #:tests? #f)) ;no tests
6386 (native-inputs `(("gettext" ,gettext-minimal)))
6387 (inputs (list pciutils))
6388 (home-page (package-home-page linux-libre))
6389 (synopsis "CPU frequency and voltage scaling tools for Linux")
6391 "cpupower is a set of user-space tools that use the cpufreq feature of the
6392 Linux kernel to retrieve and control processor features related to power saving,
6393 such as frequency and voltage scaling.")
6394 (license license:gpl2)))
6396 (define-public x86-energy-perf-policy
6398 (name "x86-energy-perf-policy")
6399 (version (package-version linux-libre))
6400 (source (package-source linux-libre))
6401 (build-system gnu-build-system)
6405 (modify-phases %standard-phases
6406 (add-after 'unpack 'enter-subdirectory
6408 (chdir "tools/power/x86/x86_energy_perf_policy")
6411 (add-before 'build 'fix-makefile
6413 (substitute* "Makefile" (("/usr") ""))
6416 (let ((out (assoc-ref %outputs "out")))
6417 (list (string-append "DESTDIR=" out)
6418 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
6419 (supported-systems '("i686-linux" "x86_64-linux"))
6420 (home-page (package-home-page linux-libre))
6421 (synopsis "Display and update Intel-CPU energy-performance policy")
6423 "@command{x86_energy_perf_policy} displays and updates energy-performance
6424 policy settings specific to Intel Architecture Processors. Settings are
6425 accessed via Model Specific Register (MSR) updates, no matter if the Linux
6426 cpufreq sub-system is enabled or not.")
6427 (license license:gpl2)))
6429 (define-public haveged
6437 (url "https://github.com/jirka-h/haveged")
6438 (commit (string-append "v" version))))
6439 (file-name (git-file-name name version))
6441 (base32 "1y1p3qhjzhpgd20xz5ffms3w1bdvpk883y38ydwsmp9mc0kzy8kz"))))
6442 (build-system gnu-build-system)
6445 (list "--disable-static")))
6446 (home-page "https://www.issihosts.com/haveged")
6447 (synopsis "Entropy source for the Linux random number generator")
6449 "haveged generates an unpredictable stream of random numbers for use by
6450 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
6451 standard mechanisms for filling the entropy pool may not be sufficient for
6452 systems with high needs or limited user interaction, such as headless servers.
6454 @command{haveged} runs as a privileged daemon, harvesting randomness from the
6455 indirect effects of hardware events on hidden processor state using the
6456 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
6457 It tunes itself to its environment and provides the same built-in test suite
6458 for the output stream as used on certified hardware security devices.
6460 The quality of the randomness produced by this algorithm has not been proven.
6461 It is recommended to run it together with another entropy source like rngd, and
6462 not as a replacement for it.")
6463 (license (list (license:non-copyleft "file://nist/mconf.h")
6464 (license:non-copyleft "file://nist/packtest.c")
6465 license:public-domain ; nist/dfft.c
6466 license:gpl3+)))) ; everything else
6468 (define-public ecryptfs-utils
6470 (name "ecryptfs-utils")
6475 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
6476 version "/+download/ecryptfs-utils_"
6477 version ".orig.tar.gz"))
6480 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
6481 (build-system gnu-build-system)
6483 `(#:configure-flags (list "--disable-pywrap")
6485 (modify-phases %standard-phases
6486 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
6487 (lambda* (#:key inputs outputs #:allow-other-keys)
6488 (let ((out (assoc-ref outputs "out"))
6489 (utils-linux (assoc-ref inputs "utils-linux"))
6490 (cryptsetup (assoc-ref inputs "cryptsetup"))
6491 (linux-pam (assoc-ref inputs "linux-pam"))
6492 (lvm2 (assoc-ref inputs "lvm2")))
6493 (substitute* '("src/utils/ecryptfs-mount-private"
6494 "src/utils/ecryptfs-umount-private"
6495 "src/utils/ecryptfs-setup-private"
6496 "src/utils/ecryptfs-setup-swap"
6497 "src/utils/mount.ecryptfs.c"
6498 "src/utils/umount.ecryptfs.c"
6499 "src/pam_ecryptfs/pam_ecryptfs.c"
6500 "src/desktop/ecryptfs-mount-private.desktop.in"
6501 "src/desktop/ecryptfs-setup-private.desktop.in")
6503 (string-append utils-linux "/bin/mount"))
6505 (string-append utils-linux "/bin/umount"))
6506 (("/sbin/mount.ecryptfs_private")
6507 (string-append out "/sbin/mount.ecryptfs_private"))
6508 (("/sbin/umount.ecryptfs_private")
6509 (string-append out "/sbin/umount.ecryptfs_private"))
6510 (("/usr/bin/ecryptfs-mount-private")
6511 (string-append out "/bin/ecryptfs-mount-private"))
6512 (("/usr/bin/ecryptfs-rewrite-file")
6513 (string-append out "/bin/ecryptfs-rewrite-file"))
6514 (("/usr/bin/ecryptfs-setup-private")
6515 (string-append out "/bin/ecryptfs-setup-private"))
6516 (("/sbin/cryptsetup")
6517 (string-append cryptsetup "/sbin/cryptsetup"))
6518 (("/sbin/unix_chkpwd")
6519 (string-append linux-pam "/sbin/unix_chkpwd"))
6521 (string-append lvm2 "/sbin/dmsetup")))))))))
6523 (list intltool perl ; for pod2man
6526 `(("keyutils" ,keyutils)
6527 ("linux-pam" ,linux-pam)
6528 ("utils-linux" ,util-linux)
6529 ("cryptsetup" ,cryptsetup)
6532 (home-page "https://ecryptfs.org/")
6533 (synopsis "eCryptfs cryptographic file system utilities")
6535 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
6536 Each file's cryptographic meta-data is stored inside the file itself, along
6537 with the encrypted contents. This allows individual encrypted files to be
6538 copied between hosts and still be decrypted with the proper key. eCryptfs is a
6539 native Linux file system, and has been part of the Linux kernel since version
6540 2.6.19. This package contains the userland utilities to manage it.")
6541 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
6542 ;; grant additional permission to link with OpenSSL.
6543 (license license:gpl2+)))
6545 (define-public libnfsidmap
6547 (name "libnfsidmap")
6552 (uri (string-append "https://fedorapeople.org/~steved/"
6553 name "/" version "/" name "-" version ".tar.bz2"))
6555 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
6556 (build-system gnu-build-system)
6558 `(#:configure-flags (list
6559 (string-append "--with-pluginpath="
6560 (assoc-ref %outputs "out")
6561 "/lib/libnfsidmap"))))
6563 (list autoconf)) ; 0.27 still needs autoheader
6565 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
6566 (synopsis "NFSv4 support library for name/ID mapping")
6567 (description "Libnfsidmap is a library holding mulitiple methods of
6568 mapping names to ids and visa versa, mainly for NFSv4. It provides an
6569 extensible array of mapping functions, currently consisting of two choices:
6570 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
6571 (license (license:non-copyleft "file://COPYING"
6572 "See COPYING in the distribution."))))
6574 (define-public module-init-tools
6576 (name "module-init-tools")
6581 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
6582 "module-init-tools-" version ".tar.bz2"))
6585 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
6586 (patches (search-patches "module-init-tools-moduledir.patch"))))
6587 (build-system gnu-build-system)
6589 ;; FIXME: The upstream tarball lacks man pages, and building them would
6590 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
6591 ;; but they vanished. In the meantime, fake it.
6593 (modify-phases %standard-phases
6594 (add-before 'configure 'fake-docbook
6596 (substitute* "Makefile.in"
6597 (("^DOCBOOKTOMAN.*$")
6598 "DOCBOOKTOMAN = true\n"))
6600 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
6601 (synopsis "Tools for loading and managing Linux kernel modules")
6603 "Tools for loading and managing Linux kernel modules, such as
6604 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
6605 (license license:gpl2+)))
6607 (define-public mce-inject
6608 (let ((revision "0") ; no git tags :-/
6609 (commit "4cbe46321b4a81365ff3aafafe63967264dbfec5"))
6612 (version (git-version "0.0.0" revision commit))
6617 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git")
6619 (file-name (git-file-name name version))
6621 (base32 "0gjapg2hrlxp8ssrnhvc19i3r1xpcnql7xv0zjgbv09zyha08g6z"))))
6622 (build-system gnu-build-system)
6624 ;; There is no test suite. There's a test/ directory, but it just holds
6625 ;; example text files you could feed to the programme to crash something.
6628 #~(list (string-append "prefix=" #$output)
6629 (string-append "CC=" #$(cc-for-target)))
6631 #~(modify-phases %standard-phases
6632 (delete 'configure) ; no configure script
6633 (add-after 'install 'install-examples
6634 (lambda* (#:key outputs #:allow-other-keys)
6635 (let* ((out (assoc-ref outputs "out"))
6636 (doc (string-append out "/share/doc/" #$name))
6637 (dir (string-append doc "/examples")))
6638 (copy-recursively "test" dir )))))))
6641 (supported-systems (list "i686-linux" "x86_64-linux"))
6643 "https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git/about/")
6645 "Inject x86 @acronym{MCEs, machine-check exceptions} into Linux")
6647 "This simple tool injects fake @acronym{MCEs, machine-check exceptions}
6648 into a running Linux kernel, to debug or test the kernel's @acronym{EDAC, error
6649 detection and correction}-handling code specific to x86 and x86_64 platforms.
6651 Real MCEs are internal CPU errors. Handling them correctly can be important to
6652 system stability and even prevent physical damage. In contrast, simulated MCEs
6653 produced by @command{mce-inject} are purely synthetic: injection happens only at
6654 the software level, inside the kernel, and is not visible to the platform
6655 hardware or firmware.
6657 A convenient feature of @command{mce-inject} is that the input language used to
6658 describe MCEs is similar to the format used in Linux panic messages, with a few
6659 extensions. In general, you should be able to pipe in any logged MCE panic to
6660 simulate that same MCE.
6662 The target kernel must have the @code{CONFIG_X86_MCE_INJECT} option enabled and
6663 the @code{mce-inject} module loaded if it exists.")
6664 (license license:gpl2))))
6666 (define-public mcelog
6674 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git")
6675 (commit (string-append "v" version))))
6676 (file-name (git-file-name name version))
6678 (base32 "0zdlwbdqs4s72yrpz4irhp12c1wqzy8kmf4hxahk13dmafd6dbnj"))
6679 (modules '((guix build utils)))
6682 ;; The checkout lacks a .git directory, breaking ‘git describe’.
6683 (substitute* "Makefile"
6684 (("\"unknown\"") (string-append "\"v" ,version "\"")))))))
6685 (build-system gnu-build-system)
6687 `(#:phases (modify-phases %standard-phases
6688 (delete 'configure)) ; no configure script
6689 #:make-flags (let ((out (assoc-ref %outputs "out")))
6690 (list (string-append "CC=" ,(cc-for-target))
6691 (string-append "prefix=" out)
6692 (string-append "DOCDIR=" out "/share/doc/"
6694 "etcprefix=$(DOCDIR)/examples"))
6695 ;; The tests will only run as root on certain supported CPU models.
6698 (list python-wrapper)) ; to generate example mcelog.conf
6699 (supported-systems (list "i686-linux" "x86_64-linux"))
6700 (home-page "https://mcelog.org/")
6701 (synopsis "Machine check monitor for x86 Linux systems")
6703 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
6704 systems running the kernel Linux. It can also perform user-defined tasks, such
6705 as bringing bad pages off-line, when configurable error thresholds are
6707 (license license:gpl2)))
6709 (define-public mtd-utils
6716 "ftp://ftp.infradead.org/pub/mtd-utils/"
6717 "mtd-utils-" version ".tar.bz2"))
6720 "168vyzpfa0n66i8lcf626b9jczjr81rqbdk7735lfb18bp8i2rrc"))))
6722 (list #:configure-flags
6723 (if (%current-target-system) ; When cross-compiling.
6725 #~(list "--enable-unit-tests"))
6727 #:parallel-tests? #f)) ;tests may fail when running in parallel
6729 (list cmocka pkg-config))
6731 `(("acl" ,acl) ; extended attributes (xattr)
6732 ("libuuid" ,util-linux "lib")
6734 ("openssl" ,openssl) ; optional crypto support
6736 ("zstd" ,zstd "lib")))
6737 (build-system gnu-build-system)
6738 (synopsis "MTD Flash Storage Utilities")
6739 (description "This package provides utilities for testing, partitioning, etc
6741 (home-page "http://www.linux-mtd.infradead.org/")
6743 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
6744 license:mpl1.1 ; All ftl* files
6745 license:expat)))) ; libiniparser
6747 (define-public libseccomp
6753 (uri (string-append "https://github.com/seccomp/libseccomp/"
6754 "releases/download/v" version
6755 "/libseccomp-" version ".tar.gz"))
6758 "0xhan73zn4p0n7s8vx6s47wjmidvk4x8r90vfbljairn6f3mq1jr"))))
6759 (build-system gnu-build-system)
6761 '(#:configure-flags '("--disable-static")
6762 #:phases (modify-phases %standard-phases
6763 (add-before 'check 'skip-load-test
6765 ;; This test does a native system call and fails when
6766 ;; run under QEMU user-mode emulation. Just skip it.
6767 (delete-file "tests/52-basic-load.tests"))))))
6770 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
6771 (description "The libseccomp library provides an easy to use, platform
6772 independent, interface to the Linux Kernel's syscall filtering mechanism. The
6773 libseccomp API is designed to abstract away the underlying BPF based syscall
6774 filter language and present a more conventional function-call based filtering
6775 interface that should be familiar to, and easily adopted by, application
6777 (home-page "https://github.com/seccomp/libseccomp")
6778 (license license:lgpl2.1)))
6780 (define-public radeontop
6788 (url "https://github.com/clbr/radeontop")
6789 (commit (string-append "v" version))))
6790 (file-name (git-file-name name version))
6792 (base32 "0kwqddidr45s1blp0h8r8h1dd1p50l516yb6mb4s6zsc827xzgg3"))))
6793 (build-system gnu-build-system)
6795 `(#:phases (modify-phases %standard-phases
6796 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
6797 ;; dependency, and doesn't even work on release(!) tarballs.
6798 (add-after 'unpack 'report-correct-version
6800 (substitute* "getver.sh"
6802 (string-append "ver=" ,version)))))
6803 (delete 'configure)) ; no configure script
6804 #:make-flags (list (string-append "CC=" ,(cc-for-target))
6805 (string-append "PREFIX=" %output))
6806 #:tests? #f)) ; no tests
6808 (list gettext-minimal pkg-config))
6810 (list libdrm libpciaccess libxcb ncurses))
6811 (home-page "https://github.com/clbr/radeontop/")
6812 (synopsis "Usage monitor for AMD Radeon graphics")
6813 (description "RadeonTop monitors resource consumption on supported AMD
6814 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
6815 a terminal or saved to a file for further processing. It measures both the
6816 activity of the GPU as a whole, which is also accurate during OpenCL
6817 computations, as well as separate component statistics that are only meaningful
6818 under OpenGL graphics workloads.")
6819 (license license:gpl3)))
6821 (define-public efivar
6827 (uri (string-append "https://github.com/rhboot/" name
6828 "/releases/download/" version "/" name
6829 "-" version ".tar.bz2"))
6832 "0jaka7b4lccswjqiv4liclkj6w78gildg7vd6dnw3wf595pfs67h"))
6834 (search-patches "efivar-211.patch"))))
6836 (build-system gnu-build-system)
6839 ;; Tests require a UEFI system and is not detected in the chroot.
6842 #~(list (string-append "prefix=" #$output)
6843 (string-append "libdir=" #$output "/lib")
6844 (string-append "CC=" #$(cc-for-target))
6845 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
6847 #~(modify-phases %standard-phases
6848 (add-after 'unpack 'build-deterministically
6850 (substitute* "src/include/defaults.mk"
6851 ;; Don't use -march=native.
6854 (delete 'configure))))
6856 (list mandoc pkg-config))
6859 (home-page "https://github.com/rhboot/efivar")
6860 (synopsis "Tool and library to manipulate EFI variables")
6861 (description "This package provides a library and a command line
6862 interface to the variable facility of UEFI boot firmware.")
6863 (license license:lgpl2.1+)))
6865 (define-public efibootmgr
6873 (url "https://github.com/rhboot/efibootmgr")
6875 (file-name (git-file-name name version))
6877 (base32 "1niicijxg59rsmiw3rsjwy4bvi1n42dynvm01lnp9haixdzdpq03"))
6878 (patches (search-patches "efibootmgr-remove-extra-decl.patch"))
6879 (modules '((guix build utils)))
6882 ;; Cast the first argument to the correct type. Extracted
6883 ;; from upstream commit e8ce9fecebd15adb4.
6884 (substitute* '("src/efibootdump.c" "src/efibootmgr.c")
6885 (("efidp_format_device_path\\(text_path,")
6886 "efidp_format_device_path((unsigned char *)text_path,"))))))
6887 (build-system gnu-build-system)
6890 #:tests? #f ;no tests
6892 #~(append (list (string-append "prefix=" #$output)
6893 (string-append "libdir=" #$output "/lib")
6894 ;; EFIDIR denotes a subdirectory relative to the
6895 ;; EFI System Partition where the loader will be
6896 ;; installed (known as OS_VENDOR in the code).
6897 ;; GRUB overrides this, as such it's only used if
6898 ;; nothing else is specified on the command line.
6900 #$(if (%current-target-system)
6902 (string-append "CC=" #$(cc-for-target))
6903 (string-append "PKG_CONFIG=" #$(pkg-config-for-target))
6904 (string-append "EXTRAINCDIRS="
6905 #$(this-package-input "efivar") "/include"))
6907 #:phases #~(modify-phases %standard-phases (delete 'configure))))
6912 (home-page "https://github.com/rhboot/efibootmgr")
6913 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
6915 "@code{efibootmgr} is a user-space application to modify the Intel
6916 Extensible Firmware Interface (EFI) Boot Manager. This application can
6917 create and destroy boot entries, change the boot order, change the next
6918 running boot option, and more.")
6919 (license license:gpl2+)))
6921 (define-public sysstat
6928 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
6929 "sysstat-" version ".tar.xz"))
6931 (base32 "091xjip7l52dxal8dsfh5chksr4g9gclnssw3hjjxy84kr3yf4lm"))))
6932 (build-system gnu-build-system)
6934 `(#:tests? #f ; no test suite.
6935 ;; Without this flag, it tries to install the man pages with group 'root'
6936 ;; and fails because /etc/passwd lacks an entry for the root user.
6938 (list "--disable-file-attr"
6939 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
6941 (modify-phases %standard-phases
6942 ;; The build process tries to create '/var/lib/sa', so we skip that
6944 (add-after 'build 'skip-touching-var
6946 (substitute* "Makefile"
6947 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
6949 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
6950 (synopsis "Performance monitoring tools for Linux")
6951 (description "The sysstat utilities are a collection of performance
6952 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
6953 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
6954 @code{sadf} and @code{sa}.")
6955 (license license:gpl2+)))
6957 (define-public light
6965 (url "https://github.com/haikarainen/light")
6966 (commit (string-append "v" version))))
6968 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
6969 (file-name (git-file-name name version))))
6970 (build-system gnu-build-system)
6972 `(#:configure-flags '("CFLAGS=-fcommon")
6974 (modify-phases %standard-phases
6975 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
6976 (lambda* (#:key inputs #:allow-other-keys)
6977 (substitute* "90-backlight.rules"
6978 (("/bin/chgrp") (which "chgrp"))
6979 (("/bin/chmod") (which "chmod")))
6981 (add-after 'install 'install-udev-rules
6982 (lambda* (#:key outputs #:allow-other-keys)
6983 (let ((out (assoc-ref outputs "out")))
6985 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
6988 (list autoconf automake))
6989 (home-page "https://haikarainen.github.io/light/")
6990 (synopsis "GNU/Linux application to control backlights")
6992 "Light is a program to send commands to screen backlight controllers
6993 under GNU/Linux. Features include:
6996 @item It does not rely on X.
6997 @item Light can automatically figure out the best controller to use, making
6998 full use of underlying hardware.
6999 @item It is possible to set a minimum brightness value, as some controllers
7000 set the screen to be pitch black at a value of 0 (or higher).
7002 (license license:gpl3+)))
7004 (define-public brightnessctl
7006 (name "brightnessctl")
7008 (home-page "https://github.com/Hummer12007/brightnessctl")
7011 (uri (git-reference (url home-page) (commit version)))
7012 (file-name (git-file-name name version))
7015 "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq"))
7016 (patches (search-patches "brightnessctl-elogind-support.patch"))))
7017 (build-system gnu-build-system)
7019 `(#:tests? #f ; no tests
7020 #:make-flags (list (string-append "CC=" ,(cc-for-target))
7021 (string-append "PREFIX=" %output)
7022 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/")
7025 (modify-phases %standard-phases
7027 (add-after 'unpack 'adjust-udev-rules
7029 (substitute* "Makefile"
7030 (("INSTALL_UDEV_RULES=0") "INSTALL_UDEV_RULES=1"))
7031 (substitute* "90-brightnessctl.rules"
7032 (("/bin/") "/run/current-system/profile/bin/"))
7038 (synopsis "Backlight and LED brightness control")
7040 "This program allows you read and control device brightness. Devices
7041 include backlight and LEDs. It can also preserve current brightness before
7042 applying the operation, such as on lid close.
7044 The appropriate permissions must be set on the backlight or LED control
7045 interface in sysfs, which can be accomplished with the included udev rules.")
7046 (license license:expat)))
7056 (url "https://github.com/linrunner/TLP")
7058 (file-name (git-file-name name version))
7060 (base32 "0cssclk2brhwvn9dm7h5snm2svwy0c8cfr4z2cgkdkac2pfaaxw4"))))
7066 ("ethtool" ,ethtool)
7070 ("inetutils" ,inetutils)
7073 ("pciutils" ,pciutils)
7077 ("usbutils" ,usbutils)
7078 ("util-linux" ,util-linux)
7079 ("wireless-tools" ,wireless-tools)
7080 ,@(if (let ((system (or (%current-target-system)
7081 (%current-system))))
7082 (or (string-prefix? "i686-" system)
7083 (string-prefix? "x86_64-" system)))
7084 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
7086 (build-system gnu-build-system)
7088 ;; XXX: The full test suite is run with "checkall" but it requires
7089 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
7090 `(#:test-target "shellcheck"
7091 #:modules ((guix build gnu-build-system)
7095 (modify-phases %standard-phases
7096 (delete 'configure) ; no configure script
7097 (add-before 'build 'setenv
7098 (lambda* (#:key outputs #:allow-other-keys)
7099 (let ((out (assoc-ref outputs "out")))
7100 (setenv "TLP_WITH_SYSTEMD" "0")
7101 (setenv "TLP_NO_INIT" "1")
7102 (setenv "TLP_NO_PMUTILS" "1")
7103 (setenv "TLP_SBIN" (string-append out "/bin"))
7104 (setenv "TLP_BATD" (string-append out "/share/tlp/bat.d"))
7105 (setenv "TLP_BIN" (string-append out "/bin"))
7106 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
7107 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
7108 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
7109 (setenv "TLP_CONFDEF"
7110 (string-append out "/share/tlp/defaults.conf"))
7111 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
7112 (setenv "TLP_CONFREN"
7113 (string-append out "/share/tlp/rename.conf"))
7115 (string-append out "/lib/elogind/system-sleep"))
7117 (string-append out "/share/bash-completion/completions"))
7118 (setenv "TLP_MAN" (string-append out "/share/man"))
7119 (setenv "TLP_META" (string-append out "/share/metainfo")))))
7120 (add-before 'install 'fix-installation
7122 ;; Stop the Makefile from trying to create system directories.
7123 (substitute* "Makefile"
7124 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
7125 (("install -d -m 755 \\$\\(_VAR\\)") "#"))))
7127 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
7128 (add-after 'install 'wrap
7129 (lambda* (#:key inputs outputs #:allow-other-keys)
7130 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
7131 (bin-files (find-files bin ".*")))
7132 (define (bin-directory input-name)
7133 (let ((p (assoc-ref inputs input-name)))
7134 (and p (string-append p "/bin"))))
7135 (define (sbin-directory input-name)
7136 (string-append (assoc-ref inputs input-name) "/sbin"))
7137 (for-each (lambda (program)
7138 (wrap-program program
7141 (filter-map bin-directory
7153 "x86-energy-perf-policy"))
7154 (filter-map sbin-directory
7160 "wireless-tools"))))))
7162 (home-page "https://linrunner.de/en/tlp/tlp.html")
7163 (synopsis "Power management tool for Linux")
7164 (description "TLP is a power management tool for Linux. It comes with
7165 a default configuration already optimized for battery life. Nevertheless,
7166 TLP is customizable to fulfil system requirements. TLP settings are applied
7167 every time the power supply source is changed.")
7168 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
7170 (license (list license:gpl2+ license:gpl3+))))
7172 (define-public tlpui
7180 (url "https://github.com/d4nj1/TLPUI")
7181 (commit (string-append "tlpui-" version))))
7182 (file-name (git-file-name name version))
7184 (base32 "16a6x733szsggn23ns7bj3gpvb80675plh96v4llrz0s8p3h47pg"))))
7185 (build-system python-build-system)
7189 #~(modify-phases %standard-phases
7190 (add-after 'unpack 'patch-setup.py
7191 ;; Install data_files to $out/share instead of /usr/share.
7193 (substitute* "setup.py"
7195 (add-after 'unpack 'use-tlp-input
7196 ;; Hard-code tlp-stat filename to avoid propagating "tlp".
7197 (lambda* (#:key inputs #:allow-other-keys)
7198 (let ((tlp-stat (search-input-file inputs "/bin/tlp-stat")))
7199 (with-directory-excursion "tlpui"
7200 (substitute* '("file.py" "settingshelper.py" "statui.py")
7201 (("which\\(\"tlp-stat\"\\)")
7202 (string-append "'" tlp-stat "'"))
7204 (string-append "'" tlp-stat "'")))))))
7205 (add-before 'check 'fix-home-directory
7207 ;; Tests fail with "Permission denied:
7208 ;; '/homeless-shelter'".
7209 (setenv "HOME" "/tmp")))
7210 ;; `sanity-check' phase errors out with the following
7211 ;; messages: "Unable to init server: Could not connect:
7212 ;; Connection refused" and "Error: cannot read user
7213 ;; configuration from /etc/tlp.conf or /etc/default/tlp".
7214 (delete 'sanity-check)
7216 (lambda* (#:key tests? #:allow-other-keys)
7218 (invoke "python" "-m" "discover"))))
7219 (add-after 'install 'wrap-gi-python
7221 (let ((gi-typelib-path (getenv "GI_TYPELIB_PATH")))
7222 (wrap-program (string-append #$output "/bin/tlpui")
7223 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))))))))
7225 (list `(,glib "bin") gobject-introspection python-discover))
7227 (list gtk+ python-pygobject tlp))
7228 (home-page "https://github.com/d4nj1/TLPUI")
7229 (synopsis "User interface for TLP written in Python")
7231 "The Python scripts in this project generate a GTK-UI to change
7232 TLP configuration files easily. It aims to protect users from setting
7233 bad configuration and to deliver a basic overview of all the valid
7234 configuration values.")
7235 (license license:gpl2+)))
7240 (version "B.02.19.2")
7243 (uri (string-append "https://www.ezix.org/software/"
7244 "files/lshw-" version
7248 "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
7249 (build-system gnu-build-system)
7251 `(#:phases (modify-phases %standard-phases (delete 'configure))
7252 #:tests? #f ; no tests
7254 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
7255 (synopsis "List hardware information")
7257 "@command{lshw} (Hardware Lister) is a small tool to provide
7258 detailed information on the hardware configuration of the machine.
7259 It can report exact memory configuration, firmware version, mainboard
7260 configuration, CPU version and speed, cache configuration, bus speed,
7261 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
7262 machines (PowerMac G4 is known to work).")
7263 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
7264 (license license:gpl2+)))
7266 (define-public libmnl
7273 (uri (string-append "mirror://netfilter.org/libmnl/"
7274 "libmnl-" version ".tar.bz2"))
7277 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
7278 (build-system gnu-build-system)
7279 (home-page "https://www.netfilter.org/projects/libmnl/")
7280 (synopsis "Netlink utility library")
7281 (description "Libmnl is a minimalistic user-space library oriented to
7282 Netlink developers. There are a lot of common tasks in parsing, validating,
7283 constructing of both the Netlink header and TLVs that are repetitive and easy to
7284 get wrong. This library aims to provide simple helpers that allows you to
7285 re-use code and to avoid re-inventing the wheel.")
7286 (license license:lgpl2.1+)))
7288 (define-public libnftnl
7295 (uri (string-append "mirror://netfilter.org/libnftnl/"
7296 "libnftnl-" version ".tar.bz2"))
7298 (base32 "0m82bmh8i24hwxmz7rxwxjll4904ghd2b1x1p5h8algrg6dyl5p9"))))
7299 (build-system gnu-build-system)
7304 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
7305 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
7306 (description "Libnftnl is a userspace library providing a low-level netlink
7307 programming interface to the in-kernel nf_tables subsystem. The library
7308 libnftnl has been previously known as libnftables. This library is currently
7310 (license license:gpl2+)))
7312 ;; This is used in iptables, which contributes to rust. We're pinning this
7313 ;; variant to avoid accidental rebuilds of rust.
7314 (define-public libnftnl/fixed
7315 (package (inherit libnftnl)
7320 (uri (string-append "mirror://netfilter.org/libnftnl/"
7321 "libnftnl-" version ".tar.bz2"))
7323 (base32 "1xblq1cbcxhr6qmjpy98i1qdza148idgz99vbhjc7s4vzvfizc4h"))))
7324 (build-system gnu-build-system)
7330 (define-public nftables
7337 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
7339 (string-append "https://www.nftables.org/projects/nftables"
7340 "/files/nftables-" version ".tar.bz2")))
7342 (base32 "02p59m773l2xqcb7ib7cprlpjfdnp792bahbs6c3dx1s74c4n6wd"))))
7343 (build-system gnu-build-system)
7344 (arguments `(#:configure-flags
7345 '("--disable-static"
7346 "--with-cli=readline"
7349 (modify-phases %standard-phases
7350 (add-before 'configure 'autoreconf
7352 (invoke "autoreconf" "-fi"))))))
7353 (inputs (list gmp libmnl libnftnl readline jansson))
7354 (native-inputs (list pkg-config
7361 (home-page "https://www.nftables.org")
7362 (synopsis "Userspace utility for Linux packet filtering")
7363 (description "nftables is the project that aims to replace the existing
7364 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
7365 filtering framework, a new userspace utility and also a compatibility layer for
7366 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
7367 infrastructure such as the existing hooks, the connection tracking system, the
7368 userspace queueing component and the logging subsystem.")
7369 (license license:gpl2)))
7371 (define-public libnetfilter-conntrack
7373 (name "libnetfilter-conntrack")
7378 (uri (string-append "https://netfilter.org/projects/"
7379 "libnetfilter_conntrack/files/"
7380 "libnetfilter_conntrack-"
7381 version ".tar.bz2"))
7384 "1ky1mqgnplw2h9jf0kn0a69d94jkydhbiipng9l2hdcj13h3pl8c"))))
7385 (build-system gnu-build-system)
7386 (native-inputs (list pkg-config))
7387 (inputs (list libnfnetlink libmnl))
7388 (synopsis "Library for kernel connection tracking state table")
7389 (description "libnetfilter_conntrack is a userspace library providing a
7390 programming interface (API) to the in-kernel connection tracking state table.
7391 The library libnetfilter_conntrack has been previously known as
7392 libnfnetlink_conntrack and libctnetlink. This library is currently used by
7393 conntrack-tools among many other applications.")
7394 (home-page "https://netfilter.org/projects/libnetfilter_conntrack/index.html")
7395 (supported-systems (filter target-linux? %supported-systems))
7396 (properties '((upstream-name . "libnetfilter_conntrack")))
7397 (license license:gpl2+)))
7399 (define-public libnetfilter-cttimeout
7401 (name "libnetfilter-cttimeout")
7406 (uri (string-append "https://netfilter.org/projects/"
7407 "libnetfilter_cttimeout/files/"
7408 "libnetfilter_cttimeout-" version ".tar.bz2"))
7411 "1fpyz1zlvcq80244knvyvy87909xjqlj02lmw8yblz2m9xsi5axf"))))
7412 (build-system gnu-build-system)
7413 (native-inputs (list pkg-config))
7414 (inputs (list libmnl))
7415 (synopsis "Library for kernel connection tracking timeout infrastructure")
7416 (description "libnetfilter_cttimeout is the userspace library that
7417 provides the programming interface to the fine-grain connection tracking
7418 timeout infrastructure. With this library, you can create, update and delete
7419 timeout policies that can be attached to traffic flows. This library is used
7420 by conntrack-tools.")
7421 (home-page "https://netfilter.org/projects/libnetfilter_cttimeout/index.html")
7422 (supported-systems (filter target-linux? %supported-systems))
7423 (properties '((upstream-name . "libnetfilter_cttimeout")))
7424 (license license:gpl2)))
7426 (define-public libnetfilter-cthelper
7428 (name "libnetfilter-cthelper")
7433 (uri (string-append "https://netfilter.org/projects/"
7434 "libnetfilter_cthelper/files/"
7435 "libnetfilter_cthelper-" version ".tar.bz2"))
7438 "0gfgzkc1fjniqwk4jxds72c0lcgfhq2591hrvjrvd9nrqiqqwq87"))))
7439 (build-system gnu-build-system)
7440 (native-inputs (list pkg-config))
7441 (inputs (list libmnl))
7442 (synopsis "Library for user-space connection tracking helpers")
7443 (description "libnetfilter_cthelper is a userspace library that provides a
7444 programming interface to user-space connection tracking helpers.
7447 register new user-space connection tracking helpers
7449 unregister user-space connection tracking helpers
7451 list existing registered user-space connection tracking helpers
7453 (home-page "https://netfilter.org/projects/libnetfilter_cthelper/index.html")
7454 (supported-systems (filter target-linux? %supported-systems))
7455 (properties '((upstream-name . "libnetfilter_cthelper")))
7456 (license license:gpl2+)))
7458 (define-public libnetfilter-queue
7460 (name "libnetfilter-queue")
7465 (uri (string-append "https://netfilter.org/projects/"
7466 "libnetfilter_queue/files/"
7467 "libnetfilter_queue-" version ".tar.bz2"))
7470 "1xdra6i4p8jkv943ygjw646qx8df27f7p5852kc06vjx608krzzr"))))
7471 (build-system gnu-build-system)
7472 (native-inputs (list pkg-config))
7473 (inputs (list libmnl libnfnetlink))
7474 (synopsis "Library for kernel netfilter infrastructure and state")
7475 (description "libnetfilter_queue is a userspace library providing an API
7476 to packets that have been queued by the kernel packet filter. It is is part
7477 of a system that deprecates the old ip_queue/libipq mechanism.")
7478 (home-page "https://netfilter.org/projects/libnetfilter_queue/index.html")
7479 (supported-systems (filter target-linux? %supported-systems))
7480 (properties '((upstream-name . "libnetfilter_queue")))
7481 (license license:gpl2+)))
7483 (define-public conntrack-tools
7485 (name "conntrack-tools")
7490 (uri (string-append "https://netfilter.org/projects/"
7491 "conntrack-tools/files/"
7492 "conntrack-tools-" version ".tar.bz2"))
7495 "0psx41bclqrh4514yzq03rvs3cq3scfpd1v4kkyxnic2hk65j22r"))))
7496 (build-system gnu-build-system)
7497 (native-inputs (list bison flex pkg-config))
7498 (inputs (list libtirpc
7499 libnetfilter-conntrack
7500 libnetfilter-cttimeout
7501 libnetfilter-cthelper
7505 (synopsis "Set of tools targeting the conntrack kernel subsystem")
7506 (description "The tool conntrack provides a full featured interface that
7507 is intended to replace the old @file{/proc/net/ip_conntrack} interface. Using
7508 conntrack, you can view and manage the in-kernel connection tracking state
7509 table from userspace. On the other hand, conntrackd covers the specific
7510 aspects of stateful firewalls to enable highly available scenarios, and can be
7511 used as statistics collector as well.
7513 Since 1.2.0, the conntrack-tools includes the @command{nfct} command line
7514 utility. This utility only supports the nfnetlink_cttimeout by now. In the
7515 long run, we expect that it will replace conntrack by providing a syntax
7516 similar to nftables.")
7517 (home-page "https://netfilter.org/projects/conntrack-tools/index.html")
7518 (supported-systems (filter target-linux? %supported-systems))
7519 (license license:gpl2+)))
7521 (define-public libnetfilter-acct
7523 (name "libnetfilter-acct")
7528 (uri (string-append "https://netfilter.org/projects/"
7529 "libnetfilter_acct/files/"
7530 "libnetfilter_acct-" version ".tar.bz2"))
7533 "06lsjndgfjsgfjr43px2n2wk3nr7whz6r405mks3887y7vpwwl22"))))
7534 (build-system gnu-build-system)
7535 (native-inputs (list pkg-config))
7536 (inputs (list libmnl))
7537 (synopsis "Library providing interface to extended accounting infrastructure")
7538 (description "libnetfilter_acct is the userspace library providing interface
7539 to extended accounting infrastructure.
7543 creating accounting objects
7545 retrieving accounting objects (and atomically set to zero)
7547 deleting accounting objects
7549 For the nfnetlink_acct subsystem.")
7550 (home-page "https://netfilter.org/projects/libnetfilter_acct/index.html")
7551 (supported-systems (filter target-linux? %supported-systems))
7552 (properties '((upstream-name . "libnetfilter_acct")))
7553 (license license:lgpl2.1+)))
7555 (define-public nfacct
7562 (uri (string-append "https://netfilter.org/projects/" name
7563 "/files/nfacct-" version ".tar.bz2"))
7566 "0sdxbxjyapbqcp2ami5jd10vz4xbbdvx39f3wfy1iqsbflc25zzc"))))
7567 (build-system gnu-build-system)
7568 (native-inputs (list pkg-config))
7569 (inputs (list libmnl libnetfilter-acct))
7570 (synopsis "Command line tool to create/retrieve/delete accounting objects")
7571 (description "nfacct is the command line tool to create/retrieve/delete
7575 listing the objects of the nfacct table in plain text/XML
7577 atomically get and reset objects of the nfacct table
7579 adding new objects to the nfacct table
7581 deleting objects from the nfacct table
7583 (home-page "https://netfilter.org/projects/nfacct/index.html")
7584 (supported-systems (filter target-linux? %supported-systems))
7585 (license license:gpl2+)))
7587 (define-public libnetfilter-log
7589 (name "libnetfilter-log")
7594 (uri (string-append "https://netfilter.org/projects/"
7595 "libnetfilter_log/files/"
7596 "libnetfilter_log-" version ".tar.bz2"))
7599 "1spy9xs41v76kid5ana8n126f3mvgq6fjibbfbj4kn0larbhix73"))))
7600 (build-system gnu-build-system)
7601 (native-inputs (list pkg-config))
7602 (inputs (list libnfnetlink libmnl))
7603 (synopsis "Library providing interface to packets logged by netfilter")
7604 (description "libnetfilter_log is a userspace library providing interface to
7605 packets that have been logged by the kernel packet filter. It is is part of a
7606 system that deprecates the old syslog/dmesg based packet logging. This library
7607 has been previously known as libnfnetlink_log.
7611 receiving to-be-logged packets from the kernel nfnetlink_log subsystem
7613 (home-page "https://netfilter.org/projects/libnetfilter_log/index.html")
7614 (supported-systems (filter target-linux? %supported-systems))
7615 (properties '((upstream-name . "libnetfilter_log")))
7616 (license license:gpl2+)))
7618 (define-public ulogd
7625 (uri (string-append "https://netfilter.org/projects/" name
7626 "/files/ulogd-" version ".tar.bz2"))
7629 "0ax9959c4bapq78n13bbaibcf1gwjir3ngx8l2dh45lw9m4ha2lr"))))
7630 (build-system gnu-build-system)
7632 ;; additonal non-default output plugins
7633 "json" "pcap" "sqlite3" "pgsql" "mysql"))
7634 (native-inputs (list pkg-config))
7635 (inputs (list libnfnetlink
7638 libnetfilter-conntrack
7648 (list #:configure-flags
7649 #~(list (string-append "--with-pgsql="
7650 (assoc-ref %build-inputs "postgresql"))
7651 (string-append "--with-mysql="
7652 (assoc-ref %build-inputs "mysql")))
7654 #~(modify-phases %standard-phases
7655 (add-after 'install 'install-doc
7657 (let ((out-etc (string-append #$output "/etc"))
7658 (ulogd.conf "ulogd.conf"))
7660 (copy-file ulogd.conf (string-append out-etc "/"
7662 (add-after 'install 'setup-plugin-outputs
7663 (lambda* (#:key outputs #:allow-other-keys)
7664 (with-directory-excursion
7665 (string-append #$output "/lib/ulogd/")
7667 (lambda (output-name)
7668 (let ((output-dir (string-append
7669 (assoc-ref outputs output-name)
7671 (mkdir-p output-dir)
7674 (copy-file plugin (string-append output-dir plugin))
7675 (delete-file plugin))
7677 (string-append "ulogd_output_"
7678 (string-upcase output-name)
7680 (list "json" "pcap" "sqlite3" "pgsql" "mysql"))))))))
7681 (synopsis "Logging daemon for netfilter and iptables")
7682 (description "ulogd is a userspace logging daemon for netfilter/iptables
7683 related logging. This includes per-packet logging of security violations,
7684 per-packet logging for accounting, per-flow logging and flexible user-defined
7689 Packet and flow-based traffic accounting
7691 Flexible user-defined traffic accounting via nfacct infrastructure
7693 SQL database back-end support: SQLite3, PostgreSQL, MySQL
7695 Text-based output formats: CSV, XML, Netfilter's LOG, Netfilter's conntrack
7697 (home-page "https://netfilter.org/projects/nfacct/index.html")
7698 (supported-systems (filter target-linux? %supported-systems))
7699 (license license:gpl2)))
7701 (define-public proot
7709 (url "https://github.com/proot-me/PRoot")
7710 (commit (string-append "v" version))))
7711 (file-name (git-file-name name version))
7713 (base32 "1r1ga3xbwq5kx4i8ihj1p6nmgaa14lfkwxzpsbdcmfh1jimpbmzk"))))
7714 (build-system gnu-build-system)
7715 ;; Many architectures are not supported (see:
7716 ;; https://github.com/proot-me/proot/blob/master/src/arch.h#L51).
7717 (supported-systems '("x86_64-linux" "i686-linux"
7718 "armhf-linux" "aarch64-linux" "i586-gnu"))
7720 ;; Disable the test suite on armhf-linux, as there are too many
7721 ;; failures to keep track of (see for example:
7722 ;; https://github.com/proot-me/proot/issues/286).
7723 `(#:tests? ,(not (or (%current-target-system)
7724 (string-prefix? "armhf"
7725 (or (%current-system)))))
7726 #:make-flags '("-C" "src")
7727 #:phases (modify-phases %standard-phases
7728 (add-after 'unpack 'patch-sources
7729 (lambda* (#:key inputs #:allow-other-keys)
7730 (substitute* (find-files "src" "\\.[ch]$")
7732 (string-append "\"" (assoc-ref inputs "bash")
7735 (substitute* "src/GNUmakefile"
7736 (("/bin/echo") (which "echo"))
7738 (string-append "VERSION := " ,version "\n")))
7740 (substitute* (find-files "test" "\\.sh$")
7741 ;; Some of the tests try to "bind-mount" /bin/true.
7743 (string-append "-b " (which "true") ":"))
7744 ;; Likewise for /bin.
7745 (("-b /bin:") "-b /gnu:")
7746 ;; Others try to run /bin/sh.
7747 (("/bin/sh") (which "sh"))
7748 ;; Others assume /etc/fstab exists.
7749 (("/etc/fstab") "/etc/passwd"))
7750 (substitute* "test/GNUmakefile"
7751 (("-b /bin:") "-b /gnu:"))
7752 (substitute* "test/test-c6b77b77.mk"
7753 (("/bin/bash") (which "bash"))
7754 (("/usr/bin/test") (which "test")))
7755 (substitute* "test/test-16573e73.c"
7756 (("/bin/([a-z-]+)" _ program)
7758 (substitute* "test/test-5467b986.sh"
7759 (("-w /usr") "-w /gnu")
7760 (("-w usr") "-w gnu")
7761 (("/usr/share") "/gnu/store")
7762 (("share") "store"))
7763 (substitute* "test/test-092c5e26.sh"
7765 "-q $(which echo) "))
7767 ;; The socket tests requires networking.
7768 (for-each delete-file
7769 (find-files "test" "test-socket.*\\.sh$"))))
7771 (add-after 'build 'build-manpage
7773 (with-directory-excursion "doc"
7774 (invoke "make" "proot/man.1" "SUFFIX=.py"))))
7776 (lambda* (#:key tests? #:allow-other-keys)
7778 (let ((n (parallel-job-count)))
7779 ;; Most of the tests expect "/bin" to be in $PATH so
7780 ;; they can run things that live in $ROOTFS/bin.
7782 (string-append (getenv "PATH") ":/bin"))
7783 (invoke "make" "check" "-C" "test"
7785 "-j" (number->string n))))))
7787 (lambda* (#:key outputs #:allow-other-keys)
7788 ;; The 'install' rule does nearly nothing.
7789 (let* ((out (assoc-ref outputs "out"))
7790 (man1 (string-append out "/share/man/man1")))
7791 ;; TODO: 'make install-care' (does not even
7792 ;; build currently.)
7793 (invoke "make" "-C" "src" "install"
7794 (string-append "PREFIX=" out))
7796 (copy-file "doc/proot/man.1"
7797 (string-append man1 "/proot.1"))))))))
7798 (native-inputs (list which
7799 ;; For 'mcookie', used by some of the tests.
7803 ;; For rst2man, used to generate the manual page.
7805 (inputs (list libarchive talloc))
7806 (home-page "https://github.com/proot-me/PRoot")
7807 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
7809 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
7810 and @code{binfmt_misc}. This means that users don't need any privileges or
7811 setup to do things like using an arbitrary directory as the new root
7812 file system, making files accessible somewhere else in the file system
7813 hierarchy, or executing programs built for another CPU architecture
7814 transparently through QEMU user-mode. Also, developers can use PRoot as a
7815 generic process instrumentation engine thanks to its extension mechanism.
7816 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
7817 available in the kernel Linux.")
7818 (license license:gpl2+)))
7820 (define-public proot-static
7823 (name "proot-static")
7825 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
7826 (inputs `(("talloc" ,talloc/static)))
7828 (substitute-keyword-arguments (package-arguments proot)
7829 ((#:make-flags flags)
7830 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
7832 `(modify-phases ,phases
7833 (add-after 'strip 'remove-store-references
7834 (lambda* (#:key outputs #:allow-other-keys)
7835 (let* ((out (assoc-ref outputs "out")))
7836 (with-directory-excursion out
7837 (remove-store-references "bin/proot")
7839 ((#:allowed-references _ '("out"))
7842 (define-public cpuid
7845 (version "20220812")
7848 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
7849 version ".src.tar.gz"))
7852 "1gss85szv4b48d93d6hzkkzggicdvw8dijiwfs84ywclgnwqzxiv"))))
7853 (build-system gnu-build-system)
7856 #~(list (string-append "CC=" #$(cc-for-target)))
7857 #:tests? #f ; no tests
7859 #~(modify-phases %standard-phases
7860 (delete 'configure) ; no configure script
7861 (add-before 'install 'fix-makefile
7862 (lambda* (#:key outputs #:allow-other-keys)
7863 (substitute* "Makefile"
7864 (("\\$\\(BUILDROOT\\)/usr")
7865 (assoc-ref outputs "out"))))))))
7866 (inputs (list perl))
7867 (supported-systems '("i686-linux" "x86_64-linux"))
7868 (home-page "http://www.etallen.com/cpuid.html")
7869 (synopsis "Dump x86 CPUID processor information")
7870 (description "cpuid dumps detailed information about the CPU(s) gathered
7871 from the CPUID instruction, and also determines the exact model of CPU(s). It
7872 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
7873 NexGen, Rise, and SiS CPUs.")
7874 (license license:gpl2+)))
7876 (define-public jmtpfs
7884 (url "https://github.com/JasonFerrara/jmtpfs")
7885 (commit (string-append "v" version))))
7886 (file-name (git-file-name name version))
7889 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
7890 (build-system gnu-build-system)
7892 (list file fuse libmtp))
7895 (home-page "https://github.com/JasonFerrara/jmtpfs")
7896 (synopsis "Use a FUSE file system to access data over MTP")
7897 (description "jmtpfs uses FUSE (file system in userspace) to provide access
7898 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
7899 the MTP device as a file system.")
7900 (license license:gpl3)))
7902 (define-public procenv
7910 (url "https://github.com/jamesodhunt/procenv")
7912 (file-name (git-file-name name version))
7914 (base32 "00d7q0h4qjc8lg435lq77lp2fx6ikm5piq90m81mr1dqqna1g6pz"))))
7915 (build-system gnu-build-system)
7921 (list expat libcap libselinux))
7922 (synopsis "Utility to show process environment")
7924 "Procenv is a command-line tool that displays as much detail about
7925 itself and its environment as possible. It can be used as a test
7926 tool, to understand the type of environment a process runs in, and for
7927 comparing system environments.")
7928 (home-page "https://github.com/jamesodhunt/procenv/")
7929 (license license:gpl3+)))
7931 (define-public libfabric
7939 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
7940 version "/libfabric-" version ".tar.bz2"))
7942 (base32 "1nnpfkwxhim2nqjkb1vwrb4wj4j3l6w6yvvy69fqam2snlhshazz"))))
7943 (build-system gnu-build-system)
7944 (inputs `(("rdma-core" ,rdma-core)
7945 ,@(match (%current-system)
7946 ((member (package-supported-systems psm))
7950 (home-page "https://ofiwg.github.io/libfabric/")
7951 (synopsis "Open Fabric Interfaces")
7953 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
7954 communication services to applications. OFI is best described as a collection
7955 of libraries and applications used to export fabric services. The key
7956 components of OFI are: application interfaces, provider libraries, kernel
7957 services, daemons, and test applications.
7959 Libfabric is a core component of OFI. It is the library that defines and
7960 exports the user-space API of OFI, and is typically the only software that
7961 applications deal with directly. It works in conjunction with provider
7962 libraries, which are often integrated directly into libfabric.")
7963 (license (list license:bsd-2 license:gpl2)))) ;dual
7968 (version "3.3.20170428")
7969 (home-page "https://github.com/intel/psm")
7973 (uri (git-reference (url home-page)
7974 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
7975 (file-name (string-append "psm-" version ".tar.gz"))
7977 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
7978 (patches (search-patches
7979 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
7980 "psm-ldflags.patch" ; build shared lib with LDFLAGS
7981 "psm-repro.patch" ; reproducibility
7982 "psm-disable-memory-stats.patch"))))
7983 (build-system gnu-build-system)
7984 (outputs '("out" "debug"))
7985 (inputs `(("libuuid" ,util-linux "lib")))
7987 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
7988 ,(string-append "INSTALL_PREFIX=" %output)
7989 ,(string-append "CFLAGS=-Wall -fpic -fPIC -D_GNU_SOURCE"
7990 " -funwind-tables -O3 -g3"
7991 " -DPSM_USE_SYS_UUID"
7992 " -Wno-strict-aliasing -DNVALGRIND"
7994 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
7996 #:phases (modify-phases %standard-phases
7998 (add-after 'unpack 'patch-/usr/include
8000 (substitute* "Makefile"
8001 (("\\$\\{DESTDIR}/usr/include")
8002 (string-append %output "/include")))
8003 (substitute* "Makefile"
8004 (("/lib64") "/lib"))
8006 (add-after 'unpack 'patch-sysmacros
8008 (substitute* "ipath/ipath_proto.c"
8009 (("#include <sys/poll.h>" m)
8010 (string-append m "\n"
8011 "#include <sys/sysmacros.h>")))
8013 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
8015 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
8016 communications interface for the True Scale family of products. PSM users are
8017 enabled with mechanisms necessary to implement higher level communications
8018 interfaces in parallel environments.")
8019 ;; Only Intel-compatable processors are supported.
8020 (supported-systems '("i686-linux" "x86_64-linux"))
8021 (license (list license:bsd-2 license:gpl2)))) ;dual
8023 (define-public snapscreenshot
8025 (name "snapscreenshot")
8026 (version "1.0.14.3")
8030 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
8031 name "-" version ".tar.bz2"))
8033 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
8034 (build-system gnu-build-system)
8037 (let ((out (assoc-ref %outputs "out")))
8038 (list (string-append "BINDIR=" out "/bin")
8039 (string-append "MANDIR=" out "/share/man")))
8040 #:tests? #f ; no test suite
8042 (modify-phases %standard-phases
8043 (delete 'configure) ; ./configure is a snarky no-op
8044 (add-before 'install 'fix-ownership
8045 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
8047 (substitute* "depfun.mak"
8048 ((" -o bin -g bin ") " "))
8050 (add-before 'install 'create-output-directories
8051 (lambda* (#:key outputs #:allow-other-keys)
8052 (let ((out (assoc-ref outputs "out")))
8053 (mkdir-p (string-append out "/share/man/man1"))
8055 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
8056 (synopsis "Take screenshots of one or more Linux text consoles")
8058 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
8059 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
8060 relevant @file{/dev/vcs*} file(s).")
8061 (license license:gpl2)))
8063 (define-public fbcat
8070 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
8071 version "/" name "-" version ".tar.gz"))
8073 (base32 "07q6f0xj7b4gjvn69qfn0g04yd0ch8ndzyigcz8nnrhli0cvsbh6"))))
8074 (build-system gnu-build-system)
8076 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
8077 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
8078 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
8079 `(("pnmtopng" ,netpbm)))
8080 (outputs (list "out" "fbgrab"))
8084 (string-append "PREFIX=" (assoc-ref %outputs "out")))
8085 #:tests? #f ; no tests
8087 (modify-phases %standard-phases
8088 (delete 'configure) ; no configure script
8089 (add-after 'build 'qualify-references
8090 (lambda* (#:key inputs outputs #:allow-other-keys)
8091 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
8092 (out (assoc-ref outputs "out")))
8093 (substitute* "fbgrab"
8095 (string-append out "/bin/" all))
8097 (string-append pnmtopng "/bin/" all))))))
8098 (add-after 'install 'split-fbgrab-output
8099 (lambda* (#:key outputs #:allow-other-keys)
8100 (let* ((out (assoc-ref outputs "out"))
8101 (out:fbgrab (assoc-ref outputs "fbgrab")))
8102 (for-each (lambda (file)
8103 (let ((old (string-append out "/" file))
8104 (new (string-append out:fbgrab "/" file)))
8105 (mkdir-p (dirname new))
8106 (rename-file old new)))
8108 "share/man/man1/fbgrab.1"))))))))
8109 (home-page "https://jwilk.net/software/fbcat")
8110 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
8112 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
8113 a dump therof. It supports a wide range of drivers and pixel formats.
8114 @command{fbcat} can take screenshots of virtually any application that can be
8115 made to write its output to the framebuffer, including (but not limited to)
8116 text-mode or graphical applications that don't use a display server.
8118 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
8119 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
8120 (license license:gpl2)))
8122 (define-public libcgroup
8126 (home-page "https://github.com/libcgroup/libcgroup")
8130 (uri (string-append home-page "/releases/download/v"
8131 version "/" name "-" version ".tar.gz"))
8133 (base32 "1y0c9ncsawamj77raiw6qkbm5cdsyvhjb2mvgma1kxmgw0r3pxlf"))))
8134 (build-system gnu-build-system)
8136 ;; Tests are virtualized with lxc, it is not very feasible
8137 ;; to make them executable under guix build. Also, note that
8138 ;; origin is using source tarball release which is prepared
8145 (synopsis "Control groups management tools")
8146 (description "Control groups is Linux kernel method for process resource
8147 restriction, permission handling and more. This package provides userspace
8148 interface to this kernel feature.")
8149 (license license:lgpl2.1)))
8151 (define-public mbpfan
8159 (url "https://github.com/dgraziotin/mbpfan")
8160 (commit (string-append "v" version))))
8161 (file-name (git-file-name name version))
8163 (base32 "0gc9ypxi55vxs77nx8ihhh9zk7fr9v0m0zfm76q7x0bi6jz11mbr"))))
8164 (build-system gnu-build-system)
8166 `(#:tests? #f ; tests ask to be run as root
8167 #:make-flags (let ((out (assoc-ref %outputs "out")))
8168 (list (string-append "DESTDIR=" out)
8169 ,(string-append "CC=" (cc-for-target))))
8171 (modify-phases %standard-phases
8172 (add-after 'unpack 'patch-paths
8174 (substitute* "Makefile"
8177 (delete 'configure)))) ; there's no configure phase
8178 (home-page "https://github.com/dgraziotin/mbpfan")
8179 (synopsis "Control fan speed on Macbooks")
8181 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
8182 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
8183 module. It can be executed as a daemon or in the foreground with root
8185 (license license:gpl3+)))
8190 (version "11.2.185")
8194 (url "https://github.com/intel/opa-psm2")
8195 (commit (string-append "PSM2_" version))))
8196 (file-name (git-file-name name version))
8199 "062hg4r6gz7pla9df70nqs5i2a3mp1wszmp4l0g771fykhhrxsjg"))))
8200 (build-system gnu-build-system)
8203 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
8205 #:phases (modify-phases %standard-phases
8207 (add-after 'unpack 'patch-Makefiles
8209 (substitute* "Makefile"
8212 (substitute* "compat/Makefile"
8218 (setenv "DESTDIR" %output)
8219 (invoke "make" "install")
8222 (list rdma-core numactl))
8223 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
8225 "This package is low-level user-level Intel's communications interface.
8226 The PSM2 API is a high-performance vendor-specific protocol that provides a
8227 low-level communications interface for the Intel Omni-Path family of
8228 high-speed networking devices.")
8229 (home-page "https://github.com/intel/opa-psm2")
8230 ;; Only the x86_64 architecure is supported.
8231 (supported-systems '("x86_64-linux"))
8232 (license (list license:bsd-3 license:gpl2)))) ; dual
8234 (define-public libpfm4
8240 (uri (string-append "mirror://sourceforge/perfmon2/"
8241 name "/libpfm-" version ".tar.gz"))
8244 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
8245 (build-system gnu-build-system)
8247 '(#:modules ((guix build utils)
8248 (guix build gnu-build-system))
8249 #:phases (modify-phases %standard-phases
8253 (lambda* (#:key inputs outputs #:allow-other-keys)
8254 (let* ((out (assoc-ref outputs "out")))
8256 (setenv "CFLAGS" "-Wno-format-truncation")
8260 (lambda* (#:key outputs #:allow-other-keys)
8261 (let* ((out (assoc-ref outputs "out")))
8263 (string-append "PREFIX=" out)
8266 (synopsis "Performance event monitoring library")
8268 "This package provides a library called libpfm4, which is used to develop
8269 monitoring tools exploiting the performance monitoring events such as those
8270 provided by the Performance Monitoring Unit (PMU) of modern processors.
8272 Libpfm4 helps convert from an event name, expressed as a string, to the event
8273 encoding that is either the raw event as documented by the hardware vendor or
8274 the OS-specific encoding. In the latter case, the library is able to prepare
8275 the OS-specific data structures needed by the kernel to setup the event.
8277 libpfm4 provides support for the @code{perf_events} interface, which was
8278 introduced in Linux 2.6.31.")
8279 (home-page "http://perfmon2.sourceforge.net/")
8280 (license license:expat)))
8282 (define-public libnfnetlink
8284 (name "libnfnetlink")
8289 "https://www.netfilter.org/projects/libnfnetlink/files/"
8290 "libnfnetlink-" version ".tar.bz2"))
8293 "0xn3rcrzxr6g82kfxzs9bqn2zvl2kf2yda30drwb9vr6sk1wfr5h"))))
8294 (build-system gnu-build-system)
8295 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
8296 (synopsis "Low-level netfilter netlink communication library")
8298 "@code{libnfnetlink} is the low-level library for netfilter related
8299 kernel/userspace communication. It provides a generic messaging
8300 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
8301 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
8302 management tools in userspace.")
8303 (license license:gpl2)))
8305 (define-public go-netlink
8312 (url "https://github.com/vishvananda/netlink")
8313 (commit (string-append "v" version))))
8314 (file-name (git-file-name name version))
8317 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
8318 (build-system go-build-system)
8320 `(#:import-path "github.com/vishvananda/netlink"))
8322 (list go-golang-org-x-sys go-netns))
8323 (home-page "https://github.com/vishvananda/netlink")
8324 (synopsis "Simple netlink library for Go")
8325 (description "The netlink package provides a simple netlink library for
8326 Go. Netlink is the interface a user-space program in Linux uses to
8327 communicate with the kernel. It can be used to add and remove interfaces, set
8328 IP addresses and routes, and configure IPsec.")
8329 (license license:asl2.0)))
8331 (define-public libinih
8338 (url "https://github.com/benhoyt/inih")
8339 (commit (string-append "r" version))))
8340 (file-name (git-file-name name version))
8343 "1fjqvf56yij15lgwj58dcmxlq5n98gzpbss0nnn1d2i5j7gf4kgf"))))
8344 (build-system meson-build-system)
8345 ;; Install static libraries for use by the initrd's xfsprogs/static.
8346 (outputs (list "out" "static"))
8349 (list "-Ddistro_install=true"
8350 "-Ddefault_library=both")
8352 (modify-phases %standard-phases
8353 (add-after 'install 'separate-static
8354 (lambda* (#:key outputs #:allow-other-keys)
8355 (let ((out (assoc-ref outputs "out"))
8356 (static (assoc-ref outputs "static")))
8357 (with-directory-excursion out
8358 (for-each (lambda (source)
8359 (let ((target (string-append static "/" source)))
8360 (mkdir-p (dirname target))
8361 (rename-file source target)))
8362 (find-files "lib" "\\.a$")))))))))
8363 (home-page "https://github.com/benhoyt/inih")
8364 (synopsis "Simple .INI parser library for C")
8365 (description "The inih (INI Not Invented Here) library is a simple .INI file
8366 parser written in C. It's only a couple of pages of code, and it was designed to
8367 be small and simple, so it's good for embedded systems. It's also more or less
8368 compatible with Python's ConfigParser style of .INI files, including RFC
8369 822-style multi-line syntax and name: value entries.")
8370 (license license:bsd-3)))
8372 (define-public xfsprogs
8379 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
8380 "xfsprogs-" version ".tar.gz"))
8383 "0368dacdjq55ip38yizs9spdyl7b0b1c0vz3gr1gvcb9rw3a6dnp"))))
8384 (build-system gnu-build-system)
8385 (outputs (list "out" "python"))
8387 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
8389 (list "--disable-static")
8393 (modify-phases %standard-phases
8394 (add-after 'install 'separate-python-output
8395 (lambda* (#:key outputs #:allow-other-keys)
8396 (let ((out (assoc-ref outputs "out"))
8397 (python (assoc-ref outputs "python")))
8400 (mkdir-p (string-append python (dirname script)))
8401 (rename-file (string-append out script)
8402 (string-append python script)))
8403 (list "/sbin/xfs_scrub_all")))))
8404 (add-after 'install 'install-headers
8405 (lambda* (#:key make-flags #:allow-other-keys)
8406 (apply invoke "make" "install-dev" make-flags))))))
8408 `(("gettext" ,gettext-minimal)))
8410 `(("libinih" ,libinih)
8411 ("liburcu" ,liburcu)
8412 ("libuuid" ,util-linux "lib")
8413 ("python" ,python-wrapper)))
8414 (home-page "https://xfs.wiki.kernel.org/")
8415 (synopsis "XFS file system tools")
8416 (description "This package provides commands to create and check XFS
8418 ;; The library "libhandle" and the headers in "xfslibs-dev" are
8419 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
8420 (license (list license:gpl2 license:lgpl2.1))))
8422 (define-public xfsprogs/static
8425 (name "xfsprogs-static")
8426 (outputs (list "out"))
8428 (substitute-keyword-arguments (package-arguments xfsprogs)
8429 ((#:configure-flags configure-flags '())
8430 `(append ,configure-flags
8431 (list "--enable-static")))
8432 ((#:make-flags make-flags ''())
8433 `(cons* "LLDFLAGS=-all-static" ,make-flags))
8435 `(modify-phases %standard-phases
8436 (add-after 'install 'delete-useless-files
8437 (lambda* (#:key outputs #:allow-other-keys)
8438 (with-directory-excursion (assoc-ref outputs "out")
8439 (for-each delete-file-recursively
8440 (list "include" "lib")))))))))
8442 `(("libinih:static" ,libinih "static")
8443 ("util-linux:static" ,util-linux "static")
8444 ,@(remove (match-lambda
8446 (member label '("python"))))
8447 (package-inputs xfsprogs))))
8448 (synopsis "Statically linked XFS file system tools")))
8450 (define-public xfs_repair/static
8452 (name "xfs_repair-static")
8453 (version (package-version xfsprogs/static))
8455 (build-system trivial-build-system)
8457 `(#:modules ((guix build utils))
8460 (use-modules (guix build utils))
8461 (let* ((xfsprogs (assoc-ref %build-inputs "xfsprogs"))
8462 (out (assoc-ref %outputs "out"))
8463 (sbin (string-append out "/sbin")))
8464 (install-file (string-append xfsprogs "/sbin/xfs_repair") sbin)
8465 (with-directory-excursion sbin
8466 (remove-store-references "xfs_repair"))))))
8468 `(("xfsprogs" ,xfsprogs/static)))
8469 (home-page (package-home-page xfsprogs/static))
8470 (synopsis "Statically linked @command{xfs_repair} from xfsprogs")
8472 "This package provides a statically linked @command{xfs_repair} taken
8473 from the xfsprogs package. It is meant to be used in initrds.")
8474 (license (package-license xfsprogs/static))))
8476 (define-public genext2fs
8483 (url "https://github.com/bestouff/genext2fs")
8484 (commit "474111097321f03de9e009aa9f7d4a8948e310b2")))
8485 (file-name (git-file-name name version))
8487 (base32 "14lgvml5zz99845ja47jpf4iirjzfqv36ffzachh3hw2ggji9c7l"))))
8488 (build-system gnu-build-system)
8490 (list autoconf automake))
8491 (home-page "https://github.com/bestouff/genext2fs")
8492 (synopsis "Generate ext2 file system as a normal user")
8493 (description "This package provides a program to generate an ext2
8494 file system as a normal (non-root) user. It does not require you to mount
8495 the image file to copy files on it, nor does it require that you become
8496 the superuser to make device nodes.")
8497 (license license:gpl2)))
8499 (define-public fakeroot
8505 ;; There are no tags in the repository, so take this snapshot.
8507 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
8508 "fakeroot/fakeroot_" version ".orig.tar.gz"))
8509 (file-name (string-append name "-" version ".tar.gz"))
8511 (base32 "1hlh77b6m2cfm42lcav372mbjni5akbgs25yg4wgi1gndzihbm2n"))
8512 (modules '((guix build utils)
8516 ;; Delete pregenerated man page translations, but not the originals.
8517 (with-directory-excursion "doc"
8518 (for-each (lambda (language)
8519 (for-each delete-file
8520 (find-files language "\\.[0-9]$")))
8523 (and (not (string-prefix? "." file))
8525 (stat:type (lstat file))))))))))))
8526 (build-system gnu-build-system)
8529 (list "--disable-static")
8531 (modify-phases %standard-phases
8532 (add-after 'unpack 'patch-Makefile.am
8534 (substitute* "Makefile.am"
8535 (("/bin/sh") (which "sh")))))
8536 (add-after 'unpack 'patch-script
8537 (lambda* (#:key inputs #:allow-other-keys)
8538 (substitute* "scripts/fakeroot.in"
8540 (string-append (assoc-ref inputs "util-linux")
8543 (string-append (assoc-ref inputs "sed")
8545 (("cat|cut" command)
8546 (string-append (assoc-ref inputs "coreutils")
8547 "/bin/" command)) )))
8550 ;; The "preroll" script takes care of Autoconf and also
8551 ;; prepares the translated manuals.
8552 (invoke "sh" "./preroll")))
8553 (add-before 'configure 'setenv
8555 (setenv "LIBS" "-lacl")))
8556 (add-before 'check 'prepare-check
8558 (setenv "SHELL" (which "bash"))
8559 (setenv "VERBOSE" "1")
8560 (substitute* "test/t.touchinstall"
8561 ;; We don't have the name of the root user, so use ID=0.
8562 (("grep root") "grep \"\\<0\\>\""))
8563 (substitute* "test/tartest"
8564 ;; We don't have the name of the root group, so use ID=0.
8565 (("ROOTGROUP=root") "ROOTGROUP=0")
8566 ;; We don't have the name of the daemon user, so use IDs.
8567 (("daemon:sys") "1:3")
8569 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
8570 (substitute* "test/compare-tar"
8571 (("tar -tvf") "tar --numeric-owner -tvf")))))))
8573 `(;; For bootstrapping the package.
8574 ("autoconf" ,autoconf-2.71)
8575 ("automake" ,automake)
8576 ("libtool" ,libtool)
8577 ("gettext" ,gettext-minimal)
8581 ("sharutils" ,sharutils)
8584 (list acl libcap util-linux sed coreutils))
8585 (synopsis "Run commands in an environment with fake root privileges")
8587 "@command{fakeroot} runs a command in an environment where it appears to
8588 have root privileges for file manipulation. This is useful for allowing users
8589 to create archives (@file{tar}, @file{ar}, @file{deb}, etc.) with files in
8590 them with root permissions and/or ownership.
8592 Without fakeroot, one would have to have root privileges to create the
8593 constituent files of the archives with the correct permissions and ownership,
8594 and then pack them up, or one would have to construct the archives directly,
8595 without using the archiver.")
8596 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
8597 (license license:gpl3+)))
8599 (define-public fakechroot
8600 ;; XXX: Build from the change submitted at
8601 ;; <https://github.com/dex4er/fakechroot/pull/85> to allow compilation
8602 ;; against glibc 2.33. Switch back to the official repository on the next
8604 (let ((commit "e7c1f3a446e594a4d0cce5f5d499c9439ce1d5c5")
8608 (version (git-version "2.20.1" revision commit))
8612 (url "https://github.com/lipnitsk/fakechroot")
8614 (file-name (git-file-name name version))
8617 "0gac6a6djx3nf343vd33sr5qqngz8ss3aij54zl8x9wb47pc11kb"))))
8618 (build-system gnu-build-system)
8620 ;; XXX: The tests heavily assume they run on an FHS system so for now
8623 #:configure-flags '("--disable-static")))
8624 (native-inputs (list autoconf automake libtool perl))
8625 (synopsis "Emulate @code{chroot} by overriding file system calls")
8627 "@command{fakechroot} runs a command in an environment were is additional
8628 possibility to use @code{chroot} command without root privileges. This is
8629 useful for allowing users to create own chrooted environment with possibility
8630 to install another packages without need for root privileges.
8632 It works by providing @file{libfakechroot.so}, a shared library meant to be
8633 set as @code{LD_PRELOAD} to override the C library file system functions.")
8634 (home-page "https://github.com/dex4er/fakechroot/")
8635 (license license:lgpl2.1+))))
8637 (define-public inputattach
8639 (name "inputattach")
8644 (url "https://github.com/linuxwacom/input-wacom")
8645 (commit (string-append "input-wacom-" version))))
8646 (file-name (git-file-name name version))
8648 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
8649 (build-system gnu-build-system)
8652 (modify-phases %standard-phases
8656 (lambda* (#:key inputs #:allow-other-keys)
8657 (with-directory-excursion "inputattach"
8658 (invoke "gcc" "-O2" "-o" "inputattach"
8662 (lambda* (#:key outputs #:allow-other-keys)
8663 (let ((target-dir (string-append
8664 (assoc-ref outputs "out")
8666 (mkdir-p target-dir)
8667 (copy-file "inputattach/inputattach"
8668 (string-append target-dir
8671 (home-page "https://linuxwacom.github.io/")
8672 (synopsis "Dispatch input peripherals events to a device file")
8673 (description "inputattach dispatches input events from several device
8674 types and interfaces and translates so that the X server can use them.")
8675 (license license:gpl2+)))
8677 (define-public pipewire
8684 (url "https://github.com/PipeWire/pipewire")
8686 (file-name (git-file-name name version))
8689 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))
8690 (patches (search-patches "pipewire-0.2.7-fno-common.patch"))))
8691 (build-system meson-build-system)
8693 '(#:configure-flags '("-Dsystemd=false")))
8706 (home-page "https://pipewire.org/")
8707 (synopsis "Server and user space API to deal with multimedia pipelines")
8709 "PipeWire is a project that aims to greatly improve handling of audio and
8710 video under Linux. It aims to support the usecases currently handled by both
8711 PulseAudio and Jack and at the same time provide same level of powerful handling
8712 of Video input and output. It also introduces a security model that makes
8713 interacting with audio and video devices from containerized applications easy,
8714 with supporting Flatpak applications being the primary goal. Alongside Wayland
8715 and Flatpak we expect PipeWire to provide a core building block for the future
8716 of Linux application development.")
8717 (license license:lgpl2.0+)))
8719 (define-public pipewire-0.3
8727 (url "https://github.com/PipeWire/pipewire")
8729 (file-name (git-file-name name version))
8732 "0gp2h0sidapcqmnifl0iipdmbzb18bdh8zdi7pfywr9gsksh0cxy"))))
8735 (list (string-append "-Dudevrulesdir=" (assoc-ref %outputs "out")
8736 "/lib/udev/rules.d")
8737 "-Dsystemd=disabled"
8738 "-Dsession-managers=[]")
8740 (modify-phases %standard-phases
8741 ;; Skip shrink-runpath, otherwise validate-runpath fails.
8742 (delete 'shrink-runpath))))
8743 (inputs (modify-inputs (package-inputs pipewire)
8752 (define-public wireplumber
8754 (name "wireplumber")
8761 "https://gitlab.freedesktop.org/pipewire/wireplumber.git")
8763 (file-name (git-file-name name version))
8765 (base32 "0g7xkgkjlxrhs49hqkwrjk2hb478gq55wwydafvvbsv78vsa7qfb"))))
8766 (build-system meson-build-system)
8768 `(#:configure-flags '("-Dsystemd=disabled"
8769 "-Dsystem-lua=true")))
8771 (list `(,glib "bin")
8773 (inputs (list dbus elogind glib lua pipewire-0.3))
8774 (home-page "https://gitlab.freedesktop.org/pipewire/wireplumber")
8775 (synopsis "Session / policy manager implementation for PipeWire")
8776 (description "WirePlumber is a modular session / policy manager for
8777 PipeWire and a GObject-based high-level library that wraps PipeWire's API,
8778 providing convenience for writing the daemon's modules as well as external
8779 tools for managing PipeWire.")
8780 (license license:expat)))
8789 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
8791 (file-name (git-file-name name version))
8794 "0lxjizby3zdyhzad5a0gbz4m2pp44jf1j4l1pn18d04rw9mr2gqy"))))
8795 (build-system gnu-build-system)
8797 ;; Tests launch dbus-daemon instances that all try to bind to
8798 ;; "/tmp/ell-test-bus". Thus, we need to run them sequentially.
8799 '(#:parallel-tests? #f))
8803 (list autoconf automake libtool pkg-config))
8804 (home-page "https://01.org/ell")
8805 (synopsis "Embedded Linux Library")
8806 (description "The Embedded Linux* Library (ELL) provides core, low-level
8807 functionality for system daemons. It typically has no dependencies other than
8808 the Linux kernel, C standard library, and libdl (for dynamic linking). While
8809 ELL is designed to be efficient and compact enough for use on embedded Linux
8810 platforms, it is not limited to resource-constrained systems.")
8811 (license license:lgpl2.1+)))
8813 (define-public kexec-tools
8815 (name "kexec-tools")
8819 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
8820 "/kexec/kexec-tools-" version ".tar.xz"))
8823 "06r44i91g1s9f7k5b9kmvb58j9vrqvysfh32pb70cnyrgmncsqxa"))))
8824 (build-system gnu-build-system)
8826 ;; There are no automated tests.
8828 ;; This variant of binutils is used for the 64 bit support needed to
8829 ;; assemble the `purgatory/arch/i386/compat_x86_64.S' program on i686-linux.
8830 (native-inputs (list (make-ld-wrapper "ld-wrapper"
8831 #:binutils binutils)
8833 (home-page "https://projects.horms.net/projects/kexec/")
8834 (synopsis "Tools for booting directly into different kernels")
8835 (description "This package provides the @code{kexec} program and ancillary
8836 utilities. Using @code{kexec}, it is possible to boot directly into a new
8837 kernel from the context of an already-running kernel, bypassing the normal
8838 system boot process.")
8839 (supported-systems (delete "riscv64-linux" %supported-systems))
8840 (license license:gpl2)))
8842 (define-public cachefilesd
8844 (name "cachefilesd")
8849 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
8850 "/cachefilesd.git/snapshot/cachefilesd-"
8854 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
8855 (build-system gnu-build-system)
8858 `(#:tests? #f ; there are no tests
8860 (let ((prefix-dir (lambda (var dir)
8861 (string-append var "=" %output "/" dir))))
8862 (list (string-append "CC=" ,(cc-for-target))
8863 (prefix-dir "SBINDIR" "sbin/")
8864 (prefix-dir "ETCDIR" "etc/")
8865 (prefix-dir "MANDIR" "share/man/")))
8866 #:phases (modify-phases %standard-phases (delete 'configure))))
8867 (home-page "https://people.redhat.com/~dhowells/cachefs/")
8868 (synopsis "CacheFiles userspace management daemon")
8869 (description "@code{cachefilesd} is a userspace daemon that manages the
8870 cache data store that is used by network file systems such as @code{AFS} and
8871 @code{NFS} to cache data locally on disk. The content of the cache is
8872 persistent over reboots.")
8873 (license license:gpl2+)))
8875 (define-public libbpf
8883 (url "https://github.com/libbpf/libbpf")
8884 (commit (string-append "v" version))))
8885 (file-name (git-file-name name version))
8888 "1zzpkk4x3f20483dzw43b3ml03d63vvkmqf4j8y3b61b67wm59bm"))))
8889 (build-system gnu-build-system)
8893 ;; In Requires.private of libbpf.pc.
8894 (list elfutils zlib))
8896 `(#:tests? #f ; no tests
8899 (string-append "PREFIX=" (assoc-ref %outputs "out"))
8900 (string-append "LIBDIR=$(PREFIX)/lib")
8901 (string-append "CC=" ,(cc-for-target)))
8903 (modify-phases %standard-phases
8905 (add-before 'build 'pre-build
8908 (home-page "https://github.com/libbpf/libbpf")
8909 (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
8911 "Libbpf supports building BPF CO-RE-enabled applications, which, in
8912 contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
8914 (license `(,license:lgpl2.1 ,license:bsd-2))))
8924 (url "https://github.com/iovisor/bcc")
8925 (commit (string-append "v" version))))
8926 (file-name (git-file-name name version))
8929 "1i6xikkxf2nasfkqa91hjzdq0a88mgyzrvia4fi2i2v1d8pbmnp4"))))
8930 (build-system cmake-build-system)
8934 `(("clang-toolchain" ,clang-toolchain-9)
8935 ("libbpf" ,(package-source libbpf))
8936 ;; LibElf required but libelf does not contain
8937 ;; archives, only object files.
8938 ;; https://github.com/iovisor/bcc/issues/504
8939 ("elfutils" ,elfutils)
8941 ("python-wrapper" ,python-wrapper)))
8943 `(;; Tests all require root permissions and a "standard" file hierarchy.
8946 (let ((revision ,version))
8947 `(,(string-append "-DREVISION=" revision)))
8949 (modify-phases %standard-phases
8950 ;; FIXME: Use "-DCMAKE_USE_LIBBPF_PACKAGE=ON".
8951 (add-after 'unpack 'copy-libbpf
8952 (lambda* (#:key inputs #:allow-other-keys)
8953 (delete-file-recursively "src/cc/libbpf")
8955 (assoc-ref inputs "libbpf") "src/cc/libbpf")))
8956 (add-after 'copy-libbpf 'substitute-libbc
8957 (lambda* (#:key outputs #:allow-other-keys)
8958 (substitute* "src/python/bcc/libbcc.py"
8959 (("(libbcc\\.so.*)\\b" _ libbcc)
8961 (assoc-ref outputs "out") "/lib/" libbcc)))))
8962 (add-after 'install 'wrap-tools
8963 (lambda* (#:key outputs #:allow-other-keys)
8964 (use-modules (ice-9 textual-ports))
8965 (let* ((out (assoc-ref outputs "out"))
8966 (lib (string-append out "/lib"))
8967 (tools (string-append out "/share/bcc/tools"))
8969 (lambda (filename _)
8970 (call-with-input-file filename
8972 (string-contains (get-line port)
8975 (lambda (python-executable)
8976 (format #t "Wrapping: ~A.~%" python-executable)
8977 (wrap-program python-executable
8978 `("GUIX_PYTHONPATH" ":" prefix
8979 (,(string-append lib
8981 ,(version-major+minor
8982 (package-version python))
8983 "/site-packages")))))
8984 (find-files tools python-executable?))
8986 (home-page "https://github.com/iovisor/bcc")
8987 (synopsis "Tools for BPF on Linux")
8989 "BCC is a toolkit for creating efficient kernel tracing and manipulation
8990 programs, and includes several useful tools and examples. It makes use of
8991 extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
8992 that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
8994 (license license:asl2.0)))
8996 (define-public bpftrace
9004 (url "https://github.com/iovisor/bpftrace")
9005 (commit (string-append "v" version))))
9006 (file-name (git-file-name name version))
9008 (base32 "022fg0kiz0liahj82wvlxmivkwyp86shs5fwr2v4blx7lh05k9zm"))
9009 (patches (search-patches "bpftrace-disable-bfd-disasm.patch"))))
9010 (build-system cmake-build-system)
9014 (list bcc clang-toolchain-9 elfutils libbpf cereal))
9016 `(#:tests? #f ;Tests require googletest sources.
9018 '("-DBUILD_TESTING=OFF"
9019 ;; FIXME: libbfd misses some link dependencies, when fixed, remove
9020 ;; the associated patch.
9021 "-DHAVE_BFD_DISASM=OFF")))
9022 (home-page "https://github.com/iovisor/bpftrace")
9023 (synopsis "High-level tracing language for Linux eBPF")
9025 "bpftrace is a high-level tracing language for Linux enhanced Berkeley
9026 Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses
9027 LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for
9028 interacting with the Linux BPF system, as well as existing Linux tracing
9029 capabilities: kernel dynamic tracing (kprobes), user-level dynamic
9030 tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk
9031 and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was
9032 created by Alastair Robertson.")
9033 (license license:asl2.0)))
9035 (define-public ttyebus-linux-module
9036 (let ((revision "0")
9037 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))
9039 (name "ttyebus-linux-module")
9040 (version (git-version "1.5" revision commit))
9045 (url "https://github.com/eBUS/ttyebus")
9046 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")))
9047 (file-name (git-file-name name version))
9050 "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani"))))
9051 (supported-systems '("armhf-linux" "aarch64-linux"))
9052 (build-system linux-module-build-system)
9055 (home-page "https://github.com/eBUS/ttyebus")
9056 (synopsis "Low-latency Raspberry Pi UART driver")
9057 (description "This package provides a Linux kernel module that will
9058 provide a serial device @code{/dev/ttyebus} with almost no latency upon
9059 receiving. It is dedicated to the PL011 UART of the Raspberry Pi.")
9060 (license license:gpl3+))))
9062 (define-public ipset
9069 (uri (string-append "https://ipset.netfilter.org/"
9070 "ipset-" version ".tar.bz2"))
9072 (base32 "0l8pcaym6057hq3a4zwnk53p5y6xg1m3d3c83wn18h5nmnm4am8a"))))
9073 (build-system gnu-build-system)
9079 `(#:configure-flags '("--disable-static"
9081 (home-page "https://ipset.netfilter.org/")
9082 (synopsis "Administration tool for IP sets")
9083 (description "IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel which
9084 can be administered by the ipset utility. Depending on the type,
9085 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
9086 IP addresses with MAC addresses in a way which ensures lightning speed
9087 when matching an entry against a set.
9091 @item store multiple IP addresses or port numbers and match against the entire
9092 collection using a single iptables rule.
9093 @item dynamically update iptables rules against IP addresses or ports without
9094 performance penalty.
9095 @item express complex IP address and ports based rulesets with a single
9096 iptables rule and benefit from the speed of IP sets.
9098 then IP sets may be the proper tool for you.")
9099 (license license:gpl2+)))
9101 (define-public liburing
9108 (url "https://git.kernel.dk/liburing")
9109 (commit (string-append "liburing-" version))))
9110 (file-name (git-file-name name version))
9113 "1677zqqbd9nw9hrdaxqbd1zwy54cxfsv2z0bjipn23mrkz2xzy1k"))))
9114 (build-system gnu-build-system)
9116 `(;; Tests are dependent on kernel version and features
9119 (modify-phases %standard-phases
9121 ;; configure fails if it is followed by SHELL, CONFIG_SHELL,
9122 ;; --enable-fast-install, and --build
9123 (lambda* (#:key outputs #:allow-other-keys)
9124 (let ((out (assoc-ref outputs "out")))
9125 (setenv "SHELL" (which "sh"))
9126 (setenv "CONFIG_SHELL" (which "sh"))
9127 (invoke "./configure" (string-append "--prefix=" out))))))))
9128 (home-page "https://github.com/axboe/liburing")
9129 (synopsis "Interface to the Linux kernel @code{io_uring} interface")
9130 (description "This is the io_uring library, liburing. liburing provides
9131 helpers to setup and teardown io_uring instances, and also a simplified
9132 interface for applications that don't need (or want) to deal with the full
9133 kernel side implementation.")
9134 (license license:expat)))
9136 (define-public erofs-utils
9138 (name "erofs-utils")
9144 (url "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git")
9145 (commit (string-append "v" version))))
9146 (file-name (git-file-name name version))
9148 (base32 "0rgkw3b924xdg49v3qi8a10w41zfk276wb6fp71lb9q9cfc81idw"))))
9149 (build-system gnu-build-system)
9152 `(,util-linux "lib")))
9154 (list autoconf automake libtool pkg-config))
9155 (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/")
9156 (synopsis "User-space tools for the EROFS file system")
9158 "@acronym{EROFS, The Enhanced Read-Only File System} is a compressed,
9159 read-only file system optimized for resource-scarce devices. This package
9160 provides user-space tools for creating EROFS file systems.")
9161 (license license:gpl2+)))
9163 (define-public rasdaemon
9171 (url "https://github.com/mchehab/rasdaemon")
9172 (commit (string-append "v" version))))
9173 (file-name (git-file-name name version))
9175 (base32 "0r0339mg4rc12p63iiq2kwdqn1zjakyiv014i2a2l9s8v5rjik41"))))
9176 (native-inputs (list autoconf automake libtool))
9177 (inputs (list sqlite))
9180 (list "--enable-all"
9181 ;; Don't install unused /etc/sysconfig/rasdaemon environment file.
9182 "--with-sysconfdefdir=."
9183 "--localstatedir=/var")
9185 (modify-phases %standard-phases
9186 (add-before 'configure 'munge-autotools
9188 ;; For some reason upstream forces sysconfdir=/etc. This results
9189 ;; in EPERM during the install phase. Removing the offending
9190 ;; line lets sysconfdir correctly pick up DESTDIR.
9191 (substitute* "configure.ac"
9192 (("^test .* sysconfdir=/etc\n$") ""))
9193 ;; Upstream tries to create /var/lib/rasdaemon at install time.
9194 ;; This results in EPERM on guix. Instead, the service should
9195 ;; create this at activation time.
9196 (substitute* "Makefile.am"
9197 (("^\\s*\\$\\(install_sh\\) -d .*@RASSTATEDIR@.*$") "")))))))
9198 (build-system gnu-build-system)
9199 (home-page "https://github.com/mchehab/rasdaemon")
9200 (synopsis "Platform Reliability, Availability, and Serviceability tools")
9202 "The @code{rasdaemon} daemon monitors platform @acronym{RAS, Reliability
9203 Availability and Serviceability} reports from Linux kernel trace events.
9204 These trace events are logged in @file{/sys/kernel/debug/tracing} and reported
9205 through standard log mechanisms like syslog.")
9206 (license license:gpl2)))
9208 (define-public libgpiod
9217 (url "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
9218 (commit (string-append "v" version))))
9219 (file-name (git-file-name name version))
9220 (sha256 (base32 "0rv8a11hx3pc6sdw6nfc6k35hkp2clb3v53n1381cvip8fzhbsad"))))
9221 (build-system gnu-build-system)
9224 '("--enable-tools=yes"
9225 "--enable-bindings-cxx"
9226 "--enable-bindings-python")))
9234 (synopsis "Interact with the Linux GPIO character device")
9236 "This package provides a C library with C++/Python bindings and
9237 command-line tools for interacting with GPIO devices that avoids the usage of
9238 older system-wide @file{/sys} interface.")
9239 (home-page "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/")
9240 (license (list license:lgpl2.1+ ;; libgpiod
9241 license:gpl2+ ;; gpio-tools
9242 license:lgpl3+)))) ;; C++ bindings
9244 (define-public libtree
9252 (url "https://github.com/haampie/libtree")
9253 (commit (string-append "v" version))))
9254 (file-name (git-file-name name version))
9256 (base32 "1jbc60cslzcfxk9jwva51ncr1zl1nz0fkgfjdckgv81is11nswmb"))))
9259 ;; NOTE: Official documentation recommends to build libtree with
9261 #~(list (string-append "CC=" #$(cc-for-target))
9262 (string-append "PREFIX=" #$output))
9264 #~(modify-phases %standard-phases
9265 (add-after 'unpack 'fix-tests
9266 ;; XXX: '08_nodeflib' fails as 'libtree' returns a non-zero
9267 ;; code in one of the tests.
9269 ;; See <https://github.com/haampie/libtree/issues/80>).
9271 (substitute* "tests/08_nodeflib/Makefile"
9272 (("! ../../libtree -vvv exe_b")
9273 "../../libtree -vvv exe_b"))))
9274 (delete 'configure))))
9275 (build-system gnu-build-system)
9276 (home-page "https://github.com/haampie/libtree")
9277 (synopsis "Show output of @command{ldd} as a tree")
9279 "This tool turns @command{ldd} into a tree and explains how shared
9280 libraries are found or why they cannot be located.")
9281 (license license:expat)))
9283 (define-public touchegg
9291 (url "https://github.com/JoseExposito/touchegg")
9293 (file-name (git-file-name name version))
9295 (base32 "0shvslz0c8nqx5f988z55qjc9xw0in9rb7b19r6vr1f7cdkqb6yr"))))
9296 (build-system cmake-build-system)
9298 `(#:tests? #f ; No tests exist
9300 (list "-DUSE_SYSTEMD=OFF"))) ; No systemd
9313 (home-page "https://github.com/JoseExposito/touchegg")
9314 (synopsis "Multitouch gesture recognizer")
9316 "Touchégg is an application that runs in the background and transform the
9317 gestures you make on your touchpad or touchscreen into visible actions in your
9319 (license license:gpl3+)))
9321 (define-public evtest
9328 (url "https://gitlab.freedesktop.org/libevdev/evtest")
9329 (commit (string-append "evtest-" version))))
9330 (file-name (git-file-name name version))
9333 "164prnw35kda6jfykl7h52lfzy99ma2lk029zscyqk766k19spf4"))))
9334 (build-system gnu-build-system)
9336 (list #:tests? #f ;No tests exist
9337 #:make-flags #~(list (string-append "CC="
9339 (string-append "PREFIX="
9341 #:phases #~(modify-phases %standard-phases
9342 (add-after 'unpack 'generate-doc
9344 (invoke "asciidoc" "-d" "manpage"
9348 (invoke "xsltproc" "--nonet"
9350 #$(this-package-native-input "docbook-xsl")
9351 "/xml/xsl/docbook-xsl-"
9353 (this-package-native-input "docbook-xsl"))
9354 "/manpages/docbook.xsl")
9358 (setenv "CONFIG_SHELL" (which "sh"))
9359 (invoke "autoreconf" "-fi"))))))
9360 (native-inputs (list autoconf
9367 (home-page "https://gitlab.freedesktop.org/libevdev/evtest")
9368 (synopsis "Kernel evdev device information and monitor")
9370 "@code{evtest} is a tool to print @code{evdev} kernel events. It reads
9371 directly from the kernel device and prints a device description and the events
9372 with the value and the symbolic name.")
9373 (license license:gpl2+)))