projects/guix·blob javascript-team · refs

12970 lines · 557.6 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012-2021, 2021-2026 Ludovic Courtès <[email protected]>
3;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <[email protected]>
4;;; Copyright © 2012 Nikita Karetnikov <[email protected]>
5;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <[email protected]>
6;;; Copyright © 2015 Federico Beffa <[email protected]>
7;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <[email protected]>
8;;; Copyright © 2015-2018, 2020, 2022-2025 Efraim Flashner <[email protected]>
9;;; Copyright © 2016 Christine Lemmer-Webber <[email protected]>
10;;; Copyright © 2016–2022 Tobias Geerinckx-Rice <[email protected]>
11;;; Copyright © 2016, 2017 Alex Kost <[email protected]>
12;;; Copyright © 2016 Raymond Nicholson <[email protected]>
13;;; Copyright © 2016 Mathieu Lirzin <[email protected]>
14;;; Copyright © 2016, 2018-2023, 2025 Nicolas Goaziou <[email protected]>
15;;; Copyright © 2016, 2018, 2019, 2020, 2021, 2022, 2023 Ricardo Wurmus <[email protected]>
16;;; Copyright © 2016 David Craven <[email protected]>
17;;; Copyright © 2016 John Darrington <[email protected]>
18;;; Copyright © 2016-2023 Marius Bakke <[email protected]>
19;;; Copyright © 2016, 2018 Rene Saavedra <[email protected]>
20;;; Copyright © 2016 Carlos Sánchez de La Lama <[email protected]>
21;;; Copyright © 2016, 2017 Nikita <[email protected]>
22;;; Copyright © 2017, 2018, 2020, 2021, 2022 Leo Famulari <[email protected]>
23;;; Copyright © 2017 José Miguel Sánchez García <[email protected]>
24;;; Copyright © 2017 Gábor Boskovits <[email protected]>
25;;; Copyright © 2017, 2019, 2021 Mathieu Othacehe <[email protected]>
26;;; Copyright © 2017 Clément Lassieur <[email protected]>
27;;; Copyright © 2017, 2018, 2019 Rutger Helling <[email protected]>
28;;; Copyright © 2017 nee <[email protected]>
29;;; Copyright © 2017 Dave Love <[email protected]>
30;;; Copyright © 2018 Pierre-Antoine Rouby <[email protected]>
31;;; Copyright © 2018, 2020, 2022 Brendan Tildesley <[email protected]>
32;;; Copyright © 2018 Manuel Graf <[email protected]>
33;;; Copyright © 2018, 2019 Pierre Langlois <[email protected]>
34;;; Copyright © 2018 Vasile Dumitrascu <[email protected]>
35;;; Copyright © 2019 Tim Gesthuizen <[email protected]>
36;;; Copyright © 2019 mikadoZero <[email protected]>
37;;; Copyright © 2019-2026 Maxim Cournoyer <[email protected]>
38;;; Copyright © 2019 Stefan Stefanović <[email protected]>
39;;; Copyright © 2019-2022 Brice Waegeneire <[email protected]>
40;;; Copyright © 2019 Kei Kebreau <[email protected]>
41;;; Copyright © 2020, 2021, 2025 Oleg Pykhalov <[email protected]>
42;;; Copyright © 2020 Pierre Neidhardt <[email protected]>
43;;; Copyright © 2020 Chris Marusich <[email protected]>
44;;; Copyright © 2020 Vincent Legoll <[email protected]>
45;;; Copyright © 2020, 2023-2026 Janneke Nieuwenhuizen <[email protected]>
46;;; Copyright © 2020 Morgan Smith <[email protected]>
47;;; Copyright © 2020 John Soo <[email protected]>
48;;; Copyright © 2020, 2022 Michael Rohleder <[email protected]>
49;;; Copyright © 2020 Anders Thuné <[email protected]>
50;;; Copyright © 2020, 2021 Greg Hogan <[email protected]>
51;;; Copyright © 2020 Zhu Zihao <[email protected]>
52;;; Copyright © 2020 David Dashyan <[email protected]>
53;;; Copyright © 2020 pukkamustard <[email protected]>
54;;; Copyright © 2021 Solene Rapenne <[email protected]>
55;;; Copyright © 2021 B. Wilson <[email protected]>
56;;; Copyright © 2021 Ivan Gankevich <[email protected]>
57;;; Copyright © 2021 Maxime Devos <[email protected]>
58;;; Copyright © 2021, 2023 Guillaume Le Vaillant <[email protected]>
59;;; Copyright © 2021 Sarah Morgensen <[email protected]>
60;;; Copyright © 2021 Felix Gruber <[email protected]>
61;;; Copyright © 2021 Josselin Poiret <[email protected]>
62;;; Copyright © 2021 Olivier Dion <[email protected]>
63;;; Copyright © 2021 Solene Rapenne <[email protected]>
64;;; Copyright © 2021, 2022 Petr Hodina <[email protected]>
65;;; Copyright © 2021 Ryan Sundberg <[email protected]>
66;;; Copyright © 2022-2026 Artyom V. Poptsov <[email protected]>
67;;; Copyright © 2022 Rene Saavedra <[email protected]>
68;;; Copyright © 2022 muradm <[email protected]>
69;;; Copyright © 2022, 2023 Denis 'GNUtoo' Carikli <[email protected]>
70;;; Copyright © 2022 Hunter Jozwiak <[email protected]>
71;;; Copyright © 2022 Hilton Chain <[email protected]>
72;;; Copyright © 2022 Stefan <[email protected]>
73;;; Copyright © 2022, 2023 Demis Balbach <[email protected]>
74;;; Copyright © 2023 Bruno Victal <[email protected]>
75;;; Copyright © 2023 Yovan Naumovski <[email protected]>
76;;; Copyright © 2023, 2025 Zheng Junjie <[email protected]>
77;;; Copyright © 2023 dan <[email protected]>
78;;; Copyright © 2023 Foundation Devices, Inc. <[email protected]>
79;;; Copyright © 2023, 2024, 2026 Wilko Meyer <[email protected]>
80;;; Copyright © 2023 Jaeme Sifat <[email protected]>
81;;; Copyright © 2024 Gabriel Wicki <[email protected]>
82;;; Copyright © 2024 Sharlatan Hellseher <[email protected]>
83;;; Copyright © 2024 Arun Isaac <[email protected]>
84;;; Copyright © 2024-2026 Ashish SHUKLA <[email protected]>
85;;; Copyright © 2025 Nigko Yerden <[email protected]>
86;;; Copyright © 2025 Mathieu Laparie <[email protected]>
87;;; Copyright © 2025 John Kehayias <[email protected]>
88;;; Copyright © 2025 Arjan Adriaanse <[email protected]>
89;;; Copyright © 2025 Dariqq <[email protected]>
90;;; Copyright © 2026 Justin Veilleux <[email protected]>
91;;; Copyright © 2026 Simen Endsjø <[email protected]>
92;;;
93;;; This file is part of GNU Guix.
94;;;
95;;; GNU Guix is free software; you can redistribute it and/or modify it
96;;; under the terms of the GNU General Public License as published by
97;;; the Free Software Foundation; either version 3 of the License, or (at
98;;; your option) any later version.
99;;;
100;;; GNU Guix is distributed in the hope that it will be useful, but
101;;; WITHOUT ANY WARRANTY; without even the implied warranty of
102;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
103;;; GNU General Public License for more details.
104;;;
105;;; You should have received a copy of the GNU General Public License
106;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
107
108(define-module (gnu packages linux)
109 #:use-module (gnu packages acl)
110 #:use-module (gnu packages admin)
111 #:use-module (gnu packages algebra)
112 #:use-module (gnu packages apparmor)
113 #:use-module (gnu packages audio)
114 #:use-module (gnu packages autotools)
115 #:use-module (gnu packages backup)
116 #:use-module (gnu packages base)
117 #:use-module (gnu packages bash)
118 #:use-module (gnu packages bison)
119 #:use-module (gnu packages boost)
120 #:use-module (gnu packages calendar)
121 #:use-module (gnu packages check)
122 #:use-module (gnu packages compression)
123 #:use-module (gnu packages cpio)
124 #:use-module (gnu packages cpp)
125 #:use-module (gnu packages crypto)
126 #:use-module (gnu packages cryptsetup)
127 #:use-module (gnu packages curl)
128 #:use-module (gnu packages databases)
129 #:use-module (gnu packages datastructures)
130 #:use-module (gnu packages dbm)
131 #:use-module (gnu packages disk)
132 #:use-module (gnu packages dlang)
133 #:use-module (gnu packages dns)
134 #:use-module (gnu packages docbook)
135 #:use-module (gnu packages documentation)
136 #:use-module (gnu packages elf)
137 #:use-module (gnu packages file)
138 #:use-module (gnu packages compiler-tools)
139 #:use-module (gnu packages fontutils)
140 #:use-module (gnu packages freedesktop)
141 #:use-module (gnu packages gawk)
142 #:use-module (gnu packages gcc)
143 #:use-module (gnu packages gettext)
144 #:use-module (gnu packages glib)
145 #:use-module (gnu packages gnome)
146 #:use-module (gnu packages gnupg)
147 #:use-module (gnu packages golang)
148 #:use-module (gnu packages golang-xyz)
149 #:use-module (gnu packages gperf)
150 #:use-module (gnu packages graphviz)
151 #:use-module (gnu packages groff)
152 #:use-module (gnu packages gstreamer)
153 #:use-module (gnu packages gtk)
154 #:use-module (gnu packages guile)
155 #:use-module (gnu packages haskell-apps)
156 #:use-module (gnu packages haskell-xyz)
157 #:use-module (gnu packages image)
158 #:use-module (gnu packages kde-frameworks)
159 #:use-module (gnu packages kde-graphics)
160 #:use-module (gnu packages libedit)
161 #:use-module (gnu packages libevent)
162 #:use-module (gnu packages libunwind)
163 #:use-module (gnu packages libusb)
164 #:use-module (gnu packages llvm)
165 #:use-module (gnu packages lsof)
166 #:use-module (gnu packages lua)
167 #:use-module (gnu packages m4)
168 #:use-module (gnu packages man)
169 #:use-module (gnu packages maths)
170 #:use-module (gnu packages multiprecision)
171 #:use-module (gnu packages ncurses)
172 #:use-module (gnu packages netpbm)
173 #:use-module (gnu packages networking)
174 #:use-module (gnu packages nss)
175 #:use-module (gnu packages onc-rpc)
176 #:use-module (gnu packages oneapi)
177 #:use-module (gnu packages patchutils)
178 #:use-module (gnu packages pciutils)
179 #:use-module (gnu packages perl)
180 #:use-module (gnu packages photo)
181 #:use-module (gnu packages pkg-config)
182 #:use-module (gnu packages polkit)
183 #:use-module (gnu packages popt)
184 #:use-module (gnu packages protobuf)
185 #:use-module (gnu packages pulseaudio)
186 #:use-module (gnu packages python)
187 #:use-module (gnu packages python-build)
188 #:use-module (gnu packages python-xyz)
189 #:use-module (gnu packages qt)
190 #:use-module (gnu packages readline)
191 #:use-module (gnu packages regex)
192 #:use-module (gnu packages rocm)
193 #:use-module (gnu packages rpc)
194 #:use-module (gnu packages rrdtool)
195 #:use-module (gnu packages rsync)
196 #:use-module (gnu packages rust-apps)
197 #:use-module (gnu packages rust-sources)
198 #:use-module (gnu packages samba)
199 #:use-module (gnu packages sdl)
200 #:use-module (gnu packages selinux)
201 #:use-module (gnu packages serialization)
202 #:use-module (gnu packages slang)
203 #:use-module (gnu packages sphinx)
204 #:use-module (gnu packages sqlite)
205 #:use-module (gnu packages swig)
206 #:use-module (gnu packages texinfo)
207 #:use-module (gnu packages textutils)
208 #:use-module (gnu packages tls)
209 #:use-module (gnu packages valgrind)
210 #:use-module (gnu packages video)
211 #:use-module (gnu packages vim)
212 #:use-module (gnu packages vulkan)
213 #:use-module (gnu packages web)
214 #:use-module (gnu packages xdisorg)
215 #:use-module (gnu packages xiph)
216 #:use-module (gnu packages xml)
217 #:use-module (gnu packages xorg)
218 #:use-module (gnu packages)
219 #:use-module (guix build-system cargo)
220 #:use-module (guix build-system cmake)
221 #:use-module (guix build-system copy)
222 #:use-module (guix build-system gnu)
223 #:use-module (guix build-system go)
224 #:use-module (guix build-system linux-module)
225 #:use-module (guix build-system meson)
226 #:use-module (guix build-system pyproject)
227 #:use-module (guix build-system qt)
228 #:use-module (guix build-system trivial)
229 #:use-module (guix deprecation) ;for libcap/next
230 #:use-module (guix download)
231 #:use-module (guix gexp)
232 #:use-module (guix git-download)
233 #:use-module ((guix licenses) #:prefix license:)
234 #:use-module (guix monads)
235 #:use-module (guix packages)
236 #:use-module (guix platform)
237 #:use-module (guix store)
238 #:use-module (guix utils)
239 #:use-module (ice-9 match)
240 #:use-module (ice-9 regex)
241 #:use-module (srfi srfi-1)
242 #:use-module (srfi srfi-2)
243 #:use-module (srfi srfi-26)
244 #:export (customize-linux
245 make-defconfig))
246
247
248
249;;;
250;;; Linux kernel customization functions.
251;;;
252
253(define* (customize-linux #:key name
254 (linux linux-libre)
255 source
256 defconfig
257 modconfig
258 (configs "")
259 extra-version)
260 "Make a customized Linux package NAME derived from the LINUX package.
261
262If NAME is not given, then it defaults to the same name as the LINUX package.
263
264Unless SOURCE is given the source of LINUX is used.
265
266A DEFCONFIG file to be used can be given as an origin, as a file-like object
267(file-append, local-file etc.), or as a string with the name of a defconfig file
268available in the Linux sources. If DEFCONFIG is not given, then a defconfig
269file will be saved from the LINUX package configuration.
270
271MODCONFIG is an origin or file-like object used for make localmodconfig to
272disable unlisted modules. For instance, this can come from using modprobed-db
273periodically on a running machine to find all loaded modules.
274
275Additional CONFIGS will be used to modify the given or saved defconfig, which
276will finally be used to build Linux.
277
278CONFIGS can be a list of strings, with one configuration per line. The usual
279defconfig syntax has to be used, but there is a special extension to ease the
280removal of configurations. Comment lines are supported as well.
281
282Here is an example:
283
284 '(;; This string defines the version tail in 'uname -r'.
285 \"CONFIG_LOCALVERSION=\\\"-handcrafted\\\"
286 ;; This '# CONFIG_... is not set' syntax has to match exactly!
287 \"# CONFIG_BOOT_CONFIG is not set\"
288 \"CONFIG_NFS_SWAP=y\"
289 ;; This is a multiline configuration:
290 \"CONFIG_E1000=y
291# This is a comment, below follows an extension to unset a configuration:
292CONFIG_CMDLINE_EXTEND\")
293
294A string of configurations instead of a list of configuration strings is also
295possible.
296
297EXTRA-VERSION can be a string overwriting the EXTRAVERSION setting of the LINUX
298package, after being prepended by a hyphen. It will be visible in the output
299of 'uname -r' behind the Linux version numbers."
300 (package
301 (inherit linux)
302 (name (or name (package-name linux)))
303 (source (or source (package-source linux)))
304 (arguments
305 (substitute-keyword-arguments
306 (package-arguments linux)
307 ((#:imported-modules imported-modules %default-gnu-imported-modules)
308 `((guix build kconfig) ,@imported-modules))
309 ((#:modules modules)
310 `((guix build kconfig) ,@modules))
311 ((#:phases phases)
312 #~(modify-phases #$phases
313 (replace 'configure
314 (lambda* (#:key inputs #:allow-other-keys #:rest arguments)
315 (setenv "EXTRAVERSION"
316 #$(and extra-version
317 (not (string-null? extra-version))
318 (string-append "-" extra-version)))
319 (let* ((configs (string-append "arch/" #$(linux-srcarch)
320 "/configs/"))
321 (guix_defconfig (string-append configs
322 "guix_defconfig")))
323 #$(cond
324 ((not defconfig)
325 #~(begin
326 ;; Call the original 'configure phase.
327 (apply (assoc-ref #$phases 'configure) arguments)
328 ;; Save a defconfig file.
329 (invoke "make" "savedefconfig")
330 ;; Move the saved defconfig to the proper location.
331 (rename-file "defconfig"
332 guix_defconfig)))
333 ((string? defconfig)
334 ;; Use another existing defconfig from the Linux sources.
335 #~(rename-file (string-append configs #$defconfig)
336 guix_defconfig))
337 (else
338 ;; Copy the defconfig input to the proper location.
339 #~(copy-file #$defconfig guix_defconfig)))
340 (chmod guix_defconfig #o644)
341 (modify-defconfig guix_defconfig '#$configs)
342 (invoke "make" "guix_defconfig")
343 (verify-config ".config" guix_defconfig)
344 ;; Minimize module building if provided e.g. a modprobed-db
345 ;; database.
346 (if #$modconfig
347 (invoke "make" (string-append "LSMOD=" #$modconfig)
348 "localmodconfig")))))))))))
349
350(define (make-defconfig uri sha256-as-base32)
351 (origin (method url-fetch)
352 (uri uri)
353 (sha256 (base32 sha256-as-base32))))
354
355(define (linux-srcarch)
356 "Return the linux SRCARCH name, which is set in the toplevel Makefile of
357Linux and denotes the architecture-specific directory name below arch/ in its
358source code. Some few architectures share a common folder. It resembles the
359definition of SRCARCH based on ARCH in the Makefile and may be used to place a
360defconfig file in the proper path."
361 (let ((linux-arch (platform-linux-architecture
362 (lookup-platform-by-target-or-system
363 (or (%current-target-system)
364 (%current-system))))))
365 (match linux-arch
366 ("i386" "x86")
367 ("x86_64" "x86")
368 ("sparc32" "sparc")
369 ("sparc64" "sparc")
370 ("sh64" "sh")
371 (_ linux-arch))))
372
373(define-public (system->defconfig system)
374 "Some systems (notably powerpc-linux) require a special target for kernel
375defconfig. Return the appropriate Make target if applicable, otherwise return
376\"defconfig\"."
377 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
378 ((string-prefix? "powerpc64-" system) "ppc64_defconfig")
379 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
380 (else "defconfig")))
381
382
383;;;
384;;; Kernel source code deblobbing.
385;;;
386
387(define (linux-libre-deblob-scripts version gnu-revision
388 deblob-hash
389 deblob-check-hash)
390 (list (version-major+minor version)
391 (origin
392 (method url-fetch)
393 (uri (string-append "https://linux-libre.fsfla.org"
394 "/pub/linux-libre/releases/" version "-" gnu-revision "/"
395 "deblob-" (version-major+minor version)))
396 (file-name (string-append "linux-libre-deblob-"
397 version "-" gnu-revision))
398 (sha256 deblob-hash))
399 (origin
400 (method url-fetch)
401 (uri (string-append "https://linux-libre.fsfla.org"
402 "/pub/linux-libre/releases/" version "-" gnu-revision "/"
403 "deblob-check"))
404 (file-name (string-append "linux-libre-deblob-check-" version "-" gnu-revision))
405 (sha256 deblob-check-hash))))
406
407;; XXXX: Workaround 'snippet' limitations
408(define computed-origin-method (@@ (guix packages) computed-origin-method))
409
410(define (make-linux-libre-source version
411 upstream-source
412 deblob-scripts)
413 "Return a 'computed' origin that generates a Linux-libre tarball from the
414corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
415 (match deblob-scripts
416 ((deblob-version (? origin? deblob) (? origin? deblob-check))
417 (unless (string=? deblob-version (version-major+minor version))
418 ;; The deblob script cannot be expected to work properly on a
419 ;; different version (major+minor) of Linux, even if no errors
420 ;; are signaled during execution.
421 (error "deblob major+minor version mismatch"))
422 (define unchecked-source
423 (make-linux-source
424 version upstream-source
425 (delay
426 (with-imported-modules '((guix build utils))
427 #~(begin
428 (use-modules (guix build utils))
429
430 (mkdir "/tmp/bin")
431 (set-path-environment-variable
432 "PATH" '("bin")
433 (list "/tmp"
434 #+(canonical-package bash)
435 #+(canonical-package coreutils)
436 #+(canonical-package diffutils)
437 #+(canonical-package findutils)
438 #+(canonical-package patch)
439 #+(canonical-package xz)
440 #+(canonical-package sed)
441 #+(canonical-package grep)
442 #+(canonical-package bzip2)
443 #+(canonical-package gzip)
444 #+(canonical-package tar)
445 #+(canonical-package gawk)
446 #+python-wrapper))
447
448 (with-directory-excursion "/tmp/bin"
449 (copy-file #+deblob "deblob")
450 (chmod "deblob" #o755)
451 (substitute* "deblob"
452 (("/bin/sh") (which "sh")))
453
454 (copy-file #+deblob-check "deblob-check")
455 (chmod "deblob-check" #o755)
456 (substitute* "deblob-check"
457 (("/bin/sh") (which "sh"))
458 (("/bin/sed") (which "sed"))
459 (("/usr/bin/python") (which "python"))))
460
461 (format #t "Running deblob script...~%")
462 (invoke "/tmp/bin/deblob"))))))
463 (origin
464 (method computed-origin-method)
465 (file-name (string-append "linux-" version "-guix.tar.xz"))
466 (sha256 #f)
467 (uri
468 (delay
469 (with-imported-modules '((guix build utils))
470 #~(begin
471 (use-modules (guix build utils))
472
473 (mkdir "/tmp/bin")
474 (set-path-environment-variable
475 "PATH" '("bin")
476 (list "/tmp"
477 #+(canonical-package bash)
478 #+(canonical-package coreutils)
479 #+(canonical-package diffutils)
480 #+(canonical-package findutils)
481 #+(canonical-package patch)
482 #+(canonical-package xz)
483 #+(canonical-package sed)
484 #+(canonical-package grep)
485 #+(canonical-package bzip2)
486 #+(canonical-package gzip)
487 #+(canonical-package tar)
488 #+(canonical-package gawk)
489 #+python-wrapper))
490
491 (with-directory-excursion "/tmp/bin"
492 (copy-file #+deblob-check "deblob-check")
493 (chmod "deblob-check" #o755)
494 (substitute* "deblob-check"
495 (("/bin/sh") (which "sh"))
496 (("/bin/sed") (which "sed"))
497 (("/usr/bin/python") (which "python"))))
498
499 (copy-file #$unchecked-source #$output)
500
501 (format #t "~%Scanning the generated tarball for blobs...~%")
502 (invoke "/tmp/bin/deblob-check" "--use-awk" "--list-blobs"
503 #$output)))))))))
504
505(define (make-linux-source version upstream-source transformation)
506 "Return a 'computed' origin that generates a modified Linux tarball from the
507corresponding UPSTREAM-SOURCE (an origin), using the given TRANSFORMATION (a
508GEXP)."
509 (origin
510 (method computed-origin-method)
511 (file-name (string-append "linux-" version "-guix.tar.xz"))
512 (sha256 #f)
513 (uri
514 (delay
515 (with-imported-modules '((guix build utils))
516 ;; NOTE: it's very important not to introduce local symbols inside
517 ;; the gexp as they will shadow symbols used in TRANSFORMATION.
518 (let ((dir (string-append "linux-" version))
519 (cp (file-append (canonical-package coreutils) "/bin/cp"))
520 (tar (file-append (canonical-package tar) "/bin/tar"))
521 (change-mode (file-append (canonical-package coreutils) "/bin/chmod")))
522 #~(begin
523 (use-modules (guix build utils)
524 (srfi srfi-1)
525 (ice-9 match)
526 (ice-9 ftw))
527
528 ;; Required for tar gz decompression.
529 (setenv "PATH" #+(file-append (canonical-package xz) "/bin"))
530
531 (if (file-is-directory? #+upstream-source)
532 (begin
533 (format #t "Copying upstream Linux source...~%")
534 (copy-recursively #+upstream-source #$dir)
535 (for-each (cut make-file-writable <>)
536 (find-files #$dir)))
537 (begin
538 (format #t "Unpacking upstream Linux tarball...~%")
539 (invoke #+tar "xf" #$upstream-source)
540 (match (scandir "."
541 (lambda (name)
542 (and (not (member name '("." "..")))
543 (file-is-directory? name))))
544 ((unpacked-dir)
545 (unless (string=? #$dir unpacked-dir)
546 (rename-file unpacked-dir #$dir)))
547 (dirs
548 (error "multiple directories found" dirs)))))
549
550 (with-directory-excursion #$dir
551 #$(if (promise? transformation)
552 (force transformation)
553 transformation))
554
555 (format #t "~%Packing new Linux tarball...~%")
556 (invoke #+tar "cvfa" #$output
557 ;; Avoid non-determinism in the archive.
558 "--mtime=@0"
559 "--owner=root:0"
560 "--group=root:0"
561 "--sort=name"
562 "--hard-dereference"
563 #$dir))))))))
564
565
566;;;
567;;; Kernel sources.
568;;;
569
570(define (linux-libre-urls version gnu-revision)
571 "Return a list of URLs for Linux-Libre VERSION."
572 (list (string-append
573 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
574 version "-" gnu-revision "/linux-libre-" version "-" gnu-revision ".tar.xz")
575
576 ;; XXX: Work around <http://bugs.gnu.org/14851>.
577 (string-append
578 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
579 version "-" gnu-revision ".tar.xz")
580
581 ;; Maybe this URL will become valid eventually.
582 (string-append
583 "mirror://gnu/linux-libre/" version "-" gnu-revision "/linux-libre-"
584 version "-" gnu-revision ".tar.xz")))
585
586(define (%upstream-linux-source version hash)
587 (origin
588 (method url-fetch)
589 (uri (string-append "mirror://kernel.org"
590 "/linux/kernel/v" (version-major version) ".x/"
591 "linux-" version ".tar.xz"))
592 (sha256 hash)))
593
594;; The current "stable" kernels. That is, the most recently released major
595;; versions that are still supported upstream.
596
597(define-public linux-libre-7.2-version "7.2.11")
598(define-public linux-libre-7.2-gnu-revision "gnu")
599(define deblob-scripts-7.2
600 (linux-libre-deblob-scripts
601 linux-libre-7.2-version
602 linux-libre-7.2-gnu-revision
603 (base32 "109qy4m3mcc19c1p3b87amzkmmq39jgkr70q3zyxpml41fcc8m23")
604 (base32 "1cwpmi4hxsn01pf7vpkcfda4da146hsa82jjbqwr25pymryzdz9x")))
605(define-public linux-libre-7.2-pristine-source
606 (let ((version linux-libre-7.2-version)
607 (hash (base32 "1976l4zxjp0dqi46ff95ywf6brhg6cv9qgpi2d9w1a43z5ww83zx")))
608 (make-linux-libre-source version
609 (%upstream-linux-source version hash)
610 deblob-scripts-7.2)))
611
612(define-public linux-libre-7.1-version "7.1.13")
613(define-public linux-libre-7.1-gnu-revision "gnu")
614(define deblob-scripts-7.1
615 (linux-libre-deblob-scripts
616 linux-libre-7.1-version
617 linux-libre-7.1-gnu-revision
618 (base32 "0a14ymlj6ahfd5ch78hk9nx47ihglndq1h9hi9a4r9di469s5f8v")
619 (base32 "0ab66phhdwhhhvhywiylhlsmqvw8ny4xyi7ap7xzzkqc7im8w1j9")))
620(define-public linux-libre-7.1-pristine-source
621 (let ((version linux-libre-7.1-version)
622 (hash (base32 "1mqshj3ldn0md1c0am35skznnq5vmz3fvrr0cqmwwp6bzpx9akb1")))
623 (make-linux-libre-source version
624 (%upstream-linux-source version hash)
625 deblob-scripts-7.1)))
626
627;; The "longterm" kernels — the older releases with long-term upstream support.
628;; Here are the support timelines:
629;; <https://www.kernel.org/category/releases.html>
630
631(define-public linux-libre-6.18-version "6.18.57")
632(define-public linux-libre-6.18-gnu-revision "gnu")
633(define deblob-scripts-6.18
634 (linux-libre-deblob-scripts
635 linux-libre-6.18-version
636 linux-libre-6.18-gnu-revision
637 (base32 "1x5szxc5d20jq8j5wzqqwk4jagc1q9kdhi2xvry7zbwy6cxskw52")
638 (base32 "1dl6lm9lajxvqqqh2xim0b8085p2242i7qqk3fwa8h9dmshpjxam")))
639(define-public linux-libre-6.18-pristine-source
640 (let ((version linux-libre-6.18-version)
641 (hash (base32 "137rmiqcabchvrnwyqgjzxzdxps0m9d0x15fj0vzqppchbfarnav")))
642 (make-linux-libre-source version
643 (%upstream-linux-source version hash)
644 deblob-scripts-6.18)))
645
646(define-public linux-libre-6.12-version "6.12.113")
647(define-public linux-libre-6.12-gnu-revision "gnu")
648(define deblob-scripts-6.12
649 (linux-libre-deblob-scripts
650 linux-libre-6.12-version
651 linux-libre-6.12-gnu-revision
652 (base32 "168aykyvyyp34549hqhlprl0n052q8wdb2y3vyxqw40wpf2vw3ln")
653 (base32 "1afqvvzmmxkajsg99blcadk3x1hz6r3xsck6r6k6cfvvcr6smcpc")))
654(define-public linux-libre-6.12-pristine-source
655 (let ((version linux-libre-6.12-version)
656 (hash (base32 "0a14vvvsjyhrm0w55lxp9mhbg3y3p404jsa11lzja8f5wlkng6z0")))
657 (make-linux-libre-source version
658 (%upstream-linux-source version hash)
659 deblob-scripts-6.12)))
660
661(define-public linux-libre-6.6-version "6.6.156")
662(define-public linux-libre-6.6-gnu-revision "gnu")
663(define deblob-scripts-6.6
664 (linux-libre-deblob-scripts
665 linux-libre-6.6-version
666 linux-libre-6.6-gnu-revision
667 (base32 "0y3lawljby2rl0mb0yjdyaasci4pl935y8xa0dnmbzff23knkxlw")
668 (base32 "1h0qybxvk1f2vvbajivxcyqha49zfh1as5053ww36klllyml3cpn")))
669(define-public linux-libre-6.6-pristine-source
670 (let ((version linux-libre-6.6-version)
671 (hash (base32 "07a1dyaxmcv289r0n4agna2li2rfsjdld8279cs18jmg9r52dqmf")))
672 (make-linux-libre-source version
673 (%upstream-linux-source version hash)
674 deblob-scripts-6.6)))
675
676(define-public linux-libre-6.1-version "6.1.187")
677(define-public linux-libre-6.1-gnu-revision "gnu")
678(define deblob-scripts-6.1
679 (linux-libre-deblob-scripts
680 linux-libre-6.1-version
681 linux-libre-6.1-gnu-revision
682 (base32 "10gcbkd5jxfspa712kvb3qmsjgsapd9cz47pmpfk03bbfzf8ydlv")
683 (base32 "1w5pfws6l39dpc3lzazs1n6r4m96f6rdf6vb2scy5fhmrd933ldc")))
684(define-public linux-libre-6.1-pristine-source
685 (let ((version linux-libre-6.1-version)
686 (hash (base32 "0av4fcw3hv4pfql85s2rirxj7hkdr2kdasj219kwl257xa57jvhv")))
687 (make-linux-libre-source version
688 (%upstream-linux-source version hash)
689 deblob-scripts-6.1)))
690
691(define-public linux-libre-5.15-version "5.15.220")
692(define-public linux-libre-5.15-gnu-revision "gnu")
693(define deblob-scripts-5.15
694 (linux-libre-deblob-scripts
695 linux-libre-5.15-version
696 linux-libre-5.15-gnu-revision
697 (base32 "0b2gd83ihxlq490gpgq930misc6jrckw4rzl7fvwd0qzczqjvff5")
698 (base32 "1s6km2r2mad0wpf7nqn4rqsykw1lm386l1yskmil24239fbva1f1")))
699(define-public linux-libre-5.15-pristine-source
700 (let ((version linux-libre-5.15-version)
701 (hash (base32 "08v7mbwvfgy9vv60j2ssdks4ss218p27rkwwrmjch2hj0ljrkcmm")))
702 (make-linux-libre-source version
703 (%upstream-linux-source version hash)
704 deblob-scripts-5.15)))
705
706(define %boot-logo-patch
707 ;; Linux-Libre boot logo featuring Freedo and a gnu.
708 (origin
709 (method url-fetch)
710 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
711 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
712 (sha256
713 (base32
714 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
715
716(define %linux-libre-arm-export-__sync_icache_dcache-patch
717 (origin
718 (method url-fetch)
719 (uri (string-append
720 "https://salsa.debian.org/kernel-team/linux"
721 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
722 "/debian/patches/bugfix/arm/"
723 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
724 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
725 (sha256
726 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
727
728(define (source-with-patches source patches)
729 (origin
730 (inherit source)
731 (patches (append (origin-patches source)
732 patches))))
733
734(define-public linux-libre-7.2-source
735 (source-with-patches linux-libre-7.2-pristine-source
736 (append
737 (list %linux-libre-arm-export-__sync_icache_dcache-patch)
738 (search-patches "linux-shmem-hurd-xattr.patch"
739 "linux-libre-fix-arm64-bin-sh.patch"))))
740
741(define-public linux-libre-7.1-source
742 (source-with-patches linux-libre-7.1-pristine-source
743 (append
744 (list %linux-libre-arm-export-__sync_icache_dcache-patch)
745 (search-patches "linux-shmem-hurd-xattr.patch"
746 "linux-libre-fix-arm64-bin-sh.patch"))))
747
748(define-public linux-libre-6.18-source
749 (source-with-patches linux-libre-6.18-pristine-source
750 (list %boot-logo-patch
751 %linux-libre-arm-export-__sync_icache_dcache-patch)))
752
753(define-public linux-libre-6.12-source
754 (source-with-patches linux-libre-6.12-pristine-source
755 (list %boot-logo-patch
756 %linux-libre-arm-export-__sync_icache_dcache-patch)))
757
758(define-public linux-libre-6.6-source
759 (source-with-patches linux-libre-6.6-pristine-source
760 (list %boot-logo-patch
761 %linux-libre-arm-export-__sync_icache_dcache-patch)))
762
763(define-public linux-libre-6.1-source
764 (source-with-patches linux-libre-6.1-pristine-source
765 (append
766 (list %boot-logo-patch
767 %linux-libre-arm-export-__sync_icache_dcache-patch)
768 (search-patches
769 "linux-libre-infodocs-target.patch"))))
770
771(define-public linux-libre-5.15-source
772 (source-with-patches linux-libre-5.15-pristine-source
773 (list %boot-logo-patch
774 %linux-libre-arm-export-__sync_icache_dcache-patch)))
775
776
777;; Debian sources.
778
779(define (linux-debian-patches version hash)
780 (package
781 (name "linux-debian-patches")
782 (version version)
783 (source (origin
784 (method git-fetch)
785 (uri (git-reference
786 (url "https://salsa.debian.org/kernel-team/linux.git")
787 (commit (string-append "debian/" version))))
788 (file-name (git-file-name name version))
789 (sha256 hash)))
790 (build-system copy-build-system)
791 (arguments
792 (list
793 #:install-plan
794 ''(("debian/patches" "")
795 ("debian/config" ""))))
796 (home-page "Debian patches")
797 (synopsis "Debian patches")
798 (description "Debian patches")
799 (license license:gpl2)))
800
801(define-public linux-debian-6.12-version "6.12.113")
802(define debian-patches-6.12
803 (linux-debian-patches
804 (string-append linux-debian-6.12-version "-1")
805 (base32 "17bsmpngm9zr5xy058620wdq7xazb3h27rngw4chpv8sr5v6i91j")))
806(define-public linux-debian-6.12-pristine-source
807 (let ((version linux-debian-6.12-version)
808 (hash (base32 "0a14vvvsjyhrm0w55lxp9mhbg3y3p404jsa11lzja8f5wlkng6z0")))
809 (make-linux-source
810 version (%upstream-linux-source version hash)
811 (delay
812 #~(begin
813 (format #t "Patching kernel...~%")
814 (setenv "QUILT_PATCHES" #$(file-append debian-patches-6.12
815 "/patches"))
816 (invoke #$(file-append quilt "/bin/quilt") "push" "-a"))))))
817
818(define-public linux-debian-6.12-source
819 (source-with-patches linux-debian-6.12-pristine-source
820 (search-patches "linux-shmem-hurd-xattr.patch")))
821
822
823;;;
824;;; Kernel headers.
825;;;
826
827(define %linux-libre-timeout-properties
828 ;; Package properties for 'linux-libre' and 'linux-libre-headers' packages.
829 `((timeout . ,(* 8 3600)) ;deblob takes >5h on AArch64
830 (max-silent-time . ,(* 3 3600)))) ;don't time out on blob scan
831
832(define (make-linux-libre-headers version gnu-revision hash-string)
833 (make-linux-libre-headers* version gnu-revision
834 (origin
835 (method url-fetch)
836 (uri (linux-libre-urls version gnu-revision))
837 (sha256 (base32 hash-string)))))
838
839(define (make-linux-libre-headers* version gnu-revision source)
840 (package
841 (name "linux-libre-headers")
842 (version version)
843 (source source)
844 (build-system gnu-build-system)
845 (native-inputs `(("perl" ,perl)
846 ,@(if (version>=? version "4.16")
847 `(("flex" ,flex)
848 ("bison" ,bison))
849 '())))
850 (arguments
851 `(#:modules ((guix build gnu-build-system)
852 (guix build utils)
853 (srfi srfi-1)
854 (ice-9 match))
855 #:phases
856 (modify-phases %standard-phases
857 (delete 'configure)
858 (replace 'build
859 (lambda _
860 (let ((arch ,(platform-linux-architecture
861 (lookup-platform-by-target-or-system
862 (or (%current-target-system)
863 (%current-system)))))
864 (defconfig ,(system->defconfig
865 (or (%current-target-system)
866 (%current-system))))
867 (make-target ,(if (version>=? version "5.3")
868 "headers"
869 "headers_check")))
870 (setenv "ARCH" arch)
871 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
872 (invoke "make" defconfig)
873 (invoke "make" "mrproper" make-target))))
874 (replace 'install
875 (lambda* (#:key outputs #:allow-other-keys)
876 (let ((out (assoc-ref outputs "out")))
877
878 ;; Mimic the quiet_cmd_headers_install target to avoid a
879 ;; dependency on rsync.
880 (for-each (lambda (file)
881 (let ((destination (string-append
882 out "/include/"
883 ;; Drop the 'usr/include' prefix.
884 (match (string-split file #\/)
885 ((_ _ path ...)
886 (string-join path "/"))))))
887 (format #t "`~a' -> `~a'~%" file destination)
888 (install-file file (dirname destination))))
889 (find-files "usr/include" "\\.h$"))
890
891 (mkdir (string-append out "/include/config"))
892 (call-with-output-file
893 (string-append out
894 "/include/config/kernel.release")
895 (lambda (p)
896 (format p "~a-default~%" ,version)))))))
897 #:allowed-references ()
898 #:tests? #f))
899 (supported-systems (remove target-hurd? %supported-systems))
900 (properties %linux-libre-timeout-properties)
901 (home-page "https://www.gnu.org/software/linux-libre/")
902 (synopsis "GNU Linux-Libre kernel headers")
903 (description "Headers of the Linux-Libre kernel.")
904 (license license:gpl2)))
905
906(define-public linux-libre-headers-7.2
907 (make-linux-libre-headers* linux-libre-7.2-version
908 linux-libre-7.2-gnu-revision
909 linux-libre-7.2-source))
910
911(define-public linux-libre-headers-7.1
912 (make-linux-libre-headers* linux-libre-7.1-version
913 linux-libre-7.1-gnu-revision
914 linux-libre-7.1-source))
915
916(define-public linux-libre-headers-6.18
917 (make-linux-libre-headers* linux-libre-6.18-version
918 linux-libre-6.18-gnu-revision
919 linux-libre-6.18-source))
920
921(define-public linux-libre-headers-6.12
922 (make-linux-libre-headers* linux-libre-6.12-version
923 linux-libre-6.12-gnu-revision
924 linux-libre-6.12-source))
925
926(define-public linux-libre-headers-6.6
927 (make-linux-libre-headers* linux-libre-6.6-version
928 linux-libre-6.6-gnu-revision
929 linux-libre-6.6-source))
930
931(define-public linux-libre-headers-6.1
932 (make-linux-libre-headers* linux-libre-6.1-version
933 linux-libre-6.1-gnu-revision
934 linux-libre-6.1-source))
935
936(define-public linux-libre-headers-5.15
937 (make-linux-libre-headers* linux-libre-5.15-version
938 linux-libre-5.15-gnu-revision
939 linux-libre-5.15-source))
940
941;; The following package is used in the early bootstrap, and thus must be kept
942;; stable and with minimal build requirements.
943(define-public linux-libre-headers-6.12.17
944 (make-linux-libre-headers "6.12.17" "gnu"
945 "1j3iyivh8h9abryjqksf4k51wgwnwqy2l3zsc019bm84xmka38xm"))
946
947(define-public linux-libre-headers linux-libre-headers-6.12.17)
948;; linux-libre-headers-latest points to the latest headers package
949;; and should be used as a dependency for packages that depend on
950;; the headers.
951(define-public linux-libre-headers-latest linux-libre-headers-7.2)
952
953
954;;;
955;;; Kernel configurations.
956;;;
957
958(define* (kernel-config arch #:key variant)
959 "Return a file-like object of the Linux-Libre build configuration file for
960ARCH and optionally VARIANT, or #f if there is no such configuration."
961 (let* ((name (string-append (if variant (string-append variant "-") "")
962 (if (string=? "i386" arch) "i686" arch) ".conf"))
963 (file (string-append "linux-libre/" name))
964 (config (search-auxiliary-file file)))
965 (and config (local-file config))))
966
967(define (default-extra-linux-options version)
968 `(;; Make the kernel config available at /proc/config.gz
969 ("CONFIG_IKCONFIG" . #t)
970 ("CONFIG_IKCONFIG_PROC" . #t)
971 ;; Debugging options.
972 ("CONFIG_DEBUG_INFO" . #t) ;required by BTF
973 ,@(if (version>=? version "5.1")
974 '(("CONFIG_DEBUG_INFO_BTF" . #t))
975 '())
976 ,@(if (version>=? version "5.12")
977 '(("CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT" . #t))
978 '())
979 ("CONFIG_DEBUG_INFO_REDUCED" . #f) ;incompatible with BTF
980 ;; Tracing and related options.
981 ,@(if (version>=? version "5.1")
982 '(("CONFIG_BPF_JIT" . #t)
983 ("CONFIG_BPF_JIT_ALWAYS_ON" . #t)
984 ("CONFIG_BPF_SYSCALL" . #t))
985 '())
986 ,@(if (version>=? version "5.13")
987 '(("CONFIG_BPF_UNPRIV_DEFAULT_OFF" . #t))
988 '())
989 ("CONFIG_NET_CLS_BPF" . m) ;classify packets based on BPF filters
990 ("CONFIG_NET_ACT_BPF" . m) ;to execute BPF code on packets
991 ;; Compress kernel modules via Zstd.
992 ,(if (version>=? version "5.13")
993 '("CONFIG_MODULE_COMPRESS_ZSTD" . #t)
994 '("CONFIG_MODULE_COMPRESS_GZIP" . #t))
995 ;; Some very mild hardening.
996 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
997 ;; All kernels should have NAMESPACES options enabled
998 ("CONFIG_NAMESPACES" . #t)
999 ("CONFIG_UTS_NS" . #t)
1000 ("CONFIG_IPC_NS" . #t)
1001 ("CONFIG_USER_NS" . #t)
1002 ("CONFIG_PID_NS" . #t)
1003 ("CONFIG_NET_NS" . #t)
1004 ;; Various options needed for elogind service:
1005 ;; https://issues.guix.gnu.org/43078
1006 ("CONFIG_CGROUP_FREEZER" . #t)
1007 ("CONFIG_BLK_CGROUP" . #t)
1008 ("CONFIG_CGROUP_WRITEBACK" . #t)
1009 ("CONFIG_CGROUP_SCHED" . #t)
1010 ("CONFIG_CGROUP_PIDS" . #t)
1011 ("CONFIG_CGROUP_FREEZER" . #t)
1012 ("CONFIG_CGROUP_DEVICE" . #t)
1013 ("CONFIG_CGROUP_CPUACCT" . #t)
1014 ("CONFIG_CGROUP_PERF" . #t)
1015 ("CONFIG_SOCK_CGROUP_DATA" . #t)
1016 ("CONFIG_BLK_CGROUP_IOCOST" . #t)
1017 ("CONFIG_CGROUP_NET_PRIO" . #t)
1018 ("CONFIG_CGROUP_NET_CLASSID" . #t)
1019 ("CONFIG_MEMCG" . #t)
1020 ("CONFIG_MEMCG_SWAP" . #t)
1021 ("CONFIG_MEMCG_KMEM" . #t)
1022 ("CONFIG_CPUSETS" . #t)
1023 ("CONFIG_PROC_PID_CPUSET" . #t)
1024 ;; Allow disk encryption by default
1025 ("CONFIG_DM_CRYPT" . m)
1026 ;; Allow fscrypt filesystem encryption by default
1027 ("CONFIG_FS_ENCRYPTION" . #t)
1028 ;; Support zram on all kernel configs
1029 ("CONFIG_ZSWAP" . #t)
1030 ("CONFIG_ZSMALLOC" . #t)
1031 ("CONFIG_ZRAM" . m)
1032 ;; Accessibility support.
1033 ("CONFIG_ACCESSIBILITY" . #t)
1034 ("CONFIG_A11Y_BRAILLE_CONSOLE" . #t)
1035 ("CONFIG_SPEAKUP" . m)
1036 ("CONFIG_SPEAKUP_SYNTH_SOFT" . m)
1037 ;; Modules required for initrd:
1038 ("CONFIG_NET_9P" . m)
1039 ("CONFIG_NET_9P_VIRTIO" . m)
1040 ("CONFIG_VIRTIO_BLK" . m)
1041 ("CONFIG_VIRTIO_NET" . m)
1042 ("CONFIG_VIRTIO_PCI" . m)
1043 ("CONFIG_VIRTIO_BALLOON" . m)
1044 ("CONFIG_VIRTIO_MMIO" . m)
1045 ("CONFIG_FUSE_FS" . m)
1046 ("CONFIG_CIFS" . m)
1047 ("CONFIG_9P_FS" . m)
1048 ;; Enable DMABUF used by wayland, pipewire and libcamera
1049 ;; https://codeberg.org/guix/guix/issues/5995
1050 ("CONFIG_UDMABUF" . #t)
1051 ("CONFIG_DMABUF_MOVE_NOTIFY" . #t)
1052 ("CONFIG_DMABUF_HEAPS" . #t)
1053 ("CONFIG_DMABUF_HEAPS_SYSTEM" . #t)
1054 ("CONFIG_DMABUF_HEAPS_CMA" . #t)
1055 ,@(if (version>=? version "6.17")
1056 '(("CONFIG_DMABUF_HEAPS_CMA_LEGACY" . #t))
1057 '())
1058 ;; Enable sched_ext support for userspace schedulers
1059 ;; Note: Depends on BPF tracing
1060 ;; https://docs.kernel.org/scheduler/sched-ext.html
1061 ,@(if (version>=? version "6.12")
1062 '(("CONFIG_SCHED_CLASS_EXT" . #t))
1063 '())
1064 ;; Disable the EFI pstore storage backend to avoid causing
1065 ;; unrecoverable failures on some EFI systems:
1066 ;; https://lists.gnu.org/archive/html/help-guix/2025-01/msg00173.html
1067 ("CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE" . #t)
1068 ;; Provide modules for wireguard and netfilter support
1069 ("CONFIG_WIREGUARD" . m)
1070 ("CONFIG_IP_NF_FILTER" . m)
1071 ("CONFIG_NETFILTER_XT_MATCH_ADDRTYPE" . m)))
1072
1073(define (config->string options)
1074 (string-join (map (match-lambda
1075 ((option . 'm)
1076 (string-append option "=m"))
1077 ((option . #t)
1078 (string-append option "=y"))
1079 ((option . #f)
1080 (string-append option "=n"))
1081 ((option . string)
1082 (string-append option "=\"" string "\"")))
1083 options)
1084 "\n"))
1085
1086
1087;;;
1088;;; Kernel package utilities.
1089;;;
1090
1091(define (apply-infodoc-patch? version)
1092 ;; Versions older than 5.10 have different enough build scripts that the
1093 ;; infodocs patch doesn't apply.
1094 (and (version>=? version "5.10")
1095 (not (version>=? version "6.2")))) ;patch applied upstream
1096
1097(define* (make-linux* version source supported-systems produced-modules
1098 #:key
1099 (extra-version #f)
1100 ;; A function that takes an arch and a variant.
1101 ;; See kernel-config for an example.
1102 (configuration-file #f)
1103 (defconfig "defconfig")
1104 (extra-options (default-extra-linux-options version)))
1105 "Create a Linux package from VERSION using SOURCE for SUPPORTED-SYSTEMS.
1106
1107Produced modules will use package-properties to convey which modules the given
1108configuration produced either by CONFIGURATION-FILE or DEFCONFIG will yield.
1109This allows 'operating-system' records to infer their 'intrd-modules' value
1110from their 'kernel' field package.
1111
1112EXTRA-VERSION will control the emitted package name as well as the
1113EXTRAVERSION value of the kernel build.
1114
1115CONFIGURATION-FILE is a file-like object which will be used as the
1116configuration file to use for building the kernel. If used the DEFCONFIG
1117argument will be ignored.
1118
1119DEFCONFIG can either be a string, which will control the make target that
1120generates the configuration file used for building the kernel, or a GEXP which
1121should produce the '.config' file that will be used for building the kernel.
1122
1123EXTRA-OPTIONS will be appended to the configuration file provided by
1124CONFIGURATION-FILE or generated by DEFCONFIG. It must be an alist where each element has the form:
1125(KERNEL-OPTION . VALUE)
1126
1127KERNEL-OPTION must be a string and VALUE can be '#t', '#f' or 'm' for
1128instructing that the configuration option should build a kernel module."
1129 (package
1130 (name (if extra-version
1131 (string-append "linux-" extra-version)
1132 "linux"))
1133 (version version)
1134 (source source)
1135 (supported-systems supported-systems)
1136 (build-system gnu-build-system)
1137 (arguments
1138 (list
1139 #:modules '((guix build gnu-build-system)
1140 (guix build utils)
1141 (srfi srfi-1)
1142 (srfi srfi-26)
1143 (ice-9 ftw)
1144 (ice-9 match))
1145 #:tests? #f
1146 #:phases
1147 #~(modify-phases %standard-phases
1148 (add-after 'unpack 'patch-/bin/pwd
1149 (lambda _
1150 (substitute* (find-files
1151 "." "^Makefile(\\.include)?$")
1152 (("/bin/pwd") "pwd"))))
1153 (add-before 'configure 'set-environment
1154 (lambda* (#:key target #:allow-other-keys)
1155 ;; Avoid introducing timestamps.
1156 (setenv "KCONFIG_NOTIMESTAMP" "1")
1157 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
1158
1159 ;; Other variables useful for reproducibility.
1160 (setenv "KBUILD_BUILD_VERSION" "1")
1161 (setenv "KBUILD_BUILD_USER" "guix")
1162 (setenv "KBUILD_BUILD_HOST" "guix")
1163
1164 ;; Set ARCH and CROSS_COMPILE.
1165 (let ((arch #$(platform-linux-architecture
1166 (lookup-platform-by-target-or-system
1167 (or (%current-target-system)
1168 (%current-system))))))
1169 (setenv "ARCH" arch)
1170 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
1171 (when target
1172 (setenv "CROSS_COMPILE" (string-append target "-"))
1173 (format #t "`CROSS_COMPILE' set to `~a'~%"
1174 (getenv "CROSS_COMPILE"))))
1175
1176 ;; Allow EXTRAVERSION to be set via the environment.
1177 (substitute* "Makefile"
1178 (("^ *EXTRAVERSION[[:blank:]]*=")
1179 "EXTRAVERSION ?="))
1180 (setenv "EXTRAVERSION"
1181 #$(and extra-version
1182 (string-append "-" extra-version)))
1183 ;; Use the maximum compression available for Zstd-compressed
1184 ;; modules.
1185 (setenv "ZSTD_CLEVEL" "19")))
1186 (replace 'configure
1187 (lambda _
1188 (let ((config
1189 #$(match (let ((arch (platform-linux-architecture
1190 (lookup-platform-by-target-or-system
1191 (or (%current-target-system)
1192 (%current-system))))))
1193 (and configuration-file arch
1194 (configuration-file
1195 arch
1196 #:variant (version-major+minor version))))
1197 (#f ;no config for this platform
1198 #f)
1199 ((? file-like? config)
1200 config))))
1201 ;; Use a custom kernel configuration file or a default
1202 ;; configuration file.
1203 (if config
1204 (begin
1205 (copy-file config ".config")
1206 (chmod ".config" #o666))
1207 #$(cond
1208 ((string? defconfig)
1209 #~(invoke "make" #$defconfig))
1210 ((promise? defconfig)
1211 (force defconfig))
1212 (else
1213 defconfig)))
1214 ;; Appending works even when the option wasn't in the file.
1215 ;; The last one prevails if duplicated.
1216 (let ((port (open-file ".config" "a"))
1217 (extra-configuration #$(config->string extra-options)))
1218 (display extra-configuration port)
1219 (close-port port))
1220 (invoke "make" "oldconfig"))))
1221 (replace 'install
1222 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
1223 (let ((moddir (string-append #$output "/lib/modules"))
1224 (dtbdir (string-append #$output "/lib/dtbs"))
1225 (make-flags
1226 (append make-flags
1227 (list "-j"
1228 (if parallel-build?
1229 (number->string (parallel-job-count))
1230 "1")))))
1231 ;; Install kernel image, kernel configuration and link map.
1232 (for-each (lambda (file) (install-file file #$output))
1233 (find-files "." "^(\\.config|bzImage|zImage|Image\
1234|vmlinuz|System\\.map|Module\\.symvers)$"))
1235 ;; Install device tree files
1236 (unless (null? (find-files "." "\\.dtb$"))
1237 (mkdir-p dtbdir)
1238 (apply invoke "make"
1239 (string-append "INSTALL_DTBS_PATH=" dtbdir)
1240 "dtbs_install" make-flags))
1241 ;; Install kernel modules
1242 (mkdir-p moddir)
1243 (apply invoke "make"
1244 ;; Disable depmod because the Guix system's module
1245 ;; directory is an union of potentially multiple
1246 ;; packages. It is not possible to use depmod to
1247 ;; usefully calculate a dependency graph while building
1248 ;; only one of them.
1249 "DEPMOD=true"
1250 (string-append "MODULE_DIR=" moddir)
1251 (string-append "INSTALL_PATH=" #$output)
1252 (string-append "INSTALL_MOD_PATH=" #$output)
1253 "INSTALL_MOD_STRIP=1"
1254 "modules_install" make-flags)
1255 (let* ((versions (filter (lambda (name)
1256 (not (string-prefix? "." name)))
1257 (scandir moddir)))
1258 (version (match versions
1259 ((x) x))))
1260 ;; There are symlinks to the build and source directory.
1261 ;; Both will point to target /tmp/guix-build* and thus not
1262 ;; be useful in a profile. Delete the symlinks.
1263 (false-if-file-not-found
1264 (delete-file
1265 (string-append moddir "/" version "/build")))
1266 (false-if-file-not-found
1267 (delete-file
1268 (string-append moddir "/" version "/source"))))))))))
1269 (native-inputs
1270 (list perl
1271 bc
1272 openssl
1273 elfutils ;needed to enable CONFIG_STACK_VALIDATION
1274 flex
1275 bison
1276 util-linux ;needed for hexdump
1277 ;; These are needed to compile the GCC plugins.
1278 gmp
1279 mpfr
1280 mpc
1281 ;; These are needed when building with the CONFIG_DEBUG_INFO_BTF
1282 ;; support.
1283 dwarves ;for pahole
1284 python-wrapper
1285 zlib
1286 ;; For Zstd compression of kernel modules.
1287 zstd))
1288 (home-page #f)
1289 (synopsis #f)
1290 (description #f)
1291 (license #f)
1292 (properties
1293 `((base-initrd-modules . ,produced-modules)))))
1294
1295(define* (make-linux-libre version gnu-revision hash-string supported-systems
1296 #:key
1297 (extra-version #f)
1298 ;; A function that takes an arch and a variant, and
1299 ;; return a file-like object. See kernel-config
1300 ;; for an example.
1301 (configuration-file #f)
1302 (defconfig "defconfig")
1303 (extra-options (default-extra-linux-options version))
1304 (patches
1305 `(,%boot-logo-patch
1306 ,@(if (apply-infodoc-patch? version)
1307 (list (search-patch
1308 "linux-libre-infodocs-target.patch"))
1309 '()))))
1310 (make-linux-libre* version gnu-revision
1311 (origin
1312 (method url-fetch)
1313 (uri (linux-libre-urls version gnu-revision))
1314 (sha256 (base32 hash-string))
1315 (patches patches))
1316 supported-systems
1317 #:extra-version extra-version
1318 #:configuration-file configuration-file
1319 #:defconfig defconfig
1320 #:extra-options extra-options))
1321
1322(define virtio-modules
1323 ;; Modules for Linux para-virtualized devices, for use in QEMU guests.
1324 '("virtio_pci" "virtio_balloon" "virtio_blk" "virtio_net"
1325 "virtio_console" "virtio-rng" "virtio_mmio" "virtio_scsi"))
1326
1327(define default-linux-libre-initrd-modules
1328 ;; Default set of modules that need to be available in the initrd when
1329 ;; booting Linux-libre.
1330 (let* ((generic `("ahci" ;for SATA controllers
1331 "nvme" ;for NVMe controllers
1332 "usb-storage" "uas" ;for the installation image etc.
1333 "usbhid" "hid-generic" ;keyboards during early boot
1334 "mmc_block" ;for MMC block device driver
1335 "dm-crypt" "xts" "serpent_generic" "wp512" ;for encrypted root partitions
1336 "nls_iso8859-1" ;for `mkfs.fat`, et.al
1337 ,@virtio-modules))
1338 (_86 (cons*
1339 "hid-apple"
1340 "pata_acpi" "pata_atiixp" ;for ATA controllers
1341 "isci"
1342 generic))
1343 (others (cons*
1344 "hid-apple"
1345 generic)))
1346 `(("x86_64-linux" . ,_86)
1347 ("i686-linux" . ,_86)
1348 ("armhf-linux" . ,others)
1349 ("aarch64-linux" . ,others)
1350 ("mips64el-linux" . ,others)
1351 ("powerpc-linux" . ,others)
1352 ("powerpc64le-linux" . ,others)
1353 ("riscv64-linux" . ,generic))))
1354
1355(define* (make-linux-libre* version gnu-revision source supported-systems
1356 #:key
1357 (extra-version #f)
1358 ;; A function that takes an arch and a variant.
1359 ;; See kernel-config for an example.
1360 (configuration-file #f)
1361 (defconfig "defconfig")
1362 (extra-options (default-extra-linux-options version)))
1363 (let ((linux (make-linux* version source supported-systems
1364 default-linux-libre-initrd-modules
1365 #:extra-version extra-version
1366 #:configuration-file configuration-file
1367 #:defconfig defconfig
1368 #:extra-options extra-options)))
1369 (package
1370 (inherit linux)
1371 (name (if extra-version
1372 (string-append "linux-libre-" extra-version)
1373 "linux-libre"))
1374 (home-page "https://www.gnu.org/software/linux-libre/")
1375 (synopsis "100% free redistribution of a cleaned Linux kernel")
1376 (description "GNU Linux-Libre is a free (as in freedom) variant of the
1377Linux kernel. It has been modified to remove all non-free binary blobs.")
1378 (license license:gpl2)
1379 (properties (append %linux-libre-timeout-properties
1380 (package-properties linux))))))
1381
1382(define default-linux-debian-initrd-modules
1383 ;; Default set of modules that need to be available in the initrd when
1384 ;; booting Linux-debian.
1385 (let* ((generic `("ahci" ;for SATA controllers
1386 "nvme" ;for NVMe controllers
1387 "ext4" "crc32c_generic" ;compiled as a module by 'CONFIG_EXT4_FS=m'.
1388 "usb-storage" "uas" ;for the installation image etc.
1389 "usbhid" "hid-generic" ;keyboards during early boot
1390 "mmc_block" ;for MMC block device driver
1391 "dm-crypt" "xts" "serpent_generic" "wp512" ;for encrypted root partitions
1392 "nls_iso8859-1" ;for `mkfs.fat`, et.al
1393 ,@virtio-modules))
1394 (_86 (cons*
1395 "hid-apple"
1396 "pata_atiixp" ;for ATA controllers
1397 "isci"
1398 generic))
1399 (others (cons*
1400 "hid-apple"
1401 generic)))
1402 `(("x86_64-linux" . ,_86)
1403 ("i686-linux" . ,_86)
1404 ("armhf-linux" . ,others)
1405 ("aarch64-linux" . ,others)
1406 ("mips64el-linux" . ,others)
1407 ("powerpc-linux" . ,others)
1408 ("powerpc64le-linux" . ,others)
1409 ("riscv64-linux" . ,generic))))
1410
1411(define* (make-linux-debian* version source supported-systems
1412 #:key
1413 (extra-version #f)
1414 ;; A function that takes an arch and a variant.
1415 ;; See kernel-config for an example.
1416 (configuration-file #f)
1417 (defconfig "defconfig")
1418 (extra-options (append
1419 ;; Required for enabling CIRRUS
1420 '(("CONFIG_PCI" . #t)
1421 ("CONFIG_DRM" . #t)
1422 ;; Required for QEMU virt
1423 ;; support.
1424 ("CONFIG_DRM_CIRRUS_QEMU" . m)
1425 ("CONFIG_DRM_VIRTIO_GPU" . m)
1426 ("CONFIG_DRM_BOCHS" . m))
1427 (default-extra-linux-options version))))
1428 (package
1429 (inherit (make-linux* version source supported-systems
1430 default-linux-debian-initrd-modules
1431 #:extra-version extra-version
1432 #:configuration-file configuration-file
1433 #:defconfig defconfig
1434 #:extra-options extra-options))
1435 (name (if extra-version
1436 (string-append "linux-debian-" extra-version)
1437 "linux-debian"))
1438 (home-page "https://www.debian.org")
1439 (synopsis "Debian's free redistribution of a cleaned Linux kernel")
1440 (description "Linux-Debian is a free (as in freedom) variant of the
1441Linux kernel. It has been modified to remove all non-free binary blobs
1442following the @uref{https://www.debian.org/social_contract#guidelines,
1443DFSDG}.")
1444 (license license:gpl2)))
1445
1446
1447;;;
1448;;; Generic kernel packages.
1449;;;
1450
1451(define-public linux-debian-6.12
1452 (make-linux-debian* linux-debian-6.12-version
1453 linux-debian-6.12-source
1454 '("x86_64-linux" "armhf-linux" "aarch64-linux"
1455 "powerpc64le-linux" "riscv64-linux")
1456 #:defconfig
1457 ;; XXX: this snippet merges the different configuration
1458 ;; files provided by Debian to construct a Debian
1459 ;; configuration for the given architecture. The
1460 ;; complete Debian configuration is composed by a
1461 ;; generic configuration 'config/config', an
1462 ;; architecture specific one ('armhf', 'arm64',
1463 ;; 'riscv64', 'amd64') that follows debian architecture
1464 ;; naming and sometimes an additionaly configuration
1465 ;; following the pattern 'kernelarch-xxx'.
1466 (delay
1467 #~(let* ((arch->debian-arch
1468 (lambda (arch)
1469 ;; Case comparison is done with 'eqv?'
1470 ;; which doesn't work with strings.
1471 (case (string->symbol arch)
1472 ((arm) '("kernelarch-arm" "armhf"))
1473 ((arm64) '("arm64"))
1474 ((powerpc) '("kernelarch-powerpc" "ppc64el"))
1475 ((riscv) '("riscv64"))
1476 ((x86_64) '("kernelarch-x86" "amd64"))
1477 (else '()))))
1478 (arch-confs (arch->debian-arch (getenv "ARCH"))))
1479 (apply invoke "scripts/kconfig/merge_config.sh"
1480 #$(file-append debian-patches-6.12
1481 "/config/config")
1482 (map (lambda (arch-conf)
1483 (string-append #$debian-patches-6.12
1484 "/config/"
1485 arch-conf
1486 "/config"))
1487 arch-confs))
1488 (invoke #$(file-append gnu-make "/bin/make")
1489 "olddefconfig")))))
1490
1491(define-public linux-debian linux-debian-6.12)
1492
1493(define-public linux-libre-7.2
1494 (make-linux-libre* linux-libre-7.2-version
1495 linux-libre-7.2-gnu-revision
1496 linux-libre-7.2-source
1497 '("x86_64-linux" "i686-linux" "armhf-linux"
1498 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1499 #:configuration-file kernel-config))
1500
1501(define-public linux-libre-version linux-libre-7.2-version)
1502(define-public linux-libre-gnu-revision linux-libre-7.2-gnu-revision)
1503(define-public linux-libre-pristine-source linux-libre-7.2-pristine-source)
1504(define-public linux-libre-source linux-libre-7.2-source)
1505(define-public linux-libre linux-libre-7.2)
1506
1507(define-public linux-libre-7.1
1508 (make-linux-libre* linux-libre-7.1-version
1509 linux-libre-7.1-gnu-revision
1510 linux-libre-7.1-source
1511 '("x86_64-linux" "i686-linux" "armhf-linux"
1512 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1513 #:configuration-file kernel-config))
1514
1515(define-public linux-libre-6.18
1516 (make-linux-libre* linux-libre-6.18-version
1517 linux-libre-6.18-gnu-revision
1518 linux-libre-6.18-source
1519 '("x86_64-linux" "i686-linux" "armhf-linux"
1520 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1521 #:configuration-file kernel-config))
1522
1523(define-public linux-libre-6.12
1524 (make-linux-libre* linux-libre-6.12-version
1525 linux-libre-6.12-gnu-revision
1526 linux-libre-6.12-source
1527 '("x86_64-linux" "i686-linux" "armhf-linux"
1528 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1529 #:configuration-file kernel-config))
1530
1531(define-public linux-libre-6.6
1532 (make-linux-libre* linux-libre-6.6-version
1533 linux-libre-6.6-gnu-revision
1534 linux-libre-6.6-source
1535 '("x86_64-linux" "i686-linux" "armhf-linux"
1536 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1537 #:configuration-file kernel-config))
1538
1539(define-public linux-libre-6.1
1540 (make-linux-libre* linux-libre-6.1-version
1541 linux-libre-6.1-gnu-revision
1542 linux-libre-6.1-source
1543 '("x86_64-linux" "i686-linux" "armhf-linux"
1544 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1545 #:configuration-file kernel-config))
1546
1547;; Linux-Libre-LTS points to the *newest* released long-term support version of
1548;; Linux-Libre.
1549;; Reference: <https://www.kernel.org/category/releases.html>
1550
1551(define-public linux-libre-lts-version linux-libre-6.18-version)
1552(define-public linux-libre-lts-gnu-revision linux-libre-6.18-gnu-revision)
1553(define-public linux-libre-lts-pristine-source linux-libre-6.18-pristine-source)
1554(define-public linux-libre-lts-source linux-libre-6.18-source)
1555(define-public linux-libre-lts linux-libre-6.18)
1556
1557
1558;;;
1559;;; Specialized kernel variants.
1560;;;
1561
1562(define-public %dummy-linux-kernel-for-container
1563 (hidden-package
1564 (package
1565 (name "linux-dummy")
1566 (version "0.0.0")
1567 (source #f)
1568 (build-system copy-build-system)
1569 (arguments
1570 (list #:phases
1571 #~(modify-phases %standard-phases
1572 (delete 'unpack)
1573 (replace 'install
1574 (lambda _
1575 (mkdir-p #$output))))))
1576 (home-page "")
1577 (synopsis "Dummy Linux kernel for @command{guix system container}")
1578 (description "")
1579 (license #f))))
1580
1581(define-public linux-libre-arm-generic
1582 (make-linux-libre* linux-libre-version
1583 linux-libre-gnu-revision
1584 linux-libre-source
1585 '("armhf-linux")
1586 #:defconfig "multi_v7_defconfig"
1587 #:extra-version "arm-generic"
1588 #:extra-options
1589 (append
1590 `(;; needed to fix the RTC on rockchip platforms
1591 ("CONFIG_RTC_DRV_RK808" . #t))
1592 (default-extra-linux-options linux-libre-version))))
1593
1594(define-public linux-libre-arm-omap2plus
1595 (make-linux-libre* linux-libre-version
1596 linux-libre-gnu-revision
1597 linux-libre-source
1598 '("armhf-linux")
1599 #:defconfig "omap2plus_defconfig"
1600 #:extra-version "arm-omap2plus"))
1601
1602(define pinebook-extra-modules
1603 `(;; Pinebook display, battery, charger and usb
1604 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1605 ("CONFIG_CHARGER_AXP20X" . m)
1606 ("CONFIG_INPUT_AXP20X_PEK" . m)
1607 ("CONFIG_CHARGER_AXP20X" . m)
1608 ("CONFIG_BATTERY_AXP20X" . m)
1609 ("CONFIG_PINCTRL_AXP209" . m)
1610 ("CONFIG_AXP20X_POWER" . m)
1611 ("CONFIG_AXP20X_ADC" . m)
1612 ;; Pinebook PRO battery and sound support
1613 ("CONFIG_BATTERY_CW2015" . m)
1614 ("CONFIG_CHARGER_GPIO" . m)
1615 ("CONFIG_SND_SOC_ES8316" . m)))
1616
1617(define arm64-generic-extra-modules
1618 (append
1619 pinebook-extra-modules
1620 `(;; Provide support for ath9k wireless
1621 ("CONFIG_ATH9K_HTC" . m)
1622 ;; Support Orange Pi R1 Plus LTS ethernet PHY.
1623 ("CONFIG_MOTORCOMM_PHY" . m)
1624 ;; needed to fix the RTC on rockchip platforms
1625 ("CONFIG_RTC_DRV_RK808" . #t))))
1626
1627(define-public linux-libre-arm64-generic
1628 (make-linux-libre* linux-libre-version
1629 linux-libre-gnu-revision
1630 linux-libre-source
1631 '("aarch64-linux")
1632 #:defconfig "defconfig"
1633 #:extra-version "arm64-generic"
1634 #:extra-options
1635 (append
1636 arm64-generic-extra-modules
1637 (default-extra-linux-options linux-libre-version))))
1638
1639(define-public linux-libre-lts-arm64-generic
1640 (if (string=? linux-libre-lts-version linux-libre-version)
1641
1642 ;; Make it a strict alias so that the user interface does not see two
1643 ;; packages with the exact same name and version.
1644 linux-libre-arm64-generic
1645
1646 (make-linux-libre* linux-libre-lts-version
1647 linux-libre-lts-gnu-revision
1648 linux-libre-lts-source
1649 '("aarch64-linux")
1650 #:defconfig "defconfig"
1651 #:extra-version "arm64-generic"
1652 #:extra-options
1653 (append
1654 arm64-generic-extra-modules
1655 (default-extra-linux-options linux-libre-lts-version)))))
1656
1657(define-public linux-libre-arm64-honeycomb
1658 ;; Kernel for use on the HoneyComb LX2 boards:
1659 ;; <https://shop.solid-run.com/product/SRCFTXE000IV13/>.
1660 (make-linux-libre* linux-libre-lts-version
1661 linux-libre-lts-gnu-revision
1662 linux-libre-lts-source
1663 '("aarch64-linux")
1664 #:extra-version "arm64-honeycomb"
1665 #:extra-options
1666 ;; See
1667 ;; https://github.com/SolidRun/lx2160a_build/blob/master/configs/linux/lx2k_additions.config
1668 (append
1669 `(("CONFIG_GPIO_SYSFS" . #true)
1670 ("CONFIG_GPIO_MPC8XXX" . #true)
1671 ("CONFIG_NET_PKTGEN" . #true)
1672 ("CONFIG_USB_SERIAL" . #true)
1673 ("CONFIG_USB_SERIAL_CONSOLE" . #true)
1674 ("CONFIG_USB_SERIAL_GENERIC" . #true)
1675 ("CONFIG_USB_SERIAL_SIMPLE" . #true)
1676 ("CONFIG_USB_SERIAL_FTDI_SIO" . #true)
1677 ("CONFIG_USB_ACM" . #true)
1678 ("CONFIG_USB_NET_DRIVERS" . #true)
1679 ("CONFIG_USB_USBNET" . #true)
1680 ("CONFIG_USB_NET_CDCETHER" . #true)
1681 ("CONFIG_USB_NET_CDC_NCM" . #true)
1682 ("CONFIG_USB_NET_NET1080" . #true)
1683 ("CONFIG_USB_NET_CDC_SUBSET_ENABLE" . #true)
1684 ("CONFIG_USB_NET_CDC_SUBSET" . #true)
1685 ("CONFIG_USB_ARMLINUX" . #true)
1686 ("CONFIG_BLK_DEV_NVME" . #true)
1687 ("CONFIG_NVMEM_BCM_OCOTP" . #true)
1688 ("CONFIG_DRM_AMDGPU" . #true)
1689 ("CONFIG_DRM_AMDGPU_SI" . #true)
1690 ("CONFIG_DRM_AMDGPU_CIK" . #true)
1691 ("CONFIG_DRM_AMDGPU_USERPTR" . #true)
1692 ("CONFIG_DRM_AMD_DC" . #true)
1693 ("CONFIG_CHASH" . #true)
1694 ("CONFIG_PMBUS" . #true)
1695 ("CONFIG_SENSORS_PMBUS" . #true)
1696 ("CONFIG_REGULATOR" . #true)
1697 ("CONFIG_REGULATOR_FIXED_VOLTAGE" . #true)
1698 ("CONFIG_REGULATOR_PWM" . #true)
1699 ("CONFIG_SENSORS_AMC6821" . #true)
1700 ("CONFIG_SENSORS_LM90" . #true)
1701 ("CONFIG_SENSORS_LTC2978" . #true)
1702 ("CONFIG_SENSORS_LTC2978_REGULATOR" . #true)
1703 ("CONFIG_TMPFS" . #true)
1704 ("CONFIG_TMPFS_POSIX_ACL" . #true)
1705 ("CONFIG_TMPFS_XATTR" . #true)
1706 ;;("CONFIG_BLK_DEV_RAM_SIZE" . 524288)
1707 ("CONFIG_POWER_RESET_GPIO" . #true)
1708 ("CONFIG_CRYPTO_USER_API_HASH" . #true)
1709 ("CONFIG_CRYPTO_USER_API_SKCIPHER" . #true)
1710 ("CONFIG_CRYPTO_USER_API_RNG" . #true)
1711 ("CONFIG_CRYPTO_USER_API_AEAD" . #true)
1712
1713 ;; Fixes https://codeberg.org/guix/guix/issues/101
1714 ("CONFIG_KEY_DH_OPERATIONS" . #true)
1715
1716 ;; restool support
1717 ("CONFIG_FSL_MC_UAPI_SUPPORT" . #t)
1718 ("CONFIG_FSL_MC_BUS" . #t)
1719 ("CONFIG_VFIO_FSL_MC" . #t)
1720 ("CONFIG_FSL_MC_DPIO" . #t)
1721 ("CONFIG_ARM_GIC_V3_ITS_FSL_MC" . #t)
1722
1723 ;; vsockets support
1724 ;; TODO This seems to be enabled by default on other
1725 ;; architectures?
1726 ("CONFIG_VSOCKETS" . m)
1727 ("CONFIG_VSOCKETS_DIAG" . m)
1728 ("CONFIG_VSOCKETS_LOOPBACK" . m)
1729 ("CONFIG_VMWARE_VMCI_VSOCKETS" . m)
1730 ("CONFIG_VIRTIO_VSOCKETS" . m)
1731 ("CONFIG_VIRTIO_VSOCKETS_COMMON" . m)
1732 ("CONFIG_HYPERV_VSOCKETS" . m)
1733 ("CONFIG_VHOST_IOTLB" . m)
1734 ("CONFIG_VHOST_RING" . m)
1735 ("CONFIG_VHOST_TASK" . #true)
1736 ("CONFIG_VHOST" . m)
1737 ("CONFIG_VHOST_MENU" . #true)
1738 ("CONFIG_VHOST_NET" . m)
1739 ("CONFIG_VHOST_SCSI" . m)
1740 ("CONFIG_VHOST_VSOCK" . m)
1741 ("CONFIG_VHOST_VDPA" . m))
1742 (default-extra-linux-options linux-libre-lts-version))))
1743
1744(define-public reform-debian-packages-for-7.1
1745 (package
1746 (name "reform-debian-packages")
1747 (version "2023-07-10-688-gc3e9ed6") ;from git describe
1748 (source
1749 (origin
1750 (method git-fetch)
1751 (uri (git-reference
1752 (url "https://source.mnt.re/reform/reform-debian-packages.git")
1753 (commit "c3e9ed6f2dc3b18221dcbfe251d5724f6be83d09")))
1754 (file-name (git-file-name name version))
1755 (sha256
1756 (base32 "138a9jz882mia71gvvhhhhza1kb9vwp1xrmh6r9aj16qqfbzhspj"))))
1757 (build-system copy-build-system)
1758 (arguments
1759 (list
1760 #:install-plan
1761 #~'(("linux/patches7.1/" "/patches7.1")
1762 ("linux/" "/dts/amlogic"
1763 #:include-regexp ("meson.*\\.dts$"))
1764 ("linux/" "/dts/freescale"
1765 #:include-regexp ("imx8.*\\.dts$"))
1766 ("linux/" "/dts/freescale"
1767 #:include-regexp ("fsl.*\\.dts$"))
1768 ("linux/" "/dts/rockchip"
1769 #:include-regexp ("rk3588.*\\.dts$"))
1770 ("linux/" "/dts/qcom"
1771 #:include-regexp ("qcs.*\\.dts$"))
1772 ("linux/" "/dts/qcom"
1773 #:include-regexp ("qcs.*\\.dtsi$"))
1774 ("linux/config" "config"))))
1775 (home-page "https://source.mnt.re/reform/reform-debian-packages")
1776 (synopsis
1777 "Linux kernel patches and device-trees used for MNT Reform systems")
1778 (description
1779 "Linux kernel patches and device-trees used for the MNT Reform systems")
1780 (license (list
1781 (license:fsf-free "file://filter-output"
1782 "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html")
1783 license:bsd-2
1784 license:expat
1785 license:gpl2
1786 license:gpl2+
1787 license:gpl3
1788 license:x11))))
1789
1790(define-public reform-debian-packages-for-6.18
1791 (package
1792 (name "reform-debian-packages")
1793 (version "2023-07-10-525-g7e8a95c") ;from git describe
1794 (source
1795 (origin
1796 (method git-fetch)
1797 (uri (git-reference
1798 (url "https://source.mnt.re/reform/reform-debian-packages.git")
1799 (commit "7e8a95c7babd9e1f4b307b6d146e0846c65fc9b8")))
1800 (file-name (git-file-name name version))
1801 (sha256
1802 (base32 "0g7lm7bfsjn6y77i1gk6wgpmghd36s3axqdqr1ahl9vhzw03cx0g"))))
1803 (build-system copy-build-system)
1804 (arguments
1805 (list
1806 #:install-plan
1807 #~'(("linux/patches6.18/" "/patches6.18")
1808 ("linux/" "/dts/amlogic"
1809 #:include-regexp ("meson.*\\.dts$"))
1810 ("linux/" "/dts/freescale"
1811 #:include-regexp ("imx8.*\\.dts$"))
1812 ("linux/" "/dts/freescale"
1813 #:include-regexp ("fsl.*\\.dts$"))
1814 ("linux/" "/dts/rockchip"
1815 #:include-regexp ("rk3588.*\\.dts$"))
1816 ("linux/config" "config"))))
1817 (home-page "https://source.mnt.re/reform/reform-debian-packages")
1818 (synopsis
1819 "Linux kernel patches and device-trees used for MNT Reform systems")
1820 (description
1821 "Linux kernel patches and device-trees used for the MNT Reform systems")
1822 (license (list
1823 (license:fsf-free "file://filter-output"
1824 "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html")
1825 license:bsd-2
1826 license:expat
1827 license:gpl2
1828 license:gpl2+
1829 license:gpl3
1830 license:x11))))
1831
1832(define-public reform-debian-packages-for-6.12
1833 (package
1834 (name "reform-debian-packages")
1835 (version "2023-07-10-320-gaf0a461") ;from git describe
1836 (source
1837 (origin
1838 (method git-fetch)
1839 (uri (git-reference
1840 (url "https://source.mnt.re/reform/reform-debian-packages.git")
1841 (commit "af0a461d38e13481323f061d9ff6827d1d13873b")))
1842 (file-name (git-file-name name version))
1843 (sha256
1844 (base32 "1cylprld2ri3mprj5cgwla1l8qv9iqqvcra7h64yarzs49zaa16m"))))
1845 (build-system copy-build-system)
1846 (arguments
1847 (list
1848 #:install-plan
1849 #~'(("linux/patches6.12/" "/patches6.12")
1850 ("linux/" "/dts/amlogic"
1851 #:include-regexp ("meson.*\\.dts$"))
1852 ("linux/" "/dts/freescale"
1853 #:include-regexp ("imx8.*\\.dts$"))
1854 ("linux/" "/dts/freescale"
1855 #:include-regexp ("fsl.*\\.dts$"))
1856 ("linux/" "/dts/rockchip"
1857 #:include-regexp ("rk3588.*\\.dts$"))
1858 ("linux/config" "config"))))
1859 (home-page "https://source.mnt.re/reform/reform-debian-packages")
1860 (synopsis
1861 "Linux kernel patches and device-trees used for MNT Reform systems")
1862 (description
1863 "Linux kernel patches and device-trees used for the MNT Reform systems")
1864 (license (list
1865 (license:fsf-free "file://filter-output"
1866 "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html")
1867 license:bsd-2
1868 license:expat
1869 license:gpl2
1870 license:gpl2+
1871 license:gpl3
1872 license:x11))))
1873
1874(define (mnt-reform-kernel-options version)
1875 `(("CONFIG_DRM_LVDS_CODEC" . m)
1876 ("CONFIG_DRM_CDNS_MHDP8546" . m)
1877 ("CONFIG_DRM_CDNS_HDMI_CEC" . m)
1878 ("CONFIG_DRM_IMX_CDNS_MHDP" . m)
1879 ("CONFIG_DRM_IMX_DCSS" . m)
1880 ("CONFIG_PHY_FSL_IMX8MQ_HDPTX" . m)
1881 ("CONFIG_DRM_PANEL_LVDS" . m)
1882 ("CONFIG_I2C_IMX_LPI2C" . m)
1883 ("CONFIG_I2C_MUX_REG" . m)
1884 ("CONFIG_INTERCONNECT_IMX" . #true)
1885 ("CONFIG_INTERCONNECT_IMX8MQ" . #true)
1886 ("CONFIG_MFD_WM8994" . m)
1887 ("CONFIG_MUX_GPIO" . m)
1888 ("CONFIG_MUX_MMIO" . m)
1889 ("CONFIG_RTC_DRV_PCF8523" . m)
1890 ("CONFIG_USB_EHCI_FSL" . m)
1891 ("CONFIG_NO_HZ_IDLE" . #true)
1892 ("CONFIG_SND_SOC_FSL_MICFIL" . m)
1893 ("CONFIG_SND_IMX_SOC" . m)
1894 ("CONFIG_SND_SOC_FSL_ASOC_CARD" . m)
1895 ("CONFIG_SND_SOC_IMX_AUDMIX" . m)
1896 ("CONFIG_SND_SOC_IMX_HDMI" . m)
1897 ("CONFIG_INPUT_JOYSTICK" . #true)
1898 ("CONFIG_JOYSTICK_XPAD" . m)
1899 ("CONFIG_JOYSTICK_XPAD_FF" . #true)
1900 ("CONFIG_JOYSTICK_XPAD_LEDS" . #true)
1901 ("CONFIG_INTERCONNECT_IMX8MP" . #true)
1902 ("CONFIG_SND_SOC_FSL_ASRC" . #true)
1903 ("CONFIG_DRM_IMX_LCDIF" . #true)
1904 ("CONFIG_DRM_IMX8MP_DW_HDMI_BRIDGE" . #true)
1905 ("CONFIG_DRM_IMX8MP_HDMI_PVI" . #true)
1906 ("CONFIG_IMX8MM_THERMAL" . #true)
1907 ("CONFIG_IMX2_WDT" . #true)
1908 ("CONFIG_DRM_SAMSUNG_DSIM" . #true)
1909 ("CONFIG_PHY_FSL_SAMSUNG_HDMI_PHY" . #true)
1910 ("CONFIG_DRM" . m)
1911 ("CONFIG_DRM_PANEL_MNT_POCKET_REFORM" . m)
1912 ("CONFIG_IMX8M_BLK_CTRL" . #true)
1913 ("CONFIG_IMX_GPCV2_PM_DOMAINS" . #true)
1914 ("CONFIG_DRM_DISPLAY_CONNECTOR" . #true)
1915 ("CONFIG_DRM_FSL_LDB" . #true)
1916 ("CONFIG_BACKLIGHT_CLASS_DEVICE" . #true)
1917 ("CONFIG_BACKLIGHT_PWM" . #true)
1918 ("CONFIG_BACKLIGHT_GPIO" . #true)
1919 ("CONFIG_BACKLIGHT_LED" . #true)
1920 ("CONFIG_CPU_FREQ_GOV_PERFORMANCE" . #true)
1921 ("CONFIG_CPU_FREQ_GOV_POWERSAVE" . #true)
1922 ("CONFIG_CPU_FREQ_GOV_USERSPACE" . #true)
1923 ("CONFIG_CPU_FREQ_GOV_ONDEMAND" . #true)
1924 ("CONFIG_CPU_FREQ_GOV_CONSERVATIVE" . #true)
1925 ("CONFIG_CPU_FREQ_GOV_SCHEDUTIL" . #true)
1926 ("CONFIG_ARM_IMX_CPUFREQ_DT" . #true)
1927 ("CONFIG_ARM_IMX_BUS_DEVFREQ" . #true)
1928 ("CONFIG_IMX_IRQSTEER" . #true)
1929 ("CONFIG_PCI_MESON" . #true)
1930 ("CONFIG_DWMAC_MESON" . #true)
1931 ("CONFIG_MDIO_BUS_MUX_MESON_G12A" . m)
1932 ("CONFIG_GPIO_ROCKCHIP" . #true)
1933 ("CONFIG_PL330_DMA" . #true)
1934 ("CONFIG_I2C_MESON" . #true)
1935 ("CONFIG_PWM_MESON" . #true)
1936 ("CONFIG_USB_DWC3_MESON_G12A" . #true)
1937 ("CONFIG_MMC_MESON_GX" . #true)
1938 ("CONFIG_MMC_MESON_MX_SDIO" . #true)
1939 ("CONFIG_MESON_DDR_PMU" . #true)
1940 ("CONFIG_RTW88_8822CS" . m)
1941 ("CONFIG_PWM_FSL_FTM" . #true)
1942 ("CONFIG_FSL_RCPM" . #true)
1943 ("CONFIG_VIDEO_DW100" . m)
1944 ("CONFIG_IMX_AIPSTZ" . m)
1945 ("CONFIG_IMX_DSP" . m)
1946 ("CONFIG_IMX_REMOTEPROC" . m)
1947 ("CONFIG_IMX_DSP_REMOTEPROC" . m)
1948 ("CONFIG_ARM_ROCKCHIP_CPUFREQ" . m)
1949 ("CONFIG_DRM_PANTHOR" . m)
1950 ("CONFIG_NVMEM_ROCKCHIP_OTP" . #true)
1951 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX" . m)
1952 ("CONFIG_PHY_ROCKCHIP_USBDP" . m)
1953 ("CONFIG_ROCKCHIP_REGULATOR_COUPLER" . #true)
1954 ("CONFIG_SPI_ROCKCHIP" . #true)
1955 ("CONFIG_SPI_ROCKCHIP_SFC" . m)
1956 ("CONFIG_ARM_SCMI_CPUFREQ" . m)
1957 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_DCPHY" . #true)
1958 ("CONFIG_VIDEO_ROCKCHIP_VDEC2" . m)
1959 ("CONFIG_ROCKCHIP_DW_HDMI_QP" . #true)
1960 ;; Fixes https://codeberg.org/guix/guix/issues/101
1961 ("CONFIG_CRYPTO_USER_API_HASH" . #true)
1962 ("CONFIG_CRYPTO_USER_API_SKCIPHER" . #true)
1963 ("CONFIG_CRYPTO_USER_API_RNG" . #true)
1964 ("CONFIG_CRYPTO_USER_API_AEAD" . #true)
1965 ("CONFIG_KEY_DH_OPERATIONS" . #true)
1966 ;; nftables support
1967 ("CONFIG_NF_TABLES" . m)
1968 ("CONFIG_NF_TABLES_INET" . #true)
1969 ("CONFIG_NF_TABLES_NETDEV" . #true)
1970 ("CONFIG_NF_TABLES_IPV4" . #true)
1971 ("CONFIG_NF_TABLES_ARP" . #true)
1972 ("CONFIG_NF_TABLES_IPV6" . #true)
1973 ("CONFIG_NF_TABLES_BRIDGE" . m)
1974 ("CONFIG_NFT_NUMGEN" . m)
1975 ("CONFIG_NFT_CT" . m)
1976 ("CONFIG_NFT_FLOW_OFFLOAD" . m)
1977 ("CONFIG_NFT_CONNLIMIT" . m)
1978 ("CONFIG_NFT_LOG" . m)
1979 ("CONFIG_NFT_LIMIT" . m)
1980 ("CONFIG_NFT_MASQ" . m)
1981 ("CONFIG_NFT_REDIR" . m)
1982 ("CONFIG_NFT_NAT" . m)
1983 ("CONFIG_NFT_TUNNEL" . m)
1984 ("CONFIG_NFT_QUEUE" . m)
1985 ("CONFIG_NFT_QUOTA" . m)
1986 ("CONFIG_NFT_REJECT" . m)
1987 ("CONFIG_NFT_REJECT_INET" . m)
1988 ("CONFIG_NFT_COMPAT" . m)
1989 ("CONFIG_NFT_HASH" . m)
1990 ("CONFIG_NFT_FIB" . m)
1991 ("CONFIG_NFT_FIB_INET" . m)
1992 ("CONFIG_NFT_XFRM" . m)
1993 ("CONFIG_NFT_SOCKET" . m)
1994 ("CONFIG_NFT_OSF" . m)
1995 ("CONFIG_NFT_TPROXY" . m)
1996 ("CONFIG_NFT_SYNPROXY" . m)
1997 ("CONFIG_NFT_DUP_NETDEV" . m)
1998 ("CONFIG_NFT_FWD_NETDEV" . m)
1999 ("CONFIG_NFT_FIB_NETDEV" . m)
2000 ("CONFIG_NFT_REJECT_NETDEV" . m)
2001 ("CONFIG_NFT_REJECT_IPV4" . m)
2002 ("CONFIG_NFT_DUP_IPV4" . m)
2003 ("CONFIG_NFT_FIB_IPV4" . m)
2004 ("CONFIG_NFT_COMPAT_ARP" . m)
2005 ("CONFIG_NFT_REJECT_IPV6" . m)
2006 ("CONFIG_NFT_DUP_IPV6" . m)
2007 ("CONFIG_NFT_FIB_IPV6" . m)
2008 ("CONFIG_NFT_BRIDGE_META" . m)
2009 ("CONFIG_NFT_BRIDGE_REJECT" . m)
2010 ;; Provides support for FBCON options
2011 ("CONFIG_FRAMEBUFFER_CONSOLE_ROTATION" . #true)
2012 ("CONFIG_HIDRAW" . #true)
2013 ("CONFIG_FONT_SUPPORT" . #true)
2014 ("CONFIG_FONTS" . #true)
2015 ("CONFIG_FONT_8x8" . #true)
2016 ("CONFIG_FONT_8x16" . #true)
2017 ("CONFIG_FONT_TER10x18" . #true)
2018 ("CONFIG_FONT_TER16x32" . #true)
2019 ;; Provide support for USB tethering
2020 ("CONFIG_USB_NET_CDC_EEM" . m)
2021 ("CONFIG_USB_NET_RNDIS_HOST" . m)
2022 ("CONFIG_USB_WDM" . m)
2023 ("CONFIG_USB_GADGET" . m)
2024 ("CONFIG_USB_ETH" . m)
2025 ("CONFIG_USB_ETH_RNDIS" . m)
2026 ("CONFIG_USB_ETH_EEM" . m)
2027 ("CONFIG_USB_G_NCM" . m)
2028 ;; Provide support for ath9k wireless
2029 ("CONFIG_ATH9K" . m)
2030 ("CONFIG_ATH9K_HTC" . m)
2031 ;; vsockets support
2032 ("CONFIG_VSOCKETS" . m)
2033 ("CONFIG_VSOCKETS_DIAG" . m)
2034 ("CONFIG_VSOCKETS_LOOPBACK" . m)
2035 ("CONFIG_VMWARE_VMCI_VSOCKETS" . m)
2036 ("CONFIG_VIRTIO_VSOCKETS" . m)
2037 ("CONFIG_VIRTIO_VSOCKETS_COMMON" . m)
2038 ("CONFIG_HYPERV_VSOCKETS" . m)
2039 ,@(if (version>=? version "6.18")
2040 '(("CONFIG_ROCKCHIP_DW_MIPI_DSI2" . #true))
2041 ;; 6.12 or older gets this instead:
2042 '(("CONFIG_ROCKCHIP_INNO_HDMI" . #true)
2043 ("CONFIG_ROCKCHIP_LVDS" . #true)
2044 ("CONFIG_ROCKCHIP_DW_MIPI_DSI" . #true)))
2045 ,@(if (version>=? version "7.1")
2046 '( ;; QCOM cpu module
2047 ("CONFIG_INTERCONNECT_QCOM_SM8550" . #true)
2048 ("CONFIG_PINCTRL_SM8550" . #true)
2049 ("CONFIG_PINCTRL_SM8550_LPASS_LPI" . #true)
2050 ("CONFIG_SM_CAMCC_8550" . #true)
2051 ("CONFIG_SM_GCC_8550" . #true)
2052 ("CONFIG_SM_GPUCC_8550" . #true)
2053 ("CONFIG_SM_TCSRCC_8550" . #true)
2054 ("CONFIG_SM_VIDEOCC_8550" . #true)
2055 ("CONFIG_SM_DISPCC_8550" . #true)
2056 ("CONFIG_USB_QCOM_EUD" . #true)
2057 ("CONFIG_SPMI_PMIC_CLKDIV" . #true)
2058 ("CONFIG_INTERCONNECT_QCOM_SM8750" . #true)
2059 ("CONFIG_PINCTRL_SM8750" . #true)
2060 ("CONFIG_SM_TCSRCC_8750" . #true)
2061 ("CONFIG_REGULATOR_QCOM_REFGEN" . m)
2062 ("CONFIG_MNTRE_SC" . m))
2063 '())))
2064
2065(define-public linux-libre-arm64-mnt-reform-7.1
2066 ;; Kernel for use on the MNT/Reform systems
2067 ;; https://mntre.com/reform.html
2068 (let ((base (make-linux-libre* linux-libre-7.1-version
2069 linux-libre-7.1-gnu-revision
2070 linux-libre-7.1-source
2071 '("aarch64-linux")
2072 #:extra-version "arm64-mnt-reform"
2073 #:extra-options
2074 ;; https://source.mnt.re/reform/reform-debian-packages/-/blob/main/linux/config
2075 (append (mnt-reform-kernel-options
2076 linux-libre-7.1-version)
2077 (default-extra-linux-options
2078 linux-libre-7.1-version)))))
2079 (package
2080 (inherit base)
2081 (inputs (list reform-debian-packages-for-7.1))
2082 (synopsis (string-append (package-synopsis base)
2083 " for MNT/Reform systems"))
2084 (description (string-append (package-description base)
2085 " Configuration options and patches have been applied for use with MNT/Reform systems."))
2086 (arguments
2087 (substitute-keyword-arguments (package-arguments base)
2088 ((#:phases phases)
2089 #~(modify-phases #$phases
2090 (add-after 'unpack 'apply-reform-patches
2091 (lambda* (#:key inputs #:allow-other-keys)
2092 (for-each (lambda (patch)
2093 (invoke "patch" "-p1" "-i"
2094 (search-input-file inputs
2095 (string-append
2096 "patches7.1/" patch))))
2097 (list
2098 "imx8mp-mnt-pocket-reform/2ghz/0001-imx8mp-2ghz-clk.patch"
2099 "imx8mp-mnt-pocket-reform/2ghz/0002-imx8mp-2ghz-opp.patch"
2100 "imx8mp-mnt-pocket-reform/mmc-sdio/0001-sdhci-add-no-sd-uhs-sdr104-devicetree-property.patch"
2101 "imx8mp-mnt-pocket-reform/mmc-sdio/0002-During-the-card-init-the-host-side-sometimes-may-nee.patch"
2102 "imx8mp-mnt-pocket-reform/mmc-sdio/0003-USDHC-IP-has-one-limitation-the-tuning-circuit-can-t.patch"
2103 "imx8mp-mnt-pocket-reform/pocket-panel/0001-v5-add-multi-display-panel-driver.patch"
2104 "imx8mp-mnt-reform2/0001-sn65dsi86-use-hs-clock-of-samsung-dsim-host-directly.patch"
2105 "imx8mp-mnt-reform2/0002-lcdif-dont-exceed-desired-pixel-clock.patch"
2106 "imx8mq-mnt-reform2/0001-imx8mq-mnt-reform2.dts-multiple-fixes-for-display-wi.patch"
2107 "imx8mq-mnt-reform2/0001-nwl-dsi-fixup-mode-only-for-LCDIF-input-not-DCSS.patch"
2108 "imx8mq-mnt-reform2/0002-Revert-drm-bridge-nwl-dsi-Use-vsync-hsync-polarity-f.patch"
2109 "imx8mq-mnt-reform2/0003-lcdif-fix-pcie-interference.patch"
2110 "imx8mq-mnt-reform2/0004-mnt4002-imx-gpcv2-wake-smccc.patch.patch"
2111 "imx8mq-mnt-reform2/0005-pci-imx6-add-support-for-internal-refclk-imx8mq.patch"
2112 "imx8mq-mnt-reform2/0006-imx8mq-import-HDMI-driver-and-make-DCSS-compatible-w.patch"
2113 "ls1028a-mnt-reform2/0000-dtsi-add-hdptx.patch"
2114 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0001-a311d-viu-fifo-lines-config.patch"
2115 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0002-a311d-viu-fifo-lines-config-header.patch"
2116 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0003-tlv320aic31xx-add-1228800hz-support.patch"
2117 "meson-g12b-bananapi-cm4-mnt-reform2/0001-Revert-drm-bridge-synopsys-dw-mipi-dsi-enable-EoTp-b.patch"
2118 "meson-g12b-bananapi-cm4-mnt-reform2/0001-meson-g12b-bananapi-cm4-mnt-reform2.dts-fix-audio-an.patch"
2119 "meson-g12b-bananapi-cm4-mnt-reform2/0011-dw-mipi-dsi-phy-stop-wait-time.patch"
2120 "meson-g12b-bananapi-cm4-mnt-reform2/0012-innolux-n125hce-gn1-timing-tweaks.patch"
2121 "meson-g12b-bananapi-cm4-mnt-reform2/0013-meson-viu-hold-fifo-lines.patch"
2122 "meson-g12b-bananapi-cm4-mnt-reform2/0014-meson-venc-sync.patch.patch"
2123 "meson-g12b-bananapi-cm4-mnt-reform2/0015-meson-dw-mipi-dsi-sync-invert.patch"
2124 "meson-g12b-bananapi-cm4-mnt-reform2/0016-sn65dsi86-burst-mode-support.patch"
2125 "meson-g12b-bananapi-cm4-mnt-reform2/0018-sn65dsi86-never-turn-off.patch"
2126 "meson-g12b-bananapi-cm4-mnt-reform2/0020-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch"
2127 "meson-g12b-bananapi-cm4-mnt-reform2/0021-HACK-of-partial-revert-of-fdt.c-changes.patch"
2128 "meson-g12b-bananapi-cm4-mnt-reform2/0022-add-bt-and-eth-resets.patch"
2129 "meson-g12b-bananapi-cm4-mnt-reform2/0023-sdio-pullups.patch"
2130 "meson-g12b-bananapi-cm4-mnt-reform2/0024-sdio-improve-wifi-speed.patch"
2131 "meson-g12b-bananapi-cm4-mnt-reform2/0030-WORKAROUND-meson-plane-disable-afbc-32x8.patch"
2132 "qcom-mnt-reform2/3001-casey-aux-bridge-defer.patch"
2133 "qcom-mnt-reform2/3003-casey-lpass-sc7280-audio-hacks.patch"
2134 "qcom-mnt-reform2/4000-qcom-pci-d3cold.patch"
2135 "qcom-mnt-reform2/4001-qcom-pci-d3cold-2.patch"
2136 "qcom-mnt-reform2/4002-qcom-pci-get-ltssm.patch"
2137 "qcom-mnt-reform2/4003-qcom-pci-power-down-phy-via-parf.patch"
2138 "qcom-mnt-reform2/4004-qcom-pci-add-d3cold.patch"
2139 "qcom-mnt-reform2/5000-tlv320aic31xx-mclk-fallback.patch"
2140 "qcom-mnt-reform2/5010-asoc_qcom_qdsp6_q6prm_add_the_missing_mclk_clock_ids.patch"
2141 "qcom-mnt-reform2/5011-sc8280xp-add-support-for-I2S-clocks.patch"
2142 "rk3588-mnt-reform2/0024-math.h-add-DIV_ROUND_UP_NO_OVERFLOW.patch"
2143 "rk3588-mnt-reform2/0025-clk-divider-Fix-divisor-masking-on-64-bit-platforms.patch"
2144 "rk3588-mnt-reform2/0026-clk-composite-replace-open-coded-abs_diff.patch"
2145 "rk3588-mnt-reform2/0029-PCI-dw-rockchip-Restore-vpcie3v3-regulator-handle.patch"
2146 "rk3588-mnt-reform2/0030-mfd-rk8xx-Fix-shutdown-handler.patch"
2147 "rk3588-mnt-reform2/0031-dt-bindings-display-vop2-Add-VP-clock-resets.patch"
2148 "rk3588-mnt-reform2/0032-drm-rockchip-vop2-Add-clock-resets-support.patch"
2149 "rk3588-mnt-reform2/0033-arm64-dts-rockchip-Add-VOP-clock-resets-for-rk3588s.patch"
2150 "rk3588-mnt-reform2/0035-drm-rockchip-vop2-Add-core-reset-support.patch"
2151 "rk3588-mnt-reform2/0062-PCI-dw-rockchip-Move-devm_phy_get-out-of-phy_init.patch"
2152 "rk3588-mnt-reform2/0063-PCI-dw-rockchip-Add-helper-function-for-enhanced-LTS.patch"
2153 "rk3588-mnt-reform2/0064-PCI-dw-rockchip-Add-helper-function-for-controller-m.patch"
2154 "rk3588-mnt-reform2/0065-PCI-dw-rockchip-Add-helper-function-for-DDL-indicato.patch"
2155 "rk3588-mnt-reform2/0066-PCI-dw-rockchip-Add-pme_turn_off-support.patch"
2156 "rk3588-mnt-reform2/0067-PCI-dw-rockchip-Add-system-PM-support.patch"
2157 "rk3588-mnt-reform2/0078-PCI-dw-rockchip-Fix-LTSSM-set-functions.patch"
2158 "rk3588-mnt-reform2/0079-RFC-PCI-dw-rockchip-port-some-suspend-code-from-vend.patch"
2159 "rk3588-mnt-reform2/0089-DEBUG-phy-rockchip-samsung-hdptx-Add-verbose-logging.patch"
2160 "rk3588-mnt-reform2/0092-drm-rockchip-dw_hdmi_qp-Restrict-HPD-event-to-the-af.patch"
2161 "rk3588-mnt-reform2/0094-drm-bridge-connector-Use-cached-connector-status-in-.patch"
2162 "rk3588-mnt-reform2/0095-drm-bridge-Add-detect_ctx-hook-and-drm_bridge_detect.patch"
2163 "rk3588-mnt-reform2/0096-drm-bridge-connector-Switch-to-.detect_ctx-for-conne.patch"
2164 "rk3588-mnt-reform2/0097-drm-bridge-dw-hdmi-qp-Add-HDMI-2.0-SCDC-scrambling-a.patch"
2165 "rk3588-mnt-reform2/0108-dt-bindings-phy-rockchip-usbdp-add-improved-ports-sc.patch"
2166 "rk3588-mnt-reform2/2001-drm-bridge-dw-hdmi-qp-Return-0-in-audio-prepare-when.patch"
2167 "rk3588-mnt-reform2/2003-drm-bridge-synopsys-Do-not-warn-about-audio-params-c.patch"
2168 "rk3588-mnt-reform2/5200-drm-rockchip-Set-dma-mask-to-64-bit.patch"
2169 "rk3588-mnt-reform2/6000-loosen-mnt-reform2-edp-panel-timing.patch"
2170 "rk3588-mnt-reform2/7000-mnt-analogix-dp-changes-for-usb-c-alt-mode.patch"
2171 "sc/1000-mnt-sc-driver.patch"))))
2172 (add-after 'apply-reform-patches 'copy-reform-dts-files
2173 (lambda* (#:key inputs #:allow-other-keys)
2174 (for-each (lambda (dts)
2175 (copy-file (search-input-file inputs
2176 (string-append
2177 "/dts/" dts))
2178 (string-append "arch/arm64/boot/dts/"
2179 dts)))
2180 (list
2181 "amlogic/meson-g12b-bananapi-cm4-mnt-pocket-reform.dts"
2182 "freescale/fsl-ls1028a-mnt-reform2.dts"
2183 "freescale/imx8mp-mnt-pocket-reform.dts"
2184 "freescale/imx8mp-mnt-reform2.dts"
2185 "freescale/imx8mq-mnt-reform2-hdmi.dts"
2186 "rockchip/rk3588-mnt-station.dts"
2187 "rockchip/rk3588-mnt-pocket-reform.dts"
2188 "rockchip/rk3588-mnt-reform-next.dts"
2189 "rockchip/rk3588-mnt-reform2.dts"
2190 "rockchip/rk3588-mnt-reform2-dsi.dts"
2191 "qcom/qcs6490-mnt-quasar.dtsi"
2192 "qcom/qcs6490-mnt-reform2.dts"
2193 "qcom/qcs6490-mnt-pocket-reform.dts"
2194 "qcom/qcs6490-mnt-reform-next.dts"
2195 "qcom/qcs8550-mnt-reform2.dts"
2196 "qcom/qcs8550-mnt-pocket-reform.dts"
2197 "qcom/qcs8550-mnt-reform-next.dts"))))
2198 (add-after 'apply-reform-patches 'adjust-makefiles-with-new-dtb
2199 (lambda _
2200 (substitute* "arch/arm64/boot/dts/amlogic/Makefile"
2201 (("meson-g12b-bananapi-cm4-mnt-reform2.dtb")
2202 "meson-g12b-bananapi-cm4-mnt-reform2.dtb
2203dtb-$(CONFIG_ARCH_MESON) += meson-g12b-bananapi-cm4-mnt-pocket-reform.dtb"))
2204 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2205 (("fsl-ls1028a-rdb.dtb")
2206 "fsl-ls1028a-rdb.dtb
2207dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-mnt-reform2.dtb"))
2208 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2209 (("imx8mq-mnt-reform2.dtb")
2210 "imx8mq-mnt-reform2.dtb
2211dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-reform2.dtb
2212dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-pocket-reform.dtb
2213dtb-$(CONFIG_ARCH_MXC) += imx8mq-mnt-reform2-hdmi.dtb"))
2214 (substitute* "arch/arm64/boot/dts/rockchip/Makefile"
2215 (("rk3588-mnt-reform2.dtb")
2216 "rk3588-mnt-reform2.dtb
2217dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-station.dts
2218dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform2-dsi.dtb
2219dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform-next.dtb
2220dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-pocket-reform.dtb"))
2221 (substitute* "arch/arm64/boot/dts/qcom/Makefile"
2222 (("= qcs6490-rb3gen2-vision-mezzanine.dtb")
2223 "= qcs6490-rb3gen2-vision-mezzanine.dtb
2224dtb-$(CONFIG_ARCH_QCOM) += qcs6490-mnt-reform2.dtb
2225dtb-$(CONFIG_ARCH_QCOM) += qcs6490-mnt-pocket-reform.dtb
2226dtb-$(CONFIG_ARCH_QCOM) += qcs6490-mnt-reform-next.dtb")
2227 (("qcs8550-aim300-aiot.dtb")
2228 "qcs8550-aim300-aiot.dtb
2229dtb-$(CONFIG_ARCH_QCOM) += qcs8550-mnt-reform2.dtb
2230dtb-$(CONFIG_ARCH_QCOM) += qcs8550-mnt-pocket-reform.dtb
2231dtb-$(CONFIG_ARCH_QCOM) += qcs8550-mnt-reform-next.dtb")))))))))))
2232
2233(define-public linux-libre-arm64-mnt-reform linux-libre-arm64-mnt-reform-7.1)
2234
2235(define-public linux-libre-arm64-mnt-reform-6.18
2236 ;; Kernel for use on the MNT/Reform systems
2237 ;; https://mntre.com/reform.html
2238 (let ((base (make-linux-libre* linux-libre-6.18-version
2239 linux-libre-6.18-gnu-revision
2240 linux-libre-6.18-source
2241 '("aarch64-linux")
2242 #:extra-version "arm64-mnt-reform"
2243 #:extra-options
2244 ;; https://source.mnt.re/reform/reform-debian-packages/-/blob/main/linux/config
2245 (append (mnt-reform-kernel-options
2246 linux-libre-6.18-version)
2247 (default-extra-linux-options
2248 linux-libre-6.18-version)))))
2249 (package
2250 (inherit base)
2251 (inputs (list reform-debian-packages-for-6.18))
2252 (synopsis (string-append (package-synopsis base)
2253 " for MNT/Reform systems"))
2254 (description (string-append (package-description base)
2255 " Configuration options and patches have been applied for use with MNT/Reform systems."))
2256 (arguments
2257 (substitute-keyword-arguments arguments
2258 ((#:phases phases)
2259 #~(modify-phases #$phases
2260 (add-after 'unpack 'apply-reform-patches
2261 (lambda* (#:key inputs #:allow-other-keys)
2262 (for-each (lambda (patch)
2263 (invoke "patch" "-p1" "-i"
2264 (search-input-file inputs
2265 (string-append
2266 "patches6.18/" patch))))
2267 (list
2268 "imx8mp-mnt-pocket-reform/2ghz/0001-imx8mp-2ghz-clk.patch"
2269 "imx8mp-mnt-pocket-reform/2ghz/0002-imx8mp-2ghz-opp.patch"
2270 "imx8mp-mnt-pocket-reform/audio/0000-revert-crashy-audiomix-pm-support.patch"
2271 "imx8mp-mnt-pocket-reform/mmc-sdio/0001-sdhci-add-no-sd-uhs-sdr104-devicetree-property.patch"
2272 "imx8mp-mnt-pocket-reform/mmc-sdio/0002-During-the-card-init-the-host-side-sometimes-may-nee.patch"
2273 "imx8mp-mnt-pocket-reform/mmc-sdio/0003-USDHC-IP-has-one-limitation-the-tuning-circuit-can-t.patch"
2274 "imx8mp-mnt-pocket-reform/pocket-panel/0001-v5-add-multi-display-panel-driver.patch"
2275 "imx8mp-mnt-pocket-reform/pocket-panel/0002-pocket-panel-fix-sleep-add-orientation.patch"
2276 "imx8mp-mnt-reform2/0001-sn65dsi86-use-hs-clock-of-samsung-dsim-host-directly.patch"
2277 "imx8mp-mnt-reform2/0002-lcdif-dont-exceed-desired-pixel-clock.patch"
2278 "imx8mq-mnt-reform2/0001-imx8mq-mnt-reform2.dts-multiple-fixes-for-display-wi.patch"
2279 "imx8mq-mnt-reform2/0001-nwl-dsi-fixup-mode-only-for-LCDIF-input-not-DCSS.patch"
2280 "imx8mq-mnt-reform2/0002-Revert-drm-bridge-nwl-dsi-Use-vsync-hsync-polarity-f.patch"
2281 "imx8mq-mnt-reform2/0003-lcdif-fix-pcie-interference.patch"
2282 "imx8mq-mnt-reform2/0004-mnt4002-imx-gpcv2-wake-smccc.patch.patch"
2283 "imx8mq-mnt-reform2/0005-pci-imx6-add-support-for-internal-refclk-imx8mq.patch"
2284 "imx8mq-mnt-reform2/0006-imx8mq-import-HDMI-driver-and-make-DCSS-compatible-w.patch"
2285 "ls1028a-mnt-reform2/0000-dtsi-add-hdptx.patch"
2286 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0001-a311d-viu-fifo-lines-config.patch"
2287 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0002-a311d-viu-fifo-lines-config-header.patch"
2288 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0003-tlv320aic31xx-add-1228800hz-support.patch"
2289 "meson-g12b-bananapi-cm4-mnt-reform2/0001-meson-g12b-bananapi-cm4-mnt-reform2.dts-fix-audio-an.patch"
2290 "meson-g12b-bananapi-cm4-mnt-reform2/0001-Revert-drm-bridge-synopsys-dw-mipi-dsi-enable-EoTp-b.patch"
2291 "meson-g12b-bananapi-cm4-mnt-reform2/0011-dw-mipi-dsi-phy-stop-wait-time.patch"
2292 "meson-g12b-bananapi-cm4-mnt-reform2/0012-innolux-n125hce-gn1-timing-tweaks.patch"
2293 "meson-g12b-bananapi-cm4-mnt-reform2/0013-meson-viu-hold-fifo-lines.patch"
2294 "meson-g12b-bananapi-cm4-mnt-reform2/0014-meson-venc-sync.patch.patch"
2295 "meson-g12b-bananapi-cm4-mnt-reform2/0015-meson-dw-mipi-dsi-sync-invert.patch"
2296 "meson-g12b-bananapi-cm4-mnt-reform2/0016-sn65dsi86-burst-mode-support.patch"
2297 "meson-g12b-bananapi-cm4-mnt-reform2/0018-sn65dsi86-never-turn-off.patch"
2298 "meson-g12b-bananapi-cm4-mnt-reform2/0020-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch"
2299 "meson-g12b-bananapi-cm4-mnt-reform2/0021-HACK-of-partial-revert-of-fdt.c-changes.patch"
2300 "meson-g12b-bananapi-cm4-mnt-reform2/0022-add-bt-and-eth-resets.patch"
2301 "meson-g12b-bananapi-cm4-mnt-reform2/0023-sdio-pullups.patch"
2302 "meson-g12b-bananapi-cm4-mnt-reform2/0024-sdio-improve-wifi-speed.patch"
2303 "meson-g12b-bananapi-cm4-mnt-reform2/0030-WORKAROUND-meson-plane-disable-afbc-32x8.patch"
2304 "rk3588-mnt-reform2/0001-MERGED-drm-bridge-Pass-down-connector-to-drm-bridge-.patch"
2305 "rk3588-mnt-reform2/0024-math.h-add-DIV_ROUND_UP_NO_OVERFLOW.patch"
2306 "rk3588-mnt-reform2/0025-clk-divider-Fix-divisor-masking-on-64-bit-platforms.patch"
2307 "rk3588-mnt-reform2/0026-clk-composite-replace-open-coded-abs_diff.patch"
2308 "rk3588-mnt-reform2/0030-mfd-rk8xx-Fix-shutdown-handler.patch"
2309 "rk3588-mnt-reform2/0031-dt-bindings-display-vop2-Add-VP-clock-resets.patch"
2310 "rk3588-mnt-reform2/0032-drm-rockchip-vop2-Add-clock-resets-support.patch"
2311 "rk3588-mnt-reform2/0033-arm64-dts-rockchip-Add-VOP-clock-resets-for-rk3588s.patch"
2312 "rk3588-mnt-reform2/0035-drm-rockchip-vop2-Add-core-reset-support.patch"
2313 "rk3588-mnt-reform2/0046-arm64-defconfig-Enable-Rockchip-RK3588-DisplayPort-C.patch"
2314 "rk3588-mnt-reform2/0055-phy-rockchip-usbdp-move-orientation-handling-further.patch"
2315 "rk3588-mnt-reform2/0056-phy-rockchip-usbdp-reset-USB3-and-reinit-on-orientat.patch"
2316 ;; "rk3588-mnt-reform2/0060-PCI-dw-rockchip-Rename-rockchip_pcie_get_ltssm-funct.patch"
2317 ;; "rk3588-mnt-reform2/0061-PCI-dw-rockchip-Support-get_ltssm-operation.patch"
2318 ;; "rk3588-mnt-reform2/0062-PCI-dw-rockchip-Move-devm_phy_get-out-of-phy_init.patch"
2319 ;; "rk3588-mnt-reform2/0063-PCI-dw-rockchip-Add-helper-function-for-enhanced-LTS.patch"
2320 ;; "rk3588-mnt-reform2/0064-PCI-dw-rockchip-Add-helper-function-for-controller-m.patch"
2321 ;; "rk3588-mnt-reform2/0065-PCI-dw-rockchip-Add-helper-function-for-DDL-indicato.patch"
2322 ;; "rk3588-mnt-reform2/0066-PCI-dw-rockchip-Add-pme_turn_off-support.patch"
2323 ;; "rk3588-mnt-reform2/0067-PCI-dw-rockchip-Add-system-PM-support.patch"
2324 "rk3588-mnt-reform2/0068-drm-bridge-dw-hdmi-qp-Add-CEC-support.patch"
2325 "rk3588-mnt-reform2/0069-drm-bridge-dw-hdmi-qp-Fixup-timer-base-setup.patch"
2326 "rk3588-mnt-reform2/0070-drm-rockchip-dw_hdmi_qp-Improve-error-handling-with-.patch"
2327 "rk3588-mnt-reform2/0071-drm-rockchip-dw_hdmi_qp-Provide-CEC-IRQ-in-dw_hdmi_q.patch"
2328 "rk3588-mnt-reform2/0072-drm-rockchip-dw_hdmi_qp-Provide-ref-clock-rate-in-dw.patch"
2329 "rk3588-mnt-reform2/0073-arm64-defconfig-Enable-DW-HDMI-QP-CEC-support.patch"
2330 "rk3588-mnt-reform2/0075-phy-hdmi-Add-HDMI-2.1-FRL-configuration-options.patch"
2331 "rk3588-mnt-reform2/0079-phy-rockchip-samsung-hdptx-Use-usleep_range-instead-.patch"
2332 "rk3588-mnt-reform2/0080-phy-rockchip-samsung-hdptx-Fix-coding-style-alignmen.patch"
2333 "rk3588-mnt-reform2/0081-phy-rockchip-samsung-hdptx-Consistently-use-rk_-hdpt.patch"
2334 "rk3588-mnt-reform2/0082-phy-rockchip-samsung-hdptx-Enable-lane-output-in-com.patch"
2335 "rk3588-mnt-reform2/0083-phy-rockchip-samsung-hdptx-Cleanup-_cmn_init_seq-lis.patch"
2336 "rk3588-mnt-reform2/0084-phy-rockchip-samsung-hdptx-Compute-clk-rate-from-PLL.patch"
2337 "rk3588-mnt-reform2/0085-phy-rockchip-samsung-hdptx-Drop-hw_rate-driver-data.patch"
2338 "rk3588-mnt-reform2/0086-phy-rockchip-samsung-hdptx-Switch-to-driver-specific.patch"
2339 "rk3588-mnt-reform2/0087-phy-rockchip-samsung-hdptx-Extend-rk_hdptx_phy_verif.patch"
2340 "rk3588-mnt-reform2/0088-phy-rockchip-samsung-hdptx-Add-HDMI-2.1-FRL-support.patch"
2341 "rk3588-mnt-reform2/0089-drm-rockchip-vop2-Check-bpc-before-switching-DCLK-so.patch"
2342 "rk3588-mnt-reform2/0090-drm-bridge-dw-hdmi-qp-Handle-platform-supported-form.patch"
2343 "rk3588-mnt-reform2/0091-drm-rockchip-dw_hdmi_qp-Switch-to-phy_configure.patch"
2344 "rk3588-mnt-reform2/0092-drm-rockchip-dw_hdmi_qp-Use-bit-macros-for-RK3576-re.patch"
2345 "rk3588-mnt-reform2/0093-drm-rockchip-dw_hdmi_qp-Add-high-color-depth-support.patch"
2346 "rk3588-mnt-reform2/0094-DEBUG-phy-rockchip-samsung-hdptx-Add-verbose-logging.patch"
2347 "rk3588-mnt-reform2/0095-WIP-SCRAMB-drm-bridge-Add-detect_ctx-hook.patch"
2348 "rk3588-mnt-reform2/0096-WIP-SCRAMB-drm-bridge-connector-Switch-from-detect-t.patch"
2349 "rk3588-mnt-reform2/0097-WIP-SCRAMB-drm-bridge-dw-hdmi-qp-Add-high-TMDS-clock.patch"
2350 "rk3588-mnt-reform2/0098-WIP-YUV420-drm-rockchip-vop2-Add-YUV420-output-forma.patch"
2351 "rk3588-mnt-reform2/0099-WIP-YUV420-drm-rockchip-dw_hdmi_qp-Add-YUV420-output.patch"
2352 "rk3588-mnt-reform2/0100-WIP-FRL-dt-bindings-display-rockchip-Add-tmds-enable.patch"
2353 "rk3588-mnt-reform2/0101-WIP-FRL-drm-rockchip-dw_hdmi_qp-Fixup-usage-of-enabl.patch"
2354 "rk3588-mnt-reform2/0103-WIP-FRL-arm64-dts-rockchip-Assign-ACLK_VOP-to-750-MH.patch"
2355 "rk3588-mnt-reform2/0104-WIP-FRL-drm-connector-hdmi-Handle-FRL-in-hdmi_clock_.patch"
2356 "rk3588-mnt-reform2/0105-WIP-FRL-drm-bridge-dw-hdmi-qp-Add-HDMI-2.1-FRL-suppo.patch"
2357 "rk3588-mnt-reform2/0106-WIP-FRL-drm-rockchip-dw_hdmi_qp-Add-HDMI-2.1-FRL-sup.patch"
2358 "rk3588-mnt-reform2/0107-WIP-FRL-drm-rockchip-vop2-Add-HDMI-2.1-FRL-support.patch"
2359 "rk3588-mnt-reform2/0108-dt-bindings-phy-rockchip-usbdp-add-improved-ports-sc.patch"
2360 "rk3588-mnt-reform2/0114-media-dt-bindings-video-interfaces-add-defines-for-s.patch"
2361 "rk3588-mnt-reform2/2001-drm-bridge-dw-hdmi-qp-Return-0-in-audio-prepare-when.patch"
2362 "rk3588-mnt-reform2/2003-drm-bridge-synopsys-Do-not-warn-about-audio-params-c.patch"
2363 "rk3588-mnt-reform2/5200-drm-rockchip-Set-dma-mask-to-64-bit.patch"
2364 "rk3588-mnt-reform2/7001-PCI-dw-rockchip-Disable-root-port-BARs.patch"))))
2365 (add-after 'apply-reform-patches 'copy-reform-dts-files
2366 (lambda* (#:key inputs #:allow-other-keys)
2367 (for-each (lambda (dts)
2368 (copy-file (search-input-file inputs
2369 (string-append
2370 "/dts/" dts))
2371 (string-append "arch/arm64/boot/dts/"
2372 dts)))
2373 (list
2374 "amlogic/meson-g12b-bananapi-cm4-mnt-pocket-reform.dts"
2375 "freescale/fsl-ls1028a-mnt-reform2.dts"
2376 "freescale/imx8mp-mnt-pocket-reform.dts"
2377 "freescale/imx8mp-mnt-reform2.dts"
2378 "freescale/imx8mq-mnt-reform2-hdmi.dts"
2379 "rockchip/rk3588-mnt-desktop-reform.dts"
2380 "rockchip/rk3588-mnt-pocket-reform.dts"
2381 "rockchip/rk3588-mnt-reform-next.dts"
2382 "rockchip/rk3588-mnt-reform2.dts"
2383 "rockchip/rk3588-mnt-reform2-dsi.dts"
2384 ))))
2385 (add-after 'apply-reform-patches 'adjust-makefiles-with-new-dtb
2386 (lambda _
2387 (substitute* "arch/arm64/boot/dts/amlogic/Makefile"
2388 (("meson-g12b-bananapi-cm4-mnt-reform2.dtb")
2389 "meson-g12b-bananapi-cm4-mnt-reform2.dtb
2390dtb-$(CONFIG_ARCH_MESON) += meson-g12b-bananapi-cm4-mnt-pocket-reform.dtb"))
2391 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2392 (("fsl-ls1028a-rdb.dtb")
2393 "fsl-ls1028a-rdb.dtb
2394dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-mnt-reform2.dtb"))
2395 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2396 (("imx8mq-mnt-reform2.dtb")
2397 "imx8mq-mnt-reform2.dtb
2398dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-reform2.dtb
2399dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-pocket-reform.dtb
2400dtb-$(CONFIG_ARCH_MXC) += imx8mq-mnt-reform2-hdmi.dtb"))
2401 (substitute* "arch/arm64/boot/dts/rockchip/Makefile"
2402 (("rk3588-mnt-reform2.dtb")
2403 "rk3588-mnt-reform2.dtb
2404dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-desktop-reform.dtb
2405dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform2-dsi.dtb
2406dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform-next.dtb
2407dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-pocket-reform.dtb")))))))))))
2408
2409(define-public linux-libre-arm64-mnt-reform-6.12
2410 ;; Kernel for use on the MNT/Reform systems
2411 ;; https://mntre.com/reform.html
2412 (let ((base (make-linux-libre* linux-libre-6.12-version
2413 linux-libre-6.12-gnu-revision
2414 (source-with-patches linux-libre-6.12-source
2415 ;; Revert upstream patches
2416 ;; that conflict with
2417 ;; MNT/Reform patches
2418 (search-patches
2419 "linux-libre-arm64-mnt-reform-revert-vop2-display-modes.patch"
2420 "linux-libre-arm64-mnt-reform-revert-phy-rockchip-samsung.patch"
2421 "linux-libre-arm64-mnt-reform-revert-rk-samsung-hdptx.patch"))
2422 '("aarch64-linux")
2423 #:extra-version "arm64-mnt-reform"
2424 #:extra-options
2425 ;; https://source.mnt.re/reform/reform-debian-packages/-/blob/main/linux/config
2426 (append (mnt-reform-kernel-options
2427 linux-libre-6.12-version)
2428 (default-extra-linux-options
2429 linux-libre-6.12-version)))))
2430 (package
2431 (inherit base)
2432 (inputs (list reform-debian-packages-for-6.12))
2433 (synopsis (string-append (package-synopsis base)
2434 " for MNT/Reform systems"))
2435 (description (string-append (package-description base)
2436 " Configuration options and patches have been applied for use with MNT/Reform systems."))
2437 (arguments
2438 (substitute-keyword-arguments arguments
2439 ((#:phases phases)
2440 #~(modify-phases #$phases
2441 (add-after 'unpack 'apply-reform-patches
2442 (lambda* (#:key inputs #:allow-other-keys)
2443 (for-each (lambda (patch)
2444 (invoke "patch" "-p1" "-i"
2445 (search-input-file inputs
2446 (string-append
2447 "patches6.12/" patch))))
2448 (list
2449 "imx8mp-mnt-pocket-reform/2ghz/0001-imx8mp-2ghz-clk.patch"
2450 "imx8mp-mnt-pocket-reform/2ghz/0002-imx8mp-2ghz-opp.patch"
2451 "imx8mp-mnt-pocket-reform/audio/0000-revert-crashy-audiomix-pm-support.patch"
2452 "imx8mp-mnt-pocket-reform/mmc-sdio/0001-sdhci-add-no-sd-uhs-sdr104-devicetree-property.patch"
2453 "imx8mp-mnt-pocket-reform/mmc-sdio/0002-During-the-card-init-the-host-side-sometimes-may-nee.patch"
2454 "imx8mp-mnt-pocket-reform/mmc-sdio/0003-USDHC-IP-has-one-limitation-the-tuning-circuit-can-t.patch"
2455 "imx8mp-mnt-pocket-reform/pocket-panel/0001-v5-add-multi-display-panel-driver.patch"
2456 "imx8mp-mnt-reform2/0001-sn65dsi86-use-hs-clock-of-samsung-dsim-host-directly.patch"
2457 "imx8mp-mnt-reform2/0002-lcdif-dont-exceed-desired-pixel-clock.patch"
2458 "imx8mq-mnt-reform2/0001-nwl-dsi-fixup-mode-only-for-LCDIF-input-not-DCSS.patch"
2459 "imx8mq-mnt-reform2/0002-pci-imx6-add-support-for-internal-refclk-imx8mq.patch"
2460 "imx8mq-mnt-reform2/0003-lcdif-fix-pcie-interference.patch"
2461 "imx8mq-mnt-reform2/0004-mnt4002-imx-gpcv2-wake-smccc.patch.patch"
2462 ;; Does not apply, needs further investigation
2463 ;; "imx8mq-mnt-reform2/v19_20241126_sandor_yu_initial_support_cadence_mhdp8501_hdmi_dp_for_i_mx8mq.mbx"
2464 "ls1028a-mnt-reform2/0000-dtsi-add-hdptx.patch"
2465 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0001-a311d-viu-fifo-lines-config.patch"
2466 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0002-a311d-viu-fifo-lines-config-header.patch"
2467 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0003-tlv320aic31xx-add-1228800hz-support.patch"
2468 "meson-g12b-bananapi-cm4-mnt-reform2/0001-Revert-drm-bridge-synopsys-dw-mipi-dsi-enable-EoTp-b.patch"
2469 "meson-g12b-bananapi-cm4-mnt-reform2/0011-dw-mipi-dsi-phy-stop-wait-time.patch"
2470 "meson-g12b-bananapi-cm4-mnt-reform2/0012-innolux-n125hce-gn1-timing-tweaks.patch"
2471 "meson-g12b-bananapi-cm4-mnt-reform2/0013-meson-viu-hold-fifo-lines.patch"
2472 "meson-g12b-bananapi-cm4-mnt-reform2/0014-meson-venc-sync.patch.patch"
2473 "meson-g12b-bananapi-cm4-mnt-reform2/0015-meson-dw-mipi-dsi-sync-invert.patch"
2474 "meson-g12b-bananapi-cm4-mnt-reform2/0016-sn65dsi86-burst-mode-support.patch"
2475 "meson-g12b-bananapi-cm4-mnt-reform2/0018-sn65dsi86-never-turn-off.patch"
2476 "meson-g12b-bananapi-cm4-mnt-reform2/0020-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch"
2477 "meson-g12b-bananapi-cm4-mnt-reform2/0021-HACK-of-partial-revert-of-fdt.c-changes.patch"
2478 "meson-g12b-bananapi-cm4-mnt-reform2/0022-add-bt-and-eth-resets.patch"
2479 "meson-g12b-bananapi-cm4-mnt-reform2/0023-sdio-pullups.patch"
2480 "meson-g12b-bananapi-cm4-mnt-reform2/0024-sdio-improve-wifi-speed.patch"
2481 "rk3588-mnt-reform2/0001-regulator-Add-of_regulator_get_optional-for-pure-DT-.patch"
2482 "rk3588-mnt-reform2/0001-scripts-package-builddeb-allow-hooks-also-in-usr-sha.patch"
2483 "rk3588-mnt-reform2/0002-regulator-Add-devres-version-of-of_regulator_get_opt.patch"
2484 "rk3588-mnt-reform2/0004-arm64-dts-rockchip-rk3588-rock5b-add-USB-C-support.patch"
2485 "rk3588-mnt-reform2/0005-math.h-add-DIV_ROUND_UP_NO_OVERFLOW.patch"
2486 "rk3588-mnt-reform2/0006-clk-divider-Fix-divisor-masking-on-64-bit-platforms.patch"
2487 "rk3588-mnt-reform2/0007-clk-composite-replace-open-coded-abs_diff.patch"
2488 "rk3588-mnt-reform2/0008-clk-rockchip-support-clocks-registered-late.patch"
2489 "rk3588-mnt-reform2/0009-clk-rockchip-rk3588-register-GATE_LINK-later.patch"
2490 "rk3588-mnt-reform2/0010-clk-rockchip-expose-rockchip_clk_set_lookup.patch"
2491 "rk3588-mnt-reform2/0011-clk-rockchip-implement-linked-gate-clock-support.patch"
2492 "rk3588-mnt-reform2/0012-clk-rockchip-rk3588-drop-RK3588_LINKED_CLK.patch"
2493 "rk3588-mnt-reform2/0013-arm64-dts-rockchip-rk3588-evb1-add-bluetooth-rfkill.patch"
2494 "rk3588-mnt-reform2/0014-arm64-dts-rockchip-rk3588-evb1-improve-PCIe-ethernet.patch"
2495 "rk3588-mnt-reform2/0015-arm64-dts-rockchip-Slow-down-EMMC-a-bit-to-keep-IO-s.patch"
2496 "rk3588-mnt-reform2/0016-vop2-Add-clock-resets-support.patch"
2497 "rk3588-mnt-reform2/0017-arm64-dts-rockchip-Add-VOP-clock-resets-for-rk3588s.patch"
2498 "rk3588-mnt-reform2/0018-dt-bindings-display-vop2-Add-VP-clock-resets.patch"
2499 "rk3588-mnt-reform2/0019-media-v4l2-ctrls-core-Set-frame_mbs_only_flag-by-def.patch"
2500 "rk3588-mnt-reform2/0020-media-rockchip-Move-H264-CABAC-table-to-header-file.patch"
2501 "rk3588-mnt-reform2/0021-media-rockchip-Introduce-the-rkvdec2-driver.patch"
2502 "rk3588-mnt-reform2/0022-media-dt-bindings-rockchip-Document-RK3588-Video-Dec.patch"
2503 "rk3588-mnt-reform2/0023-arm64-dts-rockchip-Add-rkvdec2-Video-Decoder-on-rk35.patch"
2504 "rk3588-mnt-reform2/0024-arm64-defconfig-enable-Rockchip-RK3588-video-decoder.patch"
2505 "rk3588-mnt-reform2/0025-mfd-rk8xx-Fix-shutdown-handler.patch"
2506 "rk3588-mnt-reform2/0026-WIP-phy-phy-rockchip-samsung-hdptx-Add-FRL-EARC-supp.patch"
2507 "rk3588-mnt-reform2/0027-TESTING-phy-phy-rockchip-samsung-hdptx-Add-verbose-l.patch"
2508 "rk3588-mnt-reform2/0028-WIP-dt-bindings-display-rockchip-drm-Add-optional-cl.patch"
2509 "rk3588-mnt-reform2/0029-WIP-drm-rockchip-vop2-Improve-display-modes-handling.patch"
2510 "rk3588-mnt-reform2/0030-arm64-dts-rockchip-Add-HDMI0-bridge-to-rk3588.patch"
2511 "rk3588-mnt-reform2/0031-arm64-dts-rockchip-Enable-HDMI0-on-rock-5b.patch"
2512 "rk3588-mnt-reform2/0032-arm64-dts-rockchip-Enable-HDMI0-on-rk3588-evb1.patch"
2513 "rk3588-mnt-reform2/0033-WIP-arm64-dts-rockchip-Enable-HDMI0-PHY-clk-provider.patch"
2514 "rk3588-mnt-reform2/0034-WIP-arm64-dts-rockchip-Make-use-of-HDMI0-PHY-PLL-on-.patch"
2515 "rk3588-mnt-reform2/0035-WIP-arm64-dts-rockchip-Make-use-of-HDMI0-PHY-PLL-on-.patch"
2516 "rk3588-mnt-reform2/0036-dt-bindings-display-bridge-Add-schema-for-Synopsys-D.patch"
2517 "rk3588-mnt-reform2/0037-dt-bindings-display-rockchip-Add-schema-for-RK3588-H.patch"
2518 "rk3588-mnt-reform2/0038-drm-bridge-synopsys-Add-DW-HDMI-QP-TX-controller-dri.patch"
2519 "rk3588-mnt-reform2/0039-drm-rockchip-Add-basic-RK3588-HDMI-output-support.patch"
2520 "rk3588-mnt-reform2/0040-arm64-defconfig-Enable-Rockchip-extensions-for-Synop.patch"
2521 "rk3588-mnt-reform2/0041-MAINTAINERS-Add-entry-for-Synopsys-DesignWare-HDMI-R.patch"
2522 "rk3588-mnt-reform2/0042-dt-bindings-media-Document-bindings-for-HDMI-RX-Cont.patch"
2523 "rk3588-mnt-reform2/0043-arm64-dts-rockchip-Add-device-tree-support-for-HDMI-.patch"
2524 "rk3588-mnt-reform2/0044-media-platform-synopsys-Add-support-for-HDMI-input-d.patch"
2525 "rk3588-mnt-reform2/0045-arm64-defconfig-Enable-Synopsys-HDMI-receiver.patch"
2526 "rk3588-mnt-reform2/0046-arm64-dts-rockchip-Enable-HDMI-receiver-on-rock-5b.patch"
2527 "rk3588-mnt-reform2/0047-arm64-dts-rockchip-Enable-HDMI-receiver-on-RK3588-EV.patch"
2528 "rk3588-mnt-reform2/0048-arm64-defconfig-Enable-default-EDID-for-Synopsys-HDM.patch"
2529 "rk3588-mnt-reform2/0049-regulator-Add-devm_-of_regulator_get.patch"
2530 "rk3588-mnt-reform2/0050-pmdomain-rockchip-cleanup-mutex-handling-in-rockchip.patch"
2531 "rk3588-mnt-reform2/0051-pmdomain-rockchip-forward-rockchip_do_pmu_set_power_.patch"
2532 "rk3588-mnt-reform2/0052-pmdomain-rockchip-reduce-indentation-in-rockchip_pd_.patch"
2533 "rk3588-mnt-reform2/0053-dt-bindings-power-rockchip-add-regulator-support.patch"
2534 "rk3588-mnt-reform2/0054-pmdomain-rockchip-add-regulator-support.patch"
2535 "rk3588-mnt-reform2/0055-arm64-dts-rockchip-Add-GPU-power-domain-regulator-de.patch"
2536 "rk3588-mnt-reform2/0056-dt-bindings-net-wireless-brcm4329-fmac-add-pci14e4-4.patch"
2537 "rk3588-mnt-reform2/0057-dt-bindings-net-wireless-brcm4329-fmac-add-clock-des.patch"
2538 "rk3588-mnt-reform2/0058-wifi-brcmfmac-Add-optional-lpo-clock-enable-support.patch"
2539 ;; does not apply cleanly due to DEBLOBBING
2540 ;; "rk3588-mnt-reform2/0059-wifi-brcmfmac-add-flag-for-random-seed-during-firmwa.patch"
2541 "rk3588-mnt-reform2/0060-arm64-dts-rockchip-rk3588-evb1-add-WLAN-controller.patch"
2542 "rk3588-mnt-reform2/0061-arm64-dts-rockchip-add-and-enable-gpu-node-for-Radxa.patch"
2543 "rk3588-mnt-reform2/0062-arm64-dts-rockchip-Enable-HDMI0-on-rock-5a.patch"
2544 "rk3588-mnt-reform2/0100-rk3588-dtsi-add-hdmi1-controller.patch"
2545 "rk3588-mnt-reform2/0102-drm-panthor-Actually-suspend-IRQs-in-the-unplug-path.patch"
2546 "rk3588-mnt-reform2/3001-display-rockchip-add-schema-for-rk3588-hdmi-tx.patch"
2547 "rk3588-mnt-reform2/4000-mnt-rk3588-dual-hdmi-qp-rockchip.patch"
2548 "rk3588-mnt-reform2/4001-mnt-rk3588-dual-hdmi-vop2-pll.patch"
2549 "rk3588-mnt-reform2/5001-rk3588-dsi2-driver.patch"
2550 "rk3588-mnt-reform2/5002-rk3588-dsi-dts-nodes.patch"
2551 "rk3588-mnt-reform2/5100-modernize-hdmi1-in-dtsi.patch"
2552 "rk3588-mnt-reform2/5110-hdptx-crash-workaround.patch"
2553 "rk3588-mnt-reform2/5200-drm-rockchip-Set-dma-mask-to-64-bit.patch"))))
2554 (add-after 'apply-reform-patches 'copy-reform-dts-files
2555 (lambda* (#:key inputs #:allow-other-keys)
2556 (for-each (lambda (dts)
2557 (copy-file (search-input-file inputs
2558 (string-append
2559 "/dts/" dts))
2560 (string-append "arch/arm64/boot/dts/"
2561 dts)))
2562 (list
2563 "amlogic/meson-g12b-bananapi-cm4-mnt-pocket-reform.dts"
2564 "amlogic/meson-g12b-bananapi-cm4-mnt-reform2.dts"
2565 "freescale/fsl-ls1028a-mnt-reform2.dts"
2566 "freescale/imx8mp-mnt-pocket-reform.dts"
2567 "freescale/imx8mp-mnt-reform2.dts"
2568 "freescale/imx8mq-mnt-reform2-hdmi.dts"
2569 "freescale/imx8mq-mnt-reform2.dts"
2570 "rockchip/rk3588-mnt-pocket-reform.dts"
2571 "rockchip/rk3588-mnt-reform-next.dts"
2572 "rockchip/rk3588-mnt-reform2.dts"))))
2573 (add-after 'apply-reform-patches 'adjust-makefiles-with-new-dtb
2574 (lambda _
2575 (substitute* "arch/arm64/boot/dts/amlogic/Makefile"
2576 (("meson-g12b-bananapi-cm4-mnt-reform2.dtb")
2577 "meson-g12b-bananapi-cm4-mnt-reform2.dtb
2578dtb-$(CONFIG_ARCH_MESON) += meson-g12b-bananapi-cm4-mnt-pocket-reform.dtb"))
2579 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2580 (("fsl-ls1028a-rdb.dtb")
2581 "fsl-ls1028a-rdb.dtb
2582dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-mnt-reform2.dtb"))
2583 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2584 (("imx8mq-mnt-reform2.dtb")
2585 "imx8mq-mnt-reform2.dtb
2586dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-reform2.dtb
2587dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-pocket-reform.dtb
2588dtb-$(CONFIG_ARCH_MXC) += imx8mq-mnt-reform2-hdmi.dtb"))
2589 (substitute* "arch/arm64/boot/dts/rockchip/Makefile"
2590 (("rk3588-rock-5b.dtb")
2591 "rk3588-rock-5b.dtb
2592dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform2.dtb
2593dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform-next.dtb
2594dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-pocket-reform.dtb")))))))))))
2595
2596(define-public linux-libre-riscv64-generic
2597 (make-linux-libre* linux-libre-version
2598 linux-libre-gnu-revision
2599 linux-libre-source
2600 '("riscv64-linux")
2601 #:extra-version "riscv64-generic"
2602 #:extra-options
2603 (append
2604 ;; required `guix system vm'
2605 `(("CONFIG_USB_HID" . m)
2606 ("CONFIG_HID_GEMBIRD" . m)
2607 ("CONFIG_AHCI_DWC" . m)
2608 ("CONFIG_SATA_AHCI" . m)
2609 ("CONFIG_CRYPTO_SERPENT" . m)
2610 ("CONFIG_CRYPTO_WP512" . m)
2611 ("CONFIG_USB_UAS" . m)
2612 ("CONFIG_USB_STORAGE" . m)
2613 ("CONFIG_HID_GENERIC" . m)
2614 ("CONFIG_DRM_CIRRUS_QEMU" . m)
2615 ("CONFIG_HW_RANDOM_VIRTIO" . m)
2616 ("CONFIG_VIRTIO_CONSOLE" . m)
2617 ("CONFIG_CRYPTO_XTS" . m))
2618 (default-extra-linux-options linux-libre-version))))
2619
2620(define-public linux-libre-mips64el-fuloong2e
2621 (make-linux-libre* linux-libre-version
2622 linux-libre-gnu-revision
2623 linux-libre-source
2624 '("mips64el-linux")
2625 #:defconfig "fuloong2e_defconfig"
2626 #:extra-version "mips64el-fuloong2e"
2627 #:extra-options
2628 (append
2629 `(("CONFIG_OVERLAY_FS" . m))
2630 (default-extra-linux-options linux-libre-version))))
2631
2632
2633;;;
2634;;; Linux kernel modules.
2635;;;
2636
2637(define-public acpi-call-linux-module
2638 (package
2639 (name "acpi-call-linux-module")
2640 (version "1.2.2")
2641 (source
2642 (origin
2643 (method git-fetch)
2644 (uri (git-reference
2645 (url "https://github.com/nix-community/acpi_call")
2646 (commit (string-append "v" version))))
2647 (file-name (git-file-name name version))
2648 (sha256
2649 (base32 "09ljx0jl987753r2kjqj5kxms95bijw0xn14kf82ryn38ck5c8cf"))))
2650 (build-system linux-module-build-system)
2651 (arguments
2652 (list #:tests? #f ; no tests
2653 #:phases
2654 #~(modify-phases %standard-phases
2655 (add-before 'install 'patch-shebangs-harder
2656 ;; The (only) shebangs in examples/ don't justify a reference.
2657 ;; However, do substitute a slightly more portable one.
2658 (lambda _
2659 (substitute* (find-files "examples" ".")
2660 (("^(#! *)/[^ ]*/" _ shebang)
2661 (string-append shebang "/usr/bin/env ")))))
2662 (add-after 'install 'install-documentation
2663 (lambda _
2664 (let* ((doc (string-append #$output "/share/doc/"
2665 #$name "-" #$version)))
2666 (for-each (lambda (file)
2667 (let ((target (string-append doc "/" file)))
2668 (mkdir-p (dirname target))
2669 (copy-recursively file target)))
2670 (list "README.md" "examples"))))))))
2671 (home-page "https://github.com/nix-community/acpi_call")
2672 (synopsis "Linux kernel module to perform ACPI method calls")
2673 (description
2674 "This simple Linux kernel module allows calls from user space to any
2675@acronym{ACPI, Advanced Configuration and Power Interface} method provided by
2676your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
2677any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
2678and @code{ACPI_BUFFER}.
2679
2680It grants direct and undocumented access to your hardware that may cause damage
2681and should be used with caution, especially on untested models.")
2682 (license license:gpl3+))) ; see README.md (no licence headers)
2683
2684(define-public corefreq
2685 (package
2686 (name "corefreq")
2687 (version "2.1.2")
2688 (source
2689 (origin
2690 (method git-fetch)
2691 (uri (git-reference
2692 (url "https://github.com/cyring/CoreFreq")
2693 (commit version)))
2694 (file-name (git-file-name name version))
2695 (sha256
2696 (base32 "0kkb82205g4vkh5rh1bd3w97b83miqvb3xf557sf7pp1gz9i0acw"))))
2697 ;; The upstream Makefile is now such a proprietary mess that standard builds
2698 ;; as performed by our linux-module-build-system are more or less impossible
2699 ;; without heavy patching. However, we still keep it as the main build
2700 ;; system because lifting out LINUX-MODULE-BUILDER would be even messier.
2701 (build-system linux-module-build-system)
2702 (outputs (list "out" "linux-module"))
2703 (arguments
2704 (list #:imported-modules `((guix build gnu-build-system)
2705 ,@%linux-module-build-system-modules)
2706 #:modules `((guix build linux-module-build-system)
2707 ((guix build gnu-build-system) #:prefix gnu:)
2708 (guix build utils))
2709 #:make-flags
2710 #~(list (string-append "CC=" #$(cc-for-target))
2711 "OPTIM_LVL=3"
2712 (string-append "PREFIX=" #$output))
2713 #:tests? #f ;no test suite
2714 #:source-directory "../build" ;must contain modules.order
2715 #:phases
2716 #~(modify-phases %standard-phases
2717 (add-after 'unpack 'patch-Makefile
2718 (lambda* (#:key inputs #:allow-other-keys)
2719 (let ((dir (search-input-directory
2720 inputs "lib/modules/build")))
2721 (substitute* "Makefile"
2722 (("^(KERNELREL \\?= ).*" _ =)
2723 (string-append = (dirname dir) "\n"))
2724 (("^(KERNELDIR \\?= ).*" _ =)
2725 (string-append = dir "\n"))
2726 (("^([[:space:]]+)(.* modules_install.*)"
2727 _ indent command)
2728 (string-append indent "echo skipping " command))))))
2729 (add-before 'build 'prepare
2730 (lambda* (#:key source-directory #:allow-other-keys)
2731 ;; Lazily fix another mismatch between what the kernel module
2732 ;; build system expects and what this package provides.
2733 (symlink "source/build" source-directory)))
2734 (replace 'build
2735 (lambda* (#:key inputs #:allow-other-keys #:rest rest)
2736 (let ((kernel-dir
2737 (search-input-directory inputs "lib/modules/build")))
2738 ;; Avoid introducing store paths into the build output.
2739 ;; https://codeberg.org/guix/guix/issues/10409
2740 (setenv "KCFLAGS"
2741 (format #f "-ffile-prefix-map=~a=" kernel-dir))
2742 (apply (assoc-ref gnu:%standard-phases 'build)
2743 #:inputs inputs
2744 rest)
2745 (unsetenv "KCFLAGS"))))
2746 (add-before 'install 'resolve-symlink
2747 ;; The build system silently fails to install from a symlink.
2748 (lambda _
2749 (delete-file "../build")
2750 (copy-recursively "build" "../build")))
2751 (add-before 'install 'create-output
2752 (lambda _
2753 ;; Avoid installing the corefreq binary as …/bin.
2754 (mkdir-p (string-append #$output "/bin"))))
2755 (add-after 'install 'gnu:install
2756 (assoc-ref gnu:%standard-phases 'install))
2757 (add-after 'install 'separate-module
2758 (lambda* (#:key outputs #:allow-other-keys)
2759 ;; Adding INSTALL_MOD_PATH= to #:make-flags would still create an
2760 ;; empty <out>/lib/modules directory, so just do it all by hand.
2761 (let* ((output (assoc-ref outputs "out"))
2762 (module (assoc-ref outputs "linux-module")))
2763 (mkdir-p module)
2764 (rename-file (string-append output "/lib")
2765 (string-append module "/lib")))))
2766 (add-after 'install 'install-README
2767 ;; There is no proper documentation. Provide something.
2768 (lambda* (#:key outputs #:allow-other-keys)
2769 (let* ((out (assoc-ref outputs "out"))
2770 (doc (string-append out "/share/doc/"
2771 #$name "-" #$version)))
2772 (install-file "README.md" doc)))))))
2773 (home-page "https://github.com/cyring/CoreFreq")
2774 (synopsis
2775 "Measure performance data & tweak low-level settings on x86-64 CPUs")
2776 (description
2777 "CoreFreq is a CPU monitor that reports low-level processor settings and
2778performance data with notably high precision by using a loadable Linux kernel
2779module. Unlike most similar tools, it can be used to modify some settings if
2780supported by the hardware and at your own risk. It's designed for 64-bit x86
2781Intel processors (Atom, Core2, Nehalem, SandyBridge, and newer) and compatible
2782architectures like AMD@tie{}Zen and Hygon@tie{}Dhyana.
2783
2784Supported processor features include:
2785@enumerate
2786@item time spent in C-states, including C1/C3 Auto- and UnDemotion;
2787@item core temperatures, voltage, and tweaking thermal limits;
2788@item core frequencies, ratios, and base clock rate;
2789@item enabling, disabling, and testing SpeedStep (EIST), Turbo Boost, and
2790Hyper-Threading or SMT;
2791@item enabling or disabling data cache prefetching;
2792@item kernel assembly code to keep as near as possible readings of performance
2793counters such as the @acronym{TSC, Time Stamp Counter}, @acronym{UCC, Unhalted
2794Core Cycles}, and @acronym{URC, Unhalted Reference Cycles};
2795@item the number of instructions per cycle or second (IPS, IPC, and CPI);
2796@item memory controller geometry and RAM timings;
2797@item running processes' CPU affinity.
2798@end enumerate
2799
2800This package provides the @command{corefreqd} data collection daemon, the
2801@command{corefreq-cli} client to visualise and control it in real time, and the
2802@code{corefreqk} kernel module in its own separate output. Read the included
2803@file{README.md} before loading it.")
2804 (supported-systems (list "x86_64-linux"))
2805 (license license:gpl2)))
2806
2807(define-public tuxedo-keyboard
2808 (package
2809 (name "tuxedo-keyboard")
2810 (version "4.22.2")
2811 (source
2812 (origin
2813 (method git-fetch)
2814 (uri (git-reference
2815 (url "https://gitlab.com/tuxedocomputers/development/packages/tuxedo-drivers.git")
2816 (commit (string-append "v" version))))
2817 (file-name (git-file-name name version))
2818 (sha256
2819 (base32 "0akjyz8nhhpcr4y4xmhghd4253mndzhhi5qggr2z315vpxfr7rl4"))))
2820 (build-system linux-module-build-system)
2821 (arguments
2822 (list #:tests? #f)) ; no test suite
2823 ;; This package fails to build on aarch64, and the manufacturer only sells
2824 ;; machines based on Intel-compatible processors. For more information, see
2825 ;; <https://codeberg.org/guix/guix/pulls/1795>.
2826 (supported-systems '("i686-linux" "x86_64-linux"))
2827 (home-page "https://gitlab.com/tuxedocomputers/development/packages/tuxedo-drivers")
2828 (synopsis "Linux kernel modules to control keyboard on most Tuxedo computers")
2829 (description
2830 "This package provides the @code{tuxedo_keyboard}, @code{tuxedo_io},
2831@code{clevo_wmi} @acronym{WMI, Windows Management Engine} and the
2832@code{clevo_acpi} @acronym{ACPI, Advanced Configuration and Power Interface}
2833kernel modules to control the keyboard on most Tuxedo computers. The @code{tuxedo_io}
2834module is also needed for the @code{tuxedo-control-center} (short tcc) package.")
2835 (license license:gpl2+)))
2836
2837(define-public evdi
2838 ;; Version with fix for building on Linux 7.2 is unreleased
2839 (let ((revision "0")
2840 (commit "ee3a4b233d3086f2db38dc9ec88a83c92678afc7"))
2841 (package
2842 (name "evdi")
2843 (version (git-version "1.15.1" revision commit)) ;inherited by libevdi
2844 (source
2845 (origin
2846 (method git-fetch)
2847 (uri (git-reference
2848 (url "https://github.com/DisplayLink/evdi")
2849 (commit commit)))
2850 (file-name (git-file-name name version))
2851 (sha256
2852 (base32 "049rwypq3dpvi70yz5lp2ly5r876ax55qx351cg0v4h6r6vdgz6q"))))
2853 (build-system linux-module-build-system)
2854 (arguments
2855 (list #:tests? #f ;no test suite
2856 #:phases #~(modify-phases %standard-phases
2857 (add-after 'unpack 'chdir
2858 (lambda _
2859 (chdir "module")))
2860 ;; Looks like the value is only there to detect RHEL
2861 ;; derivatives, so we can safely delete the include.
2862 (add-after 'unpack 'embed-/etc/os-release
2863 (lambda _
2864 (substitute* "module/Makefile"
2865 (("include /etc/os-release") "")))))))
2866 (home-page "https://github.com/DisplayLink/evdi")
2867 (synopsis
2868 "@acronym{EVDI, Extensible Virtual Display Interface} Linux kernel module")
2869 (description
2870 "The @acronym{EVDI, Extensible Virtual Display Interface} is a Linux kernel
2871module that enables management of multiple screens, allowing user-space programs
2872to take control over what happens with the image. It is essentially a virtual
2873display for which applications using the @code{libevdi} library can add, remove,
2874and receive screen updates.
2875
2876The EVDI driver uses the standard Linux @acronym{DRM, Direct Rendering Manager}.
2877Its displays can be controlled by standard tools such as @command{xrandr} and
2878display settings applets in graphical environments.")
2879 (license license:gpl2))))
2880
2881(define-public libevdi
2882 (package
2883 (inherit evdi)
2884 (name "libevdi")
2885 (build-system gnu-build-system)
2886 (arguments
2887 (list #:tests? #f ;no test suite
2888 #:make-flags
2889 #~(list (string-append "CC=" #$(cc-for-target)))
2890 #:phases #~(modify-phases %standard-phases
2891 (delete 'configure)
2892 (add-after 'unpack 'chdir
2893 (lambda _
2894 (chdir "library")))
2895 (replace 'install
2896 (lambda* _
2897 (let* ((lib (string-append #$output "/lib")))
2898 (mkdir-p lib)
2899 (install-file "libevdi.so" lib)))))))
2900 (inputs (list libdrm))
2901 (native-inputs (list pkg-config))
2902 (synopsis
2903 "@acronym{EVDI, Extensible Virtual Display Interface} user-space library")
2904 (description
2905 "Libevdi is a library that gives applications easy access to
2906@acronym{EVDI, Extensible Virtual Display Interface} devices provided by the
2907@code{evdi} driver package.")
2908 (license license:lgpl2.1)))
2909
2910(define-public ec
2911 (package
2912 (name "ec")
2913 (version (package-version linux-libre))
2914 (source (package-source linux-libre))
2915 (build-system gnu-build-system)
2916 (arguments
2917 (list #:make-flags #~(list (string-append "sbindir="
2918 #$output "/sbin")
2919 "INSTALL=install" "STRIPCMD=true")
2920 #:phases #~(modify-phases %standard-phases
2921 (add-after 'unpack 'enter-subdirectory
2922 (lambda _
2923 (chdir "tools/power/acpi/tools/ec")))
2924 (delete 'configure)) ;no configure script
2925 #:tests? #f)) ;no tests
2926 (home-page (package-home-page linux-libre))
2927 (synopsis
2928 "Utility for reading or writing @acronym{EC, Embedded Controller} registers")
2929 (description
2930 "This utility can read or write specific registers or all the available
2931registers of the @acronym{EC, Embedded Controller} supported by the
2932@code{ec_sys} Linux driver.")
2933 (license license:gpl2)))
2934
2935(define-public bbswitch-module
2936 ;; Use "develop" branch since stable release does not build on Linux >= 5.6.
2937 ;; See https://github.com/Bumblebee-Project/bbswitch/issues/205.
2938 (let ((commit "19f60204596a6463b162fc7ca11f4946f5c20cea"))
2939 (package
2940 (name "bbswitch-module")
2941 (version (git-version "0.8" "2" commit))
2942 (source (origin
2943 (method git-fetch)
2944 (uri (git-reference
2945 ;; Use fork until
2946 ;; https://github.com/Bumblebee-Project/bbswitch/pull/219
2947 ;; is merged.
2948 (url "https://github.com/madchic/bbswitch")
2949 (commit commit)))
2950 (file-name (git-file-name name version))
2951 (sha256
2952 (base32
2953 "1pv41y02c9xg9k1bg4i4ll3w7hxxzdr651i08f092b9q5hr57mqn"))))
2954 (build-system linux-module-build-system)
2955 (arguments
2956 (list #:tests? #f)) ; no test suite
2957 (home-page "https://github.com/Bumblebee-Project/bbswitch")
2958 (synopsis "Kernel module that disables discrete Nvidia graphics cards")
2959 (description "The bbswitch module provides a way to toggle the Nvidia
2960graphics card on Optimus laptops.")
2961 (license license:gpl2))))
2962
2963(define-public bin-graph
2964 (package
2965 (name "bin-graph")
2966 (version "1.2.0")
2967 (source
2968 (origin
2969 (method git-fetch)
2970 (uri (git-reference
2971 (url "https://github.com/8dcc/bin-graph")
2972 (commit (string-append "v" version))))
2973 (file-name (git-file-name name version))
2974 (sha256
2975 (base32 "1msr4fj1nh6hf5h6j5pimfrgd37xy4xbik3iml9gd3b1fdkxsdv7"))))
2976 (arguments
2977 (list #:tests? #f ; no tests
2978 #:make-flags
2979 #~(list (string-append "CC=" #$(cc-for-target))
2980 (string-append "PREFIX=" #$output)
2981 (string-append "INSTALL_DIR=" #$output "/bin"))
2982 #:phases
2983 #~(modify-phases %standard-phases
2984 (delete 'configure)))) ; no configure script
2985 (build-system gnu-build-system)
2986 (inputs (list libpng))
2987 (home-page "https://github.com/8dcc/bin-graph")
2988 (synopsis "Visualize binary files")
2989 (description
2990 "@code{bin-graph} provides a simple way of visualizing the different regions
2991of a binary file.")
2992 (license license:gpl3)))
2993
2994(define-public ddcci-driver-linux
2995 (let ((revision "0")
2996 (commit "bbb7553373f815d78e93a4a9f071ce968563694a"))
2997 (package
2998 (name "ddcci-driver-linux")
2999 (version (git-version "0.4.5" revision commit))
3000 (source
3001 (origin
3002 (method git-fetch)
3003 (uri
3004 (git-reference
3005 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
3006 (commit commit)))
3007 (file-name (git-file-name name version))
3008 (sha256
3009 (base32 "1kc2lf2206x1hhj04xyplkbkja40j7r1a0mms5nah57d6q7fq23x"))
3010 (patches (search-patches "ddcci-driver-fix-linux-7.2.patch"))))
3011 (build-system linux-module-build-system)
3012 (arguments
3013 (list #:tests? #f ; no tests
3014 #:phases
3015 #~(modify-phases %standard-phases
3016 (replace 'build
3017 (lambda args
3018 (for-each
3019 (lambda (module)
3020 (with-directory-excursion module
3021 (apply (assoc-ref %standard-phases 'build) args)))
3022 '("ddcci" "ddcci-backlight"))))
3023 (replace 'install
3024 (lambda args
3025 (for-each
3026 (lambda (module)
3027 (with-directory-excursion module
3028 (apply (assoc-ref %standard-phases 'install) args)))
3029 '("ddcci" "ddcci-backlight")))))))
3030 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
3031 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
3032 (description "This package provides two Linux kernel drivers, ddcci and
3033ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
3034interface. The ddcci module creates a character device for each DDC/CI
3035monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
3036module allows the control of the backlight level or luminance property when
3037supported under @file{/sys/class/backlight/}.")
3038 (license license:gpl2+))))
3039
3040(define-public reform2-lpc-module
3041 (package
3042 (name "reform2-lpc-module")
3043 (version "1.79")
3044 (source
3045 (origin
3046 (method git-fetch)
3047 (uri (git-reference
3048 (url "https://source.mnt.re/reform/reform-tools.git")
3049 (commit version)))
3050 (file-name (git-file-name name version))
3051 (sha256
3052 (base32 "16xzdygf14zksvqjbp5gwiqsn0mb7kphvzrmqbl9db4kvyj4ajqa"))))
3053 (build-system linux-module-build-system)
3054 (arguments
3055 '(#:tests? #f ;no tests
3056 #:source-directory "lpc"))
3057 (synopsis "Linux kernel module for the Reform 2 system controller")
3058 (description
3059 "The reform2_lpc module allows for interaction with the NXP LPC11U24
3060Cortex-M0 MCU system controller in the Reform 2 open hardware laptop. It
3061provides battery status information and is necessary to completely shut down
3062the system when powering it off via userspace.")
3063 (home-page "https://source.mnt.re/reform/reform-tools/")
3064 (license license:gpl3+)))
3065
3066(define-public v4l2loopback-linux-module
3067 (package
3068 (name "v4l2loopback-linux-module")
3069 (version "0.15.3")
3070 (source (origin
3071 (method git-fetch)
3072 (uri (git-reference
3073 (url "https://github.com/v4l2loopback/v4l2loopback")
3074 (commit (string-append "v" version))))
3075 (file-name (git-file-name name version))
3076 (sha256
3077 (base32
3078 "1fpzsymsas4d2maj81k1al02m62d81ll4q15xwc4n0rhh88hkdv7"))))
3079 (build-system linux-module-build-system)
3080 (arguments
3081 (list #:tests? #f)) ; no test suite
3082 (home-page "https://github.com/v4l2loopback/v4l2loopback")
3083 (synopsis "Linux kernel module to create virtual V4L2 video devices")
3084 (description
3085 "This Linux module creates virtual video devices. @acronym{V4L2, Video
3086for Linux 2} applications will treat these as ordinary video devices but read
3087video data generated by another application, instead of a hardware device such
3088as a capture card.
3089
3090This lets you apply nifty effects to your Jitsi video, for example, but also
3091allows some more serious things like adding streaming capabilities to an
3092application by hooking GStreamer into the loopback device.")
3093 (license license:gpl2+)))
3094
3095(define-public xpadneo
3096 (package
3097 (name "xpadneo")
3098 (version "0.9.8")
3099 (source (origin
3100 (method git-fetch)
3101 (uri (git-reference
3102 (url "https://github.com/atar-axis/xpadneo")
3103 (commit (string-append "v" version))))
3104 (file-name (git-file-name name version))
3105 (sha256
3106 (base32
3107 "0928yr832may1ibximnvd6qjzr6sipyg8iclqgpcsa7wpxb4320b"))))
3108 (build-system linux-module-build-system)
3109 (arguments
3110 (list #:tests? #f ; no `check' target
3111 #:source-directory "hid-xpadneo/src"
3112 #:phases
3113 #~(modify-phases %standard-phases
3114 (add-after 'install 'post-install
3115 (lambda _
3116 (copy-recursively "hid-xpadneo/etc-modprobe.d"
3117 (string-append #$output "/etc/modprobe.d"))
3118 ;; udev-service-type takes its rules from /lib rather than
3119 ;; /etc, so copy it there instead
3120 (copy-recursively "hid-xpadneo/etc-udev-rules.d"
3121 (string-append #$output
3122 "/lib/udev/rules.d")))))))
3123 (home-page "https://atar-axis.github.io/xpadneo/")
3124 (synopsis "Xbox One Wireless Controller driver for the kernel Linux")
3125 (description
3126 "This package provides a driver for the XBox One S Wireless controller
3127and some newer models when connected via Bluetooth. In addition to the included
3128Linux kernel module, it also contains a modprobe configuration and udev rules,
3129which need to be installed separately.")
3130 (license license:gpl3+)))
3131
3132
3133;;;
3134;;; Pluggable authentication modules (PAM).
3135;;;
3136
3137(define-public linux-pam
3138 (package
3139 (name "linux-pam")
3140 (version "1.7.2")
3141 (source
3142 (origin
3143 (method git-fetch)
3144 (uri (git-reference
3145 (url "https://github.com/linux-pam/linux-pam")
3146 (commit (string-append "v" version))))
3147 (file-name (git-file-name name version))
3148 (sha256
3149 (base32
3150 "1z5apric696zsci28c7651spvdll0zrpfm9z574gcjf45mp22gmi"))
3151 (patches (search-patches "linux-pam-unix_chkpwd.patch"
3152 "linux-pam-no-setfsuid.patch"))))
3153 (build-system meson-build-system)
3154 (outputs '("out" "doc")) ;; 0.8 MiB of html
3155 (inputs (list libxcrypt))
3156 (native-inputs
3157 (list gettext-minimal
3158 flex bison
3159 ;; manpages
3160 libxslt
3161 libxml2
3162 docbook-xml
3163 docbook-xsl))
3164 (arguments
3165 (list
3166 #:configure-flags
3167 #~(list
3168 ;; lastlog is deprecated since 1.5.3
3169 "-Dpam_lastlog=enabled"
3170 (string-append "-Dvendordir=" #$output "/share/pam")
3171 (string-append "-Ddocbook-rng="
3172 #$(let ((docbook-xml (this-package-native-input
3173 "docbook-xml")))
3174 (file-append docbook-xml
3175 "/xml/docbook/"
3176 (package-version docbook-xml)
3177 "/rng/docbookxi.rng")))
3178 (string-append "-Dhtmldir=" #$output:doc "/share/doc/" #$name "/html"))
3179 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
3180 ;; isn't available.
3181 #:tests? #f))
3182 (home-page "http://www.linux-pam.org/")
3183 (synopsis "Pluggable authentication modules for Linux")
3184 (description
3185 "A *Free* project to implement OSF's RFC 86.0.
3186Pluggable authentication modules are small shared object files that can
3187be used through the PAM API to perform tasks, like authenticating a user
3188at login. Local and dynamic reconfiguration are its key features.")
3189 (license license:bsd-3)))
3190
3191(define-public python-pamela
3192 (package
3193 (name "python-pamela")
3194 (version "1.0.0")
3195 (source
3196 (origin
3197 (method git-fetch)
3198 (uri (git-reference
3199 (url "https://github.com/minrk/pamela")
3200 (commit version)))
3201 (file-name (git-file-name name version))
3202 (sha256
3203 (base32 "0cg3w6np1fbjpvzhv54xg567hpf38szwp2d4gvzb9r736nxbv0vr"))))
3204 (build-system pyproject-build-system)
3205 (arguments
3206 (list
3207 #:tests? #f ;Test suite isn't designed to be run inside a container.
3208 #:phases
3209 #~(modify-phases %standard-phases
3210 (add-after 'unpack 'hardcode-pam.so
3211 (lambda* (#:key inputs #:allow-other-keys)
3212 (substitute* "pamela.py"
3213 (("find_library\\(\"pam\")")
3214 (format #f "~s"
3215 (search-input-file inputs "lib/libpam.so"))))))
3216 (replace 'check
3217 (lambda* (#:key tests? #:allow-other-keys)
3218 (when (and tests? (file-exists? "test_pamela.py"))
3219 (invoke "pytest" "--assert=plain" "test_pamela.py")
3220 (invoke "python" "-m" "pamela" "-a" "`whoami`")))))))
3221 (inputs (list linux-pam))
3222 (native-inputs (list python-pytest python-setuptools))
3223 (home-page "https://github.com/minrk/pamela")
3224 (synopsis "PAM interface using ctypes")
3225 (description "This package provides a PAM interface using @code{ctypes}.")
3226 (license license:expat)))
3227
3228(define-public pam-gnupg
3229 (package
3230 (name "pam-gnupg")
3231 (version "0.3")
3232 (source (origin
3233 (method git-fetch)
3234 (uri (git-reference
3235 (url "https://github.com/cruegge/pam-gnupg")
3236 (commit (string-append "v" version))))
3237 (file-name (git-file-name name version))
3238 (sha256
3239 (base32
3240 "1bf91gi6zmfzzmczxm7pajxdlgnikasvg5xsd3j0a368rcr7lf9l"))))
3241 (build-system gnu-build-system)
3242 (inputs
3243 (list gnupg linux-pam))
3244 (native-inputs
3245 (list autoconf automake libtool))
3246 (arguments
3247 `(#:tests? #f ;no tests suite
3248 #:configure-flags
3249 (list (string-append "--with-moduledir="
3250 (assoc-ref %outputs "out") "/lib/security"))))
3251
3252 (home-page "https://github.com/cruegge/pam-gnupg")
3253 (synopsis "Unlock GnuPG keys on login")
3254 (description "This package provides a PAM module that hands over your
3255login password to @code{gpg-agent}. This can be useful if you are using a
3256GnuPG-based password manager like @code{pass}.")
3257 (license license:gpl3+)))
3258
3259
3260;;;
3261;;; Kernel documentation
3262;;;
3263
3264(define-public linux-libre-documentation
3265 (package
3266 (inherit linux-libre)
3267 (name "linux-libre-documentation")
3268 (arguments
3269 (list
3270 #:tests? #f
3271 #:phases #~(modify-phases %standard-phases
3272 (delete 'configure)
3273 (replace 'build
3274 (lambda* (#:key parallel-build? #:allow-other-keys)
3275 (substitute* "Documentation/Makefile"
3276 ;; Remove problematic environment check script.
3277 ((".*sphinx-pre-install --version-check") ""))
3278 (invoke "make" "infodocs"
3279 "-j" (if parallel-build?
3280 (number->string (parallel-job-count))
3281 "1"))))
3282 (replace 'install
3283 (lambda _
3284 (let* ((info-dir (string-append #$output "/share/info"))
3285 (info (string-append info-dir
3286 "/TheLinuxKernel.info.gz")))
3287 (with-directory-excursion "Documentation/output"
3288 (invoke "make" "-C" "texinfo" "install-info"
3289 (string-append "infodir=" info-dir)))
3290 ;; Create a symlink, for convenience.
3291 (symlink info (string-append info-dir
3292 "/linux.info.gz"))))))))
3293 (native-inputs
3294 (list graphviz
3295 perl
3296 python
3297 python-sphinx
3298 python-pyyaml
3299 texinfo
3300 which))
3301 (synopsis "Documentation for the kernel Linux-Libre")
3302 (description "This package provides the documentation for the kernel
3303Linux-Libre, as an Info manual. To consult it, run @samp{info linux}.")))
3304
3305;;;
3306;;; Miscellaneous.
3307;;;
3308
3309(define-public powercap
3310 (package
3311 (name "powercap")
3312 (version "0.6.0")
3313 (source
3314 (origin
3315 (method git-fetch)
3316 (uri (git-reference
3317 (url "https://github.com/powercap/powercap")
3318 (commit (string-append "v" version))))
3319 (file-name (git-file-name name version))
3320 (sha256
3321 (base32 "087almlx34nzjbv8a40kxlmgy8691z2zlzkfyca8a2b7l0b2kqlp"))))
3322 (build-system cmake-build-system)
3323 (arguments
3324 (list #:configure-flags
3325 #~(list "-DBUILD_SHARED_LIBS=ON")))
3326 (home-page "https://github.com/powercap/powercap")
3327 (synopsis "Utilities for accessing the powercap Linux kernel feature")
3328 (description "This package contains utilities for accessing the powercap
3329Linux kernel feature through sysfs. It includes an implementation for working
3330with Intel @acronym{RAPL, Running Average Power Limit}.
3331It provides the commands @code{powercap-info} and @code{powercap-set}.")
3332 (license license:bsd-3)))
3333
3334(define-public powerstat
3335 (package
3336 (name "powerstat")
3337 (version "0.04.03")
3338 (source
3339 (origin
3340 (method git-fetch)
3341 (uri (git-reference
3342 (url "https://github.com/ColinIanKing/powerstat")
3343 (commit (string-append "V" version))))
3344 (file-name (git-file-name name version))
3345 (sha256
3346 (base32 "1a1fnw4rb8fx4wrcl0yc6dbjj49k6vagnq7diyw4fs4i5nin7mv3"))))
3347 (build-system gnu-build-system)
3348 (arguments
3349 `(#:make-flags
3350 (list (string-append "CC=" ,(cc-for-target))
3351 (string-append "prefix=" (assoc-ref %outputs "out")))
3352 #:tests? #f ; no test suite
3353 #:phases
3354 (modify-phases %standard-phases
3355 (delete 'configure)))) ; no configure script
3356 (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
3357 (synopsis "Measure system power consumption")
3358 (description
3359 "Powerstat measures and reports your computer's power consumption in real
3360time. On mobile PCs, it uses ACPI battery information to measure the power
3361drain of the entire system.
3362
3363Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
3364domain measurements. These are available only on some hardware such as Intel
3365Sandybridge and newer, and cover only part of the machine's components such as
3366CPU, DRAM, and graphics. However, they provide accurate and immediate readings
3367and don't require a battery at all.
3368
3369The output is like @command{vmstat} but also shows power consumption statistics:
3370at the end of a run, @command{powerstat} will calculate the average, standard
3371deviation, and minimum and maximum values. It can show a nice histogram too.")
3372 (license license:gpl2)))
3373
3374(define-public psmisc
3375 (package
3376 (name "psmisc")
3377 (version "23.7")
3378 (source
3379 (origin
3380 (method url-fetch)
3381 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
3382 version ".tar.xz"))
3383 (sha256
3384 (base32 "09y30ywh1d4s4f0wgvki115kgpliq48rarmfmmjl0iq22jf5viaq"))))
3385 (build-system gnu-build-system)
3386 (arguments
3387 (list
3388 #:configure-flags
3389 (if (%current-target-system)
3390 #~(list "ac_cv_func_malloc_0_nonnull=yes"
3391 "ac_cv_func_realloc_0_nonnull=yes")
3392 #~'())))
3393 (inputs (list ncurses))
3394 (home-page "https://gitlab.com/psmisc/psmisc")
3395 (synopsis "Small utilities that use the proc file system")
3396 (description
3397 "psmisc is a set of small utilities that use the proc file system.
3398@itemize @bullet
3399@item @command{fuser} identifies processes using files or sockets;
3400@item @command{killall} kills processes by name;
3401@item @command{prtstat} prints statistics of a process;
3402@item @command{pslog} prints the log file(s) of a process;
3403@item @command{pstree} shows the currently running processes as a tree;
3404@item @command{peekfd} shows the data travelling over a file descriptor.
3405@end itemize")
3406 (license license:gpl2+)))
3407
3408(define-public util-linux
3409 (package
3410 (name "util-linux")
3411 (version "2.42.2")
3412 (source (origin
3413 (method url-fetch)
3414 (uri (string-append "mirror://kernel.org/linux/utils/"
3415 "util-linux/v" (version-major+minor version) "/"
3416 "util-linux-" version ".tar.xz"))
3417 (sha256
3418 (base32
3419 "12nfg4300x0g6z03fmqy6l6fcp10nf25p81diw9fy0lnvwx5v803"))
3420 (patches (search-patches "util-linux-tests.patch"))
3421 (modules '((guix build utils)))
3422 (snippet
3423 ;; We take 'nologin' from Shadow, the 'logger' program from
3424 ;; GNU Inetutils and 'kill' from GNU Coreutils.
3425 '(begin
3426 (substitute* "configure"
3427 (("build_nologin=yes") "build_nologin=no")
3428 (("build_logger=yes") "build_logger=no")
3429 (("build_kill=yes") "build_kill=no"))))))
3430 (build-system gnu-build-system)
3431 (outputs '("out" ;6.4 MiB executables and documentation
3432 "lib" ;8.8 MiB shared libraries, headers and locales
3433 "static")) ;2.9 MiB static .a libraries
3434 (arguments
3435 (list #:configure-flags
3436 #~(list "--disable-use-tty-group"
3437 (string-append
3438 "--enable-fs-paths-default="
3439 "/run/setuid-programs"
3440 ":/run/current-system/profile/sbin")
3441 ;; Don't try to chown root:root mount and umount
3442 "--disable-makeinstall-chown"
3443 "--localstatedir=/var"
3444 "--sysconfdir=/etc"
3445 (string-append "--localedir=" #$output:lib
3446 "/share/locale")
3447 ;; Install completions where our bash-completion package
3448 ;; expects them.
3449 (string-append "--with-bashcompletiondir=" #$output
3450 "/etc/bash_completion.d")
3451 ;; XXX: 32-bit Hurd platforms don't support 64bit time_t
3452 #$@(if (target-hurd32?)
3453 '("--disable-year2038")
3454 '()))
3455
3456 ;; FIXME: For now we cannot reliably run tests on GNU/Hurd:
3457 ;; <https://bugs.gnu.org/47791>.
3458 #:tests? (and (not (%current-target-system))
3459 (not (system-hurd?)))
3460
3461 #:phases
3462 #~(modify-phases %standard-phases
3463 (add-before 'configure 'patch-build-scripts
3464 (lambda _
3465 (substitute* "configure"
3466 ;; The build system assumes that we want to install
3467 ;; libraries below $exec_prefix when $libdir does not
3468 ;; match any of the "usual" locations. Fix that.
3469 (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
3470 "usrlib_execdir=$libdir"))))
3471 (add-before 'build 'set-umount-file-name
3472 (lambda _
3473 ;; Tell 'eject' the right file name of 'umount'.
3474 (substitute* "sys-utils/eject.c"
3475 (("\"/bin/umount\"")
3476 (string-append "\"" #$output "/bin/umount\"")))))
3477 (add-before 'check 'pre-check
3478 (lambda* (#:key native-inputs inputs #:allow-other-keys)
3479
3480 ;; Some tests use the invalid pw_shell
3481 (setenv "SHELL" (which "sh"))
3482
3483 (let ((services (search-input-file (or native-inputs inputs)
3484 "etc/services")))
3485 ;; Change the test to refer to the right file.
3486 (substitute* "tests/ts/mcookie/mcookie"
3487 (("/etc/services")
3488 services))
3489 (substitute* "tests/helpers/test_mkfds.c"
3490 (("/etc/fstab")
3491 (which "sh")))
3492 (substitute* "tests/ts/coresched/coresched"
3493 (("/bin/bash -c")
3494 (string-append (which "bash") " -c")))
3495 (substitute* "tests/ts/fincore/count"
3496 (("\"\\$FS\" = \"overlay\"")
3497 "\"$FS\" = \"overlay\" || \"$FS\" = \"btrfs\""))
3498 (substitute* "tests/helpers/test_enosys.c"
3499 (("/bin/false")
3500 (which "false"))))))
3501 (add-before 'check 'disable-setarch-test
3502 (lambda _
3503 ;; The setarch tests are unreliable in QEMU's user-mode
3504 ;; emulation, which is our primary method of building
3505 ;; ARMv7 packages. See
3506 ;; <https://github.com/karelzak/util-linux/issues/601>.
3507 (substitute* "tests/ts/setarch/setarch"
3508 (("ts_init_subtest.*" all)
3509 (string-append
3510 all "\n"
3511 "ts_skip \"setarch tests are unreliable under QEMU\"")))))
3512 (add-before 'check 'disable-lsns-test
3513 (lambda _
3514 ;; The lsns tests can fail due to ioctl(_, NS_GET_USERNS)
3515 ;; returning ENOTTY, indicating this kernel does not
3516 ;; support user namespaces. Curiously, this test can fail
3517 ;; on i686 even if the same test passes on x86_64 on the
3518 ;; same machine. See <https://issues.guix.gnu.org/49933>.
3519 (delete-file "tests/ts/lsns/ioctl_ns")))
3520 (add-before 'check 'disable-choom-test
3521 (lambda _
3522 ;; This test relies on writing to /proc/%d/oom_score_adj
3523 (delete-file "tests/ts/choom/choom")))
3524 (add-before 'check 'disable-lslogins-tests
3525 (lambda _
3526 ;; these test require that a user with name root exists
3527 ;; In the build sandbox there is no such user
3528 (delete-file "tests/ts/lslogins/checkuser")
3529 (delete-file "tests/ts/lslogins/json_mode")))
3530 #$@(if (target-ppc32?)
3531 #~((add-before 'check 'disable-enosys-ioctl
3532 ;; It is unclear why this test specifically
3533 ;; fails in Guix's port of powerpc-linux.
3534 (lambda _
3535 (substitute* "tests/ts/enosys/enosys"
3536 (("ts_init_subtest ioctl")
3537 (string-append
3538 "ts_init_subtest ioctl\n\n"
3539 "ts_skip \"unexplained failure on powerpc\"\n"))))))
3540 #~())
3541 (add-after 'install 'move-static-libraries
3542 (lambda _
3543 (let ((lib #$output:lib)
3544 (static #$output:static))
3545
3546 ;; Move static libraries to the "static" output.
3547 (mkdir-p (string-append static "/lib"))
3548 (with-directory-excursion lib
3549 (for-each (lambda (file)
3550 (rename-file file
3551 (string-append static "/"
3552 file)))
3553 (find-files "lib" "\\.a$"))
3554
3555 ;; Remove references to the static library from the '.la'
3556 ;; files so that Libtool does the right thing when both
3557 ;; the shared and static library is available.
3558 (substitute* (find-files "lib" "\\.la$")
3559 (("old_library=.*") "old_library=''\n"))))))
3560 (add-after 'install 'adjust-pkg-config-files
3561 (lambda _
3562 ;; Drop the unused "prefix=" and "exec_prefix=" variables from
3563 ;; the pkg-config files to avoid a cyclic reference on "out".
3564 (substitute* (find-files (string-append #$output:lib
3565 "/lib/pkgconfig")
3566 "\\.pc$")
3567 (("^(exec_)?prefix=.*") "")))))))
3568 (inputs
3569 (list file ;for libmagic
3570 ncurses
3571 sqlite
3572 zlib))
3573 (native-inputs
3574 (list net-base ;for tests
3575 perl
3576 pkg-config))
3577 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
3578 (synopsis "Collection of utilities for the Linux kernel")
3579 (description "Util-linux is a diverse collection of Linux kernel
3580utilities. It provides dmesg and includes tools for working with file systems,
3581block devices, UUIDs, TTYs, and many other tools.")
3582
3583 (properties '((upstream-name . "util-linux")))
3584 ;; Note that util-linux doesn't use the same license for all the
3585 ;; code. GPLv2+ is the default license for a code without an
3586 ;; explicitly defined license.
3587 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
3588 license:bsd-4 license:public-domain))))
3589
3590;; util-linux optionally supports udev, which allows lsblk to read file system
3591;; metadata without special privileges. Add it as a separate package to avoid
3592;; a circular dependency, and to keep the size small.
3593(define-public util-linux+udev
3594 (package/inherit
3595 util-linux
3596 (name "util-linux-with-udev")
3597 (inputs
3598 (modify-inputs inputs
3599 (prepend eudev)))))
3600
3601(define-public chimerautils
3602 (package
3603 (name "chimerautils")
3604 (version "15.0.3")
3605 (source
3606 (origin
3607 (method git-fetch)
3608 (uri (git-reference
3609 (url "https://github.com/chimera-linux/chimerautils")
3610 (commit (string-append "v" version))))
3611 (file-name (git-file-name name version))
3612 (sha256
3613 (base32 "1inagax7gg2rl2a9ymfxxk71xrwd4sngwc45ph61rlk345jhnxpw"))))
3614 (build-system meson-build-system)
3615 (arguments
3616 (list
3617 #:tests? #f ;no test suite
3618 #:phases
3619 #~(modify-phases %standard-phases
3620 (add-after 'unpack 'patch-paths
3621 (lambda _
3622 ;; In the mv meson configuration, chimerautils refers
3623 ;; to it's own cp (_PATH_CP) and mv (_PATH_MV) by path.
3624 (substitute* "src.freebsd/coreutils/mv/meson.build"
3625 (("/bin/") (string-append #$output "/bin/"))))))))
3626 (inputs (list acl
3627 libedit
3628 libxo
3629 ncurses
3630 openssl
3631 zlib
3632 (list zstd "lib")))
3633 (native-inputs (list flex bison pkg-config))
3634 (home-page "https://github.com/chimera-linux/chimerautils")
3635 (synopsis "The FreeBSD-based core Linux userland from Chimera Linux")
3636 (description
3637 "This is a port of the FreeBSD userland for Linux provided by
3638the Chimera Linux distribution. Essentially, it is a collection of UNIX tools
3639such as @command{grep}, @command{cp}, @command{vi}, etc. and can be used as an
3640alternative to the corresponding implementations from the GNU project.")
3641 (license license:bsd-2)))
3642
3643(define-public dislocker
3644 (package
3645 (name "dislocker")
3646 (version "0.7.3")
3647 (home-page "https://github.com/Aorimn/dislocker")
3648 (source (origin
3649 (method git-fetch)
3650 (uri (git-reference
3651 (url home-page)
3652 (commit (string-append "v" version))))
3653 (file-name (git-file-name name version))
3654 (sha256
3655 (base32
3656 "1ak68s1v5dwh8y2dy5zjybmrh0pnqralmyqzis67y21m87g47h2k"))))
3657 (build-system cmake-build-system)
3658 (arguments
3659 '(#:tests? #f)) ;no test suite
3660 (inputs (list fuse-2 mbedtls-lts))
3661 (synopsis "FUSE driver to read/write Windows BitLocker drives")
3662 (description
3663 "This package provides means to to read BitLocker encrypted
3664partitions. Write functionality is also provided but check the README.")
3665 (license license:gpl2+)))
3666
3667(define-public dwarves
3668 (package
3669 (name "dwarves")
3670 (version "1.29")
3671 (source (origin
3672 (method git-fetch)
3673 (uri (git-reference
3674 (url "https://github.com/acmel/dwarves")
3675 (commit (string-append "v" version))))
3676 (file-name (git-file-name name version))
3677 (sha256
3678 (base32
3679 "1ia3r77zyw7r8mydy1zrrdnqzm9ginsvf9pqviq48rglihhddvli"))
3680 (patches
3681 (search-patches "dwarves-threading-reproducibility.patch"))))
3682 (build-system cmake-build-system)
3683 (arguments (list #:configure-flags #~(list "-D__LIB=lib"
3684 "-DLIBBPF_EMBEDDED=OFF")
3685 #:tests? #f)) ;no test suite
3686 (native-inputs (list pkg-config))
3687 (inputs (list libbpf))
3688 (home-page "https://github.com/acmel/dwarves")
3689 (synopsis "Debugging information processing library and utilities")
3690 (description "Dwarves is a set of tools that use the debugging information
3691inserted in ELF binaries by compilers such as GCC, used by well known
3692debuggers such as GDB.
3693
3694Utilities in the Dwarves suite include @command{pahole}, that can be used to
3695find alignment holes in structures and classes in languages such as C, C++,
3696but not limited to these. These tools can also be used to encode and read the
3697BTF type information format used with the kernel Linux @code{bpf} syscall.
3698
3699The @command{codiff} command can be used to compare the effects changes in
3700source code generate on the resulting binaries.
3701
3702The @command{pfunct} command can be used to find all sorts of information
3703about functions, inlines, decisions made by the compiler about inlining, etc.
3704
3705The @command{pahole} command can be used to use all this type information to
3706pretty print raw data according to command line directions.
3707
3708Headers can have its data format described from debugging info and offsets from
3709it can be used to further format a number of records.
3710
3711Finally, the @command{btfdiff} command can be used to compare the output of
3712pahole from BTF and DWARF, to make sure they produce the same results.")
3713 (license license:gpl2+)))
3714
3715(define-public fbset
3716 (package
3717 (name "fbset")
3718 (version "2.1")
3719 (source
3720 (origin
3721 (method url-fetch)
3722 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
3723 version ".tar.gz"))
3724 (sha256
3725 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
3726 (build-system gnu-build-system)
3727 (arguments
3728 '(#:modules ((guix build gnu-build-system)
3729 (guix build utils)
3730 (srfi srfi-26))
3731 #:phases
3732 (modify-phases %standard-phases
3733 (delete 'configure) ; no configure script
3734 (add-before 'install 'pre-install
3735 (lambda* (#:key outputs #:allow-other-keys)
3736 (let ((out (assoc-ref outputs "out")))
3737 (substitute* "Makefile"
3738 (("mknod ") "true ")
3739 ;; The Makefile doesn't honour PREFIX or similar.
3740 (("/usr") out))
3741 (mkdir out)
3742 (with-directory-excursion out
3743 (for-each mkdir-p (list "sbin"
3744 "man/man5"
3745 "man/man8")))
3746 #t)))
3747 (add-after 'install 'install-fb.modes
3748 (lambda* (#:key outputs #:allow-other-keys)
3749 (let* ((out (assoc-ref outputs "out"))
3750 (etc (string-append out "/etc")))
3751 (for-each (cut install-file <> etc)
3752 (find-files "etc" "^fb\\.modes"))
3753 (symlink "fb.modes.ATI"
3754 (string-append etc "/fb.modes"))
3755 #t))))
3756 ;; Parallel building races to create modes.tab.c.
3757 #:parallel-build? #f
3758 #:tests? #f)) ; no test suite
3759 (native-inputs
3760 (list bison flex))
3761 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
3762 (synopsis "Show and modify Linux frame buffer settings")
3763 (description
3764 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
3765different kinds of graphic displays. The @command{fbset} utility can query and
3766change various device settings such as depth, virtual resolution, and timing
3767parameters.")
3768 (license license:gpl2)))
3769
3770(define-public procps
3771 (package
3772 (name "procps")
3773 (version "4.0.3")
3774 (source (origin
3775 (method url-fetch)
3776 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
3777 "procps-ng-" version ".tar.xz"))
3778 (sha256
3779 (base32
3780 "14ms9mkqr1mgl3h5yl6w8m57cf39k382nv7qms78vqbaz728wg1h"))
3781 (patches (search-patches "procps-strtod-test.patch"))))
3782 (build-system gnu-build-system)
3783 (arguments
3784 (list #:modules '((guix build utils)
3785 (guix build gnu-build-system)
3786 (srfi srfi-1)
3787 (srfi srfi-26))
3788 #:configure-flags
3789 (if (%current-target-system)
3790 #~'("ac_cv_func_malloc_0_nonnull=yes"
3791 "ac_cv_func_realloc_0_nonnull=yes")
3792 #~'())
3793 #:phases
3794 #~(modify-phases %standard-phases
3795 (add-after 'install 'post-install
3796 ;; Remove commands and man pages redudant with
3797 ;; Coreutils.
3798 (lambda* (#:key outputs #:allow-other-keys)
3799 (let* ((out #$output)
3800 (dup (append-map (cut find-files out <>)
3801 '("^kill" "^uptime"))))
3802 (for-each delete-file dup))))
3803 #$@(if (system-hurd?)
3804 #~((add-after 'unpack 'skip-tests
3805 (lambda _
3806 (substitute* "library/tests/test_version.c"
3807 (("^int main\\(.*" all)
3808 (string-append all "{\n exit (77);//"))))))
3809 #~()))))
3810 (inputs (list ncurses))
3811 (native-inputs (list pkg-config))
3812 (home-page "https://gitlab.com/procps-ng/procps/")
3813 (synopsis "Utilities that give information about processes")
3814 (description
3815 "Procps is the package that has a bunch of small useful utilities
3816that give information about processes using the Linux /proc file system.
3817The package includes the programs free, pgrep, pidof, pkill, pmap, ps, pwdx,
3818slabtop, tload, top, vmstat, w, watch and sysctl.")
3819 (properties '((upstream-name . "procps-ng")))
3820 (license license:gpl2)))
3821
3822(define-public usbutils
3823 (package
3824 (name "usbutils")
3825 (version "018")
3826 (source
3827 (origin
3828 (method url-fetch)
3829 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
3830 "usbutils-" version ".tar.xz"))
3831 (sha256
3832 (base32 "14xd7j9fl3pm0z4dhqj3mf9paqk431kq4vi602f5hiw5nmcqpxl3"))))
3833 (build-system meson-build-system)
3834 (outputs (list "out" "python"))
3835 (arguments
3836 (list
3837 #:phases
3838 #~(modify-phases %standard-phases
3839 (add-after 'install 'separate-python-output
3840 ;; Separating one Python script shaves more than 106 MiB from :out.
3841 (lambda _
3842 (for-each (lambda (file)
3843 (let ((old (string-append #$output "/" file))
3844 (new (string-append #$output:python "/" file)))
3845 (mkdir-p (dirname new))
3846 (rename-file old new)))
3847 (list "bin/lsusb.py"))))
3848 (add-after 'install 'install-usbreset
3849 (lambda _
3850 (install-file "usbreset"
3851 (string-append #$output "/bin")))))))
3852 (native-inputs (list pkg-config))
3853 (inputs (list eudev libusb python))
3854 (home-page "http://www.linux-usb.org/")
3855 (synopsis
3856 "Tools for working with USB devices")
3857 (description
3858 "Collection of tools to query what type of USB devices are connected to
3859the system, including @command{lsusb}. The experimental @command{usbreset}
3860command included in the package, but be aware that it may not work for all
3861devices.")
3862 (license license:gpl2+)))
3863
3864(define-public usbip-utils
3865 (package
3866 (name "usbip-utils")
3867 (version (package-version linux-libre))
3868 (source (package-source linux-libre))
3869 (build-system gnu-build-system)
3870 (arguments
3871 '(#:configure-flags '("--disable-static")
3872 #:phases (modify-phases %standard-phases
3873 (add-after 'unpack 'enter-subdirectory
3874 (lambda _
3875 (chdir "tools/usb/usbip")
3876 #t)))))
3877 (native-inputs
3878 `(("automake" ,automake)
3879 ("autoreconf" ,autoconf)
3880 ("libtool" ,libtool)))
3881 (inputs (list eudev))
3882 (home-page (package-home-page linux-libre))
3883 (synopsis "Utilities for sharing USB devices over IP networks")
3884 (description
3885 "The USB/IP protocol enables to pass USB device from a server to
3886a client over the network. The server is a machine which shares an
3887USB device and the client is a machine which uses USB device provided by
3888a server over the network. The USB device may be either physical device
3889connected to a server or software entity created on a server using USB
3890gadget subsystem. The usbip-utils are userspace tools to used to handle
3891connection and management on both side. The client needs the @file{vhci-hcd}
3892Linux kernel module and the server needs the @file{usbip_host} Linux kernel
3893module.")
3894 (license license:gpl2)))
3895
3896(define-public e2fsprogs
3897 (package
3898 (name "e2fsprogs")
3899 (version "1.47.2")
3900 (source (origin
3901 (method url-fetch)
3902 (uri (string-append
3903 "mirror://kernel.org/linux/kernel/people/tytso/"
3904 "e2fsprogs/v" version "/"
3905 "e2fsprogs-" version ".tar.xz"))
3906 (sha256
3907 (base32
3908 "0g76fhnyzr2awwybd6c16439l80r5dv4kbfaq7cr908fr9j2w908"))))
3909 (build-system gnu-build-system)
3910 (inputs
3911 `((,util-linux "lib") ,@(if (target-hurd?) '() (list fuse))))
3912 (native-inputs (list pkg-config
3913 texinfo ;for the libext2fs Info manual
3914 ;; For tests.
3915 perl
3916 procps))
3917 (arguments
3918 `(;; util-linux is the preferred source for some of the libraries and
3919 ;; commands, so disable them (see, e.g.,
3920 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
3921 #:configure-flags (list "--disable-libblkid"
3922 "--disable-libuuid" "--disable-uuidd"
3923 "--disable-fsck"
3924
3925 ;; Use symlinks instead of hard links for
3926 ;; 'fsck.extN' etc. This makes the resulting nar
3927 ;; smaller and is preserved across copies.
3928 "--enable-symlink-install"
3929
3930 (string-append "LDFLAGS=-Wl,-rpath="
3931 (assoc-ref %outputs "out")
3932 "/lib")
3933
3934 ;; Install libext2fs et al.
3935 "--enable-elf-shlibs")
3936
3937 #:phases
3938 (modify-phases %standard-phases
3939 (add-before 'configure 'patch-shells
3940 (lambda _
3941 (substitute* "configure"
3942 (("/bin/sh (.*)parse-types.sh" _ dir)
3943 (string-append (which "sh") " " dir
3944 "parse-types.sh")))
3945 (substitute* "MCONFIG.in"
3946 (("INSTALL_SYMLINK = /bin/sh")
3947 "INSTALL_SYMLINK = sh"))
3948 (substitute* (find-files "." "^Makefile.in$")
3949 (("#!/bin/sh")
3950 (string-append "#!" (which "sh"))))))
3951 (add-after 'install 'install-libs
3952 (lambda* (#:key outputs #:allow-other-keys)
3953 (let* ((out (assoc-ref outputs "out"))
3954 (lib (string-append out "/lib")))
3955 (invoke "make" "install-libs")
3956
3957 ;; Make the .a writable so that 'strip' works.
3958 ;; Failing to do that, due to debug symbols, we
3959 ;; retain a reference to the final
3960 ;; linux-libre-headers, which refer to the
3961 ;; bootstrap binaries.
3962 (let ((archives (find-files lib "\\.a$")))
3963 (for-each (lambda (file)
3964 (chmod file #o666))
3965 archives)))))
3966 ,@(if (system-hurd?)
3967 '((add-after 'unpack 'skip-tests
3968 (lambda _
3969 (with-directory-excursion "tests"
3970 (for-each
3971 (lambda (directory)
3972 (delete-file-recursively directory))
3973 '("d_bad_ostype"
3974 "f_detect_junk"
3975 "f_extent_oobounds"
3976 "j_ext_long_revoke_trans"
3977 "j_ext_long_trans"
3978 "j_long_revoke_trans"
3979 "j_long_revoke_trans_mcsum_32bit"
3980 "j_long_revoke_trans_mcsum_64bit"
3981 "j_long_trans"
3982 "j_long_trans_mcsum_32bit"
3983 "j_long_trans_mcsum_64bit"
3984 "j_short_revoke_trans"
3985 "j_short_revoke_trans_mcsum_64bit"
3986 "j_short_trans_64bit"
3987 "j_short_trans"
3988 "j_short_trans_mcsum_64bit"
3989 "j_short_trans_old_csum"
3990 "j_short_trans_open_recover"
3991 "j_short_trans_recover"
3992 "j_short_trans_recover_mcsum_64bit"
3993 "j_short_uncommitted_trans"
3994 "j_short_uncommitted_trans_mcsum_64bit"
3995 "m_error_behavior"
3996 "m_minrootdir"
3997 "m_rootdir"
3998 "r_32to64bit_expand_full"
3999 "r_expand_full"
4000 "r_fixup_lastbg_big"
4001 "t_change_uuid"
4002 "t_change_uuid_mcsum"
4003 "t_change_uuid_mcsum_mounted"
4004 "t_change_uuid_mcsum_seed_mounted"
4005 "t_change_uuid_mounted"
4006 "t_disable_changed_csum_seed"
4007 "t_disable_changed_csum_seed_mounted"
4008 "t_disable_csum_seed"
4009 "t_disable_meta_csum_and_seed"
4010 "t_enable_csum_seed"
4011 "t_format_csum_seed"
4012 "t_replay_and_set"
4013 "u_compound_rollback"
4014 "u_corrupt_blk_csum"
4015 "u_corrupt_blk_csum_force"
4016 "u_corrupt_key_csum"
4017 "u_debugfs_opt"
4018 "u_dryrun"
4019 "u_e2fsck_opt"
4020 "u_errorout"
4021 "u_force"
4022 "u_force_dryrun"
4023 "u_incomplete"
4024 "u_mke2fs_opt"
4025 "u_mke2fs_opt_oddsize"
4026 "u_offset"
4027 "u_onefile_bad"
4028 "u_resize2fs_opt"
4029 "u_revert_64bitmcsum_onefile"
4030 "u_revert_all_onefile"
4031 "u_revert_upgrade_to_64bitmcsum"
4032 "u_tune2fs_opt"
4033 "u_undo_undo"
4034 "u_wrong_fs"))))))
4035 '()))))
4036 (home-page "https://e2fsprogs.sourceforge.net/")
4037 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
4038 (description
4039 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
4040 (license (list license:gpl2 ;programs
4041 license:lgpl2.0 ;libext2fs
4042 license:x11)))) ;libuuid
4043
4044(define e2fsprogs/static
4045 (static-package
4046 (package (inherit e2fsprogs)
4047 (arguments
4048 ;; Do not build shared libraries.
4049 (substitute-keyword-arguments arguments
4050 ((#:configure-flags _)
4051 '(list "--disable-blkid" "--disable-fuse2fs"))
4052 ((#:make-flags _)
4053 '(list)))))))
4054
4055(define-public e2fsck/static
4056 (package
4057 (name "e2fsck-static")
4058 (version (package-version e2fsprogs))
4059 (build-system trivial-build-system)
4060 (source #f)
4061 (inputs
4062 (list e2fsprogs/static))
4063 (arguments
4064 `(#:modules ((guix build utils))
4065 #:builder
4066 (begin
4067 (use-modules (guix build utils)
4068 (ice-9 ftw)
4069 (srfi srfi-26))
4070
4071 (let ((e2fsck (search-input-file %build-inputs "/sbin/e2fsck"))
4072 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
4073 (mkdir-p bin)
4074 (with-directory-excursion bin
4075 (copy-file e2fsck "e2fsck")
4076 (remove-store-references "e2fsck")
4077 (chmod "e2fsck" #o555))
4078 #t))))
4079 (home-page (package-home-page e2fsprogs))
4080 (synopsis "Statically-linked e2fsck command from e2fsprogs")
4081 (description "This package provides statically-linked e2fsck command taken
4082from the e2fsprogs package. It is meant to be used in initrds.")
4083 (license (package-license e2fsprogs))))
4084
4085(define-public extundelete
4086 (package
4087 (name "extundelete")
4088 (version "0.2.4")
4089 (source
4090 (origin
4091 (method url-fetch)
4092 (uri (string-append "mirror://sourceforge/extundelete/"
4093 "extundelete/" version "/extundelete-"
4094 version ".tar.bz2"))
4095 (sha256
4096 (base32
4097 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
4098 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
4099 (build-system gnu-build-system)
4100 (inputs (list e2fsprogs))
4101 (home-page "https://extundelete.sourceforge.net/")
4102 (synopsis "Recover deleted files from ext2/3/4 partitions")
4103 (description
4104 "Extundelete is a set of tools that can recover deleted files from an
4105ext3 or ext4 partition.")
4106 (license license:gpl2)))
4107
4108(define-public zerofree
4109 (package
4110 (name "zerofree")
4111 (version "1.1.1")
4112 (home-page "https://frippery.org/uml/")
4113 (source
4114 (origin
4115 (method url-fetch)
4116 (uri (string-append home-page name "-" version ".tgz"))
4117 (sha256
4118 (base32 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
4119 (build-system gnu-build-system)
4120 (arguments
4121 (list
4122 #:tests? #f ;no tests
4123 #:phases
4124 #~(modify-phases %standard-phases
4125 (delete 'configure) ;no configure script
4126 (replace 'install
4127 ;; The Makefile lacks an ‘install’ target.
4128 (lambda _
4129 (chmod "zerofree" #o555)
4130 (install-file "zerofree" (string-append #$output "/bin")))))))
4131 (inputs (list e2fsprogs))
4132 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
4133 (description
4134 "Zerofree finds the unallocated blocks with non-zero value content in an
4135ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
4136This is a simple way to make disk images more compressible.
4137Zerofree requires the file system to be unmounted or mounted read-only.")
4138 (license license:gpl2)))
4139
4140(define-public strace
4141 (package
4142 (name "strace")
4143 (version "7.0")
4144 (source
4145 (origin
4146 (method git-fetch)
4147 (uri (git-reference
4148 (url "https://github.com/strace/strace")
4149 (commit (string-append "v" version))))
4150 (file-name (git-file-name name version))
4151 (sha256
4152 (base32 "1rrcak1kg2w2dc7dbj6vfyp6a3j0ad7b2jrv6wmkw8h9p8zscx02"))
4153 (patches (search-patches "strace-readlink-tests.patch"))))
4154 (build-system gnu-build-system)
4155 (arguments
4156 (list
4157 #:phases
4158 #~(modify-phases %standard-phases
4159 ;; Needed for the 'bootstrap phase.
4160 (add-after 'unpack 'patch-source-shebangs-initial
4161 (assoc-ref %standard-phases 'patch-source-shebangs))
4162 (add-after 'unpack 'patch-test-shebangs
4163 (lambda _
4164 (substitute* '("tests/detach-vfork.test"
4165 "tests/gen_tests.sh"
4166 "tests/kill-on-exit.sh")
4167 (("#!/bin/sh")
4168 (string-append "#!" (which "sh")))))))
4169 #:configure-flags
4170 ''("--with-libunwind"
4171 ;; Don't fail if the architecture doesn't support different
4172 ;; personalities.
4173 "--enable-mpers=check")
4174 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
4175 #:parallel-tests? #f)) ; undeterministic failures
4176 (inputs (list libunwind))
4177 (native-inputs
4178 (list autoconf
4179 automake
4180 perl
4181 m4
4182 ;; For some tests
4183 util-linux))
4184 (home-page "https://strace.io")
4185 (synopsis "System call tracer for Linux")
4186 (description
4187 "strace is a system call tracer, i.e. a debugging tool which prints out a
4188trace of all the system calls made by a another process/program.")
4189 (license license:lgpl2.1+)))
4190
4191(define-public ltrace
4192 (package
4193 (name "ltrace")
4194 (version "0.7.3")
4195 (source (origin
4196 (method url-fetch)
4197 (uri (string-append "http://www.ltrace.org/ltrace_" version
4198 ".orig.tar.bz2"))
4199 (sha256
4200 (base32
4201 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
4202 (build-system gnu-build-system)
4203 (arguments
4204 ;; Compilation uses -Werror by default, but it fails.
4205 (list #:configure-flags #~'("--disable-werror")))
4206 (inputs (list elfutils))
4207 (home-page "https://www.ltrace.org/")
4208 (synopsis "Library call tracer for Linux")
4209 (description
4210 "ltrace intercepts and records dynamic library calls which are called by
4211an executed process and the signals received by that process. It can also
4212intercept and print the system calls executed by the program.")
4213 (license license:gpl2+)))
4214
4215(define-public alsa-ucm-conf
4216 (package
4217 (name "alsa-ucm-conf")
4218 (version "1.2.16.1")
4219 (source
4220 (origin
4221 (method git-fetch)
4222 (uri (git-reference
4223 (url "https://github.com/alsa-project/alsa-ucm-conf")
4224 (commit (string-append "v" version))))
4225 (file-name (git-file-name name version))
4226 (sha256
4227 (base32 "1dgr8dlxzm4cx4sbp6mbb9ihharyym1qmb8zy9zq171h33k4061w"))))
4228 (build-system copy-build-system)
4229 (arguments
4230 '(#:install-plan
4231 '(("ucm" "share/alsa/ucm")
4232 ("ucm2" "share/alsa/ucm2"))))
4233 (home-page "https://www.alsa-project.org/wiki/Main_Page")
4234 (synopsis "The Advanced Linux Sound Architecture Use Case Manager")
4235 (description
4236 "This package contains @acronym{ALSA, Advanced Linux Sound Architecture}
4237@acronym{UCM, Use Case Manager} configuration of audio input/output names and
4238routing for specific audio hardware.")
4239 (license license:bsd-3)))
4240
4241(define-public alsa-topology-conf
4242 (package
4243 (name "alsa-topology-conf")
4244 (version "1.2.5.1")
4245 (source
4246 (origin
4247 (method git-fetch)
4248 (uri (git-reference
4249 (url "https://github.com/alsa-project/alsa-topology-conf")
4250 (commit (string-append "v" version))))
4251 (file-name (git-file-name name version))
4252 (sha256
4253 (base32 "150065nc5ksrxcay0ia0f8ad2s0gpp3xgn7gc5xsyf0k5dwdby49"))))
4254 (build-system copy-build-system)
4255 (arguments
4256 '(#:install-plan
4257 '(("topology" "share/alsa/topology"))))
4258 (home-page "https://www.alsa-project.org/wiki/Main_Page")
4259 (synopsis "The Advanced Linux Sound Architecture libraries")
4260 (description
4261 "This package contains @acronym{ALSA, Advanced Linux Sound Architecture}
4262topology configuration files that can be used for specific audio hardware.")
4263 (license license:bsd-3)))
4264
4265(define-public alsa-lib
4266 (package
4267 (name "alsa-lib")
4268 (version "1.2.16.1")
4269 (source
4270 (origin
4271 (method git-fetch)
4272 (uri (git-reference
4273 (url "https://github.com/alsa-project/alsa-lib")
4274 (commit (string-append "v" version))))
4275 (file-name (git-file-name name version))
4276 (sha256
4277 (base32 "06r315gq2ps11w72bh3hpljpqjwx2avba3lxccmqpwl9njfcvfmc"))))
4278 (build-system gnu-build-system)
4279 (arguments
4280 (list
4281 #:configure-flags
4282 #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
4283 #:phases
4284 #~(modify-phases %standard-phases
4285 (replace 'bootstrap
4286 (lambda _
4287 (invoke "libtoolize" "--force" "--copy" "--automake")
4288 (invoke "aclocal")
4289 (invoke "autoheader")
4290 (invoke "automake" "--foreign" "--copy" "--add-missing")
4291 (invoke "autoconf")))
4292 (add-before 'install 'pre-install
4293 (lambda* _
4294 (let* ((ucm #$(this-package-input "alsa-ucm-conf"))
4295 (topology #$(this-package-input "alsa-topology-conf"))
4296 (alsa (string-append #$output "/share/alsa"))
4297 (ucm-share (string-append ucm "/share/alsa/ucm"))
4298 (ucm2-share (string-append ucm "/share/alsa/ucm2"))
4299 (topology-share (string-append topology "/share/alsa/topology")))
4300 (mkdir-p alsa)
4301 (symlink ucm-share (string-append alsa "/ucm"))
4302 (symlink ucm2-share (string-append alsa "/ucm2"))
4303 (symlink topology-share (string-append alsa "/topology"))))))))
4304 (inputs
4305 (list autoconf-2.72
4306 automake
4307 alsa-ucm-conf
4308 alsa-topology-conf
4309 libtool))
4310 (supported-systems (remove target-hurd? %supported-systems))
4311 (home-page "https://www.alsa-project.org/wiki/Main_Page")
4312 (synopsis "The Advanced Linux Sound Architecture libraries")
4313 (description
4314 "@acronym{ALSA, Advanced Linux Sound Architecture} provides audio and
4315@acronym{MIDI, Musical Instrument Digital Interface} functionality to the
4316Linux-based operating system.")
4317 (license license:lgpl2.1+)))
4318
4319(define-public alsa-utils
4320 (package
4321 (name "alsa-utils")
4322 (version "1.2.16")
4323 (source (origin
4324 (method url-fetch)
4325 (uri (string-append
4326 "https://www.alsa-project.org/files/pub/utils/"
4327 name "-" version ".tar.bz2"))
4328 (sha256
4329 (base32
4330 "0b13yb7jirxwkfvynq1vd5slpv0wa9bk2fcf31g1v6klx3arj8q9"))))
4331 (build-system gnu-build-system)
4332 (arguments
4333 (list
4334 #:configure-flags
4335 #~(list
4336 ;; The udev rule is responsible for restoring the volume.
4337 (string-append "--with-udev-rules-dir=" #$output "/lib/udev/rules.d"))
4338 #:phases
4339 #~(modify-phases %standard-phases
4340 (add-after 'unpack 'patch-alsactl-udev-rules
4341 (lambda* (#:key inputs #:allow-other-keys)
4342 (substitute* "alsactl/conf/90-alsa-restore.rules.in"
4343 (("/usr/bin/cat")
4344 (search-input-file inputs "bin/cat")))))
4345 (add-before 'install 'pre-install
4346 (lambda _
4347 ;; Don't try to mkdir /var/lib/alsa.
4348 (substitute* "Makefile"
4349 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
4350 "true\n")))))))
4351 (native-inputs
4352 (list docbook-xml-4.2 docbook-xsl gettext-minimal pkg-config xmlto))
4353 (inputs
4354 (list libsamplerate ncurses alsa-lib))
4355 (home-page "http://www.alsa-project.org/")
4356 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
4357 (description
4358 "The Advanced Linux Sound Architecture (ALSA) provides audio and
4359MIDI functionality to the Linux-based operating system.")
4360
4361 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
4362 ;; GPLv2-only.
4363 (license license:gpl2)))
4364
4365(define-public alsa-plugins
4366 (package
4367 (name "alsa-plugins")
4368 (version "1.2.12")
4369 (source
4370 (origin
4371 (method git-fetch)
4372 (uri (git-reference
4373 (url "https://github.com/alsa-project/alsa-plugins")
4374 (commit (string-append "v" version))))
4375 (file-name (git-file-name name version))
4376 (sha256
4377 (base32 "0izvzdvw3nj69l4a968p9d9xjxfxs7i3bdpj1r4cvm6b8w7j33z8"))))
4378 (build-system gnu-build-system)
4379 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
4380 ;; be split, there are references to both in files.
4381 ;; TODO: Remove OSS related plugins, they add support to run native
4382 ;; ALSA applications on OSS however we do not offer OSS and OSS is
4383 ;; obsolete.
4384 (outputs '("out" "pulseaudio" "jack"))
4385 (native-search-paths
4386 (list (search-path-specification
4387 (variable "ALSA_PLUGIN_DIR")
4388 (files '("lib/alsa-lib"))
4389 (separator #f))))
4390 (arguments
4391 `(#:configure-flags '(;; Do not install a "local" configuration targeted
4392 ;; for /etc/alsa. On Guix System plugins are loaded from
4393 ;; the ALSA service, and other distributions likely
4394 ;; won't use these files.
4395 "--with-alsalconfdir=/tmp/noop")
4396 #:phases
4397 (modify-phases %standard-phases
4398 (add-after 'install 'split
4399 (lambda* (#:key inputs outputs #:allow-other-keys)
4400 ;; Distribute the binaries to the various outputs.
4401 (let* ((out (assoc-ref outputs "out"))
4402 (jack (assoc-ref outputs "jack"))
4403 (jacklib (string-append jack "/lib/alsa-lib"))
4404 (pua (assoc-ref outputs "pulseaudio"))
4405 (pualib (string-append pua "/lib/alsa-lib")))
4406 ;; For jack.
4407 (mkdir-p jacklib)
4408 (for-each (lambda (file)
4409 (rename-file file (string-append jacklib "/" (basename file))))
4410 (find-files out ".*jack\\.(la|so)"))
4411 ;; For pulseaudio.
4412 (mkdir-p pualib)
4413 (for-each (lambda (file)
4414 (rename-file file (string-append pualib "/" (basename file))))
4415 (find-files out ".*pulse\\.(la|so)"))
4416 #t))))))
4417 (inputs
4418 (list alsa-lib
4419 jack-1
4420 speex ; libspeexdsp resampling plugin
4421 libsamplerate ; libsamplerate resampling plugin
4422 ffmpeg ; libavcodec resampling plugin, a52 plugin
4423 pulseaudio)) ; PulseAudio plugin
4424 (native-inputs
4425 (list autoconf automake libtool pkg-config))
4426 (home-page "http://www.alsa-project.org/")
4427 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
4428 (description
4429 "@acronym{ALSA, Advanced Linux Sound Architecture} provides audio and
4430@acronym{MIDI, Musical Instrument Digital Interface} functionality to the
4431Linux-based operating system. This package enhances @acronym{ALSA} by
4432providing additional plugins which include: upmixing, downmixing, jackd and
4433pulseaudio support for native alsa applications, format conversion (s16 to
4434a52), and external rate conversion.")
4435 (license (list license:gpl2+
4436 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
4437 license:lgpl2.1+))))
4438
4439(define-public snd-rane-sl3
4440 (let ((commit "01099892261b55ec5ee814292d840eeb664c1904")
4441 (revision "0"))
4442 (package
4443 (name "snd-rane-sl3")
4444 (version (git-version "0" revision commit))
4445 (source
4446 (origin
4447 (method git-fetch)
4448 (uri (git-reference
4449 (url "https://github.com/nvgeele/snd-rane-sl3")
4450 (commit commit)))
4451 (file-name (git-file-name name version))
4452 (sha256
4453 (base32 "1j2aan5xmbi8hgkzzwjb7rarqh4g65rg3s1qd1c8x5m6fpqdnvli"))))
4454 (build-system linux-module-build-system)
4455 (arguments
4456 (list
4457 #:tests? #f ;No tests.
4458 #:phases
4459 #~(modify-phases %standard-phases
4460 (delete 'configure)
4461 (add-before 'build 'change-directory
4462 (lambda _
4463 (chdir "snd-rane-sl3"))))))
4464 (inputs (list linux-libre-headers))
4465 (home-page "https://github.com/nvgeele/snd-rane-sl3")
4466 (synopsis
4467 "Linux ALSA kernel driver for the Rane SL3 USB Audio interface")
4468 (description
4469 "snd-rane-sl3 provides a native Linux kernel module that
4470enables the Rane SL3 to work as a standard ALSA audio device, supporting 6
4471channels (3 stereo pairs) of 24-bit PCM audio at 44.1kHz and 48kHz sample
4472rates.")
4473 (license license:gpl3))))
4474
4475(define-public iptables
4476 (package
4477 (name "iptables")
4478 (version "1.8.11")
4479 (source
4480 (origin
4481 (method url-fetch)
4482 (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
4483 version ".tar.xz")))
4484 (sha256
4485 (base32 "1cp7kw0d3fpmfmbl4adh88v02wnj4s5rfgyxsk52pjgqbvah6wyq"))))
4486 (build-system gnu-build-system)
4487 (native-inputs
4488 (list pkg-config flex bison))
4489 (inputs
4490 (list libmnl libnftnl/pinned))
4491 (arguments
4492 (list #:tests? #f ; no test suite
4493 #:configure-flags ; add $libdir to the RUNPATH of executables
4494 #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))))
4495 (home-page "https://www.netfilter.org/projects/iptables/index.html")
4496 (synopsis "Programs to configure Linux IP packet filtering rules")
4497 (description
4498 "@command{iptables} is the user-space command line program used to
4499configure the Linux 2.4.x and later IPv4 packet filtering ruleset
4500(@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
4501
4502This package also includes @command{ip6tables}, which is used to configure the
4503IPv6 packet filter.
4504
4505Both commands are targeted at system administrators.")
4506 (properties
4507 '((release-monitoring-url . "https://www.netfilter.org/pub/iptables/")))
4508 (license license:gpl2+)))
4509
4510(define-public iptables-nft
4511 (package
4512 (inherit iptables)
4513 (name "iptables-nft")
4514 (source #f)
4515 (build-system copy-build-system)
4516 (arguments
4517 (list
4518 #:phases
4519 #~(modify-phases %standard-phases
4520 (delete 'unpack)
4521 (replace 'install
4522 (lambda* (#:key inputs #:allow-other-keys)
4523 (for-each
4524 (lambda (command-path)
4525 (let ((link-path (string-append #$output command-path)))
4526 (mkdir-p (dirname link-path))
4527 (symlink (search-input-file inputs "sbin/xtables-nft-multi")
4528 link-path)))
4529 (apply append
4530 '("/bin/iptables-xml")
4531 (map (lambda (xtables)
4532 (list (string-append "/sbin/" xtables)
4533 (string-append "/sbin/" xtables "-restore")
4534 (string-append "/sbin/" xtables "-save")))
4535 '("arptables"
4536 "ebtables"
4537 "iptables"
4538 "ip6tables")))))))))
4539 (inputs (list iptables))
4540 (native-inputs '())
4541 (synopsis
4542 "Programs to configure Linux IP packet filtering rules (nftables API)")))
4543
4544(define-public irqbalance
4545 (package
4546 (name "irqbalance")
4547 (version "1.9.5")
4548 (source
4549 (origin
4550 (method git-fetch)
4551 (uri (git-reference
4552 (url "https://github.com/irqbalance/irqbalance")
4553 (commit (string-append "v" version))))
4554 (file-name (git-file-name name version))
4555 (sha256
4556 (base32 "13drfji15qi7rnnsjvflp5yc98ga5x7frgw21ddhxjspjdib5cd9"))))
4557 (build-system gnu-build-system)
4558 (inputs (list glib ncurses libnl libcap-ng))
4559 (native-inputs (list autoconf automake libtool pkg-config))
4560 (home-page "https://irqbalance.github.io/irqbalance/")
4561 (synopsis "Daemon used to load balance CPU interrupts")
4562 (description
4563 "Irqbalance is a daemon to help balance the CPU load generated by
4564interrupts across all of a systems CPUs. Irqbalance identifies the highest
4565volume interrupt sources, and isolates each of them to a single unique CPU, so
4566that load is spread as much as possible over an entire processor set, while
4567minimizing cache miss rates for irq handlers.")
4568 (license license:gpl2)))
4569
4570(define-public bolt
4571 (package
4572 (name "bolt")
4573 (version "0.9.10")
4574 (source (origin
4575 (method git-fetch)
4576 (uri (git-reference
4577 (url "https://gitlab.freedesktop.org/bolt/bolt")
4578 (commit version)))
4579 (file-name (git-file-name name version))
4580 (sha256
4581 (base32
4582 "1vw4vzyhkpm73snnfciy7x88ja72cv5isc27k91jvmy2350b29yx"))))
4583 (build-system meson-build-system)
4584 (arguments
4585 (list #:configure-flags '(list "--localstatedir=/var")
4586 #:glib-or-gtk? #t ;To wrap binaries and/or compile schemas
4587 #:phases #~(modify-phases %standard-phases
4588 (add-after 'unpack 'replace-directories
4589 (lambda* (#:key outputs #:allow-other-keys)
4590 (substitute* "meson.build"
4591 (("udev.get_variable\\(pkgconfig: 'udevdir'\\)")
4592 (string-append "'" #$output "/lib/udev'"))
4593 ;; Don't install in /var
4594 (("not systemd\\.found\\(\\)")
4595 "false"))))
4596 (add-before 'install 'no-polkit-magic
4597 (lambda* (#:key outputs #:allow-other-keys)
4598 (setenv "PKEXEC_UID" "something"))))))
4599 (native-inputs (list pkg-config
4600 `(,glib "bin") python asciidoc umockdev))
4601 (inputs (list eudev dbus polkit))
4602 (synopsis "Thunderbolt 3 device manager")
4603 (description
4604 "This package provides @command{boltd}, a userspace daemon
4605for Thunderbolt devices, and @command{boltctl}, a command-line utility for
4606managing those devices.
4607
4608The daemon @command{boltd} exposes devices via D-Bus to clients. It also
4609stores a database of previously authorized devices and will, depending on the
4610policy set for the individual devices, automatically authorize newly connected
4611devices without user interaction.
4612
4613The command-line utility @command{boltctl} manages Thunderbolt devices via
4614@command{boltd}. It can list devices, monitor changes, and initiate
4615authorization of devices.")
4616 (home-page "https://gitlab.freedesktop.org/bolt/bolt")
4617 (properties `((lint-hidden-cpe-vendors . ("boltcms" "puppet"))))
4618 (license license:gpl2+)))
4619
4620(define-public jitterentropy-rngd
4621 (package
4622 (name "jitterentropy-rngd")
4623 (version "1.2.8")
4624 (source
4625 (origin
4626 (method git-fetch)
4627 (uri (git-reference
4628 (url "https://github.com/smuellerDD/jitterentropy-rngd")
4629 (commit (string-append "v" version))))
4630 (file-name (git-file-name name version))
4631 (sha256
4632 (base32 "13br8s6gqnfc844ps38ya5nny3pndsmskszv3dsp1cxcgvmscg1c"))))
4633 (build-system gnu-build-system)
4634 (arguments
4635 (list
4636 #:tests? #f ; no test suite
4637 #:make-flags
4638 #~(list (string-append "CC=" #$(cc-for-target))
4639 (string-append "PREFIX=" #$output)
4640 "UNITDIR=$(PREFIX)/lib/systemd/system")
4641 #:phases
4642 #~(modify-phases %standard-phases
4643 (delete 'configure)))) ; no ./configure script
4644 (home-page "https://www.chronox.de/jent.html")
4645 (synopsis "CPU jitter random number generator daemon")
4646 (description
4647 "This simple daemon feeds entropy from the CPU Jitter @acronym{RNG, random
4648number generator} core to the kernel Linux's entropy estimator. This prevents
4649the @file{/dev/random} device from blocking and should benefit users of the
4650preferred @file{/dev/urandom} and @code{getrandom()} interfaces too.
4651
4652The CPU Jitter RNG itself is part of the kernel and claims to provide good
4653entropy by collecting and magnifying differences in CPU execution time as
4654measured by the high-resolution timer built into modern CPUs. It requires no
4655additional hardware or external entropy source.
4656
4657The random bit stream generated by @command{jitterentropy-rngd} is not processed
4658by a cryptographically secure whitening function. Nonetheless, its authors
4659believe it to be a suitable source of cryptographically secure key material or
4660other cryptographically sensitive data.
4661
4662If you agree with them, start this daemon as early as possible to provide
4663properly seeded random numbers to services like SSH or those using TLS during
4664early boot when entropy may be low, especially in virtualised environments.")
4665 (license (list license:bsd-3 ; or
4666 license:gpl2+))))
4667
4668(define-public ebtables
4669 (package
4670 (name "ebtables")
4671 (version "2.0.11")
4672 (source (origin
4673 (method url-fetch)
4674 (uri (string-append
4675 "mirror://netfilter.org/ebtables/ebtables-"
4676 version ".tar.gz"))
4677 (sha256
4678 (base32
4679 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
4680 (build-system gnu-build-system)
4681 (inputs
4682 (list perl iptables))
4683 (synopsis "Ethernet bridge frame table administration")
4684 (home-page "https://ebtables.netfilter.org/")
4685 (description
4686 "ebtables is an application program used to set up and maintain the
4687tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
4688analogous to the iptables application, but less complicated, due to the fact
4689that the Ethernet protocol is much simpler than the IP protocol.")
4690 (license license:gpl2+)))
4691
4692(define-public iproute
4693 (package
4694 (name "iproute2")
4695 (version "7.0.0")
4696 (source (origin
4697 (method url-fetch)
4698 (uri (string-append
4699 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
4700 version ".tar.xz"))
4701 (sha256
4702 (base32
4703 "0kiggxwnjsglxnj43wqkc0rmq0acxf6xqcgk7ddc0qyynpvr0a76"))))
4704 (build-system gnu-build-system)
4705 (arguments
4706 (list
4707 ;; There is a test suite, but it wants network namespaces and sudo.
4708 #:tests? #f
4709 #:make-flags
4710 #~(let ((out #$output))
4711 (list (string-append "CC=" #$(cc-for-target))
4712 "HOSTCC=gcc"
4713 (string-append "BASH_COMPDIR=" out
4714 "/etc/bash_completion.d")
4715 (string-append "PREFIX=" out)
4716 (string-append "LIBDIR=" out "/lib")
4717 (string-append "HDRDIR=" out "/include")
4718 (string-append "SBINDIR=" out "/sbin")
4719 (string-append "CONFDIR=" out "/etc")
4720 (string-append "MANDIR=" out "/share/man")
4721 #$@(if (target-ppc64le?)
4722 '("CCOPTS=-O2 -pipe -Wno-incompatible-pointer-types")
4723 '())))
4724 #:phases
4725 #~(modify-phases %standard-phases
4726 (replace 'configure
4727 (lambda* (#:key (configure-flags #~'()) #:allow-other-keys)
4728 ;; The configure script does not understand some of the
4729 ;; default options of gnu-build-system.
4730 (setenv "PKG_CONFIG" #$(pkg-config-for-target))
4731 (apply invoke "./configure"
4732 "--prefix" #$output
4733 configure-flags)))
4734 (add-before 'install 'pre-install
4735 (lambda _
4736 ;; Don't attempt to create /var/lib/arpd.
4737 (substitute* "Makefile"
4738 (("^.*ARPDDIR.*$") "")))))))
4739 (inputs
4740 (list bdb iptables libmnl))
4741 (native-inputs
4742 (list bison flex pkg-config))
4743 ;; For tests.
4744 ;; ("libmnl" ,libmnl)
4745 ;; ("util-linux" ,util-linux)
4746 (home-page
4747 "https://wiki.linuxfoundation.org/networking/iproute2")
4748 (synopsis
4749 "Utilities for controlling TCP/IP networking and traffic in Linux")
4750 (description
4751 "Iproute2 is a collection of utilities for controlling TCP/IP networking
4752and traffic with the Linux kernel. The most important of these are
4753@command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
4754control.
4755
4756Most network configuration manuals still refer to ifconfig and route as the
4757primary network configuration tools, but ifconfig is known to behave
4758inadequately in modern network environments, and both should be deprecated.")
4759 (license license:gpl2+)))
4760
4761(define-public net-tools
4762 ;; XXX: This package is basically unmaintained, but it provides a few
4763 ;; commands not yet provided by Inetutils, such as 'route', so we have to
4764 ;; live with it.
4765 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
4766 (revision "0"))
4767 (package
4768 (name "net-tools")
4769 (version (string-append "1.60-" revision "."
4770 (string-take commit 7)))
4771 (source
4772 (origin
4773 (method url-fetch)
4774 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
4775 "n/ne/net-tools/code.git/net-tools-code-" commit
4776 ".zip"))
4777 (file-name (string-append name "-" version ".zip"))
4778 (sha256
4779 (base32 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
4780 (home-page "https://net-tools.sourceforge.net/")
4781 (build-system gnu-build-system)
4782 (arguments
4783 (list
4784 ;; Binaries that depend on libnet-tools.a don't declare that
4785 ;; dependency, making it parallel-unsafe.
4786 #:parallel-build? #f
4787
4788 #:tests? #f ;no test suite
4789 #:make-flags
4790 #~(list #$(string-append "CC=" (cc-for-target))
4791 (string-append "BASEDIR=" #$output)
4792 (string-append "INSTALLNLSDIR=" #$output "/share/locale")
4793 (string-append "mandir=/share/man"))
4794 #:modules `((guix build gnu-build-system)
4795 (guix build utils)
4796 (srfi srfi-1)
4797 (srfi srfi-26))
4798 #:phases
4799 #~(modify-phases %standard-phases
4800 (replace 'configure
4801 (lambda _
4802 (mkdir-p (string-append #$output "/bin"))
4803 (mkdir-p (string-append #$output "/sbin"))
4804
4805 ;; Pretend we have everything...
4806 (system "yes | make config")
4807
4808 ;; ... except for the things we don't have.
4809 ;; HAVE_AFDECnet requires libdnet, which we don't have.
4810 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
4811 ;; that have been removed.
4812 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
4813 ;; think about adding them later.
4814 (substitute* '("config.make" "config.h")
4815 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
4816 ""))))
4817 (add-after 'install 'remove-redundant-commands
4818 (lambda _
4819 ;; Remove commands and man pages redundant with Inetutils.
4820 (for-each delete-file
4821 (append-map (cute find-files #$output <>)
4822 '("^hostname"
4823 "^(yp|nis|dns)?domainname"))))))))
4824 (native-inputs (list gettext-minimal unzip))
4825 (supported-systems (remove target-hurd? %supported-systems))
4826 (synopsis "Tools for controlling the network subsystem in Linux")
4827 (description
4828 "This package includes the important tools for controlling the network
4829subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
4830route. Additionally, this package contains utilities relating to particular
4831network hardware types (plipconfig, slattach) and advanced aspects of IP
4832configuration (iptunnel, ipmaddr).")
4833 (license license:gpl2+))))
4834
4835(define-public libcap
4836 (package
4837 (name "libcap")
4838 (version "2.64")
4839 (source (origin
4840 (method url-fetch)
4841 (uri (string-append
4842 "mirror://kernel.org/linux/libs/security/linux-privs/"
4843 "libcap2/libcap-" version ".tar.xz"))
4844 (sha256
4845 (base32
4846 "04qy0z6yhlljb29xxcb2srbdnymcrhsi28wrc705z3861cgmwin8"))))
4847 (build-system gnu-build-system)
4848 (arguments
4849 (list #:phases
4850 #~(modify-phases %standard-phases
4851 (delete 'configure)
4852 #$@(if (target-ppc32?)
4853 #~((add-after 'unpack 'apply-patch
4854 (lambda _
4855 (let ((patch
4856 #$(local-file
4857 (search-patch
4858 "libcap-magic-glibc-constant.patch"))))
4859 (invoke "patch" "--force" "-p1" "-i" patch)))))
4860 #~()))
4861 #:test-target "test"
4862 #:make-flags
4863 #~(list "lib=lib"
4864 (string-append "prefix=" #$output)
4865 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
4866 "RAISE_SETFCAP=no"
4867 ;; Tell the makefile to use TARGET-gcc and friends
4868 ;; when cross-compiling.
4869 #$@(if (%current-target-system)
4870 `((string-append "CROSS_COMPILE="
4871 ,(%current-target-system) "-")
4872 "BUILD_CC=gcc")
4873 '()))))
4874 (native-inputs (list perl))
4875 (supported-systems (remove target-hurd? %supported-systems))
4876 (home-page "https://sites.google.com/site/fullycapable/")
4877 (synopsis "Library for working with POSIX capabilities")
4878 (description
4879 "Libcap2 provides a programming interface to POSIX capabilities on
4880Linux-based operating systems.")
4881
4882 ;; License is BSD-3 or GPLv2, at the user's choice.
4883 (license (list license:bsd-3 license:gpl2))))
4884
4885(define-public bridge-utils
4886 (package
4887 (name "bridge-utils")
4888 (version "1.7.1")
4889 (source
4890 (origin
4891 (method url-fetch)
4892 (uri (string-append "mirror://kernel.org/linux/utils/net/"
4893 "bridge-utils/bridge-utils-" version ".tar.xz"))
4894 (sha256
4895 (base32 "03p6cmhm6cqhnfsfa1wv7frhb361y12daf7gr1h5qh51y7j8n7d6"))))
4896 (build-system gnu-build-system)
4897
4898 ;; The tarball lacks all the generated files.
4899 (native-inputs (list autoconf automake))
4900 (arguments
4901 '(#:tests? #f)) ; no 'check' target
4902
4903 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
4904 (synopsis "Manipulate Ethernet bridges")
4905 (description
4906 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
4907to connect two Ethernet segments together in a protocol independent way.
4908Packets are forwarded based on Ethernet address, rather than IP address (like
4909a router). Since forwarding is done at Layer 2, all protocols can go
4910transparently through a bridge.")
4911 (license license:gpl2+)))
4912
4913(define-public libnl
4914 (package
4915 (name "libnl")
4916 (version "3.12.0")
4917 (source (origin
4918 (method url-fetch)
4919 (uri (string-append
4920 "https://github.com/thom311/libnl/releases/download/"
4921 "libnl" (string-join (string-split version #\.) "_")
4922 "/libnl-" version ".tar.gz"))
4923 (sha256
4924 (base32
4925 "066xq01y2mx0xi7bwa5y6ciw1ygla15qdlzzyvyzb8zijrqwllgw"))))
4926 (build-system gnu-build-system)
4927 (native-inputs
4928 `(("bison" ,bison)
4929 ("flex" ,flex)
4930 ("pkg-config" ,pkg-config)
4931 ("swig" ,swig-4.0)
4932 ("libnl3-doc"
4933 ,(origin
4934 (method url-fetch)
4935 (uri (string-append
4936 "https://github.com/thom311/libnl/releases/download/libnl"
4937 (string-join (string-split version #\.) "_")
4938 "/libnl-doc-" version ".tar.gz"))
4939 (sha256
4940 (base32 "18f14pdycghy6fcd27faqgh19zpam6b45s8bgsk85kb9wwzq3yd4"))))))
4941 (outputs `("out" "doc"))
4942 (arguments
4943 `(#:phases
4944 (modify-phases %standard-phases
4945 (add-after 'install 'install-doc
4946 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
4947 (let ((dest (string-append (assoc-ref outputs "doc")
4948 "/share/doc/libnl")))
4949 (mkdir-p dest)
4950 (invoke "tar" "xf" (assoc-ref
4951 (or native-inputs inputs)
4952 "libnl3-doc")
4953 "--strip-components=1" "-C" dest)))))))
4954 (home-page "https://www.infradead.org/~tgr/libnl/")
4955 (synopsis "NetLink protocol library suite")
4956 (description
4957 "The libnl suite is a collection of libraries providing APIs to netlink
4958protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
4959between the kernel and user space processes. It was designed to be a more
4960flexible successor to ioctl to provide mainly networking related kernel
4961configuration and monitoring interfaces.")
4962
4963 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
4964 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
4965 (license license:gpl2)))
4966
4967;; libnl python extensions used to be outputs of libnl. However, as
4968;; cross-compiling python extensions is currently broken, create separate
4969;; packages for libnl python extensions.
4970(define (libnl-python-package python)
4971 (let ((name (string-append "libnl-" python)))
4972 (package
4973 (inherit libnl)
4974 (name name)
4975 (outputs '("out"))
4976 (arguments
4977 (list
4978 #:modules `((guix build gnu-build-system)
4979 (guix build utils)
4980 (srfi srfi-1))
4981 #:phases
4982 #~(modify-phases %standard-phases
4983 (replace 'install
4984 (lambda* (#:key inputs #:allow-other-keys)
4985 (define (python-inst python)
4986 (invoke python "setup.py" "build")
4987 (invoke python "setup.py" "install"
4988 (string-append "--prefix=" #$output))
4989 (invoke python "setup.py" "clean"))
4990 (let ((libdir (dirname (search-input-directory inputs
4991 "lib/libnl"))))
4992 (setenv "LDFLAGS" (string-append "-Wl,-rpath=" libdir)))
4993 (with-directory-excursion "./python"
4994 (python-inst #$python)))))))
4995 (inputs
4996 (append (cond
4997 ((string=? python "python2")
4998 (list python-2))
4999 ((string=? python "python3")
5000 (list python-setuptools python-wrapper)))
5001 (list libxcrypt))) ;required by Python.h
5002 (propagated-inputs (list libnl)))))
5003
5004(define-public libnl-python3 (libnl-python-package "python3"))
5005
5006(define-public iw
5007 (package
5008 (name "iw")
5009 (version "5.19")
5010 (source (origin
5011 (method url-fetch)
5012 (uri (string-append
5013 "mirror://kernel.org/software/network/iw/iw-"
5014 version ".tar.xz"))
5015 (sha256
5016 (base32
5017 "0kjdrihc7ibnjdpjqkq8sv0kmmvavgsww78cpjgbnlyx8zlvnrzi"))))
5018 (build-system gnu-build-system)
5019 (native-inputs (list pkg-config))
5020 (inputs (list libnl))
5021 (arguments
5022 (list #:make-flags
5023 #~(list
5024 (string-append "CC=" #$(cc-for-target))
5025 (string-append "PKG_CONFIG=" #$(pkg-config-for-target))
5026 (string-append "PREFIX=" (assoc-ref %outputs "out")))
5027 #:phases
5028 #~(modify-phases %standard-phases
5029 (delete 'configure)))) ; no configure script
5030 (home-page "https://wireless.wiki.kernel.org/")
5031 (synopsis "Tool for configuring wireless devices")
5032 (description
5033 "iw is a new nl80211 based CLI configuration utility for wireless
5034devices. It replaces @code{iwconfig}, which is deprecated.")
5035 (license license:isc)))
5036
5037(define-public powertop
5038 (package
5039 (name "powertop")
5040 (version "2.15")
5041 (source
5042 (origin
5043 (method git-fetch)
5044 (uri (git-reference
5045 (url "https://github.com/fenrus75/powertop")
5046 (commit (string-append "v" version))))
5047 (file-name (git-file-name name version))
5048 (sha256
5049 (base32 "10vbk4vplmzp3p1mhwnhj81g6i5xvam9pdvmiy6cmd0xvnmdyy77"))))
5050 (build-system gnu-build-system)
5051 (arguments
5052 (list
5053 #:configure-flags #~(list "LDFLAGS=-pthread")
5054 #:phases
5055 #~(modify-phases %standard-phases
5056 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
5057 ;; allow calibrating the network interface in Guix System.
5058 (add-after 'unpack 'patch-absolute-file-names
5059 (lambda* (#:key inputs #:allow-other-keys)
5060 (let ((kmod (assoc-ref inputs "kmod")))
5061 ;; Fix for using a more modern gettext.
5062 (substitute* "autogen.sh"
5063 (("autoreconf")
5064 "autoreconf --force"))
5065 (substitute* "configure.ac"
5066 (("^AM_GNU_GETTEXT_VERSION.*$")
5067 (string-append "AM_GNU_GETTEXT_VERSION(["
5068 #$(package-version (this-package-native-input "gettext-minimal"))
5069 "])\n")))
5070 ;; Give the right 'modprobe' file name so that essential
5071 ;; modules such as msr.ko can be loaded.
5072 (substitute* (find-files "src" "\\.cpp$")
5073 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
5074 ;; These programs are only needed to calibrate, so using
5075 ;; relative file names avoids adding extra inputs. When they
5076 ;; are missing powertop gracefully handles it.
5077 (("/usr/s?bin/(hciconfig|hcitool|xset)" _ command)
5078 command
5079 command))))))))
5080 (native-inputs
5081 (list autoconf
5082 autoconf-archive
5083 automake
5084 gettext-minimal
5085 libtool
5086 pkg-config))
5087 (inputs
5088 (list kmod libnl ncurses pciutils zlib))
5089 (home-page "https://01.org/powertop/")
5090 (synopsis "Analyze power consumption on x86-based laptops")
5091 (description
5092 "PowerTOP is a Linux tool to diagnose issues with power consumption and
5093power management. In addition to being a diagnostic tool, PowerTOP also has
5094an interactive mode where the user can experiment various power management
5095settings for cases where the operating system has not enabled these
5096settings.")
5097 (license license:gpl2)))
5098
5099(define-public aumix
5100 (package
5101 (name "aumix")
5102 (version "2.9.1")
5103 (source (origin
5104 (method url-fetch)
5105 (uri (string-append
5106 "https://web.archive.org/web/20211201184543/"
5107 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
5108 version ".tar.bz2"))
5109 (sha256
5110 (base32
5111 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
5112 (build-system gnu-build-system)
5113 (arguments
5114 ;; Allow compilation with GCC 10.
5115 '(#:configure-flags '("CFLAGS=-O2 -g -fcommon")))
5116 (inputs (list ncurses))
5117 (home-page (string-append "https://web.archive.org/web/20211201184543/"
5118 "http://jpj.net/~trevor/aumix.html"))
5119 (synopsis "Audio mixer for X and the console")
5120 (description
5121 "Aumix adjusts an audio mixer from X, the console, a terminal,
5122the command line or a script.")
5123 (license license:gpl2+)))
5124
5125(define-public iotop-python
5126 ;; The last release is from 2013 and gives a misleading CONFIG_TASK_DELAY_ACCT
5127 ;; error on ‘newer’ kernels.
5128 (let ((revision "0")
5129 (commit "a14256a3ff74eeee59493ac088561f1bafab85a7"))
5130 (package
5131 (name "iotop-python")
5132 (version (git-version "0.6" revision commit))
5133 (source
5134 (origin
5135 (method git-fetch)
5136 (uri (git-reference
5137 (url "https://repo.or.cz/iotop.git")
5138 (commit commit)))
5139 (file-name (git-file-name name version))
5140 (sha256
5141 (base32 "00h5p8fk1zi237q8mqds8apqbis9iw0yih1hl0pr63dsnyzmmrpw"))))
5142 (build-system pyproject-build-system)
5143 (arguments
5144 (list
5145 #:tests? #f ; No tests.
5146 #:phases
5147 #~(modify-phases %standard-phases
5148 (add-after 'unpack 'fix-build-with-python3
5149 (lambda _
5150 (substitute* "setup.py"
5151 (("itervalues")
5152 "values")))))))
5153 (native-inputs (list python python-setuptools))
5154 (home-page "http://guichaz.free.fr/iotop/")
5155 (synopsis "Displays the IO activity of running processes")
5156 (description
5157 "Iotop is a Python program with a top like user interface to show the
5158processes currently causing I/O.")
5159 (license license:gpl2+))))
5160
5161(define-public iotop
5162 (package
5163 (name "iotop")
5164 (version "1.31")
5165 (source
5166 (origin
5167 (method git-fetch)
5168 (uri (git-reference
5169 (url "https://github.com/Tomas-M/iotop")
5170 (commit (string-append "v" version))))
5171 (file-name (git-file-name name version))
5172 (sha256
5173 (base32 "19ccdiw3flzk7gki90rc1nifmma79g2l87vhls4d2xr4z763m4nc"))))
5174 (build-system gnu-build-system)
5175 (arguments
5176 (list #:make-flags
5177 #~(list (string-append "CC=" #$(cc-for-target))
5178 (string-append "PREFIX=" #$output))
5179 #:tests? #f ; no tests
5180 #:phases
5181 #~(modify-phases %standard-phases
5182 (delete 'configure)))) ; no configure script
5183 (native-inputs (list pkg-config))
5184 (inputs (list ncurses))
5185 (home-page "https://github.com/Tomas-M/iotop")
5186 (synopsis "Interactive @command{top}-like input/output activity monitor")
5187 (description
5188 "iotop identifies which processes and threads are most responsible for
5189@acronym{I/O, input/output} activity such as disc reads and writes. It sorts
5190them in a live, interactive table overview similar to that of the well-known
5191@command{top}.
5192
5193This information makes it much easier for an administrator to see which tasks
5194are blocking others and adjust their priority (using @command{ionice}) or stop
5195or kill them altogether.")
5196 (license license:gpl2+)))
5197
5198(define-public fuse
5199 (package
5200 (name "fuse")
5201 (version "3.18.1")
5202 (source (origin
5203 (method url-fetch)
5204 (uri
5205 (string-append "https://github.com/libfuse/libfuse/releases/"
5206 "download/fuse-" version
5207 "/fuse-" version ".tar.gz"))
5208 (sha256
5209 (base32
5210 "0b1jp5gp2gv40gv6cvmv86rcr4l0mdh050qbvnxl0xcwya45qffx"))))
5211 (build-system meson-build-system)
5212 (outputs (list "out" "debug" "static"))
5213 (inputs
5214 (list bash-minimal util-linux))
5215 (arguments
5216 `(#:configure-flags
5217 ,#~(list
5218 (string-append "-Dudevrulesdir=" #$output "/udev/rules.d")
5219 "-Duseroot=false"
5220 ;; Build static libraries.
5221 "--default-library=both")
5222 #:tests? #f
5223 #:modules ((guix build meson-build-system)
5224 (guix build utils)
5225 (ice-9 ftw))
5226 #:phases
5227 ,#~(modify-phases %standard-phases
5228 (add-after 'unpack 'set-file-names
5229 (lambda* (#:key inputs #:allow-other-keys)
5230 ;; libfuse calls out to mount(8) and umount(8). Make sure
5231 ;; it refers to the right ones.
5232 (substitute* '("lib/mount_util.c")
5233 (("/bin/(u?)mount" _ maybe-u)
5234 (search-input-file inputs
5235 (string-append "bin/"
5236 maybe-u "mount"))))
5237 (substitute* '("util/mount.fuse.c")
5238 (("/bin/sh")
5239 (search-input-file inputs "/bin/sh")))
5240
5241 ;; This hack leads libfuse to search for 'fusermount' in
5242 ;; $PATH, where it may find a setuid-root binary, instead of
5243 ;; trying solely $out/sbin/fusermount and failing because
5244 ;; it's not setuid.
5245 (substitute* "lib/meson.build"
5246 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
5247 "-DFUSERMOUNT_DIR=\"/var/empty\"'"))))
5248 (add-after 'unpack 'fix-install
5249 (lambda* (#:key inputs #:allow-other-keys)
5250 (substitute* '("util/meson.build")
5251 (("install_helper.sh") "true"))
5252 (substitute* '("util/meson.build")
5253 (("fuseconf_path = .*")
5254 "fuseconf_path = '/etc/fuse.conf'"))))
5255 (add-before 'configure 'set-paths
5256 (lambda* (#:key inputs outputs #:allow-other-keys)
5257 (let ((dummy-init.d
5258 (string-append (getcwd) "/etc/init.d")))
5259 (setenv "MOUNT_FUSE_PATH"
5260 (string-append #$output "/sbin"))
5261 (setenv "UDEV_RULES_PATH"
5262 (string-append #$output
5263 "/lib/udev/rules.d")))))
5264 (add-after 'install 'install-static-libraries
5265 (lambda* (#:key outputs #:allow-other-keys)
5266 (let ((out (assoc-ref outputs "out"))
5267 (static (assoc-ref outputs "static")))
5268 (mkdir-p (string-append static "/lib"))
5269 (for-each
5270 (lambda (static-library)
5271 (rename-file
5272 (string-append out "/lib/" static-library)
5273 (string-append static "/lib/" static-library)))
5274 (scandir (string-append out "/lib")
5275 (lambda (file-name)
5276 (string-suffix? ".a" file-name))))))))))
5277 (supported-systems (remove target-hurd? %supported-systems))
5278 (home-page "https://github.com/libfuse/libfuse")
5279 (synopsis "Support file systems implemented in user space")
5280 (description
5281 "As a consequence of its monolithic design, file system code for Linux
5282normally goes into the kernel itself---which is not only a robustness issue,
5283but also an impediment to system extensibility. FUSE, for \"file systems in
5284user space\", is a kernel module and user-space library that tries to address
5285part of this problem by allowing users to run file system implementations as
5286user-space processes.")
5287 (license (list license:lgpl2.1 ; library
5288 license:gpl2+)))) ; command-line utilities
5289
5290(define-public fuse-2
5291 (package
5292 (inherit fuse)
5293 (name "fuse")
5294 (version "2.9.9")
5295 (source
5296 (origin
5297 (method url-fetch)
5298 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
5299 "download/fuse-" version
5300 "/fuse-" version ".tar.gz"))
5301 (sha256
5302 (base32 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
5303 (patches (search-patches "fuse-overlapping-headers.patch"
5304 "fuse-glibc-2.34.patch"))))
5305 (build-system gnu-build-system)
5306 (native-inputs
5307 (list autoconf automake gettext-minimal libtool))
5308 (arguments
5309 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
5310 (assoc-ref %outputs "out")
5311 "/sbin")
5312 (string-append "INIT_D_PATH="
5313 (assoc-ref %outputs "out")
5314 "/etc/init.d")
5315
5316 ;; The rule makes /dev/fuse 666.
5317 (string-append "UDEV_RULES_PATH="
5318 (assoc-ref %outputs "out")
5319 "/lib/udev/rules.d"))
5320 #:phases
5321 (modify-phases %standard-phases
5322 (add-before 'bootstrap 'force-bootstrap
5323 (lambda _
5324 ;; Force a bootstrap to make the patch changes effective.
5325 (delete-file "configure")))
5326 (add-before 'build 'set-file-names
5327 (lambda* (#:key inputs #:allow-other-keys)
5328 ;; libfuse calls out to mount(8) and umount(8). Make sure
5329 ;; it refers to the right ones.
5330 (substitute* '("lib/mount_util.c" "util/mount_util.c")
5331 (("/bin/(u?)mount" _ maybe-u)
5332 (search-input-file inputs
5333 (string-append "bin/"
5334 maybe-u "mount"))))
5335 (substitute* '("util/mount.fuse.c")
5336 (("/bin/sh")
5337 (search-input-file inputs "/bin/sh")))
5338
5339 ;; This hack leads libfuse to search for 'fusermount' in
5340 ;; $PATH, where it may find a setuid-root binary, instead of
5341 ;; trying solely $out/sbin/fusermount and failing because
5342 ;; it's not setuid.
5343 (substitute* "lib/Makefile"
5344 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
5345 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))))))))
5346
5347(define-public unionfs-fuse
5348 (package
5349 (name "unionfs-fuse")
5350 (version "3.3")
5351 (source (origin
5352 (method git-fetch)
5353 (uri (git-reference
5354 (url "https://github.com/rpodgorny/unionfs-fuse")
5355 (commit (string-append "v" version))))
5356 (file-name (git-file-name name version))
5357 (sha256
5358 (base32
5359 "1wl5m5qnwf3s1792xphr35pb80sx8ybaqi3n3ddi5vvk3qjc4iws"))))
5360 (build-system cmake-build-system)
5361 (arguments
5362 (list
5363 #:phases
5364 #~(modify-phases %standard-phases
5365 (replace 'check
5366 ;; The epitome of ‘I tried’: run the 2 trivial tests that don't rely
5367 ;; on the fuse kernel module being loaded. All others would fail.
5368 (lambda* (#:key tests? #:allow-other-keys)
5369 (when tests?
5370 (invoke "pytest" "../source/test_all.py" "-k" "test_help")))))))
5371 (native-inputs
5372 (list pkg-config
5373
5374 ;; Only for the test ‘suite’.
5375 python
5376 python-pytest))
5377 (inputs
5378 (list fuse))
5379 (home-page "https://github.com/rpodgorny/unionfs-fuse")
5380 (synopsis "User-space union file system")
5381 (description
5382 "UnionFS-FUSE is a flexible union file system implementation in user
5383space, using the FUSE library. Mounting a union file system allows you to
5384\"aggregate\" the contents of several directories into a single mount point.
5385UnionFS-FUSE additionally supports copy-on-write.")
5386 (license license:bsd-3)))
5387
5388(define fuse-static
5389 (package (inherit fuse)
5390 (name "fuse-static")
5391 (source
5392 (origin
5393 (inherit (package-source fuse))
5394 (modules '((guix build utils)))
5395 (snippet
5396 #~(begin
5397 ;; Normally libfuse invokes mount(8) so that /etc/mtab is updated.
5398 ;; Change calls to 'mtab_needs_update' to 0 so that it doesn't do
5399 ;; that, allowing us to remove the dependency on util-linux
5400 ;; (something that is useful in initrds.)
5401 (substitute* "lib/mount_util.c"
5402 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)") "0")
5403 (("/bin/") ""))))))
5404 (arguments
5405 (substitute-keyword-arguments arguments
5406 ((#:configure-flags flags '())
5407 #~(cons "-Ddefault_library=static"
5408 #$flags))))))
5409
5410(define-public unionfs-fuse/static
5411 (package (inherit unionfs-fuse)
5412 (synopsis "User-space union file system (statically linked)")
5413 (name (string-append (package-name unionfs-fuse) "-static"))
5414 (source
5415 (origin
5416 (inherit (package-source unionfs-fuse))
5417 (modules '((guix build utils)))
5418 (snippet
5419 #~(begin
5420 ;; Add -ldl to the libraries, because libfuse.a needs that.
5421 (substitute* "src/CMakeLists.txt"
5422 (("target_link_libraries(.*)\\)" _ libs)
5423 (string-append "target_link_libraries"
5424 libs " dl)")))))))
5425 (arguments
5426 (substitute-keyword-arguments arguments
5427 ((#:configure-flags flags #~'())
5428 #~(cons "-DCMAKE_EXE_LINKER_FLAGS=-static" #$flags))
5429 ((#:phases phases #~%standard-phases)
5430 #~(modify-phases #$phases
5431 (add-after 'install 'post-install
5432 (lambda _
5433 ;; By default, 'unionfs' keeps references to
5434 ;; $glibc/share/locale and similar stuff. Remove them.
5435 (remove-store-references (string-append #$output "/bin/unionfs"))
5436 ;; 'unionfsctl' has references to glibc as well. Since
5437 ;; we don't need it, remove it.
5438 (delete-file (string-append #$output "/bin/unionfsctl"))))))))
5439 (inputs (list fuse-static))))
5440
5441(define-public sshfs
5442 (package
5443 (name "sshfs")
5444 (version "3.7.6")
5445 (source (origin
5446 (method url-fetch)
5447 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
5448 "download/sshfs-" version "/sshfs-" version
5449 ".tar.xz"))
5450 (sha256
5451 (base32
5452 "14sq94g160i56v5sc39wgilxnd6yf661bzxpn6f7w1qa8lqwn6va"))))
5453 (build-system meson-build-system)
5454 (arguments
5455 ;; XXX: tests are skipped: FUSE kernel module does not seem to be loaded
5456 '(#:tests? #f))
5457 (inputs
5458 (list fuse glib))
5459 (native-inputs
5460 (list pkg-config
5461 ;; man page
5462 python-docutils))
5463 (home-page "https://github.com/libfuse/sshfs")
5464 (synopsis "Mount remote file systems over SSH")
5465 (description
5466 "This is a file system client based on the SSH File Transfer Protocol.
5467Since most SSH servers already support this protocol it is very easy to set
5468up: on the server side there's nothing to do; on the client side mounting the
5469file system is as easy as logging into the server with an SSH client.")
5470 (license license:gpl2+)))
5471
5472(define-public archivemount
5473 (package
5474 (name "archivemount")
5475 (version "0.9.1")
5476 (source
5477 (origin
5478 (method url-fetch)
5479 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
5480 "archivemount-" version ".tar.gz"))
5481 (sha256
5482 (base32 "1cy5b6qril9c3ry6fv7ir87s8iyy5vxxmbyx90dm86fbra0vjaf5"))))
5483 (build-system gnu-build-system)
5484 (inputs (list fuse-2 libarchive))
5485 (native-inputs (list pkg-config))
5486 (home-page "https://www.cybernoia.de/software/archivemount.html")
5487 (synopsis "Tool for mounting archive files with FUSE")
5488 (description "archivemount is a FUSE-based file system for Unix variants,
5489including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
5490mount point where it can be read from or written to as with any other file
5491system. This makes accessing the contents of the archive, which may be
5492compressed, transparent to other programs, without decompressing them.")
5493 (license license:lgpl2.0+)))
5494
5495(define-public numactl
5496 (package
5497 (name "numactl")
5498 (version "2.0.16")
5499 (source (origin
5500 (method url-fetch)
5501 (uri (string-append
5502 "https://github.com/numactl/numactl/releases/download/v"
5503 version "/numactl-" version ".tar.gz"))
5504 (sha256
5505 (base32
5506 "1j67wx3383fwqbvhg4nwqf72vpdgimmrvkpn3b9s2xzr7a4jy90v"))))
5507 (build-system gnu-build-system)
5508 (arguments
5509 `(,@(if (target-riscv64?)
5510 `(#:make-flags (list "LDFLAGS=-latomic"))
5511 '())
5512 ;; There's a 'test' target, but it requires NUMA support in the kernel
5513 ;; to run, which we can't assume to have.
5514 #:tests? #f))
5515 (home-page "https://github.com/numactl/numactl")
5516 (synopsis "Tools for non-uniform memory access (NUMA) machines")
5517 (description
5518 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
5519memory is not all in one place. The @command{numactl} program allows you to
5520run your application program on specific CPUs and memory nodes. It does this
5521by supplying a NUMA memory policy to the operating system before running your
5522program.
5523
5524The package contains other commands, such as @command{numastat},
5525@command{memhog}, and @command{numademo} which provides a quick overview of
5526NUMA performance on your system.")
5527 (license (list license:gpl2 ;programs
5528 license:lgpl2.1)))) ;library
5529
5530(define-public kbd-neo
5531 (package
5532 (name "kbd-neo")
5533 (version "2486")
5534 (source
5535 (origin
5536 (method url-fetch)
5537 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
5538 version "/linux/console/neo.map"))
5539 (file-name (string-append name "-" version ".map"))
5540 (sha256
5541 (base32
5542 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
5543 (build-system trivial-build-system)
5544 (arguments
5545 `(#:modules ((guix build utils))
5546 #:builder (begin
5547 (use-modules (guix build utils))
5548 (let ((out (string-append %output "/share/keymaps"))
5549 (source (assoc-ref %build-inputs "source")))
5550 (mkdir-p out)
5551 (copy-file source (string-append out "/neo.map"))
5552 #t))))
5553 (home-page "https://neo-layout.org")
5554 (synopsis "Neo2 console layout")
5555 (description
5556 "Kbd-neo provides the Neo2 keyboard layout for use with
5557@command{loadkeys(1)} from @code{kbd(4)}.")
5558 ;; The file is located in an svn directory, the entire content of
5559 ;; the directory is licensed as GPL3.
5560 (license license:gpl3+)))
5561
5562(define-public kbd
5563 (package
5564 (name "kbd")
5565 (version "2.5.1")
5566 (source
5567 (origin
5568 (method url-fetch)
5569 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-" version
5570 ".tar.xz"))
5571 (sha256
5572 (base32 "10s608i4blprgy9nynlid0hglfdrrgln6wwjs9rhjf56hwilbpyc"))
5573 (modules '((guix build utils)))
5574 (snippet
5575 '(begin
5576 (substitute* '("src/unicode_start" "src/unicode_stop")
5577 ;; Assume the Coreutils are in $PATH.
5578 (("/usr/bin/tty")
5579 "tty"))))))
5580 (build-system gnu-build-system)
5581 (arguments
5582 (list
5583 #:phases
5584 #~(modify-phases %standard-phases
5585 (add-before 'build 'pre-build
5586 (lambda* (#:key inputs #:allow-other-keys)
5587 (substitute* "src/libkbdfile/kbdfile.c"
5588 (("bzip2")
5589 (search-input-file inputs "/bin/bzip2"))
5590 (("gzip")
5591 (search-input-file inputs "/bin/gzip"))
5592 (("xz -d")
5593 (string-append (search-input-file inputs "/bin/xz") " -d"))
5594 (("zstd")
5595 (search-input-file inputs "/bin/zstd")))))
5596 (add-after 'install 'post-install
5597 (lambda _
5598 ;; Make sure these programs find their comrades.
5599 (let ((bin (string-append #$output "/bin")))
5600 (for-each (lambda (prog)
5601 (wrap-program (string-append bin "/" prog)
5602 `("PATH" ":" prefix (,bin))))
5603 '("unicode_start" "unicode_stop"))))))))
5604 (native-inputs (list autoconf pkg-config))
5605 (inputs
5606 (list bash-minimal
5607 ;; for wrap-program
5608 bzip2
5609 gzip
5610 linux-pam
5611 xz
5612 zstd))
5613 (native-search-paths
5614 (list (search-path-specification
5615 (variable "LOADKEYS_KEYMAP_PATH")
5616 ;; Append ‘/**’ to recursively search all directories. One can then
5617 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
5618 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
5619 (files (list "share/keymaps/**")))))
5620 (home-page "https://kbd-project.org/")
5621 (synopsis "Linux keyboard utilities and keyboard maps")
5622 (description
5623 "This package contains keytable files and keyboard utilities compatible
5624for systems using the Linux kernel. This includes commands such as
5625@code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
5626 (license license:gpl2+)))
5627
5628(define-public loadkeys-static
5629 (package
5630 (inherit kbd)
5631 (name "loadkeys-static")
5632 (arguments
5633 (substitute-keyword-arguments arguments
5634 ((#:configure-flags flags #~(list))
5635 #~(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
5636 "--disable-vlock" ;so we don't need libpam
5637 "--disable-libkeymap")
5638 #$flags))
5639 ((#:make-flags flags #~(list))
5640 #~(cons "LDFLAGS=-all-static -lrt -lpthread" #$flags))
5641 ((#:phases phases #~%standard-phases)
5642 #~(modify-phases #$phases
5643 (replace 'install
5644 (lambda _
5645 ;; The binary keeps references to gzip, among other things,
5646 ;; which we don't need in the initrd, so strip references.
5647 (remove-store-references "src/loadkeys")
5648
5649 (install-file "src/loadkeys"
5650 (string-append #$output "/bin"))))
5651 (delete 'post-install)))
5652 ((#:strip-flags _ #~(list))
5653 #~(list "--strip-all"))
5654 ((#:allowed-references _ '())
5655 '())))
5656
5657 (synopsis "Statically-linked @command{loadkeys} program")
5658
5659 ;; This package is meant to be used internally in the initrd so don't
5660 ;; expose it.
5661 (properties '((hidden? . #t)))))
5662
5663(define-public inotify-tools
5664 (package
5665 (name "inotify-tools")
5666 (version "3.22.6.0")
5667 (source (origin
5668 (method git-fetch)
5669 (uri (git-reference
5670 (url "https://github.com/rvoicilas/inotify-tools")
5671 (commit version)))
5672 (file-name (git-file-name name version))
5673 (sha256
5674 (base32
5675 "1j9j8k5zjp8m4cl53zjncnll9z4dnvzr4ygmfcjk0ci81i59b18i"))))
5676 (build-system gnu-build-system)
5677 (native-inputs
5678 (list autoconf automake libtool))
5679 (arguments
5680 `(#:configure-flags
5681 (list "--disable-static")))
5682 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
5683 (synopsis "Monitor file accesses")
5684 (description
5685 "The inotify-tools packages provides a C library and command-line tools
5686to use Linux' inotify mechanism, which allows file accesses to be monitored.")
5687 (license license:gpl2+)))
5688
5689(define-public kmod
5690 (package
5691 (name "kmod")
5692 (version "29")
5693 (source (origin
5694 (method url-fetch)
5695 (uri
5696 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
5697 "kmod-" version ".tar.xz"))
5698 (sha256
5699 (base32
5700 "0am54mi5rk72g5q7k6l6f36gw3r9vwgjmyna43ywcjhqmakyx00b"))
5701 (patches (search-patches "kmod-module-directory.patch"))))
5702 (build-system gnu-build-system)
5703 (arguments
5704 (list #:configure-flags #~(list "--with-xz" "--with-zlib" "--with-zstd"
5705 "--disable-test-modules")
5706 #:phases
5707 #~(modify-phases %standard-phases
5708 (add-after 'unpack 'disable-tests
5709 (lambda _
5710 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
5711 (substitute* "Makefile.in"
5712 (("testsuite/test-modprobe") "")
5713 (("testsuite/test-depmod") "")
5714 (("testsuite/test-blacklist") ""))))
5715 (add-after 'install 'install-modprobe&co
5716 (lambda _
5717 (for-each (lambda (tool)
5718 (symlink "kmod"
5719 (string-append #$output "/bin/" tool)))
5720 '("insmod" "rmmod" "lsmod" "modprobe"
5721 "modinfo" "depmod")))))))
5722 (native-inputs (list pkg-config zstd)) ;zstd needed for tests
5723 (inputs (list xz zlib `(,zstd "lib")))
5724 (supported-systems (remove target-hurd? %supported-systems))
5725 (home-page "https://www.kernel.org/")
5726 (synopsis "Kernel module tools")
5727 (description "Kmod is a set of tools to handle common tasks with Linux
5728kernel modules like insert, remove, list, check properties, resolve
5729dependencies and aliases.
5730
5731These tools are designed on top of libkmod, a library that is shipped with
5732kmod. The aim is to be compatible with tools, configurations and indices
5733from the module-init-tools project.")
5734 (license license:gpl2+))) ; library under lgpl2.1+
5735
5736(define-public earlyoom
5737 (package
5738 (name "earlyoom")
5739 (version "1.9.0")
5740 (source (origin
5741 (method git-fetch)
5742 (uri (git-reference
5743 (url "https://github.com/rfjakob/earlyoom")
5744 (commit (string-append "v" version))))
5745 (file-name (git-file-name name version))
5746 (sha256
5747 (base32
5748 "107d2vgdlkqm8ggacxn1biamganvqz29nhi0zbn7yhmfmzvs1mbq"))))
5749 (build-system gnu-build-system)
5750 (arguments
5751 (list
5752 #:imported-modules %go-build-system-modules
5753 #:modules '((guix build gnu-build-system)
5754 ((guix build go-build-system) #:prefix go:)
5755 (guix build union)
5756 (guix build utils))
5757 #:phases
5758 #~(modify-phases %standard-phases
5759 (delete 'configure) ; no configure script
5760 (add-before 'build 'setup-go-environment
5761 (assoc-ref go:%standard-phases 'setup-go-environment))
5762 (add-before 'check 'set-go-HOME
5763 (lambda _
5764 (setenv "HOME" (getcwd))))
5765 (add-before 'check 'disable-failing-test
5766 (lambda _
5767 ;; This test relies on writing to /proc/%d/oom_score_adj.
5768 (substitute* "Makefile"
5769 (("go test -v" match)
5770 (string-append match " -vet=off -skip 'TestI'"))))))
5771 #:make-flags
5772 #~(list (string-append "CC=" #$(cc-for-target))
5773 (string-append "VERSION=v" #$version)
5774 (string-append "PREFIX=" #$output)
5775 (string-append "SYSCONFDIR=" #$output "/etc")
5776 ;; Do not try installing systemd files to /etc/systemd.
5777 "SYSTEMDUNITDIR=/tmp/dummy")
5778 #:test-target "test"))
5779 (native-inputs
5780 (append
5781 ;; To generate the manpage.
5782 (if (or (target-x86-64?) (target-x86-32?))
5783 (list pandoc)
5784 '())
5785 (list
5786 ;; For the test suite.
5787 cppcheck
5788 go
5789 go-github-com-c9s-goprocinfo)))
5790 (home-page "https://github.com/rfjakob/earlyoom")
5791 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
5792 (description "Early OOM is a minimalist out of memory (OOM) daemon that
5793runs in user space and provides a more responsive and configurable alternative
5794to the in-kernel OOM killer.")
5795 (license license:expat)))
5796
5797(define-public eudev
5798 (package
5799 (name "eudev")
5800 (version "3.2.14")
5801 (source (origin
5802 (method git-fetch)
5803 (uri (git-reference (url "https://github.com/eudev-project/eudev")
5804 (commit (string-append "v" version))))
5805 (file-name (git-file-name name version))
5806 (sha256
5807 (base32
5808 "1f6lz57igi7iw2ls3fpzgw42bfznam4nf9368h7x8yf1mb737yxz"))))
5809 (build-system gnu-build-system)
5810 (arguments
5811 (list
5812 ;; The binary should be built to look for its rules under
5813 ;; /etc/udev/rules.d, which is where the udev-shepherd-service keeps
5814 ;; them.
5815 #:make-flags #~(list "udevrulesdir=/etc/udev/rules.d")
5816 #:phases
5817 #~(modify-phases %standard-phases
5818 (add-before 'bootstrap 'patch-file-names
5819 (lambda* (#:key inputs native-inputs #:allow-other-keys)
5820 (substitute* "man/make.sh"
5821 (("/usr/bin/xsltproc")
5822 (search-input-file (or native-inputs inputs) "/bin/xsltproc")))))
5823 (add-before 'bootstrap 'install-in-lib
5824 (lambda _
5825 ;; When the udev-service-type instantiates /etc, it collects
5826 ;; hardware files from the <package>/lib/udev/hwdb.d directories
5827 ;; of different packages. Since we set sysconfdir to /etc, the
5828 ;; only package-dependent location we can install hwdb files is
5829 ;; in <package>/lib/udev/hwdb.d. Eudev is configured to install
5830 ;; these files in sysconfdir, but they should be placed into
5831 ;; udevlibexecdir.
5832 (copy-file "hwdb/Makefile.am" "hwdb/files.am")
5833 (call-with-output-file "hwdb/Makefile.am"
5834 (lambda (port)
5835 (format port "hardwarelibdir = $(udevlibexecdir)/hwdb.d\n")
5836 (format port "include ./files.am")))
5837 (substitute* "hwdb/files.am"
5838 (("dist_udevhwdb_DATA =")
5839 "dist_hardwarelib_DATA ="))
5840 ;; Do not install the empty udev.conf template.
5841 (substitute* "src/udev/Makefile.am"
5842 (("dist_udevconf_DATA =")
5843 "dist_noinst_DATA ="))
5844 ;; Do not ensure that /etc/udev/rules.d exists.
5845 (substitute* "rules/Makefile.am"
5846 (("\\$\\(MKDIR_P\\) \\$\\(DESTDIR\\)\\$\\(udevconfdir\\)/rules\\.d")
5847 "true"))))
5848 (add-after 'install 'move-static-library
5849 (lambda _
5850 (let ((source (string-append #$output "/lib/libudev.a"))
5851 (target (string-append #$output:static "/lib/libudev.a")))
5852 (mkdir-p (dirname target))
5853 (link source target)
5854 (delete-file source)
5855 ;; Remove reference to the static library from the .la file
5856 ;; such that Libtool looks for it in the usual places.
5857 (substitute* (string-append #$output "/lib/libudev.la")
5858 (("old_library=.*")
5859 "old_library=''\n")))))
5860 (replace 'install
5861 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
5862 ;; Although the runtime udevrulesdir is set to
5863 ;; /etc/udev/rules.d, the package should provide its default
5864 ;; rules under $libdir/udev/rules.d.
5865 (let* ((default-udev-rules.d (string-append #$output
5866 "/lib/udev/rules.d"))
5867 (make-flags (cons (string-append "udevrulesdir="
5868 default-udev-rules.d)
5869 (delete "udevrulesdir=/etc/udev/rules.d"
5870 make-flags))))
5871 (apply (assoc-ref %standard-phases 'install)
5872 `(,@args #:make-flags ,make-flags))))))
5873 #:configure-flags
5874 #~(list "--enable-manpages"
5875 ;; By default, autoconf uses $prefix/etc. The udev-service-type
5876 ;; makes sure /etc is set up with rules and hardware file
5877 ;; descriptions.
5878 "--sysconfdir=/etc")))
5879 (native-search-paths
5880 (list (search-path-specification
5881 (variable "UDEV_HWDB_PATH")
5882 (files '("lib/udev/hwdb.d")))))
5883 (native-inputs
5884 (list autoconf
5885 automake
5886 gperf
5887 libtool
5888 pkg-config
5889 ;; For tests.
5890 perl
5891 python-wrapper
5892 ;; For documentation.
5893 docbook-xml-4.2
5894 docbook-xsl
5895 libxslt))
5896 (inputs
5897 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
5898 ;; and similar; it also installs the '60-persistent-storage.rules' file,
5899 ;; which contains the rules to do that.
5900 (list `(,util-linux "lib") ;for blkid
5901 kmod))
5902 (outputs '("out" "static"))
5903 (home-page "https://github.com/eudev-project/eudev")
5904 (synopsis "Userspace device management")
5905 (description "Udev is a daemon which dynamically creates and removes
5906device nodes from /dev/, handles hotplug events and loads drivers at boot
5907time.")
5908 (license license:gpl2+)))
5909
5910(define-public python-evdev
5911 (package
5912 (name "python-evdev")
5913 (version "1.9.1")
5914 (source
5915 (origin
5916 (method git-fetch) ; no tests data in PyPi package
5917 (uri (git-reference
5918 (url "https://github.com/gvalkov/python-evdev")
5919 (commit (string-append "v" version))))
5920 (file-name (git-file-name name version))
5921 (sha256
5922 (base32 "09p7pj0xhv23hqlpx865klrxrf7x6sw1bdsgs6pq900jvz92pl16"))))
5923 (build-system pyproject-build-system)
5924 (arguments
5925 (list
5926 #:test-flags
5927 ;; Silent tests requiring access to /dev/uinput.
5928 #~(list "-k" (string-append "not test_open"
5929 " and not test_open_context"
5930 " and not test_enable_events"
5931 " and not test_abs_values"
5932 " and not test_write"))
5933 #:phases
5934 #~(modify-phases %standard-phases
5935 (add-before 'build 'fix-hard-coded-directory
5936 (lambda* (#:key inputs #:allow-other-keys)
5937 (substitute* "setup.py"
5938 (("/usr/include/linux")
5939 (string-append
5940 (assoc-ref inputs "kernel-headers") "/include/linux"))))))))
5941 (native-inputs
5942 (list python-pytest python-setuptools python-wheel))
5943 (home-page "https://github.com/gvalkov/python-evdev")
5944 (synopsis "Bindings to the Linux input handling subsystem")
5945 (description
5946 "Python-evdev provides bindings to the generic input event interface in
5947Linux. The @code{evdev} interface serves the purpose of passing events
5948generated in the kernel directly to userspace through character devices that
5949are typically located in @file{/dev/input/}.
5950
5951This package also comes with bindings to @code{uinput}, the userspace input
5952subsystem. @code{uinput} allows userspace programs to create and handle input
5953devices that can inject events directly into the input subsystem.")
5954 (license license:bsd-3)))
5955
5956(define-public interception-tools
5957 (package
5958 (name "interception-tools")
5959 (version "0.6.8")
5960 (home-page "https://gitlab.com/interception/linux/tools")
5961 (source (origin
5962 (method git-fetch)
5963 (uri (git-reference
5964 (url home-page)
5965 (commit (string-append "v" version))))
5966 (file-name (git-file-name name version))
5967 (sha256
5968 (base32
5969 "1sbidym6ld4c8cx2ww5i54zsv8v0kygv15zq1yimz44v4my605wf"))))
5970 (build-system cmake-build-system)
5971 (native-inputs
5972 (list pkg-config))
5973 (inputs
5974 (list boost libevdev eudev yaml-cpp))
5975 (arguments
5976 `(#:tests? #f)) ; no test suite
5977 (synopsis "Utilities for operating on input events of evdev devices")
5978 (description
5979 "Interception Tools provides a composable infrastructure on top of
5980@code{libudev} and @code{libevdev}. The following utilities are provided:
5981
5982@itemize
5983@item @command{udevmon} --- monitor input devices for launching tasks
5984@item @command{intercept} --- redirect device input events to stdout
5985@item @command{uinput} --- redirect device input events from stding to virtual device
5986@item @command{mux} --- mux streams of input events
5987@end itemize")
5988 ;; Dual-licensed under GPLv3+ or "something else" on request, per
5989 ;; 'README.md'.
5990 (license license:gpl3+)))
5991
5992(define-public interception-dual-function-keys
5993 (package
5994 (name "interception-dual-function-keys")
5995 (version "1.5.0")
5996 (home-page "https://gitlab.com/interception/linux/plugins/dual-function-keys")
5997 (source (origin
5998 (method git-fetch)
5999 (uri (git-reference
6000 (url home-page)
6001 (commit version)))
6002 (file-name (git-file-name name version))
6003 (sha256
6004 (base32
6005 "17jc02wh45yk427qryb0ydyim16607i31wyghbsahahd6mrh9ylv"))))
6006 (build-system gnu-build-system)
6007 (inputs
6008 (list libevdev yaml-cpp))
6009 (arguments
6010 `(#:make-flags (list ,(string-append "CC=" (cc-for-target))
6011 ,(string-append "CXX=" (cxx-for-target))
6012 (string-append "PREFIX=" %output))
6013 #:phases
6014 (modify-phases %standard-phases
6015 (add-after 'unpack 'fix-libevdev-path
6016 (lambda* (#:key inputs #:allow-other-keys)
6017 (let ((libevdev (assoc-ref inputs "libevdev")))
6018 (substitute* "config.mk"
6019 (("/usr/include/libevdev-1.0")
6020 (string-append libevdev "/include/libevdev-1.0")))
6021 #t)))
6022 ;; No configure script
6023 (delete 'configure))
6024 ;; No tests are included.
6025 #:tests? #f))
6026 (synopsis "Tap for one key, hold for another")
6027 (description
6028 "Dual Function Keys is a plugin for @code{interception-tools} that allows
6029one to send arbitrary keycodes when a given key is tapped or held.")
6030 (license license:expat)))
6031
6032(define-public lvm2
6033 (package
6034 (name "lvm2")
6035 (version "2.03.22")
6036 (source (origin
6037 (method url-fetch)
6038 (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2."
6039 version ".tgz")
6040 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
6041 version ".tgz")))
6042 (sha256
6043 (base32
6044 "0z6w6bknhwh1n3qfkb5ij6x57q3wjf28lq3l8kh7rkhsplinjnjc"))
6045 (patches (search-patches "lvm2-no-systemd.patch"))
6046 (modules '((guix build utils)))
6047 (snippet
6048 '(begin
6049 (use-modules (guix build utils))
6050
6051 ;; Honor sysconfdir.
6052 (substitute* "make.tmpl.in"
6053 (("^confdir = .*$")
6054 "confdir = @sysconfdir@\n")
6055 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
6056 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
6057 (build-system gnu-build-system)
6058 (arguments
6059 (list
6060 #:tests? #f ;The tests use 'mknod', which requires root access.
6061 #:configure-flags
6062 #~(list (string-append "--sysconfdir=" #$output "/etc/lvm")
6063 "--enable-udev_sync"
6064 "--enable-udev_rules"
6065 "--enable-pkgconfig"
6066 "--enable-cmdlib"
6067 "--enable-dmeventd" ;Requires '--enable-cmdlib'.
6068 ;; Make sure programs such as 'dmsetup' can
6069 ;; find libdevmapper.so.
6070 (string-append "LDFLAGS=-Wl,-rpath="
6071 #$output "/lib,-rpath="
6072 #$output "/lib/device-mapper")
6073 ;; This is needed when cross-compiling.
6074 #$@(if (%current-target-system)
6075 '("ac_cv_func_malloc_0_nonnull=yes"
6076 "ac_cv_func_realloc_0_nonnull=yes")
6077 '()))
6078 #:phases
6079 #~(modify-phases %standard-phases
6080 (add-after 'unpack 'update-config
6081 (lambda* (#:key inputs native-inputs #:allow-other-keys)
6082 (install-file (search-input-file (or native-inputs inputs)
6083 "/bin/config.sub")
6084 "autoconf")
6085 (install-file (search-input-file (or native-inputs inputs)
6086 "/bin/config.guess")
6087 "autoconf")))
6088 (add-after 'configure 'set-makefile-shell
6089 (lambda _
6090 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
6091 ;; expected.
6092 (setenv "SHELL" (which "sh"))
6093
6094 ;; Replace /bin/sh with the right file name.
6095 (patch-makefile-SHELL "make.tmpl"))))))
6096 (native-inputs (list config pkg-config procps)) ;tests use 'pgrep'
6097 (inputs (list libaio eudev))
6098 (supported-systems (remove target-hurd? %supported-systems))
6099 (home-page "https://sourceware.org/lvm2/")
6100 (synopsis "Logical volume management for Linux")
6101 (description
6102 "LVM2 is the logical volume management tool set for Linux-based systems.
6103This package includes the user-space libraries and tools, including the device
6104mapper. Kernel components are part of Linux-libre.")
6105
6106 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
6107 ;; Command-line tools are GPLv2.
6108 (license (list license:gpl2 license:lgpl2.1))))
6109
6110(define-public (libdevmapper-propagated-inputs)
6111 (list eudev))
6112
6113(define-public lvm2-static
6114 (package
6115 (inherit lvm2)
6116 (name "lvm2-static")
6117 (arguments
6118 (substitute-keyword-arguments arguments
6119 ((#:configure-flags flags #~(list))
6120 ;; LVM2 doesn't use Libtool, hence the custom option.
6121 #~(append (list "--enable-static_link")
6122 ;; Building dmeventd statically is complicated due to a
6123 ;; requirement on libdevmapper.a, which is being phased out
6124 ;; in favor of libdevice-mapper.a, which in turn is is not
6125 ;; easily made available at dmeventd build time. Just ignore
6126 ;; it until the situation improves.
6127 (delete "--enable-dmeventd" #$flags)))
6128 ((#:phases phases)
6129 #~(modify-phases #$phases
6130 (add-before 'configure 'adjust-Makefile
6131 (lambda _
6132 ;; These fixes are related to the upstream libdm->device_mapper
6133 ;; migration and will hopefully be fixed upstream in due time.
6134 (substitute* "tools/Makefile.in"
6135 ;; This variable is empty in a static configuration and causes
6136 ;; an erroneous GCC command line.
6137 (("-L\\$\\(interfacebuilddir\\)") "")
6138 ;; Remove obsolete reference to libdevmapper.a.
6139 (("-ldevmapper")
6140 ""))))
6141 (add-after 'install 'adjust-pkgconfig
6142 ;; The static eudev is missing its pkg config file, and I am not
6143 ;; rebuilding it at this point.
6144 (lambda* (#:key inputs #:allow-other-keys)
6145 (substitute* (string-append #$output
6146 "/lib/pkgconfig/devmapper.pc")
6147 (("Requires.private: .*")
6148 "")
6149 (("Libs.private:")
6150 (format #f "Libs.private: -L~a -ludev"
6151 (dirname
6152 (search-input-file inputs
6153 "lib/libudev.a")))))))))))
6154 (inputs (modify-inputs inputs
6155 (append (list eudev "static"))))
6156 (synopsis "Logical volume management for Linux (statically linked)")))
6157
6158(define-public thin-provisioning-tools
6159 (package
6160 (name "thin-provisioning-tools")
6161 (version "0.8.5")
6162 (source
6163 (origin
6164 (method git-fetch)
6165 (uri (git-reference
6166 (url "https://github.com/jthornber/thin-provisioning-tools")
6167 (commit (string-append "v" version))))
6168 (file-name (git-file-name name version))
6169 (sha256
6170 (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19"))))
6171 (build-system gnu-build-system)
6172 (arguments
6173 ;; Doesn't build with --enable-testing due to a function name collision
6174 ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released.
6175 (list #:tests? #f))
6176 (native-inputs (list autoconf automake))
6177 (inputs (list boost expat libaio))
6178 (synopsis "Tools for manipulating the metadata of device-mapper targets")
6179 (description "A suite of tools for manipulating the metadata of the
6180dm-thin, dm-cache and dm-era device-mapper targets.")
6181 (home-page "https://github.com/jthornber/thin-provisioning-tools")
6182 (license license:gpl3+)))
6183
6184(define-public watchdogd
6185 (package
6186 (name "watchdogd")
6187 (version "4.1")
6188 (source (origin
6189 (method git-fetch)
6190 (uri (git-reference
6191 (url "https://github.com/troglobit/watchdogd")
6192 (commit version)))
6193 (file-name (git-file-name name version))
6194 (sha256
6195 (base32
6196 "1n5xq5gxrj8b8j2g323k0jpxabjnq9piw8v2fqcyphj33kmgay23"))))
6197 (build-system gnu-build-system)
6198 (native-inputs (list autoconf automake libtool pkg-config))
6199 (inputs (list libconfuse libite libuev))
6200 (synopsis "Advanced system & process supervisor for Linux")
6201 (description "This package provides an advanced monitor of critical system
6202resources, supervises the heartbeat of processes, records deadline
6203transgressions, and initiates a controlled reset if needed.")
6204 (home-page "https://troglobit.com/projects/watchdogd/")
6205 (license license:isc)))
6206
6207(define-public wireless-tools
6208 (package
6209 (name "wireless-tools")
6210 (version "30.pre9")
6211 (source
6212 (origin
6213 (method url-fetch)
6214 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/"
6215 "Linux/wireless_tools." version ".tar.gz"))
6216 (sha256
6217 (base32 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
6218 (snippet
6219 #~(begin
6220 ;; Remove the older header files that are not free software.
6221 (for-each (lambda (n)
6222 (delete-file (format #f "wireless.~a.h" n)))
6223 '(10 11 12 13 14 15 16 17 18 19 20))))))
6224 (build-system gnu-build-system)
6225 (arguments
6226 (list #:make-flags
6227 #~(list (string-append "PREFIX=" #$output)
6228 (string-append "INSTALL_MAN=" #$output "/share/man")
6229 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
6230 "BUILD_STATIC=")
6231 #:phases
6232 #~(modify-phases %standard-phases
6233 (replace 'configure
6234 (lambda* (#:key target #:allow-other-keys)
6235 (when target
6236 ;; Cross-compilation: use the cross tools.
6237 (substitute* (find-files "." "Makefile")
6238 (("CC = .*$")
6239 (string-append "CC = " target "-gcc\n"))
6240 (("AR = .*$")
6241 (string-append "AR = " target "-ar\n"))
6242 (("RANLIB = .*$")
6243 (string-append "RANLIB = " target "-ranlib\n")))))))
6244 #:tests? #f))
6245 (synopsis "Tools for manipulating Linux Wireless Extensions")
6246 (description "Wireless Tools are used to manipulate the now-deprecated
6247Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
6248Extension was an interface allowing you to set Wireless LAN specific
6249parameters and get the specific stats. It is deprecated in favor the nl80211
6250interface.")
6251 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
6252 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
6253 ;; other files are distributed under gpl2.
6254 (license (list license:gpl2 license:lgpl2.1+))))
6255
6256(define-public crda
6257 (package
6258 (name "crda")
6259 (version "4.15")
6260 (source
6261 (origin
6262 (method git-fetch)
6263 (uri (git-reference
6264 (url "https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/crda.git")
6265 (commit (string-append "v" version))))
6266 (file-name (git-file-name name version))
6267 (sha256
6268 (base32 "1ajh8zx84p15y9wawh764zawniwn059iw9m32v56ajvkz9xbnkp2"))
6269 (patches (search-patches "crda-optional-gcrypt.patch"))))
6270 (build-system gnu-build-system)
6271 (arguments
6272 (list #:phases
6273 #~(modify-phases %standard-phases
6274 (delete 'configure)
6275 (add-after 'unpack 'gzip-deterministically
6276 (lambda _
6277 (substitute* "Makefile"
6278 (("gzip" command)
6279 (string-append command " --no-name")))))
6280 #$@(if (%current-target-system)
6281 #~((add-after 'unpack 'fix-pkg-config
6282 (lambda* (#:key target #:allow-other-keys)
6283 (substitute* "Makefile"
6284 (("pkg-config" command)
6285 (string-append target "-" command))))))
6286 #~())
6287 (add-before 'build 'patch-Makefile
6288 (lambda _
6289 (substitute* "Makefile"
6290 (("ldconfig") "true"))))
6291 (add-before 'build 'set-regulatory-db-file-name
6292 (lambda* (#:key native-inputs inputs #:allow-other-keys)
6293 ;; Tell CRDA where to find our database.
6294 (let ((regdb (assoc-ref (or native-inputs inputs)
6295 "wireless-regdb")))
6296 (substitute* "crda.c"
6297 (("\"/lib/crda/regulatory.bin\"")
6298 (string-append "\"" regdb
6299 "/lib/crda/regulatory.bin\"")))))))
6300 #:test-target "verify"
6301 #:make-flags
6302 #~(list
6303 (string-append "CC=" #$(cc-for-target))
6304 "V=1"
6305
6306 ;; Disable signature-checking on 'regulatory.bin'.
6307 ;; The reason is that this simplifies maintenance
6308 ;; on our side (no need to manage a distro key
6309 ;; pair), and we can guarantee integrity of
6310 ;; 'regulatory.bin' by other means anyway, such as
6311 ;; 'guix gc --verify'. See
6312 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
6313 ;; for a discssion.
6314 "USE_OPENSSL=0"
6315
6316 (string-append "PREFIX=" #$output)
6317 (string-append "SBINDIR=" #$output "/sbin/")
6318 (string-append "UDEV_RULE_DIR="
6319 #$output "/lib/udev/rules.d")
6320 (string-append "LDFLAGS=-Wl,-rpath="
6321 #$output "/lib -L.")
6322 (string-append "REG_BIN="
6323 #$(this-package-native-input "wireless-regdb")
6324 "/lib/crda/regulatory.bin")
6325 "all_noverify")))
6326 (native-inputs (list pkg-config wireless-regdb))
6327 (inputs (list libnl))
6328 (home-page
6329 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
6330 (synopsis "@acronym{CRDA, Central Regulatory Domain Agent} for WiFi")
6331 (description
6332 "The @acronym{CRDA, Central Regulatory Domain Agent} acts as the udev
6333helper for communication between the kernel Linux and user space for regulatory
6334compliance.")
6335 (license license:copyleft-next)))
6336
6337(define-public wireless-regdb
6338 (package
6339 (name "wireless-regdb")
6340 (version "2026.09.03")
6341 (source (origin
6342 (method url-fetch)
6343 (uri (string-append
6344 "mirror://kernel.org/software/network/wireless-regdb/"
6345 "wireless-regdb-" version ".tar.xz"))
6346 (sha256
6347 (base32 "13gmrcsbnkp98b20vqd50d8klxsvl60ydaw0qb8hr0kv480hjbmj"))
6348 ;; We're building 'regulatory.bin' and 'regulatory.db' by
6349 ;; ourselves.
6350 (snippet '(begin
6351 (map delete-file '("regulatory.bin"
6352 "regulatory.db"))))))
6353 (build-system gnu-build-system)
6354 (arguments
6355 (list
6356 #:phases
6357 #~(modify-phases %standard-phases
6358 (add-after 'unpack 'gzip-determinism
6359 (lambda _
6360 (substitute* "Makefile"
6361 (("gzip") "gzip --no-name"))))
6362 (replace 'build
6363 (lambda* (#:key (make-flags '()) #:allow-other-keys)
6364 (apply invoke "make" "regulatory.db" make-flags)))
6365 (add-after 'build 'build-regulatory.bin-unsigned
6366 (lambda* (#:key (make-flags '()) #:allow-other-keys)
6367 (apply invoke "make" "regulatory.bin"
6368 (cons*
6369 ;; Leave this empty so that db2bin.py doesn't try to sign
6370 ;; ‘regulatory.bin’. This allows us to avoid managing a key
6371 ;; pair for the whole distribution.
6372 "REGDB_PRIVKEY="
6373 ;; Don't generate a public key for the same reason. These are
6374 ;; used as Makefile targets and can't be the empty string.
6375 "REGDB_PUBCERT=/dev/null"
6376 "REGDB_PUBKEY=/dev/null"
6377 make-flags))))
6378 ;; We check if the 'regulatory.db' we just built is the same as the
6379 ;; one that got signed by upstream.
6380 (replace 'check
6381 (lambda _
6382 (invoke "openssl" "smime"
6383 "-verify" "-inform" "DER"
6384 "-signer" "wens.x509.pem"
6385 "-in" "regulatory.db.p7s" "-content" "regulatory.db"
6386 "-out" "/dev/null"
6387 "-CAfile" "wens.x509.pem")))
6388 (delete 'configure)) ; no configure script
6389 #:make-flags
6390 #~(list (string-append "PREFIX=" #$output)
6391 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware"))))
6392 (native-inputs (list openssl ; to verify signature
6393 python-wrapper))
6394 (home-page
6395 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
6396 (synopsis "Wireless regulatory database")
6397 (description
6398 "This package contains the wireless regulatory database used by the Linux
6399cfg80211 subsystem and the legacy @acronym{CRDA, Central Regulatory Database
6400Agent}. The database contains information on country-specific regulations for
6401the wireless spectrum.")
6402 (license license:isc)))
6403
6404(define-public lm-sensors
6405 (package
6406 (name "lm-sensors")
6407 (version "3.6.2")
6408 (source
6409 (origin
6410 (method git-fetch)
6411 (uri (git-reference
6412 (url "https://github.com/hramrach/lm-sensors")
6413 (commit (string-append "V" (string-join
6414 (string-split version #\.) "-")))))
6415 (file-name (git-file-name name version))
6416 (sha256
6417 (base32 "0p2ck8p9zb1w53l37pvm6c10vi6r8bfz51nd3sdwwsfhfhgvsr0j"))
6418 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
6419 (build-system gnu-build-system)
6420 (outputs '("lib" ; avoid perl in closure
6421 "out"))
6422 (arguments
6423 (list
6424 #:tests? #f ; no 'check' target
6425 #:make-flags
6426 #~(list (string-append "PREFIX=" #$output)
6427 (string-append "ETCDIR=" #$output:lib "/etc")
6428 (string-append "INCLUDEDIR=" #$output:lib "/include")
6429 (string-append "MANDIR=" #$output "/share/man")
6430 (string-append "LIBDIR=" #$output:lib "/lib"))
6431 #:phases
6432 #~(modify-phases %standard-phases
6433 (delete 'configure)
6434 (add-before 'build 'patch-exec-paths
6435 (lambda* (#:key inputs #:allow-other-keys)
6436 (substitute* "prog/detect/sensors-detect"
6437 (("`uname")
6438 (string-append
6439 "`" (assoc-ref inputs "coreutils") "/bin/uname"))
6440 (("(`|\")modprobe" all open-quote)
6441 (string-append
6442 open-quote #$(this-package-input "kmod") "/bin/modprobe")))
6443 (substitute* '("prog/pwm/pwmconfig" "prog/pwm/fancontrol")
6444 (("gnuplot")
6445 (search-input-file inputs "/bin/gnuplot"))
6446 (("cat ")
6447 (string-append (search-input-file inputs "/bin/cat") " "))
6448 (("e?grep " match)
6449 (string-append
6450 (search-input-file
6451 inputs (string-append "/bin/" (string-trim-right match)))
6452 " "))
6453 (("sed -e")
6454 (string-append (search-input-file inputs "/bin/sed") " -e"))
6455 (("cut -d")
6456 (string-append (search-input-file inputs "/bin/cut") " -d"))
6457 (("sleep ")
6458 (string-append (search-input-file inputs "/bin/sleep") " "))
6459 (("readlink -f")
6460 (string-append
6461 (search-input-file inputs "/bin/readlink") " -f"))))))))
6462 (inputs
6463 (list gnuplot kmod perl rrdtool))
6464 (native-inputs
6465 (list bison flex pkg-config which))
6466 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
6467 (synopsis "Utilities to read temperature/voltage/fan sensors")
6468 (description
6469 "Lm-sensors is a hardware health monitoring package for Linux. It allows
6470you to access information from temperature, voltage, and fan speed sensors.
6471It works with most newer systems.")
6472 (license license:gpl2+)))
6473
6474(define-public iucode-tool
6475 (package
6476 (name "iucode-tool")
6477 (version "2.3.1")
6478 (source (origin
6479 (method url-fetch)
6480 (uri (string-append "https://gitlab.com/iucode-tool/releases"
6481 "/raw/latest/iucode-tool_" version ".tar.xz"))
6482 (sha256
6483 (base32
6484 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
6485 (build-system gnu-build-system)
6486 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
6487 (synopsis "Manipulate Intel microcode bundles")
6488 (description
6489 "@command{iucode_tool} is a utility to work with microcode packages for
6490Intel processors. It can convert between formats, extract specific versions,
6491create a firmware image suitable for the Linux kernel, and more.")
6492 ;; cpuid.h is available for i686, x86_64, and ia64.
6493 (supported-systems '("i686-linux" "x86_64-linux"))
6494 (license license:gpl2+)))
6495
6496(define-public i2c-tools
6497 (package
6498 (name "i2c-tools")
6499 (version "4.3")
6500 (source (origin
6501 (method url-fetch)
6502 (uri (string-append
6503 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
6504 version ".tar.xz"))
6505 (sha256
6506 (base32
6507 "1y0fphjd5ah2j886x8i175r7viq0hmx666hyca0wi4dzrm290qxk"))))
6508 (build-system gnu-build-system)
6509 (arguments
6510 `(#:tests? #f ; no 'check' target
6511 #:make-flags
6512 ,#~(list (string-append "PREFIX=" #$output)
6513 (string-append "LDFLAGS+=-Wl,-rpath=" #$output "/lib")
6514 (string-append "CC=" #$(cc-for-target)))
6515 ;; No configure script.
6516 #:phases (modify-phases %standard-phases (delete 'configure))))
6517 (inputs
6518 (list perl))
6519 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
6520 (synopsis "I2C tools for Linux")
6521 (description
6522 "The i2c-tools package contains a heterogeneous set of I2C tools for
6523Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
6524EEPROM decoding scripts, EEPROM programming tools, and a python module for
6525SMBus access.")
6526 (license license:gpl2+)))
6527
6528(define-public i2c-tools-3
6529 (package
6530 (inherit i2c-tools)
6531 (name "i2c-tools")
6532 (version "3.1.2")
6533 (source (origin
6534 (method url-fetch)
6535 (uri (string-append
6536 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
6537 version ".tar.bz2"))
6538 (sha256
6539 (base32 "0hd4c1w8lnwc3j95h3vpd125170l1d4myspyrlpamqx6wbr6jpnv"))))
6540 (arguments
6541 (substitute-keyword-arguments arguments
6542 ((#:make-flags _)
6543 #~(list (string-append "prefix=" #$output)
6544 (string-append "CC=" #$(cc-for-target))))))))
6545
6546(define-public python-smbus
6547 (package
6548 (inherit i2c-tools)
6549 (name "python-smbus")
6550 (build-system pyproject-build-system)
6551 (arguments
6552 (list #:tests? #f ;; No test suite.
6553 #:phases
6554 #~(modify-phases %standard-phases
6555 (add-after 'unpack 'change-directory
6556 (lambda _ (chdir "py-smbus")))
6557 (add-after 'change-directory 'set-library-path
6558 (lambda _
6559 (substitute* "setup.py"
6560 (("-L\\.\\./lib")
6561 (string-append "-L" #$(this-package-input "i2c-tools")
6562 "/lib"))))))))
6563 (inputs (list i2c-tools))
6564 (native-inputs (list python-setuptools python-wheel))
6565 (synopsis "I2C/SMBus access for Python")
6566 (description "This package provides a Python library to access
6567@acronym{I2C, Inter-Integrated Circuit} and @acronym{SMBus, System
6568Management Bus} devices on Linux.")))
6569
6570(define-public xsensors
6571 (package
6572 (name "xsensors")
6573 (version "0.70")
6574 (source (origin
6575 (method url-fetch)
6576 (uri (string-append
6577 "http://www.linuxhardware.org/xsensors/xsensors-"
6578 version ".tar.gz"))
6579 (sha256
6580 (base32
6581 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
6582 (build-system gnu-build-system)
6583 (arguments
6584 `(#:phases
6585 (modify-phases %standard-phases
6586 (add-before 'configure 'enable-deprecated
6587 (lambda _
6588 (substitute* "src/Makefile.in"
6589 (("-DGDK_DISABLE_DEPRECATED") "")
6590 (("-DGTK_DISABLE_DEPRECATED") ""))))
6591 (add-before 'configure 'remove-Werror
6592 (lambda _
6593 (substitute* '("configure" "src/Makefile.in")
6594 (("-Werror") "")))))))
6595 (inputs (list (list lm-sensors "lib") gtk+-2))
6596 (native-inputs (list pkg-config))
6597 (home-page "http://www.linuxhardware.org/xsensors/")
6598 (synopsis "Hardware health information viewer")
6599 (description
6600 "Xsensors reads data from the libsensors library regarding hardware
6601health such as temperature, voltage and fan speed and displays the information
6602in a digital read-out.")
6603 (license license:gpl2+)))
6604
6605(define-public perf
6606 (package
6607 (name "perf")
6608 (version (package-version linux-libre))
6609 (source (package-source linux-libre))
6610 (build-system gnu-build-system)
6611 (arguments
6612 '(#:phases
6613 (modify-phases %standard-phases
6614 (replace 'configure
6615 (lambda* (#:key inputs #:allow-other-keys)
6616 (setenv "SHELL_PATH" (which "bash"))
6617 (chdir "tools/perf")
6618
6619 ;; In Linux 6.10.6, 'Makefile.config' overrides PKG_CONFIG_PATH
6620 ;; when looking for libtraceevent and thus fails to find it.
6621 ;; Remove that.
6622 (substitute* "Makefile.config"
6623 (("PKG_CONFIG_PATH=[[:graph:]]+")
6624 ""))
6625
6626 ;; This file hard-codes file system layouts for specific distros
6627 ;; but not for ours; address that. With this change, one can run
6628 ;; "perf report --symfs=$HOME/.guix-profile" (without
6629 ;; "/lib/debug") and 'perf' should be able to find separate debug
6630 ;; info files.
6631 (substitute* "util/dso.c"
6632 (("/usr/lib/debug")
6633 "/lib/debug")))))
6634 #:make-flags (list (string-append "prefix="
6635 (assoc-ref %outputs "out"))
6636 "CC=gcc"
6637 "WERROR=0"
6638
6639 ;; By default, 'config/Makefile' uses lib64 on
6640 ;; x86_64. Work around that.
6641 "lib=lib")
6642 #:tests? #f)) ;no tests
6643 (native-inputs
6644 (list pkg-config
6645 bison
6646 flex
6647 ;; For build scripts.
6648 python-3
6649 ;; Documentation
6650 docbook-xsl
6651 xmlto
6652 asciidoc))
6653 (inputs
6654 (list slang ;for the interactive TUI
6655 zlib
6656 ;; newt
6657 python-3 ;'perf' links against libpython
6658 elfutils
6659 libiberty ;used alongside BDF for symbol demangling
6660 libunwind ;better stack walking
6661 libtraceevent
6662 numactl)) ;for 'perf bench numa mem'
6663 (home-page "https://perf.wiki.kernel.org/")
6664 (synopsis "Linux profiling with performance counters")
6665 (description
6666 "perf is a tool suite for profiling using hardware performance counters,
6667with support in the Linux kernel. perf can instrument CPU performance
6668counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
6669of lightweight profiling. This package contains the user-land tools and in
6670particular the @code{perf} command.")
6671 (license (package-license linux-libre))))
6672
6673(define-public pflask
6674 (package
6675 (name "pflask")
6676 (version "0.2")
6677 (source (origin
6678 (method git-fetch)
6679 (uri (git-reference
6680 (url "https://github.com/ghedo/pflask")
6681 (commit (string-append "v" version))))
6682 (file-name (git-file-name name version))
6683 (sha256
6684 (base32
6685 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
6686 (build-system cmake-build-system)
6687 (arguments
6688 '(#:tests? #f)) ; no tests
6689 (home-page "https://ghedo.github.io/pflask/")
6690 (synopsis "Simple tool for creating Linux namespace containers")
6691 (description "pflask is a simple tool for creating Linux namespace
6692containers. It can be used for running a command or even booting an OS inside
6693an isolated container, created with the help of Linux namespaces. It is
6694similar in functionality to chroot, although pflask provides better isolation
6695thanks to the use of namespaces.")
6696 (license license:bsd-2)))
6697
6698(define-public singularity
6699 (package
6700 (name "singularity")
6701 (version "2.6.1")
6702 (source (origin
6703 (method url-fetch)
6704 (uri (string-append "https://github.com/singularityware/singularity/"
6705 "releases/download/" version
6706 "/singularity-" version ".tar.gz"))
6707 (sha256
6708 (base32
6709 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
6710 (modules '((guix build utils)))
6711 (snippet
6712 '(begin
6713 ;; Do not create directories in /var.
6714 (substitute* "Makefile.in"
6715 (("\\$\\(MAKE\\) .*install-data-hook") ""))
6716
6717 ;; The original source overrides PATH so that it points to
6718 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
6719 ;; on Guix System. Leave PATH unchanged so we refer to the
6720 ;; installed Coreutils, grep, etc.
6721 (substitute* "bin/singularity.in"
6722 (("^PATH=.*" all)
6723 (string-append "#" all "\n")))
6724
6725 (substitute* (find-files "libexec/cli" "\\.exec$")
6726 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
6727 _ program)
6728 (string-append "/run/privileged/bin/singularity-"
6729 program "-helper")))
6730
6731 ;; These squashfs mount options are apparently no longer
6732 ;; supported since Linux-libre 5.4.5.
6733 (substitute* "src/lib/image/squashfs/mount.c"
6734 (("\"errors=remount-ro\"")
6735 "NULL"))))))
6736 (build-system gnu-build-system)
6737 (arguments
6738 (list
6739 #:configure-flags #~(list "--localstatedir=/var")
6740 #:phases
6741 #~(modify-phases %standard-phases
6742 (add-after 'unpack 'patch-references
6743 (lambda _
6744 (substitute* "libexec/cli/build.exec.in"
6745 (("-mksquashfs") (string-append "-" (which "mksquashfs"))))
6746 (substitute* (append
6747 (find-files "libexec" "functions")
6748 (find-files "libexec/bootstrap-scripts" ".*sh$")
6749 (find-files "libexec/cli" ".*exec$"))
6750 (("\\| grep ")
6751 (string-append "| " (which "grep") " "))
6752 (("egrep ")
6753 (string-append (which "egrep") " "))
6754 ((" sed ")
6755 (string-append " " (which "sed") " ")))))
6756 (add-after 'install 'set-PATH
6757 (lambda _
6758 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
6759 ;; But don't override PATH, so that other tools like zcat and
6760 ;; tar can still be found if they are available.
6761 (let ((coreutils #$(this-package-input "coreutils")))
6762 (wrap-program (string-append #$output "/bin/singularity")
6763 `("PATH" prefix (,(string-append coreutils "/bin"))))
6764 (substitute* (string-append #$output "/bin/run-singularity")
6765 (("/usr/bin/env singularity")
6766 (string-append (which "env") " "
6767 #$output "/bin/singularity")))))))))
6768 (inputs
6769 (list bash-minimal
6770 coreutils
6771 libarchive
6772 python-wrapper
6773 squashfs-tools
6774 zlib))
6775 (home-page "https://singularity.lbl.gov/")
6776 (synopsis "Container platform")
6777 (description "Singularity is a container platform supporting a number of
6778container image formats. It can build SquashFS container images or import
6779existing Docker images. Singularity requires kernel support for container
6780isolation or root privileges.")
6781 (license license:bsd-3)))
6782
6783(define-public python-spython
6784 (package
6785 (name "python-spython")
6786 (version "0.3.13")
6787 (source
6788 (origin
6789 (method url-fetch)
6790 (uri (pypi-uri "spython" version))
6791 (sha256
6792 (base32 "0kly851k6mj7xzcybciav5d0pq5q04pzg7c5a1g712bqbxkha4ck"))))
6793 (build-system pyproject-build-system)
6794 (arguments
6795 (list
6796 #:phases
6797 #~(modify-phases %standard-phases
6798 ;; Configure absolute path to singularity.
6799 (add-after 'unpack 'configure
6800 (lambda* (#:key inputs #:allow-other-keys)
6801 (let ((singularity (search-input-file inputs "bin/singularity")))
6802 (substitute* "spython/utils/terminal.py"
6803 (("software=\"singularity\"")
6804 (string-append "software=\"" singularity "\"")))
6805 (substitute* (list "spython/utils/terminal.py"
6806 "spython/main/help.py"
6807 "spython/main/base/command.py")
6808 (("\\[\"singularity\"")
6809 (string-append "[\"" singularity "\"")))
6810 (substitute* "spython/main/execute.py"
6811 (("shutil.which\\(\"singularity\"\\)")
6812 (string-append "shutil.which(\"" singularity "\")"))))))
6813 ;; Skip tests that require network access.
6814 (add-before 'check 'skip-tests
6815 (lambda _
6816 (delete-file "spython/tests/test_client.py"))))))
6817 (inputs
6818 (list singularity))
6819 (native-inputs
6820 (list python-pytest python-setuptools python-wheel))
6821 (home-page "https://github.com/singularityhub/singularity-cli")
6822 (synopsis "Singularity Python client")
6823 (description "@code{python-spython} is a Python library to interact with
6824Singularity containers.")
6825 (license license:mpl2.0)))
6826
6827(define-public libnvme
6828 (package
6829 (name "libnvme")
6830 (version "1.16.2")
6831 (source (origin
6832 (method git-fetch)
6833 (uri (git-reference
6834 (url "https://github.com/linux-nvme/libnvme.git")
6835 (commit (string-append "v" version))))
6836 (sha256
6837 (base32 "05h1kjs8lgdmfsdz5vcfl470zhw7j36jp7a9wip20ibb6g3s9r1k"))
6838 (file-name (git-file-name name version))))
6839 (build-system meson-build-system)
6840 (outputs (list "out" "doc")) ; docs are 80% of all output
6841 (arguments
6842 (list
6843 #:configure-flags
6844 #~(let ((doc (string-append #$output:doc "/share/doc/" #$name)))
6845 (list (string-append "-Dhtmldir=" doc "/html")
6846 (string-append "-Drstdir=" doc "/rst")
6847 "-Ddocs-build=true" "-Ddocs=all"))))
6848 (native-inputs (list pkg-config perl python python-sphinx))
6849 ;; libnvme.pc, libnvme-mi.pc lists these in Requires.private.
6850 (propagated-inputs (list dbus json-c openssl))
6851 (home-page "https://github.com/linux-nvme/libnvme")
6852 (synopsis "C Library for NVM Express on Linux")
6853 (description "libnvme provides type definitions for NVMe specification
6854structures, enumerations, and bit fields, helper functions to construct,
6855dispatch, and decode commands and payloads, and utilities to connect, scan,
6856and manage nvme devices on a Linux system.")
6857 (license license:lgpl2.1+)))
6858
6859(define-public nvme-cli
6860 (package
6861 (name "nvme-cli")
6862 (version "2.16")
6863 (home-page "https://github.com/linux-nvme/nvme-cli")
6864 (source (origin
6865 (method git-fetch)
6866 (uri (git-reference
6867 (url home-page)
6868 (commit (string-append "v" version))))
6869 (sha256
6870 (base32 "1877fvhd4573900zwk7y2mk2vvmgnws2wa37sv176ikxj647jvw1"))
6871 (file-name (git-file-name name version))))
6872 (build-system meson-build-system)
6873 (outputs (list "out" "doc")) ; docs make up ~70% of total size
6874 (arguments
6875 (list
6876 #:configure-flags #~(list (format #f "-Dhtmldir=~a/share/doc/~a/html"
6877 #$output:doc #$name)
6878 "-Ddocs=all")))
6879 (native-inputs (list pkg-config))
6880 (inputs (list libnvme json-c zlib))
6881 (synopsis "NVM-Express user space tooling for Linux")
6882 (description "Nvme-cli is a utility to provide standards compliant tooling
6883for NVM-Express drives. It was made specifically for Linux as it relies on the
6884IOCTLs defined by the mainline kernel driver.")
6885 (license license:gpl2+)))
6886
6887(define-public acpi
6888 (package
6889 (name "acpi")
6890 (version "1.7")
6891 (source (origin
6892 (method url-fetch)
6893 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
6894 version "/" name "-" version ".tar.gz"))
6895 (sha256
6896 (base32
6897 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
6898 (build-system gnu-build-system)
6899 (home-page "http://acpiclient.sourceforge.net")
6900 (synopsis "Display information on ACPI devices")
6901 (description "@code{acpi} attempts to replicate the functionality of the
6902\"old\" @code{apm} command on ACPI systems, including battery and thermal
6903information. It does not support ACPI suspending, only displays information
6904about ACPI devices.")
6905 (license license:gpl2+)))
6906
6907(define-public acpid
6908 (package
6909 (name "acpid")
6910 (version "2.0.34")
6911 (source (origin
6912 (method url-fetch)
6913 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
6914 version ".tar.xz"))
6915 (sha256
6916 (base32
6917 "0cxkdbd087kj9ikprvvjpk0ixzqbipf2rmj6qyp7r15wzj65q29d"))))
6918 (build-system gnu-build-system)
6919 (home-page "https://sourceforge.net/projects/acpid2/")
6920 (synopsis "Daemon for delivering ACPI events to user-space programs")
6921 (description
6922 "acpid is designed to notify user-space programs of Advanced
6923Configuration and Power Interface (ACPI) events. acpid should be started
6924during the system boot, and will run as a background process. When an ACPI
6925event is received from the kernel, acpid will examine the list of rules
6926specified in /etc/acpi/events and execute the rules that match the event.")
6927 (license license:gpl2+)))
6928
6929(define-public sysfsutils
6930 (package
6931 (name "sysfsutils")
6932 (version "2.1.0")
6933 (source
6934 (origin
6935 (method url-fetch)
6936 (uri
6937 (string-append
6938 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
6939 version ".tar.gz"))
6940 (sha256
6941 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
6942 (build-system gnu-build-system)
6943 (home-page "https://linux-diag.sourceforge.net/Sysfsutils.html")
6944 (synopsis "System utilities based on Linux sysfs")
6945 (description
6946 "These are a set of utilities built upon sysfs, a virtual file system in
6947Linux kernel versions 2.5+ that exposes a system's device tree. The package
6948also contains the libsysfs library.")
6949 ;; The library is under lgpl2.1+ (all files say "or any later version").
6950 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
6951 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
6952
6953(define-public cpufrequtils
6954 (let ((commit "a2f0c39d5f21596bb9f5223e895c0ff210b265d0")
6955 (revision "1"))
6956 (package
6957 (name "cpufrequtils")
6958 (version (git-version "008" revision commit))
6959 (source
6960 (origin
6961 (method git-fetch)
6962 (uri
6963 (git-reference
6964 (url "https://git.kernel.org/pub/scm/linux/kernel/git/brodo/cpufrequtils.git")
6965 (commit commit)))
6966 (file-name (git-file-name name version))
6967 (sha256
6968 (base32 "01n2hp6v89cilqqvqvlcprphyhnljsjclh4h1zf3b1l7ypz29lbp"))))
6969 (build-system gnu-build-system)
6970 (arguments
6971 (list
6972 #:tests? #f ;no test suite
6973 #:make-flags
6974 #~(let ((out #$output))
6975 (list "PROC=false" ;obsoleted by sysfs in Linux 2.6(!)
6976 (string-append "CC=" #$(cc-for-target))
6977 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
6978 "INSTALL=install"
6979 (string-append "bindir=" out "/bin")
6980 (string-append "sbindir=" out "/sbin")
6981 (string-append "mandir=" out "/share/man")
6982 (string-append "includedir=" out "/include")
6983 (string-append "libdir=" out "/lib")
6984 (string-append "localedir=" out "/share/locale")
6985 (string-append "docdir=" out "/share/doc/" #$name)))
6986 #:phases
6987 #~(modify-phases %standard-phases
6988 (delete 'configure)))) ;no configure script
6989 (native-inputs (list gettext-minimal))
6990 (home-page
6991 "http://ftp.be.debian.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html")
6992 (synopsis "Utilities to get and set CPU frequency on Linux")
6993 (description
6994 "The cpufrequtils suite contains utilities to retrieve CPU frequency
6995information, and set the CPU frequency if supported, using the cpufreq
6996capabilities of the Linux kernel.")
6997 (license license:gpl2))))
6998
6999(define-public libite
7000 (package
7001 (name "libite")
7002 (version "2.5.2")
7003 (source
7004 (origin
7005 (method git-fetch)
7006 (uri (git-reference
7007 (url "https://github.com/troglobit/libite")
7008 (commit (string-append "v" version))))
7009 (file-name (git-file-name name version))
7010 (sha256
7011 (base32 "0i27ppb557kdc1hm7nf0f5r7sxvqma31pr57h79whl6qcp28gy4a"))))
7012 (build-system gnu-build-system)
7013 (arguments
7014 `(#:configure-flags
7015 (list "--disable-static")
7016 #:phases
7017 (modify-phases %standard-phases
7018 (add-after 'unpack 'fix-tests
7019 (lambda* (#:key inputs #:allow-other-keys)
7020 ;; replace paths to the executables
7021 (substitute* "test/which.c"
7022 (("/usr/bin/which")
7023 (search-input-file inputs "/bin/which"))
7024 (("ls\"")
7025 (string-append
7026 (search-input-file inputs "/bin/ls") "\"")))
7027 ;; create pidfile in /tmp instead of /var
7028 (substitute* "test/pidfile.c" (("/var/tmp") "/tmp")))))))
7029 (native-inputs (list autoconf automake libtool which))
7030 (synopsis "Library providing missing pieces in GNU libc")
7031 (description "This package provides many of the missing pieces in GNU
7032libc. Most notably the string functions: strlcpy(3), strlcat(3) and the *BSD
7033sys/queue.h and sys/tree.h API's.")
7034 (home-page "https://troglobit.com/projects/libite/")
7035 (license license:expat)))
7036
7037(define-public libuev
7038 (package
7039 (name "libuev")
7040 (version "2.4.0")
7041 (source
7042 (origin
7043 (method git-fetch)
7044 (uri (git-reference
7045 (url "https://github.com/troglobit/libuev")
7046 (commit (string-append "v" version))))
7047 (file-name (git-file-name name version))
7048 (sha256
7049 (base32
7050 "0ih82lxfdcq179kknzdl5c8vi1l0n5j7yh68y8f6kwsrm457paf7"))))
7051 (build-system gnu-build-system)
7052 (native-inputs (list autoconf automake libtool))
7053 (synopsis "Lightweight event loop library for epoll family APIs")
7054 (description "This package provides small event loop that wraps the
7055epoll family of APIs.")
7056 (home-page "https://troglobit.com/projects/libuev/")
7057 (license license:expat)))
7058
7059(define-public libraw1394
7060 (package
7061 (name "libraw1394")
7062 (version "2.1.2")
7063 (source (origin
7064 (method url-fetch)
7065 (uri (string-append
7066 "mirror://kernel.org/linux/libs/ieee1394/"
7067 name "-" version ".tar.xz"))
7068 (sha256
7069 (base32
7070 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
7071 (build-system gnu-build-system)
7072 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
7073 (synopsis "Interface library for the Linux IEEE1394 drivers")
7074 (description
7075 "Libraw1394 is the only supported interface to the kernel side raw1394 of
7076the Linux IEEE-1394 subsystem, which provides direct access to the connected
70771394 buses to user space. Through libraw1394/raw1394, applications can directly
7078send to and receive from other nodes without requiring a kernel driver for the
7079protocol in question.")
7080 (license license:lgpl2.1+)))
7081
7082(define-public libavc1394
7083 (package
7084 (name "libavc1394")
7085 (version "0.5.4")
7086 (source (origin
7087 (method url-fetch)
7088 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
7089 name "-" version ".tar.gz"))
7090 (sha256
7091 (base32
7092 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
7093 (build-system gnu-build-system)
7094 (native-inputs
7095 (list pkg-config))
7096 (propagated-inputs
7097 (list libraw1394)) ; required by libavc1394.pc
7098 (home-page "https://sourceforge.net/projects/libavc1394/")
7099 (synopsis "AV/C protocol library for IEEE 1394")
7100 (description
7101 "Libavc1394 is a programming interface to the AV/C specification from
7102the 1394 Trade Association. AV/C stands for Audio/Video Control.")
7103 (license license:lgpl2.1+)))
7104
7105(define-public libiec61883
7106 (package
7107 (name "libiec61883")
7108 (version "1.2.0")
7109 (source (origin
7110 (method url-fetch)
7111 (uri (string-append
7112 "mirror://kernel.org/linux/libs/ieee1394/"
7113 name "-" version ".tar.xz"))
7114 (sha256
7115 (base32
7116 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
7117 (build-system gnu-build-system)
7118 (native-inputs
7119 (list pkg-config))
7120 (propagated-inputs
7121 (list libraw1394)) ; required by libiec61883.pc
7122 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
7123 (synopsis "Isochronous streaming media library for IEEE 1394")
7124 (description
7125 "The libiec61883 library provides a higher level API for streaming DV,
7126MPEG-2 and audio over Linux IEEE 1394.")
7127 (license license:lgpl2.1+)))
7128
7129(define-public mdadm
7130 (package
7131 (name "mdadm")
7132 (version "4.2")
7133 (source (origin
7134 (method url-fetch)
7135 (uri (string-append
7136 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
7137 version ".tar.xz"))
7138 (sha256
7139 (base32
7140 "07ghmibmbnkdy91ng87zdllzicm299l20dhs9m5bfjw6f1b22726"))))
7141 (build-system gnu-build-system)
7142 (arguments
7143 (list #:make-flags
7144 #~(list (string-append "CC=" #$(cc-for-target))
7145 "INSTALL=install"
7146 "CHECK_RUN_DIR=0"
7147 ;; TODO: tell it where to find 'sendmail'
7148 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
7149 (string-append "BINDIR=" #$output "/sbin")
7150 (string-append "MANDIR=" #$output "/share/man")
7151 (string-append "UDEVDIR=" #$output "/lib/udev"))
7152 #:phases
7153 #~(modify-phases %standard-phases
7154 (add-before 'build 'patch-program-paths
7155 (lambda* (#:key native-inputs inputs #:allow-other-keys)
7156 (let ((coreutils (assoc-ref (or native-inputs inputs)
7157 "coreutils")))
7158 (substitute* "udev-md-raid-arrays.rules"
7159 (("/usr/bin/(readlink|basename)" all program)
7160 (string-append coreutils "/bin/" program))))))
7161 (add-before 'build 'remove-W-error
7162 (lambda _
7163 ;; We cannot build with -Werror on i686 due to a
7164 ;; 'sign-compare' warning in util.c.
7165 (substitute* "Makefile"
7166 (("-Werror") ""))))
7167 (delete 'configure))
7168 ;; Tests must be run as root.
7169 #:tests? #f))
7170 (inputs
7171 (list eudev))
7172 (supported-systems (remove target-hurd? %supported-systems))
7173 (home-page "http://neil.brown.name/blog/mdadm")
7174 (synopsis "Tool for managing Linux Software RAID arrays")
7175 (description
7176 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
7177assemble, report on, and monitor arrays. It can also move spares between raid
7178arrays when needed.")
7179 (license license:gpl2+)))
7180
7181(define-public mdadm-static
7182 (package
7183 (inherit mdadm)
7184 (name "mdadm-static")
7185 (arguments
7186 (substitute-keyword-arguments arguments
7187 ((#:make-flags flags)
7188 #~(cons* "LDFLAGS = -static"
7189 "CXFLAGS = -DNO_LIBUDEV"
7190 #$flags))
7191 ((#:phases phases)
7192 #~(modify-phases #$phases
7193 (add-after 'install 'remove-cruft
7194 (lambda* (#:key outputs #:allow-other-keys)
7195 (let* ((out (assoc-ref outputs "out"))
7196 (precious? (lambda (file)
7197 (member file '("." ".." "sbin"))))
7198 (directories (scandir out (negate precious?))))
7199 (with-directory-excursion out
7200 (for-each delete-file-recursively directories)
7201 (remove-store-references "sbin/mdadm")
7202 (delete-file "sbin/mdmon")))))))
7203 ((#:modules modules %default-gnu-modules)
7204 `((ice-9 ftw) ,@modules))
7205 ((#:strip-flags _ '())
7206 ''("--strip-all")) ;strip a few extra KiB
7207 ((#:allowed-references _ '("out"))
7208 '("out")))) ;refer only self
7209 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
7210
7211(define-public multipath-tools
7212 (package
7213 (name "multipath-tools")
7214 (version "0.11.0")
7215 (home-page "https://github.com/opensvc/multipath-tools")
7216 (source (origin
7217 (method git-fetch)
7218 (uri (git-reference (url home-page) (commit version)))
7219 (file-name (git-file-name name version))
7220 (sha256
7221 (base32
7222 "1yl2cd4xgw2l5xzx5dbdf7awhrvfbjsrspli9i6bmxc5j4jkvazr"))
7223 (modules '((guix build utils)))
7224 (snippet
7225 '(begin
7226 ;; Drop bundled valgrind headers.
7227 (delete-file-recursively "third-party")
7228 (substitute* '("multipathd/main.c"
7229 "libmpathutil/debug.c")
7230 (("#include \"../third-party/")
7231 "#include \""))))))
7232 (build-system gnu-build-system)
7233 (arguments
7234 (list
7235 #:test-target "test"
7236 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
7237 (string-append "prefix=" #$output)
7238 ;; Install Udev rules below this directory, relative
7239 ;; to the prefix.
7240 (string-append "systemd_prefix=" #$output))
7241 #:phases
7242 #~(modify-phases %standard-phases
7243 (add-after 'unpack 'patch-source
7244 (lambda* (#:key inputs #:allow-other-keys)
7245 (let ((libdevmapper.h
7246 (search-input-file inputs "include/libdevmapper.h"))
7247 (libudev.h
7248 (search-input-file inputs "include/libudev.h")))
7249 (substitute* "Makefile.inc"
7250 (("/bin/echo") "echo")
7251 (("\\$\\(prefix\\)/usr") "$(prefix)")
7252 (("configdir.*:= \\$\\(prefix\\)/etc/multipath/conf.d")
7253 "configdir := /etc/multipath/conf.d")
7254 ;; Do not save timestamp to avoid gzip "timestamp
7255 ;; out-of-range" warnings.
7256 (("gzip -9") "gzip -9n"))
7257 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
7258 (("/usr/include/libdevmapper.h") libdevmapper.h)
7259 (("/usr/include/libudev.h") libudev.h)))))
7260 (add-after 'unpack 'skip-failing-tests
7261 (lambda _
7262 ;; This test and the module's setup() test an arbitrary block
7263 ;; device node name, but the build environment has none.
7264 (substitute* "tests/devt.c"
7265 (("return get_one_devt.*") "return 0;\n")
7266 (("cmocka_unit_test\\(test_devt2devname_devt_good\\),") ""))
7267 ;; The above triggers -Werror=unused-function. Ignore it.
7268 (substitute* "tests/Makefile"
7269 (("CFLAGS \\+= " match)
7270 (string-append match "-Wno-error=unused-function ")))))
7271 (delete 'configure) ;no configure script
7272 (add-before 'build 'no-fortify-3
7273 (lambda _
7274 ;; NOTE: The check made seems to wrongly assume the
7275 ;; FORTIFY_SOURCE=3 is valid. However, when compiling, warnings
7276 ;; are emitted from glibc, resulting in failed build. Fix this
7277 ;; by forcing the usage of FORTIFY_SOURCE=2.
7278 (substitute* "create-config.mk"
7279 (("FORTIFY_SOURCE=3")
7280 "FORTIFY_SOURCE=2"))))
7281 (add-before 'build 'set-LDFLAGS
7282 (lambda _
7283 ;; Note: this cannot be passed as a make flag because that will
7284 ;; override the build system LDFLAGS.
7285 (setenv "LDFLAGS"
7286 (string-append "-Wl,-rpath=" #$output "/lib")))))))
7287
7288 (native-inputs
7289 (list perl pkg-config valgrind/pinned
7290 ;; For tests.
7291 cmocka))
7292 (inputs
7293 (list json-c
7294 libaio
7295 liburcu
7296 lvm2
7297 readline
7298 eudev
7299 ;; For libmount.
7300 `(,util-linux "lib")))
7301 (synopsis "Access block devices through multiple paths")
7302 (description
7303 "This package provides the following binaries to drive the
7304Linux Device Mapper multipathing driver:
7305@enumerate
7306@item @command{multipath} - Device mapper target autoconfig.
7307@item @command{multipathd} - Multipath daemon.
7308@item @command{mpathpersist} - Manages SCSI persistent reservations on
7309@code{dm} multipath devices.
7310@item @command{kpartx} - Create device maps from partition tables.
7311@end enumerate")
7312 (license (list license:gpl2+ ;main distribution
7313 license:lgpl2.0+)))) ;libmpathcmd/mpath_cmd.h
7314
7315(define-public libaio
7316 (package
7317 (name "libaio")
7318 (version "0.3.113")
7319 (source (origin
7320 (method url-fetch)
7321 (uri (list
7322 (string-append "https://releases.pagure.org/libaio/"
7323 name "-" version ".tar.gz")))
7324 (sha256
7325 (base32
7326 "02r0g2vfv6kfljplm3ga93w4xw13q2wixbn9hwi7ahqdzp2x2i1c"))
7327 (patches (search-patches "libaio-32bit-test.patch"))))
7328 (build-system gnu-build-system)
7329 (arguments
7330 (list #:make-flags
7331 #~(list (string-append "prefix=" #$output)
7332 (string-append "CC=" #$(cc-for-target)))
7333 #:test-target "partcheck" ; need root for a full 'check'
7334 #:phases
7335 #~(modify-phases %standard-phases
7336 (add-after 'unpack 'disable-problematic-tests
7337 (lambda _
7338 (with-directory-excursion "harness/cases"
7339 ;; The 21.t test fails with "Expected 4096, got
7340 ;; 18446744073709551605" (see:
7341 ;; https://pagure.io/libaio/issue/26).
7342 (rename-file "21.t" "21.t.disabled"))))
7343 (delete 'configure) ; no configure script
7344 #$@(if (target-riscv64?)
7345 #~((add-after 'unpack 'patch-test
7346 (lambda* (#:key build-inputs #:allow-other-keys)
7347 (invoke "patch" "-p1" "-i"
7348 #$(local-file
7349 (search-patch
7350 "libaio-riscv-test5.patch"))))))
7351 #~()))))
7352 (native-inputs
7353 (if (target-riscv64?)
7354 (list (search-patch "libaio-riscv-test5.patch")
7355 patch)
7356 '()))
7357 (home-page "https://pagure.io/libaio")
7358 (synopsis "Linux-native asynchronous I/O access library")
7359 (description
7360 "This library enables userspace to use Linux kernel asynchronous I/O
7361system calls, important for the performance of databases and other advanced
7362applications.")
7363 (license license:lgpl2.1+)))
7364
7365(define-public blktrace
7366 ;; Take a newer commit to get the latest patches.
7367 (let ((commit "b9ea6e507e8849f01d06aa48c0c59c5cee4820be")
7368 (revision "1"))
7369 (package
7370 (name "blktrace")
7371 (version (git-version "1.3.0" revision commit))
7372 (home-page
7373 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
7374 (source (origin
7375 (method git-fetch)
7376 (uri (git-reference
7377 (url home-page)
7378 (commit commit)))
7379 (sha256
7380 (base32 "0a4830mlqckbhchar1xcn2w4f24bzb75bigdig5wpm2axl0zc8cq"))
7381 (file-name (git-file-name name version))))
7382 (build-system gnu-build-system)
7383 (arguments
7384 (list
7385 #:make-flags
7386 #~(list (string-append "CC=" #$(cc-for-target))
7387 (string-append "prefix=" #$output))
7388 #:tests? #f ; no tests
7389 #:phases
7390 #~(modify-phases %standard-phases
7391 (delete 'configure) ; no configure script
7392 (add-after 'unpack 'fix-gnuplot-path
7393 (lambda* (#:key inputs #:allow-other-keys)
7394 (substitute* "btt/bno_plot.py"
7395 (("gnuplot %s")
7396 (string-append
7397 (search-input-file inputs "/bin/gnuplot" ) " %s"))))))))
7398 (inputs
7399 (list libaio
7400 gnuplot
7401 python-wrapper)) ; for 'bno_plot.py'
7402 (synopsis "Block layer IO tracing mechanism")
7403 (description "Blktrace is a block layer IO tracing mechanism which provides
7404detailed information about request queue operations to user space. It extracts
7405event traces from the kernel (via the relaying through the debug file system).")
7406 (license license:gpl2))))
7407
7408(define-public sbc
7409 (package
7410 (name "sbc")
7411 (version "2.2")
7412 (source
7413 (origin
7414 (method url-fetch)
7415 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-" version
7416 ".tar.xz"))
7417 (sha256
7418 (base32 "17mfhc9rn25vrqgfpihpjjc8syp3r56paqyhzg1gjnjyydpagbd1"))))
7419 (build-system gnu-build-system)
7420 (arguments
7421 (list
7422 #:configure-flags
7423 #~(list "--disable-tester")))
7424 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
7425 (synopsis "Bluetooth subband audio codec")
7426 (description
7427 "The SBC is a digital audio encoder and decoder used to transfer data to
7428Bluetooth audio output devices like headphones or loudspeakers.")
7429 (license license:gpl2+)))
7430
7431(define-public sbctester
7432 (package
7433 (inherit sbc)
7434 (name "sbctester")
7435 (arguments
7436 (list
7437 #:phases
7438 #~(modify-phases %standard-phases
7439 (add-after 'unpack 'write-build-files
7440 (lambda _
7441 (begin
7442 (for-each delete-file
7443 (list "Makefile.in" "aclocal.m4" "configure"
7444 "config.h.in"))
7445 (delete-file-recursively "build-aux")
7446 (with-output-to-file "configure.ac"
7447 (lambda _
7448 (format #t
7449 "AC_PREREQ([2.69])
7450 AC_INIT([sbctester], [~a])
7451 AC_CONFIG_HEADERS(config.h)
7452 AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
7453 COMPILER_FLAGS
7454 AC_LANG([C])
7455 AC_PROG_CC
7456 AC_PROG_CC_PIE
7457 AC_PROG_INSTALL
7458 AC_PROG_LIBTOOL
7459 PKG_CHECK_MODULES(SNDFILE, sndfile, dummy=yes,
7460 AC_MSG_ERROR(sndfile library is required))
7461 AC_SUBST(SNDFILE_LIBS)
7462 AC_CONFIG_FILES([Makefile])
7463 AC_OUTPUT
7464 AC_MSG_RESULT([$PACKAGE_NAME $VERSION])
7465 ~%"
7466 #$(package-version sbc))))
7467 (with-output-to-file "Makefile.am"
7468 (lambda _
7469 (format #t
7470 "bin_PROGRAMS = src/sbctester
7471 src_sbctester_SOURCES = src/sbctester.c
7472 src_sbctester_LDADD = @SNDFILE_LIBS@ -lm")))))))))
7473 (inputs (list libsndfile))
7474 (native-inputs (list autoconf automake libtool pkg-config))
7475 (synopsis "Test utility for the sbc codec")
7476 (description
7477 "Utility to detect differences between two audio files, encoded with
7478SBC.")))
7479
7480(define-public bluez
7481 (package
7482 (name "bluez")
7483 (version "5.79")
7484 (source (origin
7485 (method url-fetch)
7486 (uri (string-append
7487 "mirror://kernel.org/linux/bluetooth/bluez-"
7488 version ".tar.xz"))
7489 (sha256
7490 (base32
7491 "12pal1m4xlr8k7kxb6isv5lbaca2wc5zcgy0907wfwcz78qaar21"))))
7492 (build-system gnu-build-system)
7493 (arguments
7494 (list
7495 #:configure-flags
7496 #~(list "--sysconfdir=/etc"
7497 "--localstatedir=/var"
7498 "--enable-library"
7499 "--enable-wiimote"
7500 "--disable-systemd"
7501 ;; TODO: is this needed? Not installed by default since 5.55.
7502 "--enable-hid2hci"
7503 ;; Install dbus/udev files to the correct location.
7504 (string-append "--with-dbusconfdir=" #$output "/etc")
7505 (string-append "--with-udevdir=" #$output "/lib/udev"))
7506 #:phases
7507 #~(modify-phases %standard-phases
7508 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
7509 ;; issue (discussion on upstream mailing list:
7510 ;; https://marc.info/?t=149578476300002&r=1&w=2)
7511 (add-before 'check 'skip-wonky-test
7512 (lambda _
7513 (substitute* "unit/test-gatt.c"
7514 (("tester_init\\(&argc, &argv\\);") "return 77;"))))
7515 (replace 'install
7516 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
7517 ;; Override the sysconfdir and localstatedir locations only for
7518 ;; the installation phase. Otherwise, the installation fails when
7519 ;; it tries to write to /etc/bluetooth and /var.
7520 (define make-flags*
7521 (append make-flags (list (string-append "sysconfdir="
7522 #$output "/etc")
7523 (string-append "localstatedir="
7524 #$output "/var"))))
7525 (apply (assoc-ref %standard-phases 'install)
7526 (append args (list #:make-flags make-flags*)))))
7527 (add-after 'install 'post-install
7528 (lambda* (#:key inputs outputs #:allow-other-keys)
7529 (let* ((servicedir (string-append #$output
7530 "/share/dbus-1/services"))
7531 (service "obexd/src/org.bluez.obex.service")
7532 (rule (string-append
7533 #$output "/lib/udev/rules.d/97-hid2hci.rules")))
7534 ;; Install the obex dbus service file.
7535 (substitute* service
7536 (("/bin/false")
7537 (string-append #$output "/libexec/bluetooth/obexd")))
7538 (install-file service servicedir)
7539 ;; Fix paths in the udev rule.
7540 (substitute* rule
7541 (("hid2hci --method")
7542 (string-append #$output "/lib/udev/hid2hci --method"))
7543 (("/sbin/udevadm")
7544 (search-input-file inputs "/bin/udevadm")))))))))
7545 (native-inputs
7546 (list gettext-minimal
7547 pkg-config
7548 python
7549 python-docutils
7550 python-pygments))
7551 (inputs
7552 (list glib dbus eudev libical readline))
7553 (home-page "https://www.bluez.org/")
7554 (synopsis "Linux Bluetooth protocol stack")
7555 (description
7556 "BlueZ provides support for the core Bluetooth layers and protocols. It
7557is flexible, efficient and uses a modular implementation.")
7558 (license license:gpl2+)))
7559
7560(define-public fuse-exfat
7561 (package
7562 (name "fuse-exfat")
7563 (version "1.4.0")
7564 (source (origin
7565 (method url-fetch)
7566 (uri (string-append
7567 "https://github.com/relan/exfat/releases/download/v"
7568 version "/" name "-" version ".tar.gz"))
7569 (sha256
7570 (base32
7571 "07h0ngnydfy8n8h9ni3jn8zlmcj4pzqa0nk0hk0i4yhfbv2yvkx1"))))
7572 (build-system gnu-build-system)
7573 (native-inputs
7574 (list pkg-config))
7575 (inputs
7576 (list fuse-2))
7577 (home-page "https://github.com/relan/exfat")
7578 (synopsis "Mount exFAT file systems")
7579 (description
7580 "This package provides a FUSE-based file system that provides read and
7581write access to exFAT devices.")
7582 (license license:gpl2+)))
7583
7584(define-public gpm
7585 (package
7586 (name "gpm")
7587 (version "1.20.7")
7588 (source (origin
7589 (method url-fetch)
7590 (uri (string-append
7591 "https://www.nico.schottelius.org/software/gpm/archives/"
7592 "gpm-" version ".tar.bz2"))
7593 (patches (search-patches "gpm-glibc-2.26.patch"))
7594 (sha256
7595 (base32
7596 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))
7597 (modules '((guix build utils)))
7598 (snippet
7599 '(begin
7600 ;; Take a patch from upstream to fix building with -fno-common,
7601 ;; which is default in GCC 10:
7602 ;; https://github.com/telmich/gpm/pull/37
7603 (substitute* "src/headers/daemon.h"
7604 (("^time_t[[:blank:]]+last_selection_time;")
7605 "extern time_t last_selection_time;"))))))
7606 (build-system gnu-build-system)
7607 (arguments
7608 '(#:phases (modify-phases %standard-phases
7609 (replace 'bootstrap
7610 (lambda _
7611 ;; The tarball was not generated with 'make dist' so we
7612 ;; need to bootstrap things ourselves.
7613 (substitute* "autogen.sh"
7614 (("/bin/sh") (which "sh")))
7615 (invoke "./autogen.sh")
7616 (patch-makefile-SHELL "Makefile.include.in")
7617 #t)))
7618
7619 ;; Make sure programs find libgpm.so.
7620 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
7621 (assoc-ref %outputs "out")
7622 "/lib"))))
7623 (native-inputs
7624 (list texinfo
7625 bison
7626 flex
7627 autoconf
7628 automake
7629 libtool))
7630 (supported-systems (remove target-hurd? %supported-systems))
7631 (home-page "https://www.nico.schottelius.org/software/gpm/")
7632 (synopsis "Mouse support for the Linux console")
7633 (description
7634 "The GPM (general-purpose mouse) daemon is a mouse server for
7635applications running on the Linux console. It allows users to select items
7636and copy/paste text in the console and in xterm.")
7637 (license license:gpl2+)))
7638
7639(define-public gamemode
7640 (package
7641 (name "gamemode")
7642 (version "1.8.2")
7643 (source (origin
7644 (method git-fetch)
7645 (uri (git-reference
7646 (url "https://github.com/FeralInteractive/gamemode")
7647 (commit version)))
7648 (file-name (git-file-name name version))
7649 (sha256
7650 (base32 "14i3y385jzpr30lxk38z84rq76sy4cz0pwm54rm62f4mnk0xwjjp"))))
7651 (build-system meson-build-system)
7652 (arguments
7653 (list
7654 #:configure-flags
7655 #~(list
7656 ;; Don't build sample programs.
7657 "-Dwith-examples=false"
7658 ;; Build gamemoderun and other utilities.
7659 "-Dwith-util=true"
7660 ;; Use elogind instead of systemd for sd-bus.
7661 "-Dwith-sd-bus-provider=elogind"
7662 ;; Install PAM limits.d config to the package prefix; a Guix
7663 ;; service can then install it to /etc/security/limits.d/.
7664 (string-append "-Dwith-pam-limits-dir=" #$output
7665 "/etc/security/limits.d")
7666 ;; Guix does not use systemd.
7667 "-Dwith-systemd-user-unit=false"
7668 "-Dwith-systemd-group=false")
7669 #:phases
7670 #~(modify-phases %standard-phases
7671 (add-after 'unpack 'patch-references
7672 (lambda _
7673 (substitute* '("lib/gamemode_client.h"
7674 "data/gamemoderun")
7675 (("libgamemode(auto)?\\.so\\.0" lib)
7676 (string-append #$output "/lib/" lib))))))))
7677 (native-inputs
7678 (list pkg-config))
7679 (inputs
7680 (list
7681 dbus
7682 elogind
7683 libinih))
7684 (synopsis "Optimise Linux system performance on demand")
7685 (description "GameMode is a daemon and library for Linux that allows games to
7686request a set of optimisations be temporarily applied to the host OS and/or a
7687game process. GameMode was designed primarily as a stop-gap solution to problems
7688with the Intel and AMD CPU powersave or ondemand governors, but is now host to a
7689range of optimisation features and configurations, including CPU governor, I/O
7690priority, process niceness, kernel scheduler, screensaver inhibiting, GPU
7691performance mode, and custom scripts.")
7692 (home-page "https://github.com/FeralInteractive/gamemode")
7693 (license license:bsd-3)))
7694
7695(define-public btrfs-progs
7696 (package
7697 (name "btrfs-progs")
7698 (version "7.0")
7699 (source (origin
7700 (method url-fetch)
7701 (uri (string-append "mirror://kernel.org/linux/kernel/"
7702 "people/kdave/btrfs-progs/" "btrfs-progs-v"
7703 version ".tar.xz"))
7704 (sha256
7705 (base32
7706 "16cs5n1hm06ppkylkd9p7v13wdc0sb7y85xll0kj7mxwdj3xd1n2"))))
7707 (build-system gnu-build-system)
7708 (outputs '("out" "static")) ;static versions of the binaries in "out"
7709 (arguments
7710 (list
7711 #:configure-flags
7712 #~(list
7713 ;; Without --disable-documentation, it complains about missing
7714 ;; python-sphinx on systems where this package isn't available
7715 ;; (because it requires Rust).
7716 #$@(if (member (%current-system)
7717 (package-transitive-supported-systems
7718 python-sphinx))
7719 '()
7720 '("--disable-documentation"))
7721 ;; The ‘Python support’ was never actually installed by previous
7722 ;; versions of this package, but did prevent cross-compilation.
7723 "--disable-python")
7724 #:phases #~(modify-phases %standard-phases
7725 (add-after 'unpack 'patch-makefile
7726 (lambda* (#:key outputs #:allow-other-keys)
7727 (substitute* "Makefile"
7728 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
7729 (string-append (assoc-ref outputs "out")
7730 "/lib/udev/rules.d")))))
7731 (add-after 'build 'build-static
7732 (lambda _
7733 (invoke "make" "static")))
7734 (add-after 'install 'install-bash-completion
7735 (lambda* (#:key outputs #:allow-other-keys)
7736 (let* ((out (assoc-ref outputs "out"))
7737 (bashcomp (string-append out
7738 "/etc/bash_completion.d")))
7739 (mkdir-p bashcomp)
7740 (copy-file "btrfs-completion"
7741 (string-append bashcomp "/btrfs")))))
7742 (add-after 'install 'install-static
7743 (let ((staticbin (string-append (assoc-ref %outputs
7744 "static")
7745 "/bin")))
7746 (lambda _
7747 (invoke "make"
7748 (string-append "bindir=" staticbin)
7749 "install-static")))))
7750 #:tests? #f ;XXX: require the 'btrfs' kernel module.
7751 #:test-target "test"
7752 #:parallel-tests? #f)) ;tests fail when run in parallel
7753 (inputs (list e2fsprogs ;for btrfs-convert
7754 eudev
7755 lzo
7756 `(,util-linux "lib") ;for libblkid and libuuid
7757 `(,util-linux "static") ;ditto
7758 zlib
7759 `(,zlib "static")
7760 `(,zstd "lib")
7761 `(,zstd "static")))
7762 (native-inputs
7763 (append
7764 ;; For building documentation. Since python-sphinx requires Rust, add
7765 ;; it conditionally depending on such support.
7766 (if (supported-package? python-sphinx)
7767 (list python-wrapper python-sphinx python-sphinx-rtd-theme)
7768 '())
7769 (list pkg-config
7770 acl ;for tests
7771 lvm2 ;for dmsetup
7772 grep ;need Perl regexp support
7773 libaio
7774 liburing
7775 util-linux ;for fallocate
7776 which)))
7777 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
7778 (synopsis "Create and manage btrfs copy-on-write file systems")
7779 (description
7780 "Btrfs is a @acronym{CoW, copy-on-write} file system for Linux
7781aimed at implementing advanced features while focusing on fault tolerance,
7782repair and easy administration.")
7783 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
7784 ;; GPL2: Everything else.
7785 (license (list license:gpl2 license:gpl2+))))
7786
7787(define-public btrfs-progs/static
7788 (package
7789 (name "btrfs-progs-static")
7790 (version (package-version btrfs-progs))
7791 (source #f)
7792 (build-system trivial-build-system)
7793 (inputs
7794 `(("btrfs-progs:static" ,btrfs-progs "static")))
7795 (arguments
7796 `(#:modules ((guix build utils))
7797 #:builder
7798 (begin
7799 (use-modules (guix build utils)
7800 (ice-9 ftw)
7801 (srfi srfi-26))
7802
7803 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
7804 (out (assoc-ref %outputs "out"))
7805 (source (string-append btrfs "/bin/btrfs.static"))
7806 (target (string-append out "/bin/btrfs")))
7807 (mkdir-p (dirname target))
7808 (copy-file source target)
7809 (remove-store-references target)
7810 (chmod target #o555)
7811 #t))))
7812 (home-page (package-home-page btrfs-progs))
7813 (synopsis "Statically-linked btrfs command from btrfs-progs")
7814 (description "This package provides the statically-linked @command{btrfs}
7815from the btrfs-progs package. It is meant to be used in initrds.")
7816 (license (package-license btrfs-progs))))
7817
7818(define-public cramfs-tools
7819 (package
7820 (name "cramfs-tools")
7821 (home-page "https://github.com/npitre/cramfs-tools")
7822 (version "2.2")
7823 (source (origin
7824 (method git-fetch)
7825 (uri (git-reference
7826 (url home-page)
7827 (commit (string-append "v" version))))
7828 (sha256
7829 (base32 "1rx63qx2sdpzrgcmp7cskin670rnlp45jn90wxqgnqxvc5vr9l5k"))
7830 (file-name (git-file-name name version))))
7831 (build-system gnu-build-system)
7832 (arguments
7833 (list #:tests? #f ; No tests.
7834 #:phases
7835 #~(modify-phases %standard-phases
7836 (delete 'configure)
7837 (replace 'install
7838 (lambda _
7839 (let ((sbin (string-append #$output "/sbin")))
7840 (install-file "mkcramfs" sbin)
7841 (install-file "cramfsck" sbin)))))))
7842 (inputs
7843 (list zlib))
7844 (synopsis "Tools to manage Cramfs file systems")
7845 (description "Cramfs is a Linux file system designed to be simple, small,
7846and to compress things well. It is used on a number of embedded systems and
7847small devices. This version has additional features such as uncompressed
7848blocks and random block placement.")
7849 (license license:gpl2+)))
7850
7851(define-public compsize
7852 (let ((commit "d79eacf77abe3b799387bb8a4e07a18f1f1031e8")
7853 (revision "0"))
7854 (package
7855 (name "compsize")
7856 (version (git-version "1.5" revision commit))
7857 (home-page "https://github.com/kilobyte/compsize")
7858 (source (origin
7859 (method git-fetch)
7860 (uri (git-reference
7861 (url home-page)
7862 (commit commit)))
7863 (sha256
7864 (base32 "02fvgy12m50rg1snp555a1kc3cm01g2imb81cih7ikhkbjbca0d7"))
7865 (file-name (git-file-name name version))
7866 (patches
7867 (search-patches "compsize-fix-btrfs-progs-compatibility.patch"))))
7868 (build-system gnu-build-system)
7869 (inputs
7870 (list btrfs-progs))
7871 (arguments
7872 `(#:tests? #f ; No tests.
7873 #:make-flags
7874 (list (string-append "CC=" ,(cc-for-target)))
7875 #:phases
7876 (modify-phases %standard-phases
7877 (delete 'configure)
7878 (replace 'install
7879 (lambda* (#:key outputs #:allow-other-keys)
7880 (let ((out (assoc-ref outputs "out")))
7881 (install-file "compsize" (string-append out "/bin"))
7882 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
7883 (synopsis "Find compression type/ratio on Btrfs files")
7884 (description "@command{compsize} takes a list of files (given as
7885arguments) on a Btrfs file system and measures used compression types and
7886effective compression ratio, producing a report.
7887
7888A directory has no extents but has a (recursive) list of files. A non-regular
7889file is silently ignored.
7890
7891As it makes no sense to talk about compression ratio of a partial extent,
7892every referenced extent is counted whole, exactly once -- no matter if you use
7893only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
7894uncompressed size will not match the number given by @command{tar} or
7895@command{du}. On the other hand, the space used should be accurate (although
7896obviously it can be shared with files outside our set).")
7897 (license license:gpl2+))))
7898
7899(define-public f2fs-tools
7900 (package
7901 (name "f2fs-tools")
7902 (version "1.16.0")
7903 (source (origin
7904 (method git-fetch)
7905 (uri (git-reference
7906 (url "https://git.kernel.org/pub/scm/linux/kernel\
7907/git/jaegeuk/f2fs-tools.git")
7908 (commit (string-append "v" version))))
7909 (file-name (git-file-name name version))
7910 (sha256
7911 (base32
7912 "0832ix3jnmfagx53wr6clc3q4ay7cbashfj7jirk01gyzwbvblfc"))))
7913 (build-system gnu-build-system)
7914 (native-inputs
7915 (list autoconf automake libtool pkg-config))
7916 (inputs
7917 (list `(,util-linux "lib"))) ;for libuuid
7918 (home-page "https://f2fs.wiki.kernel.org/")
7919 (synopsis "Userland tools for f2fs")
7920 (description
7921 "F2FS, the Flash-Friendly File System, is a modern file system
7922designed to be fast and durable on flash devices such as solid-state
7923disks and SD cards. This package provides the userland utilities.")
7924 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
7925 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
7926 (license (list license:gpl2 license:lgpl2.1))))
7927
7928(define-public f2fs-tools-1.7
7929 (package
7930 (inherit f2fs-tools)
7931 (name "f2fs-tools")
7932 (version "1.7.0")
7933 (source (origin
7934 (method git-fetch)
7935 (uri (git-reference
7936 (url (git-reference-url
7937 (origin-uri (package-source f2fs-tools))))
7938 (commit (string-append "v" version))))
7939 (file-name (git-file-name name version))
7940 (sha256
7941 (base32
7942 "0wpzklw8smnngng0dm25jdmi7v5zfhpz02dksyxpz0a7kzzvnqqm"))))
7943 (inputs
7944 (list `(,util-linux "lib") libselinux))
7945 (arguments
7946 '(#:configure-flags '("CFLAGS=-fcommon")
7947 #:phases
7948 (modify-phases %standard-phases
7949 (add-after 'install 'install-headers
7950 (lambda* (#:key outputs #:allow-other-keys)
7951 (let* ((out (assoc-ref outputs "out"))
7952 (out-include (string-append out "/include")))
7953 (install-file "include/f2fs_fs.h" out-include)
7954 (install-file "mkfs/f2fs_format_utils.h" out-include)))))))))
7955
7956(define-public f2fs-tools/static
7957 (static-package
7958 (package
7959 (inherit f2fs-tools)
7960 (name "f2fs-tools-static")
7961 (arguments
7962 `(#:configure-flags
7963 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
7964 (libuuid (assoc-ref %build-inputs "libuuid")))
7965 (list
7966 (string-append "libuuid_CFLAGS=-I" libuuid "/include/uuid")
7967 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
7968 (string-append "libblkid_CFLAGS=-I" libuuid "/include/uuid "
7969 "-I" libuuid "/include/blkid")
7970 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
7971 #:disallowed-references (,(this-package-input "libuuid"))
7972 #:make-flags '("LDFLAGS=-all-static")
7973 #:phases
7974 (modify-phases %standard-phases ; TODO: f2fs phases.
7975 (add-after 'install 'remove-store-references
7976 (lambda* (#:key outputs #:allow-other-keys)
7977 ;; Work around bug in our util-linux.
7978 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
7979 (remove-store-references (string-append (assoc-ref outputs "out")
7980 "/sbin/mkfs.f2fs"))
7981 #t)))))
7982 (inputs
7983 `(("libuuid:static" ,util-linux "static")
7984 ("libuuid" ,util-linux "lib")))))) ; for include files
7985
7986(define-public f2fs-fsck/static
7987 (package
7988 (name "f2fs-fsck-static")
7989 (version (package-version f2fs-tools/static))
7990 (source #f)
7991 (build-system trivial-build-system)
7992 (arguments
7993 `(#:modules ((guix build utils))
7994 #:builder
7995 (begin
7996 (use-modules (guix build utils)
7997 (ice-9 ftw)
7998 (srfi srfi-26))
7999 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
8000 (fsck "fsck.f2fs")
8001 (out (assoc-ref %outputs "out"))
8002 (sbin (string-append out "/sbin")))
8003 (mkdir-p sbin)
8004 (with-directory-excursion sbin
8005 (install-file (string-append f2fs-tools "/sbin/" fsck)
8006 ".")
8007 (remove-store-references fsck)
8008 (chmod fsck #o555))
8009 #t))))
8010 (inputs
8011 (list f2fs-tools/static))
8012 (home-page (package-home-page f2fs-tools/static))
8013 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
8014 (description "This package provides statically-linked fsck.f2fs command taken
8015from the f2fs-tools package. It is meant to be used in initrds.")
8016 (license (package-license f2fs-tools/static))))
8017
8018(define-public freefall
8019 (package
8020 (name "freefall")
8021 (version (package-version linux-libre))
8022 (source (package-source linux-libre))
8023 (build-system gnu-build-system)
8024 (arguments
8025 '(#:phases (modify-phases %standard-phases
8026 (add-after 'unpack 'enter-subdirectory
8027 (lambda _
8028 (chdir "tools/laptop/freefall")
8029 #t))
8030 (delete 'configure)
8031 (add-before 'build 'increase-timeout
8032 (lambda _
8033 ;; The default of 2 seconds is too low: it assumes an
8034 ;; open lid and AC power without actually checking.
8035 (substitute* "freefall.c"
8036 (("alarm\\(2\\)") "alarm(5)"))
8037 #t)))
8038 #:make-flags (list (string-append "PREFIX="
8039 (assoc-ref %outputs "out"))
8040 "CC=gcc")
8041 #:tests? #f)) ;no tests
8042 (home-page (package-home-page linux-libre))
8043 (synopsis "Free-fall protection for spinning laptop hard drives")
8044 (description
8045 "Prevents shock damage to the internal spinning hard drive(s) of some
8046HP and Dell laptops. When sudden movement is detected, all input/output
8047operations on the drive are suspended and its heads are parked on the ramp,
8048where they are less likely to cause damage to the spinning disc. Requires a
8049drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
8050feature, and a laptop with an accelerometer. It has no effect on SSDs.")
8051 (license license:gpl2)))
8052
8053
8054(define-public nbfc-linux
8055 (let ((version "0.1.7")
8056 (commit "4c2b75e4a875459e86a9892319889ff945e9cadf")
8057 (revision "0"))
8058 (package
8059 (name "nbfc-linux")
8060 (version (git-version version revision commit))
8061 (source (origin
8062 (method git-fetch)
8063 (uri (git-reference
8064 (url "https://github.com/nbfc-linux/nbfc-linux")
8065 (commit commit)))
8066 (file-name (git-file-name name version))
8067 (sha256
8068 (base32
8069 "0mmyfaigrh3fd5v11a8p38km4m02qzsfx8yh72g0z405bzhqn5jk"))))
8070 (build-system gnu-build-system)
8071 (arguments
8072 `(#:make-flags (list (string-append "CC="
8073 ,(cc-for-target))
8074 (string-append "PREFIX="
8075 (assoc-ref %outputs "out")))
8076 #:tests? #f
8077 #:phases (modify-phases %standard-phases
8078 (delete 'configure))))
8079 (native-inputs (list pkg-config))
8080 (propagated-inputs (list python dmidecode))
8081 (synopsis "NoteBook FanControl ported to Linux")
8082 (description
8083 "This package provides a C port of NoteBook FanControl (NBFC), a fan
8084control service for notebooks. It provides the same utilities with the same
8085interfaces as the original NBFC, although the implementation differs.")
8086 (home-page "https://github.com/nbfc-linux/nbfc-linux")
8087 (license license:gpl3+))))
8088
8089(define-public thinkfan
8090 (package
8091 (name "thinkfan")
8092 (version "2.0.0")
8093 (source
8094 (origin
8095 (method git-fetch)
8096 (uri (git-reference
8097 (url "https://github.com/vmatare/thinkfan")
8098 (commit version)))
8099 (file-name (git-file-name name version))
8100 (sha256
8101 (base32 "1jdjqdbv0m7yf9g4rxs7nq1ldh2b81a7qx4vcf9lzw7jwlydd822"))))
8102 (build-system cmake-build-system)
8103 (arguments
8104 (list
8105 #:modules '((guix build cmake-build-system)
8106 (guix build utils)
8107 (srfi srfi-26))
8108 #:tests? #f ; no test target
8109 #:configure-flags
8110 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
8111 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
8112 ;; inefficient’.
8113 #~(list "-DUSE_ATASMART:BOOL=ON")
8114 #:phases
8115 #~(modify-phases %standard-phases
8116 (add-after 'unpack 'create-init-scripts
8117 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
8118 ;; systemd to patch and install their service files. Fake their
8119 ;; presence rather than duplicating the build system below. Leave
8120 ;; things like ‘/bin/kill’ because they're not worth a dependency.
8121 ;; The sysvinit needs manual patching, but since upstream doesn't
8122 ;; even provide the option to install it: don't.
8123 (lambda _
8124 (substitute* "CMakeLists.txt"
8125 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
8126 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
8127 ;; That was easy! Now we just need to fix the destinations.
8128 (("/etc" directory)
8129 (string-append #$output directory))))))))
8130 (native-inputs
8131 (list pkg-config))
8132 (inputs
8133 `(("libatasmart" ,libatasmart)
8134 ("lm-sensors" ,lm-sensors "lib")
8135 ("yaml-cpp" ,yaml-cpp)))
8136 (home-page "https://github.com/vmatare/thinkfan")
8137 (synopsis "Simple fan control program")
8138 (description
8139 "Thinkfan is a simple fan control program. It reads temperatures,
8140checks them against configured limits and switches to appropriate (also
8141pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
8142other @code{hwmon} driver that enables temperature reading and fan control
8143from userspace.")
8144 (license license:gpl3+)))
8145
8146(define-public tpacpi-bat
8147 (package
8148 (name "tpacpi-bat")
8149 (version "3.2")
8150 (source
8151 (origin
8152 (method git-fetch)
8153 (uri (git-reference
8154 (url "https://github.com/teleshoes/tpacpi-bat")
8155 (commit (string-append "v" version))))
8156 (file-name (git-file-name name version))
8157 (sha256
8158 (base32 "0nd8s2bqbhl0sjpflphb4l9ix71p7kvnbvkq4dg9a1v0sxafyygm"))))
8159 (build-system gnu-build-system)
8160 (arguments
8161 `(#:tests? #f ; no test target
8162 #:phases
8163 (modify-phases %standard-phases
8164 (add-after 'unpack 'refer-to-inputs
8165 (lambda* (#:key inputs #:allow-other-keys)
8166 (substitute* "tpacpi-bat"
8167 (("cat ")
8168 (string-append (search-input-file inputs "bin/cat") " "))
8169 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
8170 ;; loaded. That's the administrator's prerogative; disable it.
8171 (("system \"(modprobe .*)\"" _ match)
8172 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))))
8173 (delete 'configure) ; nothing to configure
8174 (delete 'build) ; nothing to build
8175 (replace 'install
8176 (lambda* (#:key outputs #:allow-other-keys)
8177 (let* ((out (assoc-ref outputs "out"))
8178 (bin (string-append out "/bin"))
8179 (doc (string-append out "/share/doc/" ,name "-" ,version)))
8180 (install-file "tpacpi-bat" bin)
8181
8182 ;; There's no man page. Install other forms of documentation.
8183 (for-each (lambda (file)
8184 (let ((target (string-append doc "/" file)))
8185 (mkdir-p (dirname target))
8186 (copy-recursively file target)))
8187 (list "battery_asl" "examples" "README.md"))))))))
8188 (inputs
8189 (list coreutils-minimal
8190 perl))
8191 (home-page "https://github.com/teleshoes/tpacpi-bat")
8192 (synopsis "ThinkPad battery charge controller")
8193 (description
8194 "Tpacpi-bat is a command-line interface to control battery charging on
8195@uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
8196ThinkPad models released after 2011}, starting with the xx20 series. It can
8197query and set the thresholds at which one or both batteries will start and stop
8198charging, inhibit charging batteries for a set period of time, or force them to
8199discharge when they otherwise would not.
8200
8201This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
8202kernel module provided by the @code{acpi-call-linux-module} package, which must
8203be installed and loaded separately. Only the original vendor firmware is
8204supported.")
8205 (license license:gpl3+)))
8206
8207(define-public tmon
8208 (package
8209 (name "tmon")
8210 ;; Tmon's ‘VERSION = 1.0’ hasn't been touched since 2013; the code has.
8211 (version (package-version linux-libre))
8212 (source (package-source linux-libre))
8213 (build-system gnu-build-system)
8214 (arguments
8215 (list
8216 #:tests? #f ; no test suite
8217 #:make-flags
8218 #~(list (string-append "CC=" #$(cc-for-target))
8219 (string-append "INSTALL_ROOT=" #$output)
8220 "BINDIR=bin")
8221 #:phases
8222 #~(modify-phases %standard-phases
8223 (add-after 'unpack 'enter-subdirectory
8224 (lambda _
8225 (chdir "tools/thermal/tmon")))
8226 (add-after 'install 'install-man-page
8227 (lambda _
8228 (let ((man8 (string-append #$output "/share/man/man8")))
8229 (install-file "tmon.8" man8))))
8230 (delete 'configure)))) ; no configure script
8231 (inputs
8232 (list ncurses))
8233 (home-page (package-home-page linux-libre))
8234 (synopsis "Monitor and test the Linux thermal subsystem in real time")
8235 (description
8236 "Tmon is a tool to interact with the complex thermal subsystem of the
8237kernel Linux. It helps visualize thermal relationships and real-time thermal
8238data, tune and test cooling devices and sensors, and collect thermal data for
8239further analysis.
8240
8241As computers become smaller and more thermally constrained, more sensors are
8242added and new cooling capabilities introduced. Thermal relationships can change
8243dynamically. Their complexity grows exponentially among cooling devices, zones,
8244sensors, and trip points.
8245
8246Linux exposes this relationship through @file{/sys/class/thermal} with a matrix
8247of symbolic links, trip point bindings, and device instances. To traverse it
8248by hand is no trivial task: @command{tmon} aims to make it understandable.")
8249 (license (list license:gpl2 ; the man page
8250 license:gpl2+)))) ; the actual rest
8251
8252(define-public turbostat
8253 (package
8254 (name "turbostat")
8255 ;; XXX turbostat reports a version like ‘20.09.30’ but using it here would
8256 ;; make it harder to benefit from ‘free’ linux-libre package updates.
8257 (version (package-version linux-libre))
8258 (source (package-source linux-libre))
8259 (build-system gnu-build-system)
8260 (arguments
8261 (list
8262 #:tests? #f ;no test suite
8263 #:make-flags
8264 #~(list (string-append "CC=" #$(cc-for-target))
8265 (string-append "PREFIX=" #$output))
8266 #:phases
8267 #~(modify-phases %standard-phases
8268 (add-after 'unpack 'enter-subdirectory
8269 (lambda _
8270 (chdir "tools/power/x86/turbostat")))
8271 (delete 'configure)))) ;no configure script
8272 (inputs
8273 (list libcap))
8274 (supported-systems '("i686-linux" "x86_64-linux"))
8275 (home-page (package-home-page linux-libre))
8276 (synopsis "Report x86 processor frequency and idle statistics")
8277 (description
8278 "Turbostat reports x86 processor topology, frequency, idle power state
8279statistics, temperature, and power consumption. Some information is unavailable
8280on older processors.
8281
8282It can be used to identify machines that are inefficient in terms of power usage
8283or idle time, report the rate of @acronym{SMI, system management interrupt}s
8284occurring on the system, or verify the effects of power management tuning.
8285
8286@command{turbostat} reads hardware counters but doesn't write to them, so it
8287won't interfere with the OS or other running processes---including multiple
8288invocations of itself.")
8289 (license license:gpl2)))
8290
8291(define-public ntfs-3g
8292 (package
8293 (name "ntfs-3g")
8294 (version "2026.7.7")
8295 (source (origin
8296 (method git-fetch)
8297 (uri
8298 (git-reference
8299 (url "https://github.com/tuxera/ntfs-3g")
8300 (commit version)))
8301 (file-name (git-file-name name version))
8302 (sha256
8303 (base32
8304 "0kkpmi28qihwmnyvdnkj0azrd7zr6wkv590pjfmbbhn1w4qfp7gd"))
8305 (patches
8306 (search-patches "ntfs-3g-autoconf-sbin-helpers.patch"
8307 "ntfs-3g-consistent-sbindir-usage.patch"))))
8308 (build-system gnu-build-system)
8309 (inputs (list util-linux ; libuuid
8310 kmod
8311 fuse-2))
8312 (native-inputs (list pkg-config autoconf automake libtool
8313 libgcrypt)) ; for m4 macros
8314 (arguments
8315 (list
8316 #:configure-flags
8317 #~(list "--disable-static"
8318 "--disable-ldconfig" ;not necessary
8319 "--exec-prefix=${prefix}"
8320 "--with-fuse=external" ;use our own FUSE
8321 "--enable-mount-helper"
8322 (string-append "--with-modprobe-helper="
8323 #$(this-package-input "kmod") "/bin/modprobe")
8324 "--enable-posix-acls"
8325 "--enable-xattr-mappings")
8326 #:phases
8327 #~(modify-phases %standard-phases
8328 ;; If users install ntfs-3g, they probably want to make it the
8329 ;; default driver as well, so we opt for sensible defaults and link
8330 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
8331 ;; mount NTFS file systems.)
8332 (add-after 'install 'install-link
8333 (lambda* (#:key outputs #:allow-other-keys)
8334 (let* ((out (assoc-ref outputs "out"))
8335 (sbin (string-append out "/sbin")))
8336 (symlink "mount.ntfs-3g"
8337 (string-append sbin "/mount.ntfs"))))))))
8338 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
8339 (synopsis "Read-write access to NTFS file systems")
8340 (description
8341 "NTFS-3G provides read-write access to NTFS file systems, which are
8342commonly found on Microsoft Windows. It is implemented as a FUSE file system.
8343The package provides additional NTFS tools.")
8344 (license license:gpl2+)))
8345
8346(define-public ntfs-3g/static
8347 (static-package
8348 (package
8349 (inherit ntfs-3g)
8350 (name "ntfs-3g-static")
8351 (arguments
8352 (substitute-keyword-arguments arguments
8353 ((#:configure-flags flags)
8354 #~(cons* "--enable-really-static"
8355 ;; The FUSE driver isn't currently used by our initrd.
8356 "--disable-ntfs-3g"
8357 #$flags))
8358 ((#:phases phases)
8359 #~(modify-phases #$phases
8360 (add-after 'unpack 'make-really-static-really-static
8361 (lambda _
8362 (substitute* "ntfsprogs/Makefile.am"
8363 ((" -static") " -all-static"))))
8364 (delete 'install-link))))))))
8365
8366(define-public ntfsfix/static
8367 (package
8368 (name "ntfsfix-static")
8369 (version (package-version ntfs-3g/static))
8370 (source #f)
8371 (build-system trivial-build-system)
8372 (arguments
8373 (list
8374 #:modules `((guix build utils))
8375 #:builder
8376 #~(begin
8377 (use-modules (guix build utils))
8378 (let ((bin (string-append #$output "/bin")))
8379 (install-file (search-input-file %build-inputs "/bin/ntfsfix") bin)
8380 (with-directory-excursion bin
8381 (remove-store-references "ntfsfix"))))))
8382 (inputs (list ntfs-3g/static))
8383 (home-page (package-home-page ntfs-3g/static))
8384 (synopsis "Statically linked @command{ntfsfix} from ntfs-3g")
8385 (description
8386 "This package provides a statically linked @command{ntfsfix} taken
8387from the ntfs-3g package. It is meant to be used in initrds.")
8388 (license (package-license ntfs-3g/static))))
8389
8390(define-public rdma-core
8391 (package
8392 (name "rdma-core")
8393 (version "62.0")
8394 (source (origin
8395 (method url-fetch)
8396 (uri (string-append "https://github.com/linux-rdma/rdma-core"
8397 "/releases/download/v" version "/rdma-core-"
8398 version ".tar.gz"))
8399 (sha256
8400 (base32
8401 "1802afy4q80zl7qkxlyq71ll5fsksva43f8xfd6vlqj1c47dc2n0"))))
8402 (build-system cmake-build-system)
8403 (arguments
8404 `(#:tests? #f ;no tests
8405
8406 ;; Upstream uses the "ninja" build system and encourage distros
8407 ;; to do the same for consistency.
8408 #:generator "Ninja"
8409 #:configure-flags
8410 (list (string-append "-DRST2MAN_EXECUTABLE="
8411 (search-input-file
8412 %build-inputs "/bin/rst2man.py")))))
8413 (native-inputs
8414 (list pkg-config python-wrapper python-docutils-0.19)) ;for 'rst2man'
8415 (inputs
8416 (list libnl eudev))
8417 (home-page "https://github.com/linux-rdma/rdma-core")
8418 (synopsis "Utilities and libraries for working with RDMA devices")
8419 (description
8420 "This package provides userspace components for the InfiniBand
8421subsystem of the Linux kernel. Specifically it contains userspace
8422libraries for the following device nodes:
8423
8424@enumerate
8425@item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
8426@item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
8427@item @file{/dev/infiniband/umadX} (@code{libibumad})
8428@end enumerate
8429
8430The following service daemons are also provided:
8431@enumerate
8432@item @code{srp_daemon} (for the @code{ib_srp} kernel module)
8433@item @code{iwpmd} (for iWARP kernel providers)
8434@item @code{ibacm} (for InfiniBand communication management assistant)
8435@end enumerate")
8436 ;; All library code is dual licensed under GPL2 and a custom MIT
8437 ;; variant. The package also includes some components covered by
8438 ;; other licenses. Consult COPYING.md for full details.
8439 (license
8440 (list license:gpl2
8441 (license:x11-style "See COPYING.BSD_MIT in the distribution")
8442 license:bsd-2 ; Files referring to COPYING.BSD_FB
8443 license:cc0 ; most files in ccan/
8444 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
8445
8446(define-public perftest
8447 (package
8448 (name "perftest")
8449 (version "4.5-0.20")
8450 (home-page "https://github.com/linux-rdma/perftest")
8451 (source (origin
8452 (method git-fetch)
8453 (uri (git-reference (url home-page)
8454 (commit (string-append "v" version))))
8455 (file-name (git-file-name name version))
8456 (sha256
8457 (base32
8458 "1hrpzmkz1kq4jwpy6b5fl8073iy7dllcq2hfzdw6waaf5920vd64"))))
8459 (build-system gnu-build-system)
8460 (native-inputs
8461 (list autoconf automake libtool))
8462 (inputs (list pciutils rdma-core))
8463 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
8464 (description "This is a collection of tests written over uverbs intended
8465for use as a performance micro-benchmark. The tests may be used for hardware
8466or software tuning as well as for functional testing.
8467
8468The collection contains a set of bandwidth and latency benchmark such as:
8469@enumerate
8470@item Send - @code{ib_send_bw} and @code{ib_send_lat}
8471@item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
8472@item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
8473@item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
8474@item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
8475@end enumerate")
8476 (license license:gpl2)))
8477
8478(define-public rng-tools
8479 (package
8480 (name "rng-tools")
8481 (home-page "https://github.com/nhorman/rng-tools")
8482 (version "6.17")
8483 (source (origin
8484 (method git-fetch)
8485 (uri (git-reference (url home-page)
8486 (commit (string-append "v" version))))
8487 (file-name (git-file-name name version))
8488 (sha256
8489 (base32
8490 "0vvqi9ha4jbk4086x2q98p4ip3z56sfdpyckdyknsd36zhp6z8n2"))
8491 (patches
8492 (search-patches "rng-tools-revert-build-randstat.patch"))
8493 (patch-flags '("-p0"))))
8494 (build-system gnu-build-system)
8495 (arguments
8496 (list
8497 ;; Disable support for various hardware entropy sources as they need
8498 ;; dependencies that are not yet in Guix, and would significantly
8499 ;; increase closure size.
8500 #:configure-flags #~(list "--without-nistbeacon"
8501 "--without-pkcs11"
8502 "--without-rtlsdr"
8503 "--without-qrypt")
8504 #:phases
8505 #~(modify-phases %standard-phases
8506 (add-before 'check 'disable-failing-test
8507 (lambda _
8508 (substitute* "tests/Makefile"
8509 ;; This test requires a hwrng, rdrand, or tpm device.
8510 ;; Worse, it appears to fail if that isn't sufficiently random.
8511 (("\\brngtestjitter\\.sh\\b") " ")))))))
8512 (native-inputs
8513 (list autoconf automake pkg-config))
8514 (inputs
8515 (list libcap sysfsutils openssl))
8516 (synopsis "Random number generator daemon")
8517 (description
8518 "Monitor a hardware random number generator, and supply entropy
8519from that to the system kernel's @file{/dev/random} machinery.")
8520 ;; The source package is offered under the GPL2+, but the files
8521 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
8522 (license (list license:gpl2 license:gpl2+))))
8523
8524(define-public cpupower
8525 (package
8526 (name "cpupower")
8527 (version (package-version linux-libre))
8528 (source (package-source linux-libre))
8529 (build-system gnu-build-system)
8530 (arguments
8531 (list #:make-flags
8532 #~(list "CC=gcc"
8533 (string-append "DESTDIR=" #$output)
8534 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
8535 "docdir=/share/doc/cpupower" ;drop default ‘packages/’
8536 "confdir=$(docdir)/examples"
8537 ;; The Makefile recommends the following changes.
8538 "DEBUG=false"
8539 "[email protected]")
8540 #:tests? #f ; no tests
8541 #:phases
8542 #~(modify-phases %standard-phases
8543 (add-after 'unpack 'enter-subdirectory
8544 (lambda _
8545 (chdir "tools/power/cpupower")))
8546 (delete 'configure) ; no configure script
8547 (add-before 'build 'fix-makefiles
8548 (lambda _
8549 (substitute* "Makefile"
8550 (("/usr/") "/")
8551 (("/bin/(install)" _ command) command))
8552 (substitute* "bench/Makefile"
8553 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))))
8554 (native-inputs (list gettext-minimal
8555 which)) ;to find gettext
8556 (inputs (list pciutils))
8557 (home-page (package-home-page linux-libre))
8558 (synopsis "CPU frequency and voltage scaling tools for Linux")
8559 (description
8560 "cpupower is a set of user-space tools that use the cpufreq feature of the
8561Linux kernel to retrieve and control processor features related to power saving,
8562such as frequency and voltage scaling.")
8563 (license license:gpl2)))
8564
8565(define-public x86-energy-perf-policy
8566 (package
8567 (name "x86-energy-perf-policy")
8568 (version (package-version linux-libre))
8569 (source (package-source linux-libre))
8570 (build-system gnu-build-system)
8571 (arguments
8572 '(#:tests? #f
8573 #:phases
8574 (modify-phases %standard-phases
8575 (add-after 'unpack 'enter-subdirectory
8576 (lambda _
8577 (chdir "tools/power/x86/x86_energy_perf_policy")
8578 #t))
8579 (delete 'configure)
8580 (add-before 'build 'fix-makefile
8581 (lambda _
8582 (substitute* "Makefile" (("/usr") ""))
8583 #t)))
8584 #:make-flags
8585 (let ((out (assoc-ref %outputs "out")))
8586 (list (string-append "DESTDIR=" out)
8587 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
8588 (supported-systems '("i686-linux" "x86_64-linux"))
8589 (home-page (package-home-page linux-libre))
8590 (synopsis "Display and update Intel-CPU energy-performance policy")
8591 (description
8592 "@command{x86_energy_perf_policy} displays and updates energy-performance
8593policy settings specific to Intel Architecture Processors. Settings are
8594accessed via Model Specific Register (MSR) updates, no matter if the Linux
8595cpufreq sub-system is enabled or not.")
8596 (license license:gpl2)))
8597
8598(define-public haveged
8599 (package
8600 (name "haveged")
8601 (version "1.9.19")
8602 (source
8603 (origin
8604 (method git-fetch)
8605 (uri (git-reference
8606 (url "https://github.com/jirka-h/haveged")
8607 (commit (string-append "v" version))))
8608 (file-name (git-file-name name version))
8609 (sha256
8610 (base32 "1qka68dlfz9z3gjfvfwvh60l2121c1yx0z264jqsf2vjp5f0xbmn"))))
8611 (build-system gnu-build-system)
8612 (arguments
8613 `(#:configure-flags
8614 (list "--disable-static")))
8615 (home-page "https://www.issihosts.com/haveged")
8616 (synopsis "Entropy source for the Linux random number generator")
8617 (description
8618 "haveged generates an unpredictable stream of random numbers for use by
8619Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
8620standard mechanisms for filling the entropy pool may not be sufficient for
8621systems with high needs or limited user interaction, such as headless servers.
8622
8623@command{haveged} runs as a privileged daemon, harvesting randomness from the
8624indirect effects of hardware events on hidden processor state using the
8625@acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
8626It tunes itself to its environment and provides the same built-in test suite
8627for the output stream as used on certified hardware security devices.
8628
8629The quality of the randomness produced by this algorithm has not been proven.
8630It is recommended to run it together with another entropy source like rngd, and
8631not as a replacement for it.")
8632 (license (list (license:non-copyleft "file://nist/mconf.h")
8633 (license:non-copyleft "file://nist/packtest.c")
8634 license:public-domain ; nist/dfft.c
8635 license:gpl3+)))) ; everything else
8636
8637(define-public hotspot
8638 (package
8639 (name "hotspot")
8640 (version "1.6.0")
8641 (source (origin
8642 (method git-fetch)
8643 (uri (git-reference
8644 (url "https://github.com/KDAB/hotspot")
8645 (commit version)
8646 ;; Include the bundled perfparser and PrefixTickLabels
8647 ;; libraries, which are to be used in source form.
8648 (recursive? #t)))
8649 (file-name (git-file-name name version))
8650 (sha256
8651 (base32
8652 "065pcibr4m2ixjlq9nf45g22f73zsxabll361bjjnmkfv6xhz1r4"))))
8653 (build-system qt-build-system)
8654 (arguments
8655 (list
8656 ;; As mentioned in the option help text, the KAuth helper cannot be
8657 ;; installed to a custom prefix and the build fails with "file cannot
8658 ;; create directory: /polkit-1/actions. Maybe need administrative"
8659 ;; (see: <https://bugs.kde.org/show_bug.cgi?id=363678>).
8660 #:configure-flags #~(list "-DINSTALL_KAUTH_HELPER=OFF"
8661 "-DQT6_BUILD=ON")
8662 #:qtbase qtbase
8663 ;; The 'tst_models' and 'tst_callgraphgenerator' fail, with
8664 ;; the later seemingly requiring sudo or access to the kernel
8665 ;; trace points.
8666 #:test-exclude
8667 (string-append
8668 "("
8669 (string-join
8670 ;; The 'tst_models' expected output doesn't exactly
8671 ;; match.
8672 '("tst_models"
8673 ;; The 'tst_callgraphgenerator' perf invocation
8674 ;; fails when run in the build container.
8675 "tst_callgraphgenerator"
8676 ;; The 'tst_perfparser' test requires sudo/access
8677 ;; to the kernel scheduler trace points.
8678 "tst_perfparser")
8679 "|")
8680 ")")
8681 #:phases
8682 #~(modify-phases %standard-phases
8683 (add-after 'unpack 'patch-perfparser
8684 ;; XXX: This phase is copied from qt-creator: keep them in sync!
8685 (lambda* (#:key inputs #:allow-other-keys)
8686 ;; perfparser attempts to dynamically load the demangle
8687 ;; libraries; use their absolute file name to avoid having to
8688 ;; set LD_LIBRARY_PATH.
8689 (let ((librustc_demangle.so
8690 (with-exception-handler (lambda (ex)
8691 (if (search-error? ex)
8692 #f
8693 (raise-exception ex)))
8694 (lambda ()
8695 (search-input-file inputs "lib/librustc_demangle.so"))
8696 #:unwind? #t)))
8697 (substitute* "3rdparty/perfparser/app/demangler.cpp"
8698 (("loadDemangleLib\\(QStringLiteral\\(\"rustc_demangle\")"
8699 all)
8700 (if librustc_demangle.so
8701 (format #f "loadDemangleLib(QStringLiteral(~s)"
8702 librustc_demangle.so)
8703 all)) ;no rustc_demangle; leave unchanged
8704 (("loadDemangleLib\\(QStringLiteral\\(\"d_demangle\")")
8705 (format #f "loadDemangleLib(QStringLiteral(~s)"
8706 (search-input-file inputs
8707 "lib/libd_demangle.so")))))))
8708 (add-after 'unpack 'path-paths
8709 (lambda* (#:key inputs #:allow-other-keys)
8710 (substitute* "src/perfoutputwidgetkonsole.cpp"
8711 (("\"tail\"")
8712 (format #f "~s" (search-input-file inputs "bin/tail"))))
8713 (substitute* "src/perfrecord.cpp"
8714 (("\"perf( )?\"" _ space)
8715 (string-append "\"" (search-input-file inputs "bin/perf")
8716 (or space "") "\""))))))))
8717 (native-inputs
8718 (list extra-cmake-modules
8719 vulkan-headers))
8720 (inputs
8721 (append
8722 (list coreutils-minimal
8723 d-demangler
8724 elfutils
8725 karchive
8726 kconfig
8727 kcoreaddons
8728 kddockwidgets
8729 kgraphviewer
8730 ki18n
8731 kio
8732 kiconthemes
8733 kitemmodels
8734 kitemviews
8735 knotifications
8736 kparts
8737 ksyntaxhighlighting
8738 kwindowsystem
8739 libxkbcommon
8740 perf
8741 qtdeclarative
8742 qtsvg
8743 solid
8744 threadweaver
8745 `(,zstd "lib"))
8746 (if (supported-package? rust-rustc-demangle-capi-0.1)
8747 (list rust-rustc-demangle-capi-0.1)
8748 '())))
8749 (home-page "https://github.com/KDAB/hotspot")
8750 (synopsis "Performance analysis GUI for Linux perf")
8751 (description "Hotspot is a standalone GUI for performance data analysis.
8752It aims to be similar to KCachegrind, but for data collected with
8753@command{perf}, a profiler for use with the kernel Linux. Its main feature is
8754graphically visualizing a @file{perf.data} file.")
8755 (license (list license:gpl2+ license:gpl3+)))) ;dual licensed
8756
8757(define-public ecryptfs-utils
8758 (package
8759 (name "ecryptfs-utils")
8760 (version "111")
8761 (source
8762 (origin
8763 (method url-fetch)
8764 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
8765 version "/+download/ecryptfs-utils_"
8766 version ".orig.tar.gz"))
8767 (sha256
8768 (base32
8769 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
8770 (build-system gnu-build-system)
8771 (arguments
8772 `(#:configure-flags (list "--disable-pywrap")
8773 #:modules (,@%default-gnu-modules
8774 (ice-9 binary-ports)
8775 (rnrs bytevectors)
8776 (srfi srfi-26))
8777 #:phases
8778 (modify-phases %standard-phases
8779 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
8780 (lambda* (#:key inputs outputs #:allow-other-keys)
8781 (let ((out (assoc-ref outputs "out"))
8782 (util-linux (assoc-ref inputs "util-linux"))
8783 (cryptsetup (assoc-ref inputs "cryptsetup-minimal"))
8784 (linux-pam (assoc-ref inputs "linux-pam"))
8785 (lvm2 (assoc-ref inputs "lvm2")))
8786 (substitute* '("src/utils/ecryptfs-mount-private"
8787 "src/utils/ecryptfs-umount-private"
8788 "src/utils/ecryptfs-setup-private"
8789 "src/utils/ecryptfs-setup-swap"
8790 "src/utils/mount.ecryptfs.c"
8791 "src/utils/umount.ecryptfs.c"
8792 "src/pam_ecryptfs/pam_ecryptfs.c"
8793 "src/desktop/ecryptfs-mount-private.desktop.in"
8794 "src/desktop/ecryptfs-setup-private.desktop.in")
8795 (("/bin/mount")
8796 (string-append util-linux "/bin/mount"))
8797 (("/bin/umount")
8798 (string-append util-linux "/bin/umount"))
8799 (("/sbin/mount.ecryptfs_private")
8800 (string-append out "/sbin/mount.ecryptfs_private"))
8801 (("/sbin/umount.ecryptfs_private")
8802 (string-append out "/sbin/umount.ecryptfs_private"))
8803 (("/usr/bin/ecryptfs-mount-private")
8804 (string-append out "/bin/ecryptfs-mount-private"))
8805 (("/usr/bin/ecryptfs-rewrite-file")
8806 (string-append out "/bin/ecryptfs-rewrite-file"))
8807 (("/usr/bin/ecryptfs-setup-private")
8808 (string-append out "/bin/ecryptfs-setup-private"))
8809 (("/sbin/cryptsetup")
8810 (string-append cryptsetup "/sbin/cryptsetup"))
8811 (("/sbin/unix_chkpwd")
8812 (string-append linux-pam "/sbin/unix_chkpwd"))
8813 (("/sbin/dmsetup")
8814 (string-append lvm2 "/sbin/dmsetup"))))))
8815 (add-after 'install 'wrap-scripts
8816 (lambda* (#:key inputs outputs #:allow-other-keys)
8817 (let* ((out (assoc-ref outputs "out"))
8818 (bin (string-append out "/bin"))
8819 (add (map (lambda (bin)
8820 (dirname (search-input-file
8821 inputs (string-append "bin/" bin))))
8822 ;; For simplicity, we wrap all scripts the same.
8823 (list "awk" "find" "gettext" "grep" "keyctl" "ls"
8824 "lsof" "mount" "rsync" "sed" "which")))
8825 (script? (lambda (file)
8826 (call-with-input-file file
8827 (lambda (port)
8828 (bytevector=? (string->utf8 "#!")
8829 (get-bytevector-n port 2)))))))
8830 (for-each (lambda (file)
8831 (when (script? file)
8832 (wrap-program file
8833 ;; '= would be better than 'suffix but break
8834 ;; setuid binaries.
8835 `("PATH" ":" suffix (,@add
8836 ,(string-append bin))))))
8837 (find-files bin "."))))))))
8838 (native-inputs
8839 (list intltool perl ; for pod2man
8840 pkg-config))
8841 (inputs
8842 (list coreutils
8843 cryptsetup-minimal
8844 findutils
8845 gawk
8846 grep
8847 keyutils
8848 linux-pam
8849 lsof
8850 lvm2
8851 nss
8852 rsync
8853 sed
8854 util-linux
8855 which))
8856 (home-page "https://ecryptfs.org/")
8857 (synopsis "Cryptographic file system utilities")
8858 (description
8859 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
8860Each file's cryptographic meta-data is stored inside the file itself, along
8861with the encrypted contents. This allows individual encrypted files to be
8862copied between hosts and still be decrypted with the proper key. eCryptfs is a
8863native Linux file system, and has been part of the Linux kernel since version
88642.6.19. This package contains the userland utilities to manage it.")
8865 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
8866 ;; grant additional permission to link with OpenSSL.
8867 (license license:gpl2+)))
8868
8869(define-public module-init-tools
8870 (package
8871 (name "module-init-tools")
8872 (version "3.16")
8873 (source (origin
8874 (method url-fetch)
8875 (uri (string-append
8876 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
8877 "module-init-tools-" version ".tar.bz2"))
8878 (sha256
8879 (base32
8880 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
8881 (patches (search-patches "module-init-tools-moduledir.patch"))))
8882 (build-system gnu-build-system)
8883 (arguments
8884 ;; FIXME: The upstream tarball lacks man pages, and building them would
8885 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
8886 ;; but they vanished. In the meantime, fake it.
8887 '(#:phases
8888 (modify-phases %standard-phases
8889 (add-before 'configure 'fake-docbook
8890 (lambda _
8891 (substitute* "Makefile.in"
8892 (("^DOCBOOKTOMAN.*$")
8893 "DOCBOOKTOMAN = true\n"))
8894 #t)))))
8895 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
8896 (synopsis "Tools for loading and managing Linux kernel modules")
8897 (description
8898 "Tools for loading and managing Linux kernel modules, such as
8899@code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
8900 (license license:gpl2+)))
8901
8902(define-public mce-inject
8903 (let ((revision "0") ; no git tags :-/
8904 (commit "4cbe46321b4a81365ff3aafafe63967264dbfec5"))
8905 (package
8906 (name "mce-inject")
8907 (version (git-version "0.0.0" revision commit))
8908 (source
8909 (origin
8910 (method git-fetch)
8911 (uri (git-reference
8912 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git")
8913 (commit commit)))
8914 (file-name (git-file-name name version))
8915 (sha256
8916 (base32 "0gjapg2hrlxp8ssrnhvc19i3r1xpcnql7xv0zjgbv09zyha08g6z"))))
8917 (build-system gnu-build-system)
8918 (arguments
8919 ;; There is no test suite. There's a test/ directory, but it just holds
8920 ;; example text files you could feed to the programme to crash something.
8921 (list #:tests? #f
8922 #:make-flags
8923 #~(list (string-append "prefix=" #$output)
8924 (string-append "CC=" #$(cc-for-target)))
8925 #:phases
8926 #~(modify-phases %standard-phases
8927 (delete 'configure) ; no configure script
8928 (add-after 'install 'install-examples
8929 (lambda* (#:key outputs #:allow-other-keys)
8930 (let* ((out (assoc-ref outputs "out"))
8931 (doc (string-append out "/share/doc/" #$name))
8932 (dir (string-append doc "/examples")))
8933 (copy-recursively "test" dir )))))))
8934 (native-inputs
8935 (list bison flex))
8936 (supported-systems (list "i686-linux" "x86_64-linux"))
8937 (home-page
8938 "https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git/about/")
8939 (synopsis
8940 "Inject x86 @acronym{MCEs, machine-check exceptions} into Linux")
8941 (description
8942 "This simple tool injects fake @acronym{MCEs, machine-check exceptions}
8943into a running Linux kernel, to debug or test the kernel's @acronym{EDAC, error
8944detection and correction}-handling code specific to x86 and x86_64 platforms.
8945
8946Real MCEs are internal CPU errors. Handling them correctly can be important to
8947system stability and even prevent physical damage. In contrast, simulated MCEs
8948produced by @command{mce-inject} are purely synthetic: injection happens only at
8949the software level, inside the kernel, and is not visible to the platform
8950hardware or firmware.
8951
8952A convenient feature of @command{mce-inject} is that the input language used to
8953describe MCEs is similar to the format used in Linux panic messages, with a few
8954extensions. In general, you should be able to pipe in any logged MCE panic to
8955simulate that same MCE.
8956
8957The target kernel must have the @code{CONFIG_X86_MCE_INJECT} option enabled and
8958the @code{mce-inject} module loaded if it exists.")
8959 (license license:gpl2))))
8960
8961(define-public mcelog
8962 (package
8963 (name "mcelog")
8964 (version "195")
8965 (source
8966 (origin
8967 (method git-fetch)
8968 (uri (git-reference
8969 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git")
8970 (commit (string-append "v" version))))
8971 (file-name (git-file-name name version))
8972 (sha256
8973 (base32 "1bg2bj8flybd8kzmmaaslisc6lc1fs9nbv09im6r32dq48skx5aj"))
8974 (modules '((guix build utils)))
8975 (snippet
8976 `(begin
8977 ;; The checkout lacks a .git directory, breaking ‘git describe’.
8978 (substitute* "Makefile"
8979 (("\"unknown\"") (string-append "\"v" ,version "\"")))))))
8980 (build-system gnu-build-system)
8981 (arguments
8982 (list
8983 ;; The tests will only run as root on certain supported CPU models.
8984 #:tests? #f
8985 #:make-flags
8986 #~(list (string-append "CC=" #$(cc-for-target))
8987 (string-append "prefix=" #$output)
8988 (string-append "DOCDIR=" #$output "/share/doc/"
8989 #$name "-" #$version)
8990 "etcprefix=$(DOCDIR)/examples")
8991 #:phases
8992 #~(modify-phases %standard-phases
8993 (delete 'configure)))) ; no configure script
8994 (native-inputs
8995 (list python-wrapper)) ; to generate example mcelog.conf
8996 (supported-systems (list "i686-linux" "x86_64-linux"))
8997 (home-page "https://mcelog.org/")
8998 (synopsis "Machine check monitor for x86 Linux systems")
8999 (description
9000 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
9001systems running the kernel Linux. It can also perform user-defined tasks, such
9002as bringing bad pages off-line, when configurable error thresholds are
9003exceeded.")
9004 (license license:gpl2)))
9005
9006(define-public mtd-utils
9007 (package
9008 (name "mtd-utils")
9009 (version "2.1.5")
9010 (source (origin
9011 (method url-fetch)
9012 (uri (string-append
9013 "ftp://ftp.infradead.org/pub/mtd-utils/"
9014 "mtd-utils-" version ".tar.bz2"))
9015 (sha256
9016 (base32
9017 "0ilz8hkcyvfcnqpy25kbr8fb71x9vl28wbmw56vvd68n2byjfviq"))))
9018 (arguments
9019 (list #:configure-flags
9020 (if (%current-target-system) ; When cross-compiling.
9021 #~(list)
9022 #~(list "--enable-unit-tests"))
9023
9024 #:parallel-tests? #f)) ;tests may fail when running in parallel
9025 (native-inputs
9026 (list cmocka pkg-config))
9027 (inputs
9028 (list acl ; extended attributes (xattr)
9029 lzo
9030 openssl ; optional crypto support
9031 `(,util-linux "lib")
9032 zlib
9033 `(,zstd "lib")))
9034 (build-system gnu-build-system)
9035 (synopsis "MTD Flash Storage Utilities")
9036 (description "This package provides utilities for testing, partitioning, etc
9037of flash storage.")
9038 (home-page "http://www.linux-mtd.infradead.org/")
9039 (license
9040 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
9041 license:mpl1.1 ; All ftl* files
9042 license:expat)))) ; libiniparser
9043
9044(define-public libseccomp
9045 (package
9046 (name "libseccomp")
9047 (version "2.6.0")
9048 (source (origin
9049 (method git-fetch)
9050 (uri (git-reference
9051 (url "https://github.com/seccomp/libseccomp")
9052 (commit (string-append "v" version))))
9053 (file-name (git-file-name name version))
9054 (sha256
9055 (base32
9056 "189yh66aj3z3jvns739qbj504f3mcl3w44pxxizw877pbj3kal11"))))
9057 (build-system gnu-build-system)
9058 (arguments
9059 (list
9060 #:configure-flags #~(list "--disable-static")
9061 #:phases #~(modify-phases %standard-phases
9062 #$@(if (target-ppc32?)
9063 ;; This test is removed upstream. See upstream commit
9064 ;; 7db46d72f13c172b290818f624c2966bd0db5677
9065 #~((add-after 'unpack 'skip-62-sim-arch-tests
9066 (lambda _
9067 (substitute*
9068 "tests/62-sim-arch_transactions.tests"
9069 (("test type: bpf-sim-fuzz") "")
9070 (("62-sim-arch_transactions 5") "")))))
9071 #~())
9072 (add-before 'check 'skip-load-test
9073 (lambda _
9074 ;; This test does a native system call and fails when
9075 ;; run under QEMU user-mode emulation. Just skip it.
9076 (delete-file "tests/52-basic-load.tests"))))))
9077 (native-inputs
9078 (list autoconf automake gperf libtool which))
9079 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
9080 (description "The libseccomp library provides an easy to use, platform
9081independent, interface to the Linux Kernel's syscall filtering mechanism. The
9082libseccomp API is designed to abstract away the underlying BPF based syscall
9083filter language and present a more conventional function-call based filtering
9084interface that should be familiar to, and easily adopted by, application
9085developers.")
9086 (home-page "https://github.com/seccomp/libseccomp")
9087 (license license:lgpl2.1)))
9088
9089(define-public radeontop
9090 (package
9091 (name "radeontop")
9092 (version "1.4")
9093 (source
9094 (origin
9095 (method git-fetch)
9096 (uri (git-reference
9097 (url "https://github.com/clbr/radeontop")
9098 (commit (string-append "v" version))))
9099 (file-name (git-file-name name version))
9100 (sha256
9101 (base32 "0kwqddidr45s1blp0h8r8h1dd1p50l516yb6mb4s6zsc827xzgg3"))))
9102 (build-system gnu-build-system)
9103 (arguments
9104 `(#:phases (modify-phases %standard-phases
9105 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
9106 ;; dependency, and doesn't even work on release(!) tarballs.
9107 (add-after 'unpack 'report-correct-version
9108 (lambda _
9109 (substitute* "getver.sh"
9110 (("ver=unknown")
9111 (string-append "ver=" ,version)))))
9112 (delete 'configure)) ; no configure script
9113 #:make-flags (list (string-append "CC=" ,(cc-for-target))
9114 (string-append "PREFIX=" %output))
9115 #:tests? #f)) ; no tests
9116 (native-inputs
9117 (list gettext-minimal pkg-config))
9118 (inputs
9119 (list libdrm libpciaccess libxcb ncurses))
9120 (home-page "https://github.com/clbr/radeontop/")
9121 (synopsis "Usage monitor for AMD Radeon graphics")
9122 (description "RadeonTop monitors resource consumption on supported AMD
9123Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
9124a terminal or saved to a file for further processing. It measures both the
9125activity of the GPU as a whole, which is also accurate during OpenCL
9126computations, as well as separate component statistics that are only meaningful
9127under OpenGL graphics workloads.")
9128 (license license:gpl3)))
9129
9130(define-public efivar
9131 (package
9132 (name "efivar")
9133 (version "39")
9134 (source (origin
9135 (method git-fetch)
9136 (uri (git-reference
9137 (url "https://github.com/rhboot/efivar")
9138 (commit version)))
9139 (file-name (git-file-name name version))
9140 (sha256
9141 (base32
9142 "1zd9dghg1z2rrsazv3d9rj7nik6kdqz42jiak65pipz7mpjn9zdk"))
9143 (patches (search-patches "efivar-fix-fprint-format.patch"))))
9144 (build-system gnu-build-system)
9145 (arguments
9146 (list
9147 ;; Tests require a UEFI system and is not detected in the chroot.
9148 #:tests? #f
9149 #:make-flags #~(list (string-append "prefix="
9150 #$output)
9151 (string-append "libdir="
9152 #$output "/lib")
9153 (string-append "CC="
9154 #$(cc-for-target))
9155 "HOSTCC=gcc"
9156 (string-append "LDFLAGS=-Wl,-rpath="
9157 #$output "/lib")
9158 ;; Strictly only needed for i686-linux/32bit
9159 "CFLAGS=-g -O2 -Wno-error=format")
9160 #:phases #~(modify-phases %standard-phases
9161 (add-after 'unpack 'build-deterministically
9162 (lambda _
9163 (substitute* "src/include/defaults.mk"
9164 ;; Don't use -march=native.
9165 (("-march=native")
9166 ""))))
9167 (delete 'configure))))
9168 (native-inputs (list mandoc pkg-config))
9169 (inputs (list popt))
9170 (home-page "https://github.com/rhboot/efivar")
9171 (synopsis "Tool and library to manipulate EFI variables")
9172 (description "This package provides a library and a command line
9173interface to the variable facility of UEFI boot firmware.")
9174 (license license:lgpl2.1+)))
9175
9176(define-public efibootmgr
9177 (package
9178 (name "efibootmgr")
9179 (version "18")
9180 (source
9181 (origin
9182 (method git-fetch)
9183 (uri (git-reference
9184 (url "https://github.com/rhboot/efibootmgr")
9185 (commit version)))
9186 (file-name (git-file-name name version))
9187 (sha256
9188 (base32 "1j19m3dngcb7jl88ib32phbh5r7c02dhhakq8jk6z7y408c111hd"))))
9189 (build-system gnu-build-system)
9190 (arguments
9191 (list
9192 #:tests? #f ;no tests
9193 #:make-flags
9194 #~(append (list (string-append "prefix=" #$output)
9195 (string-append "libdir=" #$output "/lib")
9196 ;; EFIDIR denotes a subdirectory relative to the
9197 ;; EFI System Partition where the loader will be
9198 ;; installed (known as OS_VENDOR in the code).
9199 ;; GRUB overrides this, as such it's only used if
9200 ;; nothing else is specified on the command line.
9201 "EFIDIR=gnu")
9202 #$(if (%current-target-system)
9203 #~(list
9204 (string-append "CC=" #$(cc-for-target))
9205 (string-append "PKG_CONFIG=" #$(pkg-config-for-target))
9206 (string-append "EXTRAINCDIRS="
9207 #$(this-package-input "efivar") "/include"))
9208 #~'()))
9209 #:phases #~(modify-phases %standard-phases (delete 'configure))))
9210 (native-inputs
9211 (list pkg-config))
9212 (inputs
9213 (list efivar popt))
9214 (home-page "https://github.com/rhboot/efibootmgr")
9215 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
9216 (description
9217 "@code{efibootmgr} is a user-space application to modify the Intel
9218Extensible Firmware Interface (EFI) Boot Manager. This application can
9219create and destroy boot entries, change the boot order, change the next
9220running boot option, and more.")
9221 (license license:gpl2+)))
9222
9223(define-public sysstat
9224 (package
9225 (name "sysstat")
9226 (version "12.7.5")
9227 (source
9228 (origin
9229 (method url-fetch)
9230 (uri (string-append "https://sysstat.github.io/sysstat-packages/"
9231 "sysstat-" version ".tar.xz"))
9232 (sha256
9233 (base32 "0ssdrm3k0fclq5b5i0aznfwdkbac9l9cf88idaq3pls9lm040rjp"))))
9234 (build-system gnu-build-system)
9235 (native-inputs (list gettext-minimal))
9236 (arguments
9237 `(#:tests? #f ; no test suite.
9238 ;; Without this flag, it tries to install the man pages with group 'root'
9239 ;; and fails because /etc/passwd lacks an entry for the root user.
9240 #:configure-flags
9241 (list "--disable-file-attr"
9242 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
9243 #:phases
9244 (modify-phases %standard-phases
9245 ;; The build process tries to create '/var/lib/sa', so we skip that
9246 ;; instruction.
9247 (add-after 'build 'skip-touching-var
9248 (lambda _
9249 (substitute* "Makefile"
9250 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
9251 "")))))))
9252 (home-page "https://sysstat.github.io")
9253 (synopsis "Performance monitoring tools for Linux")
9254 (description "The sysstat utilities are a collection of performance
9255monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
9256@code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
9257@code{sadf} and @code{sa}.")
9258 (license license:gpl2+)))
9259
9260(define-public acpilight
9261 (package
9262 (name "acpilight")
9263 (version "1.2")
9264 (source (origin
9265 (method git-fetch)
9266 (uri (git-reference
9267 (url "https://gitlab.com/wavexx/acpilight.git")
9268 (commit (string-append "v" version))))
9269 (file-name (git-file-name name version))
9270 (sha256
9271 (base32
9272 "1r0r3nx6x6vkpal6vci0zaa1n9dfacypldf6k8fxg7919vzxdn1w"))))
9273 (build-system gnu-build-system)
9274 (arguments
9275 (list #:tests? #f ; no tests
9276 #:make-flags
9277 #~(list (string-append "prefix=" #$output)
9278 (string-append "sysconfdir=" #$output "/lib")) ;udev rule
9279 #:phases
9280 #~(modify-phases %standard-phases
9281 (delete 'configure)
9282 (add-after 'unpack 'patch
9283 (lambda* (#:key inputs #:allow-other-keys)
9284 ;; Prevent reloading udev at build time
9285 (substitute* "Makefile"
9286 (("udevadm") "true"))
9287 (substitute* "90-backlight.rules"
9288 (("/bin")
9289 (string-append #$(this-package-input "coreutils")
9290 "/bin"))))))))
9291 (inputs (list coreutils python))
9292 (home-page "https://gitlab.com/wavexx/acpilight")
9293 (synopsis "Backward-compatibile xbacklight replacement")
9294 (description "acpilight is a backward-compatibile replacement for
9295xbacklight that uses the ACPI interface to set the display brightness. On
9296modern laptops acpilight can control both display and keyboard backlight
9297uniformly on either X11, the console or Wayland.")
9298 (license license:gpl3+)))
9299
9300(define-public light
9301 (package
9302 (name "light")
9303 (version "1.2.2")
9304 (source
9305 (origin
9306 (method git-fetch)
9307 (uri (git-reference
9308 (url "https://github.com/haikarainen/light")
9309 (commit (string-append "v" version))))
9310 (sha256
9311 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
9312 (file-name (git-file-name name version))))
9313 (build-system gnu-build-system)
9314 (arguments
9315 `(#:configure-flags '("CFLAGS=-fcommon")
9316 #:phases
9317 (modify-phases %standard-phases
9318 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
9319 (lambda* (#:key inputs #:allow-other-keys)
9320 (substitute* "90-backlight.rules"
9321 (("/bin/chgrp") (which "chgrp"))
9322 (("/bin/chmod") (which "chmod")))
9323 #t))
9324 (add-after 'install 'install-udev-rules
9325 (lambda* (#:key outputs #:allow-other-keys)
9326 (let ((out (assoc-ref outputs "out")))
9327 (install-file
9328 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
9329 #t))))))
9330 (native-inputs
9331 (list autoconf automake))
9332 (home-page "https://haikarainen.github.io/light/")
9333 (synopsis "GNU/Linux application to control backlights")
9334 (description
9335 "Light is a program to send commands to screen backlight controllers
9336under GNU/Linux. Features include:
9337
9338@itemize
9339@item It does not rely on X.
9340@item Light can automatically figure out the best controller to use, making
9341full use of underlying hardware.
9342@item It is possible to set a minimum brightness value, as some controllers
9343set the screen to be pitch black at a value of 0 (or higher).
9344@end itemize\n")
9345 (license license:gpl3+)))
9346
9347(define-public brightnessctl
9348 (package
9349 (name "brightnessctl")
9350 (version "0.5.1")
9351 (home-page "https://github.com/Hummer12007/brightnessctl")
9352 (source (origin
9353 (method git-fetch)
9354 (uri (git-reference (url home-page) (commit version)))
9355 (file-name (git-file-name name version))
9356 (sha256
9357 (base32
9358 "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq"))
9359 (patches (search-patches "brightnessctl-elogind-support.patch"))))
9360 (build-system gnu-build-system)
9361 (arguments
9362 `(#:tests? #f ; no tests
9363 #:make-flags (list (string-append "CC=" ,(cc-for-target))
9364 (string-append "PREFIX=" %output)
9365 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/")
9366 "ENABLE_SYSTEMD=1")
9367 #:phases
9368 (modify-phases %standard-phases
9369 (delete 'configure)
9370 (add-after 'unpack 'adjust-udev-rules
9371 (lambda _
9372 (substitute* "Makefile"
9373 (("INSTALL_UDEV_RULES=0") "INSTALL_UDEV_RULES=1"))
9374 (substitute* "90-brightnessctl.rules"
9375 (("/bin/") "/run/current-system/profile/bin/"))
9376 #t)))))
9377 (native-inputs
9378 (list pkg-config))
9379 (inputs
9380 (list elogind))
9381 (synopsis "Backlight and LED brightness control")
9382 (description
9383 "This program allows you read and control device brightness. Devices
9384include backlight and LEDs. It can also preserve current brightness before
9385applying the operation, such as on lid close.
9386
9387The appropriate permissions must be set on the backlight or LED control
9388interface in sysfs, which can be accomplished with the included udev rules.")
9389 (license license:expat)))
9390
9391(define-public tlp
9392 (package
9393 (name "tlp")
9394 (version "1.9.0")
9395 (source
9396 (origin
9397 (method git-fetch)
9398 (uri (git-reference
9399 (url "https://github.com/linrunner/TLP")
9400 (commit version)))
9401 (file-name (git-file-name name version))
9402 (sha256
9403 (base32 "0msskz42yy0ddq6gqak0dsl77wsym24ly3bkpymfwl9dr3wzikv8"))))
9404 (native-inputs
9405 (list shellcheck))
9406 (inputs
9407 `(("dbus" ,dbus)
9408 ("ethtool" ,ethtool)
9409 ("eudev" ,eudev)
9410 ("grep" ,grep)
9411 ("guile" ,guile-3.0) ;for wrap-script
9412 ("hdparm" ,hdparm)
9413 ("inetutils" ,inetutils)
9414 ("iw" ,iw)
9415 ("kmod" ,kmod)
9416 ("pciutils" ,pciutils)
9417 ("perl" ,perl)
9418 ("sed" ,sed)
9419 ("usbutils" ,usbutils)
9420 ("util-linux" ,util-linux)
9421 ("wireless-tools" ,wireless-tools)
9422 ,@(if (let ((system (or (%current-target-system)
9423 (%current-system))))
9424 (or (string-prefix? "i686-" system)
9425 (string-prefix? "x86_64-" system)))
9426 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
9427 '())))
9428 (build-system gnu-build-system)
9429 (arguments
9430 ;; XXX: The full test suite is run with "checkall" but it requires
9431 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
9432 (list
9433 #:make-flags
9434 #~(list "TLP_CONFUSR=/etc/tlp.conf" "TLP_CONFDIR=/etc/tlp.d")
9435 #:test-target "shellcheck"
9436 #:modules '((guix build gnu-build-system)
9437 (guix build utils)
9438 (srfi srfi-1))
9439 #:phases
9440 #~(modify-phases %standard-phases
9441 (delete 'configure) ; no configure script
9442 (add-before 'build 'setenv
9443 (lambda _
9444 (setenv "TLP_WITH_SYSTEMD" "0")
9445 (setenv "TLP_NO_INIT" "1")))
9446 (add-before 'build 'fix-installation
9447 (lambda _
9448 ;; Stop the Makefile from trying to create system directories.
9449 (substitute* "Makefile"
9450 (("= /usr") (string-append "= " #$output))
9451 (("= /etc") (string-append "= " #$output "/etc"))
9452 (("install -d -m 755 \\$\\(_VAR\\)") "#"))))
9453 (add-before 'build 'fix-perl-calls
9454 ;; Shell scripts in "bat.d" and "func.d" call "perl". Fix
9455 ;; invocation without wrapping every one of them.
9456 (lambda* (#:key inputs #:allow-other-keys)
9457 (substitute* (append (find-files "bat.d" ".")
9458 (find-files "func.d" "."))
9459 (("(^|[^/])perl" _ prefix)
9460 (string-append prefix
9461 (search-input-file inputs "bin/perl"))))))
9462 (replace 'install
9463 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
9464 (add-after 'install 'wrap
9465 (lambda* (#:key inputs outputs #:allow-other-keys)
9466 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
9467 (sbin (string-append (assoc-ref outputs "out") "/sbin"))
9468 ;; Used to ignore symlinks which don't need wrapping
9469 (regular-file-predicate
9470 (lambda (file stat) (eq? 'regular (stat:type stat))))
9471 (bin-files (find-files bin regular-file-predicate))
9472 (sbin-files (find-files sbin regular-file-predicate)))
9473 (define (bin-directory input-name)
9474 (let ((p (assoc-ref inputs input-name)))
9475 (and p (string-append p "/bin"))))
9476 (define (sbin-directory input-name)
9477 (string-append (assoc-ref inputs input-name) "/sbin"))
9478 (for-each (lambda (program)
9479 ;; Programs rely on $0 so we use wrap-script
9480 ;; instead of wrap-program
9481 (wrap-script program
9482 `("PATH" ":" prefix
9483 ,(append
9484 (filter-map bin-directory
9485 '("bash"
9486 "coreutils"
9487 "dbus"
9488 "eudev"
9489 "grep"
9490 "inetutils"
9491 "kmod"
9492 "perl"
9493 "sed"
9494 "usbutils"
9495 "util-linux"
9496 "x86-energy-perf-policy"))
9497 (filter-map sbin-directory
9498 '("ethtool"
9499 "hdparm"
9500 "iw"
9501 "pciutils"
9502 "util-linux"
9503 "wireless-tools"))))))
9504 (append bin-files sbin-files))))))))
9505 (home-page "https://linrunner.de/en/tlp/tlp.html")
9506 (synopsis "Power management tool for Linux")
9507 (description "TLP is a power management tool for Linux. It comes with
9508a default configuration already optimized for battery life. Nevertheless,
9509TLP is customizable to fulfil system requirements. TLP settings are applied
9510every time the power supply source is changed.")
9511 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
9512 ;; rest is GPLv2+.
9513 (license (list license:gpl2+ license:gpl3+))))
9514
9515(define-public tlpui
9516 (package
9517 (name "tlpui")
9518 (version "1.9.0")
9519 (source
9520 (origin
9521 (method git-fetch)
9522 (uri (git-reference
9523 (url "https://github.com/d4nj1/TLPUI")
9524 (commit (string-append "tlpui-" version))))
9525 (file-name (git-file-name name version))
9526 (sha256
9527 (base32 "00rkq389zs525s7ckjj6cm34s25rsrgz47p28pp43ld35i538g9w"))))
9528 (build-system pyproject-build-system)
9529 (arguments
9530 (list
9531 #:phases
9532 #~(modify-phases %standard-phases
9533 (add-after 'unpack 'set-absolute-locations
9534 (lambda* (#:key inputs #:allow-other-keys)
9535 (let ((defaults.conf
9536 (search-input-file inputs "/share/tlp/defaults.conf"))
9537 (lspci (search-input-file inputs "/bin/lspci"))
9538 (lsusb (search-input-file inputs "/bin/lsusb"))
9539 (tlp-stat (search-input-file inputs "/bin/tlp-stat")))
9540 (with-directory-excursion "tlpui"
9541 (substitute* '("file.py" "settingshelper.py" "statui.py")
9542 (("\"tlp-stat\"")
9543 (string-append "'" tlp-stat "'"))
9544 (("/usr/share/tlp/defaults.conf")
9545 defaults.conf))
9546 (substitute* "ui_config_objects/gtkusblist.py"
9547 (("\"lsusb\"")
9548 (string-append "'" lsusb "'")))
9549 (substitute* "ui_config_objects/gtkpcilist.py"
9550 (("\"lspci\"")
9551 (string-append "'" lspci "'")))
9552 ;; Settings check if various tlp executables, lspci and
9553 ;; usbutils are available. Skip this phase since we know
9554 ;; for sure they are (and it avoids patching each location).
9555 (substitute* "settingshelper.py"
9556 (("(command_exists = ).*" _ lead)
9557 (string-append lead "True\n")))))))
9558 (add-after 'install 'install-desktop-file
9559 (lambda _
9560 (let ((dir (string-append #$output "/share/applications")))
9561 (install-file "tlpui.desktop" dir))))
9562 (add-after 'wrap 'wrap-gi-python
9563 (lambda _
9564 (let ((gi-typelib-path (getenv "GI_TYPELIB_PATH")))
9565 (wrap-program (string-append #$output "/bin/tlpui")
9566 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))))))))
9567 (native-inputs
9568 (list `(,glib "bin")
9569 gobject-introspection
9570 python-poetry-core
9571 python-pytest
9572 python-pyyaml))
9573 (inputs
9574 (list gtk+
9575 pciutils
9576 python-pygobject
9577 tlp
9578 usbutils))
9579 (propagated-inputs (list (librsvg-for-system)))
9580 (home-page "https://github.com/d4nj1/TLPUI")
9581 (synopsis "User interface for TLP written in Python")
9582 (description
9583 "The Python scripts in this project generate a GTK-UI to change
9584TLP configuration files easily. It aims to protect users from setting
9585bad configuration and to deliver a basic overview of all the valid
9586configuration values.")
9587 (license license:gpl2+)))
9588
9589(define-public lshw
9590 (package
9591 (name "lshw")
9592 (version "B.02.19.2")
9593 (source (origin
9594 (method url-fetch)
9595 (uri (string-append "https://www.ezix.org/software/"
9596 "files/lshw-" version
9597 ".tar.gz"))
9598 (sha256
9599 (base32
9600 "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
9601 (build-system gnu-build-system)
9602 (arguments
9603 `(#:phases (modify-phases %standard-phases (delete 'configure))
9604 #:tests? #f ; no tests
9605 #:make-flags
9606 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
9607 (synopsis "List hardware information")
9608 (description
9609 "@command{lshw} (Hardware Lister) is a small tool to provide
9610detailed information on the hardware configuration of the machine.
9611It can report exact memory configuration, firmware version, mainboard
9612configuration, CPU version and speed, cache configuration, bus speed,
9613and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
9614machines (PowerMac G4 is known to work).")
9615 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
9616 (license license:gpl2+)))
9617
9618(define-public libmnl
9619 (package
9620 (name "libmnl")
9621 (version "1.0.5")
9622 (source
9623 (origin
9624 (method url-fetch)
9625 (uri (string-append "mirror://netfilter.org/libmnl/"
9626 "libmnl-" version ".tar.bz2"))
9627 (sha256
9628 (base32
9629 "09851ns07399rbz0y8slrlmnw3fn1nakr8d37pxjn5gkks8rnjr7"))))
9630 (build-system gnu-build-system)
9631 (home-page "https://www.netfilter.org/projects/libmnl/")
9632 (synopsis "Netlink utility library")
9633 (description "Libmnl is a minimalistic user-space library oriented to
9634Netlink developers. There are a lot of common tasks in parsing, validating,
9635constructing of both the Netlink header and TLVs that are repetitive and easy to
9636get wrong. This library aims to provide simple helpers that allows you to
9637re-use code and to avoid re-inventing the wheel.")
9638 (properties
9639 '((release-monitoring-url . "https://www.netfilter.org/pub/libmnl/")))
9640 (license license:lgpl2.1+)))
9641
9642(define-public libnftnl
9643 (package
9644 (name "libnftnl")
9645 (version "1.2.8")
9646 (source
9647 (origin
9648 (method url-fetch)
9649 (uri (string-append "mirror://netfilter.org/libnftnl/"
9650 "libnftnl-" version ".tar.xz"))
9651 (sha256
9652 (base32 "15ddcyp91lxjh2wfi8xicjpffhn9rpiqsa8djbkqvc69npbabzip"))))
9653 (build-system gnu-build-system)
9654 (native-inputs
9655 (list pkg-config))
9656 (inputs
9657 (list libmnl))
9658 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
9659 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
9660 (description "Libnftnl is a userspace library providing a low-level netlink
9661programming interface to the in-kernel nf_tables subsystem. The library
9662libnftnl has been previously known as libnftables. This library is currently
9663used by nftables.")
9664 (license license:gpl2+)))
9665
9666;;; The symbol libnftl/fixed should be used when libnftnl needs fixes
9667;;; (security or else) and this deprecation could be removed.
9668(define-deprecated/public-alias libnftnl/fixed libnftnl/pinned)
9669
9670;; This is used in iptables, which contributes to rust. We're pinning this
9671;; variant to avoid accidental rebuilds of rust.
9672(define-public libnftnl/pinned
9673 (package
9674 (inherit libnftnl)
9675 (version "1.2.8")
9676 (source
9677 (origin
9678 (method url-fetch)
9679 (uri (string-append "mirror://netfilter.org/libnftnl/"
9680 "libnftnl-" version ".tar.xz"))
9681 (sha256
9682 (base32 "15ddcyp91lxjh2wfi8xicjpffhn9rpiqsa8djbkqvc69npbabzip"))))
9683 (build-system gnu-build-system)
9684 (native-inputs
9685 (list pkg-config))
9686 (inputs
9687 (list libmnl))))
9688
9689(define-public nftables
9690 (package
9691 (name "nftables")
9692 (version "1.0.8")
9693 (source
9694 (origin
9695 (method url-fetch)
9696 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
9697 version ".tar.xz")
9698 (string-append "https://www.nftables.org/projects/nftables"
9699 "/files/nftables-" version ".tar.xz")))
9700 (sha256
9701 (base32 "0l1xpwr9qfbl3bxa97v8s2lbibiz0xma9q0qi34xp0hswh6p8wwk"))))
9702 (build-system gnu-build-system)
9703 (arguments `(#:configure-flags
9704 '("--disable-static"
9705 "--with-cli=readline"
9706 "--with-json")
9707 #:phases
9708 (modify-phases %standard-phases
9709 (add-before 'configure 'autoreconf
9710 (lambda _
9711 (invoke "autoreconf" "-fi"))))))
9712 (inputs (list gmp libmnl libnftnl readline jansson))
9713 (native-inputs (list pkg-config
9714 bison
9715 flex
9716 docbook2x
9717 autoconf
9718 automake
9719 libtool))
9720 (home-page "https://www.nftables.org")
9721 (synopsis "Userspace utility for Linux packet filtering")
9722 (description "nftables is the project that aims to replace the existing
9723{ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
9724filtering framework, a new userspace utility and also a compatibility layer for
9725{ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
9726infrastructure such as the existing hooks, the connection tracking system, the
9727userspace queueing component and the logging subsystem.")
9728 (license license:gpl2)))
9729
9730(define-public libnetfilter-conntrack
9731 (package
9732 (name "libnetfilter-conntrack")
9733 (version "1.0.9")
9734 (source
9735 (origin
9736 (method url-fetch)
9737 (uri (string-append "https://netfilter.org/projects/"
9738 "libnetfilter_conntrack/files/"
9739 "libnetfilter_conntrack-"
9740 version ".tar.bz2"))
9741 (sha256
9742 (base32 "1a3rnpsba64dzy97wwjrxal89wr0nf9znvag2j18nkp3kzs9vgb7"))))
9743 (build-system gnu-build-system)
9744 (native-inputs (list pkg-config))
9745 (inputs (list libnfnetlink libmnl))
9746 (synopsis "Library for kernel connection tracking state table")
9747 (description "libnetfilter_conntrack is a userspace library providing a
9748programming interface (API) to the in-kernel connection tracking state table.
9749The library libnetfilter_conntrack has been previously known as
9750libnfnetlink_conntrack and libctnetlink. This library is currently used by
9751conntrack-tools among many other applications.")
9752 (home-page "https://netfilter.org/projects/libnetfilter_conntrack/index.html")
9753 (supported-systems (filter target-linux? %supported-systems))
9754 (properties '((upstream-name . "libnetfilter_conntrack")))
9755 (license license:gpl2+)))
9756
9757(define-public libnetfilter-cttimeout
9758 (package
9759 (name "libnetfilter-cttimeout")
9760 (version "1.0.1")
9761 (source
9762 (origin
9763 (method url-fetch)
9764 (uri (string-append "https://netfilter.org/projects/"
9765 "libnetfilter_cttimeout/files/"
9766 "libnetfilter_cttimeout-" version ".tar.bz2"))
9767 (sha256
9768 (base32 "0983cpyvxyycbnzqlrzml80pph2z51r6s7sxp06ciq8468pxln8b"))))
9769 (build-system gnu-build-system)
9770 (native-inputs (list pkg-config))
9771 (inputs (list libmnl))
9772 (synopsis "Library for kernel connection tracking timeout infrastructure")
9773 (description "libnetfilter_cttimeout is the userspace library that
9774provides the programming interface to the fine-grain connection tracking
9775timeout infrastructure. With this library, you can create, update and delete
9776timeout policies that can be attached to traffic flows. This library is used
9777by conntrack-tools.")
9778 (home-page "https://netfilter.org/projects/libnetfilter_cttimeout/index.html")
9779 (supported-systems (filter target-linux? %supported-systems))
9780 (properties '((upstream-name . "libnetfilter_cttimeout")))
9781 (license license:gpl2)))
9782
9783(define-public libnetfilter-cthelper
9784 (package
9785 (name "libnetfilter-cthelper")
9786 (version "1.0.1")
9787 (source
9788 (origin
9789 (method url-fetch)
9790 (uri (string-append "https://netfilter.org/projects/"
9791 "libnetfilter_cthelper/files/"
9792 "libnetfilter_cthelper-" version ".tar.bz2"))
9793 (sha256
9794 (base32 "04n95ngil5l8m8v64dfjm1dwq0wd3kf4vw1zblsrff13hxa3s1ql"))))
9795 (build-system gnu-build-system)
9796 (native-inputs (list pkg-config))
9797 (inputs (list libmnl))
9798 (synopsis "Library for user-space connection tracking helpers")
9799 (description "libnetfilter_cthelper is a userspace library that provides a
9800programming interface to user-space connection tracking helpers.
9801@enumerate
9802@item
9803register new user-space connection tracking helpers
9804@item
9805unregister user-space connection tracking helpers
9806@item
9807list existing registered user-space connection tracking helpers
9808@end enumerate")
9809 (home-page "https://netfilter.org/projects/libnetfilter_cthelper/index.html")
9810 (supported-systems (filter target-linux? %supported-systems))
9811 (properties '((upstream-name . "libnetfilter_cthelper")))
9812 (license license:gpl2+)))
9813
9814(define-public libnetfilter-queue
9815 (package
9816 (name "libnetfilter-queue")
9817 (version "1.0.5")
9818 (source
9819 (origin
9820 (method url-fetch)
9821 (uri (string-append "https://netfilter.org/projects/"
9822 "libnetfilter_queue/files/"
9823 "libnetfilter_queue-" version ".tar.bz2"))
9824 (sha256
9825 (base32
9826 "1xdra6i4p8jkv943ygjw646qx8df27f7p5852kc06vjx608krzzr"))))
9827 (build-system gnu-build-system)
9828 (native-inputs (list pkg-config))
9829 (inputs (list libmnl libnfnetlink))
9830 (synopsis "Library for kernel netfilter infrastructure and state")
9831 (description "libnetfilter_queue is a userspace library providing an API
9832to packets that have been queued by the kernel packet filter. It is is part
9833of a system that deprecates the old ip_queue/libipq mechanism.")
9834 (home-page "https://netfilter.org/projects/libnetfilter_queue/index.html")
9835 (supported-systems (filter target-linux? %supported-systems))
9836 (properties '((upstream-name . "libnetfilter_queue")))
9837 (license license:gpl2+)))
9838
9839(define-public conntrack-tools
9840 (package
9841 (name "conntrack-tools")
9842 (version "1.4.8")
9843 (source
9844 (origin
9845 (method url-fetch)
9846 (uri (string-append "https://netfilter.org/projects/"
9847 "conntrack-tools/files/"
9848 "conntrack-tools-" version ".tar.xz"))
9849 (sha256
9850 (base32 "1mnynl5a63j25arapwvkjbm3a2cqm3aaklwfwwclhmpnqps7fxh6"))))
9851 (build-system gnu-build-system)
9852 (native-inputs (list bison flex pkg-config))
9853 (inputs (list libtirpc
9854 libnetfilter-conntrack
9855 libnetfilter-cttimeout
9856 libnetfilter-cthelper
9857 libnetfilter-queue
9858 libnfnetlink
9859 libmnl))
9860 (synopsis "Set of tools targeting the conntrack kernel subsystem")
9861 (description "The tool conntrack provides a full featured interface that
9862is intended to replace the old @file{/proc/net/ip_conntrack} interface. Using
9863conntrack, you can view and manage the in-kernel connection tracking state
9864table from userspace. On the other hand, conntrackd covers the specific
9865aspects of stateful firewalls to enable highly available scenarios, and can be
9866used as statistics collector as well.
9867
9868Since 1.2.0, the conntrack-tools includes the @command{nfct} command line
9869utility. This utility only supports the nfnetlink_cttimeout by now. In the
9870long run, we expect that it will replace conntrack by providing a syntax
9871similar to nftables.")
9872 (home-page "https://netfilter.org/projects/conntrack-tools/index.html")
9873 (supported-systems (filter target-linux? %supported-systems))
9874 (license license:gpl2+)))
9875
9876(define-public libnetfilter-acct
9877 (package
9878 (name "libnetfilter-acct")
9879 (version "1.0.3")
9880 (source
9881 (origin
9882 (method url-fetch)
9883 (uri (string-append "https://netfilter.org/projects/"
9884 "libnetfilter_acct/files/"
9885 "libnetfilter_acct-" version ".tar.bz2"))
9886 (sha256
9887 (base32
9888 "06lsjndgfjsgfjr43px2n2wk3nr7whz6r405mks3887y7vpwwl22"))))
9889 (build-system gnu-build-system)
9890 (native-inputs (list pkg-config))
9891 (inputs (list libmnl))
9892 (synopsis "Library providing interface to extended accounting infrastructure")
9893 (description "libnetfilter_acct is the userspace library providing interface
9894to extended accounting infrastructure.
9895
9896@enumerate
9897@item
9898creating accounting objects
9899@item
9900retrieving accounting objects (and atomically set to zero)
9901@item
9902deleting accounting objects
9903@end enumerate
9904For the nfnetlink_acct subsystem.")
9905 (home-page "https://netfilter.org/projects/libnetfilter_acct/index.html")
9906 (supported-systems (filter target-linux? %supported-systems))
9907 (properties '((upstream-name . "libnetfilter_acct")))
9908 (license license:lgpl2.1+)))
9909
9910(define-public nfacct
9911 (package
9912 (name "nfacct")
9913 (version "1.0.2")
9914 (source
9915 (origin
9916 (method url-fetch)
9917 (uri (string-append "https://netfilter.org/projects/" name
9918 "/files/nfacct-" version ".tar.bz2"))
9919 (sha256
9920 (base32
9921 "0sdxbxjyapbqcp2ami5jd10vz4xbbdvx39f3wfy1iqsbflc25zzc"))))
9922 (build-system gnu-build-system)
9923 (native-inputs (list pkg-config))
9924 (inputs (list libmnl libnetfilter-acct))
9925 (synopsis "Command line tool to create/retrieve/delete accounting objects")
9926 (description "nfacct is the command line tool to create/retrieve/delete
9927accounting objects
9928@enumerate
9929@item
9930listing the objects of the nfacct table in plain text/XML
9931@item
9932atomically get and reset objects of the nfacct table
9933@item
9934adding new objects to the nfacct table
9935@item
9936deleting objects from the nfacct table
9937@end enumerate")
9938 (home-page "https://netfilter.org/projects/nfacct/index.html")
9939 (supported-systems (filter target-linux? %supported-systems))
9940 (license license:gpl2+)))
9941
9942(define-public libnetfilter-log
9943 (package
9944 (name "libnetfilter-log")
9945 (version "1.0.2")
9946 (source
9947 (origin
9948 (method url-fetch)
9949 (uri (string-append "https://netfilter.org/projects/"
9950 "libnetfilter_log/files/"
9951 "libnetfilter_log-" version ".tar.bz2"))
9952 (sha256
9953 (base32
9954 "1spy9xs41v76kid5ana8n126f3mvgq6fjibbfbj4kn0larbhix73"))))
9955 (build-system gnu-build-system)
9956 (native-inputs (list pkg-config))
9957 (inputs (list libnfnetlink libmnl))
9958 (synopsis "Library providing interface to packets logged by netfilter")
9959 (description "libnetfilter_log is a userspace library providing interface to
9960packets that have been logged by the kernel packet filter. It is is part of a
9961system that deprecates the old syslog/dmesg based packet logging. This library
9962has been previously known as libnfnetlink_log.
9963
9964@enumerate
9965@item
9966receiving to-be-logged packets from the kernel nfnetlink_log subsystem
9967@end enumerate")
9968 (home-page "https://netfilter.org/projects/libnetfilter_log/index.html")
9969 (supported-systems (filter target-linux? %supported-systems))
9970 (properties '((upstream-name . "libnetfilter_log")))
9971 (license license:gpl2+)))
9972
9973(define-public ulogd
9974 (package
9975 (name "ulogd")
9976 (version "2.0.7")
9977 (source
9978 (origin
9979 (method url-fetch)
9980 (uri (string-append "https://netfilter.org/projects/" name
9981 "/files/ulogd-" version ".tar.bz2"))
9982 (sha256
9983 (base32
9984 "0ax9959c4bapq78n13bbaibcf1gwjir3ngx8l2dh45lw9m4ha2lr"))))
9985 (build-system gnu-build-system)
9986 (outputs '("out"
9987 ;; additional non-default output plugins
9988 "json" "pcap" "sqlite3" "pgsql" "mysql"))
9989 (native-inputs (list pkg-config))
9990 (inputs (list libnfnetlink
9991 libmnl
9992 libnetfilter-log
9993 libnetfilter-conntrack
9994 libnetfilter-acct
9995 sqlite
9996 libpcap
9997 jansson
9998 postgresql
9999 (list mariadb "dev")
10000 zlib
10001 openssl))
10002 (arguments
10003 (list #:configure-flags
10004 #~(list (string-append "--with-pgsql="
10005 (assoc-ref %build-inputs "postgresql"))
10006 (string-append "--with-mysql="
10007 (assoc-ref %build-inputs "mariadb")))
10008 #:phases
10009 #~(modify-phases %standard-phases
10010 (add-after 'install 'install-doc
10011 (lambda _
10012 (let ((out-etc (string-append #$output "/etc"))
10013 (ulogd.conf "ulogd.conf"))
10014 (mkdir-p out-etc)
10015 (copy-file ulogd.conf (string-append out-etc "/"
10016 ulogd.conf)))))
10017 (add-after 'install 'setup-plugin-outputs
10018 (lambda* (#:key outputs #:allow-other-keys)
10019 (with-directory-excursion
10020 (string-append #$output "/lib/ulogd/")
10021 (for-each
10022 (lambda (output-name)
10023 (let ((output-dir (string-append
10024 (assoc-ref outputs output-name)
10025 "/lib/ulogd/")))
10026 (mkdir-p output-dir)
10027 (for-each
10028 (lambda (plugin)
10029 (copy-file plugin (string-append output-dir plugin))
10030 (delete-file plugin))
10031 (find-files "."
10032 (string-append "ulogd_output_"
10033 (string-upcase output-name)
10034 ".*$")))))
10035 (list "json" "pcap" "sqlite3" "pgsql" "mysql"))))))))
10036 (synopsis "Logging daemon for netfilter and iptables")
10037 (description "ulogd is a userspace logging daemon for netfilter/iptables
10038related logging. This includes per-packet logging of security violations,
10039per-packet logging for accounting, per-flow logging and flexible user-defined
10040accounting.
10041
10042@enumerate
10043@item
10044Packet and flow-based traffic accounting
10045@item
10046Flexible user-defined traffic accounting via nfacct infrastructure
10047@item
10048SQL database back-end support: SQLite3, PostgreSQL, MySQL
10049@item
10050Text-based output formats: CSV, XML, Netfilter's LOG, Netfilter's conntrack
10051@end enumerate")
10052 (home-page "https://netfilter.org/projects/nfacct/index.html")
10053 (supported-systems (filter target-linux? %supported-systems))
10054 (license license:gpl2)))
10055
10056(define-public proot
10057 (package
10058 (name "proot")
10059 (version "5.4.0")
10060 (source
10061 (origin
10062 (method git-fetch)
10063 (uri (git-reference
10064 (url "https://github.com/proot-me/PRoot")
10065 (commit (string-append "v" version))))
10066 (file-name (git-file-name name version))
10067 (sha256
10068 (base32 "186qsg4yvisqjgf8w5jxhnlig7x341vpqwcgp8as3r59qmqkpmk7"))
10069 ;; Waiting for upstream inclusion at
10070 ;; https://github.com/proot-me/proot/pull/355
10071 (patches (search-patches "proot-add-clone3.patch"
10072 "proot-add-missing-include.patch"))))
10073 (build-system gnu-build-system)
10074 ;; Many architectures are not supported (see:
10075 ;; https://github.com/proot-me/proot/blob/master/src/arch.h#L51).
10076 (supported-systems '("x86_64-linux" "i686-linux"
10077 "armhf-linux" "aarch64-linux" "i586-gnu" "x86_64-gnu"))
10078 (arguments
10079 ;; Disable the test suite on armhf-linux, as there are too many
10080 ;; failures to keep track of (see for example:
10081 ;; https://github.com/proot-me/proot/issues/286).
10082 (list
10083 #:tests? (not (or (%current-target-system)
10084 (string-prefix? "armhf"
10085 (or (%current-system)))))
10086 #:make-flags
10087 #~'("-C" "src")
10088 #:phases
10089 #~(modify-phases %standard-phases
10090 (add-after 'unpack 'patch-sources
10091 (lambda* (#:key inputs #:allow-other-keys)
10092 (substitute* (find-files "src" "\\.[ch]$")
10093 (("\"/bin/sh\"")
10094 (format #f "~s" (search-input-file inputs "/bin/sh"))))
10095
10096 (substitute* "src/GNUmakefile"
10097 (("/bin/echo") (which "echo"))
10098 (("^VERSION = .*")
10099 (string-append "VERSION := " #$version "\n")))
10100
10101 (substitute* (find-files "test" "\\.sh$")
10102 ;; Some of the tests try to "bind-mount" /bin/true.
10103 (("-b /bin/true:")
10104 (string-append "-b " (which "true") ":"))
10105 ;; Likewise for /bin.
10106 (("-b /bin:") "-b /gnu:")
10107 ;; Others try to run /bin/sh.
10108 (("/bin/sh") (which "sh"))
10109 ;; Others assume /etc/fstab exists.
10110 (("/etc/fstab") "/etc/passwd"))
10111 (substitute* "test/GNUmakefile"
10112 (("-b /bin:") "-b /gnu:"))
10113 (substitute* "test/test-c6b77b77.mk"
10114 (("/bin/bash") (which "bash"))
10115 (("/usr/bin/test") (which "test")))
10116 (substitute* "test/test-16573e73.c"
10117 (("/bin/([a-z-]+)" _ program)
10118 (which program)))
10119 (substitute* "test/test-5467b986.sh"
10120 (("-w /usr") "-w /gnu")
10121 (("-w usr") "-w gnu")
10122 (("/usr/share") "/gnu/store")
10123 (("share") "store"))
10124 (substitute* "test/test-092c5e26.sh"
10125 (("-q echo ")
10126 "-q $(which echo) "))
10127
10128 ;; The socket tests requires networking.
10129 (for-each delete-file
10130 (find-files "test" "test-socket.*\\.sh$"))))
10131 (delete 'configure)
10132 (add-after 'build 'build-manpage
10133 (lambda _
10134 (with-directory-excursion "doc"
10135 (invoke "make" "proot/man.1" "SUFFIX=.py"))))
10136 (replace 'check
10137 (lambda* (#:key tests? #:allow-other-keys)
10138 (when tests?
10139 ;; Most of the tests expect "/bin" to be in $PATH so
10140 ;; they can run things that live in $ROOTFS/bin.
10141 (setenv "PATH" (string-append (getenv "PATH") ":/bin"))
10142 (invoke "make" "check" "-C" "test"
10143 "-j" (number->string (parallel-job-count))))))
10144 (replace 'install
10145 (lambda _
10146 ;; The 'install' rule does nearly nothing.
10147 (let ((man1 (string-append #$output "/share/man/man1")))
10148 ;; TODO: 'make install-care' (does not even
10149 ;; build currently.)
10150 (invoke "make" "-C" "src" "install"
10151 (string-append "PREFIX=" #$output))
10152 (mkdir-p man1)
10153 (copy-file "doc/proot/man.1"
10154 (string-append man1 "/proot.1"))))))))
10155 (native-inputs (list which
10156 ;; For 'mcookie', used by some of the tests.
10157 util-linux
10158 coreutils
10159 pkg-config
10160 ;; For rst2man, used to generate the manual page.
10161 python-docutils-0.19))
10162 (inputs (list libarchive talloc))
10163 (home-page "https://github.com/proot-me/PRoot")
10164 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
10165 (description
10166 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
10167and @code{binfmt_misc}. This means that users don't need any privileges or
10168setup to do things like using an arbitrary directory as the new root
10169file system, making files accessible somewhere else in the file system
10170hierarchy, or executing programs built for another CPU architecture
10171transparently through QEMU user-mode. Also, developers can use PRoot as a
10172generic process instrumentation engine thanks to its extension mechanism.
10173Technically PRoot relies on @code{ptrace}, an unprivileged system-call
10174available in the kernel Linux.")
10175 (license license:gpl2+)))
10176
10177(define-public proot-static
10178 (package
10179 (inherit proot)
10180 (name "proot-static")
10181 (synopsis
10182 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
10183 (inputs (list talloc/static))
10184 (arguments
10185 (substitute-keyword-arguments arguments
10186 ((#:make-flags flags)
10187 #~(cons* "LDFLAGS = -ltalloc -static -static-libgcc" #$flags))
10188 ((#:phases phases)
10189 #~(modify-phases #$phases
10190 (add-after 'strip 'remove-store-references
10191 (lambda _
10192 (with-directory-excursion #$output
10193 (remove-store-references "bin/proot"))))))
10194 ((#:allowed-references _ '("out"))
10195 '("out"))))))
10196
10197(define-public cpuid
10198 (package
10199 (name "cpuid")
10200 (version "20260220")
10201 (source (origin
10202 (method url-fetch)
10203 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
10204 version ".src.tar.gz"))
10205 (sha256
10206 (base32
10207 "1ywg1fzbk153sil3n0mdrah3728j76dbjj8c24gig4g5bbbhyqp7"))))
10208 (build-system gnu-build-system)
10209 (arguments
10210 (list #:make-flags
10211 #~(list (string-append "CC=" #$(cc-for-target)))
10212 #:tests? #f ; no tests
10213 #:phases
10214 #~(modify-phases %standard-phases
10215 (delete 'configure) ; no configure script
10216 (add-before 'install 'fix-makefile
10217 (lambda* (#:key outputs #:allow-other-keys)
10218 (substitute* "Makefile"
10219 (("\\$\\(BUILDROOT\\)/usr")
10220 (assoc-ref outputs "out"))))))))
10221 (inputs (list perl))
10222 (supported-systems '("i686-linux" "x86_64-linux"))
10223 (home-page "https://www.etallen.com/cpuid.html")
10224 (synopsis "Dump x86 CPUID processor information")
10225 (description "cpuid dumps detailed information about the CPU(s) gathered
10226from the CPUID instruction, and also determines the exact model of CPU(s). It
10227supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
10228NexGen, Rise, and SiS CPUs.")
10229 (license license:gpl2+)))
10230
10231(define-public jmtpfs
10232 (package
10233 (name "jmtpfs")
10234 (version "0.5")
10235 (source
10236 (origin
10237 (method git-fetch)
10238 (uri (git-reference
10239 (url "https://github.com/JasonFerrara/jmtpfs")
10240 (commit (string-append "v" version))))
10241 (file-name (git-file-name name version))
10242 (sha256
10243 (base32
10244 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
10245 (build-system gnu-build-system)
10246 (inputs
10247 (list file fuse-2 libmtp))
10248 (native-inputs
10249 (list pkg-config))
10250 (home-page "https://github.com/JasonFerrara/jmtpfs")
10251 (synopsis "Use a FUSE file system to access data over MTP")
10252 (description "jmtpfs uses @acronym{FUSE, File system in USEr space} to
10253provide access to data over @acronym{MTP, the Media Transfer Protocol}.
10254Unprivileged users can mount the MTP device as a file system.")
10255 (license license:gpl3)))
10256
10257(define-public procenv
10258 (package
10259 (name "procenv")
10260 (version "0.60")
10261 (source
10262 (origin
10263 (method git-fetch)
10264 (uri (git-reference
10265 (url "https://github.com/jamesodhunt/procenv")
10266 (commit version)))
10267 (file-name (git-file-name name version))
10268 (sha256
10269 (base32 "00d7q0h4qjc8lg435lq77lp2fx6ikm5piq90m81mr1dqqna1g6pz"))))
10270 (build-system gnu-build-system)
10271 (native-inputs
10272 (list pkg-config
10273 ;; For tests.
10274 check groff))
10275 (inputs
10276 (list expat libcap libselinux))
10277 (synopsis "Utility to show process environment")
10278 (description
10279 "Procenv is a command-line tool that displays as much detail about
10280itself and its environment as possible. It can be used as a test
10281tool, to understand the type of environment a process runs in, and for
10282comparing system environments.")
10283 (home-page "https://github.com/jamesodhunt/procenv/")
10284 (license license:gpl3+)))
10285
10286(define-public cassini-headers
10287 (package
10288 (name "cassini-headers")
10289 (version "14.0.0")
10290 (home-page "https://github.com/HewlettPackard/shs-cassini-headers")
10291 (source (origin
10292 (method git-fetch)
10293 (uri (git-reference
10294 (url home-page)
10295 (commit (string-append "release/shs-" version))))
10296 (file-name (git-file-name name version))
10297 (sha256
10298 (base32
10299 "074r1snc682f1b6vgswyz55n8zjf5rhqnsl31xsswih7q9q38jda"))
10300 (patches (search-patches "cassini-headers-memset.patch"))))
10301 (build-system copy-build-system)
10302 (arguments
10303 (list #:install-plan
10304 #~'(("include" "include")
10305 ("share/cassini-headers" "share/cassini-headers"))))
10306 (synopsis "Cassini network hardware definitions and headers")
10307 (description
10308 "This package provides hardware definitions and C headers for use by
10309the Linux driver and by user-space applications for the Cassini/Slingshot
10310high-speed network interconnect made by HPE (formerly Cray). User-land
10311software uses @file{cxi_prov_hw.h} from this package.")
10312 ;; As per include/cxi_prov_hw.h it is __aarch64__ or __x86_64__ only.
10313 (supported-systems '("x86_64-linux" "aarch64-linux"))
10314 (license (list license:gpl2 license:bsd-2)))) ;dual-licensed
10315
10316(define-public cxi-driver
10317 (package
10318 (name "cxi-driver")
10319 (version "14.0.0")
10320 (home-page "https://github.com/HewlettPackard/shs-cxi-driver")
10321 (source
10322 (origin
10323 (method git-fetch)
10324 (uri (git-reference
10325 (url home-page)
10326 (commit (string-append "release/shs-" version))))
10327 (file-name (git-file-name name version))
10328 (sha256
10329 (base32
10330 "07dhdm1az9hvy48iq8bn0wypwyml59yr5aqqyf1yhwrf1basry9g"))))
10331 ;; TODO: Actually build the Linux driver.
10332 (build-system copy-build-system)
10333 (arguments
10334 (list #:install-plan #~'(("include" "include"))))
10335 (propagated-inputs (list cassini-headers))
10336 (synopsis "Linux driver for the Cassini/Slingshot interconnect")
10337 (description
10338 "This is the Linux driver for the Cray/HPE Cassini 1 and 2 high-speed
10339network interconnect (aka. Slingshot), and its Ethernet driver. It includes
10340the @file{uapi/misc/cxi.h} C header file for use by user-land software.
10341
10342Currently the Linux driver itself is missing from this package.")
10343 (license license:gpl2+)))
10344
10345(define-public cxi-driver-for-libfabric-1
10346 ;; This old version defines constants such as 'CXI_MAP_IOVA_ALLOC' that
10347 ;; libfabric 1.22.0 relies on.
10348 (let ((commit "5f0ec0ead6ef3f98542a2ef5e76b89d14dd22150")
10349 (revision "0"))
10350 (package
10351 (inherit cxi-driver)
10352 (name "cxi-driver")
10353 (version (git-version "1.0.0" ;per .spec file
10354 revision commit))
10355 (home-page "https://github.com/HewlettPackard/shs-cxi-driver")
10356 (source
10357 (origin
10358 (method git-fetch)
10359 (uri (git-reference (url home-page) (commit commit)))
10360 (file-name (git-file-name name version))
10361 (sha256
10362 (base32
10363 "19cly014ihgdidrc1aki2xsbfhpc0g73v0vxcky8r27xza7rz5bg")))))))
10364
10365(define-public libcxi
10366 (package
10367 (name "libcxi")
10368 ;; Note: Do not upgrade until
10369 ;; <https://github.com/HewlettPackard/shs-libcxi/issues/18> is resolved.
10370 (version "13.0.0")
10371 (home-page "https://github.com/HewlettPackard/shs-libcxi")
10372 (source
10373 (origin
10374 (method git-fetch)
10375 (uri (git-reference (url home-page)
10376 (commit (string-append "release/shs-" version))))
10377 (file-name (git-file-name name version))
10378 (sha256
10379 (base32 "1m8mds1h8plhfn2ja9br31xaiy82ky69685cp1rznanl18inaiff"))))
10380 (build-system gnu-build-system)
10381 (arguments
10382 (list #:configure-flags
10383 #~(list "--disable-static"
10384 (string-append "--with-udevrulesdir="
10385 #$output "/lib/udev/rules.d"))
10386
10387 #:phases
10388 #~(modify-phases %standard-phases
10389 (add-before 'configure 'set-cassini-file-names
10390 (lambda* (#:key inputs #:allow-other-keys)
10391 (substitute* "utils/cxi_dump_csrs.py"
10392 (("/usr/share/cassini-headers/csr_defs.json")
10393 (search-input-file
10394 inputs
10395 "/share/cassini-headers/csr_defs.json"))))))))
10396 (native-inputs (list autoconf
10397 automake
10398 libtool
10399 pkg-config
10400 python-wrapper))
10401 (inputs (list libconfig
10402 libuv
10403 fuse-2
10404 libyaml
10405 libnl
10406 numactl
10407 eudev
10408 (list lm-sensors "lib")))
10409 (propagated-inputs (list cassini-headers cxi-driver))
10410 (synopsis "Interface to the Cassini/Slingshot high-speed interconnect")
10411 (description
10412 "Libcxi provides applications with a low-level interface to the
10413Cray/HPE Cassini high-speed @acronym{NIC, network interface controller}, also
10414known as Slingshot.")
10415
10416 ;; License is spelled out in 'cray-libcxi.spec' and in source file
10417 ;; headers.
10418 (license (list license:lgpl2.1+ license:bsd-3)))) ;dual-licensed
10419
10420(define-public libfabric
10421 (package
10422 (name "libfabric")
10423 (version "2.5.1")
10424 (source
10425 (origin
10426 (method git-fetch)
10427 (uri (git-reference
10428 (url "https://github.com/ofiwg/libfabric")
10429 (commit (string-append "v" version))))
10430 (file-name (git-file-name name version))
10431 (sha256 (base32 "15z0g1z62hv6kkiksvpxl6xv07wdmnvqhm5vnh0vq4ipr8f5vikp"))))
10432 (build-system gnu-build-system)
10433 (native-inputs
10434 (list autoconf
10435 automake
10436 libtool))
10437 (inputs
10438 (let ((if-supported ;XXX: modified from openmpi
10439 (lambda (package . extra)
10440 (if (and (not (%current-target-system))
10441 (member (%current-system)
10442 (package-transitive-supported-systems package)))
10443 (cons package extra)
10444 '()))))
10445 (append (list rdma-core libnl)
10446 (if-supported psm)
10447 (if-supported psm2)
10448 (if-supported libcxi curl json-c))))
10449 (arguments
10450 (list #:configure-flags
10451 #~(append (if #$(target-64bit?)
10452 (list "--enable-efa")
10453 '())
10454 (list #$@(if (this-package-input "libcxi")
10455 #~("--enable-cxi")
10456 #~())
10457 #$@(if (this-package-input "rocr-runtime")
10458 #~((string-append "--with-rocr="
10459 #$(this-package-input "rocr-runtime")))
10460 #~())
10461 "--enable-verbs"))
10462 #:phases
10463 #~(modify-phases %standard-phases
10464 (add-after 'install 'remove-libtool-archive
10465 (lambda _
10466 ;; 'libfabric.la' has '-ljson-c' without a corresponding
10467 ;; '-L' in 'dependency_libs', which in turn causes users
10468 ;; such as Open MPI to fail at link time due to '-ljson-c'
10469 ;; not being found, even when building a shared library.
10470 ;; So, remove the .la file.
10471 (delete-file
10472 (string-append #$output
10473 "/lib/libfabric.la")))))))
10474 (home-page "https://ofiwg.github.io/libfabric/")
10475 (synopsis "Open Fabric Interfaces")
10476 (description
10477 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
10478communication services to applications. OFI is best described as a collection
10479of libraries and applications used to export fabric services. The key
10480components of OFI are: application interfaces, provider libraries, kernel
10481services, daemons, and test applications.
10482
10483Libfabric is a core component of OFI. It is the library that defines and
10484exports the user-space API of OFI, and is typically the only software that
10485applications deal with directly. It works in conjunction with provider
10486libraries, which are often integrated directly into libfabric.")
10487 (license (list license:bsd-2 license:gpl2)))) ;dual
10488
10489;; Note: ROCm support is kept separate to avoid a significant increase in
10490;; closure size: <https://codeberg.org/guix/guix/issues/7225>.
10491(define-public libfabric-rocm
10492 (package/inherit libfabric
10493 (name "libfabric-rocm")
10494 (inputs (modify-inputs inputs
10495 (append rocr-runtime)))
10496 (synopsis "Open Fabric Interfaces (with ROCm support)")))
10497
10498(define-public libfabric-1 ;needed by Open MPI 4.x
10499 (package
10500 (inherit libfabric)
10501 (name "libfabric")
10502 (version "1.22.0")
10503 (source
10504 (origin
10505 (method git-fetch)
10506 (uri (git-reference
10507 (url "https://github.com/ofiwg/libfabric")
10508 (commit (string-append "v" version))))
10509 (file-name (git-file-name name version))
10510 (sha256 (base32 "1scwkfdnlg20hld03pdq83jq1q3nmvj1gravpn02pacqq18bv9xk"))))
10511 (inputs
10512 (modify-inputs inputs
10513 (append cxi-driver-for-libfabric-1)))))
10514
10515(define-public psm
10516 (package
10517 (name "psm")
10518 (version "3.3.20170428")
10519 (home-page "https://github.com/intel/psm")
10520 (source
10521 (origin
10522 (method git-fetch)
10523 (uri (git-reference (url home-page)
10524 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
10525 (file-name (string-append "psm-" version ".tar.gz"))
10526 (sha256
10527 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
10528 (patches (search-patches
10529 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
10530 "psm-ldflags.patch" ; build shared lib with LDFLAGS
10531 "psm-repro.patch" ; reproducibility
10532 "psm-disable-memory-stats.patch"))
10533 (modules '((guix build utils)))
10534 (snippet
10535 ;; That file declares its own 'strlcat' as static. To avoid a
10536 ;; conflict with the function now in glibc 2.39, give it a
10537 ;; different name.
10538 #~(substitute* "ptl_ips/ips_proto_dump.c"
10539 (("strlcat")
10540 "psm_custom_strlcat")))))
10541 (build-system gnu-build-system)
10542 (outputs '("out" "debug"))
10543 (inputs `(("libuuid" ,util-linux "lib")))
10544 (arguments
10545 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
10546 ,(string-append "INSTALL_PREFIX=" %output)
10547 ,(string-append "CFLAGS=-Wall -fpic -fPIC -D_GNU_SOURCE"
10548 " -funwind-tables -O3 -g3"
10549 " -DPSM_USE_SYS_UUID"
10550 " -Wno-strict-aliasing -DNVALGRIND"
10551 " -fcommon")
10552 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
10553 #:tests? #f
10554 #:phases (modify-phases %standard-phases
10555 (delete 'configure)
10556 (add-after 'unpack 'patch-/usr/include
10557 (lambda _
10558 (substitute* "Makefile"
10559 (("\\$\\{DESTDIR}/usr/include")
10560 (string-append %output "/include")))
10561 (substitute* "Makefile"
10562 (("/lib64") "/lib"))
10563 #t))
10564 (add-after 'unpack 'patch-sysmacros
10565 (lambda _
10566 (substitute* "ipath/ipath_proto.c"
10567 (("#include <sys/poll.h>" m)
10568 (string-append m "\n"
10569 "#include <sys/sysmacros.h>")))
10570 #t)))))
10571 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
10572 (description
10573 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
10574communications interface for the True Scale family of products. PSM users are
10575enabled with mechanisms necessary to implement higher level communications
10576interfaces in parallel environments.")
10577 ;; Only Intel-compatible processors are supported.
10578 (supported-systems '("i686-linux" "x86_64-linux"))
10579 (license (list license:bsd-2 license:gpl2)))) ;dual
10580
10581(define-public snapscreenshot
10582 (package
10583 (name "snapscreenshot")
10584 (version "1.0.14.3")
10585 (source
10586 (origin
10587 (method url-fetch)
10588 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
10589 name "-" version ".tar.bz2"))
10590 (sha256
10591 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
10592 (build-system gnu-build-system)
10593 (arguments
10594 `(#:make-flags
10595 (let ((out (assoc-ref %outputs "out")))
10596 (list (string-append "BINDIR=" out "/bin")
10597 (string-append "MANDIR=" out "/share/man")))
10598 #:tests? #f ; no test suite
10599 #:phases
10600 (modify-phases %standard-phases
10601 (delete 'configure) ; ./configure is a snarky no-op
10602 (add-before 'install 'fix-ownership
10603 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
10604 (lambda _
10605 (substitute* "depfun.mak"
10606 ((" -o bin -g bin ") " "))
10607 #t))
10608 (add-before 'install 'create-output-directories
10609 (lambda* (#:key outputs #:allow-other-keys)
10610 (let ((out (assoc-ref outputs "out")))
10611 (mkdir-p (string-append out "/share/man/man1"))
10612 #t))))))
10613 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
10614 (synopsis "Take screenshots of one or more Linux text consoles")
10615 (description
10616 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
10617Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
10618relevant @file{/dev/vcs*} file(s).")
10619 (license license:gpl2)))
10620
10621(define-public fbcat
10622 (package
10623 (name "fbcat")
10624 (version "0.5.2")
10625 (source
10626 (origin
10627 (method url-fetch)
10628 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
10629 version "/" name "-" version ".tar.gz"))
10630 (sha256
10631 (base32 "07q6f0xj7b4gjvn69qfn0g04yd0ch8ndzyigcz8nnrhli0cvsbh6"))))
10632 (build-system gnu-build-system)
10633 (outputs (list "out" "fbgrab"))
10634 (arguments
10635 (list
10636 #:make-flags
10637 #~(list "CC=gcc" (string-append "PREFIX=" #$output))
10638 #:tests? #f ;no tests
10639 #:phases
10640 #~(modify-phases %standard-phases
10641 (delete 'configure) ;no configure script
10642 (add-after 'build 'qualify-references
10643 (lambda* (#:key inputs #:allow-other-keys)
10644 (let ((pnmtopng (assoc-ref inputs "pnmtopng")))
10645 (substitute* "fbgrab"
10646 (("fbcat" all)
10647 (string-append #$output "/bin/" all))
10648 (("pnmtopng")
10649 (search-input-file inputs "/bin/pnmtopng"))))))
10650 (add-after 'install 'split-fbgrab-output
10651 (lambda _
10652 (for-each (lambda (file)
10653 (let ((old (string-append #$output "/" file))
10654 (new (string-append #$output:fbgrab "/" file)))
10655 (mkdir-p (dirname new))
10656 (rename-file old new)))
10657 (list "bin/fbgrab" "share/man/man1/fbgrab.1")))))))
10658 (inputs
10659 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
10660 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
10661 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
10662 (list netpbm))
10663 (home-page "https://jwilk.net/software/fbcat")
10664 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
10665 (description
10666 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
10667a dump thereof. It supports a wide range of drivers and pixel formats.
10668
10669@command{fbcat} can take screenshots of virtually any application that can be
10670made to write its output to the framebuffer, including (but not limited to)
10671text-mode or graphical applications that don't use a display server.
10672
10673Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
10674emulates the behaviour of Gunnar Monell's older fbgrab utility.")
10675 (license license:gpl2)))
10676
10677(define-public fbgrab
10678 (package
10679 (name "fbgrab")
10680 (version "1.5")
10681 (source (origin
10682 (method git-fetch)
10683 (uri (git-reference
10684 (url "https://github.com/GunnarMonell/fbgrab")
10685 (commit version)))
10686 (file-name (git-file-name name version))
10687 (sha256
10688 (base32
10689 "1npn7l8jg0nhjraybjl38v8635zawzmn06ql3hs3vhci1vi1r90r"))))
10690 (build-system gnu-build-system)
10691 (arguments
10692 (list #:tests? #f ;no test suite
10693 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
10694 (string-append "DESTDIR=" #$output))
10695 #:phases #~(modify-phases %standard-phases
10696 (add-after 'unpack 'strip-/usr-prefix
10697 (lambda _
10698 (substitute* "Makefile"
10699 (("/usr") ""))))
10700 (delete 'configure))))
10701 (inputs (list libpng zlib))
10702 (home-page "https://github.com/GunnarMonell/fbgrab")
10703 (synopsis "Linux framebuffer screenshot/conversion utility")
10704 (description "FBGrab is a framebuffer screenshot program that captures the
10705Linux framebuffer and converts it to a PNG image. It can also convert a
10706framebuffer dump file (copy) to a PNG image.")
10707 (license license:gpl2))) ;GPL 2.0 only (per SPDX identifier in fbgrab.c)
10708
10709(define-public libcgroup
10710 (package
10711 (name "libcgroup")
10712 (version "3.2.0")
10713 (home-page "https://github.com/libcgroup/libcgroup")
10714 (source
10715 (origin
10716 (method url-fetch)
10717 (uri (string-append
10718 "https://github.com/libcgroup/libcgroup/releases/download/v"
10719 version "/" name "-" version ".tar.gz"))
10720 (sha256
10721 (base32 "1zmxhqp8kj2n7yvj82nsy5sx07yrxj4r37w41lz5q8bpqgbc43ws"))))
10722 (build-system gnu-build-system)
10723 (arguments
10724 ;; Tests are virtualized with lxc, it is not very feasible
10725 ;; to make them executable under guix build. Also, note that
10726 ;; origin is using source tarball release which is prepared
10727 ;; after testing.
10728 (list #:tests? #f
10729 #:configure-flags
10730 #~'("--disable-systemd")))
10731 (native-inputs
10732 (list bison flex))
10733 (inputs
10734 (list linux-pam))
10735 (synopsis "Control groups management tools")
10736 (description "Control groups is Linux kernel method for process resource
10737restriction, permission handling and more. This package provides userspace
10738interface to this kernel feature.")
10739 (license license:lgpl2.1)))
10740
10741(define-public mbpfan
10742 (package
10743 (name "mbpfan")
10744 (version "2.4.0")
10745 (source
10746 (origin
10747 (method git-fetch)
10748 (uri (git-reference
10749 (url "https://github.com/dgraziotin/mbpfan")
10750 (commit (string-append "v" version))))
10751 (file-name (git-file-name name version))
10752 (sha256
10753 (base32 "146sshsjafi26n741jvi9mdbazwf74jlacxfwkky4fhbq98idlhp"))))
10754 (build-system gnu-build-system)
10755 (arguments
10756 (list #:tests? #f ; tests ask to be run as root
10757 #:make-flags
10758 #~(list (string-append "DESTDIR=" #$output)
10759 (string-append "CC=" #$(cc-for-target)))
10760 #:phases
10761 #~(modify-phases %standard-phases
10762 (add-after 'unpack 'patch-paths
10763 (lambda _
10764 (substitute* "Makefile"
10765 (("/usr") ""))))
10766 (delete 'configure)))) ; there's no configure phase
10767 (home-page "https://github.com/dgraziotin/mbpfan")
10768 (synopsis "Control fan speed on Macbooks")
10769 (description
10770 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
10771the @code{coretemp} module and sets the fan speed using the @code{applesmc}
10772module. It can be executed as a daemon or in the foreground with root
10773privileges.")
10774 (license license:gpl3+)))
10775
10776(define-public psm2
10777 (package
10778 (name "psm2")
10779 (version "12.0")
10780 (source (origin
10781 (method git-fetch)
10782 (uri (git-reference
10783 (url "https://github.com/intel/opa-psm2")
10784 ;; tag 'psm-v12.0' = commit ad5dd1b
10785 (commit (string-append "psm-v" version))))
10786 (file-name (git-file-name name version))
10787 (sha256
10788 (base32
10789 "04nar65ac11qqx41vkfs7iip8kfiah0zms7l4rmsxncpiz2iqfik"))
10790 (patches
10791 (search-patches
10792 "psm2-compile-ctor-without-avx.patch"))
10793 (modules '((guix build utils)))
10794 (snippet
10795 ;; That file declares its own 'strlcat' as static. To avoid a
10796 ;; conflict with the function now in glibc 2.39, give it a
10797 ;; different name.
10798 #~(substitute* "ptl_ips/ips_proto_dump.c"
10799 (("strlcat")
10800 "psm2_custom_strlcat")))))
10801 (build-system gnu-build-system)
10802 (arguments
10803 (list #:make-flags
10804 #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
10805 #:tests? #f
10806 #:phases #~(modify-phases %standard-phases
10807 (delete 'configure)
10808 (add-after 'unpack 'patch-Makefiles
10809 (lambda _
10810 (substitute* "Makefile"
10811 (("/lib64") "/lib")
10812 (("/usr") ""))
10813 (substitute* "compat/Makefile"
10814 (("/lib64") "/lib")
10815 (("/usr") ""))))
10816 (replace 'install
10817 (lambda _
10818 (setenv "DESTDIR" #$output)
10819 (invoke "make" "install"))))))
10820 (inputs
10821 (list rdma-core numactl))
10822 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
10823 (description
10824 "This package is low-level user-level Intel's communications interface.
10825The PSM2 API is a high-performance vendor-specific protocol that provides a
10826low-level communications interface for the Intel Omni-Path family of
10827high-speed networking devices.")
10828 (home-page "https://github.com/intel/opa-psm2")
10829 ;; Only the x86_64 architecture is supported.
10830 (supported-systems '("x86_64-linux"))
10831 (license (list license:bsd-3 license:gpl2)))) ; dual
10832
10833(define-public libpathrs
10834 (package
10835 (name "libpathrs")
10836 (version "0.2.6")
10837 (source
10838 (origin
10839 (method git-fetch)
10840 (uri (git-reference
10841 (url "https://github.com/cyphar/libpathrs")
10842 (commit (string-append "v" version))))
10843 (file-name (git-file-name name version))
10844 (sha256
10845 (base32 "0xxyrzf7h1wsjfays70wcql200jxchv9kqbgn1kswz3alnkmxxqn"))))
10846 (build-system cargo-build-system)
10847 (arguments
10848 (list
10849 #:install-source? #f
10850 #:features ''("capi")
10851 ;; tests: 4892 passed; 0 failed; 1777 ignored; 0 measured; 9 filtered out
10852 #:cargo-test-flags
10853 '`("--"
10854 ;; "Awful hack to detect the /proc/sys overmount case in containers."
10855 ;; src/tests/common/procfs.rs tries to read /proc and /proc/sys.
10856 ,@(map (lambda (test) (string-append "--skip=tests::test_procfs"
10857 "::procfs_overmounts_new_"
10858 test))
10859 '("opath_procpid1_readlink_pid1_nomount"
10860 "openat2_procpid1_readlink_pid1_nomount"
10861 "procpid1_readlink_pid1_nomount"
10862 "unmasked_opath_procpid1_readlink_pid1_nomount"
10863 "unmasked_openat2_procpid1_readlink_pid1_nomount"
10864 "unmasked_procpid1_readlink_pid1_nomount"
10865 "unsafe_open_opath_procpid1_readlink_pid1_nomount"
10866 "unsafe_open_openat2_procpid1_readlink_pid1_nomount"
10867 "unsafe_open_procpid1_readlink_pid1_nomount")))
10868 #:phases
10869 #~(modify-phases %standard-phases
10870 (replace 'install
10871 (lambda _
10872 (invoke "cargo" "cinstall" "--release"
10873 "--library-type" "cdylib"
10874 "--library-type" "staticlib"
10875 "--features" "capi"
10876 (string-append "--prefix=" #$output)))))))
10877 (native-inputs (list rust-cargo-c util-linux which))
10878 (inputs (cargo-inputs 'libpathrs))
10879 (home-page "https://github.com/cyphar/libpathrs")
10880 (synopsis "C-friendly API to make path resolution safer on Linux")
10881 (description
10882 "This library implements a set of C-friendly APIs to make path resolution
10883within a potentially-untrusted directory safe on GNU/Linux.")
10884 (license (list license:gpl3 license:lgpl3+ license:mpl2.0))))
10885
10886(define-public libpfm4
10887 (package
10888 (name "libpfm4")
10889 (version "4.9.0")
10890 (source (origin
10891 (method url-fetch)
10892 (uri (string-append "mirror://sourceforge/perfmon2/"
10893 name "/libpfm-" version ".tar.gz"))
10894 (sha256
10895 (base32
10896 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
10897 (build-system gnu-build-system)
10898 (arguments
10899 '(#:modules ((guix build utils)
10900 (guix build gnu-build-system))
10901 #:phases (modify-phases %standard-phases
10902 (delete 'configure)
10903 (delete 'check)
10904 (replace 'build
10905 (lambda* (#:key inputs outputs #:allow-other-keys)
10906 (let* ((out (assoc-ref outputs "out")))
10907 (setenv "CC" "gcc")
10908 (setenv "CFLAGS" "-Wno-format-truncation")
10909 (invoke "make")
10910 #t)))
10911 (replace 'install
10912 (lambda* (#:key outputs #:allow-other-keys)
10913 (let* ((out (assoc-ref outputs "out")))
10914 (invoke "make"
10915 (string-append "PREFIX=" out)
10916 "install")
10917 #t))))))
10918 (synopsis "Performance event monitoring library")
10919 (description
10920 "This package provides a library called libpfm4, which is used to develop
10921monitoring tools exploiting the performance monitoring events such as those
10922provided by the Performance Monitoring Unit (PMU) of modern processors.
10923
10924Libpfm4 helps convert from an event name, expressed as a string, to the event
10925encoding that is either the raw event as documented by the hardware vendor or
10926the OS-specific encoding. In the latter case, the library is able to prepare
10927the OS-specific data structures needed by the kernel to setup the event.
10928
10929libpfm4 provides support for the @code{perf_events} interface, which was
10930introduced in Linux 2.6.31.")
10931 (home-page "https://perfmon2.sourceforge.net/")
10932 (license license:expat)))
10933
10934(define-public libnfnetlink
10935 (package
10936 (name "libnfnetlink")
10937 (version "1.0.2")
10938 (source (origin
10939 (method url-fetch)
10940 (uri (string-append
10941 "https://www.netfilter.org/projects/libnfnetlink/files/"
10942 "libnfnetlink-" version ".tar.bz2"))
10943 (sha256
10944 (base32
10945 "0xn3rcrzxr6g82kfxzs9bqn2zvl2kf2yda30drwb9vr6sk1wfr5h"))))
10946 (build-system gnu-build-system)
10947 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
10948 (synopsis "Low-level netfilter netlink communication library")
10949 (description
10950 "@code{libnfnetlink} is the low-level library for netfilter related
10951kernel/userspace communication. It provides a generic messaging
10952infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
10953nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
10954management tools in userspace.")
10955 (license license:gpl2)))
10956
10957(define-public libinih
10958 (package
10959 (name "libinih")
10960 (version "62")
10961 (source (origin
10962 (method git-fetch)
10963 (uri (git-reference
10964 (url "https://github.com/benhoyt/inih")
10965 (commit (string-append "r" version))))
10966 (file-name (git-file-name name version))
10967 (sha256
10968 (base32
10969 "0yl5057682gvk1iszjkz4hy73yv45l7wr3fwhbgyf7r7fwx0cwwf"))))
10970 (build-system meson-build-system)
10971 ;; Install static libraries for use by the initrd's xfsprogs/static.
10972 (outputs (list "out" "static"))
10973 (arguments
10974 `(#:configure-flags
10975 (list "-Ddistro_install=true"
10976 "-Ddefault_library=both")
10977 #:phases
10978 (modify-phases %standard-phases
10979 (add-after 'install 'separate-static
10980 (lambda* (#:key outputs #:allow-other-keys)
10981 (let ((out (assoc-ref outputs "out"))
10982 (static (assoc-ref outputs "static")))
10983 (with-directory-excursion out
10984 (for-each (lambda (source)
10985 (let ((target (string-append static "/" source)))
10986 (mkdir-p (dirname target))
10987 (rename-file source target)))
10988 (find-files "lib" "\\.a$")))))))))
10989 (home-page "https://github.com/benhoyt/inih")
10990 (synopsis "Simple .INI parser library for C")
10991 (description "The inih (INI Not Invented Here) library is a simple .INI file
10992parser written in C. It's only a couple of pages of code, and it was designed to
10993be small and simple, so it's good for embedded systems. It's also more or less
10994compatible with Python's ConfigParser style of .INI files, including RFC
10995822-style multi-line syntax and name: value entries.")
10996 (license license:bsd-3)))
10997
10998(define-public simpleini
10999 (package
11000 (name "simpleini")
11001 (version "4.25")
11002 (source (origin
11003 (method git-fetch)
11004 (uri (git-reference
11005 (url "https://github.com/brofield/simpleini")
11006 (commit (string-append "v" version))))
11007 (file-name (git-file-name name version))
11008 (sha256
11009 (base32
11010 "1v9s0kr5ca1gdbnlkdz7chzypy0wz95f09l0r6jnmff4qy6db56l"))))
11011 (build-system cmake-build-system)
11012 (arguments
11013 (list #:configure-flags #~(list "-DSIMPLEINI_USE_SYSTEM_GTEST=ON")))
11014 (native-inputs (list googletest))
11015 (home-page "https://github.com/brofield/simpleini")
11016 (synopsis "Simple API to read and write INI-style files")
11017 (description
11018 "SimpleIni provides a simple API to read and write INI-style
11019configuration files. It supports data files in ASCII, MBCS and Unicode.")
11020 (license license:expat)))
11021
11022(define-public xfsprogs
11023 (package
11024 (name "xfsprogs")
11025 (version "6.12.0")
11026 (source
11027 (origin
11028 (method url-fetch)
11029 (uri (string-append "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
11030 "xfsprogs-" version ".tar.gz"))
11031 (sha256
11032 (base32 "1n46n27fxx1137kni3drrhzhp1l8ksxabcsmi8yzxbhpbnl4q293"))))
11033 (build-system gnu-build-system)
11034 (outputs (list "out" "python"))
11035 (arguments
11036 (list
11037 #:tests? #f ;kernel/user integration tests are in package "xfstests"
11038 #:configure-flags
11039 #~(list "--disable-static")
11040 #:make-flags
11041 #~(list "V=1")
11042 #:phases
11043 #~(modify-phases %standard-phases
11044 (add-after 'install 'separate-python-output
11045 (lambda _
11046 (for-each
11047 (lambda (script)
11048 (mkdir-p (string-append #$output:python (dirname script)))
11049 (rename-file (string-append #$output script)
11050 (string-append #$output:python script)))
11051 (list "/sbin/xfs_scrub_all"))))
11052 (add-after 'install 'install-headers
11053 (lambda* (#:key make-flags #:allow-other-keys)
11054 (apply invoke "make" "install-dev" make-flags))))))
11055 (native-inputs (list gettext-minimal))
11056 (inputs (list libinih
11057 liburcu
11058 (list util-linux "lib")
11059 python-wrapper))
11060 (home-page "https://xfs.wiki.kernel.org/")
11061 (synopsis "XFS file system tools")
11062 (description "This package provides commands to create and check XFS
11063file systems.")
11064 ;; The library "libhandle" and the headers in "xfslibs-dev" are
11065 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
11066 (license (list license:gpl2 license:lgpl2.1))))
11067
11068(define-public xfsprogs-5.9
11069 (package
11070 (inherit xfsprogs)
11071 (name "xfsprogs")
11072 (version "5.9.0")
11073 (source (origin
11074 (method url-fetch)
11075 (uri (string-append
11076 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
11077 "xfsprogs-" version ".tar.gz"))
11078 (sha256
11079 (base32
11080 "13xkn9jpmwp4fm9r68vhgznkmxhnv83n2b39mhy2qdaph90w2a1l"))))
11081 (arguments
11082 (substitute-keyword-arguments arguments
11083 ((#:configure-flags configure-flags #~(list))
11084 #~(cons* "--enable-gettext=no" #$configure-flags))))
11085 (native-inputs
11086 (modify-inputs native-inputs
11087 (delete "gettext-minimal")))))
11088
11089(define-public xfsprogs/static
11090 (package
11091 (inherit xfsprogs)
11092 (name "xfsprogs-static")
11093 (outputs (list "out"))
11094 (arguments
11095 (substitute-keyword-arguments arguments
11096 ((#:configure-flags configure-flags #~(list))
11097 #~(append #$configure-flags
11098 (list "--enable-static")))
11099 ((#:make-flags make-flags #~(list))
11100 #~(cons* "LLDFLAGS=-all-static" #$make-flags))
11101 ((#:phases _ #~%standard-phases)
11102 #~(modify-phases %standard-phases
11103 (add-after 'install 'delete-useless-files
11104 (lambda _
11105 (with-directory-excursion #$output
11106 (for-each delete-file-recursively
11107 (list "include" "lib")))))))))
11108 (inputs
11109 (modify-inputs inputs
11110 (delete "python-wrapper")
11111 (prepend (list libinih "static")
11112 (list util-linux "static"))))
11113 (synopsis "Statically linked XFS file system tools")))
11114
11115(define-public xfs-repair/static
11116 (package
11117 (name "xfs-repair-static")
11118 (version (package-version xfsprogs/static))
11119 (source #f)
11120 (build-system trivial-build-system)
11121 (arguments
11122 (list
11123 #:modules `((guix build utils))
11124 #:builder
11125 #~(begin
11126 (use-modules (guix build utils))
11127 (let ((sbin (string-append #$output "/sbin")))
11128 (install-file (search-input-file %build-inputs "/sbin/xfs_repair")
11129 sbin)
11130 (with-directory-excursion sbin
11131 (remove-store-references "xfs_repair"))))))
11132 (inputs (list xfsprogs/static))
11133 (home-page (package-home-page xfsprogs/static))
11134 (synopsis "Statically linked @command{xfs_repair} from xfsprogs")
11135 (description
11136 "This package provides a statically linked @command{xfs_repair} taken
11137from the xfsprogs package. It is meant to be used in initrds.")
11138 (license (package-license xfsprogs/static))))
11139
11140(define-deprecated-package xfs_repair/static
11141 "xfs_repair-static" xfs-repair/static)
11142
11143(define-public genext2fs
11144 (package
11145 (name "genext2fs")
11146 (version "1.5.0")
11147 (source (origin
11148 (method git-fetch)
11149 (uri (git-reference
11150 (url "https://github.com/bestouff/genext2fs")
11151 (commit "474111097321f03de9e009aa9f7d4a8948e310b2")))
11152 (file-name (git-file-name name version))
11153 (sha256
11154 (base32 "14lgvml5zz99845ja47jpf4iirjzfqv36ffzachh3hw2ggji9c7l"))))
11155 (build-system gnu-build-system)
11156 (native-inputs
11157 (list autoconf automake))
11158 (home-page "https://github.com/bestouff/genext2fs")
11159 (synopsis "Generate ext2 file system as a normal user")
11160 (description "This package provides a program to generate an ext2
11161file system as a normal (non-root) user. It does not require you to mount
11162the image file to copy files on it, nor does it require that you become
11163the superuser to make device nodes.")
11164 (license license:gpl2)))
11165
11166(define-public fakeroot
11167 (package
11168 (name "fakeroot")
11169 (version "1.38")
11170 (source
11171 (origin
11172 ;; There are no tags in the repository, so take this snapshot.
11173 (method url-fetch)
11174 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
11175 "fakeroot/fakeroot_" version ".orig.tar.gz"))
11176 (file-name (string-append name "-" version ".tar.gz"))
11177 (sha256
11178 (base32 "00p07xi1j61i4bbxymydihff8frw9bs0g0fr6rpm88q94wclcl1p"))
11179 (modules '((guix build utils)
11180 (ice-9 ftw)))
11181 (snippet
11182 `(begin
11183 ;; Delete pregenerated man page translations, but not the originals.
11184 (with-directory-excursion "doc"
11185 (for-each (lambda (language)
11186 (for-each delete-file
11187 (find-files language "\\.[0-9]$")))
11188 (scandir "."
11189 (lambda (file)
11190 (and (not (string-prefix? "." file))
11191 (eq? 'directory
11192 (stat:type (lstat file))))))))))))
11193 (build-system gnu-build-system)
11194 (arguments
11195 `(#:configure-flags
11196 (list "--disable-static")
11197 #:phases
11198 (modify-phases %standard-phases
11199 (add-after 'unpack 'patch-Makefile.am
11200 (lambda _
11201 (substitute* "Makefile.am"
11202 (("/bin/sh") (which "sh")))))
11203 (add-after 'unpack 'patch-script
11204 (lambda* (#:key inputs #:allow-other-keys)
11205 (substitute* "scripts/fakeroot.in"
11206 (("getopt")
11207 (string-append (assoc-ref inputs "util-linux")
11208 "/bin/getopt"))
11209 (("sed")
11210 (string-append (assoc-ref inputs "sed")
11211 "/bin/sed"))
11212 (("cat|cut" command)
11213 (string-append (assoc-ref inputs "coreutils")
11214 "/bin/" command)) )))
11215 (replace 'bootstrap
11216 (lambda _
11217 ;; The "preroll" script takes care of Autoconf and also
11218 ;; prepares the translated manuals.
11219 (invoke "sh" "./preroll")))
11220 (add-before 'configure 'setenv
11221 (lambda _
11222 (setenv "LIBS" "-lacl")))
11223 (add-before 'check 'prepare-check
11224 (lambda _
11225 (setenv "SHELL" (which "bash"))
11226 (setenv "VERBOSE" "1")
11227 (substitute* "test/t.touchinstall"
11228 ;; We don't have the name of the root user, so use ID=0.
11229 (("grep root") "grep \"\\<0\\>\""))
11230 (substitute* "test/tartest"
11231 ;; We don't have the name of the root group, so use ID=0.
11232 (("ROOTGROUP=root") "ROOTGROUP=0")
11233 ;; We don't have the name of the daemon user, so use IDs.
11234 (("daemon:sys") "1:3")
11235 (("daemon:") "1:"))
11236 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
11237 (substitute* "test/compare-tar"
11238 (("tar -tvf") "tar --numeric-owner -tvf")))))))
11239 (native-inputs
11240 (list autoconf-2.71 automake gettext-minimal libtool po4a-minimal
11241 perl sharutils xz)) ; for tests
11242 (inputs
11243 (list acl libcap util-linux sed coreutils))
11244 (synopsis "Run commands in an environment with fake root privileges")
11245 (description
11246 "@command{fakeroot} runs a command in an environment where it appears to
11247have root privileges for file manipulation. This is useful for allowing users
11248to create archives (@file{tar}, @file{ar}, @file{deb}, etc.) with files in
11249them with root permissions and/or ownership.
11250
11251Without fakeroot, one would have to have root privileges to create the
11252constituent files of the archives with the correct permissions and ownership,
11253and then pack them up, or one would have to construct the archives directly,
11254without using the archiver.")
11255 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
11256 (license license:gpl3+)))
11257
11258(define-public fakechroot
11259 ;; XXX: Build from the change submitted at
11260 ;; <https://github.com/dex4er/fakechroot/pull/85> to allow compilation
11261 ;; against glibc 2.33. Switch back to the official repository on the next
11262 ;; release.
11263 (let ((commit "e7c1f3a446e594a4d0cce5f5d499c9439ce1d5c5")
11264 (revision "0"))
11265 (package
11266 (name "fakechroot")
11267 (version (git-version "2.20.1" revision commit))
11268 (source (origin
11269 (method git-fetch)
11270 (uri (git-reference
11271 (url "https://github.com/lipnitsk/fakechroot")
11272 (commit commit)))
11273 (file-name (git-file-name name version))
11274 (sha256
11275 (base32
11276 "0gac6a6djx3nf343vd33sr5qqngz8ss3aij54zl8x9wb47pc11kb"))))
11277 (build-system gnu-build-system)
11278 (arguments
11279 ;; XXX: The tests heavily assume they run on an FHS system so for now
11280 ;; skip them.
11281 '(#:tests? #f
11282 #:configure-flags '("--disable-static")))
11283 (native-inputs (list autoconf automake libtool perl))
11284 (synopsis "Emulate @code{chroot} by overriding file system calls")
11285 (description
11286 "@command{fakechroot} runs a command in an environment were is additional
11287possibility to use @code{chroot} command without root privileges. This is
11288useful for allowing users to create own chrooted environment with possibility
11289to install another packages without need for root privileges.
11290
11291It works by providing @file{libfakechroot.so}, a shared library meant to be
11292set as @code{LD_PRELOAD} to override the C library file system functions.")
11293 (home-page "https://github.com/dex4er/fakechroot/")
11294 (license license:lgpl2.1+))))
11295
11296(define-public falcosecurity-libs
11297 (package
11298 (name "falcosecurity-libs")
11299 (version "0.20.0")
11300 (source (origin
11301 (method git-fetch)
11302 (uri (git-reference
11303 (url "https://github.com/falcosecurity/libs/")
11304 (commit version)))
11305 (file-name (git-file-name name version))
11306 (sha256
11307 (base32
11308 "041ir9wk44v7isidwl7fzxrjvs85j637wcr7xirasd8ysxa0r4qv"))
11309 (patches
11310 (search-patches
11311 "falcosecurity-libs-bpf-probes-fix.patch"
11312 "falcosecurity-libs-shared-build.patch"))))
11313 (build-system cmake-build-system)
11314 (arguments
11315 (list
11316 #:configure-flags
11317 #~(list "-DUSE_BUNDLED_DEPS=OFF"
11318 "-DBUILD_DRIVER=OFF"
11319 "-DENABLE_DKMS=OFF"
11320 "-DBUILD_LIBSCAP_MODERN_BPF=ON"
11321 "-DSCAP_FILES_SUITE_ENABLE=OFF" ;attempts to download scap files
11322 "-DBUILD_SHARED_LIBS=ON"
11323 #$(string-append "-DFALCOSECURITY_LIBS_VERSION=" version))
11324 ;; Only the libsinsp test suite is run, as the one for libscap requires
11325 ;; elevated privileges.
11326 #:modules '((guix build cmake-build-system)
11327 ((guix build gnu-build-system) #:prefix gnu:)
11328 (guix build utils))
11329 #:phases
11330 #~(modify-phases %standard-phases
11331 (add-after 'unpack 'disable-problematic-tests
11332 (lambda _
11333 (substitute* "userspace/libsinsp/test/user.ut.cpp"
11334 ;; The 'system_lookup' test assumes a root user
11335 ;; exists in the build environment.
11336 (("TEST_F\\(usergroup_manager_test, system_lookup)")
11337 "TEST_F(usergroup_manager_test, DISABLED_system_lookup)"))))
11338 (replace 'check
11339 (lambda* (#:rest args)
11340 (apply (assoc-ref gnu:%standard-phases 'check)
11341 #:test-target "run-unit-test-libsinsp" args)))
11342 (add-after 'install 'delete-src
11343 (lambda _
11344 (delete-file-recursively
11345 (string-append #$output "/src")))))))
11346 (native-inputs
11347 (list bpftool
11348 clang-18 ;avoid stack limit exceeded build error
11349 googletest
11350 pkg-config
11351 valijson)) ;header-only library
11352 (inputs
11353 (list elfutils))
11354 (propagated-inputs
11355 ;; The following inputs are in the 'Requires' field of libscap.pc,
11356 ;; libsinp.pc or libpman.pc.
11357 (list c-ares
11358 grpc
11359 jsoncpp
11360 libbpf
11361 libelf
11362 openssl
11363 protobuf
11364 uthash ;included in libscap headers
11365 zlib
11366 ;; These are in the 'Requires.private' field of libscap.pc and
11367 ;; libsinp.pc. They are required because the headers are installed
11368 ;; to a non-standard directory, and thus need to be found via the
11369 ;; 'Cflags' field, which in turn mandates that both the pkg-config
11370 ;; modules listed in the 'Requires' and 'Requires.private' be
11371 ;; available.
11372 curl
11373 re2
11374 onetbb))
11375 (home-page "https://github.com/falcosecurity/libs/")
11376 (synopsis "Falco security libraries")
11377 (description "The Falco security libraries include @code{libsinsp} and
11378@code{libscap}. @code{libscap} manages the data capture process, while
11379@code{libsinsp} is a system inspection library that enriches events from
11380@code{libscap} with machine state. @code{libsinsp} also performs events
11381filtering with rule evaluation through its internal rule engine. These
11382libraries are used by the @command{sysdig} command-line utility.")
11383 (license license:asl2.0)))
11384
11385(define-public inputattach
11386 (package
11387 (name "inputattach")
11388 (version "0.42.0")
11389 (source (origin
11390 (method git-fetch)
11391 (uri (git-reference
11392 (url "https://github.com/linuxwacom/input-wacom")
11393 (commit (string-append "input-wacom-" version))))
11394 (file-name (git-file-name name version))
11395 (sha256
11396 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
11397 (build-system gnu-build-system)
11398 (arguments
11399 `(#:phases
11400 (modify-phases %standard-phases
11401 (delete 'bootstrap)
11402 (delete 'configure)
11403 (replace 'build
11404 (lambda* (#:key inputs #:allow-other-keys)
11405 (with-directory-excursion "inputattach"
11406 (invoke "gcc" "-O2" "-o" "inputattach"
11407 "inputattach.c"))))
11408 (delete 'check)
11409 (replace 'install
11410 (lambda* (#:key outputs #:allow-other-keys)
11411 (let ((target-dir (string-append
11412 (assoc-ref outputs "out")
11413 "/bin/")))
11414 (mkdir-p target-dir)
11415 (copy-file "inputattach/inputattach"
11416 (string-append target-dir
11417 "inputattach"))
11418 #t))))))
11419 (home-page "https://linuxwacom.github.io/")
11420 (synopsis "Dispatch input peripherals events to a device file")
11421 (description "inputattach dispatches input events from several device
11422types and interfaces and translates so that the X server can use them.")
11423 (license license:gpl2+)))
11424
11425(define-public keyd
11426 (package
11427 (name "keyd")
11428 (version "2.6.0")
11429 (source
11430 (origin
11431 (method git-fetch)
11432 (uri (git-reference
11433 (url "https://github.com/rvaiya/keyd")
11434 (commit (string-append "v" version))))
11435 (sha256
11436 (base32
11437 "14rgrg8d1ys1cqq46mgi34yqg9jd1q3yw1acw5r5jpwwk0da7g4p"))))
11438 (arguments
11439 (list #:tests? #f ; tests require root
11440 #:make-flags
11441 #~(list (string-append "CC=" #$(cc-for-target))
11442 "PREFIX="
11443 (string-append "DESTDIR=" #$output))
11444 #:phases
11445 '(modify-phases
11446 %standard-phases
11447 (delete 'configure)))) ; no autoconf
11448 (build-system gnu-build-system)
11449 (inputs (list linux-libre-headers))
11450 (synopsis "Key remapping daemon for Linux")
11451 (description
11452 "Keyd is a keyboard remapping utility with intuitive ini configuration
11453file format. Keyd has several features, many of which are traditionally only
11454found in custom keyboard firmware like QMK.")
11455 (home-page "https://github.com/rvaiya/keyd")
11456 (license license:expat)))
11457
11458(define-public pipewire
11459 (package
11460 (name "pipewire")
11461 (version "1.6.8")
11462 (source (origin
11463 (method git-fetch)
11464 (uri (git-reference
11465 (url "https://gitlab.freedesktop.org/pipewire/pipewire")
11466 (commit version)))
11467 (file-name (git-file-name name version))
11468 (sha256
11469 (base32
11470 "1yc70gi4a98q7kbghp08nyp3wvlik120v2w25a14b93gpgwbl55k"))))
11471 (build-system meson-build-system)
11472 (arguments
11473 (list
11474 #:configure-flags
11475 #~(list (string-append "-Dudevrulesdir=" #$output "/lib/udev/rules.d")
11476 "-Dman=enabled"
11477 "-Drlimits-install=false"
11478 "-Dsession-managers=[]"
11479 "-Dsysconfdir=/etc"
11480 "-Dlibsystemd=disabled"
11481
11482 ;; XXX: link with -Wl,--no-as-needed so that libgcc_s.so.1 does not get dropped
11483 ;; Otherwise test_loop will fail with:
11484 ;; libgcc_s.so.1 must be installed for pthread_cancel to work
11485 "-Db_asneeded=false")))
11486 (native-inputs
11487 (list `(,glib "bin")
11488 pkg-config
11489 doxygen
11490 python
11491 python-docutils))
11492 (inputs (list alsa-lib
11493 avahi
11494 bluez
11495 dbus
11496 eudev
11497 ffmpeg
11498 gst-plugins-base
11499 gstreamer
11500 jack-2
11501 ldacbt
11502 libcamera-minimal
11503 libdrm
11504 libfdk
11505 libfreeaptx
11506 libsndfile
11507 libusb
11508 openssl ; raop sink
11509 libva
11510 pulseaudio
11511 readline ; for pw-cli
11512 sbc
11513 vulkan-headers
11514 vulkan-loader
11515 webrtc-audio-processing))
11516 (home-page "https://pipewire.org/")
11517 (synopsis "Server and user space API to deal with multimedia pipelines")
11518 (description
11519 "PipeWire is a project that aims to greatly improve handling of audio and
11520video under Linux. It aims to support the usecases currently handled by both
11521PulseAudio and Jack and at the same time provide same level of powerful handling
11522of Video input and output. It also introduces a security model that makes
11523interacting with audio and video devices from containerized applications easy,
11524with supporting Flatpak applications being the primary goal. Alongside Wayland
11525and Flatpak we expect PipeWire to provide a core building block for the future
11526of Linux application development.")
11527 (license license:lgpl2.0+)))
11528
11529(define-public pipewire-minimal
11530 ;; Used as libpipewire to reduce closure size and avoid dependency cycles.
11531 (hidden-package
11532 (package
11533 (inherit pipewire)
11534 (name "pipewire-minimal")
11535 (arguments
11536 (list
11537 #:configure-flags
11538 #~(list "-Dsession-managers=[]"
11539 "-Ddbus=disabled"
11540 "-Dflatpak=disabled"
11541 ;; XXX: Otherwise test_loop will fail with:
11542 ;; libgcc_s.so.1 must be installed for pthread_cancel to work
11543 "-Db_asneeded=false")))
11544 (native-inputs '())
11545 (inputs '()))))
11546
11547(define-public pipewire-minimal-1.4
11548 (package
11549 (inherit pipewire-minimal)
11550 (name "pipewire")
11551 (version "1.4.10")
11552 (source (origin
11553 (method git-fetch)
11554 (uri (git-reference
11555 (url "https://gitlab.freedesktop.org/pipewire/pipewire")
11556 (commit version)))
11557 (file-name (git-file-name name version))
11558 (sha256
11559 (base32
11560 "14rsdbcsyyhjh7hvbq3d84f6s0fllvq6vpg39cxcd7l8fn4zc2zw"))))))
11561
11562(define-public wireplumber
11563 (package
11564 (name "wireplumber")
11565 (version "0.5.17")
11566 (source
11567 (origin
11568 (method git-fetch)
11569 (uri (git-reference
11570 (url
11571 "https://gitlab.freedesktop.org/pipewire/wireplumber.git")
11572 (commit version)))
11573 (file-name (git-file-name name version))
11574 (sha256
11575 (base32 "108m9wkxldvacv2y543pjk3nzlc55shlfd0zhihms1ksmq3hfl06"))))
11576 (build-system meson-build-system)
11577 (arguments
11578 `(#:configure-flags '("-Dsystemd=disabled"
11579 "-Dsystem-lua=true")))
11580 (native-inputs
11581 (list `(,glib "bin")
11582 pkg-config python-minimal))
11583 (inputs (list dbus elogind glib lua pipewire))
11584 (home-page "https://gitlab.freedesktop.org/pipewire/wireplumber")
11585 (synopsis "Session / policy manager implementation for PipeWire")
11586 (description "WirePlumber is a modular session / policy manager for
11587PipeWire and a GObject-based high-level library that wraps PipeWire's API,
11588providing convenience for writing the daemon's modules as well as external
11589tools for managing PipeWire.")
11590 (license license:expat)))
11591
11592(define-public wireplumber-minimal
11593 (let ((base wireplumber))
11594 (package
11595 (inherit base)
11596 (name "wireplumber-minimal")
11597 (arguments
11598 (substitute-keyword-arguments arguments
11599 ((#:configure-flags flags ''())
11600 #~(cons "-Delogind=disabled" #$flags))))
11601 (inputs
11602 (modify-inputs inputs
11603 (replace "pipewire" pipewire-minimal)
11604 (delete "elogind"))))))
11605
11606(define-public ell
11607 (package
11608 (name "ell")
11609 (version "0.83")
11610 (source (origin
11611 (method git-fetch)
11612 (uri (git-reference
11613 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
11614 (commit version)))
11615 (file-name (git-file-name name version))
11616 (sha256
11617 (base32
11618 "1ywq84jgvf7f86srqwpq31w2kzdp875fx039x5g4lx486plgf526"))
11619 (modules '((guix build utils)))
11620 (snippet
11621 #~(begin
11622 (substitute* "Makefile.am"
11623 ;; requires hwdb.bin
11624 (("unit/test-hwdb.*") ""))))))
11625 (build-system gnu-build-system)
11626 (arguments
11627 ;; Tests launch dbus-daemon instances that all try to bind to
11628 ;; "/tmp/ell-test-bus". Thus, we need to run them sequentially.
11629 '(#:parallel-tests? #f))
11630 (inputs
11631 (list dbus))
11632 (native-inputs
11633 (list autoconf automake libtool pkg-config procps))
11634 (home-page "https://01.org/ell")
11635 (synopsis "Embedded Linux Library")
11636 (description "The Embedded Linux* Library (ELL) provides core, low-level
11637functionality for system daemons. It typically has no dependencies other than
11638the Linux kernel, C standard library, and libdl (for dynamic linking). While
11639ELL is designed to be efficient and compact enough for use on embedded Linux
11640platforms, it is not limited to resource-constrained systems.")
11641 (license license:lgpl2.1+)))
11642
11643(define-public kexec-tools
11644 (package
11645 (name "kexec-tools")
11646 (version "2.0.32")
11647 (source (origin
11648 (method url-fetch)
11649 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
11650 "/kexec/kexec-tools-" version ".tar.xz"))
11651 (sha256
11652 (base32
11653 "0p8af7bgws7bnlglbx62687ysramacg526q0rgv2qdnjbwm450cg"))))
11654 (build-system gnu-build-system)
11655 (arguments
11656 ;; There are no automated tests.
11657 '(#:tests? #f))
11658 ;; This variant of binutils is used for the 64 bit support needed to
11659 ;; assemble the `purgatory/arch/i386/compat_x86_64.S' program on i686-linux.
11660 (native-inputs (list (make-ld-wrapper "ld-wrapper"
11661 #:binutils binutils)
11662 binutils))
11663 (home-page "https://projects.horms.net/projects/kexec/")
11664 (synopsis "Tools for booting directly into different kernels")
11665 (description "This package provides the @code{kexec} program and ancillary
11666utilities. Using @code{kexec}, it is possible to boot directly into a new
11667kernel from the context of an already-running kernel, bypassing the normal
11668system boot process.")
11669 (license license:gpl2)))
11670
11671(define-public cachefilesd
11672 (package
11673 (name "cachefilesd")
11674 (version "0.10.10")
11675 (source (origin
11676 (method url-fetch)
11677 (uri (string-append
11678 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
11679 "/cachefilesd.git/snapshot/cachefilesd-"
11680 version ".tar.gz"))
11681 (sha256
11682 (base32
11683 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
11684 (build-system gnu-build-system)
11685 (outputs '("out"))
11686 (arguments
11687 `(#:tests? #f ; there are no tests
11688 #:make-flags
11689 (let ((prefix-dir (lambda (var dir)
11690 (string-append var "=" %output "/" dir))))
11691 (list (string-append "CC=" ,(cc-for-target))
11692 (prefix-dir "SBINDIR" "sbin/")
11693 (prefix-dir "ETCDIR" "etc/")
11694 (prefix-dir "MANDIR" "share/man/")))
11695 #:phases (modify-phases %standard-phases (delete 'configure))))
11696 (home-page "https://people.redhat.com/~dhowells/cachefs/")
11697 (synopsis "CacheFiles userspace management daemon")
11698 (description "@code{cachefilesd} is a userspace daemon that manages the
11699cache data store that is used by network file systems such as @code{AFS} and
11700@code{NFS} to cache data locally on disk. The content of the cache is
11701persistent over reboots.")
11702 (license license:gpl2+)))
11703
11704(define-public libbpf
11705 (package
11706 (name "libbpf")
11707 (version "1.7.0")
11708 (source
11709 (origin
11710 (method git-fetch)
11711 (uri (git-reference
11712 (url "https://github.com/libbpf/libbpf")
11713 (commit (string-append "v" version))))
11714 (file-name (git-file-name name version))
11715 (sha256
11716 (base32
11717 "1r1ysy8xpdz2nqs0svk4772fbykqh414mqivwylbj5r9v1nf8r02"))))
11718 (build-system gnu-build-system)
11719 (arguments
11720 (list
11721 #:tests? #f ;self-tests run in QEMU
11722 #:make-flags
11723 #~(list (string-append "PREFIX=" #$output)
11724 (string-append "LIBDIR=$(PREFIX)/lib")
11725 (string-append "CC=" #$(cc-for-target)))
11726 #:phases
11727 #~(modify-phases %standard-phases
11728 (delete 'configure)
11729 (add-before 'build 'pre-build
11730 (lambda _
11731 (chdir "src")))
11732 (replace 'install
11733 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
11734 (apply (assoc-ref %standard-phases 'install)
11735 (append args
11736 (list #:make-flags
11737 (append (list "install"
11738 ;; Also install the kernel
11739 ;; user API (uAPI) headers.
11740 "install_uapi_headers")
11741 make-flags)))))))))
11742 (native-inputs (list pkg-config))
11743 (propagated-inputs (list elfutils zlib)) ;in Requires.private of libbpf.pc
11744 (home-page "https://github.com/libbpf/libbpf")
11745 (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
11746 (description
11747 "Libbpf supports building BPF CO-RE-enabled applications, which, in
11748contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
11749headers.")
11750 (license (list license:lgpl2.1 license:bsd-2))))
11751
11752(define-public libbpf-0.8
11753 (package
11754 (inherit libbpf)
11755 (name "libbpf")
11756 (version "0.8.1")
11757 (source
11758 (origin
11759 (method git-fetch)
11760 (uri (git-reference
11761 (url "https://github.com/libbpf/libbpf")
11762 (commit (string-append "v" version))))
11763 (file-name (git-file-name name version))
11764 (sha256
11765 (base32
11766 "1zzpkk4x3f20483dzw43b3ml03d63vvkmqf4j8y3b61b67wm59bm"))))
11767 (arguments
11768 (list
11769 #:tests? #f ;self-tests run in QEMU
11770 #:make-flags
11771 #~(list (string-append "PREFIX=" #$output)
11772 (string-append "LIBDIR=$(PREFIX)/lib")
11773 (string-append "CC=" #$(cc-for-target)))
11774 #:phases #~(modify-phases %standard-phases
11775 (delete 'configure)
11776 (add-before 'build 'pre-build
11777 (lambda _
11778 (chdir "src"))))))
11779 (native-inputs (list pkg-config))
11780 (propagated-inputs (list elfutils zlib)))) ;in Requires.private of libbpf.pc
11781
11782(define-public bcc
11783 (package
11784 (name "bcc")
11785 (version "0.30.0")
11786 (source
11787 (origin
11788 (method git-fetch)
11789 (uri (git-reference
11790 (url "https://github.com/iovisor/bcc")
11791 (commit (string-append "v" version))))
11792 (file-name (git-file-name name version))
11793 (sha256
11794 (base32
11795 "0b5la0yn6x6ll73drnrm5v5yibbrzkvl86hqivkrmnpgy8cqn0cy"))))
11796 (build-system cmake-build-system)
11797 (native-inputs
11798 (list bison
11799 flex
11800 (@ (gnu packages compression) zip)))
11801 (inputs
11802 (list bash-minimal ;for wrap-program
11803 clang-15
11804 elfutils
11805 luajit
11806 libbpf
11807 python-setuptools
11808 python-wrapper))
11809 (arguments
11810 (list
11811 ;; Tests all require root permissions and a "standard" file hierarchy.
11812 #:tests? #f
11813 #:configure-flags #~(list (string-append "-DREVISION=" #$version)
11814 "-DCMAKE_USE_LIBBPF_PACKAGE=ON")
11815 #:phases
11816 #~(modify-phases %standard-phases
11817 (add-after 'unpack 'substitute-libbc
11818 (lambda _
11819 (substitute* "src/python/bcc/libbcc.py"
11820 (("(libbcc\\.so.*)\\b" _ libbcc)
11821 (string-append #$output "/lib/" libbcc)))))
11822 (add-after 'install 'wrap-tools
11823 (lambda _
11824 (use-modules (ice-9 textual-ports))
11825 (let* ((out #$output)
11826 (lib (string-append out "/lib"))
11827 (tools (string-append out "/share/bcc/tools"))
11828 (python-executable?
11829 (lambda (filename _)
11830 (call-with-input-file filename
11831 (lambda (port)
11832 (string-contains (get-line port)
11833 "/bin/python"))))))
11834 (for-each (lambda (python-executable)
11835 (format #t "Wrapping: ~A.~%" python-executable)
11836 (wrap-program python-executable
11837 `("GUIX_PYTHONPATH" ":" prefix
11838 (,(string-append lib
11839 "/python"
11840 #$(version-major+minor
11841 (package-version python))
11842 "/site-packages")))))
11843 (find-files tools python-executable?))))))))
11844 (home-page "https://github.com/iovisor/bcc")
11845 (synopsis "Tools for BPF on Linux")
11846 (description
11847 "BCC is a toolkit for creating efficient kernel tracing and manipulation
11848programs, and includes several useful tools and examples. It makes use of
11849extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
11850that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
11851and above.")
11852 (license license:asl2.0)))
11853
11854(define-public bpftool
11855 (package
11856 (name "bpftool")
11857 (version (package-version linux-libre))
11858 (source (package-source linux-libre))
11859 (build-system gnu-build-system)
11860 (arguments
11861 `(#:tests? #f ;This package has no tests.
11862 #:phases (modify-phases %standard-phases
11863 (delete 'configure)
11864 (replace 'build
11865 (lambda* (#:key inputs #:allow-other-keys)
11866 (invoke "make" "-C" "tools/bpf/bpftool"
11867 ,(string-append "CC=" (cc-for-target)))))
11868 (replace 'install
11869 (lambda* (#:key outputs #:allow-other-keys)
11870 (let* ((out (assoc-ref outputs "out")))
11871 (mkdir-p (string-append out "/sbin"))
11872 (mkdir-p (string-append out
11873 "/share/bash-completion/completions"))
11874 (invoke "make"
11875 (string-append "prefix=" out)
11876 (string-append
11877 "bash_compdir=" out
11878 "/share/bash-completion/completions")
11879 "-C" "tools/bpf/bpftool"
11880 "install")))))))
11881 (inputs (list elfutils ;provides libelf
11882 libcap openssl readline zlib))
11883 (native-inputs (list bison python))
11884 ;; This tool does not have a proper web page.
11885 (home-page
11886 "https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/bpf/bpftool")
11887 (synopsis "Tool for inspection and manipulation of eBPF programs and maps")
11888 (description "@command{bpftool} allows for inspection and simple
11889modification of BPF objects on the system.")
11890 (license (package-license linux-libre))))
11891
11892(define-public bpftrace
11893 (package
11894 (name "bpftrace")
11895 (version "0.21.2")
11896 (source
11897 (origin
11898 (method git-fetch)
11899 (uri (git-reference
11900 (url "https://github.com/bpftrace/bpftrace")
11901 (commit (string-append "v" version))))
11902 (file-name (git-file-name name version))
11903 (sha256
11904 (base32 "0icbhf1wk523a7lcmwqa67zc6hl6h02p5mfg26cizva447kbwsgz"))))
11905 (build-system cmake-build-system)
11906 (arguments
11907 (list
11908 #:test-exclude "(runtime_tests|tools-parsing-test)"
11909 #:phases
11910 #~(modify-phases %standard-phases
11911 ;; This patch also fixes broken compilation due to improper detection
11912 ;; of bfd features. This is taken from following upstream PR:
11913 ;; https://github.com/bpftrace/bpftrace/pull/3332
11914 (add-after 'unpack 'patch-paths-and-bfd-defs
11915 (lambda _
11916 (substitute* '("cmake/FindLibBfd.cmake"
11917 "src/CMakeLists.txt")
11918 (("LIBSFRAME_FOUND")
11919 "LIBSFRAME_LIBRARIES")
11920 (("LIBZSTD_FOUND")
11921 "LIBZSTD_LIBRARIES"))
11922 (with-directory-excursion "tests"
11923 (substitute* (find-files ".")
11924 (("/bin/sh")
11925 (which "sh")))
11926 (substitute* '("child.cpp"
11927 "runtime/call"
11928 "procmon.cpp")
11929 (("/bin/ls")
11930 (which "ls"))))))
11931 (add-after 'unpack 'fix-paths
11932 (lambda* (#:key inputs outputs #:allow-other-keys)
11933 (substitute* '("tests/child.cpp")
11934 (("/bin/sleep")
11935 (search-input-file inputs "bin/sleep")))))
11936 (add-before 'check 'set-test-filter
11937 (lambda _
11938 (setenv "GTEST_FILTER"
11939 (string-join
11940 (list ; "-" disables all following tests
11941 "-ast.probe_name_uprobe"
11942 "bpftrace.add_probes_uprobe_wildcard_file"
11943 "bpftrace.add_probes_uprobe_wildcard_file_uprobe_multi"
11944 "bpftrace.add_probes_usdt_wildcard"
11945 "Parser.multiple_attach_points_kprobe"
11946 "Parser.uretprobe_offset"
11947 "semantic_analyser.builtin_functions"
11948 "semantic_analyser.call_func"
11949 "semantic_analyser.call_uaddr")
11950 ":")))))))
11951 (native-inputs (list bison coreutils dwarves flex googletest xxd))
11952 (inputs (list bcc clang-15 elfutils libbpf libiberty cereal))
11953 (home-page "https://github.com/bpftrace/bpftrace")
11954 (synopsis "High-level tracing language for Linux eBPF")
11955 (description
11956 "bpftrace is a high-level tracing language for Linux enhanced Berkeley
11957Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses
11958LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for
11959interacting with the Linux BPF system, as well as existing Linux tracing
11960capabilities: kernel dynamic tracing (kprobes), user-level dynamic
11961tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk
11962and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was
11963created by Alastair Robertson.")
11964 (license license:asl2.0)))
11965
11966(define-public ttyebus-linux-module
11967 (let ((revision "0")
11968 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))
11969 (package
11970 (name "ttyebus-linux-module")
11971 (version (git-version "1.5" revision commit))
11972 (source
11973 (origin
11974 (method git-fetch)
11975 (uri (git-reference
11976 (url "https://github.com/eBUS/ttyebus")
11977 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")))
11978 (file-name (git-file-name name version))
11979 (sha256
11980 (base32
11981 "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani"))))
11982 (supported-systems '("armhf-linux" "aarch64-linux"))
11983 (build-system linux-module-build-system)
11984 (arguments
11985 `(#:tests? #f))
11986 (home-page "https://github.com/eBUS/ttyebus")
11987 (synopsis "Low-latency Raspberry Pi UART driver")
11988 (description "This package provides a Linux kernel module that will
11989provide a serial device @code{/dev/ttyebus} with almost no latency upon
11990receiving. It is dedicated to the PL011 UART of the Raspberry Pi.")
11991 (license license:gpl3+))))
11992
11993(define-public ipset
11994 (package
11995 (name "ipset")
11996 (version "7.17")
11997 (source
11998 (origin
11999 (method url-fetch)
12000 (uri (string-append "https://ipset.netfilter.org/"
12001 "ipset-" version ".tar.bz2"))
12002 (sha256
12003 (base32 "1n34mkrdha9rggd0fizjx6baqkiqqd1yfhb5ml663mlx93zwjjdy"))))
12004 (build-system gnu-build-system)
12005 (inputs
12006 (list libmnl))
12007 (native-inputs
12008 (list pkg-config))
12009 (arguments
12010 `(#:configure-flags '("--disable-static"
12011 "--with-kmod=no")))
12012 (home-page "https://ipset.netfilter.org/")
12013 (synopsis "Administration tool for IP sets")
12014 (description "IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel which
12015can be administered by the ipset utility. Depending on the type,
12016currently an IP set may store IP addresses, (TCP/UDP) port numbers or
12017IP addresses with MAC addresses in a way which ensures lightning speed
12018when matching an entry against a set.
12019
12020If you want to
12021@itemize @bullet
12022@item store multiple IP addresses or port numbers and match against the entire
12023collection using a single iptables rule.
12024@item dynamically update iptables rules against IP addresses or ports without
12025performance penalty.
12026@item express complex IP address and ports based rulesets with a single
12027iptables rule and benefit from the speed of IP sets.
12028@end itemize\n
12029then IP sets may be the proper tool for you.")
12030 (license license:gpl2+)))
12031
12032(define-public liburing
12033 (package
12034 (name "liburing")
12035 (version "2.15")
12036 (source (origin
12037 (method git-fetch)
12038 (uri (git-reference
12039 (url "https://github.com/axboe/liburing")
12040 (commit (string-append "liburing-" version))))
12041 (file-name (git-file-name name version))
12042 (sha256
12043 (base32
12044 "1vq47c15fv60992qla7y9s3b52v958zkbfpr0hscji1n6bj6w4x0"))))
12045 (build-system gnu-build-system)
12046 (arguments
12047 `(;; Tests are dependent on kernel version and features
12048 #:tests? #f
12049 #:phases
12050 (modify-phases %standard-phases
12051 (replace 'configure
12052 ;; configure fails if it is followed by SHELL, CONFIG_SHELL,
12053 ;; --enable-fast-install, and --build
12054 (lambda* (#:key outputs #:allow-other-keys)
12055 (let ((out (assoc-ref outputs "out")))
12056 (setenv "SHELL" (which "sh"))
12057 (setenv "CONFIG_SHELL" (which "sh"))
12058 (invoke "./configure" (string-append "--prefix=" out))))))))
12059 (home-page "https://github.com/axboe/liburing")
12060 (synopsis "Interface to the Linux kernel @code{io_uring} interface")
12061 (description "This is the io_uring library, liburing. liburing provides
12062helpers to setup and teardown io_uring instances, and also a simplified
12063interface for applications that don't need (or want) to deal with the full
12064kernel side implementation.")
12065 (license license:expat)))
12066
12067(define-public erofs-utils
12068 (package
12069 (name "erofs-utils")
12070 (version "1.8.10")
12071 (source
12072 (origin
12073 (method git-fetch)
12074 (uri (git-reference
12075 (url "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git")
12076 (commit (string-append "v" version))))
12077 (file-name (git-file-name name version))
12078 (sha256
12079 (base32 "1qlig9q1fdjl0zn7206dbv7w5ssjg4az4hg7y3vk69ly0zbmwkil"))))
12080 (build-system gnu-build-system)
12081 (inputs
12082 (list lz4
12083 `(,util-linux "lib")
12084 zlib))
12085 (native-inputs
12086 (list autoconf automake libtool pkg-config))
12087 (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/")
12088 (synopsis "User-space tools for the EROFS file system")
12089 (description
12090 "@acronym{EROFS, The Enhanced Read-Only File System} is a compressed,
12091read-only file system optimized for resource-scarce devices. This package
12092provides user-space tools for creating EROFS file systems.")
12093 (license license:gpl2+)))
12094
12095(define-public erofs-utils/static
12096 (static-package
12097 (package
12098 (inherit erofs-utils)
12099 (name "erofs-utils-static")
12100 (arguments
12101 (substitute-keyword-arguments (package-arguments erofs-utils)
12102 ((#:configure-flags flags #~'())
12103 #~(append #$flags (list "--without-uuid" "--without-zlib"))))))))
12104
12105(define-public rasdaemon
12106 (package
12107 (name "rasdaemon")
12108 (version "0.8.4")
12109 (source
12110 (origin
12111 (method git-fetch)
12112 (uri (git-reference
12113 (url "https://github.com/mchehab/rasdaemon")
12114 (commit (string-append "v" version))))
12115 (file-name (git-file-name name version))
12116 (sha256
12117 (base32 "1930g35igfdw5bzcd6diy59rm1q4yirpjgqznfqfsichnmk04kmf"))))
12118 (native-inputs (list autoconf automake libtool pkg-config))
12119 (inputs
12120 (list bash-minimal
12121 dmidecode
12122 kmod
12123 libtraceevent
12124 pciutils
12125 perl
12126 perl-dbd-sqlite
12127 sqlite))
12128 (arguments
12129 (list
12130 #:configure-flags
12131 #~(list "--enable-all"
12132 ;; Don't install unused /etc/sysconfig/rasdaemon environment file.
12133 "--with-sysconfdefdir=."
12134 "--localstatedir=/var")
12135 #:phases
12136 #~(modify-phases %standard-phases
12137 (add-after 'unpack 'rename-README
12138 (lambda _
12139 ;; Required by autoreconf
12140 (rename-file "README.md" "README")))
12141 (add-before 'configure 'munge-autotools
12142 (lambda _
12143 ;; For some reason upstream forces sysconfdir=/etc. This results
12144 ;; in EPERM during the install phase. Removing the offending
12145 ;; line lets sysconfdir correctly pick up DESTDIR.
12146 (substitute* "configure.ac"
12147 (("^test .* sysconfdir=/etc\n$") ""))))
12148 (add-after 'install 'wrap-rasdaemon
12149 (lambda* (#:key inputs #:allow-other-keys)
12150 (let ((path (map dirname
12151 (list (search-input-file inputs "/sbin/dmidecode")
12152 (search-input-file inputs "/bin/modprobe")))))
12153 (wrap-program (string-append #$output "/sbin/ras-mc-ctl")
12154 `("PATH" ":" prefix ,path)
12155 `("PERL5LIB" ":" prefix ,(string-split (getenv "PERL5LIB") #\:)))))))))
12156 (build-system gnu-build-system)
12157 (home-page "https://github.com/mchehab/rasdaemon")
12158 (synopsis "Platform Reliability, Availability, and Serviceability tools")
12159 (description
12160 "The @code{rasdaemon} daemon monitors platform @acronym{RAS, Reliability
12161Availability and Serviceability} reports from Linux kernel trace events.
12162These trace events are logged in @file{/sys/kernel/debug/tracing} and reported
12163through standard log mechanisms like syslog.")
12164 (license license:gpl2)))
12165
12166(define-public renameat2
12167 ;; This is a Gist, with no release or tags.
12168 (let ((revision "0")
12169 (commit "5c5193f20142511a5fc7069a539f4e5aba0ea470"))
12170 (package
12171 (name "renameat2")
12172 (version (git-version "0.0.0" revision commit))
12173 (source (origin
12174 (method url-fetch)
12175 (uri (string-append "https://gist.githubusercontent.com/"
12176 "eatnumber1/f97ac7dad7b1f5a9721f/raw/"
12177 commit "/renameat2.c"))
12178 (sha256
12179 (base32
12180 "07b4hsxqjm610sdkm4nxhp0gnl2s7gzlh4zdnja5ay40v4x24bb9"))))
12181 (build-system gnu-build-system)
12182 (arguments
12183 (list
12184 #:tests? #f ;no test suite
12185 #:phases #~(modify-phases %standard-phases
12186 (delete 'configure)
12187 (replace 'build
12188 (lambda _
12189 (invoke #$(cc-for-target) "renameat2.c"
12190 "-o" "renameat2")))
12191 (replace 'install
12192 (lambda _
12193 (install-file "renameat2"
12194 (string-append #$output "/bin")))))))
12195 (home-page "https://gist.github.com/eatnumber1/f97ac7dad7b1f5a9721f")
12196 (synopsis "Command to call the renameat2 Linux system call")
12197 (description "This package provides a @command{renameat2} command that
12198calls the Linux-specific @code{renameat2} system call.")
12199 (license license:expat))))
12200
12201(define-public libgpiod
12202 (package
12203 (name "libgpiod")
12204 (version "2.2.2")
12205 (source
12206 (origin
12207 (method git-fetch)
12208 (uri
12209 (git-reference
12210 (url "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
12211 (commit (string-append "v" version))))
12212 (file-name (git-file-name name version))
12213 (sha256 (base32 "10yiwrw80x0057w825zxmdbd54w9lbyf49bgqk1cryqapglfzqri"))))
12214 (build-system gnu-build-system)
12215 (arguments
12216 (list #:configure-flags
12217 #~(list "--enable-tools=yes"
12218 "--enable-bindings-cxx")))
12219 (native-inputs
12220 (list automake
12221 autoconf-2.71
12222 libtool
12223 autoconf-archive
12224 pkg-config))
12225 (synopsis "Interact with the Linux GPIO character device")
12226 (description
12227 "This package provides a C library with C++ bindings and
12228command-line tools for interacting with GPIO devices that avoids the usage of
12229older system-wide @file{/sys} interface.")
12230 (home-page "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/")
12231 (license (list license:lgpl2.1+ ;; libgpiod
12232 license:gpl2+ ;; gpio-tools
12233 license:lgpl3+)))) ;; C++ bindings
12234
12235(define-public python-libgpiod
12236 (package
12237 (name "python-libgpiod")
12238 (version "2.3.0")
12239 (source
12240 (origin
12241 (method git-fetch)
12242 (uri
12243 (git-reference
12244 (url "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
12245 (commit (string-append "python-v" version))))
12246 (file-name (git-file-name name version))
12247 (sha256 (base32 "1lkd7lgpb28pqf7p6lrwl0ss7r5ryiddmdcisnz6ixy796qhr8kr"))))
12248 (build-system pyproject-build-system)
12249 (arguments
12250 (list
12251 #:tests? #f ; tests require root, see README.md
12252 #:phases
12253 #~(modify-phases %standard-phases
12254 (add-after 'unpack 'cd-to-python-bindings
12255 (lambda _
12256 (chdir "bindings/python"))))))
12257 (native-inputs
12258 (list python-setuptools
12259 python-wheel
12260 libgpiod))
12261 (synopsis "Interact with the Linux GPIO character device")
12262 (description
12263 "This package provides Python bindings for interacting with GPIO devices
12264that avoids the usage of older system-wide @file{/sys} interface.")
12265 (home-page "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/")
12266 (license (list license:lgpl2.1+ ;; libgpiod
12267 license:gpl2+ ;; gpio-tools
12268 license:lgpl3+)))) ;; C++ bindings
12269
12270(define-public libtraceevent
12271 (package
12272 (name "libtraceevent")
12273 (version "1.9.0")
12274 (source
12275 (origin
12276 (method git-fetch)
12277 (uri (git-reference
12278 (url "https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git")
12279 (commit (string-append name "-" version))))
12280 (file-name (git-file-name name version))
12281 (sha256
12282 (base32 "10fklw4znjhm8mlg6hwlipdyk7v3053lnrc5bpqifnsc8gwqbaz0"))))
12283 (build-system meson-build-system)
12284 (arguments
12285 (list
12286 #:configure-flags
12287 #~(list "-Ddoc=false")))
12288 (home-page "https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/")
12289 (synopsis "Linux kernel trace event library")
12290 (description
12291 "This library parses raw Linux kernel trace event formats.")
12292 (license (list license:gpl2
12293 license:lgpl2.1))))
12294
12295(define-public libtracefs
12296 (package
12297 (name "libtracefs")
12298 (version "1.8.3")
12299 (source
12300 (origin
12301 (method git-fetch)
12302 (uri (git-reference
12303 (url "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git")
12304 (commit (string-append name "-" version))))
12305 (file-name (git-file-name name version))
12306 (sha256
12307 (base32 "1bc4mwf488nlja64zawjznvb6640vchjb25xa02v53x6qfb1mpmq"))))
12308 (build-system meson-build-system)
12309 (arguments
12310 (list
12311 #:configure-flags
12312 #~(list "-Ddoc=false")))
12313 (native-inputs
12314 (list bison
12315 flex
12316 pkg-config))
12317 (inputs (list libtraceevent))
12318 (home-page "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/")
12319 (synopsis "Linux kernel trace file system library")
12320 (description
12321 "This library provides APIs to access the Linux kernel's trace file
12322system.")
12323 (license (list license:gpl2
12324 license:lgpl2.1))))
12325
12326(define-public libtree
12327 (package
12328 (name "libtree")
12329 (version "3.1.1")
12330 (source
12331 (origin
12332 (method git-fetch)
12333 (uri (git-reference
12334 (url "https://github.com/haampie/libtree")
12335 (commit (string-append "v" version))))
12336 (file-name (git-file-name name version))
12337 (patches (search-patches "libtree-fix-check-non-x86.patch"))
12338 (sha256
12339 (base32 "1jbc60cslzcfxk9jwva51ncr1zl1nz0fkgfjdckgv81is11nswmb"))))
12340 (arguments
12341 (list #:make-flags
12342 ;; NOTE: Official documentation recommends to build libtree with
12343 ;; "-static" flag.
12344 #~(list (string-append "CC=" #$(cc-for-target))
12345 (string-append "PREFIX=" #$output))
12346 #:phases
12347 #~(modify-phases %standard-phases
12348 (add-after 'unpack 'fix-tests
12349 ;; XXX: '08_nodeflib' fails as 'libtree' returns a non-zero
12350 ;; code in one of the tests.
12351 ;;
12352 ;; See <https://github.com/haampie/libtree/issues/80>).
12353 (lambda _
12354 (substitute* "tests/08_nodeflib/Makefile"
12355 (("! ../../libtree -vvv exe_b")
12356 "../../libtree -vvv exe_b"))))
12357 (delete 'configure))))
12358 (build-system gnu-build-system)
12359 (home-page "https://github.com/haampie/libtree")
12360 (synopsis "Show output of @command{ldd} as a tree")
12361 (description
12362 "This tool turns @command{ldd} into a tree and explains how shared
12363libraries are found or why they cannot be located.")
12364 (license license:expat)))
12365
12366(define-public touchegg
12367 (package
12368 (name "touchegg")
12369 (version "2.0.18")
12370 (source
12371 (origin
12372 (method git-fetch)
12373 (uri (git-reference
12374 (url "https://github.com/JoseExposito/touchegg")
12375 (commit version)))
12376 (file-name (git-file-name name version))
12377 (sha256
12378 (base32 "0m8zgihij14b8dxrxxvpl8sdsx49mjlnxnm0fhgfxscy7n07kcpc"))))
12379 (build-system cmake-build-system)
12380 (arguments
12381 `(#:tests? #f ; No tests exist
12382 #:configure-flags
12383 (list "-DUSE_SYSTEMD=OFF"))) ; No systemd
12384 (native-inputs
12385 (list
12386 pkg-config))
12387 (inputs
12388 (list
12389 cairo
12390 gtk+
12391 libgudev
12392 libinput
12393 libxrandr
12394 libxtst
12395 pugixml))
12396 (home-page "https://github.com/JoseExposito/touchegg")
12397 (synopsis "Multitouch gesture recognizer")
12398 (description
12399 "Touchégg is an application that runs in the background and transform the
12400gestures you make on your touchpad or touchscreen into visible actions in your
12401desktop.")
12402 (license license:gpl3+)))
12403
12404(define-public evtest
12405 (package
12406 (name "evtest")
12407 (version "1.36")
12408 (source (origin
12409 (method git-fetch)
12410 (uri (git-reference
12411 (url "https://gitlab.freedesktop.org/libevdev/evtest")
12412 (commit (string-append "evtest-" version))))
12413 (file-name (git-file-name name version))
12414 (sha256
12415 (base32
12416 "0mwjvz0fwwcwm4fpw0m4x8bcxpnzjkiy7fpb438vf4i5g5q0dc1k"))))
12417 (build-system gnu-build-system)
12418 (arguments
12419 (list #:tests? #f ;No tests exist
12420 #:make-flags #~(list (string-append "CC="
12421 #$(cc-for-target))
12422 (string-append "PREFIX="
12423 #$output))
12424 #:phases #~(modify-phases %standard-phases
12425 (add-after 'unpack 'generate-doc
12426 (lambda _
12427 (invoke "asciidoc" "-d" "manpage"
12428 "-b" "docbook"
12429 "-o" "evtest.1.xml"
12430 "evtest.txt")
12431 (invoke "xsltproc" "--nonet"
12432 (string-append
12433 #$(this-package-native-input "docbook-xsl")
12434 "/xml/xsl/docbook-xsl-"
12435 #$(package-version
12436 (this-package-native-input "docbook-xsl"))
12437 "/manpages/docbook.xsl")
12438 "evtest.1.xml")))
12439 (replace 'bootstrap
12440 (lambda _
12441 (setenv "CONFIG_SHELL" (which "sh"))
12442 (invoke "autoreconf" "-fi"))))))
12443 (native-inputs (list autoconf
12444 automake
12445 bash-minimal
12446 xmlto
12447 docbook-xsl
12448 libxslt
12449 asciidoc))
12450 (home-page "https://gitlab.freedesktop.org/libevdev/evtest")
12451 (synopsis "Kernel evdev device information and monitor")
12452 (description
12453 "@code{evtest} is a tool to print @code{evdev} kernel events. It reads
12454directly from the kernel device and prints a device description and the events
12455with the value and the symbolic name.")
12456 (license license:gpl2+)))
12457
12458(define-public tp-smapi-module
12459 (package
12460 (name "tp-smapi-module")
12461 (version "0.45")
12462 (source (origin
12463 (method git-fetch)
12464 (uri (git-reference
12465 (url "https://github.com/linux-thinkpad/tp_smapi")
12466 (commit (string-append "tp-smapi/" version))))
12467 (file-name (git-file-name name version))
12468 (sha256
12469 (base32
12470 "1q67dk0sa9k0b3ns0s42fbm7ali5018q3hqn81ldspcl0lv867xc"))
12471 (patches (search-patches "tp-smapi-module-linux-7.2-fix.patch"))))
12472 (build-system linux-module-build-system)
12473 (arguments
12474 `(#:tests? #f)) ;there are none.
12475 (home-page "https://github.com/linux-thinkpad/tp_smapi")
12476 (synopsis
12477 "Linux Kernel module exposing features of ThinkPad hardware")
12478 (description
12479 "This package provides a Linux Kernel module that controls
12480battery charging of specific ThinkPad laptops. It also includes an improved
12481version of the HDAPS driver. The underlying hardware interfaces are
12482@acronym{SMAPI, System Management Application Program Interface} and direct
12483access to the embedded controller.")
12484 (license license:gpl2+)))
12485
12486(define-public modprobed-db
12487 (package
12488 (name "modprobed-db")
12489 (version "2.48")
12490 (source (origin
12491 (method git-fetch)
12492 (uri (git-reference
12493 (url "https://github.com/graysky2/modprobed-db")
12494 (commit (string-append "v" version))))
12495 (file-name (git-file-name name version))
12496 (sha256
12497 (base32
12498 "0jscinga32jjvy3vwl4s1pyd5fjgqhmmk010k665nhil302hzjdc"))))
12499 (build-system gnu-build-system)
12500 (arguments
12501 (list #:tests? #f ;no tests
12502 #:make-flags
12503 #~(list (string-append "PREFIX=" #$output)
12504 "INITDIR_SYSTEMD=no-thanks")
12505 #:phases
12506 #~(modify-phases %standard-phases
12507 (delete 'configure)
12508 (add-after 'install 'fix-path
12509 (lambda* (#:key inputs #:allow-other-keys)
12510 (substitute* (string-append #$output "/bin/modprobed-db")
12511 (("/usr") #$output)
12512 (((string-append "(" (string-join (list "awk"
12513 "cp"
12514 "cut"
12515 "getent"
12516 "grep"
12517 "logname"
12518 "md5sum"
12519 "mkdir"
12520 "mv"
12521 "sed"
12522 "sort"
12523 "uniq"
12524 "wc")
12525 "|") ")") m)
12526 (search-input-file inputs (string-append "/bin/" m)))
12527 (("modprobe ")
12528 (string-append
12529 (search-input-file inputs "/bin/modprobe") " "))))))))
12530 (inputs (list coreutils kmod gawk glibc grep sed))
12531 (home-page "https://wiki.archlinux.org/title/Modprobed-db")
12532 (synopsis "Keep track of Linux modules that have been probed")
12533 (description
12534 "Modprobed-db is a useful utility for users wishing to build a minimal
12535kernel via a @code{make localmodconfig}. In a nutshell, this @command{make}
12536target creates a config based on the current config and a list of modules you
12537define (that @command{modprobed-db} keeps for you). It then disables any
12538module option that is not needed thus not building extraneous modules. This
12539results in a system-specific, streamlined kernel package and footprint as well
12540as reduced compilation times.
12541
12542Modprobed-db simply logs every module ever probed on the target system to a
12543text-based database (@file{$XDG_CONFIG_HOME/modprobed-db}), which can be read
12544directly by @code{make localmodconfig} as described above.")
12545 (license license:expat)))
12546
12547(define-public kernel-hardening-checker
12548 (package
12549 (name "kernel-hardening-checker")
12550 (version "0.6.17.1")
12551 (source (origin
12552 (method git-fetch)
12553 (uri (git-reference
12554 (url "https://github.com/a13xp0p0v/kernel-hardening-checker")
12555 (commit (string-append "v" version))))
12556 (file-name (git-file-name name version))
12557 (sha256
12558 (base32
12559 "04r9bbayhs1ik84908q148k9djawy69zarxw0vc31dfbf64mni62"))))
12560 (build-system pyproject-build-system)
12561 (arguments
12562 (list #:tests? #f)) ;no active tests, runtime only, see GitHub Actions
12563 (native-inputs
12564 (list python-setuptools))
12565 (home-page "https://github.com/a13xp0p0v/kernel-hardening-checker")
12566 (synopsis
12567 "Tool for checking the security hardening options of the Linux kernel")
12568 (description
12569 "@code{kernel-hardening-checker} is a tool for checking the security
12570hardening options of the Linux kernel. Provided preferences are based on
12571suggestions from various sources, including:
12572
12573@itemize
12574@item KSPP recommended settings
12575@item CLIP OS kernel configuration
12576@item Last public grsecurity patch (options which they disable)
12577@item SECURITY_LOCKDOWN_LSM patchset
12578@item Direct feedback from the Linux kernel maintainers
12579@end itemize\n
12580This tool supports checking Kconfig options and kernel cmdline parameters.")
12581 (license license:gpl3)))
12582
12583(define-public firejail
12584 (package
12585 (name "firejail")
12586 (version "0.9.78")
12587 (source (origin
12588 (method git-fetch)
12589 (uri (git-reference
12590 (url "https://github.com/netblue30/firejail")
12591 (commit version)))
12592 (file-name (git-file-name name version))
12593 (sha256
12594 (base32
12595 "18bsnwyg7aidm74qckrp437gr0zy9bpq1b1wr6mfnj61v74fwwxs"))))
12596 (arguments
12597 (list #:phases
12598 #~(modify-phases %standard-phases
12599 (replace 'check
12600 (lambda* (#:key tests? #:allow-other-keys)
12601 (when tests?
12602 (with-directory-excursion "test"
12603 (invoke "make"))))))))
12604 (build-system gnu-build-system)
12605 (inputs
12606 (list apparmor xdg-dbus-proxy))
12607 (synopsis "Linux namespaces sandbox program")
12608 (description
12609 "Firejail is a SUID sandbox program that reduces the risk of security
12610breaches by restricting the running environment of untrusted applications
12611using Linux namespaces, seccomp-bpf and Linux capabilities. The software
12612includes sandbox profiles for a number of common Linux programs. Firejail
12613should be added to the list of setuid programs in the system configuration to
12614work properly.")
12615 (home-page "https://github.com/netblue30/firejail")
12616 (supported-systems
12617 (filter (cut string-suffix? "-linux" <>) %supported-systems))
12618 (license license:gpl2+)))
12619
12620(define-public firejail-disable-sandbox-check
12621 (package/inherit
12622 firejail
12623 (name "firejail-disable-sandbox-check")
12624 (arguments
12625 (substitute-keyword-arguments arguments
12626 ((#:configure-flags flags #~'())
12627 #~(append #$flags
12628 (list "--disable-sandbox-check")))))
12629 (description
12630 (string-append (package-description firejail)
12631 " Builded with @code{--disable-sandbox-check}, which is
12632 only intended for development."))))
12633
12634(define-public edac-utils
12635 (package
12636 (name "edac-utils")
12637 (version "0.18")
12638 (source (origin
12639 (method git-fetch)
12640 (uri (git-reference
12641 (url "https://github.com/grondo/edac-utils.git")
12642 (commit version)))
12643 (file-name (string-append name "-" version "-checkout"))
12644 (sha256
12645 (base32
12646 "04j686m58wsnyy5di7rz0sw9jahlm4ziwxjmgs31pjb87vzw3xgp"))))
12647 (build-system gnu-build-system)
12648 (native-inputs
12649 (list perl))
12650 (inputs
12651 (list sysfsutils))
12652 (synopsis "Memory error detection and correction userspace helpers")
12653 (description "This package provides userspace helpers for memory
12654error detection and correction (EDAC).")
12655 (home-page "https://github.com/grondo/edac-utils")
12656 (license license:gpl2+)))
12657
12658(define-public spectre-meltdown-checker
12659 (package
12660 (name "spectre-meltdown-checker")
12661 (version "0.46")
12662 (source (origin
12663 (method git-fetch)
12664 (uri (git-reference
12665 (url "https://github.com/speed47/spectre-meltdown-checker")
12666 (commit (string-append "v" version))))
12667 (file-name (git-file-name name version))
12668 (patches
12669 (search-patches
12670 "spectre-meltdown-checker-externalize-fwdb.patch"))
12671 ;; Remove builtin firmware database.
12672 (modules '((guix build utils)))
12673 (snippet '(substitute* "spectre-meltdown-checker.sh"
12674 (("^# [AI],.*") "")))
12675 (sha256
12676 (base32
12677 "0j42p6dayb7k87kf8sqimxlaswis3qh0569a15zccyknv9vf129k"))))
12678 (build-system copy-build-system)
12679 (arguments
12680 (list
12681 #:install-plan
12682 #~'(("spectre-meltdown-checker.sh" "bin/spectre-meltdown-checker"))
12683 #:phases
12684 #~(modify-phases %standard-phases
12685 (add-after 'unpack 'fixpath
12686 (lambda* (#:key inputs #:allow-other-keys)
12687 (define* (find-command inputs cmd #:optional (bin "bin"))
12688 (search-input-file inputs (string-append bin "/" cmd)))
12689 (substitute* "spectre-meltdown-checker.sh"
12690 ;; ${opt_arch_prefix}CMD
12691 (("\\$\\{opt_arch_prefix\\}\\<(nm|objdump|readelf|strings)\\>"
12692 all cmd)
12693 (find-command inputs cmd))
12694
12695 ;; Commands safe to substitute directly.
12696 (("\\<(awk|(base|dir)name|bunzip2|g(un)?zip|lz4)\\>" all cmd)
12697 (find-command inputs cmd))
12698 (("\\<(lzop|mktemp|modprobe|pgrep|rmmod|umount)\\>" all cmd)
12699 (find-command inputs cmd))
12700 (("\\<(unlzma|unxz|unzstd|uuencode)\\>" all cmd)
12701 (find-command inputs cmd))
12702
12703 ;; Commands which should only be substituted based on their
12704 ;; surroundings: First up, dd.
12705 (("\\<(dd)\\> if=" all cmd)
12706 (string-append
12707 (find-command inputs cmd)
12708 " if="))
12709
12710 ;; Another special case: sysctl is in sbin.
12711 (("(if |\\$\\( *)\\<(sysctl)\\>" all pre cmd)
12712 (string-append pre (find-command inputs cmd "sbin")))
12713
12714 ;; Meow
12715 (("cat (<<EOF|\"\\$)" all what)
12716 (string-append (find-command inputs "cat") " " what))
12717 (("'cat'")
12718 (string-append "'" (find-command inputs "cat") "'"))
12719 (("\"cat\"")
12720 (string-append "\"" (find-command inputs "cat") "\""))
12721
12722 ;; ${COMMAND} -
12723 ;; ${COMMAND} ^
12724 (("\\<(base64|cut|grep|head|id|mount)\\> ([-^])" all cmd suffix)
12725 (string-append (find-command inputs cmd) " " suffix))
12726 (("\\<(od|perl|rm|uname|xargs)\\> ([-^])" all cmd suffix)
12727 (string-append (find-command inputs cmd) " " suffix))
12728
12729 ;; ${COMMAND} |
12730 (("\\<(dmesg)\\> \\|" all cmd)
12731 (string-append (find-command inputs cmd) " |"))
12732 ;; | ${COMMAND}
12733 (("\\| \\<(grep|sed|sort|stat|tr)\\>" all cmd)
12734 (string-append "| " (find-command inputs cmd)))
12735
12736 ;; Command in sub-shell, i.e. $($COMMAND ...)
12737 (("\\$\\( *(\\<cat|find|grep|mount|nproc|stat|tr\\>)"
12738 all cmd)
12739 (string-append "$(" (find-command inputs cmd)))
12740
12741 ;; command -v
12742 (("command -v \"*\\<(base64|nproc|perl|printf)\\>\"*" all cmd)
12743 (string-append "command -v " (find-command inputs cmd)))))))))
12744 (inputs (list kmod lz4 lzop perl procps sharutils util-linux zstd))
12745 (home-page "https://github.com/speed47/spectre-meltdown-checker")
12746 (synopsis "CPU vulnerability / mitigation checker")
12747 (description
12748 "This package provides a shell script to assess your system's resilience
12749against the several transient execution CVEs that were published since early
127502018, and gives guidance as to how to mitigate them.")
12751 (license license:gpl3)))
12752
12753(define-public csmith
12754 (package
12755 (name "csmith")
12756 (version "2.3.0")
12757 (source (origin
12758 (method git-fetch)
12759 (uri (git-reference
12760 (url "https://github.com/csmith-project/csmith")
12761 (commit (string-append "csmith-" version))))
12762 (file-name (git-file-name name version))
12763 (sha256
12764 (base32
12765 "0nhrsnv6cny14xz68qb1h30fbwc05adkisk51p3x63mydm60ddl3"))))
12766 (build-system gnu-build-system)
12767 (native-inputs
12768 (list autoconf automake libtool m4 perl))
12769 (arguments
12770 (list
12771 #:tests? #f ;no test suite
12772 ;; Do not install headers under 'include/csmith-VERSION' but in
12773 ;; 'include/csmith'.
12774 #:phases
12775 `(modify-phases %standard-phases
12776 (add-after 'unpack 'patch-includedir
12777 (lambda _
12778 (substitute* "runtime/Makefile.am"
12779 (("\\$\\(includedir\\)/\\$\\(PACKAGE\\)-\\$\\(VERSION\\)")
12780 "$(includedir)/$(PACKAGE)"))))
12781 (add-before 'bootstrap 'force-bootstrap
12782 (lambda _
12783 (delete-file "configure"))))))
12784 (home-page "https://github.com/csmith-project/csmith")
12785 (synopsis "Random generator of C programs")
12786 (description "The primary purpose of Csmith is to find compiler bugs with
12787random programs using differential testing.")
12788 (license license:bsd-4)))
12789
12790(define-public ipvsadm
12791 (package
12792 (name "ipvsadm")
12793 (version "1.31")
12794 (source
12795 (origin
12796 (method url-fetch)
12797 (uri (string-append "https://kernel.org/pub/linux/utils/kernel"
12798 "/ipvsadm/ipvsadm-" version ".tar.xz"))
12799 (sha256
12800 (base32 "1nyzpv1hx75k9lh0vfxfhc0p2fpqaqb38xpvs8sn88m1nljmw2hs"))))
12801 (build-system gnu-build-system)
12802 (native-inputs (list linux-libre-headers pkg-config which))
12803 (inputs (list libnl popt))
12804 (arguments
12805 (list #:tests? #f
12806 #:parallel-build? #f ;build fails randomly with '-j'
12807 #:make-flags
12808 #~(list (string-join
12809 (list "CFLAGS="
12810 (string-append "-I"
12811 #$(this-package-input "libnl")
12812 "/include/libnl3")
12813 (string-append "-L" #$(this-package-input "libnl")
12814 "/lib")
12815 "-fPIC")
12816 " ")
12817 (string-append "CC=" #$(cc-for-target))
12818 (string-append "SBIN=" #$output "/sbin")
12819 (string-append "INIT=" #$output "/etc/init.d")
12820 (string-append "MANDIR=" #$output "/share/man"))
12821 #:phases #~(modify-phases %standard-phases
12822 (delete 'configure))))
12823 (home-page "http://www.linuxvirtualserver.org/software/ipvs.html")
12824 (synopsis "IP virtual server administration utility")
12825 (description "@code{ipvsadm(8)} is used to set up, maintain or inspect the
12826virtual server table in the Linux kernel. The Linux Virtual Server can be used
12827to build scalable network services based on a cluster of two or more nodes.")
12828 (license license:gpl2+)))
12829
12830(define-public ryzenadj
12831 (package
12832 (name "ryzenadj")
12833 (version "0.17.0")
12834 (source
12835 (origin
12836 (method git-fetch)
12837 (uri (git-reference
12838 (url "https://github.com/flygoat/ryzenadj")
12839 (commit (string-append "v" version))))
12840 (file-name (git-file-name name version))
12841 (sha256
12842 (base32 "0dpznl4h1f5syq5464a0h9grqlvlp0qmjxr59nq3gp363gr5vjfv"))
12843 (modules '((guix build utils)))
12844 (snippet
12845 '(begin
12846 (delete-file-recursively "win32")))))
12847 (build-system cmake-build-system)
12848 (inputs (list pciutils))
12849 (arguments
12850 (list
12851 #:tests? #f ;No test suite
12852 #:build-type "Release"))
12853 (home-page "https://github.com/flygoat/ryzenadj")
12854 (synopsis "Power management tool for AMD Ryzen APUs")
12855 (description
12856 "@command{ryzenadj} is an utility to adjust power management settings for
12857AMD Ryzen mobile processors. You will need to ensure it can access /dev/mem,
12858for instance by using the \"iomem=relaxed\" kernel argument.")
12859 (license license:lgpl3)))
12860
12861(define-public ryzen-smu
12862 (package
12863 (name "ryzen-smu")
12864 (version "0.1.5")
12865 (source (origin
12866 (method git-fetch)
12867 (uri (git-reference
12868 (url "https://gitlab.com/leogx9r/ryzen_smu.git")
12869 (commit (string-append "v" version))))
12870 (file-name (git-file-name name version))
12871 (sha256
12872 (base32
12873 "010la2a8zp7rljlg5ssc9ragzva4ca05gvzlicjagl508659d2wz"))
12874 (patches (search-patches "ryzen-smu-fix-linux-7.2.patch"))))
12875 (build-system linux-module-build-system)
12876 (arguments
12877 `(#:tests? #f)) ; no tests
12878 (synopsis "System Management Unit driver for AMD Ryzen processors")
12879 (description "This package provides a way to access the
12880System Management Unit for certain AMD Ryzen processors.
12881This includes access to the System Management Network.")
12882 (home-page "https://gitlab.com/leogx9r/ryzen_smu")
12883 (license license:gpl2)))
12884
12885(define-public hid-wiimote-plus
12886 (package
12887 (name "hid-wiimote-plus")
12888 (version "1.0.0")
12889 (source
12890 (origin
12891 (method git-fetch)
12892 (uri (git-reference
12893 (url "https://github.com/dkosmari/hid-wiimote-plus")
12894 (commit (string-append "v" version))))
12895 (file-name (git-file-name name version))
12896 (sha256
12897 (base32 "0vly8z9876yiaxx77ca9lbf9hfv5xichkkxxczjhbs2qwr819k1k"))))
12898 (build-system linux-module-build-system)
12899 (arguments
12900 (list #:tests? #f)) ; No tests.
12901 (synopsis "WiiMote HID kernel module")
12902 (description "This package provides a WiiMote driver that follows the
12903Linux input convention. Specifically, that allows you to use the D-pad
12904as a gamepad.")
12905 (home-page "https://github.com/dkosmari/hid-wiimote-plus")
12906 (license license:gpl2+)))
12907
12908(define-public python-evemu
12909 (package
12910 (name "python-evemu")
12911 (version "2.7.0")
12912 (source (origin
12913 (method git-fetch)
12914 (uri (git-reference
12915 (url "https://gitlab.freedesktop.org/libevdev/evemu")
12916 (commit (string-append "v" version))))
12917 (file-name (git-file-name name version))
12918 (sha256
12919 (base32
12920 "1sxf6v2wnajj9srlkfjfymjmmp4dlq73gzjcjmaw015a3c0xl029"))))
12921 (build-system gnu-build-system)
12922 (arguments
12923 (list #:tests? #f ; would open device files
12924 #:phases
12925 #~(modify-phases %standard-phases
12926 (add-after 'unpack 'patch
12927 (lambda* (#:key inputs #:allow-other-keys)
12928 (substitute* "python/evemu/base.py"
12929 (("\"libevdev.so\"")
12930 (string-append "\"" (assoc-ref inputs "libevdev")
12931 "/lib/libevdev.so\""))))))))
12932 (native-inputs
12933 (list asciidoc autoconf automake libtool docbook-xsl pkg-config
12934 python-wrapper xmlto))
12935 (inputs
12936 (list libevdev))
12937 (synopsis "Record and replay input device events")
12938 (description "This package provides a way to record and replay device
12939descriptions and events, making it possible to emulate input devices
12940through the Linux kernel's input system. Emulated devices are for most
12941practical purposes indistinguishable from real devices.
12942
12943It provides a command line program and also a Python library.")
12944 (home-page "https://www.freedesktop.org/wiki/Evemu/")
12945 (license license:gpl3)))
12946
12947(define-public dualsensectl
12948 (package
12949 (name "dualsensectl")
12950 (version "0.7")
12951 (source (origin
12952 (method git-fetch)
12953 (uri (git-reference
12954 (url "https://github.com/nowrep/dualsensectl.git")
12955 (commit (string-append "v" version))))
12956 (file-name (git-file-name name version))
12957 (sha256
12958 (base32
12959 "05snsp5r3hc2yc1nf0w4aam1my4h0lkxnmy7k4glxvasd9jwahzw"))))
12960 (build-system meson-build-system)
12961 (native-inputs
12962 (list pkg-config))
12963 (inputs
12964 (list eudev dbus hidapi))
12965 (synopsis "Linux tool for controlling PS5 DualSense controller")
12966 (description "This package provides a Linux tool for controlling a PS5
12967DualSense controller. It has to be already connected via USB or connected
12968via Bluetooth.")
12969 (home-page "https://github.com/nowrep/dualsensectl")
12970 (license license:gpl2)))