projects/guix·blob java-team · refs

12901 lines · 554.4 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-sources)
197 #:use-module (gnu packages samba)
198 #:use-module (gnu packages sdl)
199 #:use-module (gnu packages selinux)
200 #:use-module (gnu packages serialization)
201 #:use-module (gnu packages slang)
202 #:use-module (gnu packages sphinx)
203 #:use-module (gnu packages sqlite)
204 #:use-module (gnu packages swig)
205 #:use-module (gnu packages texinfo)
206 #:use-module (gnu packages textutils)
207 #:use-module (gnu packages tls)
208 #:use-module (gnu packages valgrind)
209 #:use-module (gnu packages video)
210 #:use-module (gnu packages vim)
211 #:use-module (gnu packages vulkan)
212 #:use-module (gnu packages web)
213 #:use-module (gnu packages xdisorg)
214 #:use-module (gnu packages xiph)
215 #:use-module (gnu packages xml)
216 #:use-module (gnu packages xorg)
217 #:use-module (gnu packages)
218 #:use-module (guix build-system cmake)
219 #:use-module (guix build-system copy)
220 #:use-module (guix build-system gnu)
221 #:use-module (guix build-system go)
222 #:use-module (guix build-system linux-module)
223 #:use-module (guix build-system meson)
224 #:use-module (guix build-system pyproject)
225 #:use-module (guix build-system qt)
226 #:use-module (guix build-system trivial)
227 #:use-module (guix deprecation) ;for libcap/next
228 #:use-module (guix download)
229 #:use-module (guix gexp)
230 #:use-module (guix git-download)
231 #:use-module ((guix licenses) #:prefix license:)
232 #:use-module (guix monads)
233 #:use-module (guix packages)
234 #:use-module (guix platform)
235 #:use-module (guix store)
236 #:use-module (guix utils)
237 #:use-module (ice-9 match)
238 #:use-module (ice-9 regex)
239 #:use-module (srfi srfi-1)
240 #:use-module (srfi srfi-2)
241 #:use-module (srfi srfi-26)
242 #:export (customize-linux
243 make-defconfig))
244
245
246
247;;;
248;;; Linux kernel customization functions.
249;;;
250
251(define* (customize-linux #:key name
252 (linux linux-libre)
253 source
254 defconfig
255 modconfig
256 (configs "")
257 extra-version)
258 "Make a customized Linux package NAME derived from the LINUX package.
259
260If NAME is not given, then it defaults to the same name as the LINUX package.
261
262Unless SOURCE is given the source of LINUX is used.
263
264A DEFCONFIG file to be used can be given as an origin, as a file-like object
265(file-append, local-file etc.), or as a string with the name of a defconfig file
266available in the Linux sources. If DEFCONFIG is not given, then a defconfig
267file will be saved from the LINUX package configuration.
268
269MODCONFIG is an origin or file-like object used for make localmodconfig to
270disable unlisted modules. For instance, this can come from using modprobed-db
271periodically on a running machine to find all loaded modules.
272
273Additional CONFIGS will be used to modify the given or saved defconfig, which
274will finally be used to build Linux.
275
276CONFIGS can be a list of strings, with one configuration per line. The usual
277defconfig syntax has to be used, but there is a special extension to ease the
278removal of configurations. Comment lines are supported as well.
279
280Here is an example:
281
282 '(;; This string defines the version tail in 'uname -r'.
283 \"CONFIG_LOCALVERSION=\\\"-handcrafted\\\"
284 ;; This '# CONFIG_... is not set' syntax has to match exactly!
285 \"# CONFIG_BOOT_CONFIG is not set\"
286 \"CONFIG_NFS_SWAP=y\"
287 ;; This is a multiline configuration:
288 \"CONFIG_E1000=y
289# This is a comment, below follows an extension to unset a configuration:
290CONFIG_CMDLINE_EXTEND\")
291
292A string of configurations instead of a list of configuration strings is also
293possible.
294
295EXTRA-VERSION can be a string overwriting the EXTRAVERSION setting of the LINUX
296package, after being prepended by a hyphen. It will be visible in the output
297of 'uname -r' behind the Linux version numbers."
298 (package
299 (inherit linux)
300 (name (or name (package-name linux)))
301 (source (or source (package-source linux)))
302 (arguments
303 (substitute-keyword-arguments
304 (package-arguments linux)
305 ((#:imported-modules imported-modules %default-gnu-imported-modules)
306 `((guix build kconfig) ,@imported-modules))
307 ((#:modules modules)
308 `((guix build kconfig) ,@modules))
309 ((#:phases phases)
310 #~(modify-phases #$phases
311 (replace 'configure
312 (lambda* (#:key inputs #:allow-other-keys #:rest arguments)
313 (setenv "EXTRAVERSION"
314 #$(and extra-version
315 (not (string-null? extra-version))
316 (string-append "-" extra-version)))
317 (let* ((configs (string-append "arch/" #$(linux-srcarch)
318 "/configs/"))
319 (guix_defconfig (string-append configs
320 "guix_defconfig")))
321 #$(cond
322 ((not defconfig)
323 #~(begin
324 ;; Call the original 'configure phase.
325 (apply (assoc-ref #$phases 'configure) arguments)
326 ;; Save a defconfig file.
327 (invoke "make" "savedefconfig")
328 ;; Move the saved defconfig to the proper location.
329 (rename-file "defconfig"
330 guix_defconfig)))
331 ((string? defconfig)
332 ;; Use another existing defconfig from the Linux sources.
333 #~(rename-file (string-append configs #$defconfig)
334 guix_defconfig))
335 (else
336 ;; Copy the defconfig input to the proper location.
337 #~(copy-file #$defconfig guix_defconfig)))
338 (chmod guix_defconfig #o644)
339 (modify-defconfig guix_defconfig '#$configs)
340 (invoke "make" "guix_defconfig")
341 (verify-config ".config" guix_defconfig)
342 ;; Minimize module building if provided e.g. a modprobed-db
343 ;; database.
344 (if #$modconfig
345 (invoke "make" (string-append "LSMOD=" #$modconfig)
346 "localmodconfig")))))))))))
347
348(define (make-defconfig uri sha256-as-base32)
349 (origin (method url-fetch)
350 (uri uri)
351 (sha256 (base32 sha256-as-base32))))
352
353(define (linux-srcarch)
354 "Return the linux SRCARCH name, which is set in the toplevel Makefile of
355Linux and denotes the architecture-specific directory name below arch/ in its
356source code. Some few architectures share a common folder. It resembles the
357definition of SRCARCH based on ARCH in the Makefile and may be used to place a
358defconfig file in the proper path."
359 (let ((linux-arch (platform-linux-architecture
360 (lookup-platform-by-target-or-system
361 (or (%current-target-system)
362 (%current-system))))))
363 (match linux-arch
364 ("i386" "x86")
365 ("x86_64" "x86")
366 ("sparc32" "sparc")
367 ("sparc64" "sparc")
368 ("sh64" "sh")
369 (_ linux-arch))))
370
371(define-public (system->defconfig system)
372 "Some systems (notably powerpc-linux) require a special target for kernel
373defconfig. Return the appropriate Make target if applicable, otherwise return
374\"defconfig\"."
375 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
376 ((string-prefix? "powerpc64-" system) "ppc64_defconfig")
377 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
378 (else "defconfig")))
379
380
381;;;
382;;; Kernel source code deblobbing.
383;;;
384
385(define (linux-libre-deblob-scripts version gnu-revision
386 deblob-hash
387 deblob-check-hash)
388 (list (version-major+minor version)
389 (origin
390 (method url-fetch)
391 (uri (string-append "https://linux-libre.fsfla.org"
392 "/pub/linux-libre/releases/" version "-" gnu-revision "/"
393 "deblob-" (version-major+minor version)))
394 (file-name (string-append "linux-libre-deblob-"
395 version "-" gnu-revision))
396 (sha256 deblob-hash))
397 (origin
398 (method url-fetch)
399 (uri (string-append "https://linux-libre.fsfla.org"
400 "/pub/linux-libre/releases/" version "-" gnu-revision "/"
401 "deblob-check"))
402 (file-name (string-append "linux-libre-deblob-check-" version "-" gnu-revision))
403 (sha256 deblob-check-hash))))
404
405;; XXXX: Workaround 'snippet' limitations
406(define computed-origin-method (@@ (guix packages) computed-origin-method))
407
408(define (make-linux-libre-source version
409 upstream-source
410 deblob-scripts)
411 "Return a 'computed' origin that generates a Linux-libre tarball from the
412corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
413 (match deblob-scripts
414 ((deblob-version (? origin? deblob) (? origin? deblob-check))
415 (unless (string=? deblob-version (version-major+minor version))
416 ;; The deblob script cannot be expected to work properly on a
417 ;; different version (major+minor) of Linux, even if no errors
418 ;; are signaled during execution.
419 (error "deblob major+minor version mismatch"))
420 (define unchecked-source
421 (make-linux-source
422 version upstream-source
423 (delay
424 (with-imported-modules '((guix build utils))
425 #~(begin
426 (use-modules (guix build utils))
427
428 (mkdir "/tmp/bin")
429 (set-path-environment-variable
430 "PATH" '("bin")
431 (list "/tmp"
432 #+(canonical-package bash)
433 #+(canonical-package coreutils)
434 #+(canonical-package diffutils)
435 #+(canonical-package findutils)
436 #+(canonical-package patch)
437 #+(canonical-package xz)
438 #+(canonical-package sed)
439 #+(canonical-package grep)
440 #+(canonical-package bzip2)
441 #+(canonical-package gzip)
442 #+(canonical-package tar)
443 #+(canonical-package gawk)
444 #+python-wrapper))
445
446 (with-directory-excursion "/tmp/bin"
447 (copy-file #+deblob "deblob")
448 (chmod "deblob" #o755)
449 (substitute* "deblob"
450 (("/bin/sh") (which "sh")))
451
452 (copy-file #+deblob-check "deblob-check")
453 (chmod "deblob-check" #o755)
454 (substitute* "deblob-check"
455 (("/bin/sh") (which "sh"))
456 (("/bin/sed") (which "sed"))
457 (("/usr/bin/python") (which "python"))))
458
459 (format #t "Running deblob script...~%")
460 (invoke "/tmp/bin/deblob"))))))
461 (origin
462 (method computed-origin-method)
463 (file-name (string-append "linux-" version "-guix.tar.xz"))
464 (sha256 #f)
465 (uri
466 (delay
467 (with-imported-modules '((guix build utils))
468 #~(begin
469 (use-modules (guix build utils))
470
471 (mkdir "/tmp/bin")
472 (set-path-environment-variable
473 "PATH" '("bin")
474 (list "/tmp"
475 #+(canonical-package bash)
476 #+(canonical-package coreutils)
477 #+(canonical-package diffutils)
478 #+(canonical-package findutils)
479 #+(canonical-package patch)
480 #+(canonical-package xz)
481 #+(canonical-package sed)
482 #+(canonical-package grep)
483 #+(canonical-package bzip2)
484 #+(canonical-package gzip)
485 #+(canonical-package tar)
486 #+(canonical-package gawk)
487 #+python-wrapper))
488
489 (with-directory-excursion "/tmp/bin"
490 (copy-file #+deblob-check "deblob-check")
491 (chmod "deblob-check" #o755)
492 (substitute* "deblob-check"
493 (("/bin/sh") (which "sh"))
494 (("/bin/sed") (which "sed"))
495 (("/usr/bin/python") (which "python"))))
496
497 (copy-file #$unchecked-source #$output)
498
499 (format #t "~%Scanning the generated tarball for blobs...~%")
500 (invoke "/tmp/bin/deblob-check" "--use-awk" "--list-blobs"
501 #$output)))))))))
502
503(define (make-linux-source version upstream-source transformation)
504 "Return a 'computed' origin that generates a modified Linux tarball from the
505corresponding UPSTREAM-SOURCE (an origin), using the given TRANSFORMATION (a
506GEXP)."
507 (origin
508 (method computed-origin-method)
509 (file-name (string-append "linux-" version "-guix.tar.xz"))
510 (sha256 #f)
511 (uri
512 (delay
513 (with-imported-modules '((guix build utils))
514 ;; NOTE: it's very important not to introduce local symbols inside
515 ;; the gexp as they will shadow symbols used in TRANSFORMATION.
516 (let ((dir (string-append "linux-" version))
517 (cp (file-append (canonical-package coreutils) "/bin/cp"))
518 (tar (file-append (canonical-package tar) "/bin/tar"))
519 (change-mode (file-append (canonical-package coreutils) "/bin/chmod")))
520 #~(begin
521 (use-modules (guix build utils)
522 (srfi srfi-1)
523 (ice-9 match)
524 (ice-9 ftw))
525
526 ;; Required for tar gz decompression.
527 (setenv "PATH" #+(file-append (canonical-package xz) "/bin"))
528
529 (if (file-is-directory? #+upstream-source)
530 (begin
531 (format #t "Copying upstream Linux source...~%")
532 (copy-recursively #+upstream-source #$dir)
533 (for-each (cut make-file-writable <>)
534 (find-files #$dir)))
535 (begin
536 (format #t "Unpacking upstream Linux tarball...~%")
537 (invoke #+tar "xf" #$upstream-source)
538 (match (scandir "."
539 (lambda (name)
540 (and (not (member name '("." "..")))
541 (file-is-directory? name))))
542 ((unpacked-dir)
543 (unless (string=? #$dir unpacked-dir)
544 (rename-file unpacked-dir #$dir)))
545 (dirs
546 (error "multiple directories found" dirs)))))
547
548 (with-directory-excursion #$dir
549 #$(if (promise? transformation)
550 (force transformation)
551 transformation))
552
553 (format #t "~%Packing new Linux tarball...~%")
554 (invoke #+tar "cvfa" #$output
555 ;; Avoid non-determinism in the archive.
556 "--mtime=@0"
557 "--owner=root:0"
558 "--group=root:0"
559 "--sort=name"
560 "--hard-dereference"
561 #$dir))))))))
562
563
564;;;
565;;; Kernel sources.
566;;;
567
568(define (linux-libre-urls version gnu-revision)
569 "Return a list of URLs for Linux-Libre VERSION."
570 (list (string-append
571 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
572 version "-" gnu-revision "/linux-libre-" version "-" gnu-revision ".tar.xz")
573
574 ;; XXX: Work around <http://bugs.gnu.org/14851>.
575 (string-append
576 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
577 version "-" gnu-revision ".tar.xz")
578
579 ;; Maybe this URL will become valid eventually.
580 (string-append
581 "mirror://gnu/linux-libre/" version "-" gnu-revision "/linux-libre-"
582 version "-" gnu-revision ".tar.xz")))
583
584(define (%upstream-linux-source version hash)
585 (origin
586 (method url-fetch)
587 (uri (string-append "mirror://kernel.org"
588 "/linux/kernel/v" (version-major version) ".x/"
589 "linux-" version ".tar.xz"))
590 (sha256 hash)))
591
592;; The current "stable" kernels. That is, the most recently released major
593;; versions that are still supported upstream.
594
595(define-public linux-libre-7.2-version "7.2.7")
596(define-public linux-libre-7.2-gnu-revision "gnu")
597(define deblob-scripts-7.2
598 (linux-libre-deblob-scripts
599 linux-libre-7.2-version
600 linux-libre-7.2-gnu-revision
601 (base32 "109qy4m3mcc19c1p3b87amzkmmq39jgkr70q3zyxpml41fcc8m23")
602 (base32 "1cwpmi4hxsn01pf7vpkcfda4da146hsa82jjbqwr25pymryzdz9x")))
603(define-public linux-libre-7.2-pristine-source
604 (let ((version linux-libre-7.2-version)
605 (hash (base32 "0nhl8fniqz9v95d54d39pbh045zzj7cghhrrf6rgyh15vd3lrhsa")))
606 (make-linux-libre-source version
607 (%upstream-linux-source version hash)
608 deblob-scripts-7.2)))
609
610(define-public linux-libre-7.1-version "7.1.13")
611(define-public linux-libre-7.1-gnu-revision "gnu")
612(define deblob-scripts-7.1
613 (linux-libre-deblob-scripts
614 linux-libre-7.1-version
615 linux-libre-7.1-gnu-revision
616 (base32 "0a14ymlj6ahfd5ch78hk9nx47ihglndq1h9hi9a4r9di469s5f8v")
617 (base32 "0ab66phhdwhhhvhywiylhlsmqvw8ny4xyi7ap7xzzkqc7im8w1j9")))
618(define-public linux-libre-7.1-pristine-source
619 (let ((version linux-libre-7.1-version)
620 (hash (base32 "1mqshj3ldn0md1c0am35skznnq5vmz3fvrr0cqmwwp6bzpx9akb1")))
621 (make-linux-libre-source version
622 (%upstream-linux-source version hash)
623 deblob-scripts-7.1)))
624
625;; The "longterm" kernels — the older releases with long-term upstream support.
626;; Here are the support timelines:
627;; <https://www.kernel.org/category/releases.html>
628
629(define-public linux-libre-6.18-version "6.18.53")
630(define-public linux-libre-6.18-gnu-revision "gnu")
631(define deblob-scripts-6.18
632 (linux-libre-deblob-scripts
633 linux-libre-6.18-version
634 linux-libre-6.18-gnu-revision
635 (base32 "1x5szxc5d20jq8j5wzqqwk4jagc1q9kdhi2xvry7zbwy6cxskw52")
636 (base32 "1dl6lm9lajxvqqqh2xim0b8085p2242i7qqk3fwa8h9dmshpjxam")))
637(define-public linux-libre-6.18-pristine-source
638 (let ((version linux-libre-6.18-version)
639 (hash (base32 "1q6gfh9v2p5v82p84xjypcdb6kxyp4w4sjhlnjkhhjr4qaavlvsd")))
640 (make-linux-libre-source version
641 (%upstream-linux-source version hash)
642 deblob-scripts-6.18)))
643
644(define-public linux-libre-6.12-version "6.12.111")
645(define-public linux-libre-6.12-gnu-revision "gnu")
646(define deblob-scripts-6.12
647 (linux-libre-deblob-scripts
648 linux-libre-6.12-version
649 linux-libre-6.12-gnu-revision
650 (base32 "168aykyvyyp34549hqhlprl0n052q8wdb2y3vyxqw40wpf2vw3ln")
651 (base32 "0k2q8rxrbl7qhi936qw9bkhj03kdqrvb8hhlsqr8jd3cj0v904gg")))
652(define-public linux-libre-6.12-pristine-source
653 (let ((version linux-libre-6.12-version)
654 (hash (base32 "044qhkby6dgrb4mmggk6j0m6dmlw96c9a7v0lq9gm221c9kxqncy")))
655 (make-linux-libre-source version
656 (%upstream-linux-source version hash)
657 deblob-scripts-6.12)))
658
659(define-public linux-libre-6.6-version "6.6.156")
660(define-public linux-libre-6.6-gnu-revision "gnu")
661(define deblob-scripts-6.6
662 (linux-libre-deblob-scripts
663 linux-libre-6.6-version
664 linux-libre-6.6-gnu-revision
665 (base32 "0y3lawljby2rl0mb0yjdyaasci4pl935y8xa0dnmbzff23knkxlw")
666 (base32 "1h0qybxvk1f2vvbajivxcyqha49zfh1as5053ww36klllyml3cpn")))
667(define-public linux-libre-6.6-pristine-source
668 (let ((version linux-libre-6.6-version)
669 (hash (base32 "07a1dyaxmcv289r0n4agna2li2rfsjdld8279cs18jmg9r52dqmf")))
670 (make-linux-libre-source version
671 (%upstream-linux-source version hash)
672 deblob-scripts-6.6)))
673
674(define-public linux-libre-6.1-version "6.1.187")
675(define-public linux-libre-6.1-gnu-revision "gnu")
676(define deblob-scripts-6.1
677 (linux-libre-deblob-scripts
678 linux-libre-6.1-version
679 linux-libre-6.1-gnu-revision
680 (base32 "10gcbkd5jxfspa712kvb3qmsjgsapd9cz47pmpfk03bbfzf8ydlv")
681 (base32 "1w5pfws6l39dpc3lzazs1n6r4m96f6rdf6vb2scy5fhmrd933ldc")))
682(define-public linux-libre-6.1-pristine-source
683 (let ((version linux-libre-6.1-version)
684 (hash (base32 "0av4fcw3hv4pfql85s2rirxj7hkdr2kdasj219kwl257xa57jvhv")))
685 (make-linux-libre-source version
686 (%upstream-linux-source version hash)
687 deblob-scripts-6.1)))
688
689(define-public linux-libre-5.15-version "5.15.220")
690(define-public linux-libre-5.15-gnu-revision "gnu")
691(define deblob-scripts-5.15
692 (linux-libre-deblob-scripts
693 linux-libre-5.15-version
694 linux-libre-5.15-gnu-revision
695 (base32 "0b2gd83ihxlq490gpgq930misc6jrckw4rzl7fvwd0qzczqjvff5")
696 (base32 "1s6km2r2mad0wpf7nqn4rqsykw1lm386l1yskmil24239fbva1f1")))
697(define-public linux-libre-5.15-pristine-source
698 (let ((version linux-libre-5.15-version)
699 (hash (base32 "08v7mbwvfgy9vv60j2ssdks4ss218p27rkwwrmjch2hj0ljrkcmm")))
700 (make-linux-libre-source version
701 (%upstream-linux-source version hash)
702 deblob-scripts-5.15)))
703
704(define %boot-logo-patch
705 ;; Linux-Libre boot logo featuring Freedo and a gnu.
706 (origin
707 (method url-fetch)
708 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
709 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
710 (sha256
711 (base32
712 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
713
714(define %linux-libre-arm-export-__sync_icache_dcache-patch
715 (origin
716 (method url-fetch)
717 (uri (string-append
718 "https://salsa.debian.org/kernel-team/linux"
719 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
720 "/debian/patches/bugfix/arm/"
721 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
722 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
723 (sha256
724 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
725
726(define (source-with-patches source patches)
727 (origin
728 (inherit source)
729 (patches (append (origin-patches source)
730 patches))))
731
732(define-public linux-libre-7.2-source
733 (source-with-patches linux-libre-7.2-pristine-source
734 (append
735 (list %linux-libre-arm-export-__sync_icache_dcache-patch)
736 (search-patches "linux-shmem-hurd-xattr.patch"
737 "linux-libre-fix-arm64-bin-sh.patch"))))
738
739(define-public linux-libre-7.1-source
740 (source-with-patches linux-libre-7.1-pristine-source
741 (append
742 (list %linux-libre-arm-export-__sync_icache_dcache-patch)
743 (search-patches "linux-shmem-hurd-xattr.patch"
744 "linux-libre-fix-arm64-bin-sh.patch"))))
745
746(define-public linux-libre-6.18-source
747 (source-with-patches linux-libre-6.18-pristine-source
748 (list %boot-logo-patch
749 %linux-libre-arm-export-__sync_icache_dcache-patch)))
750
751(define-public linux-libre-6.12-source
752 (source-with-patches linux-libre-6.12-pristine-source
753 (list %boot-logo-patch
754 %linux-libre-arm-export-__sync_icache_dcache-patch)))
755
756(define-public linux-libre-6.6-source
757 (source-with-patches linux-libre-6.6-pristine-source
758 (list %boot-logo-patch
759 %linux-libre-arm-export-__sync_icache_dcache-patch)))
760
761(define-public linux-libre-6.1-source
762 (source-with-patches linux-libre-6.1-pristine-source
763 (append
764 (list %boot-logo-patch
765 %linux-libre-arm-export-__sync_icache_dcache-patch)
766 (search-patches
767 "linux-libre-infodocs-target.patch"))))
768
769(define-public linux-libre-5.15-source
770 (source-with-patches linux-libre-5.15-pristine-source
771 (list %boot-logo-patch
772 %linux-libre-arm-export-__sync_icache_dcache-patch)))
773
774
775;; Debian sources.
776
777(define (linux-debian-patches version hash)
778 (package
779 (name "linux-debian-patches")
780 (version version)
781 (source (origin
782 (method git-fetch)
783 (uri (git-reference
784 (url "https://salsa.debian.org/kernel-team/linux.git")
785 (commit (string-append "debian/" version))))
786 (file-name (git-file-name name version))
787 (sha256 hash)))
788 (build-system copy-build-system)
789 (arguments
790 (list
791 #:install-plan
792 ''(("debian/patches" "")
793 ("debian/config" ""))))
794 (home-page "Debian patches")
795 (synopsis "Debian patches")
796 (description "Debian patches")
797 (license license:gpl2)))
798
799(define-public linux-debian-6.12-version "6.12.107")
800(define debian-patches-6.12
801 (linux-debian-patches
802 (string-append linux-debian-6.12-version "-1")
803 (base32 "1cqpb35hv3danwdyw7r8cxx14xa9d6ypf86j8cji8nc8kyw6scby")))
804(define-public linux-debian-6.12-pristine-source
805 (let ((version linux-debian-6.12-version)
806 (hash (base32 "0yih5s4xbp1hlyfha49z2j3l9x7i5ij335jfl6f6sbfy7yzcby55")))
807 (make-linux-source
808 version (%upstream-linux-source version hash)
809 (delay
810 #~(begin
811 (format #t "Patching kernel...~%")
812 (setenv "QUILT_PATCHES" #$(file-append debian-patches-6.12
813 "/patches"))
814 (invoke #$(file-append quilt "/bin/quilt") "push" "-a"))))))
815
816(define-public linux-debian-6.12-source
817 (source-with-patches linux-debian-6.12-pristine-source
818 (search-patches "linux-shmem-hurd-xattr.patch")))
819
820
821;;;
822;;; Kernel headers.
823;;;
824
825(define %linux-libre-timeout-properties
826 ;; Package properties for 'linux-libre' and 'linux-libre-headers' packages.
827 `((timeout . ,(* 8 3600)) ;deblob takes >5h on AArch64
828 (max-silent-time . ,(* 3 3600)))) ;don't time out on blob scan
829
830(define (make-linux-libre-headers version gnu-revision hash-string)
831 (make-linux-libre-headers* version gnu-revision
832 (origin
833 (method url-fetch)
834 (uri (linux-libre-urls version gnu-revision))
835 (sha256 (base32 hash-string)))))
836
837(define (make-linux-libre-headers* version gnu-revision source)
838 (package
839 (name "linux-libre-headers")
840 (version version)
841 (source source)
842 (build-system gnu-build-system)
843 (native-inputs `(("perl" ,perl)
844 ,@(if (version>=? version "4.16")
845 `(("flex" ,flex)
846 ("bison" ,bison))
847 '())))
848 (arguments
849 `(#:modules ((guix build gnu-build-system)
850 (guix build utils)
851 (srfi srfi-1)
852 (ice-9 match))
853 #:phases
854 (modify-phases %standard-phases
855 (delete 'configure)
856 (replace 'build
857 (lambda _
858 (let ((arch ,(platform-linux-architecture
859 (lookup-platform-by-target-or-system
860 (or (%current-target-system)
861 (%current-system)))))
862 (defconfig ,(system->defconfig
863 (or (%current-target-system)
864 (%current-system))))
865 (make-target ,(if (version>=? version "5.3")
866 "headers"
867 "headers_check")))
868 (setenv "ARCH" arch)
869 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
870 (invoke "make" defconfig)
871 (invoke "make" "mrproper" make-target))))
872 (replace 'install
873 (lambda* (#:key outputs #:allow-other-keys)
874 (let ((out (assoc-ref outputs "out")))
875
876 ;; Mimic the quiet_cmd_headers_install target to avoid a
877 ;; dependency on rsync.
878 (for-each (lambda (file)
879 (let ((destination (string-append
880 out "/include/"
881 ;; Drop the 'usr/include' prefix.
882 (match (string-split file #\/)
883 ((_ _ path ...)
884 (string-join path "/"))))))
885 (format #t "`~a' -> `~a'~%" file destination)
886 (install-file file (dirname destination))))
887 (find-files "usr/include" "\\.h$"))
888
889 (mkdir (string-append out "/include/config"))
890 (call-with-output-file
891 (string-append out
892 "/include/config/kernel.release")
893 (lambda (p)
894 (format p "~a-default~%" ,version)))))))
895 #:allowed-references ()
896 #:tests? #f))
897 (supported-systems (remove target-hurd? %supported-systems))
898 (properties %linux-libre-timeout-properties)
899 (home-page "https://www.gnu.org/software/linux-libre/")
900 (synopsis "GNU Linux-Libre kernel headers")
901 (description "Headers of the Linux-Libre kernel.")
902 (license license:gpl2)))
903
904(define-public linux-libre-headers-7.2
905 (make-linux-libre-headers* linux-libre-7.2-version
906 linux-libre-7.2-gnu-revision
907 linux-libre-7.2-source))
908
909(define-public linux-libre-headers-7.1
910 (make-linux-libre-headers* linux-libre-7.1-version
911 linux-libre-7.1-gnu-revision
912 linux-libre-7.1-source))
913
914(define-public linux-libre-headers-6.18
915 (make-linux-libre-headers* linux-libre-6.18-version
916 linux-libre-6.18-gnu-revision
917 linux-libre-6.18-source))
918
919(define-public linux-libre-headers-6.12
920 (make-linux-libre-headers* linux-libre-6.12-version
921 linux-libre-6.12-gnu-revision
922 linux-libre-6.12-source))
923
924(define-public linux-libre-headers-6.6
925 (make-linux-libre-headers* linux-libre-6.6-version
926 linux-libre-6.6-gnu-revision
927 linux-libre-6.6-source))
928
929(define-public linux-libre-headers-6.1
930 (make-linux-libre-headers* linux-libre-6.1-version
931 linux-libre-6.1-gnu-revision
932 linux-libre-6.1-source))
933
934(define-public linux-libre-headers-5.15
935 (make-linux-libre-headers* linux-libre-5.15-version
936 linux-libre-5.15-gnu-revision
937 linux-libre-5.15-source))
938
939;; The following package is used in the early bootstrap, and thus must be kept
940;; stable and with minimal build requirements.
941(define-public linux-libre-headers-6.12.17
942 (make-linux-libre-headers "6.12.17" "gnu"
943 "1j3iyivh8h9abryjqksf4k51wgwnwqy2l3zsc019bm84xmka38xm"))
944
945(define-public linux-libre-headers linux-libre-headers-6.12.17)
946;; linux-libre-headers-latest points to the latest headers package
947;; and should be used as a dependency for packages that depend on
948;; the headers.
949(define-public linux-libre-headers-latest linux-libre-headers-7.2)
950
951
952;;;
953;;; Kernel configurations.
954;;;
955
956(define* (kernel-config arch #:key variant)
957 "Return a file-like object of the Linux-Libre build configuration file for
958ARCH and optionally VARIANT, or #f if there is no such configuration."
959 (let* ((name (string-append (if variant (string-append variant "-") "")
960 (if (string=? "i386" arch) "i686" arch) ".conf"))
961 (file (string-append "linux-libre/" name))
962 (config (search-auxiliary-file file)))
963 (and config (local-file config))))
964
965(define (default-extra-linux-options version)
966 `(;; Make the kernel config available at /proc/config.gz
967 ("CONFIG_IKCONFIG" . #t)
968 ("CONFIG_IKCONFIG_PROC" . #t)
969 ;; Debugging options.
970 ("CONFIG_DEBUG_INFO" . #t) ;required by BTF
971 ,@(if (version>=? version "5.1")
972 '(("CONFIG_DEBUG_INFO_BTF" . #t))
973 '())
974 ,@(if (version>=? version "5.12")
975 '(("CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT" . #t))
976 '())
977 ("CONFIG_DEBUG_INFO_REDUCED" . #f) ;incompatible with BTF
978 ;; Tracing and related options.
979 ,@(if (version>=? version "5.1")
980 '(("CONFIG_BPF_JIT" . #t)
981 ("CONFIG_BPF_JIT_ALWAYS_ON" . #t)
982 ("CONFIG_BPF_SYSCALL" . #t))
983 '())
984 ,@(if (version>=? version "5.13")
985 '(("CONFIG_BPF_UNPRIV_DEFAULT_OFF" . #t))
986 '())
987 ("CONFIG_NET_CLS_BPF" . m) ;classify packets based on BPF filters
988 ("CONFIG_NET_ACT_BPF" . m) ;to execute BPF code on packets
989 ;; Compress kernel modules via Zstd.
990 ,(if (version>=? version "5.13")
991 '("CONFIG_MODULE_COMPRESS_ZSTD" . #t)
992 '("CONFIG_MODULE_COMPRESS_GZIP" . #t))
993 ;; Some very mild hardening.
994 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
995 ;; All kernels should have NAMESPACES options enabled
996 ("CONFIG_NAMESPACES" . #t)
997 ("CONFIG_UTS_NS" . #t)
998 ("CONFIG_IPC_NS" . #t)
999 ("CONFIG_USER_NS" . #t)
1000 ("CONFIG_PID_NS" . #t)
1001 ("CONFIG_NET_NS" . #t)
1002 ;; Various options needed for elogind service:
1003 ;; https://issues.guix.gnu.org/43078
1004 ("CONFIG_CGROUP_FREEZER" . #t)
1005 ("CONFIG_BLK_CGROUP" . #t)
1006 ("CONFIG_CGROUP_WRITEBACK" . #t)
1007 ("CONFIG_CGROUP_SCHED" . #t)
1008 ("CONFIG_CGROUP_PIDS" . #t)
1009 ("CONFIG_CGROUP_FREEZER" . #t)
1010 ("CONFIG_CGROUP_DEVICE" . #t)
1011 ("CONFIG_CGROUP_CPUACCT" . #t)
1012 ("CONFIG_CGROUP_PERF" . #t)
1013 ("CONFIG_SOCK_CGROUP_DATA" . #t)
1014 ("CONFIG_BLK_CGROUP_IOCOST" . #t)
1015 ("CONFIG_CGROUP_NET_PRIO" . #t)
1016 ("CONFIG_CGROUP_NET_CLASSID" . #t)
1017 ("CONFIG_MEMCG" . #t)
1018 ("CONFIG_MEMCG_SWAP" . #t)
1019 ("CONFIG_MEMCG_KMEM" . #t)
1020 ("CONFIG_CPUSETS" . #t)
1021 ("CONFIG_PROC_PID_CPUSET" . #t)
1022 ;; Allow disk encryption by default
1023 ("CONFIG_DM_CRYPT" . m)
1024 ;; Allow fscrypt filesystem encryption by default
1025 ("CONFIG_FS_ENCRYPTION" . #t)
1026 ;; Support zram on all kernel configs
1027 ("CONFIG_ZSWAP" . #t)
1028 ("CONFIG_ZSMALLOC" . #t)
1029 ("CONFIG_ZRAM" . m)
1030 ;; Accessibility support.
1031 ("CONFIG_ACCESSIBILITY" . #t)
1032 ("CONFIG_A11Y_BRAILLE_CONSOLE" . #t)
1033 ("CONFIG_SPEAKUP" . m)
1034 ("CONFIG_SPEAKUP_SYNTH_SOFT" . m)
1035 ;; Modules required for initrd:
1036 ("CONFIG_NET_9P" . m)
1037 ("CONFIG_NET_9P_VIRTIO" . m)
1038 ("CONFIG_VIRTIO_BLK" . m)
1039 ("CONFIG_VIRTIO_NET" . m)
1040 ("CONFIG_VIRTIO_PCI" . m)
1041 ("CONFIG_VIRTIO_BALLOON" . m)
1042 ("CONFIG_VIRTIO_MMIO" . m)
1043 ("CONFIG_FUSE_FS" . m)
1044 ("CONFIG_CIFS" . m)
1045 ("CONFIG_9P_FS" . m)
1046 ;; Enable DMABUF used by wayland, pipewire and libcamera
1047 ;; https://codeberg.org/guix/guix/issues/5995
1048 ("CONFIG_UDMABUF" . #t)
1049 ("CONFIG_DMABUF_MOVE_NOTIFY" . #t)
1050 ("CONFIG_DMABUF_HEAPS" . #t)
1051 ("CONFIG_DMABUF_HEAPS_SYSTEM" . #t)
1052 ("CONFIG_DMABUF_HEAPS_CMA" . #t)
1053 ,@(if (version>=? version "6.17")
1054 '(("CONFIG_DMABUF_HEAPS_CMA_LEGACY" . #t))
1055 '())
1056 ;; Enable sched_ext support for userspace schedulers
1057 ;; Note: Depends on BPF tracing
1058 ;; https://docs.kernel.org/scheduler/sched-ext.html
1059 ,@(if (version>=? version "6.12")
1060 '(("CONFIG_SCHED_CLASS_EXT" . #t))
1061 '())
1062 ;; Disable the EFI pstore storage backend to avoid causing
1063 ;; unrecoverable failures on some EFI systems:
1064 ;; https://lists.gnu.org/archive/html/help-guix/2025-01/msg00173.html
1065 ("CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE" . #t)
1066 ;; Provide modules for wireguard and netfilter support
1067 ("CONFIG_WIREGUARD" . m)
1068 ("CONFIG_IP_NF_FILTER" . m)
1069 ("CONFIG_NETFILTER_XT_MATCH_ADDRTYPE" . m)))
1070
1071(define (config->string options)
1072 (string-join (map (match-lambda
1073 ((option . 'm)
1074 (string-append option "=m"))
1075 ((option . #t)
1076 (string-append option "=y"))
1077 ((option . #f)
1078 (string-append option "=n"))
1079 ((option . string)
1080 (string-append option "=\"" string "\"")))
1081 options)
1082 "\n"))
1083
1084
1085;;;
1086;;; Kernel package utilities.
1087;;;
1088
1089(define (apply-infodoc-patch? version)
1090 ;; Versions older than 5.10 have different enough build scripts that the
1091 ;; infodocs patch doesn't apply.
1092 (and (version>=? version "5.10")
1093 (not (version>=? version "6.2")))) ;patch applied upstream
1094
1095(define* (make-linux* version source supported-systems produced-modules
1096 #:key
1097 (extra-version #f)
1098 ;; A function that takes an arch and a variant.
1099 ;; See kernel-config for an example.
1100 (configuration-file #f)
1101 (defconfig "defconfig")
1102 (extra-options (default-extra-linux-options version)))
1103 "Create a Linux package from VERSION using SOURCE for SUPPORTED-SYSTEMS.
1104
1105Produced modules will use package-properties to convey which modules the given
1106configuration produced either by CONFIGURATION-FILE or DEFCONFIG will yield.
1107This allows 'operating-system' records to infer their 'intrd-modules' value
1108from their 'kernel' field package.
1109
1110EXTRA-VERSION will control the emitted package name as well as the
1111EXTRAVERSION value of the kernel build.
1112
1113CONFIGURATION-FILE is a file-like object which will be used as the
1114configuration file to use for building the kernel. If used the DEFCONFIG
1115argument will be ignored.
1116
1117DEFCONFIG can either be a string, which will control the make target that
1118generates the configuration file used for building the kernel, or a GEXP which
1119should produce the '.config' file that will be used for building the kernel.
1120
1121EXTRA-OPTIONS will be appended to the configuration file provided by
1122CONFIGURATION-FILE or generated by DEFCONFIG. It must be an alist where each element has the form:
1123(KERNEL-OPTION . VALUE)
1124
1125KERNEL-OPTION must be a string and VALUE can be '#t', '#f' or 'm' for
1126instructing that the configuration option should build a kernel module."
1127 (package
1128 (name (if extra-version
1129 (string-append "linux-" extra-version)
1130 "linux"))
1131 (version version)
1132 (source source)
1133 (supported-systems supported-systems)
1134 (build-system gnu-build-system)
1135 (arguments
1136 (list
1137 #:modules '((guix build gnu-build-system)
1138 (guix build utils)
1139 (srfi srfi-1)
1140 (srfi srfi-26)
1141 (ice-9 ftw)
1142 (ice-9 match))
1143 #:tests? #f
1144 #:phases
1145 #~(modify-phases %standard-phases
1146 (add-after 'unpack 'patch-/bin/pwd
1147 (lambda _
1148 (substitute* (find-files
1149 "." "^Makefile(\\.include)?$")
1150 (("/bin/pwd") "pwd"))))
1151 (add-before 'configure 'set-environment
1152 (lambda* (#:key target #:allow-other-keys)
1153 ;; Avoid introducing timestamps.
1154 (setenv "KCONFIG_NOTIMESTAMP" "1")
1155 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
1156
1157 ;; Other variables useful for reproducibility.
1158 (setenv "KBUILD_BUILD_VERSION" "1")
1159 (setenv "KBUILD_BUILD_USER" "guix")
1160 (setenv "KBUILD_BUILD_HOST" "guix")
1161
1162 ;; Set ARCH and CROSS_COMPILE.
1163 (let ((arch #$(platform-linux-architecture
1164 (lookup-platform-by-target-or-system
1165 (or (%current-target-system)
1166 (%current-system))))))
1167 (setenv "ARCH" arch)
1168 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
1169 (when target
1170 (setenv "CROSS_COMPILE" (string-append target "-"))
1171 (format #t "`CROSS_COMPILE' set to `~a'~%"
1172 (getenv "CROSS_COMPILE"))))
1173
1174 ;; Allow EXTRAVERSION to be set via the environment.
1175 (substitute* "Makefile"
1176 (("^ *EXTRAVERSION[[:blank:]]*=")
1177 "EXTRAVERSION ?="))
1178 (setenv "EXTRAVERSION"
1179 #$(and extra-version
1180 (string-append "-" extra-version)))
1181 ;; Use the maximum compression available for Zstd-compressed
1182 ;; modules.
1183 (setenv "ZSTD_CLEVEL" "19")))
1184 (replace 'configure
1185 (lambda _
1186 (let ((config
1187 #$(match (let ((arch (platform-linux-architecture
1188 (lookup-platform-by-target-or-system
1189 (or (%current-target-system)
1190 (%current-system))))))
1191 (and configuration-file arch
1192 (configuration-file
1193 arch
1194 #:variant (version-major+minor version))))
1195 (#f ;no config for this platform
1196 #f)
1197 ((? file-like? config)
1198 config))))
1199 ;; Use a custom kernel configuration file or a default
1200 ;; configuration file.
1201 (if config
1202 (begin
1203 (copy-file config ".config")
1204 (chmod ".config" #o666))
1205 #$(cond
1206 ((string? defconfig)
1207 #~(invoke "make" #$defconfig))
1208 ((promise? defconfig)
1209 (force defconfig))
1210 (else
1211 defconfig)))
1212 ;; Appending works even when the option wasn't in the file.
1213 ;; The last one prevails if duplicated.
1214 (let ((port (open-file ".config" "a"))
1215 (extra-configuration #$(config->string extra-options)))
1216 (display extra-configuration port)
1217 (close-port port))
1218 (invoke "make" "oldconfig"))))
1219 (replace 'install
1220 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
1221 (let ((moddir (string-append #$output "/lib/modules"))
1222 (dtbdir (string-append #$output "/lib/dtbs"))
1223 (make-flags
1224 (append make-flags
1225 (list "-j"
1226 (if parallel-build?
1227 (number->string (parallel-job-count))
1228 "1")))))
1229 ;; Install kernel image, kernel configuration and link map.
1230 (for-each (lambda (file) (install-file file #$output))
1231 (find-files "." "^(\\.config|bzImage|zImage|Image\
1232|vmlinuz|System\\.map|Module\\.symvers)$"))
1233 ;; Install device tree files
1234 (unless (null? (find-files "." "\\.dtb$"))
1235 (mkdir-p dtbdir)
1236 (apply invoke "make"
1237 (string-append "INSTALL_DTBS_PATH=" dtbdir)
1238 "dtbs_install" make-flags))
1239 ;; Install kernel modules
1240 (mkdir-p moddir)
1241 (apply invoke "make"
1242 ;; Disable depmod because the Guix system's module
1243 ;; directory is an union of potentially multiple
1244 ;; packages. It is not possible to use depmod to
1245 ;; usefully calculate a dependency graph while building
1246 ;; only one of them.
1247 "DEPMOD=true"
1248 (string-append "MODULE_DIR=" moddir)
1249 (string-append "INSTALL_PATH=" #$output)
1250 (string-append "INSTALL_MOD_PATH=" #$output)
1251 "INSTALL_MOD_STRIP=1"
1252 "modules_install" make-flags)
1253 (let* ((versions (filter (lambda (name)
1254 (not (string-prefix? "." name)))
1255 (scandir moddir)))
1256 (version (match versions
1257 ((x) x))))
1258 ;; There are symlinks to the build and source directory.
1259 ;; Both will point to target /tmp/guix-build* and thus not
1260 ;; be useful in a profile. Delete the symlinks.
1261 (false-if-file-not-found
1262 (delete-file
1263 (string-append moddir "/" version "/build")))
1264 (false-if-file-not-found
1265 (delete-file
1266 (string-append moddir "/" version "/source"))))))))))
1267 (native-inputs
1268 (list perl
1269 bc
1270 openssl
1271 elfutils ;needed to enable CONFIG_STACK_VALIDATION
1272 flex
1273 bison
1274 util-linux ;needed for hexdump
1275 ;; These are needed to compile the GCC plugins.
1276 gmp
1277 mpfr
1278 mpc
1279 ;; These are needed when building with the CONFIG_DEBUG_INFO_BTF
1280 ;; support.
1281 dwarves ;for pahole
1282 python-wrapper
1283 zlib
1284 ;; For Zstd compression of kernel modules.
1285 zstd))
1286 (home-page #f)
1287 (synopsis #f)
1288 (description #f)
1289 (license #f)
1290 (properties
1291 `((base-initrd-modules . ,produced-modules)))))
1292
1293(define* (make-linux-libre version gnu-revision hash-string supported-systems
1294 #:key
1295 (extra-version #f)
1296 ;; A function that takes an arch and a variant, and
1297 ;; return a file-like object. See kernel-config
1298 ;; for an example.
1299 (configuration-file #f)
1300 (defconfig "defconfig")
1301 (extra-options (default-extra-linux-options version))
1302 (patches
1303 `(,%boot-logo-patch
1304 ,@(if (apply-infodoc-patch? version)
1305 (list (search-patch
1306 "linux-libre-infodocs-target.patch"))
1307 '()))))
1308 (make-linux-libre* version gnu-revision
1309 (origin
1310 (method url-fetch)
1311 (uri (linux-libre-urls version gnu-revision))
1312 (sha256 (base32 hash-string))
1313 (patches patches))
1314 supported-systems
1315 #:extra-version extra-version
1316 #:configuration-file configuration-file
1317 #:defconfig defconfig
1318 #:extra-options extra-options))
1319
1320(define virtio-modules
1321 ;; Modules for Linux para-virtualized devices, for use in QEMU guests.
1322 '("virtio_pci" "virtio_balloon" "virtio_blk" "virtio_net"
1323 "virtio_console" "virtio-rng" "virtio_mmio" "virtio_scsi"))
1324
1325(define default-linux-libre-initrd-modules
1326 ;; Default set of modules that need to be available in the initrd when
1327 ;; booting Linux-libre.
1328 (let* ((generic `("ahci" ;for SATA controllers
1329 "nvme" ;for NVMe controllers
1330 "usb-storage" "uas" ;for the installation image etc.
1331 "usbhid" "hid-generic" ;keyboards during early boot
1332 "mmc_block" ;for MMC block device driver
1333 "dm-crypt" "xts" "serpent_generic" "wp512" ;for encrypted root partitions
1334 "nls_iso8859-1" ;for `mkfs.fat`, et.al
1335 ,@virtio-modules))
1336 (_86 (cons*
1337 "hid-apple"
1338 "pata_acpi" "pata_atiixp" ;for ATA controllers
1339 "isci"
1340 generic))
1341 (others (cons*
1342 "hid-apple"
1343 generic)))
1344 `(("x86_64-linux" . ,_86)
1345 ("i686-linux" . ,_86)
1346 ("armhf-linux" . ,others)
1347 ("aarch64-linux" . ,others)
1348 ("mips64el-linux" . ,others)
1349 ("powerpc-linux" . ,others)
1350 ("powerpc64le-linux" . ,others)
1351 ("riscv64-linux" . ,generic))))
1352
1353(define* (make-linux-libre* version gnu-revision source supported-systems
1354 #:key
1355 (extra-version #f)
1356 ;; A function that takes an arch and a variant.
1357 ;; See kernel-config for an example.
1358 (configuration-file #f)
1359 (defconfig "defconfig")
1360 (extra-options (default-extra-linux-options version)))
1361 (let ((linux (make-linux* version source supported-systems
1362 default-linux-libre-initrd-modules
1363 #:extra-version extra-version
1364 #:configuration-file configuration-file
1365 #:defconfig defconfig
1366 #:extra-options extra-options)))
1367 (package
1368 (inherit linux)
1369 (name (if extra-version
1370 (string-append "linux-libre-" extra-version)
1371 "linux-libre"))
1372 (home-page "https://www.gnu.org/software/linux-libre/")
1373 (synopsis "100% free redistribution of a cleaned Linux kernel")
1374 (description "GNU Linux-Libre is a free (as in freedom) variant of the
1375Linux kernel. It has been modified to remove all non-free binary blobs.")
1376 (license license:gpl2)
1377 (properties (append %linux-libre-timeout-properties
1378 (package-properties linux))))))
1379
1380(define default-linux-debian-initrd-modules
1381 ;; Default set of modules that need to be available in the initrd when
1382 ;; booting Linux-debian.
1383 (let* ((generic `("ahci" ;for SATA controllers
1384 "nvme" ;for NVMe controllers
1385 "ext4" "crc32c_generic" ;compiled as a module by 'CONFIG_EXT4_FS=m'.
1386 "usb-storage" "uas" ;for the installation image etc.
1387 "usbhid" "hid-generic" ;keyboards during early boot
1388 "mmc_block" ;for MMC block device driver
1389 "dm-crypt" "xts" "serpent_generic" "wp512" ;for encrypted root partitions
1390 "nls_iso8859-1" ;for `mkfs.fat`, et.al
1391 ,@virtio-modules))
1392 (_86 (cons*
1393 "hid-apple"
1394 "pata_atiixp" ;for ATA controllers
1395 "isci"
1396 generic))
1397 (others (cons*
1398 "hid-apple"
1399 generic)))
1400 `(("x86_64-linux" . ,_86)
1401 ("i686-linux" . ,_86)
1402 ("armhf-linux" . ,others)
1403 ("aarch64-linux" . ,others)
1404 ("mips64el-linux" . ,others)
1405 ("powerpc-linux" . ,others)
1406 ("powerpc64le-linux" . ,others)
1407 ("riscv64-linux" . ,generic))))
1408
1409(define* (make-linux-debian* version source supported-systems
1410 #:key
1411 (extra-version #f)
1412 ;; A function that takes an arch and a variant.
1413 ;; See kernel-config for an example.
1414 (configuration-file #f)
1415 (defconfig "defconfig")
1416 (extra-options (append
1417 ;; Required for enabling CIRRUS
1418 '(("CONFIG_PCI" . #t)
1419 ("CONFIG_DRM" . #t)
1420 ;; Required for QEMU virt
1421 ;; support.
1422 ("CONFIG_DRM_CIRRUS_QEMU" . m)
1423 ("CONFIG_DRM_VIRTIO_GPU" . m)
1424 ("CONFIG_DRM_BOCHS" . m))
1425 (default-extra-linux-options version))))
1426 (package
1427 (inherit (make-linux* version source supported-systems
1428 default-linux-debian-initrd-modules
1429 #:extra-version extra-version
1430 #:configuration-file configuration-file
1431 #:defconfig defconfig
1432 #:extra-options extra-options))
1433 (name (if extra-version
1434 (string-append "linux-debian-" extra-version)
1435 "linux-debian"))
1436 (home-page "https://www.debian.org")
1437 (synopsis "Debian's free redistribution of a cleaned Linux kernel")
1438 (description "Linux-Debian is a free (as in freedom) variant of the
1439Linux kernel. It has been modified to remove all non-free binary blobs
1440following the @uref{https://www.debian.org/social_contract#guidelines,
1441DFSDG}.")
1442 (license license:gpl2)))
1443
1444
1445;;;
1446;;; Generic kernel packages.
1447;;;
1448
1449(define-public linux-debian-6.12
1450 (make-linux-debian* linux-debian-6.12-version
1451 linux-debian-6.12-source
1452 '("x86_64-linux" "armhf-linux" "aarch64-linux"
1453 "powerpc64le-linux" "riscv64-linux")
1454 #:defconfig
1455 ;; XXX: this snippet merges the different configuration
1456 ;; files provided by Debian to construct a Debian
1457 ;; configuration for the given architecture. The
1458 ;; complete Debian configuration is composed by a
1459 ;; generic configuration 'config/config', an
1460 ;; architecture specific one ('armhf', 'arm64',
1461 ;; 'riscv64', 'amd64') that follows debian architecture
1462 ;; naming and sometimes an additionaly configuration
1463 ;; following the pattern 'kernelarch-xxx'.
1464 (delay
1465 #~(let* ((arch->debian-arch
1466 (lambda (arch)
1467 ;; Case comparison is done with 'eqv?'
1468 ;; which doesn't work with strings.
1469 (case (string->symbol arch)
1470 ((arm) '("kernelarch-arm" "armhf"))
1471 ((arm64) '("arm64"))
1472 ((powerpc) '("kernelarch-powerpc" "ppc64el"))
1473 ((riscv) '("riscv64"))
1474 ((x86_64) '("kernelarch-x86" "amd64"))
1475 (else '()))))
1476 (arch-confs (arch->debian-arch (getenv "ARCH"))))
1477 (apply invoke "scripts/kconfig/merge_config.sh"
1478 #$(file-append debian-patches-6.12
1479 "/config/config")
1480 (map (lambda (arch-conf)
1481 (string-append #$debian-patches-6.12
1482 "/config/"
1483 arch-conf
1484 "/config"))
1485 arch-confs))
1486 (invoke #$(file-append gnu-make "/bin/make")
1487 "olddefconfig")))))
1488
1489(define-public linux-debian linux-debian-6.12)
1490
1491(define-public linux-libre-7.2
1492 (make-linux-libre* linux-libre-7.2-version
1493 linux-libre-7.2-gnu-revision
1494 linux-libre-7.2-source
1495 '("x86_64-linux" "i686-linux" "armhf-linux"
1496 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1497 #:configuration-file kernel-config))
1498
1499(define-public linux-libre-version linux-libre-7.2-version)
1500(define-public linux-libre-gnu-revision linux-libre-7.2-gnu-revision)
1501(define-public linux-libre-pristine-source linux-libre-7.2-pristine-source)
1502(define-public linux-libre-source linux-libre-7.2-source)
1503(define-public linux-libre linux-libre-7.2)
1504
1505(define-public linux-libre-7.1
1506 (make-linux-libre* linux-libre-7.1-version
1507 linux-libre-7.1-gnu-revision
1508 linux-libre-7.1-source
1509 '("x86_64-linux" "i686-linux" "armhf-linux"
1510 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1511 #:configuration-file kernel-config))
1512
1513(define-public linux-libre-6.18
1514 (make-linux-libre* linux-libre-6.18-version
1515 linux-libre-6.18-gnu-revision
1516 linux-libre-6.18-source
1517 '("x86_64-linux" "i686-linux" "armhf-linux"
1518 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1519 #:configuration-file kernel-config))
1520
1521(define-public linux-libre-6.12
1522 (make-linux-libre* linux-libre-6.12-version
1523 linux-libre-6.12-gnu-revision
1524 linux-libre-6.12-source
1525 '("x86_64-linux" "i686-linux" "armhf-linux"
1526 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1527 #:configuration-file kernel-config))
1528
1529(define-public linux-libre-6.6
1530 (make-linux-libre* linux-libre-6.6-version
1531 linux-libre-6.6-gnu-revision
1532 linux-libre-6.6-source
1533 '("x86_64-linux" "i686-linux" "armhf-linux"
1534 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1535 #:configuration-file kernel-config))
1536
1537(define-public linux-libre-6.1
1538 (make-linux-libre* linux-libre-6.1-version
1539 linux-libre-6.1-gnu-revision
1540 linux-libre-6.1-source
1541 '("x86_64-linux" "i686-linux" "armhf-linux"
1542 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1543 #:configuration-file kernel-config))
1544
1545;; Linux-Libre-LTS points to the *newest* released long-term support version of
1546;; Linux-Libre.
1547;; Reference: <https://www.kernel.org/category/releases.html>
1548
1549(define-public linux-libre-lts-version linux-libre-6.18-version)
1550(define-public linux-libre-lts-gnu-revision linux-libre-6.18-gnu-revision)
1551(define-public linux-libre-lts-pristine-source linux-libre-6.18-pristine-source)
1552(define-public linux-libre-lts-source linux-libre-6.18-source)
1553(define-public linux-libre-lts linux-libre-6.18)
1554
1555
1556;;;
1557;;; Specialized kernel variants.
1558;;;
1559
1560(define-public %dummy-linux-kernel-for-container
1561 (hidden-package
1562 (package
1563 (name "linux-dummy")
1564 (version "0.0.0")
1565 (source #f)
1566 (build-system copy-build-system)
1567 (arguments
1568 (list #:phases
1569 #~(modify-phases %standard-phases
1570 (delete 'unpack)
1571 (replace 'install
1572 (lambda _
1573 (mkdir-p #$output))))))
1574 (home-page "")
1575 (synopsis "Dummy Linux kernel for @command{guix system container}")
1576 (description "")
1577 (license #f))))
1578
1579(define-public linux-libre-arm-generic
1580 (make-linux-libre* linux-libre-version
1581 linux-libre-gnu-revision
1582 linux-libre-source
1583 '("armhf-linux")
1584 #:defconfig "multi_v7_defconfig"
1585 #:extra-version "arm-generic"
1586 #:extra-options
1587 (append
1588 `(;; needed to fix the RTC on rockchip platforms
1589 ("CONFIG_RTC_DRV_RK808" . #t))
1590 (default-extra-linux-options linux-libre-version))))
1591
1592(define-public linux-libre-arm-omap2plus
1593 (make-linux-libre* linux-libre-version
1594 linux-libre-gnu-revision
1595 linux-libre-source
1596 '("armhf-linux")
1597 #:defconfig "omap2plus_defconfig"
1598 #:extra-version "arm-omap2plus"))
1599
1600(define pinebook-extra-modules
1601 `(;; Pinebook display, battery, charger and usb
1602 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1603 ("CONFIG_CHARGER_AXP20X" . m)
1604 ("CONFIG_INPUT_AXP20X_PEK" . m)
1605 ("CONFIG_CHARGER_AXP20X" . m)
1606 ("CONFIG_BATTERY_AXP20X" . m)
1607 ("CONFIG_PINCTRL_AXP209" . m)
1608 ("CONFIG_AXP20X_POWER" . m)
1609 ("CONFIG_AXP20X_ADC" . m)
1610 ;; Pinebook PRO battery and sound support
1611 ("CONFIG_BATTERY_CW2015" . m)
1612 ("CONFIG_CHARGER_GPIO" . m)
1613 ("CONFIG_SND_SOC_ES8316" . m)))
1614
1615(define arm64-generic-extra-modules
1616 (append
1617 pinebook-extra-modules
1618 `(;; Provide support for ath9k wireless
1619 ("CONFIG_ATH9K_HTC" . m)
1620 ;; Support Orange Pi R1 Plus LTS ethernet PHY.
1621 ("CONFIG_MOTORCOMM_PHY" . m)
1622 ;; needed to fix the RTC on rockchip platforms
1623 ("CONFIG_RTC_DRV_RK808" . #t))))
1624
1625(define-public linux-libre-arm64-generic
1626 (make-linux-libre* linux-libre-version
1627 linux-libre-gnu-revision
1628 linux-libre-source
1629 '("aarch64-linux")
1630 #:defconfig "defconfig"
1631 #:extra-version "arm64-generic"
1632 #:extra-options
1633 (append
1634 arm64-generic-extra-modules
1635 (default-extra-linux-options linux-libre-version))))
1636
1637(define-public linux-libre-lts-arm64-generic
1638 (if (string=? linux-libre-lts-version linux-libre-version)
1639
1640 ;; Make it a strict alias so that the user interface does not see two
1641 ;; packages with the exact same name and version.
1642 linux-libre-arm64-generic
1643
1644 (make-linux-libre* linux-libre-lts-version
1645 linux-libre-lts-gnu-revision
1646 linux-libre-lts-source
1647 '("aarch64-linux")
1648 #:defconfig "defconfig"
1649 #:extra-version "arm64-generic"
1650 #:extra-options
1651 (append
1652 arm64-generic-extra-modules
1653 (default-extra-linux-options linux-libre-lts-version)))))
1654
1655(define-public linux-libre-arm64-honeycomb
1656 ;; Kernel for use on the HoneyComb LX2 boards:
1657 ;; <https://shop.solid-run.com/product/SRCFTXE000IV13/>.
1658 (make-linux-libre* linux-libre-lts-version
1659 linux-libre-lts-gnu-revision
1660 linux-libre-lts-source
1661 '("aarch64-linux")
1662 #:extra-version "arm64-honeycomb"
1663 #:extra-options
1664 ;; See
1665 ;; https://github.com/SolidRun/lx2160a_build/blob/master/configs/linux/lx2k_additions.config
1666 (append
1667 `(("CONFIG_GPIO_SYSFS" . #true)
1668 ("CONFIG_GPIO_MPC8XXX" . #true)
1669 ("CONFIG_NET_PKTGEN" . #true)
1670 ("CONFIG_USB_SERIAL" . #true)
1671 ("CONFIG_USB_SERIAL_CONSOLE" . #true)
1672 ("CONFIG_USB_SERIAL_GENERIC" . #true)
1673 ("CONFIG_USB_SERIAL_SIMPLE" . #true)
1674 ("CONFIG_USB_SERIAL_FTDI_SIO" . #true)
1675 ("CONFIG_USB_ACM" . #true)
1676 ("CONFIG_USB_NET_DRIVERS" . #true)
1677 ("CONFIG_USB_USBNET" . #true)
1678 ("CONFIG_USB_NET_CDCETHER" . #true)
1679 ("CONFIG_USB_NET_CDC_NCM" . #true)
1680 ("CONFIG_USB_NET_NET1080" . #true)
1681 ("CONFIG_USB_NET_CDC_SUBSET_ENABLE" . #true)
1682 ("CONFIG_USB_NET_CDC_SUBSET" . #true)
1683 ("CONFIG_USB_ARMLINUX" . #true)
1684 ("CONFIG_BLK_DEV_NVME" . #true)
1685 ("CONFIG_NVMEM_BCM_OCOTP" . #true)
1686 ("CONFIG_DRM_AMDGPU" . #true)
1687 ("CONFIG_DRM_AMDGPU_SI" . #true)
1688 ("CONFIG_DRM_AMDGPU_CIK" . #true)
1689 ("CONFIG_DRM_AMDGPU_USERPTR" . #true)
1690 ("CONFIG_DRM_AMD_DC" . #true)
1691 ("CONFIG_CHASH" . #true)
1692 ("CONFIG_PMBUS" . #true)
1693 ("CONFIG_SENSORS_PMBUS" . #true)
1694 ("CONFIG_REGULATOR" . #true)
1695 ("CONFIG_REGULATOR_FIXED_VOLTAGE" . #true)
1696 ("CONFIG_REGULATOR_PWM" . #true)
1697 ("CONFIG_SENSORS_AMC6821" . #true)
1698 ("CONFIG_SENSORS_LM90" . #true)
1699 ("CONFIG_SENSORS_LTC2978" . #true)
1700 ("CONFIG_SENSORS_LTC2978_REGULATOR" . #true)
1701 ("CONFIG_TMPFS" . #true)
1702 ("CONFIG_TMPFS_POSIX_ACL" . #true)
1703 ("CONFIG_TMPFS_XATTR" . #true)
1704 ;;("CONFIG_BLK_DEV_RAM_SIZE" . 524288)
1705 ("CONFIG_POWER_RESET_GPIO" . #true)
1706 ("CONFIG_CRYPTO_USER_API_HASH" . #true)
1707 ("CONFIG_CRYPTO_USER_API_SKCIPHER" . #true)
1708 ("CONFIG_CRYPTO_USER_API_RNG" . #true)
1709 ("CONFIG_CRYPTO_USER_API_AEAD" . #true)
1710
1711 ;; Fixes https://codeberg.org/guix/guix/issues/101
1712 ("CONFIG_KEY_DH_OPERATIONS" . #true)
1713
1714 ;; restool support
1715 ("CONFIG_FSL_MC_UAPI_SUPPORT" . #t)
1716 ("CONFIG_FSL_MC_BUS" . #t)
1717 ("CONFIG_VFIO_FSL_MC" . #t)
1718 ("CONFIG_FSL_MC_DPIO" . #t)
1719 ("CONFIG_ARM_GIC_V3_ITS_FSL_MC" . #t)
1720
1721 ;; vsockets support
1722 ;; TODO This seems to be enabled by default on other
1723 ;; architectures?
1724 ("CONFIG_VSOCKETS" . m)
1725 ("CONFIG_VSOCKETS_DIAG" . m)
1726 ("CONFIG_VSOCKETS_LOOPBACK" . m)
1727 ("CONFIG_VMWARE_VMCI_VSOCKETS" . m)
1728 ("CONFIG_VIRTIO_VSOCKETS" . m)
1729 ("CONFIG_VIRTIO_VSOCKETS_COMMON" . m)
1730 ("CONFIG_HYPERV_VSOCKETS" . m)
1731 ("CONFIG_VHOST_IOTLB" . m)
1732 ("CONFIG_VHOST_RING" . m)
1733 ("CONFIG_VHOST_TASK" . #true)
1734 ("CONFIG_VHOST" . m)
1735 ("CONFIG_VHOST_MENU" . #true)
1736 ("CONFIG_VHOST_NET" . m)
1737 ("CONFIG_VHOST_SCSI" . m)
1738 ("CONFIG_VHOST_VSOCK" . m)
1739 ("CONFIG_VHOST_VDPA" . m))
1740 (default-extra-linux-options linux-libre-lts-version))))
1741
1742(define-public reform-debian-packages-for-7.1
1743 (package
1744 (name "reform-debian-packages")
1745 (version "2023-07-10-688-gc3e9ed6") ;from git describe
1746 (source
1747 (origin
1748 (method git-fetch)
1749 (uri (git-reference
1750 (url "https://source.mnt.re/reform/reform-debian-packages.git")
1751 (commit "c3e9ed6f2dc3b18221dcbfe251d5724f6be83d09")))
1752 (file-name (git-file-name name version))
1753 (sha256
1754 (base32 "138a9jz882mia71gvvhhhhza1kb9vwp1xrmh6r9aj16qqfbzhspj"))))
1755 (build-system copy-build-system)
1756 (arguments
1757 (list
1758 #:install-plan
1759 #~'(("linux/patches7.1/" "/patches7.1")
1760 ("linux/" "/dts/amlogic"
1761 #:include-regexp ("meson.*\\.dts$"))
1762 ("linux/" "/dts/freescale"
1763 #:include-regexp ("imx8.*\\.dts$"))
1764 ("linux/" "/dts/freescale"
1765 #:include-regexp ("fsl.*\\.dts$"))
1766 ("linux/" "/dts/rockchip"
1767 #:include-regexp ("rk3588.*\\.dts$"))
1768 ("linux/" "/dts/qcom"
1769 #:include-regexp ("qcs.*\\.dts$"))
1770 ("linux/" "/dts/qcom"
1771 #:include-regexp ("qcs.*\\.dtsi$"))
1772 ("linux/config" "config"))))
1773 (home-page "https://source.mnt.re/reform/reform-debian-packages")
1774 (synopsis
1775 "Linux kernel patches and device-trees used for MNT Reform systems")
1776 (description
1777 "Linux kernel patches and device-trees used for the MNT Reform systems")
1778 (license (list
1779 (license:fsf-free "file://filter-output"
1780 "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html")
1781 license:bsd-2
1782 license:expat
1783 license:gpl2
1784 license:gpl2+
1785 license:gpl3
1786 license:x11))))
1787
1788(define-public reform-debian-packages-for-6.18
1789 (package
1790 (name "reform-debian-packages")
1791 (version "2023-07-10-525-g7e8a95c") ;from git describe
1792 (source
1793 (origin
1794 (method git-fetch)
1795 (uri (git-reference
1796 (url "https://source.mnt.re/reform/reform-debian-packages.git")
1797 (commit "7e8a95c7babd9e1f4b307b6d146e0846c65fc9b8")))
1798 (file-name (git-file-name name version))
1799 (sha256
1800 (base32 "0g7lm7bfsjn6y77i1gk6wgpmghd36s3axqdqr1ahl9vhzw03cx0g"))))
1801 (build-system copy-build-system)
1802 (arguments
1803 (list
1804 #:install-plan
1805 #~'(("linux/patches6.18/" "/patches6.18")
1806 ("linux/" "/dts/amlogic"
1807 #:include-regexp ("meson.*\\.dts$"))
1808 ("linux/" "/dts/freescale"
1809 #:include-regexp ("imx8.*\\.dts$"))
1810 ("linux/" "/dts/freescale"
1811 #:include-regexp ("fsl.*\\.dts$"))
1812 ("linux/" "/dts/rockchip"
1813 #:include-regexp ("rk3588.*\\.dts$"))
1814 ("linux/config" "config"))))
1815 (home-page "https://source.mnt.re/reform/reform-debian-packages")
1816 (synopsis
1817 "Linux kernel patches and device-trees used for MNT Reform systems")
1818 (description
1819 "Linux kernel patches and device-trees used for the MNT Reform systems")
1820 (license (list
1821 (license:fsf-free "file://filter-output"
1822 "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html")
1823 license:bsd-2
1824 license:expat
1825 license:gpl2
1826 license:gpl2+
1827 license:gpl3
1828 license:x11))))
1829
1830(define-public reform-debian-packages-for-6.12
1831 (package
1832 (name "reform-debian-packages")
1833 (version "2023-07-10-320-gaf0a461") ;from git describe
1834 (source
1835 (origin
1836 (method git-fetch)
1837 (uri (git-reference
1838 (url "https://source.mnt.re/reform/reform-debian-packages.git")
1839 (commit "af0a461d38e13481323f061d9ff6827d1d13873b")))
1840 (file-name (git-file-name name version))
1841 (sha256
1842 (base32 "1cylprld2ri3mprj5cgwla1l8qv9iqqvcra7h64yarzs49zaa16m"))))
1843 (build-system copy-build-system)
1844 (arguments
1845 (list
1846 #:install-plan
1847 #~'(("linux/patches6.12/" "/patches6.12")
1848 ("linux/" "/dts/amlogic"
1849 #:include-regexp ("meson.*\\.dts$"))
1850 ("linux/" "/dts/freescale"
1851 #:include-regexp ("imx8.*\\.dts$"))
1852 ("linux/" "/dts/freescale"
1853 #:include-regexp ("fsl.*\\.dts$"))
1854 ("linux/" "/dts/rockchip"
1855 #:include-regexp ("rk3588.*\\.dts$"))
1856 ("linux/config" "config"))))
1857 (home-page "https://source.mnt.re/reform/reform-debian-packages")
1858 (synopsis
1859 "Linux kernel patches and device-trees used for MNT Reform systems")
1860 (description
1861 "Linux kernel patches and device-trees used for the MNT Reform systems")
1862 (license (list
1863 (license:fsf-free "file://filter-output"
1864 "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html")
1865 license:bsd-2
1866 license:expat
1867 license:gpl2
1868 license:gpl2+
1869 license:gpl3
1870 license:x11))))
1871
1872(define (mnt-reform-kernel-options version)
1873 `(("CONFIG_DRM_LVDS_CODEC" . m)
1874 ("CONFIG_DRM_CDNS_MHDP8546" . m)
1875 ("CONFIG_DRM_CDNS_HDMI_CEC" . m)
1876 ("CONFIG_DRM_IMX_CDNS_MHDP" . m)
1877 ("CONFIG_DRM_IMX_DCSS" . m)
1878 ("CONFIG_PHY_FSL_IMX8MQ_HDPTX" . m)
1879 ("CONFIG_DRM_PANEL_LVDS" . m)
1880 ("CONFIG_I2C_IMX_LPI2C" . m)
1881 ("CONFIG_I2C_MUX_REG" . m)
1882 ("CONFIG_INTERCONNECT_IMX" . #true)
1883 ("CONFIG_INTERCONNECT_IMX8MQ" . #true)
1884 ("CONFIG_MFD_WM8994" . m)
1885 ("CONFIG_MUX_GPIO" . m)
1886 ("CONFIG_MUX_MMIO" . m)
1887 ("CONFIG_RTC_DRV_PCF8523" . m)
1888 ("CONFIG_USB_EHCI_FSL" . m)
1889 ("CONFIG_NO_HZ_IDLE" . #true)
1890 ("CONFIG_SND_SOC_FSL_MICFIL" . m)
1891 ("CONFIG_SND_IMX_SOC" . m)
1892 ("CONFIG_SND_SOC_FSL_ASOC_CARD" . m)
1893 ("CONFIG_SND_SOC_IMX_AUDMIX" . m)
1894 ("CONFIG_SND_SOC_IMX_HDMI" . m)
1895 ("CONFIG_INPUT_JOYSTICK" . #true)
1896 ("CONFIG_JOYSTICK_XPAD" . m)
1897 ("CONFIG_JOYSTICK_XPAD_FF" . #true)
1898 ("CONFIG_JOYSTICK_XPAD_LEDS" . #true)
1899 ("CONFIG_INTERCONNECT_IMX8MP" . #true)
1900 ("CONFIG_SND_SOC_FSL_ASRC" . #true)
1901 ("CONFIG_DRM_IMX_LCDIF" . #true)
1902 ("CONFIG_DRM_IMX8MP_DW_HDMI_BRIDGE" . #true)
1903 ("CONFIG_DRM_IMX8MP_HDMI_PVI" . #true)
1904 ("CONFIG_IMX8MM_THERMAL" . #true)
1905 ("CONFIG_IMX2_WDT" . #true)
1906 ("CONFIG_DRM_SAMSUNG_DSIM" . #true)
1907 ("CONFIG_PHY_FSL_SAMSUNG_HDMI_PHY" . #true)
1908 ("CONFIG_DRM" . m)
1909 ("CONFIG_DRM_PANEL_MNT_POCKET_REFORM" . m)
1910 ("CONFIG_IMX8M_BLK_CTRL" . #true)
1911 ("CONFIG_IMX_GPCV2_PM_DOMAINS" . #true)
1912 ("CONFIG_DRM_DISPLAY_CONNECTOR" . #true)
1913 ("CONFIG_DRM_FSL_LDB" . #true)
1914 ("CONFIG_BACKLIGHT_CLASS_DEVICE" . #true)
1915 ("CONFIG_BACKLIGHT_PWM" . #true)
1916 ("CONFIG_BACKLIGHT_GPIO" . #true)
1917 ("CONFIG_BACKLIGHT_LED" . #true)
1918 ("CONFIG_CPU_FREQ_GOV_PERFORMANCE" . #true)
1919 ("CONFIG_CPU_FREQ_GOV_POWERSAVE" . #true)
1920 ("CONFIG_CPU_FREQ_GOV_USERSPACE" . #true)
1921 ("CONFIG_CPU_FREQ_GOV_ONDEMAND" . #true)
1922 ("CONFIG_CPU_FREQ_GOV_CONSERVATIVE" . #true)
1923 ("CONFIG_CPU_FREQ_GOV_SCHEDUTIL" . #true)
1924 ("CONFIG_ARM_IMX_CPUFREQ_DT" . #true)
1925 ("CONFIG_ARM_IMX_BUS_DEVFREQ" . #true)
1926 ("CONFIG_IMX_IRQSTEER" . #true)
1927 ("CONFIG_PCI_MESON" . #true)
1928 ("CONFIG_DWMAC_MESON" . #true)
1929 ("CONFIG_MDIO_BUS_MUX_MESON_G12A" . m)
1930 ("CONFIG_GPIO_ROCKCHIP" . #true)
1931 ("CONFIG_PL330_DMA" . #true)
1932 ("CONFIG_I2C_MESON" . #true)
1933 ("CONFIG_PWM_MESON" . #true)
1934 ("CONFIG_USB_DWC3_MESON_G12A" . #true)
1935 ("CONFIG_MMC_MESON_GX" . #true)
1936 ("CONFIG_MMC_MESON_MX_SDIO" . #true)
1937 ("CONFIG_MESON_DDR_PMU" . #true)
1938 ("CONFIG_RTW88_8822CS" . m)
1939 ("CONFIG_PWM_FSL_FTM" . #true)
1940 ("CONFIG_FSL_RCPM" . #true)
1941 ("CONFIG_VIDEO_DW100" . m)
1942 ("CONFIG_IMX_AIPSTZ" . m)
1943 ("CONFIG_IMX_DSP" . m)
1944 ("CONFIG_IMX_REMOTEPROC" . m)
1945 ("CONFIG_IMX_DSP_REMOTEPROC" . m)
1946 ("CONFIG_ARM_ROCKCHIP_CPUFREQ" . m)
1947 ("CONFIG_DRM_PANTHOR" . m)
1948 ("CONFIG_NVMEM_ROCKCHIP_OTP" . #true)
1949 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX" . m)
1950 ("CONFIG_PHY_ROCKCHIP_USBDP" . m)
1951 ("CONFIG_ROCKCHIP_REGULATOR_COUPLER" . #true)
1952 ("CONFIG_SPI_ROCKCHIP" . #true)
1953 ("CONFIG_SPI_ROCKCHIP_SFC" . m)
1954 ("CONFIG_ARM_SCMI_CPUFREQ" . m)
1955 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_DCPHY" . #true)
1956 ("CONFIG_VIDEO_ROCKCHIP_VDEC2" . m)
1957 ("CONFIG_ROCKCHIP_DW_HDMI_QP" . #true)
1958 ;; Fixes https://codeberg.org/guix/guix/issues/101
1959 ("CONFIG_CRYPTO_USER_API_HASH" . #true)
1960 ("CONFIG_CRYPTO_USER_API_SKCIPHER" . #true)
1961 ("CONFIG_CRYPTO_USER_API_RNG" . #true)
1962 ("CONFIG_CRYPTO_USER_API_AEAD" . #true)
1963 ("CONFIG_KEY_DH_OPERATIONS" . #true)
1964 ;; nftables support
1965 ("CONFIG_NF_TABLES" . m)
1966 ("CONFIG_NF_TABLES_INET" . #true)
1967 ("CONFIG_NF_TABLES_NETDEV" . #true)
1968 ("CONFIG_NF_TABLES_IPV4" . #true)
1969 ("CONFIG_NF_TABLES_ARP" . #true)
1970 ("CONFIG_NF_TABLES_IPV6" . #true)
1971 ("CONFIG_NF_TABLES_BRIDGE" . m)
1972 ("CONFIG_NFT_NUMGEN" . m)
1973 ("CONFIG_NFT_CT" . m)
1974 ("CONFIG_NFT_FLOW_OFFLOAD" . m)
1975 ("CONFIG_NFT_CONNLIMIT" . m)
1976 ("CONFIG_NFT_LOG" . m)
1977 ("CONFIG_NFT_LIMIT" . m)
1978 ("CONFIG_NFT_MASQ" . m)
1979 ("CONFIG_NFT_REDIR" . m)
1980 ("CONFIG_NFT_NAT" . m)
1981 ("CONFIG_NFT_TUNNEL" . m)
1982 ("CONFIG_NFT_QUEUE" . m)
1983 ("CONFIG_NFT_QUOTA" . m)
1984 ("CONFIG_NFT_REJECT" . m)
1985 ("CONFIG_NFT_REJECT_INET" . m)
1986 ("CONFIG_NFT_COMPAT" . m)
1987 ("CONFIG_NFT_HASH" . m)
1988 ("CONFIG_NFT_FIB" . m)
1989 ("CONFIG_NFT_FIB_INET" . m)
1990 ("CONFIG_NFT_XFRM" . m)
1991 ("CONFIG_NFT_SOCKET" . m)
1992 ("CONFIG_NFT_OSF" . m)
1993 ("CONFIG_NFT_TPROXY" . m)
1994 ("CONFIG_NFT_SYNPROXY" . m)
1995 ("CONFIG_NFT_DUP_NETDEV" . m)
1996 ("CONFIG_NFT_FWD_NETDEV" . m)
1997 ("CONFIG_NFT_FIB_NETDEV" . m)
1998 ("CONFIG_NFT_REJECT_NETDEV" . m)
1999 ("CONFIG_NFT_REJECT_IPV4" . m)
2000 ("CONFIG_NFT_DUP_IPV4" . m)
2001 ("CONFIG_NFT_FIB_IPV4" . m)
2002 ("CONFIG_NFT_COMPAT_ARP" . m)
2003 ("CONFIG_NFT_REJECT_IPV6" . m)
2004 ("CONFIG_NFT_DUP_IPV6" . m)
2005 ("CONFIG_NFT_FIB_IPV6" . m)
2006 ("CONFIG_NFT_BRIDGE_META" . m)
2007 ("CONFIG_NFT_BRIDGE_REJECT" . m)
2008 ;; Provides support for FBCON options
2009 ("CONFIG_FRAMEBUFFER_CONSOLE_ROTATION" . #true)
2010 ("CONFIG_HIDRAW" . #true)
2011 ("CONFIG_FONT_SUPPORT" . #true)
2012 ("CONFIG_FONTS" . #true)
2013 ("CONFIG_FONT_8x8" . #true)
2014 ("CONFIG_FONT_8x16" . #true)
2015 ("CONFIG_FONT_TER10x18" . #true)
2016 ("CONFIG_FONT_TER16x32" . #true)
2017 ;; Provide support for USB tethering
2018 ("CONFIG_USB_NET_CDC_EEM" . m)
2019 ("CONFIG_USB_NET_RNDIS_HOST" . m)
2020 ("CONFIG_USB_WDM" . m)
2021 ("CONFIG_USB_GADGET" . m)
2022 ("CONFIG_USB_ETH" . m)
2023 ("CONFIG_USB_ETH_RNDIS" . m)
2024 ("CONFIG_USB_ETH_EEM" . m)
2025 ("CONFIG_USB_G_NCM" . m)
2026 ;; Provide support for ath9k wireless
2027 ("CONFIG_ATH9K" . m)
2028 ("CONFIG_ATH9K_HTC" . m)
2029 ;; vsockets support
2030 ("CONFIG_VSOCKETS" . m)
2031 ("CONFIG_VSOCKETS_DIAG" . m)
2032 ("CONFIG_VSOCKETS_LOOPBACK" . m)
2033 ("CONFIG_VMWARE_VMCI_VSOCKETS" . m)
2034 ("CONFIG_VIRTIO_VSOCKETS" . m)
2035 ("CONFIG_VIRTIO_VSOCKETS_COMMON" . m)
2036 ("CONFIG_HYPERV_VSOCKETS" . m)
2037 ,@(if (version>=? version "6.18")
2038 '(("CONFIG_ROCKCHIP_DW_MIPI_DSI2" . #true))
2039 ;; 6.12 or older gets this instead:
2040 '(("CONFIG_ROCKCHIP_INNO_HDMI" . #true)
2041 ("CONFIG_ROCKCHIP_LVDS" . #true)
2042 ("CONFIG_ROCKCHIP_DW_MIPI_DSI" . #true)))
2043 ,@(if (version>=? version "7.1")
2044 '( ;; QCOM cpu module
2045 ("CONFIG_INTERCONNECT_QCOM_SM8550" . #true)
2046 ("CONFIG_PINCTRL_SM8550" . #true)
2047 ("CONFIG_PINCTRL_SM8550_LPASS_LPI" . #true)
2048 ("CONFIG_SM_CAMCC_8550" . #true)
2049 ("CONFIG_SM_GCC_8550" . #true)
2050 ("CONFIG_SM_GPUCC_8550" . #true)
2051 ("CONFIG_SM_TCSRCC_8550" . #true)
2052 ("CONFIG_SM_VIDEOCC_8550" . #true)
2053 ("CONFIG_SM_DISPCC_8550" . #true)
2054 ("CONFIG_USB_QCOM_EUD" . #true)
2055 ("CONFIG_SPMI_PMIC_CLKDIV" . #true)
2056 ("CONFIG_INTERCONNECT_QCOM_SM8750" . #true)
2057 ("CONFIG_PINCTRL_SM8750" . #true)
2058 ("CONFIG_SM_TCSRCC_8750" . #true)
2059 ("CONFIG_REGULATOR_QCOM_REFGEN" . m)
2060 ("CONFIG_MNTRE_SC" . m))
2061 '())))
2062
2063(define-public linux-libre-arm64-mnt-reform-7.1
2064 ;; Kernel for use on the MNT/Reform systems
2065 ;; https://mntre.com/reform.html
2066 (let ((base (make-linux-libre* linux-libre-7.1-version
2067 linux-libre-7.1-gnu-revision
2068 linux-libre-7.1-source
2069 '("aarch64-linux")
2070 #:extra-version "arm64-mnt-reform"
2071 #:extra-options
2072 ;; https://source.mnt.re/reform/reform-debian-packages/-/blob/main/linux/config
2073 (append (mnt-reform-kernel-options
2074 linux-libre-7.1-version)
2075 (default-extra-linux-options
2076 linux-libre-7.1-version)))))
2077 (package
2078 (inherit base)
2079 (inputs (list reform-debian-packages-for-7.1))
2080 (synopsis (string-append (package-synopsis base)
2081 " for MNT/Reform systems"))
2082 (description (string-append (package-description base)
2083 " Configuration options and patches have been applied for use with MNT/Reform systems."))
2084 (arguments
2085 (substitute-keyword-arguments (package-arguments base)
2086 ((#:phases phases)
2087 #~(modify-phases #$phases
2088 (add-after 'unpack 'apply-reform-patches
2089 (lambda* (#:key inputs #:allow-other-keys)
2090 (for-each (lambda (patch)
2091 (invoke "patch" "-p1" "-i"
2092 (search-input-file inputs
2093 (string-append
2094 "patches7.1/" patch))))
2095 (list
2096 "imx8mp-mnt-pocket-reform/2ghz/0001-imx8mp-2ghz-clk.patch"
2097 "imx8mp-mnt-pocket-reform/2ghz/0002-imx8mp-2ghz-opp.patch"
2098 "imx8mp-mnt-pocket-reform/mmc-sdio/0001-sdhci-add-no-sd-uhs-sdr104-devicetree-property.patch"
2099 "imx8mp-mnt-pocket-reform/mmc-sdio/0002-During-the-card-init-the-host-side-sometimes-may-nee.patch"
2100 "imx8mp-mnt-pocket-reform/mmc-sdio/0003-USDHC-IP-has-one-limitation-the-tuning-circuit-can-t.patch"
2101 "imx8mp-mnt-pocket-reform/pocket-panel/0001-v5-add-multi-display-panel-driver.patch"
2102 "imx8mp-mnt-reform2/0001-sn65dsi86-use-hs-clock-of-samsung-dsim-host-directly.patch"
2103 "imx8mp-mnt-reform2/0002-lcdif-dont-exceed-desired-pixel-clock.patch"
2104 "imx8mq-mnt-reform2/0001-imx8mq-mnt-reform2.dts-multiple-fixes-for-display-wi.patch"
2105 "imx8mq-mnt-reform2/0001-nwl-dsi-fixup-mode-only-for-LCDIF-input-not-DCSS.patch"
2106 "imx8mq-mnt-reform2/0002-Revert-drm-bridge-nwl-dsi-Use-vsync-hsync-polarity-f.patch"
2107 "imx8mq-mnt-reform2/0003-lcdif-fix-pcie-interference.patch"
2108 "imx8mq-mnt-reform2/0004-mnt4002-imx-gpcv2-wake-smccc.patch.patch"
2109 "imx8mq-mnt-reform2/0005-pci-imx6-add-support-for-internal-refclk-imx8mq.patch"
2110 "imx8mq-mnt-reform2/0006-imx8mq-import-HDMI-driver-and-make-DCSS-compatible-w.patch"
2111 "ls1028a-mnt-reform2/0000-dtsi-add-hdptx.patch"
2112 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0001-a311d-viu-fifo-lines-config.patch"
2113 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0002-a311d-viu-fifo-lines-config-header.patch"
2114 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0003-tlv320aic31xx-add-1228800hz-support.patch"
2115 "meson-g12b-bananapi-cm4-mnt-reform2/0001-Revert-drm-bridge-synopsys-dw-mipi-dsi-enable-EoTp-b.patch"
2116 "meson-g12b-bananapi-cm4-mnt-reform2/0001-meson-g12b-bananapi-cm4-mnt-reform2.dts-fix-audio-an.patch"
2117 "meson-g12b-bananapi-cm4-mnt-reform2/0011-dw-mipi-dsi-phy-stop-wait-time.patch"
2118 "meson-g12b-bananapi-cm4-mnt-reform2/0012-innolux-n125hce-gn1-timing-tweaks.patch"
2119 "meson-g12b-bananapi-cm4-mnt-reform2/0013-meson-viu-hold-fifo-lines.patch"
2120 "meson-g12b-bananapi-cm4-mnt-reform2/0014-meson-venc-sync.patch.patch"
2121 "meson-g12b-bananapi-cm4-mnt-reform2/0015-meson-dw-mipi-dsi-sync-invert.patch"
2122 "meson-g12b-bananapi-cm4-mnt-reform2/0016-sn65dsi86-burst-mode-support.patch"
2123 "meson-g12b-bananapi-cm4-mnt-reform2/0018-sn65dsi86-never-turn-off.patch"
2124 "meson-g12b-bananapi-cm4-mnt-reform2/0020-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch"
2125 "meson-g12b-bananapi-cm4-mnt-reform2/0021-HACK-of-partial-revert-of-fdt.c-changes.patch"
2126 "meson-g12b-bananapi-cm4-mnt-reform2/0022-add-bt-and-eth-resets.patch"
2127 "meson-g12b-bananapi-cm4-mnt-reform2/0023-sdio-pullups.patch"
2128 "meson-g12b-bananapi-cm4-mnt-reform2/0024-sdio-improve-wifi-speed.patch"
2129 "meson-g12b-bananapi-cm4-mnt-reform2/0030-WORKAROUND-meson-plane-disable-afbc-32x8.patch"
2130 "qcom-mnt-reform2/3001-casey-aux-bridge-defer.patch"
2131 "qcom-mnt-reform2/3003-casey-lpass-sc7280-audio-hacks.patch"
2132 "qcom-mnt-reform2/4000-qcom-pci-d3cold.patch"
2133 "qcom-mnt-reform2/4001-qcom-pci-d3cold-2.patch"
2134 "qcom-mnt-reform2/4002-qcom-pci-get-ltssm.patch"
2135 "qcom-mnt-reform2/4003-qcom-pci-power-down-phy-via-parf.patch"
2136 "qcom-mnt-reform2/4004-qcom-pci-add-d3cold.patch"
2137 "qcom-mnt-reform2/5000-tlv320aic31xx-mclk-fallback.patch"
2138 "qcom-mnt-reform2/5010-asoc_qcom_qdsp6_q6prm_add_the_missing_mclk_clock_ids.patch"
2139 "qcom-mnt-reform2/5011-sc8280xp-add-support-for-I2S-clocks.patch"
2140 "rk3588-mnt-reform2/0024-math.h-add-DIV_ROUND_UP_NO_OVERFLOW.patch"
2141 "rk3588-mnt-reform2/0025-clk-divider-Fix-divisor-masking-on-64-bit-platforms.patch"
2142 "rk3588-mnt-reform2/0026-clk-composite-replace-open-coded-abs_diff.patch"
2143 "rk3588-mnt-reform2/0029-PCI-dw-rockchip-Restore-vpcie3v3-regulator-handle.patch"
2144 "rk3588-mnt-reform2/0030-mfd-rk8xx-Fix-shutdown-handler.patch"
2145 "rk3588-mnt-reform2/0031-dt-bindings-display-vop2-Add-VP-clock-resets.patch"
2146 "rk3588-mnt-reform2/0032-drm-rockchip-vop2-Add-clock-resets-support.patch"
2147 "rk3588-mnt-reform2/0033-arm64-dts-rockchip-Add-VOP-clock-resets-for-rk3588s.patch"
2148 "rk3588-mnt-reform2/0035-drm-rockchip-vop2-Add-core-reset-support.patch"
2149 "rk3588-mnt-reform2/0062-PCI-dw-rockchip-Move-devm_phy_get-out-of-phy_init.patch"
2150 "rk3588-mnt-reform2/0063-PCI-dw-rockchip-Add-helper-function-for-enhanced-LTS.patch"
2151 "rk3588-mnt-reform2/0064-PCI-dw-rockchip-Add-helper-function-for-controller-m.patch"
2152 "rk3588-mnt-reform2/0065-PCI-dw-rockchip-Add-helper-function-for-DDL-indicato.patch"
2153 "rk3588-mnt-reform2/0066-PCI-dw-rockchip-Add-pme_turn_off-support.patch"
2154 "rk3588-mnt-reform2/0067-PCI-dw-rockchip-Add-system-PM-support.patch"
2155 "rk3588-mnt-reform2/0078-PCI-dw-rockchip-Fix-LTSSM-set-functions.patch"
2156 "rk3588-mnt-reform2/0079-RFC-PCI-dw-rockchip-port-some-suspend-code-from-vend.patch"
2157 "rk3588-mnt-reform2/0089-DEBUG-phy-rockchip-samsung-hdptx-Add-verbose-logging.patch"
2158 "rk3588-mnt-reform2/0092-drm-rockchip-dw_hdmi_qp-Restrict-HPD-event-to-the-af.patch"
2159 "rk3588-mnt-reform2/0094-drm-bridge-connector-Use-cached-connector-status-in-.patch"
2160 "rk3588-mnt-reform2/0095-drm-bridge-Add-detect_ctx-hook-and-drm_bridge_detect.patch"
2161 "rk3588-mnt-reform2/0096-drm-bridge-connector-Switch-to-.detect_ctx-for-conne.patch"
2162 "rk3588-mnt-reform2/0097-drm-bridge-dw-hdmi-qp-Add-HDMI-2.0-SCDC-scrambling-a.patch"
2163 "rk3588-mnt-reform2/0108-dt-bindings-phy-rockchip-usbdp-add-improved-ports-sc.patch"
2164 "rk3588-mnt-reform2/2001-drm-bridge-dw-hdmi-qp-Return-0-in-audio-prepare-when.patch"
2165 "rk3588-mnt-reform2/2003-drm-bridge-synopsys-Do-not-warn-about-audio-params-c.patch"
2166 "rk3588-mnt-reform2/5200-drm-rockchip-Set-dma-mask-to-64-bit.patch"
2167 "rk3588-mnt-reform2/6000-loosen-mnt-reform2-edp-panel-timing.patch"
2168 "rk3588-mnt-reform2/7000-mnt-analogix-dp-changes-for-usb-c-alt-mode.patch"
2169 "sc/1000-mnt-sc-driver.patch"))))
2170 (add-after 'apply-reform-patches 'copy-reform-dts-files
2171 (lambda* (#:key inputs #:allow-other-keys)
2172 (for-each (lambda (dts)
2173 (copy-file (search-input-file inputs
2174 (string-append
2175 "/dts/" dts))
2176 (string-append "arch/arm64/boot/dts/"
2177 dts)))
2178 (list
2179 "amlogic/meson-g12b-bananapi-cm4-mnt-pocket-reform.dts"
2180 "freescale/fsl-ls1028a-mnt-reform2.dts"
2181 "freescale/imx8mp-mnt-pocket-reform.dts"
2182 "freescale/imx8mp-mnt-reform2.dts"
2183 "freescale/imx8mq-mnt-reform2-hdmi.dts"
2184 "rockchip/rk3588-mnt-station.dts"
2185 "rockchip/rk3588-mnt-pocket-reform.dts"
2186 "rockchip/rk3588-mnt-reform-next.dts"
2187 "rockchip/rk3588-mnt-reform2.dts"
2188 "rockchip/rk3588-mnt-reform2-dsi.dts"
2189 "qcom/qcs6490-mnt-quasar.dtsi"
2190 "qcom/qcs6490-mnt-reform2.dts"
2191 "qcom/qcs6490-mnt-pocket-reform.dts"
2192 "qcom/qcs6490-mnt-reform-next.dts"
2193 "qcom/qcs8550-mnt-reform2.dts"
2194 "qcom/qcs8550-mnt-pocket-reform.dts"
2195 "qcom/qcs8550-mnt-reform-next.dts"))))
2196 (add-after 'apply-reform-patches 'adjust-makefiles-with-new-dtb
2197 (lambda _
2198 (substitute* "arch/arm64/boot/dts/amlogic/Makefile"
2199 (("meson-g12b-bananapi-cm4-mnt-reform2.dtb")
2200 "meson-g12b-bananapi-cm4-mnt-reform2.dtb
2201dtb-$(CONFIG_ARCH_MESON) += meson-g12b-bananapi-cm4-mnt-pocket-reform.dtb"))
2202 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2203 (("fsl-ls1028a-rdb.dtb")
2204 "fsl-ls1028a-rdb.dtb
2205dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-mnt-reform2.dtb"))
2206 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2207 (("imx8mq-mnt-reform2.dtb")
2208 "imx8mq-mnt-reform2.dtb
2209dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-reform2.dtb
2210dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-pocket-reform.dtb
2211dtb-$(CONFIG_ARCH_MXC) += imx8mq-mnt-reform2-hdmi.dtb"))
2212 (substitute* "arch/arm64/boot/dts/rockchip/Makefile"
2213 (("rk3588-mnt-reform2.dtb")
2214 "rk3588-mnt-reform2.dtb
2215dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-station.dts
2216dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform2-dsi.dtb
2217dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform-next.dtb
2218dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-pocket-reform.dtb"))
2219 (substitute* "arch/arm64/boot/dts/qcom/Makefile"
2220 (("= qcs6490-rb3gen2-vision-mezzanine.dtb")
2221 "= qcs6490-rb3gen2-vision-mezzanine.dtb
2222dtb-$(CONFIG_ARCH_QCOM) += qcs6490-mnt-reform2.dtb
2223dtb-$(CONFIG_ARCH_QCOM) += qcs6490-mnt-pocket-reform.dtb
2224dtb-$(CONFIG_ARCH_QCOM) += qcs6490-mnt-reform-next.dtb")
2225 (("qcs8550-aim300-aiot.dtb")
2226 "qcs8550-aim300-aiot.dtb
2227dtb-$(CONFIG_ARCH_QCOM) += qcs8550-mnt-reform2.dtb
2228dtb-$(CONFIG_ARCH_QCOM) += qcs8550-mnt-pocket-reform.dtb
2229dtb-$(CONFIG_ARCH_QCOM) += qcs8550-mnt-reform-next.dtb")))))))))))
2230
2231(define-public linux-libre-arm64-mnt-reform linux-libre-arm64-mnt-reform-7.1)
2232
2233(define-public linux-libre-arm64-mnt-reform-6.18
2234 ;; Kernel for use on the MNT/Reform systems
2235 ;; https://mntre.com/reform.html
2236 (let ((base (make-linux-libre* linux-libre-6.18-version
2237 linux-libre-6.18-gnu-revision
2238 linux-libre-6.18-source
2239 '("aarch64-linux")
2240 #:extra-version "arm64-mnt-reform"
2241 #:extra-options
2242 ;; https://source.mnt.re/reform/reform-debian-packages/-/blob/main/linux/config
2243 (append (mnt-reform-kernel-options
2244 linux-libre-6.18-version)
2245 (default-extra-linux-options
2246 linux-libre-6.18-version)))))
2247 (package
2248 (inherit base)
2249 (inputs (list reform-debian-packages-for-6.18))
2250 (synopsis (string-append (package-synopsis base)
2251 " for MNT/Reform systems"))
2252 (description (string-append (package-description base)
2253 " Configuration options and patches have been applied for use with MNT/Reform systems."))
2254 (arguments
2255 (substitute-keyword-arguments arguments
2256 ((#:phases phases)
2257 #~(modify-phases #$phases
2258 (add-after 'unpack 'apply-reform-patches
2259 (lambda* (#:key inputs #:allow-other-keys)
2260 (for-each (lambda (patch)
2261 (invoke "patch" "-p1" "-i"
2262 (search-input-file inputs
2263 (string-append
2264 "patches6.18/" patch))))
2265 (list
2266 "imx8mp-mnt-pocket-reform/2ghz/0001-imx8mp-2ghz-clk.patch"
2267 "imx8mp-mnt-pocket-reform/2ghz/0002-imx8mp-2ghz-opp.patch"
2268 "imx8mp-mnt-pocket-reform/audio/0000-revert-crashy-audiomix-pm-support.patch"
2269 "imx8mp-mnt-pocket-reform/mmc-sdio/0001-sdhci-add-no-sd-uhs-sdr104-devicetree-property.patch"
2270 "imx8mp-mnt-pocket-reform/mmc-sdio/0002-During-the-card-init-the-host-side-sometimes-may-nee.patch"
2271 "imx8mp-mnt-pocket-reform/mmc-sdio/0003-USDHC-IP-has-one-limitation-the-tuning-circuit-can-t.patch"
2272 "imx8mp-mnt-pocket-reform/pocket-panel/0001-v5-add-multi-display-panel-driver.patch"
2273 "imx8mp-mnt-pocket-reform/pocket-panel/0002-pocket-panel-fix-sleep-add-orientation.patch"
2274 "imx8mp-mnt-reform2/0001-sn65dsi86-use-hs-clock-of-samsung-dsim-host-directly.patch"
2275 "imx8mp-mnt-reform2/0002-lcdif-dont-exceed-desired-pixel-clock.patch"
2276 "imx8mq-mnt-reform2/0001-imx8mq-mnt-reform2.dts-multiple-fixes-for-display-wi.patch"
2277 "imx8mq-mnt-reform2/0001-nwl-dsi-fixup-mode-only-for-LCDIF-input-not-DCSS.patch"
2278 "imx8mq-mnt-reform2/0002-Revert-drm-bridge-nwl-dsi-Use-vsync-hsync-polarity-f.patch"
2279 "imx8mq-mnt-reform2/0003-lcdif-fix-pcie-interference.patch"
2280 "imx8mq-mnt-reform2/0004-mnt4002-imx-gpcv2-wake-smccc.patch.patch"
2281 "imx8mq-mnt-reform2/0005-pci-imx6-add-support-for-internal-refclk-imx8mq.patch"
2282 "imx8mq-mnt-reform2/0006-imx8mq-import-HDMI-driver-and-make-DCSS-compatible-w.patch"
2283 "ls1028a-mnt-reform2/0000-dtsi-add-hdptx.patch"
2284 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0001-a311d-viu-fifo-lines-config.patch"
2285 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0002-a311d-viu-fifo-lines-config-header.patch"
2286 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0003-tlv320aic31xx-add-1228800hz-support.patch"
2287 "meson-g12b-bananapi-cm4-mnt-reform2/0001-meson-g12b-bananapi-cm4-mnt-reform2.dts-fix-audio-an.patch"
2288 "meson-g12b-bananapi-cm4-mnt-reform2/0001-Revert-drm-bridge-synopsys-dw-mipi-dsi-enable-EoTp-b.patch"
2289 "meson-g12b-bananapi-cm4-mnt-reform2/0011-dw-mipi-dsi-phy-stop-wait-time.patch"
2290 "meson-g12b-bananapi-cm4-mnt-reform2/0012-innolux-n125hce-gn1-timing-tweaks.patch"
2291 "meson-g12b-bananapi-cm4-mnt-reform2/0013-meson-viu-hold-fifo-lines.patch"
2292 "meson-g12b-bananapi-cm4-mnt-reform2/0014-meson-venc-sync.patch.patch"
2293 "meson-g12b-bananapi-cm4-mnt-reform2/0015-meson-dw-mipi-dsi-sync-invert.patch"
2294 "meson-g12b-bananapi-cm4-mnt-reform2/0016-sn65dsi86-burst-mode-support.patch"
2295 "meson-g12b-bananapi-cm4-mnt-reform2/0018-sn65dsi86-never-turn-off.patch"
2296 "meson-g12b-bananapi-cm4-mnt-reform2/0020-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch"
2297 "meson-g12b-bananapi-cm4-mnt-reform2/0021-HACK-of-partial-revert-of-fdt.c-changes.patch"
2298 "meson-g12b-bananapi-cm4-mnt-reform2/0022-add-bt-and-eth-resets.patch"
2299 "meson-g12b-bananapi-cm4-mnt-reform2/0023-sdio-pullups.patch"
2300 "meson-g12b-bananapi-cm4-mnt-reform2/0024-sdio-improve-wifi-speed.patch"
2301 "meson-g12b-bananapi-cm4-mnt-reform2/0030-WORKAROUND-meson-plane-disable-afbc-32x8.patch"
2302 "rk3588-mnt-reform2/0001-MERGED-drm-bridge-Pass-down-connector-to-drm-bridge-.patch"
2303 "rk3588-mnt-reform2/0024-math.h-add-DIV_ROUND_UP_NO_OVERFLOW.patch"
2304 "rk3588-mnt-reform2/0025-clk-divider-Fix-divisor-masking-on-64-bit-platforms.patch"
2305 "rk3588-mnt-reform2/0026-clk-composite-replace-open-coded-abs_diff.patch"
2306 "rk3588-mnt-reform2/0030-mfd-rk8xx-Fix-shutdown-handler.patch"
2307 "rk3588-mnt-reform2/0031-dt-bindings-display-vop2-Add-VP-clock-resets.patch"
2308 "rk3588-mnt-reform2/0032-drm-rockchip-vop2-Add-clock-resets-support.patch"
2309 "rk3588-mnt-reform2/0033-arm64-dts-rockchip-Add-VOP-clock-resets-for-rk3588s.patch"
2310 "rk3588-mnt-reform2/0035-drm-rockchip-vop2-Add-core-reset-support.patch"
2311 "rk3588-mnt-reform2/0046-arm64-defconfig-Enable-Rockchip-RK3588-DisplayPort-C.patch"
2312 "rk3588-mnt-reform2/0055-phy-rockchip-usbdp-move-orientation-handling-further.patch"
2313 "rk3588-mnt-reform2/0056-phy-rockchip-usbdp-reset-USB3-and-reinit-on-orientat.patch"
2314 ;; "rk3588-mnt-reform2/0060-PCI-dw-rockchip-Rename-rockchip_pcie_get_ltssm-funct.patch"
2315 ;; "rk3588-mnt-reform2/0061-PCI-dw-rockchip-Support-get_ltssm-operation.patch"
2316 ;; "rk3588-mnt-reform2/0062-PCI-dw-rockchip-Move-devm_phy_get-out-of-phy_init.patch"
2317 ;; "rk3588-mnt-reform2/0063-PCI-dw-rockchip-Add-helper-function-for-enhanced-LTS.patch"
2318 ;; "rk3588-mnt-reform2/0064-PCI-dw-rockchip-Add-helper-function-for-controller-m.patch"
2319 ;; "rk3588-mnt-reform2/0065-PCI-dw-rockchip-Add-helper-function-for-DDL-indicato.patch"
2320 ;; "rk3588-mnt-reform2/0066-PCI-dw-rockchip-Add-pme_turn_off-support.patch"
2321 ;; "rk3588-mnt-reform2/0067-PCI-dw-rockchip-Add-system-PM-support.patch"
2322 "rk3588-mnt-reform2/0068-drm-bridge-dw-hdmi-qp-Add-CEC-support.patch"
2323 "rk3588-mnt-reform2/0069-drm-bridge-dw-hdmi-qp-Fixup-timer-base-setup.patch"
2324 "rk3588-mnt-reform2/0070-drm-rockchip-dw_hdmi_qp-Improve-error-handling-with-.patch"
2325 "rk3588-mnt-reform2/0071-drm-rockchip-dw_hdmi_qp-Provide-CEC-IRQ-in-dw_hdmi_q.patch"
2326 "rk3588-mnt-reform2/0072-drm-rockchip-dw_hdmi_qp-Provide-ref-clock-rate-in-dw.patch"
2327 "rk3588-mnt-reform2/0073-arm64-defconfig-Enable-DW-HDMI-QP-CEC-support.patch"
2328 "rk3588-mnt-reform2/0075-phy-hdmi-Add-HDMI-2.1-FRL-configuration-options.patch"
2329 "rk3588-mnt-reform2/0079-phy-rockchip-samsung-hdptx-Use-usleep_range-instead-.patch"
2330 "rk3588-mnt-reform2/0080-phy-rockchip-samsung-hdptx-Fix-coding-style-alignmen.patch"
2331 "rk3588-mnt-reform2/0081-phy-rockchip-samsung-hdptx-Consistently-use-rk_-hdpt.patch"
2332 "rk3588-mnt-reform2/0082-phy-rockchip-samsung-hdptx-Enable-lane-output-in-com.patch"
2333 "rk3588-mnt-reform2/0083-phy-rockchip-samsung-hdptx-Cleanup-_cmn_init_seq-lis.patch"
2334 "rk3588-mnt-reform2/0084-phy-rockchip-samsung-hdptx-Compute-clk-rate-from-PLL.patch"
2335 "rk3588-mnt-reform2/0085-phy-rockchip-samsung-hdptx-Drop-hw_rate-driver-data.patch"
2336 "rk3588-mnt-reform2/0086-phy-rockchip-samsung-hdptx-Switch-to-driver-specific.patch"
2337 "rk3588-mnt-reform2/0087-phy-rockchip-samsung-hdptx-Extend-rk_hdptx_phy_verif.patch"
2338 "rk3588-mnt-reform2/0088-phy-rockchip-samsung-hdptx-Add-HDMI-2.1-FRL-support.patch"
2339 "rk3588-mnt-reform2/0089-drm-rockchip-vop2-Check-bpc-before-switching-DCLK-so.patch"
2340 "rk3588-mnt-reform2/0090-drm-bridge-dw-hdmi-qp-Handle-platform-supported-form.patch"
2341 "rk3588-mnt-reform2/0091-drm-rockchip-dw_hdmi_qp-Switch-to-phy_configure.patch"
2342 "rk3588-mnt-reform2/0092-drm-rockchip-dw_hdmi_qp-Use-bit-macros-for-RK3576-re.patch"
2343 "rk3588-mnt-reform2/0093-drm-rockchip-dw_hdmi_qp-Add-high-color-depth-support.patch"
2344 "rk3588-mnt-reform2/0094-DEBUG-phy-rockchip-samsung-hdptx-Add-verbose-logging.patch"
2345 "rk3588-mnt-reform2/0095-WIP-SCRAMB-drm-bridge-Add-detect_ctx-hook.patch"
2346 "rk3588-mnt-reform2/0096-WIP-SCRAMB-drm-bridge-connector-Switch-from-detect-t.patch"
2347 "rk3588-mnt-reform2/0097-WIP-SCRAMB-drm-bridge-dw-hdmi-qp-Add-high-TMDS-clock.patch"
2348 "rk3588-mnt-reform2/0098-WIP-YUV420-drm-rockchip-vop2-Add-YUV420-output-forma.patch"
2349 "rk3588-mnt-reform2/0099-WIP-YUV420-drm-rockchip-dw_hdmi_qp-Add-YUV420-output.patch"
2350 "rk3588-mnt-reform2/0100-WIP-FRL-dt-bindings-display-rockchip-Add-tmds-enable.patch"
2351 "rk3588-mnt-reform2/0101-WIP-FRL-drm-rockchip-dw_hdmi_qp-Fixup-usage-of-enabl.patch"
2352 "rk3588-mnt-reform2/0103-WIP-FRL-arm64-dts-rockchip-Assign-ACLK_VOP-to-750-MH.patch"
2353 "rk3588-mnt-reform2/0104-WIP-FRL-drm-connector-hdmi-Handle-FRL-in-hdmi_clock_.patch"
2354 "rk3588-mnt-reform2/0105-WIP-FRL-drm-bridge-dw-hdmi-qp-Add-HDMI-2.1-FRL-suppo.patch"
2355 "rk3588-mnt-reform2/0106-WIP-FRL-drm-rockchip-dw_hdmi_qp-Add-HDMI-2.1-FRL-sup.patch"
2356 "rk3588-mnt-reform2/0107-WIP-FRL-drm-rockchip-vop2-Add-HDMI-2.1-FRL-support.patch"
2357 "rk3588-mnt-reform2/0108-dt-bindings-phy-rockchip-usbdp-add-improved-ports-sc.patch"
2358 "rk3588-mnt-reform2/0114-media-dt-bindings-video-interfaces-add-defines-for-s.patch"
2359 "rk3588-mnt-reform2/2001-drm-bridge-dw-hdmi-qp-Return-0-in-audio-prepare-when.patch"
2360 "rk3588-mnt-reform2/2003-drm-bridge-synopsys-Do-not-warn-about-audio-params-c.patch"
2361 "rk3588-mnt-reform2/5200-drm-rockchip-Set-dma-mask-to-64-bit.patch"
2362 "rk3588-mnt-reform2/7001-PCI-dw-rockchip-Disable-root-port-BARs.patch"))))
2363 (add-after 'apply-reform-patches 'copy-reform-dts-files
2364 (lambda* (#:key inputs #:allow-other-keys)
2365 (for-each (lambda (dts)
2366 (copy-file (search-input-file inputs
2367 (string-append
2368 "/dts/" dts))
2369 (string-append "arch/arm64/boot/dts/"
2370 dts)))
2371 (list
2372 "amlogic/meson-g12b-bananapi-cm4-mnt-pocket-reform.dts"
2373 "freescale/fsl-ls1028a-mnt-reform2.dts"
2374 "freescale/imx8mp-mnt-pocket-reform.dts"
2375 "freescale/imx8mp-mnt-reform2.dts"
2376 "freescale/imx8mq-mnt-reform2-hdmi.dts"
2377 "rockchip/rk3588-mnt-desktop-reform.dts"
2378 "rockchip/rk3588-mnt-pocket-reform.dts"
2379 "rockchip/rk3588-mnt-reform-next.dts"
2380 "rockchip/rk3588-mnt-reform2.dts"
2381 "rockchip/rk3588-mnt-reform2-dsi.dts"
2382 ))))
2383 (add-after 'apply-reform-patches 'adjust-makefiles-with-new-dtb
2384 (lambda _
2385 (substitute* "arch/arm64/boot/dts/amlogic/Makefile"
2386 (("meson-g12b-bananapi-cm4-mnt-reform2.dtb")
2387 "meson-g12b-bananapi-cm4-mnt-reform2.dtb
2388dtb-$(CONFIG_ARCH_MESON) += meson-g12b-bananapi-cm4-mnt-pocket-reform.dtb"))
2389 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2390 (("fsl-ls1028a-rdb.dtb")
2391 "fsl-ls1028a-rdb.dtb
2392dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-mnt-reform2.dtb"))
2393 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2394 (("imx8mq-mnt-reform2.dtb")
2395 "imx8mq-mnt-reform2.dtb
2396dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-reform2.dtb
2397dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-pocket-reform.dtb
2398dtb-$(CONFIG_ARCH_MXC) += imx8mq-mnt-reform2-hdmi.dtb"))
2399 (substitute* "arch/arm64/boot/dts/rockchip/Makefile"
2400 (("rk3588-mnt-reform2.dtb")
2401 "rk3588-mnt-reform2.dtb
2402dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-desktop-reform.dtb
2403dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform2-dsi.dtb
2404dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform-next.dtb
2405dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-pocket-reform.dtb")))))))))))
2406
2407(define-public linux-libre-arm64-mnt-reform-6.12
2408 ;; Kernel for use on the MNT/Reform systems
2409 ;; https://mntre.com/reform.html
2410 (let ((base (make-linux-libre* linux-libre-6.12-version
2411 linux-libre-6.12-gnu-revision
2412 (source-with-patches linux-libre-6.12-source
2413 ;; Revert upstream patches
2414 ;; that conflict with
2415 ;; MNT/Reform patches
2416 (search-patches
2417 "linux-libre-arm64-mnt-reform-revert-vop2-display-modes.patch"
2418 "linux-libre-arm64-mnt-reform-revert-phy-rockchip-samsung.patch"
2419 "linux-libre-arm64-mnt-reform-revert-rk-samsung-hdptx.patch"))
2420 '("aarch64-linux")
2421 #:extra-version "arm64-mnt-reform"
2422 #:extra-options
2423 ;; https://source.mnt.re/reform/reform-debian-packages/-/blob/main/linux/config
2424 (append (mnt-reform-kernel-options
2425 linux-libre-6.12-version)
2426 (default-extra-linux-options
2427 linux-libre-6.12-version)))))
2428 (package
2429 (inherit base)
2430 (inputs (list reform-debian-packages-for-6.12))
2431 (synopsis (string-append (package-synopsis base)
2432 " for MNT/Reform systems"))
2433 (description (string-append (package-description base)
2434 " Configuration options and patches have been applied for use with MNT/Reform systems."))
2435 (arguments
2436 (substitute-keyword-arguments arguments
2437 ((#:phases phases)
2438 #~(modify-phases #$phases
2439 (add-after 'unpack 'apply-reform-patches
2440 (lambda* (#:key inputs #:allow-other-keys)
2441 (for-each (lambda (patch)
2442 (invoke "patch" "-p1" "-i"
2443 (search-input-file inputs
2444 (string-append
2445 "patches6.12/" patch))))
2446 (list
2447 "imx8mp-mnt-pocket-reform/2ghz/0001-imx8mp-2ghz-clk.patch"
2448 "imx8mp-mnt-pocket-reform/2ghz/0002-imx8mp-2ghz-opp.patch"
2449 "imx8mp-mnt-pocket-reform/audio/0000-revert-crashy-audiomix-pm-support.patch"
2450 "imx8mp-mnt-pocket-reform/mmc-sdio/0001-sdhci-add-no-sd-uhs-sdr104-devicetree-property.patch"
2451 "imx8mp-mnt-pocket-reform/mmc-sdio/0002-During-the-card-init-the-host-side-sometimes-may-nee.patch"
2452 "imx8mp-mnt-pocket-reform/mmc-sdio/0003-USDHC-IP-has-one-limitation-the-tuning-circuit-can-t.patch"
2453 "imx8mp-mnt-pocket-reform/pocket-panel/0001-v5-add-multi-display-panel-driver.patch"
2454 "imx8mp-mnt-reform2/0001-sn65dsi86-use-hs-clock-of-samsung-dsim-host-directly.patch"
2455 "imx8mp-mnt-reform2/0002-lcdif-dont-exceed-desired-pixel-clock.patch"
2456 "imx8mq-mnt-reform2/0001-nwl-dsi-fixup-mode-only-for-LCDIF-input-not-DCSS.patch"
2457 "imx8mq-mnt-reform2/0002-pci-imx6-add-support-for-internal-refclk-imx8mq.patch"
2458 "imx8mq-mnt-reform2/0003-lcdif-fix-pcie-interference.patch"
2459 "imx8mq-mnt-reform2/0004-mnt4002-imx-gpcv2-wake-smccc.patch.patch"
2460 ;; Does not apply, needs further investigation
2461 ;; "imx8mq-mnt-reform2/v19_20241126_sandor_yu_initial_support_cadence_mhdp8501_hdmi_dp_for_i_mx8mq.mbx"
2462 "ls1028a-mnt-reform2/0000-dtsi-add-hdptx.patch"
2463 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0001-a311d-viu-fifo-lines-config.patch"
2464 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0002-a311d-viu-fifo-lines-config-header.patch"
2465 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0003-tlv320aic31xx-add-1228800hz-support.patch"
2466 "meson-g12b-bananapi-cm4-mnt-reform2/0001-Revert-drm-bridge-synopsys-dw-mipi-dsi-enable-EoTp-b.patch"
2467 "meson-g12b-bananapi-cm4-mnt-reform2/0011-dw-mipi-dsi-phy-stop-wait-time.patch"
2468 "meson-g12b-bananapi-cm4-mnt-reform2/0012-innolux-n125hce-gn1-timing-tweaks.patch"
2469 "meson-g12b-bananapi-cm4-mnt-reform2/0013-meson-viu-hold-fifo-lines.patch"
2470 "meson-g12b-bananapi-cm4-mnt-reform2/0014-meson-venc-sync.patch.patch"
2471 "meson-g12b-bananapi-cm4-mnt-reform2/0015-meson-dw-mipi-dsi-sync-invert.patch"
2472 "meson-g12b-bananapi-cm4-mnt-reform2/0016-sn65dsi86-burst-mode-support.patch"
2473 "meson-g12b-bananapi-cm4-mnt-reform2/0018-sn65dsi86-never-turn-off.patch"
2474 "meson-g12b-bananapi-cm4-mnt-reform2/0020-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch"
2475 "meson-g12b-bananapi-cm4-mnt-reform2/0021-HACK-of-partial-revert-of-fdt.c-changes.patch"
2476 "meson-g12b-bananapi-cm4-mnt-reform2/0022-add-bt-and-eth-resets.patch"
2477 "meson-g12b-bananapi-cm4-mnt-reform2/0023-sdio-pullups.patch"
2478 "meson-g12b-bananapi-cm4-mnt-reform2/0024-sdio-improve-wifi-speed.patch"
2479 "rk3588-mnt-reform2/0001-regulator-Add-of_regulator_get_optional-for-pure-DT-.patch"
2480 "rk3588-mnt-reform2/0001-scripts-package-builddeb-allow-hooks-also-in-usr-sha.patch"
2481 "rk3588-mnt-reform2/0002-regulator-Add-devres-version-of-of_regulator_get_opt.patch"
2482 "rk3588-mnt-reform2/0004-arm64-dts-rockchip-rk3588-rock5b-add-USB-C-support.patch"
2483 "rk3588-mnt-reform2/0005-math.h-add-DIV_ROUND_UP_NO_OVERFLOW.patch"
2484 "rk3588-mnt-reform2/0006-clk-divider-Fix-divisor-masking-on-64-bit-platforms.patch"
2485 "rk3588-mnt-reform2/0007-clk-composite-replace-open-coded-abs_diff.patch"
2486 "rk3588-mnt-reform2/0008-clk-rockchip-support-clocks-registered-late.patch"
2487 "rk3588-mnt-reform2/0009-clk-rockchip-rk3588-register-GATE_LINK-later.patch"
2488 "rk3588-mnt-reform2/0010-clk-rockchip-expose-rockchip_clk_set_lookup.patch"
2489 "rk3588-mnt-reform2/0011-clk-rockchip-implement-linked-gate-clock-support.patch"
2490 "rk3588-mnt-reform2/0012-clk-rockchip-rk3588-drop-RK3588_LINKED_CLK.patch"
2491 "rk3588-mnt-reform2/0013-arm64-dts-rockchip-rk3588-evb1-add-bluetooth-rfkill.patch"
2492 "rk3588-mnt-reform2/0014-arm64-dts-rockchip-rk3588-evb1-improve-PCIe-ethernet.patch"
2493 "rk3588-mnt-reform2/0015-arm64-dts-rockchip-Slow-down-EMMC-a-bit-to-keep-IO-s.patch"
2494 "rk3588-mnt-reform2/0016-vop2-Add-clock-resets-support.patch"
2495 "rk3588-mnt-reform2/0017-arm64-dts-rockchip-Add-VOP-clock-resets-for-rk3588s.patch"
2496 "rk3588-mnt-reform2/0018-dt-bindings-display-vop2-Add-VP-clock-resets.patch"
2497 "rk3588-mnt-reform2/0019-media-v4l2-ctrls-core-Set-frame_mbs_only_flag-by-def.patch"
2498 "rk3588-mnt-reform2/0020-media-rockchip-Move-H264-CABAC-table-to-header-file.patch"
2499 "rk3588-mnt-reform2/0021-media-rockchip-Introduce-the-rkvdec2-driver.patch"
2500 "rk3588-mnt-reform2/0022-media-dt-bindings-rockchip-Document-RK3588-Video-Dec.patch"
2501 "rk3588-mnt-reform2/0023-arm64-dts-rockchip-Add-rkvdec2-Video-Decoder-on-rk35.patch"
2502 "rk3588-mnt-reform2/0024-arm64-defconfig-enable-Rockchip-RK3588-video-decoder.patch"
2503 "rk3588-mnt-reform2/0025-mfd-rk8xx-Fix-shutdown-handler.patch"
2504 "rk3588-mnt-reform2/0026-WIP-phy-phy-rockchip-samsung-hdptx-Add-FRL-EARC-supp.patch"
2505 "rk3588-mnt-reform2/0027-TESTING-phy-phy-rockchip-samsung-hdptx-Add-verbose-l.patch"
2506 "rk3588-mnt-reform2/0028-WIP-dt-bindings-display-rockchip-drm-Add-optional-cl.patch"
2507 "rk3588-mnt-reform2/0029-WIP-drm-rockchip-vop2-Improve-display-modes-handling.patch"
2508 "rk3588-mnt-reform2/0030-arm64-dts-rockchip-Add-HDMI0-bridge-to-rk3588.patch"
2509 "rk3588-mnt-reform2/0031-arm64-dts-rockchip-Enable-HDMI0-on-rock-5b.patch"
2510 "rk3588-mnt-reform2/0032-arm64-dts-rockchip-Enable-HDMI0-on-rk3588-evb1.patch"
2511 "rk3588-mnt-reform2/0033-WIP-arm64-dts-rockchip-Enable-HDMI0-PHY-clk-provider.patch"
2512 "rk3588-mnt-reform2/0034-WIP-arm64-dts-rockchip-Make-use-of-HDMI0-PHY-PLL-on-.patch"
2513 "rk3588-mnt-reform2/0035-WIP-arm64-dts-rockchip-Make-use-of-HDMI0-PHY-PLL-on-.patch"
2514 "rk3588-mnt-reform2/0036-dt-bindings-display-bridge-Add-schema-for-Synopsys-D.patch"
2515 "rk3588-mnt-reform2/0037-dt-bindings-display-rockchip-Add-schema-for-RK3588-H.patch"
2516 "rk3588-mnt-reform2/0038-drm-bridge-synopsys-Add-DW-HDMI-QP-TX-controller-dri.patch"
2517 "rk3588-mnt-reform2/0039-drm-rockchip-Add-basic-RK3588-HDMI-output-support.patch"
2518 "rk3588-mnt-reform2/0040-arm64-defconfig-Enable-Rockchip-extensions-for-Synop.patch"
2519 "rk3588-mnt-reform2/0041-MAINTAINERS-Add-entry-for-Synopsys-DesignWare-HDMI-R.patch"
2520 "rk3588-mnt-reform2/0042-dt-bindings-media-Document-bindings-for-HDMI-RX-Cont.patch"
2521 "rk3588-mnt-reform2/0043-arm64-dts-rockchip-Add-device-tree-support-for-HDMI-.patch"
2522 "rk3588-mnt-reform2/0044-media-platform-synopsys-Add-support-for-HDMI-input-d.patch"
2523 "rk3588-mnt-reform2/0045-arm64-defconfig-Enable-Synopsys-HDMI-receiver.patch"
2524 "rk3588-mnt-reform2/0046-arm64-dts-rockchip-Enable-HDMI-receiver-on-rock-5b.patch"
2525 "rk3588-mnt-reform2/0047-arm64-dts-rockchip-Enable-HDMI-receiver-on-RK3588-EV.patch"
2526 "rk3588-mnt-reform2/0048-arm64-defconfig-Enable-default-EDID-for-Synopsys-HDM.patch"
2527 "rk3588-mnt-reform2/0049-regulator-Add-devm_-of_regulator_get.patch"
2528 "rk3588-mnt-reform2/0050-pmdomain-rockchip-cleanup-mutex-handling-in-rockchip.patch"
2529 "rk3588-mnt-reform2/0051-pmdomain-rockchip-forward-rockchip_do_pmu_set_power_.patch"
2530 "rk3588-mnt-reform2/0052-pmdomain-rockchip-reduce-indentation-in-rockchip_pd_.patch"
2531 "rk3588-mnt-reform2/0053-dt-bindings-power-rockchip-add-regulator-support.patch"
2532 "rk3588-mnt-reform2/0054-pmdomain-rockchip-add-regulator-support.patch"
2533 "rk3588-mnt-reform2/0055-arm64-dts-rockchip-Add-GPU-power-domain-regulator-de.patch"
2534 "rk3588-mnt-reform2/0056-dt-bindings-net-wireless-brcm4329-fmac-add-pci14e4-4.patch"
2535 "rk3588-mnt-reform2/0057-dt-bindings-net-wireless-brcm4329-fmac-add-clock-des.patch"
2536 "rk3588-mnt-reform2/0058-wifi-brcmfmac-Add-optional-lpo-clock-enable-support.patch"
2537 ;; does not apply cleanly due to DEBLOBBING
2538 ;; "rk3588-mnt-reform2/0059-wifi-brcmfmac-add-flag-for-random-seed-during-firmwa.patch"
2539 "rk3588-mnt-reform2/0060-arm64-dts-rockchip-rk3588-evb1-add-WLAN-controller.patch"
2540 "rk3588-mnt-reform2/0061-arm64-dts-rockchip-add-and-enable-gpu-node-for-Radxa.patch"
2541 "rk3588-mnt-reform2/0062-arm64-dts-rockchip-Enable-HDMI0-on-rock-5a.patch"
2542 "rk3588-mnt-reform2/0100-rk3588-dtsi-add-hdmi1-controller.patch"
2543 "rk3588-mnt-reform2/0102-drm-panthor-Actually-suspend-IRQs-in-the-unplug-path.patch"
2544 "rk3588-mnt-reform2/3001-display-rockchip-add-schema-for-rk3588-hdmi-tx.patch"
2545 "rk3588-mnt-reform2/4000-mnt-rk3588-dual-hdmi-qp-rockchip.patch"
2546 "rk3588-mnt-reform2/4001-mnt-rk3588-dual-hdmi-vop2-pll.patch"
2547 "rk3588-mnt-reform2/5001-rk3588-dsi2-driver.patch"
2548 "rk3588-mnt-reform2/5002-rk3588-dsi-dts-nodes.patch"
2549 "rk3588-mnt-reform2/5100-modernize-hdmi1-in-dtsi.patch"
2550 "rk3588-mnt-reform2/5110-hdptx-crash-workaround.patch"
2551 "rk3588-mnt-reform2/5200-drm-rockchip-Set-dma-mask-to-64-bit.patch"))))
2552 (add-after 'apply-reform-patches 'copy-reform-dts-files
2553 (lambda* (#:key inputs #:allow-other-keys)
2554 (for-each (lambda (dts)
2555 (copy-file (search-input-file inputs
2556 (string-append
2557 "/dts/" dts))
2558 (string-append "arch/arm64/boot/dts/"
2559 dts)))
2560 (list
2561 "amlogic/meson-g12b-bananapi-cm4-mnt-pocket-reform.dts"
2562 "amlogic/meson-g12b-bananapi-cm4-mnt-reform2.dts"
2563 "freescale/fsl-ls1028a-mnt-reform2.dts"
2564 "freescale/imx8mp-mnt-pocket-reform.dts"
2565 "freescale/imx8mp-mnt-reform2.dts"
2566 "freescale/imx8mq-mnt-reform2-hdmi.dts"
2567 "freescale/imx8mq-mnt-reform2.dts"
2568 "rockchip/rk3588-mnt-pocket-reform.dts"
2569 "rockchip/rk3588-mnt-reform-next.dts"
2570 "rockchip/rk3588-mnt-reform2.dts"))))
2571 (add-after 'apply-reform-patches 'adjust-makefiles-with-new-dtb
2572 (lambda _
2573 (substitute* "arch/arm64/boot/dts/amlogic/Makefile"
2574 (("meson-g12b-bananapi-cm4-mnt-reform2.dtb")
2575 "meson-g12b-bananapi-cm4-mnt-reform2.dtb
2576dtb-$(CONFIG_ARCH_MESON) += meson-g12b-bananapi-cm4-mnt-pocket-reform.dtb"))
2577 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2578 (("fsl-ls1028a-rdb.dtb")
2579 "fsl-ls1028a-rdb.dtb
2580dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-mnt-reform2.dtb"))
2581 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2582 (("imx8mq-mnt-reform2.dtb")
2583 "imx8mq-mnt-reform2.dtb
2584dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-reform2.dtb
2585dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-pocket-reform.dtb
2586dtb-$(CONFIG_ARCH_MXC) += imx8mq-mnt-reform2-hdmi.dtb"))
2587 (substitute* "arch/arm64/boot/dts/rockchip/Makefile"
2588 (("rk3588-rock-5b.dtb")
2589 "rk3588-rock-5b.dtb
2590dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform2.dtb
2591dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform-next.dtb
2592dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-pocket-reform.dtb")))))))))))
2593
2594(define-public linux-libre-riscv64-generic
2595 (make-linux-libre* linux-libre-version
2596 linux-libre-gnu-revision
2597 linux-libre-source
2598 '("riscv64-linux")
2599 #:extra-version "riscv64-generic"
2600 #:extra-options
2601 (append
2602 ;; required `guix system vm'
2603 `(("CONFIG_USB_HID" . m)
2604 ("CONFIG_HID_GEMBIRD" . m)
2605 ("CONFIG_AHCI_DWC" . m)
2606 ("CONFIG_SATA_AHCI" . m)
2607 ("CONFIG_CRYPTO_SERPENT" . m)
2608 ("CONFIG_CRYPTO_WP512" . m)
2609 ("CONFIG_USB_UAS" . m)
2610 ("CONFIG_USB_STORAGE" . m)
2611 ("CONFIG_HID_GENERIC" . m)
2612 ("CONFIG_DRM_CIRRUS_QEMU" . m)
2613 ("CONFIG_HW_RANDOM_VIRTIO" . m)
2614 ("CONFIG_VIRTIO_CONSOLE" . m)
2615 ("CONFIG_CRYPTO_XTS" . m))
2616 (default-extra-linux-options linux-libre-version))))
2617
2618(define-public linux-libre-mips64el-fuloong2e
2619 (make-linux-libre* linux-libre-version
2620 linux-libre-gnu-revision
2621 linux-libre-source
2622 '("mips64el-linux")
2623 #:defconfig "fuloong2e_defconfig"
2624 #:extra-version "mips64el-fuloong2e"
2625 #:extra-options
2626 (append
2627 `(("CONFIG_OVERLAY_FS" . m))
2628 (default-extra-linux-options linux-libre-version))))
2629
2630
2631;;;
2632;;; Linux kernel modules.
2633;;;
2634
2635(define-public acpi-call-linux-module
2636 (package
2637 (name "acpi-call-linux-module")
2638 (version "1.2.2")
2639 (source
2640 (origin
2641 (method git-fetch)
2642 (uri (git-reference
2643 (url "https://github.com/nix-community/acpi_call")
2644 (commit (string-append "v" version))))
2645 (file-name (git-file-name name version))
2646 (sha256
2647 (base32 "09ljx0jl987753r2kjqj5kxms95bijw0xn14kf82ryn38ck5c8cf"))))
2648 (build-system linux-module-build-system)
2649 (arguments
2650 (list #:tests? #f ; no tests
2651 #:phases
2652 #~(modify-phases %standard-phases
2653 (add-before 'install 'patch-shebangs-harder
2654 ;; The (only) shebangs in examples/ don't justify a reference.
2655 ;; However, do substitute a slightly more portable one.
2656 (lambda _
2657 (substitute* (find-files "examples" ".")
2658 (("^(#! *)/[^ ]*/" _ shebang)
2659 (string-append shebang "/usr/bin/env ")))))
2660 (add-after 'install 'install-documentation
2661 (lambda _
2662 (let* ((doc (string-append #$output "/share/doc/"
2663 #$name "-" #$version)))
2664 (for-each (lambda (file)
2665 (let ((target (string-append doc "/" file)))
2666 (mkdir-p (dirname target))
2667 (copy-recursively file target)))
2668 (list "README.md" "examples"))))))))
2669 (home-page "https://github.com/nix-community/acpi_call")
2670 (synopsis "Linux kernel module to perform ACPI method calls")
2671 (description
2672 "This simple Linux kernel module allows calls from user space to any
2673@acronym{ACPI, Advanced Configuration and Power Interface} method provided by
2674your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
2675any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
2676and @code{ACPI_BUFFER}.
2677
2678It grants direct and undocumented access to your hardware that may cause damage
2679and should be used with caution, especially on untested models.")
2680 (license license:gpl3+))) ; see README.md (no licence headers)
2681
2682(define-public corefreq
2683 (package
2684 (name "corefreq")
2685 (version "2.1.2")
2686 (source
2687 (origin
2688 (method git-fetch)
2689 (uri (git-reference
2690 (url "https://github.com/cyring/CoreFreq")
2691 (commit version)))
2692 (file-name (git-file-name name version))
2693 (sha256
2694 (base32 "0kkb82205g4vkh5rh1bd3w97b83miqvb3xf557sf7pp1gz9i0acw"))))
2695 ;; The upstream Makefile is now such a proprietary mess that standard builds
2696 ;; as performed by our linux-module-build-system are more or less impossible
2697 ;; without heavy patching. However, we still keep it as the main build
2698 ;; system because lifting out LINUX-MODULE-BUILDER would be even messier.
2699 (build-system linux-module-build-system)
2700 (outputs (list "out" "linux-module"))
2701 (arguments
2702 (list #:imported-modules `((guix build gnu-build-system)
2703 ,@%linux-module-build-system-modules)
2704 #:modules `((guix build linux-module-build-system)
2705 ((guix build gnu-build-system) #:prefix gnu:)
2706 (guix build utils))
2707 #:make-flags
2708 #~(list (string-append "CC=" #$(cc-for-target))
2709 "OPTIM_LVL=3"
2710 (string-append "PREFIX=" #$output))
2711 #:tests? #f ;no test suite
2712 #:source-directory "../build" ;must contain modules.order
2713 #:phases
2714 #~(modify-phases %standard-phases
2715 (add-after 'unpack 'patch-Makefile
2716 (lambda* (#:key inputs #:allow-other-keys)
2717 (let ((dir (search-input-directory
2718 inputs "lib/modules/build")))
2719 (substitute* "Makefile"
2720 (("^(KERNELREL \\?= ).*" _ =)
2721 (string-append = (dirname dir) "\n"))
2722 (("^(KERNELDIR \\?= ).*" _ =)
2723 (string-append = dir "\n"))
2724 (("^([[:space:]]+)(.* modules_install.*)"
2725 _ indent command)
2726 (string-append indent "echo skipping " command))))))
2727 (add-before 'build 'prepare
2728 (lambda* (#:key source-directory #:allow-other-keys)
2729 ;; Lazily fix another mismatch between what the kernel module
2730 ;; build system expects and what this package provides.
2731 (symlink "source/build" source-directory)))
2732 (replace 'build
2733 (lambda* (#:key inputs #:allow-other-keys #:rest rest)
2734 (let ((kernel-dir
2735 (search-input-directory inputs "lib/modules/build")))
2736 ;; Avoid introducing store paths into the build output.
2737 ;; https://codeberg.org/guix/guix/issues/10409
2738 (setenv "KCFLAGS"
2739 (format #f "-ffile-prefix-map=~a=" kernel-dir))
2740 (apply (assoc-ref gnu:%standard-phases 'build)
2741 #:inputs inputs
2742 rest)
2743 (unsetenv "KCFLAGS"))))
2744 (add-before 'install 'resolve-symlink
2745 ;; The build system silently fails to install from a symlink.
2746 (lambda _
2747 (delete-file "../build")
2748 (copy-recursively "build" "../build")))
2749 (add-before 'install 'create-output
2750 (lambda _
2751 ;; Avoid installing the corefreq binary as …/bin.
2752 (mkdir-p (string-append #$output "/bin"))))
2753 (add-after 'install 'gnu:install
2754 (assoc-ref gnu:%standard-phases 'install))
2755 (add-after 'install 'separate-module
2756 (lambda* (#:key outputs #:allow-other-keys)
2757 ;; Adding INSTALL_MOD_PATH= to #:make-flags would still create an
2758 ;; empty <out>/lib/modules directory, so just do it all by hand.
2759 (let* ((output (assoc-ref outputs "out"))
2760 (module (assoc-ref outputs "linux-module")))
2761 (mkdir-p module)
2762 (rename-file (string-append output "/lib")
2763 (string-append module "/lib")))))
2764 (add-after 'install 'install-README
2765 ;; There is no proper documentation. Provide something.
2766 (lambda* (#:key outputs #:allow-other-keys)
2767 (let* ((out (assoc-ref outputs "out"))
2768 (doc (string-append out "/share/doc/"
2769 #$name "-" #$version)))
2770 (install-file "README.md" doc)))))))
2771 (home-page "https://github.com/cyring/CoreFreq")
2772 (synopsis
2773 "Measure performance data & tweak low-level settings on x86-64 CPUs")
2774 (description
2775 "CoreFreq is a CPU monitor that reports low-level processor settings and
2776performance data with notably high precision by using a loadable Linux kernel
2777module. Unlike most similar tools, it can be used to modify some settings if
2778supported by the hardware and at your own risk. It's designed for 64-bit x86
2779Intel processors (Atom, Core2, Nehalem, SandyBridge, and newer) and compatible
2780architectures like AMD@tie{}Zen and Hygon@tie{}Dhyana.
2781
2782Supported processor features include:
2783@enumerate
2784@item time spent in C-states, including C1/C3 Auto- and UnDemotion;
2785@item core temperatures, voltage, and tweaking thermal limits;
2786@item core frequencies, ratios, and base clock rate;
2787@item enabling, disabling, and testing SpeedStep (EIST), Turbo Boost, and
2788Hyper-Threading or SMT;
2789@item enabling or disabling data cache prefetching;
2790@item kernel assembly code to keep as near as possible readings of performance
2791counters such as the @acronym{TSC, Time Stamp Counter}, @acronym{UCC, Unhalted
2792Core Cycles}, and @acronym{URC, Unhalted Reference Cycles};
2793@item the number of instructions per cycle or second (IPS, IPC, and CPI);
2794@item memory controller geometry and RAM timings;
2795@item running processes' CPU affinity.
2796@end enumerate
2797
2798This package provides the @command{corefreqd} data collection daemon, the
2799@command{corefreq-cli} client to visualise and control it in real time, and the
2800@code{corefreqk} kernel module in its own separate output. Read the included
2801@file{README.md} before loading it.")
2802 (supported-systems (list "x86_64-linux"))
2803 (license license:gpl2)))
2804
2805(define-public tuxedo-keyboard
2806 (package
2807 (name "tuxedo-keyboard")
2808 (version "4.22.2")
2809 (source
2810 (origin
2811 (method git-fetch)
2812 (uri (git-reference
2813 (url "https://gitlab.com/tuxedocomputers/development/packages/tuxedo-drivers.git")
2814 (commit (string-append "v" version))))
2815 (file-name (git-file-name name version))
2816 (sha256
2817 (base32 "0akjyz8nhhpcr4y4xmhghd4253mndzhhi5qggr2z315vpxfr7rl4"))))
2818 (build-system linux-module-build-system)
2819 (arguments
2820 (list #:tests? #f)) ; no test suite
2821 ;; This package fails to build on aarch64, and the manufacturer only sells
2822 ;; machines based on Intel-compatible processors. For more information, see
2823 ;; <https://codeberg.org/guix/guix/pulls/1795>.
2824 (supported-systems '("i686-linux" "x86_64-linux"))
2825 (home-page "https://gitlab.com/tuxedocomputers/development/packages/tuxedo-drivers")
2826 (synopsis "Linux kernel modules to control keyboard on most Tuxedo computers")
2827 (description
2828 "This package provides the @code{tuxedo_keyboard}, @code{tuxedo_io},
2829@code{clevo_wmi} @acronym{WMI, Windows Management Engine} and the
2830@code{clevo_acpi} @acronym{ACPI, Advanced Configuration and Power Interface}
2831kernel modules to control the keyboard on most Tuxedo computers. The @code{tuxedo_io}
2832module is also needed for the @code{tuxedo-control-center} (short tcc) package.")
2833 (license license:gpl2+)))
2834
2835(define-public evdi
2836 (package
2837 (name "evdi")
2838 (version "1.14.15") ;inherited by libevdi
2839 (source
2840 (origin
2841 (method git-fetch)
2842 (uri (git-reference
2843 (url "https://github.com/DisplayLink/evdi")
2844 (commit (string-append "v" version))))
2845 (file-name (git-file-name name version))
2846 (sha256
2847 (base32 "065mfwmb4nw71s0f0ax9si8xpbr1sah1bhxvq1k81yicvi83wsxn"))))
2848 (build-system linux-module-build-system)
2849 (arguments
2850 (list #:tests? #f ;no test suite
2851 #:phases #~(modify-phases %standard-phases
2852 (add-after 'unpack 'chdir
2853 (lambda _
2854 (chdir "module")))
2855 ;; Looks like the value is only there to detect RHEL
2856 ;; derivatives, so we can safely delete the include.
2857 (add-after 'unpack 'embed-/etc/os-release
2858 (lambda _
2859 (substitute* "module/Makefile"
2860 (("include /etc/os-release") "")))))))
2861 (home-page "https://github.com/DisplayLink/evdi")
2862 (synopsis
2863 "@acronym{EVDI, Extensible Virtual Display Interface} Linux kernel module")
2864 (description
2865 "The @acronym{EVDI, Extensible Virtual Display Interface} is a Linux kernel
2866module that enables management of multiple screens, allowing user-space programs
2867to take control over what happens with the image. It is essentially a virtual
2868display for which applications using the @code{libevdi} library can add, remove,
2869and receive screen updates.
2870
2871The EVDI driver uses the standard Linux @acronym{DRM, Direct Rendering Manager}.
2872Its displays can be controlled by standard tools such as @command{xrandr} and
2873display settings applets in graphical environments.")
2874 (license license:gpl2)))
2875
2876(define-public libevdi
2877 (package
2878 (inherit evdi)
2879 (name "libevdi")
2880 (build-system gnu-build-system)
2881 (arguments
2882 (list #:tests? #f ;no test suite
2883 #:make-flags
2884 #~(list (string-append "CC=" #$(cc-for-target)))
2885 #:phases #~(modify-phases %standard-phases
2886 (delete 'configure)
2887 (add-after 'unpack 'chdir
2888 (lambda _
2889 (chdir "library")))
2890 (replace 'install
2891 (lambda* _
2892 (let* ((lib (string-append #$output "/lib")))
2893 (mkdir-p lib)
2894 (install-file "libevdi.so" lib)))))))
2895 (inputs (list libdrm))
2896 (native-inputs (list pkg-config))
2897 (synopsis
2898 "@acronym{EVDI, Extensible Virtual Display Interface} user-space library")
2899 (description
2900 "Libevdi is a library that gives applications easy access to
2901@acronym{EVDI, Extensible Virtual Display Interface} devices provided by the
2902@code{evdi} driver package.")
2903 (license license:lgpl2.1)))
2904
2905(define-public ec
2906 (package
2907 (name "ec")
2908 (version (package-version linux-libre))
2909 (source (package-source linux-libre))
2910 (build-system gnu-build-system)
2911 (arguments
2912 (list #:make-flags #~(list (string-append "sbindir="
2913 #$output "/sbin")
2914 "INSTALL=install" "STRIPCMD=true")
2915 #:phases #~(modify-phases %standard-phases
2916 (add-after 'unpack 'enter-subdirectory
2917 (lambda _
2918 (chdir "tools/power/acpi/tools/ec")))
2919 (delete 'configure)) ;no configure script
2920 #:tests? #f)) ;no tests
2921 (home-page (package-home-page linux-libre))
2922 (synopsis
2923 "Utility for reading or writing @acronym{EC, Embedded Controller} registers")
2924 (description
2925 "This utility can read or write specific registers or all the available
2926registers of the @acronym{EC, Embedded Controller} supported by the
2927@code{ec_sys} Linux driver.")
2928 (license license:gpl2)))
2929
2930(define-public bbswitch-module
2931 ;; Use "develop" branch since stable release does not build on Linux >= 5.6.
2932 ;; See https://github.com/Bumblebee-Project/bbswitch/issues/205.
2933 (let ((commit "19f60204596a6463b162fc7ca11f4946f5c20cea"))
2934 (package
2935 (name "bbswitch-module")
2936 (version (git-version "0.8" "2" commit))
2937 (source (origin
2938 (method git-fetch)
2939 (uri (git-reference
2940 ;; Use fork until
2941 ;; https://github.com/Bumblebee-Project/bbswitch/pull/219
2942 ;; is merged.
2943 (url "https://github.com/madchic/bbswitch")
2944 (commit commit)))
2945 (file-name (git-file-name name version))
2946 (sha256
2947 (base32
2948 "1pv41y02c9xg9k1bg4i4ll3w7hxxzdr651i08f092b9q5hr57mqn"))))
2949 (build-system linux-module-build-system)
2950 (arguments
2951 (list #:tests? #f)) ; no test suite
2952 (home-page "https://github.com/Bumblebee-Project/bbswitch")
2953 (synopsis "Kernel module that disables discrete Nvidia graphics cards")
2954 (description "The bbswitch module provides a way to toggle the Nvidia
2955graphics card on Optimus laptops.")
2956 (license license:gpl2))))
2957
2958(define-public bin-graph
2959 (package
2960 (name "bin-graph")
2961 (version "1.2.0")
2962 (source
2963 (origin
2964 (method git-fetch)
2965 (uri (git-reference
2966 (url "https://github.com/8dcc/bin-graph")
2967 (commit (string-append "v" version))))
2968 (file-name (git-file-name name version))
2969 (sha256
2970 (base32 "1msr4fj1nh6hf5h6j5pimfrgd37xy4xbik3iml9gd3b1fdkxsdv7"))))
2971 (arguments
2972 (list #:tests? #f ; no tests
2973 #:make-flags
2974 #~(list (string-append "CC=" #$(cc-for-target))
2975 (string-append "PREFIX=" #$output)
2976 (string-append "INSTALL_DIR=" #$output "/bin"))
2977 #:phases
2978 #~(modify-phases %standard-phases
2979 (delete 'configure)))) ; no configure script
2980 (build-system gnu-build-system)
2981 (inputs (list libpng))
2982 (home-page "https://github.com/8dcc/bin-graph")
2983 (synopsis "Visualize binary files")
2984 (description
2985 "@code{bin-graph} provides a simple way of visualizing the different regions
2986of a binary file.")
2987 (license license:gpl3)))
2988
2989(define-public ddcci-driver-linux
2990 (let ((revision "0")
2991 (commit "7f8f8e6c221a286d57a643c2909109a54e084eed"))
2992 (package
2993 (name "ddcci-driver-linux")
2994 (version (git-version "0.4.5" revision commit))
2995 (source
2996 (origin
2997 (method git-fetch)
2998 (uri
2999 (git-reference
3000 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
3001 (commit commit)))
3002 (file-name (git-file-name name version))
3003 (sha256
3004 (base32 "0sgldghd8n4qjm5nv9dgxjibj1hg4kkk1811wndf3vx3dacsmkl9"))))
3005 (build-system linux-module-build-system)
3006 (arguments
3007 (list #:tests? #f ; no tests
3008 #:phases
3009 #~(modify-phases %standard-phases
3010 (replace 'build
3011 (lambda args
3012 (for-each
3013 (lambda (module)
3014 (with-directory-excursion module
3015 (apply (assoc-ref %standard-phases 'build) args)))
3016 '("ddcci" "ddcci-backlight"))))
3017 (replace 'install
3018 (lambda args
3019 (for-each
3020 (lambda (module)
3021 (with-directory-excursion module
3022 (apply (assoc-ref %standard-phases 'install) args)))
3023 '("ddcci" "ddcci-backlight")))))))
3024 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
3025 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
3026 (description "This package provides two Linux kernel drivers, ddcci and
3027ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
3028interface. The ddcci module creates a character device for each DDC/CI
3029monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
3030module allows the control of the backlight level or luminance property when
3031supported under @file{/sys/class/backlight/}.")
3032 (license license:gpl2+))))
3033
3034(define-public reform2-lpc-module
3035 (package
3036 (name "reform2-lpc-module")
3037 (version "1.79")
3038 (source
3039 (origin
3040 (method git-fetch)
3041 (uri (git-reference
3042 (url "https://source.mnt.re/reform/reform-tools.git")
3043 (commit version)))
3044 (file-name (git-file-name name version))
3045 (sha256
3046 (base32 "16xzdygf14zksvqjbp5gwiqsn0mb7kphvzrmqbl9db4kvyj4ajqa"))))
3047 (build-system linux-module-build-system)
3048 (arguments
3049 '(#:tests? #f ;no tests
3050 #:source-directory "lpc"))
3051 (synopsis "Linux kernel module for the Reform 2 system controller")
3052 (description
3053 "The reform2_lpc module allows for interaction with the NXP LPC11U24
3054Cortex-M0 MCU system controller in the Reform 2 open hardware laptop. It
3055provides battery status information and is necessary to completely shut down
3056the system when powering it off via userspace.")
3057 (home-page "https://source.mnt.re/reform/reform-tools/")
3058 (license license:gpl3+)))
3059
3060(define-public v4l2loopback-linux-module
3061 (package
3062 (name "v4l2loopback-linux-module")
3063 (version "0.15.3")
3064 (source (origin
3065 (method git-fetch)
3066 (uri (git-reference
3067 (url "https://github.com/v4l2loopback/v4l2loopback")
3068 (commit (string-append "v" version))))
3069 (file-name (git-file-name name version))
3070 (sha256
3071 (base32
3072 "1fpzsymsas4d2maj81k1al02m62d81ll4q15xwc4n0rhh88hkdv7"))))
3073 (build-system linux-module-build-system)
3074 (arguments
3075 (list #:tests? #f)) ; no test suite
3076 (home-page "https://github.com/v4l2loopback/v4l2loopback")
3077 (synopsis "Linux kernel module to create virtual V4L2 video devices")
3078 (description
3079 "This Linux module creates virtual video devices. @acronym{V4L2, Video
3080for Linux 2} applications will treat these as ordinary video devices but read
3081video data generated by another application, instead of a hardware device such
3082as a capture card.
3083
3084This lets you apply nifty effects to your Jitsi video, for example, but also
3085allows some more serious things like adding streaming capabilities to an
3086application by hooking GStreamer into the loopback device.")
3087 (license license:gpl2+)))
3088
3089(define-public xpadneo
3090 (package
3091 (name "xpadneo")
3092 (version "0.9.8")
3093 (source (origin
3094 (method git-fetch)
3095 (uri (git-reference
3096 (url "https://github.com/atar-axis/xpadneo")
3097 (commit (string-append "v" version))))
3098 (file-name (git-file-name name version))
3099 (sha256
3100 (base32
3101 "0928yr832may1ibximnvd6qjzr6sipyg8iclqgpcsa7wpxb4320b"))))
3102 (build-system linux-module-build-system)
3103 (arguments
3104 (list #:tests? #f ; no `check' target
3105 #:source-directory "hid-xpadneo/src"
3106 #:phases
3107 #~(modify-phases %standard-phases
3108 (add-after 'install 'post-install
3109 (lambda _
3110 (copy-recursively "hid-xpadneo/etc-modprobe.d"
3111 (string-append #$output "/etc/modprobe.d"))
3112 ;; udev-service-type takes its rules from /lib rather than
3113 ;; /etc, so copy it there instead
3114 (copy-recursively "hid-xpadneo/etc-udev-rules.d"
3115 (string-append #$output
3116 "/lib/udev/rules.d")))))))
3117 (home-page "https://atar-axis.github.io/xpadneo/")
3118 (synopsis "Xbox One Wireless Controller driver for the kernel Linux")
3119 (description
3120 "This package provides a driver for the XBox One S Wireless controller
3121and some newer models when connected via Bluetooth. In addition to the included
3122Linux kernel module, it also contains a modprobe configuration and udev rules,
3123which need to be installed separately.")
3124 (license license:gpl3+)))
3125
3126
3127;;;
3128;;; Pluggable authentication modules (PAM).
3129;;;
3130
3131(define-public linux-pam
3132 (package
3133 (name "linux-pam")
3134 (version "1.7.2")
3135 (source
3136 (origin
3137 (method git-fetch)
3138 (uri (git-reference
3139 (url "https://github.com/linux-pam/linux-pam")
3140 (commit (string-append "v" version))))
3141 (file-name (git-file-name name version))
3142 (sha256
3143 (base32
3144 "1z5apric696zsci28c7651spvdll0zrpfm9z574gcjf45mp22gmi"))
3145 (patches (search-patches "linux-pam-unix_chkpwd.patch"
3146 "linux-pam-no-setfsuid.patch"))))
3147 (build-system meson-build-system)
3148 (outputs '("out" "doc")) ;; 0.8 MiB of html
3149 (inputs (list libxcrypt))
3150 (native-inputs
3151 (list gettext-minimal
3152 flex bison
3153 ;; manpages
3154 libxslt
3155 libxml2
3156 docbook-xml
3157 docbook-xsl))
3158 (arguments
3159 (list
3160 #:configure-flags
3161 #~(list
3162 ;; lastlog is deprecated since 1.5.3
3163 "-Dpam_lastlog=enabled"
3164 (string-append "-Dvendordir=" #$output "/share/pam")
3165 (string-append "-Ddocbook-rng="
3166 #$(let ((docbook-xml (this-package-native-input
3167 "docbook-xml")))
3168 (file-append docbook-xml
3169 "/xml/docbook/"
3170 (package-version docbook-xml)
3171 "/rng/docbookxi.rng")))
3172 (string-append "-Dhtmldir=" #$output:doc "/share/doc/" #$name "/html"))
3173 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
3174 ;; isn't available.
3175 #:tests? #f))
3176 (home-page "http://www.linux-pam.org/")
3177 (synopsis "Pluggable authentication modules for Linux")
3178 (description
3179 "A *Free* project to implement OSF's RFC 86.0.
3180Pluggable authentication modules are small shared object files that can
3181be used through the PAM API to perform tasks, like authenticating a user
3182at login. Local and dynamic reconfiguration are its key features.")
3183 (license license:bsd-3)))
3184
3185(define-public python-pamela
3186 (package
3187 (name "python-pamela")
3188 (version "1.0.0")
3189 (source
3190 (origin
3191 (method git-fetch)
3192 (uri (git-reference
3193 (url "https://github.com/minrk/pamela")
3194 (commit version)))
3195 (file-name (git-file-name name version))
3196 (sha256
3197 (base32 "0cg3w6np1fbjpvzhv54xg567hpf38szwp2d4gvzb9r736nxbv0vr"))))
3198 (build-system pyproject-build-system)
3199 (arguments
3200 (list
3201 #:tests? #f ;Test suite isn't designed to be run inside a container.
3202 #:phases
3203 #~(modify-phases %standard-phases
3204 (add-after 'unpack 'hardcode-pam.so
3205 (lambda* (#:key inputs #:allow-other-keys)
3206 (substitute* "pamela.py"
3207 (("find_library\\(\"pam\")")
3208 (format #f "~s"
3209 (search-input-file inputs "lib/libpam.so"))))))
3210 (replace 'check
3211 (lambda* (#:key tests? #:allow-other-keys)
3212 (when (and tests? (file-exists? "test_pamela.py"))
3213 (invoke "pytest" "--assert=plain" "test_pamela.py")
3214 (invoke "python" "-m" "pamela" "-a" "`whoami`")))))))
3215 (inputs (list linux-pam))
3216 (native-inputs (list python-pytest python-setuptools))
3217 (home-page "https://github.com/minrk/pamela")
3218 (synopsis "PAM interface using ctypes")
3219 (description "This package provides a PAM interface using @code{ctypes}.")
3220 (license license:expat)))
3221
3222(define-public pam-gnupg
3223 (package
3224 (name "pam-gnupg")
3225 (version "0.3")
3226 (source (origin
3227 (method git-fetch)
3228 (uri (git-reference
3229 (url "https://github.com/cruegge/pam-gnupg")
3230 (commit (string-append "v" version))))
3231 (file-name (git-file-name name version))
3232 (sha256
3233 (base32
3234 "1bf91gi6zmfzzmczxm7pajxdlgnikasvg5xsd3j0a368rcr7lf9l"))))
3235 (build-system gnu-build-system)
3236 (inputs
3237 (list gnupg linux-pam))
3238 (native-inputs
3239 (list autoconf automake libtool))
3240 (arguments
3241 `(#:tests? #f ;no tests suite
3242 #:configure-flags
3243 (list (string-append "--with-moduledir="
3244 (assoc-ref %outputs "out") "/lib/security"))))
3245
3246 (home-page "https://github.com/cruegge/pam-gnupg")
3247 (synopsis "Unlock GnuPG keys on login")
3248 (description "This package provides a PAM module that hands over your
3249login password to @code{gpg-agent}. This can be useful if you are using a
3250GnuPG-based password manager like @code{pass}.")
3251 (license license:gpl3+)))
3252
3253
3254;;;
3255;;; Kernel documentation
3256;;;
3257
3258(define-public linux-libre-documentation
3259 (package
3260 (inherit linux-libre)
3261 (name "linux-libre-documentation")
3262 (arguments
3263 (list
3264 #:tests? #f
3265 #:phases #~(modify-phases %standard-phases
3266 (delete 'configure)
3267 (replace 'build
3268 (lambda* (#:key parallel-build? #:allow-other-keys)
3269 (substitute* "Documentation/Makefile"
3270 ;; Remove problematic environment check script.
3271 ((".*sphinx-pre-install --version-check") ""))
3272 (invoke "make" "infodocs"
3273 "-j" (if parallel-build?
3274 (number->string (parallel-job-count))
3275 "1"))))
3276 (replace 'install
3277 (lambda _
3278 (let* ((info-dir (string-append #$output "/share/info"))
3279 (info (string-append info-dir
3280 "/TheLinuxKernel.info.gz")))
3281 (with-directory-excursion "Documentation/output"
3282 (invoke "make" "-C" "texinfo" "install-info"
3283 (string-append "infodir=" info-dir)))
3284 ;; Create a symlink, for convenience.
3285 (symlink info (string-append info-dir
3286 "/linux.info.gz"))))))))
3287 (native-inputs
3288 (list graphviz
3289 perl
3290 python
3291 python-sphinx
3292 python-pyyaml
3293 texinfo
3294 which))
3295 (synopsis "Documentation for the kernel Linux-Libre")
3296 (description "This package provides the documentation for the kernel
3297Linux-Libre, as an Info manual. To consult it, run @samp{info linux}.")))
3298
3299;;;
3300;;; Miscellaneous.
3301;;;
3302
3303(define-public powercap
3304 (package
3305 (name "powercap")
3306 (version "0.6.0")
3307 (source
3308 (origin
3309 (method git-fetch)
3310 (uri (git-reference
3311 (url "https://github.com/powercap/powercap")
3312 (commit (string-append "v" version))))
3313 (file-name (git-file-name name version))
3314 (sha256
3315 (base32 "087almlx34nzjbv8a40kxlmgy8691z2zlzkfyca8a2b7l0b2kqlp"))))
3316 (build-system cmake-build-system)
3317 (arguments
3318 (list #:configure-flags
3319 #~(list "-DBUILD_SHARED_LIBS=ON")))
3320 (home-page "https://github.com/powercap/powercap")
3321 (synopsis "Utilities for accessing the powercap Linux kernel feature")
3322 (description "This package contains utilities for accessing the powercap
3323Linux kernel feature through sysfs. It includes an implementation for working
3324with Intel @acronym{RAPL, Running Average Power Limit}.
3325It provides the commands @code{powercap-info} and @code{powercap-set}.")
3326 (license license:bsd-3)))
3327
3328(define-public powerstat
3329 (package
3330 (name "powerstat")
3331 (version "0.04.03")
3332 (source
3333 (origin
3334 (method git-fetch)
3335 (uri (git-reference
3336 (url "https://github.com/ColinIanKing/powerstat")
3337 (commit (string-append "V" version))))
3338 (file-name (git-file-name name version))
3339 (sha256
3340 (base32 "1a1fnw4rb8fx4wrcl0yc6dbjj49k6vagnq7diyw4fs4i5nin7mv3"))))
3341 (build-system gnu-build-system)
3342 (arguments
3343 `(#:make-flags
3344 (list (string-append "CC=" ,(cc-for-target))
3345 (string-append "prefix=" (assoc-ref %outputs "out")))
3346 #:tests? #f ; no test suite
3347 #:phases
3348 (modify-phases %standard-phases
3349 (delete 'configure)))) ; no configure script
3350 (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
3351 (synopsis "Measure system power consumption")
3352 (description
3353 "Powerstat measures and reports your computer's power consumption in real
3354time. On mobile PCs, it uses ACPI battery information to measure the power
3355drain of the entire system.
3356
3357Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
3358domain measurements. These are available only on some hardware such as Intel
3359Sandybridge and newer, and cover only part of the machine's components such as
3360CPU, DRAM, and graphics. However, they provide accurate and immediate readings
3361and don't require a battery at all.
3362
3363The output is like @command{vmstat} but also shows power consumption statistics:
3364at the end of a run, @command{powerstat} will calculate the average, standard
3365deviation, and minimum and maximum values. It can show a nice histogram too.")
3366 (license license:gpl2)))
3367
3368(define-public psmisc
3369 (package
3370 (name "psmisc")
3371 (version "23.7")
3372 (source
3373 (origin
3374 (method url-fetch)
3375 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
3376 version ".tar.xz"))
3377 (sha256
3378 (base32 "09y30ywh1d4s4f0wgvki115kgpliq48rarmfmmjl0iq22jf5viaq"))))
3379 (build-system gnu-build-system)
3380 (arguments
3381 (list
3382 #:configure-flags
3383 (if (%current-target-system)
3384 #~(list "ac_cv_func_malloc_0_nonnull=yes"
3385 "ac_cv_func_realloc_0_nonnull=yes")
3386 #~'())))
3387 (inputs (list ncurses))
3388 (home-page "https://gitlab.com/psmisc/psmisc")
3389 (synopsis "Small utilities that use the proc file system")
3390 (description
3391 "psmisc is a set of small utilities that use the proc file system.
3392@itemize @bullet
3393@item @command{fuser} identifies processes using files or sockets;
3394@item @command{killall} kills processes by name;
3395@item @command{prtstat} prints statistics of a process;
3396@item @command{pslog} prints the log file(s) of a process;
3397@item @command{pstree} shows the currently running processes as a tree;
3398@item @command{peekfd} shows the data travelling over a file descriptor.
3399@end itemize")
3400 (license license:gpl2+)))
3401
3402(define-public util-linux
3403 (package
3404 (name "util-linux")
3405 (version "2.42.2")
3406 (source (origin
3407 (method url-fetch)
3408 (uri (string-append "mirror://kernel.org/linux/utils/"
3409 "util-linux/v" (version-major+minor version) "/"
3410 "util-linux-" version ".tar.xz"))
3411 (sha256
3412 (base32
3413 "12nfg4300x0g6z03fmqy6l6fcp10nf25p81diw9fy0lnvwx5v803"))
3414 (patches (search-patches "util-linux-tests.patch"))
3415 (modules '((guix build utils)))
3416 (snippet
3417 ;; We take 'nologin' from Shadow, the 'logger' program from
3418 ;; GNU Inetutils and 'kill' from GNU Coreutils.
3419 '(begin
3420 (substitute* "configure"
3421 (("build_nologin=yes") "build_nologin=no")
3422 (("build_logger=yes") "build_logger=no")
3423 (("build_kill=yes") "build_kill=no"))))))
3424 (build-system gnu-build-system)
3425 (outputs '("out" ;6.4 MiB executables and documentation
3426 "lib" ;8.8 MiB shared libraries, headers and locales
3427 "static")) ;2.9 MiB static .a libraries
3428 (arguments
3429 (list #:configure-flags
3430 #~(list "--disable-use-tty-group"
3431 (string-append
3432 "--enable-fs-paths-default="
3433 "/run/setuid-programs"
3434 ":/run/current-system/profile/sbin")
3435 ;; Don't try to chown root:root mount and umount
3436 "--disable-makeinstall-chown"
3437 "--localstatedir=/var"
3438 "--sysconfdir=/etc"
3439 (string-append "--localedir=" #$output:lib
3440 "/share/locale")
3441 ;; Install completions where our bash-completion package
3442 ;; expects them.
3443 (string-append "--with-bashcompletiondir=" #$output
3444 "/etc/bash_completion.d")
3445 ;; XXX: 32-bit Hurd platforms don't support 64bit time_t
3446 #$@(if (target-hurd32?)
3447 '("--disable-year2038")
3448 '()))
3449
3450 ;; FIXME: For now we cannot reliably run tests on GNU/Hurd:
3451 ;; <https://bugs.gnu.org/47791>.
3452 #:tests? (and (not (%current-target-system))
3453 (not (system-hurd?)))
3454
3455 #:phases
3456 #~(modify-phases %standard-phases
3457 (add-before 'configure 'patch-build-scripts
3458 (lambda _
3459 (substitute* "configure"
3460 ;; The build system assumes that we want to install
3461 ;; libraries below $exec_prefix when $libdir does not
3462 ;; match any of the "usual" locations. Fix that.
3463 (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
3464 "usrlib_execdir=$libdir"))))
3465 (add-before 'build 'set-umount-file-name
3466 (lambda _
3467 ;; Tell 'eject' the right file name of 'umount'.
3468 (substitute* "sys-utils/eject.c"
3469 (("\"/bin/umount\"")
3470 (string-append "\"" #$output "/bin/umount\"")))))
3471 (add-before 'check 'pre-check
3472 (lambda* (#:key native-inputs inputs #:allow-other-keys)
3473
3474 ;; Some tests use the invalid pw_shell
3475 (setenv "SHELL" (which "sh"))
3476
3477 (let ((services (search-input-file (or native-inputs inputs)
3478 "etc/services")))
3479 ;; Change the test to refer to the right file.
3480 (substitute* "tests/ts/mcookie/mcookie"
3481 (("/etc/services")
3482 services))
3483 (substitute* "tests/helpers/test_mkfds.c"
3484 (("/etc/fstab")
3485 (which "sh")))
3486 (substitute* "tests/ts/coresched/coresched"
3487 (("/bin/bash -c")
3488 (string-append (which "bash") " -c")))
3489 (substitute* "tests/ts/fincore/count"
3490 (("\"\\$FS\" = \"overlay\"")
3491 "\"$FS\" = \"overlay\" || \"$FS\" = \"btrfs\""))
3492 (substitute* "tests/helpers/test_enosys.c"
3493 (("/bin/false")
3494 (which "false"))))))
3495 (add-before 'check 'disable-setarch-test
3496 (lambda _
3497 ;; The setarch tests are unreliable in QEMU's user-mode
3498 ;; emulation, which is our primary method of building
3499 ;; ARMv7 packages. See
3500 ;; <https://github.com/karelzak/util-linux/issues/601>.
3501 (substitute* "tests/ts/setarch/setarch"
3502 (("ts_init_subtest.*" all)
3503 (string-append
3504 all "\n"
3505 "ts_skip \"setarch tests are unreliable under QEMU\"")))))
3506 (add-before 'check 'disable-lsns-test
3507 (lambda _
3508 ;; The lsns tests can fail due to ioctl(_, NS_GET_USERNS)
3509 ;; returning ENOTTY, indicating this kernel does not
3510 ;; support user namespaces. Curiously, this test can fail
3511 ;; on i686 even if the same test passes on x86_64 on the
3512 ;; same machine. See <https://issues.guix.gnu.org/49933>.
3513 (delete-file "tests/ts/lsns/ioctl_ns")))
3514 (add-before 'check 'disable-choom-test
3515 (lambda _
3516 ;; This test relies on writing to /proc/%d/oom_score_adj
3517 (delete-file "tests/ts/choom/choom")))
3518 (add-before 'check 'disable-lslogins-tests
3519 (lambda _
3520 ;; these test require that a user with name root exists
3521 ;; In the build sandbox there is no such user
3522 (delete-file "tests/ts/lslogins/checkuser")
3523 (delete-file "tests/ts/lslogins/json_mode")))
3524 #$@(if (target-ppc32?)
3525 #~((add-before 'check 'disable-enosys-ioctl
3526 ;; It is unclear why this test specifically
3527 ;; fails in Guix's port of powerpc-linux.
3528 (lambda _
3529 (substitute* "tests/ts/enosys/enosys"
3530 (("ts_init_subtest ioctl")
3531 (string-append
3532 "ts_init_subtest ioctl\n\n"
3533 "ts_skip \"unexplained failure on powerpc\"\n"))))))
3534 #~())
3535 (add-after 'install 'move-static-libraries
3536 (lambda _
3537 (let ((lib #$output:lib)
3538 (static #$output:static))
3539
3540 ;; Move static libraries to the "static" output.
3541 (mkdir-p (string-append static "/lib"))
3542 (with-directory-excursion lib
3543 (for-each (lambda (file)
3544 (rename-file file
3545 (string-append static "/"
3546 file)))
3547 (find-files "lib" "\\.a$"))
3548
3549 ;; Remove references to the static library from the '.la'
3550 ;; files so that Libtool does the right thing when both
3551 ;; the shared and static library is available.
3552 (substitute* (find-files "lib" "\\.la$")
3553 (("old_library=.*") "old_library=''\n"))))))
3554 (add-after 'install 'adjust-pkg-config-files
3555 (lambda _
3556 ;; Drop the unused "prefix=" and "exec_prefix=" variables from
3557 ;; the pkg-config files to avoid a cyclic reference on "out".
3558 (substitute* (find-files (string-append #$output:lib
3559 "/lib/pkgconfig")
3560 "\\.pc$")
3561 (("^(exec_)?prefix=.*") "")))))))
3562 (inputs
3563 (list file ;for libmagic
3564 ncurses
3565 sqlite
3566 zlib))
3567 (native-inputs
3568 (list net-base ;for tests
3569 perl
3570 pkg-config))
3571 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
3572 (synopsis "Collection of utilities for the Linux kernel")
3573 (description "Util-linux is a diverse collection of Linux kernel
3574utilities. It provides dmesg and includes tools for working with file systems,
3575block devices, UUIDs, TTYs, and many other tools.")
3576
3577 (properties '((upstream-name . "util-linux")))
3578 ;; Note that util-linux doesn't use the same license for all the
3579 ;; code. GPLv2+ is the default license for a code without an
3580 ;; explicitly defined license.
3581 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
3582 license:bsd-4 license:public-domain))))
3583
3584;; util-linux optionally supports udev, which allows lsblk to read file system
3585;; metadata without special privileges. Add it as a separate package to avoid
3586;; a circular dependency, and to keep the size small.
3587(define-public util-linux+udev
3588 (package/inherit
3589 util-linux
3590 (name "util-linux-with-udev")
3591 (inputs
3592 (modify-inputs inputs
3593 (prepend eudev)))))
3594
3595(define-public chimerautils
3596 (package
3597 (name "chimerautils")
3598 (version "15.0.3")
3599 (source
3600 (origin
3601 (method git-fetch)
3602 (uri (git-reference
3603 (url "https://github.com/chimera-linux/chimerautils")
3604 (commit (string-append "v" version))))
3605 (file-name (git-file-name name version))
3606 (sha256
3607 (base32 "1inagax7gg2rl2a9ymfxxk71xrwd4sngwc45ph61rlk345jhnxpw"))))
3608 (build-system meson-build-system)
3609 (arguments
3610 (list
3611 #:tests? #f)) ;no test suite
3612 (inputs (list acl
3613 libedit
3614 libxo
3615 ncurses
3616 openssl
3617 zlib
3618 (list zstd "lib")))
3619 (native-inputs (list flex bison pkg-config))
3620 (home-page "https://github.com/chimera-linux/chimerautils")
3621 (synopsis "The FreeBSD-based core Linux userland from Chimera Linux")
3622 (description
3623 "This is a port of the FreeBSD userland for Linux provided by
3624the Chimera Linux distribution. Essentially, it is a collection of UNIX tools
3625such as @command{grep}, @command{cp}, @command{vi}, etc. and can be used as an
3626alternative to the corresponding implementations from the GNU project.")
3627 (license license:bsd-2)))
3628
3629(define-public dislocker
3630 (package
3631 (name "dislocker")
3632 (version "0.7.3")
3633 (home-page "https://github.com/Aorimn/dislocker")
3634 (source (origin
3635 (method git-fetch)
3636 (uri (git-reference
3637 (url home-page)
3638 (commit (string-append "v" version))))
3639 (file-name (git-file-name name version))
3640 (sha256
3641 (base32
3642 "1ak68s1v5dwh8y2dy5zjybmrh0pnqralmyqzis67y21m87g47h2k"))))
3643 (build-system cmake-build-system)
3644 (arguments
3645 '(#:tests? #f)) ;no test suite
3646 (inputs (list fuse-2 mbedtls-lts))
3647 (synopsis "FUSE driver to read/write Windows BitLocker drives")
3648 (description
3649 "This package provides means to to read BitLocker encrypted
3650partitions. Write functionality is also provided but check the README.")
3651 (license license:gpl2+)))
3652
3653(define-public dwarves
3654 (package
3655 (name "dwarves")
3656 (version "1.29")
3657 (source (origin
3658 (method git-fetch)
3659 (uri (git-reference
3660 (url "https://github.com/acmel/dwarves")
3661 (commit (string-append "v" version))))
3662 (file-name (git-file-name name version))
3663 (sha256
3664 (base32
3665 "1ia3r77zyw7r8mydy1zrrdnqzm9ginsvf9pqviq48rglihhddvli"))
3666 (patches
3667 (search-patches "dwarves-threading-reproducibility.patch"))))
3668 (build-system cmake-build-system)
3669 (arguments (list #:configure-flags #~(list "-D__LIB=lib"
3670 "-DLIBBPF_EMBEDDED=OFF")
3671 #:tests? #f)) ;no test suite
3672 (native-inputs (list pkg-config))
3673 (inputs (list libbpf))
3674 (home-page "https://github.com/acmel/dwarves")
3675 (synopsis "Debugging information processing library and utilities")
3676 (description "Dwarves is a set of tools that use the debugging information
3677inserted in ELF binaries by compilers such as GCC, used by well known
3678debuggers such as GDB.
3679
3680Utilities in the Dwarves suite include @command{pahole}, that can be used to
3681find alignment holes in structures and classes in languages such as C, C++,
3682but not limited to these. These tools can also be used to encode and read the
3683BTF type information format used with the kernel Linux @code{bpf} syscall.
3684
3685The @command{codiff} command can be used to compare the effects changes in
3686source code generate on the resulting binaries.
3687
3688The @command{pfunct} command can be used to find all sorts of information
3689about functions, inlines, decisions made by the compiler about inlining, etc.
3690
3691The @command{pahole} command can be used to use all this type information to
3692pretty print raw data according to command line directions.
3693
3694Headers can have its data format described from debugging info and offsets from
3695it can be used to further format a number of records.
3696
3697Finally, the @command{btfdiff} command can be used to compare the output of
3698pahole from BTF and DWARF, to make sure they produce the same results.")
3699 (license license:gpl2+)))
3700
3701(define-public fbset
3702 (package
3703 (name "fbset")
3704 (version "2.1")
3705 (source
3706 (origin
3707 (method url-fetch)
3708 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
3709 version ".tar.gz"))
3710 (sha256
3711 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
3712 (build-system gnu-build-system)
3713 (arguments
3714 '(#:modules ((guix build gnu-build-system)
3715 (guix build utils)
3716 (srfi srfi-26))
3717 #:phases
3718 (modify-phases %standard-phases
3719 (delete 'configure) ; no configure script
3720 (add-before 'install 'pre-install
3721 (lambda* (#:key outputs #:allow-other-keys)
3722 (let ((out (assoc-ref outputs "out")))
3723 (substitute* "Makefile"
3724 (("mknod ") "true ")
3725 ;; The Makefile doesn't honour PREFIX or similar.
3726 (("/usr") out))
3727 (mkdir out)
3728 (with-directory-excursion out
3729 (for-each mkdir-p (list "sbin"
3730 "man/man5"
3731 "man/man8")))
3732 #t)))
3733 (add-after 'install 'install-fb.modes
3734 (lambda* (#:key outputs #:allow-other-keys)
3735 (let* ((out (assoc-ref outputs "out"))
3736 (etc (string-append out "/etc")))
3737 (for-each (cut install-file <> etc)
3738 (find-files "etc" "^fb\\.modes"))
3739 (symlink "fb.modes.ATI"
3740 (string-append etc "/fb.modes"))
3741 #t))))
3742 ;; Parallel building races to create modes.tab.c.
3743 #:parallel-build? #f
3744 #:tests? #f)) ; no test suite
3745 (native-inputs
3746 (list bison flex))
3747 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
3748 (synopsis "Show and modify Linux frame buffer settings")
3749 (description
3750 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
3751different kinds of graphic displays. The @command{fbset} utility can query and
3752change various device settings such as depth, virtual resolution, and timing
3753parameters.")
3754 (license license:gpl2)))
3755
3756(define-public procps
3757 (package
3758 (name "procps")
3759 (version "4.0.3")
3760 (source (origin
3761 (method url-fetch)
3762 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
3763 "procps-ng-" version ".tar.xz"))
3764 (sha256
3765 (base32
3766 "14ms9mkqr1mgl3h5yl6w8m57cf39k382nv7qms78vqbaz728wg1h"))
3767 (patches (search-patches "procps-strtod-test.patch"))))
3768 (build-system gnu-build-system)
3769 (arguments
3770 (list #:modules '((guix build utils)
3771 (guix build gnu-build-system)
3772 (srfi srfi-1)
3773 (srfi srfi-26))
3774 #:configure-flags
3775 (if (%current-target-system)
3776 #~'("ac_cv_func_malloc_0_nonnull=yes"
3777 "ac_cv_func_realloc_0_nonnull=yes")
3778 #~'())
3779 #:phases
3780 #~(modify-phases %standard-phases
3781 (add-after 'install 'post-install
3782 ;; Remove commands and man pages redudant with
3783 ;; Coreutils.
3784 (lambda* (#:key outputs #:allow-other-keys)
3785 (let* ((out #$output)
3786 (dup (append-map (cut find-files out <>)
3787 '("^kill" "^uptime"))))
3788 (for-each delete-file dup))))
3789 #$@(if (system-hurd?)
3790 #~((add-after 'unpack 'skip-tests
3791 (lambda _
3792 (substitute* "library/tests/test_version.c"
3793 (("^int main\\(.*" all)
3794 (string-append all "{\n exit (77);//"))))))
3795 #~()))))
3796 (inputs (list ncurses))
3797 (native-inputs (list pkg-config))
3798 (home-page "https://gitlab.com/procps-ng/procps/")
3799 (synopsis "Utilities that give information about processes")
3800 (description
3801 "Procps is the package that has a bunch of small useful utilities
3802that give information about processes using the Linux /proc file system.
3803The package includes the programs free, pgrep, pidof, pkill, pmap, ps, pwdx,
3804slabtop, tload, top, vmstat, w, watch and sysctl.")
3805 (properties '((upstream-name . "procps-ng")))
3806 (license license:gpl2)))
3807
3808(define-public usbutils
3809 (package
3810 (name "usbutils")
3811 (version "018")
3812 (source
3813 (origin
3814 (method url-fetch)
3815 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
3816 "usbutils-" version ".tar.xz"))
3817 (sha256
3818 (base32 "14xd7j9fl3pm0z4dhqj3mf9paqk431kq4vi602f5hiw5nmcqpxl3"))))
3819 (build-system meson-build-system)
3820 (outputs (list "out" "python"))
3821 (arguments
3822 (list
3823 #:phases
3824 #~(modify-phases %standard-phases
3825 (add-after 'install 'separate-python-output
3826 ;; Separating one Python script shaves more than 106 MiB from :out.
3827 (lambda _
3828 (for-each (lambda (file)
3829 (let ((old (string-append #$output "/" file))
3830 (new (string-append #$output:python "/" file)))
3831 (mkdir-p (dirname new))
3832 (rename-file old new)))
3833 (list "bin/lsusb.py"))))
3834 (add-after 'install 'install-usbreset
3835 (lambda _
3836 (install-file "usbreset"
3837 (string-append #$output "/bin")))))))
3838 (native-inputs (list pkg-config))
3839 (inputs (list eudev libusb python))
3840 (home-page "http://www.linux-usb.org/")
3841 (synopsis
3842 "Tools for working with USB devices")
3843 (description
3844 "Collection of tools to query what type of USB devices are connected to
3845the system, including @command{lsusb}. The experimental @command{usbreset}
3846command included in the package, but be aware that it may not work for all
3847devices.")
3848 (license license:gpl2+)))
3849
3850(define-public usbip-utils
3851 (package
3852 (name "usbip-utils")
3853 (version (package-version linux-libre))
3854 (source (package-source linux-libre))
3855 (build-system gnu-build-system)
3856 (arguments
3857 '(#:configure-flags '("--disable-static")
3858 #:phases (modify-phases %standard-phases
3859 (add-after 'unpack 'enter-subdirectory
3860 (lambda _
3861 (chdir "tools/usb/usbip")
3862 #t)))))
3863 (native-inputs
3864 `(("automake" ,automake)
3865 ("autoreconf" ,autoconf)
3866 ("libtool" ,libtool)))
3867 (inputs (list eudev))
3868 (home-page (package-home-page linux-libre))
3869 (synopsis "Utilities for sharing USB devices over IP networks")
3870 (description
3871 "The USB/IP protocol enables to pass USB device from a server to
3872a client over the network. The server is a machine which shares an
3873USB device and the client is a machine which uses USB device provided by
3874a server over the network. The USB device may be either physical device
3875connected to a server or software entity created on a server using USB
3876gadget subsystem. The usbip-utils are userspace tools to used to handle
3877connection and management on both side. The client needs the @file{vhci-hcd}
3878Linux kernel module and the server needs the @file{usbip_host} Linux kernel
3879module.")
3880 (license license:gpl2)))
3881
3882(define-public e2fsprogs
3883 (package
3884 (name "e2fsprogs")
3885 (version "1.47.2")
3886 (source (origin
3887 (method url-fetch)
3888 (uri (string-append
3889 "mirror://kernel.org/linux/kernel/people/tytso/"
3890 "e2fsprogs/v" version "/"
3891 "e2fsprogs-" version ".tar.xz"))
3892 (sha256
3893 (base32
3894 "0g76fhnyzr2awwybd6c16439l80r5dv4kbfaq7cr908fr9j2w908"))))
3895 (build-system gnu-build-system)
3896 (inputs
3897 `((,util-linux "lib") ,@(if (target-hurd?) '() (list fuse))))
3898 (native-inputs (list pkg-config
3899 texinfo ;for the libext2fs Info manual
3900 ;; For tests.
3901 perl
3902 procps))
3903 (arguments
3904 `(;; util-linux is the preferred source for some of the libraries and
3905 ;; commands, so disable them (see, e.g.,
3906 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
3907 #:configure-flags (list "--disable-libblkid"
3908 "--disable-libuuid" "--disable-uuidd"
3909 "--disable-fsck"
3910
3911 ;; Use symlinks instead of hard links for
3912 ;; 'fsck.extN' etc. This makes the resulting nar
3913 ;; smaller and is preserved across copies.
3914 "--enable-symlink-install"
3915
3916 (string-append "LDFLAGS=-Wl,-rpath="
3917 (assoc-ref %outputs "out")
3918 "/lib")
3919
3920 ;; Install libext2fs et al.
3921 "--enable-elf-shlibs")
3922
3923 #:phases
3924 (modify-phases %standard-phases
3925 (add-before 'configure 'patch-shells
3926 (lambda _
3927 (substitute* "configure"
3928 (("/bin/sh (.*)parse-types.sh" _ dir)
3929 (string-append (which "sh") " " dir
3930 "parse-types.sh")))
3931 (substitute* "MCONFIG.in"
3932 (("INSTALL_SYMLINK = /bin/sh")
3933 "INSTALL_SYMLINK = sh"))
3934 (substitute* (find-files "." "^Makefile.in$")
3935 (("#!/bin/sh")
3936 (string-append "#!" (which "sh"))))))
3937 (add-after 'install 'install-libs
3938 (lambda* (#:key outputs #:allow-other-keys)
3939 (let* ((out (assoc-ref outputs "out"))
3940 (lib (string-append out "/lib")))
3941 (invoke "make" "install-libs")
3942
3943 ;; Make the .a writable so that 'strip' works.
3944 ;; Failing to do that, due to debug symbols, we
3945 ;; retain a reference to the final
3946 ;; linux-libre-headers, which refer to the
3947 ;; bootstrap binaries.
3948 (let ((archives (find-files lib "\\.a$")))
3949 (for-each (lambda (file)
3950 (chmod file #o666))
3951 archives)))))
3952 ,@(if (system-hurd?)
3953 '((add-after 'unpack 'skip-tests
3954 (lambda _
3955 (with-directory-excursion "tests"
3956 (for-each
3957 (lambda (directory)
3958 (delete-file-recursively directory))
3959 '("d_bad_ostype"
3960 "f_detect_junk"
3961 "f_extent_oobounds"
3962 "j_ext_long_revoke_trans"
3963 "j_ext_long_trans"
3964 "j_long_revoke_trans"
3965 "j_long_revoke_trans_mcsum_32bit"
3966 "j_long_revoke_trans_mcsum_64bit"
3967 "j_long_trans"
3968 "j_long_trans_mcsum_32bit"
3969 "j_long_trans_mcsum_64bit"
3970 "j_short_revoke_trans"
3971 "j_short_revoke_trans_mcsum_64bit"
3972 "j_short_trans_64bit"
3973 "j_short_trans"
3974 "j_short_trans_mcsum_64bit"
3975 "j_short_trans_old_csum"
3976 "j_short_trans_open_recover"
3977 "j_short_trans_recover"
3978 "j_short_trans_recover_mcsum_64bit"
3979 "j_short_uncommitted_trans"
3980 "j_short_uncommitted_trans_mcsum_64bit"
3981 "m_error_behavior"
3982 "m_minrootdir"
3983 "m_rootdir"
3984 "r_32to64bit_expand_full"
3985 "r_expand_full"
3986 "r_fixup_lastbg_big"
3987 "t_change_uuid"
3988 "t_change_uuid_mcsum"
3989 "t_change_uuid_mcsum_mounted"
3990 "t_change_uuid_mcsum_seed_mounted"
3991 "t_change_uuid_mounted"
3992 "t_disable_changed_csum_seed"
3993 "t_disable_changed_csum_seed_mounted"
3994 "t_disable_csum_seed"
3995 "t_disable_meta_csum_and_seed"
3996 "t_enable_csum_seed"
3997 "t_format_csum_seed"
3998 "t_replay_and_set"
3999 "u_compound_rollback"
4000 "u_corrupt_blk_csum"
4001 "u_corrupt_blk_csum_force"
4002 "u_corrupt_key_csum"
4003 "u_debugfs_opt"
4004 "u_dryrun"
4005 "u_e2fsck_opt"
4006 "u_errorout"
4007 "u_force"
4008 "u_force_dryrun"
4009 "u_incomplete"
4010 "u_mke2fs_opt"
4011 "u_mke2fs_opt_oddsize"
4012 "u_offset"
4013 "u_onefile_bad"
4014 "u_resize2fs_opt"
4015 "u_revert_64bitmcsum_onefile"
4016 "u_revert_all_onefile"
4017 "u_revert_upgrade_to_64bitmcsum"
4018 "u_tune2fs_opt"
4019 "u_undo_undo"
4020 "u_wrong_fs"))))))
4021 '()))))
4022 (home-page "https://e2fsprogs.sourceforge.net/")
4023 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
4024 (description
4025 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
4026 (license (list license:gpl2 ;programs
4027 license:lgpl2.0 ;libext2fs
4028 license:x11)))) ;libuuid
4029
4030(define e2fsprogs/static
4031 (static-package
4032 (package (inherit e2fsprogs)
4033 (arguments
4034 ;; Do not build shared libraries.
4035 (substitute-keyword-arguments arguments
4036 ((#:configure-flags _)
4037 '(list "--disable-blkid" "--disable-fuse2fs"))
4038 ((#:make-flags _)
4039 '(list)))))))
4040
4041(define-public e2fsck/static
4042 (package
4043 (name "e2fsck-static")
4044 (version (package-version e2fsprogs))
4045 (build-system trivial-build-system)
4046 (source #f)
4047 (inputs
4048 (list e2fsprogs/static))
4049 (arguments
4050 `(#:modules ((guix build utils))
4051 #:builder
4052 (begin
4053 (use-modules (guix build utils)
4054 (ice-9 ftw)
4055 (srfi srfi-26))
4056
4057 (let ((e2fsck (search-input-file %build-inputs "/sbin/e2fsck"))
4058 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
4059 (mkdir-p bin)
4060 (with-directory-excursion bin
4061 (copy-file e2fsck "e2fsck")
4062 (remove-store-references "e2fsck")
4063 (chmod "e2fsck" #o555))
4064 #t))))
4065 (home-page (package-home-page e2fsprogs))
4066 (synopsis "Statically-linked e2fsck command from e2fsprogs")
4067 (description "This package provides statically-linked e2fsck command taken
4068from the e2fsprogs package. It is meant to be used in initrds.")
4069 (license (package-license e2fsprogs))))
4070
4071(define-public extundelete
4072 (package
4073 (name "extundelete")
4074 (version "0.2.4")
4075 (source
4076 (origin
4077 (method url-fetch)
4078 (uri (string-append "mirror://sourceforge/extundelete/"
4079 "extundelete/" version "/extundelete-"
4080 version ".tar.bz2"))
4081 (sha256
4082 (base32
4083 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
4084 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
4085 (build-system gnu-build-system)
4086 (inputs (list e2fsprogs))
4087 (home-page "https://extundelete.sourceforge.net/")
4088 (synopsis "Recover deleted files from ext2/3/4 partitions")
4089 (description
4090 "Extundelete is a set of tools that can recover deleted files from an
4091ext3 or ext4 partition.")
4092 (license license:gpl2)))
4093
4094(define-public zerofree
4095 (package
4096 (name "zerofree")
4097 (version "1.1.1")
4098 (home-page "https://frippery.org/uml/")
4099 (source
4100 (origin
4101 (method url-fetch)
4102 (uri (string-append home-page name "-" version ".tgz"))
4103 (sha256
4104 (base32 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
4105 (build-system gnu-build-system)
4106 (arguments
4107 (list
4108 #:tests? #f ;no tests
4109 #:phases
4110 #~(modify-phases %standard-phases
4111 (delete 'configure) ;no configure script
4112 (replace 'install
4113 ;; The Makefile lacks an ‘install’ target.
4114 (lambda _
4115 (chmod "zerofree" #o555)
4116 (install-file "zerofree" (string-append #$output "/bin")))))))
4117 (inputs (list e2fsprogs))
4118 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
4119 (description
4120 "Zerofree finds the unallocated blocks with non-zero value content in an
4121ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
4122This is a simple way to make disk images more compressible.
4123Zerofree requires the file system to be unmounted or mounted read-only.")
4124 (license license:gpl2)))
4125
4126(define-public strace
4127 (package
4128 (name "strace")
4129 (version "7.0")
4130 (source
4131 (origin
4132 (method git-fetch)
4133 (uri (git-reference
4134 (url "https://github.com/strace/strace")
4135 (commit (string-append "v" version))))
4136 (file-name (git-file-name name version))
4137 (sha256
4138 (base32 "1rrcak1kg2w2dc7dbj6vfyp6a3j0ad7b2jrv6wmkw8h9p8zscx02"))
4139 (patches (search-patches "strace-readlink-tests.patch"))))
4140 (build-system gnu-build-system)
4141 (arguments
4142 (list
4143 #:phases
4144 #~(modify-phases %standard-phases
4145 ;; Needed for the 'bootstrap phase.
4146 (add-after 'unpack 'patch-source-shebangs-initial
4147 (assoc-ref %standard-phases 'patch-source-shebangs))
4148 (add-after 'unpack 'patch-test-shebangs
4149 (lambda _
4150 (substitute* '("tests/detach-vfork.test"
4151 "tests/gen_tests.sh"
4152 "tests/kill-on-exit.sh")
4153 (("#!/bin/sh")
4154 (string-append "#!" (which "sh")))))))
4155 #:configure-flags
4156 ''("--with-libunwind"
4157 ;; Don't fail if the architecture doesn't support different
4158 ;; personalities.
4159 "--enable-mpers=check")
4160 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
4161 #:parallel-tests? #f)) ; undeterministic failures
4162 (inputs (list libunwind))
4163 (native-inputs
4164 (list autoconf
4165 automake
4166 perl
4167 m4
4168 ;; For some tests
4169 util-linux))
4170 (home-page "https://strace.io")
4171 (synopsis "System call tracer for Linux")
4172 (description
4173 "strace is a system call tracer, i.e. a debugging tool which prints out a
4174trace of all the system calls made by a another process/program.")
4175 (license license:lgpl2.1+)))
4176
4177(define-public ltrace
4178 (package
4179 (name "ltrace")
4180 (version "0.7.3")
4181 (source (origin
4182 (method url-fetch)
4183 (uri (string-append "http://www.ltrace.org/ltrace_" version
4184 ".orig.tar.bz2"))
4185 (sha256
4186 (base32
4187 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
4188 (build-system gnu-build-system)
4189 (arguments
4190 ;; Compilation uses -Werror by default, but it fails.
4191 (list #:configure-flags #~'("--disable-werror")))
4192 (inputs (list elfutils))
4193 (home-page "https://www.ltrace.org/")
4194 (synopsis "Library call tracer for Linux")
4195 (description
4196 "ltrace intercepts and records dynamic library calls which are called by
4197an executed process and the signals received by that process. It can also
4198intercept and print the system calls executed by the program.")
4199 (license license:gpl2+)))
4200
4201(define-public alsa-ucm-conf
4202 (package
4203 (name "alsa-ucm-conf")
4204 (version "1.2.16.1")
4205 (source
4206 (origin
4207 (method git-fetch)
4208 (uri (git-reference
4209 (url "https://github.com/alsa-project/alsa-ucm-conf")
4210 (commit (string-append "v" version))))
4211 (file-name (git-file-name name version))
4212 (sha256
4213 (base32 "1dgr8dlxzm4cx4sbp6mbb9ihharyym1qmb8zy9zq171h33k4061w"))))
4214 (build-system copy-build-system)
4215 (arguments
4216 '(#:install-plan
4217 '(("ucm" "share/alsa/ucm")
4218 ("ucm2" "share/alsa/ucm2"))))
4219 (home-page "https://www.alsa-project.org/wiki/Main_Page")
4220 (synopsis "The Advanced Linux Sound Architecture Use Case Manager")
4221 (description
4222 "This package contains @acronym{ALSA, Advanced Linux Sound Architecture}
4223@acronym{UCM, Use Case Manager} configuration of audio input/output names and
4224routing for specific audio hardware.")
4225 (license license:bsd-3)))
4226
4227(define-public alsa-topology-conf
4228 (package
4229 (name "alsa-topology-conf")
4230 (version "1.2.5.1")
4231 (source
4232 (origin
4233 (method git-fetch)
4234 (uri (git-reference
4235 (url "https://github.com/alsa-project/alsa-topology-conf")
4236 (commit (string-append "v" version))))
4237 (file-name (git-file-name name version))
4238 (sha256
4239 (base32 "150065nc5ksrxcay0ia0f8ad2s0gpp3xgn7gc5xsyf0k5dwdby49"))))
4240 (build-system copy-build-system)
4241 (arguments
4242 '(#:install-plan
4243 '(("topology" "share/alsa/topology"))))
4244 (home-page "https://www.alsa-project.org/wiki/Main_Page")
4245 (synopsis "The Advanced Linux Sound Architecture libraries")
4246 (description
4247 "This package contains @acronym{ALSA, Advanced Linux Sound Architecture}
4248topology configuration files that can be used for specific audio hardware.")
4249 (license license:bsd-3)))
4250
4251(define-public alsa-lib
4252 (package
4253 (name "alsa-lib")
4254 (version "1.2.16.1")
4255 (source
4256 (origin
4257 (method git-fetch)
4258 (uri (git-reference
4259 (url "https://github.com/alsa-project/alsa-lib")
4260 (commit (string-append "v" version))))
4261 (file-name (git-file-name name version))
4262 (sha256
4263 (base32 "06r315gq2ps11w72bh3hpljpqjwx2avba3lxccmqpwl9njfcvfmc"))))
4264 (build-system gnu-build-system)
4265 (arguments
4266 (list
4267 #:configure-flags
4268 #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
4269 #:phases
4270 #~(modify-phases %standard-phases
4271 (replace 'bootstrap
4272 (lambda _
4273 (invoke "libtoolize" "--force" "--copy" "--automake")
4274 (invoke "aclocal")
4275 (invoke "autoheader")
4276 (invoke "automake" "--foreign" "--copy" "--add-missing")
4277 (invoke "autoconf")))
4278 (add-before 'install 'pre-install
4279 (lambda* _
4280 (let* ((ucm #$(this-package-input "alsa-ucm-conf"))
4281 (topology #$(this-package-input "alsa-topology-conf"))
4282 (alsa (string-append #$output "/share/alsa"))
4283 (ucm-share (string-append ucm "/share/alsa/ucm"))
4284 (ucm2-share (string-append ucm "/share/alsa/ucm2"))
4285 (topology-share (string-append topology "/share/alsa/topology")))
4286 (mkdir-p alsa)
4287 (symlink ucm-share (string-append alsa "/ucm"))
4288 (symlink ucm2-share (string-append alsa "/ucm2"))
4289 (symlink topology-share (string-append alsa "/topology"))))))))
4290 (inputs
4291 (list autoconf-2.72
4292 automake
4293 alsa-ucm-conf
4294 alsa-topology-conf
4295 libtool))
4296 (supported-systems (remove target-hurd? %supported-systems))
4297 (home-page "https://www.alsa-project.org/wiki/Main_Page")
4298 (synopsis "The Advanced Linux Sound Architecture libraries")
4299 (description
4300 "@acronym{ALSA, Advanced Linux Sound Architecture} provides audio and
4301@acronym{MIDI, Musical Instrument Digital Interface} functionality to the
4302Linux-based operating system.")
4303 (license license:lgpl2.1+)))
4304
4305(define-public alsa-utils
4306 (package
4307 (name "alsa-utils")
4308 (version "1.2.16")
4309 (source (origin
4310 (method url-fetch)
4311 (uri (string-append
4312 "https://www.alsa-project.org/files/pub/utils/"
4313 name "-" version ".tar.bz2"))
4314 (sha256
4315 (base32
4316 "0b13yb7jirxwkfvynq1vd5slpv0wa9bk2fcf31g1v6klx3arj8q9"))))
4317 (build-system gnu-build-system)
4318 (arguments
4319 (list
4320 #:configure-flags
4321 #~(list
4322 ;; The udev rule is responsible for restoring the volume.
4323 (string-append "--with-udev-rules-dir=" #$output "/lib/udev/rules.d"))
4324 #:phases
4325 #~(modify-phases %standard-phases
4326 (add-after 'unpack 'patch-alsactl-udev-rules
4327 (lambda* (#:key inputs #:allow-other-keys)
4328 (substitute* "alsactl/conf/90-alsa-restore.rules.in"
4329 (("/usr/bin/cat")
4330 (search-input-file inputs "bin/cat")))))
4331 (add-before 'install 'pre-install
4332 (lambda _
4333 ;; Don't try to mkdir /var/lib/alsa.
4334 (substitute* "Makefile"
4335 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
4336 "true\n")))))))
4337 (native-inputs
4338 (list docbook-xml-4.2 docbook-xsl gettext-minimal pkg-config xmlto))
4339 (inputs
4340 (list libsamplerate ncurses alsa-lib))
4341 (home-page "http://www.alsa-project.org/")
4342 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
4343 (description
4344 "The Advanced Linux Sound Architecture (ALSA) provides audio and
4345MIDI functionality to the Linux-based operating system.")
4346
4347 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
4348 ;; GPLv2-only.
4349 (license license:gpl2)))
4350
4351(define-public alsa-plugins
4352 (package
4353 (name "alsa-plugins")
4354 (version "1.2.12")
4355 (source
4356 (origin
4357 (method git-fetch)
4358 (uri (git-reference
4359 (url "https://github.com/alsa-project/alsa-plugins")
4360 (commit (string-append "v" version))))
4361 (file-name (git-file-name name version))
4362 (sha256
4363 (base32 "0izvzdvw3nj69l4a968p9d9xjxfxs7i3bdpj1r4cvm6b8w7j33z8"))))
4364 (build-system gnu-build-system)
4365 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
4366 ;; be split, there are references to both in files.
4367 ;; TODO: Remove OSS related plugins, they add support to run native
4368 ;; ALSA applications on OSS however we do not offer OSS and OSS is
4369 ;; obsolete.
4370 (outputs '("out" "pulseaudio" "jack"))
4371 (native-search-paths
4372 (list (search-path-specification
4373 (variable "ALSA_PLUGIN_DIR")
4374 (files '("lib/alsa-lib"))
4375 (separator #f))))
4376 (arguments
4377 `(#:configure-flags '(;; Do not install a "local" configuration targeted
4378 ;; for /etc/alsa. On Guix System plugins are loaded from
4379 ;; the ALSA service, and other distributions likely
4380 ;; won't use these files.
4381 "--with-alsalconfdir=/tmp/noop")
4382 #:phases
4383 (modify-phases %standard-phases
4384 (add-after 'install 'split
4385 (lambda* (#:key inputs outputs #:allow-other-keys)
4386 ;; Distribute the binaries to the various outputs.
4387 (let* ((out (assoc-ref outputs "out"))
4388 (jack (assoc-ref outputs "jack"))
4389 (jacklib (string-append jack "/lib/alsa-lib"))
4390 (pua (assoc-ref outputs "pulseaudio"))
4391 (pualib (string-append pua "/lib/alsa-lib")))
4392 ;; For jack.
4393 (mkdir-p jacklib)
4394 (for-each (lambda (file)
4395 (rename-file file (string-append jacklib "/" (basename file))))
4396 (find-files out ".*jack\\.(la|so)"))
4397 ;; For pulseaudio.
4398 (mkdir-p pualib)
4399 (for-each (lambda (file)
4400 (rename-file file (string-append pualib "/" (basename file))))
4401 (find-files out ".*pulse\\.(la|so)"))
4402 #t))))))
4403 (inputs
4404 (list alsa-lib
4405 jack-1
4406 speex ; libspeexdsp resampling plugin
4407 libsamplerate ; libsamplerate resampling plugin
4408 ffmpeg ; libavcodec resampling plugin, a52 plugin
4409 pulseaudio)) ; PulseAudio plugin
4410 (native-inputs
4411 (list autoconf automake libtool pkg-config))
4412 (home-page "http://www.alsa-project.org/")
4413 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
4414 (description
4415 "@acronym{ALSA, Advanced Linux Sound Architecture} provides audio and
4416@acronym{MIDI, Musical Instrument Digital Interface} functionality to the
4417Linux-based operating system. This package enhances @acronym{ALSA} by
4418providing additional plugins which include: upmixing, downmixing, jackd and
4419pulseaudio support for native alsa applications, format conversion (s16 to
4420a52), and external rate conversion.")
4421 (license (list license:gpl2+
4422 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
4423 license:lgpl2.1+))))
4424
4425(define-public snd-rane-sl3
4426 (let ((commit "01099892261b55ec5ee814292d840eeb664c1904")
4427 (revision "0"))
4428 (package
4429 (name "snd-rane-sl3")
4430 (version (git-version "0" revision commit))
4431 (source
4432 (origin
4433 (method git-fetch)
4434 (uri (git-reference
4435 (url "https://github.com/nvgeele/snd-rane-sl3")
4436 (commit commit)))
4437 (file-name (git-file-name name version))
4438 (sha256
4439 (base32 "1j2aan5xmbi8hgkzzwjb7rarqh4g65rg3s1qd1c8x5m6fpqdnvli"))))
4440 (build-system linux-module-build-system)
4441 (arguments
4442 (list
4443 #:tests? #f ;No tests.
4444 #:phases
4445 #~(modify-phases %standard-phases
4446 (delete 'configure)
4447 (add-before 'build 'change-directory
4448 (lambda _
4449 (chdir "snd-rane-sl3"))))))
4450 (inputs (list linux-libre-headers))
4451 (home-page "https://github.com/nvgeele/snd-rane-sl3")
4452 (synopsis
4453 "Linux ALSA kernel driver for the Rane SL3 USB Audio interface")
4454 (description
4455 "snd-rane-sl3 provides a native Linux kernel module that
4456enables the Rane SL3 to work as a standard ALSA audio device, supporting 6
4457channels (3 stereo pairs) of 24-bit PCM audio at 44.1kHz and 48kHz sample
4458rates.")
4459 (license license:gpl3))))
4460
4461(define-public iptables
4462 (package
4463 (name "iptables")
4464 (version "1.8.11")
4465 (source
4466 (origin
4467 (method url-fetch)
4468 (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
4469 version ".tar.xz")))
4470 (sha256
4471 (base32 "1cp7kw0d3fpmfmbl4adh88v02wnj4s5rfgyxsk52pjgqbvah6wyq"))))
4472 (build-system gnu-build-system)
4473 (native-inputs
4474 (list pkg-config flex bison))
4475 (inputs
4476 (list libmnl libnftnl/pinned))
4477 (arguments
4478 (list #:tests? #f ; no test suite
4479 #:configure-flags ; add $libdir to the RUNPATH of executables
4480 #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))))
4481 (home-page "https://www.netfilter.org/projects/iptables/index.html")
4482 (synopsis "Programs to configure Linux IP packet filtering rules")
4483 (description
4484 "@command{iptables} is the user-space command line program used to
4485configure the Linux 2.4.x and later IPv4 packet filtering ruleset
4486(@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
4487
4488This package also includes @command{ip6tables}, which is used to configure the
4489IPv6 packet filter.
4490
4491Both commands are targeted at system administrators.")
4492 (properties
4493 '((release-monitoring-url . "https://www.netfilter.org/pub/iptables/")))
4494 (license license:gpl2+)))
4495
4496(define-public iptables-nft
4497 (package
4498 (inherit iptables)
4499 (name "iptables-nft")
4500 (source #f)
4501 (build-system copy-build-system)
4502 (arguments
4503 (list
4504 #:phases
4505 #~(modify-phases %standard-phases
4506 (delete 'unpack)
4507 (replace 'install
4508 (lambda* (#:key inputs #:allow-other-keys)
4509 (for-each
4510 (lambda (command-path)
4511 (let ((link-path (string-append #$output command-path)))
4512 (mkdir-p (dirname link-path))
4513 (symlink (search-input-file inputs "sbin/xtables-nft-multi")
4514 link-path)))
4515 (apply append
4516 '("/bin/iptables-xml")
4517 (map (lambda (xtables)
4518 (list (string-append "/sbin/" xtables)
4519 (string-append "/sbin/" xtables "-restore")
4520 (string-append "/sbin/" xtables "-save")))
4521 '("arptables"
4522 "ebtables"
4523 "iptables"
4524 "ip6tables")))))))))
4525 (inputs (list iptables))
4526 (native-inputs '())
4527 (synopsis
4528 "Programs to configure Linux IP packet filtering rules (nftables API)")))
4529
4530(define-public irqbalance
4531 (package
4532 (name "irqbalance")
4533 (version "1.9.5")
4534 (source
4535 (origin
4536 (method git-fetch)
4537 (uri (git-reference
4538 (url "https://github.com/irqbalance/irqbalance")
4539 (commit (string-append "v" version))))
4540 (file-name (git-file-name name version))
4541 (sha256
4542 (base32 "13drfji15qi7rnnsjvflp5yc98ga5x7frgw21ddhxjspjdib5cd9"))))
4543 (build-system gnu-build-system)
4544 (inputs (list glib ncurses libnl libcap-ng))
4545 (native-inputs (list autoconf automake libtool pkg-config))
4546 (home-page "https://irqbalance.github.io/irqbalance/")
4547 (synopsis "Daemon used to load balance CPU interrupts")
4548 (description
4549 "Irqbalance is a daemon to help balance the CPU load generated by
4550interrupts across all of a systems CPUs. Irqbalance identifies the highest
4551volume interrupt sources, and isolates each of them to a single unique CPU, so
4552that load is spread as much as possible over an entire processor set, while
4553minimizing cache miss rates for irq handlers.")
4554 (license license:gpl2)))
4555
4556(define-public bolt
4557 (package
4558 (name "bolt")
4559 (version "0.9.10")
4560 (source (origin
4561 (method git-fetch)
4562 (uri (git-reference
4563 (url "https://gitlab.freedesktop.org/bolt/bolt")
4564 (commit version)))
4565 (file-name (git-file-name name version))
4566 (sha256
4567 (base32
4568 "1vw4vzyhkpm73snnfciy7x88ja72cv5isc27k91jvmy2350b29yx"))))
4569 (build-system meson-build-system)
4570 (arguments
4571 (list #:configure-flags '(list "--localstatedir=/var")
4572 #:glib-or-gtk? #t ;To wrap binaries and/or compile schemas
4573 #:phases #~(modify-phases %standard-phases
4574 (add-after 'unpack 'replace-directories
4575 (lambda* (#:key outputs #:allow-other-keys)
4576 (substitute* "meson.build"
4577 (("udev.get_variable\\(pkgconfig: 'udevdir'\\)")
4578 (string-append "'" #$output "/lib/udev'"))
4579 ;; Don't install in /var
4580 (("not systemd\\.found\\(\\)")
4581 "false"))))
4582 (add-before 'install 'no-polkit-magic
4583 (lambda* (#:key outputs #:allow-other-keys)
4584 (setenv "PKEXEC_UID" "something"))))))
4585 (native-inputs (list pkg-config
4586 `(,glib "bin") python asciidoc umockdev))
4587 (inputs (list eudev dbus polkit))
4588 (synopsis "Thunderbolt 3 device manager")
4589 (description
4590 "This package provides @command{boltd}, a userspace daemon
4591for Thunderbolt devices, and @command{boltctl}, a command-line utility for
4592managing those devices.
4593
4594The daemon @command{boltd} exposes devices via D-Bus to clients. It also
4595stores a database of previously authorized devices and will, depending on the
4596policy set for the individual devices, automatically authorize newly connected
4597devices without user interaction.
4598
4599The command-line utility @command{boltctl} manages Thunderbolt devices via
4600@command{boltd}. It can list devices, monitor changes, and initiate
4601authorization of devices.")
4602 (home-page "https://gitlab.freedesktop.org/bolt/bolt")
4603 (properties `((lint-hidden-cpe-vendors . ("boltcms" "puppet"))))
4604 (license license:gpl2+)))
4605
4606(define-public jitterentropy-rngd
4607 (package
4608 (name "jitterentropy-rngd")
4609 (version "1.2.8")
4610 (source
4611 (origin
4612 (method git-fetch)
4613 (uri (git-reference
4614 (url "https://github.com/smuellerDD/jitterentropy-rngd")
4615 (commit (string-append "v" version))))
4616 (file-name (git-file-name name version))
4617 (sha256
4618 (base32 "13br8s6gqnfc844ps38ya5nny3pndsmskszv3dsp1cxcgvmscg1c"))))
4619 (build-system gnu-build-system)
4620 (arguments
4621 (list
4622 #:tests? #f ; no test suite
4623 #:make-flags
4624 #~(list (string-append "CC=" #$(cc-for-target))
4625 (string-append "PREFIX=" #$output)
4626 "UNITDIR=$(PREFIX)/lib/systemd/system")
4627 #:phases
4628 #~(modify-phases %standard-phases
4629 (delete 'configure)))) ; no ./configure script
4630 (home-page "https://www.chronox.de/jent.html")
4631 (synopsis "CPU jitter random number generator daemon")
4632 (description
4633 "This simple daemon feeds entropy from the CPU Jitter @acronym{RNG, random
4634number generator} core to the kernel Linux's entropy estimator. This prevents
4635the @file{/dev/random} device from blocking and should benefit users of the
4636preferred @file{/dev/urandom} and @code{getrandom()} interfaces too.
4637
4638The CPU Jitter RNG itself is part of the kernel and claims to provide good
4639entropy by collecting and magnifying differences in CPU execution time as
4640measured by the high-resolution timer built into modern CPUs. It requires no
4641additional hardware or external entropy source.
4642
4643The random bit stream generated by @command{jitterentropy-rngd} is not processed
4644by a cryptographically secure whitening function. Nonetheless, its authors
4645believe it to be a suitable source of cryptographically secure key material or
4646other cryptographically sensitive data.
4647
4648If you agree with them, start this daemon as early as possible to provide
4649properly seeded random numbers to services like SSH or those using TLS during
4650early boot when entropy may be low, especially in virtualised environments.")
4651 (license (list license:bsd-3 ; or
4652 license:gpl2+))))
4653
4654(define-public ebtables
4655 (package
4656 (name "ebtables")
4657 (version "2.0.11")
4658 (source (origin
4659 (method url-fetch)
4660 (uri (string-append
4661 "mirror://netfilter.org/ebtables/ebtables-"
4662 version ".tar.gz"))
4663 (sha256
4664 (base32
4665 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
4666 (build-system gnu-build-system)
4667 (inputs
4668 (list perl iptables))
4669 (synopsis "Ethernet bridge frame table administration")
4670 (home-page "https://ebtables.netfilter.org/")
4671 (description
4672 "ebtables is an application program used to set up and maintain the
4673tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
4674analogous to the iptables application, but less complicated, due to the fact
4675that the Ethernet protocol is much simpler than the IP protocol.")
4676 (license license:gpl2+)))
4677
4678(define-public iproute
4679 (package
4680 (name "iproute2")
4681 (version "7.0.0")
4682 (source (origin
4683 (method url-fetch)
4684 (uri (string-append
4685 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
4686 version ".tar.xz"))
4687 (sha256
4688 (base32
4689 "0kiggxwnjsglxnj43wqkc0rmq0acxf6xqcgk7ddc0qyynpvr0a76"))))
4690 (build-system gnu-build-system)
4691 (arguments
4692 (list
4693 ;; There is a test suite, but it wants network namespaces and sudo.
4694 #:tests? #f
4695 #:make-flags
4696 #~(let ((out #$output))
4697 (list (string-append "CC=" #$(cc-for-target))
4698 "HOSTCC=gcc"
4699 (string-append "BASH_COMPDIR=" out
4700 "/etc/bash_completion.d")
4701 (string-append "PREFIX=" out)
4702 (string-append "LIBDIR=" out "/lib")
4703 (string-append "HDRDIR=" out "/include")
4704 (string-append "SBINDIR=" out "/sbin")
4705 (string-append "CONFDIR=" out "/etc")
4706 (string-append "MANDIR=" out "/share/man")
4707 #$@(if (target-ppc64le?)
4708 '("CCOPTS=-O2 -pipe -Wno-incompatible-pointer-types")
4709 '())))
4710 #:phases
4711 #~(modify-phases %standard-phases
4712 (replace 'configure
4713 (lambda* (#:key (configure-flags #~'()) #:allow-other-keys)
4714 ;; The configure script does not understand some of the
4715 ;; default options of gnu-build-system.
4716 (setenv "PKG_CONFIG" #$(pkg-config-for-target))
4717 (apply invoke "./configure"
4718 "--prefix" #$output
4719 configure-flags)))
4720 (add-before 'install 'pre-install
4721 (lambda _
4722 ;; Don't attempt to create /var/lib/arpd.
4723 (substitute* "Makefile"
4724 (("^.*ARPDDIR.*$") "")))))))
4725 (inputs
4726 (list bdb iptables libmnl))
4727 (native-inputs
4728 (list bison flex pkg-config))
4729 ;; For tests.
4730 ;; ("libmnl" ,libmnl)
4731 ;; ("util-linux" ,util-linux)
4732 (home-page
4733 "https://wiki.linuxfoundation.org/networking/iproute2")
4734 (synopsis
4735 "Utilities for controlling TCP/IP networking and traffic in Linux")
4736 (description
4737 "Iproute2 is a collection of utilities for controlling TCP/IP networking
4738and traffic with the Linux kernel. The most important of these are
4739@command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
4740control.
4741
4742Most network configuration manuals still refer to ifconfig and route as the
4743primary network configuration tools, but ifconfig is known to behave
4744inadequately in modern network environments, and both should be deprecated.")
4745 (license license:gpl2+)))
4746
4747(define-public net-tools
4748 ;; XXX: This package is basically unmaintained, but it provides a few
4749 ;; commands not yet provided by Inetutils, such as 'route', so we have to
4750 ;; live with it.
4751 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
4752 (revision "0"))
4753 (package
4754 (name "net-tools")
4755 (version (string-append "1.60-" revision "."
4756 (string-take commit 7)))
4757 (source
4758 (origin
4759 (method url-fetch)
4760 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
4761 "n/ne/net-tools/code.git/net-tools-code-" commit
4762 ".zip"))
4763 (file-name (string-append name "-" version ".zip"))
4764 (sha256
4765 (base32 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
4766 (home-page "https://net-tools.sourceforge.net/")
4767 (build-system gnu-build-system)
4768 (arguments
4769 (list
4770 ;; Binaries that depend on libnet-tools.a don't declare that
4771 ;; dependency, making it parallel-unsafe.
4772 #:parallel-build? #f
4773
4774 #:tests? #f ;no test suite
4775 #:make-flags
4776 #~(list #$(string-append "CC=" (cc-for-target))
4777 (string-append "BASEDIR=" #$output)
4778 (string-append "INSTALLNLSDIR=" #$output "/share/locale")
4779 (string-append "mandir=/share/man"))
4780 #:modules `((guix build gnu-build-system)
4781 (guix build utils)
4782 (srfi srfi-1)
4783 (srfi srfi-26))
4784 #:phases
4785 #~(modify-phases %standard-phases
4786 (replace 'configure
4787 (lambda _
4788 (mkdir-p (string-append #$output "/bin"))
4789 (mkdir-p (string-append #$output "/sbin"))
4790
4791 ;; Pretend we have everything...
4792 (system "yes | make config")
4793
4794 ;; ... except for the things we don't have.
4795 ;; HAVE_AFDECnet requires libdnet, which we don't have.
4796 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
4797 ;; that have been removed.
4798 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
4799 ;; think about adding them later.
4800 (substitute* '("config.make" "config.h")
4801 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
4802 ""))))
4803 (add-after 'install 'remove-redundant-commands
4804 (lambda _
4805 ;; Remove commands and man pages redundant with Inetutils.
4806 (for-each delete-file
4807 (append-map (cute find-files #$output <>)
4808 '("^hostname"
4809 "^(yp|nis|dns)?domainname"))))))))
4810 (native-inputs (list gettext-minimal unzip))
4811 (supported-systems (remove target-hurd? %supported-systems))
4812 (synopsis "Tools for controlling the network subsystem in Linux")
4813 (description
4814 "This package includes the important tools for controlling the network
4815subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
4816route. Additionally, this package contains utilities relating to particular
4817network hardware types (plipconfig, slattach) and advanced aspects of IP
4818configuration (iptunnel, ipmaddr).")
4819 (license license:gpl2+))))
4820
4821(define-public libcap
4822 (package
4823 (name "libcap")
4824 (version "2.64")
4825 (source (origin
4826 (method url-fetch)
4827 (uri (string-append
4828 "mirror://kernel.org/linux/libs/security/linux-privs/"
4829 "libcap2/libcap-" version ".tar.xz"))
4830 (sha256
4831 (base32
4832 "04qy0z6yhlljb29xxcb2srbdnymcrhsi28wrc705z3861cgmwin8"))))
4833 (build-system gnu-build-system)
4834 (arguments
4835 (list #:phases
4836 #~(modify-phases %standard-phases
4837 (delete 'configure)
4838 #$@(if (target-ppc32?)
4839 #~((add-after 'unpack 'apply-patch
4840 (lambda _
4841 (let ((patch
4842 #$(local-file
4843 (search-patch
4844 "libcap-magic-glibc-constant.patch"))))
4845 (invoke "patch" "--force" "-p1" "-i" patch)))))
4846 #~()))
4847 #:test-target "test"
4848 #:make-flags
4849 #~(list "lib=lib"
4850 (string-append "prefix=" #$output)
4851 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
4852 "RAISE_SETFCAP=no"
4853 ;; Tell the makefile to use TARGET-gcc and friends
4854 ;; when cross-compiling.
4855 #$@(if (%current-target-system)
4856 `((string-append "CROSS_COMPILE="
4857 ,(%current-target-system) "-")
4858 "BUILD_CC=gcc")
4859 '()))))
4860 (native-inputs (list perl))
4861 (supported-systems (remove target-hurd? %supported-systems))
4862 (home-page "https://sites.google.com/site/fullycapable/")
4863 (synopsis "Library for working with POSIX capabilities")
4864 (description
4865 "Libcap2 provides a programming interface to POSIX capabilities on
4866Linux-based operating systems.")
4867
4868 ;; License is BSD-3 or GPLv2, at the user's choice.
4869 (license (list license:bsd-3 license:gpl2))))
4870
4871(define-public bridge-utils
4872 (package
4873 (name "bridge-utils")
4874 (version "1.7.1")
4875 (source
4876 (origin
4877 (method url-fetch)
4878 (uri (string-append "mirror://kernel.org/linux/utils/net/"
4879 "bridge-utils/bridge-utils-" version ".tar.xz"))
4880 (sha256
4881 (base32 "03p6cmhm6cqhnfsfa1wv7frhb361y12daf7gr1h5qh51y7j8n7d6"))))
4882 (build-system gnu-build-system)
4883
4884 ;; The tarball lacks all the generated files.
4885 (native-inputs (list autoconf automake))
4886 (arguments
4887 '(#:tests? #f)) ; no 'check' target
4888
4889 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
4890 (synopsis "Manipulate Ethernet bridges")
4891 (description
4892 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
4893to connect two Ethernet segments together in a protocol independent way.
4894Packets are forwarded based on Ethernet address, rather than IP address (like
4895a router). Since forwarding is done at Layer 2, all protocols can go
4896transparently through a bridge.")
4897 (license license:gpl2+)))
4898
4899(define-public libnl
4900 (package
4901 (name "libnl")
4902 (version "3.12.0")
4903 (source (origin
4904 (method url-fetch)
4905 (uri (string-append
4906 "https://github.com/thom311/libnl/releases/download/"
4907 "libnl" (string-join (string-split version #\.) "_")
4908 "/libnl-" version ".tar.gz"))
4909 (sha256
4910 (base32
4911 "066xq01y2mx0xi7bwa5y6ciw1ygla15qdlzzyvyzb8zijrqwllgw"))))
4912 (build-system gnu-build-system)
4913 (native-inputs
4914 `(("bison" ,bison)
4915 ("flex" ,flex)
4916 ("pkg-config" ,pkg-config)
4917 ("swig" ,swig-4.0)
4918 ("libnl3-doc"
4919 ,(origin
4920 (method url-fetch)
4921 (uri (string-append
4922 "https://github.com/thom311/libnl/releases/download/libnl"
4923 (string-join (string-split version #\.) "_")
4924 "/libnl-doc-" version ".tar.gz"))
4925 (sha256
4926 (base32 "18f14pdycghy6fcd27faqgh19zpam6b45s8bgsk85kb9wwzq3yd4"))))))
4927 (outputs `("out" "doc"))
4928 (arguments
4929 `(#:phases
4930 (modify-phases %standard-phases
4931 (add-after 'install 'install-doc
4932 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
4933 (let ((dest (string-append (assoc-ref outputs "doc")
4934 "/share/doc/libnl")))
4935 (mkdir-p dest)
4936 (invoke "tar" "xf" (assoc-ref
4937 (or native-inputs inputs)
4938 "libnl3-doc")
4939 "--strip-components=1" "-C" dest)))))))
4940 (home-page "https://www.infradead.org/~tgr/libnl/")
4941 (synopsis "NetLink protocol library suite")
4942 (description
4943 "The libnl suite is a collection of libraries providing APIs to netlink
4944protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
4945between the kernel and user space processes. It was designed to be a more
4946flexible successor to ioctl to provide mainly networking related kernel
4947configuration and monitoring interfaces.")
4948
4949 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
4950 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
4951 (license license:gpl2)))
4952
4953;; libnl python extensions used to be outputs of libnl. However, as
4954;; cross-compiling python extensions is currently broken, create separate
4955;; packages for libnl python extensions.
4956(define (libnl-python-package python)
4957 (let ((name (string-append "libnl-" python)))
4958 (package
4959 (inherit libnl)
4960 (name name)
4961 (outputs '("out"))
4962 (arguments
4963 (list
4964 #:modules `((guix build gnu-build-system)
4965 (guix build utils)
4966 (srfi srfi-1))
4967 #:phases
4968 #~(modify-phases %standard-phases
4969 (replace 'install
4970 (lambda* (#:key inputs #:allow-other-keys)
4971 (define (python-inst python)
4972 (invoke python "setup.py" "build")
4973 (invoke python "setup.py" "install"
4974 (string-append "--prefix=" #$output))
4975 (invoke python "setup.py" "clean"))
4976 (let ((libdir (dirname (search-input-directory inputs
4977 "lib/libnl"))))
4978 (setenv "LDFLAGS" (string-append "-Wl,-rpath=" libdir)))
4979 (with-directory-excursion "./python"
4980 (python-inst #$python)))))))
4981 (inputs
4982 (append (cond
4983 ((string=? python "python2")
4984 (list python-2))
4985 ((string=? python "python3")
4986 (list python-setuptools python-wrapper)))
4987 (list libxcrypt))) ;required by Python.h
4988 (propagated-inputs (list libnl)))))
4989
4990(define-public libnl-python3 (libnl-python-package "python3"))
4991
4992(define-public iw
4993 (package
4994 (name "iw")
4995 (version "5.19")
4996 (source (origin
4997 (method url-fetch)
4998 (uri (string-append
4999 "mirror://kernel.org/software/network/iw/iw-"
5000 version ".tar.xz"))
5001 (sha256
5002 (base32
5003 "0kjdrihc7ibnjdpjqkq8sv0kmmvavgsww78cpjgbnlyx8zlvnrzi"))))
5004 (build-system gnu-build-system)
5005 (native-inputs (list pkg-config))
5006 (inputs (list libnl))
5007 (arguments
5008 (list #:make-flags
5009 #~(list
5010 (string-append "CC=" #$(cc-for-target))
5011 (string-append "PKG_CONFIG=" #$(pkg-config-for-target))
5012 (string-append "PREFIX=" (assoc-ref %outputs "out")))
5013 #:phases
5014 #~(modify-phases %standard-phases
5015 (delete 'configure)))) ; no configure script
5016 (home-page "https://wireless.wiki.kernel.org/")
5017 (synopsis "Tool for configuring wireless devices")
5018 (description
5019 "iw is a new nl80211 based CLI configuration utility for wireless
5020devices. It replaces @code{iwconfig}, which is deprecated.")
5021 (license license:isc)))
5022
5023(define-public powertop
5024 (package
5025 (name "powertop")
5026 (version "2.15")
5027 (source
5028 (origin
5029 (method git-fetch)
5030 (uri (git-reference
5031 (url "https://github.com/fenrus75/powertop")
5032 (commit (string-append "v" version))))
5033 (file-name (git-file-name name version))
5034 (sha256
5035 (base32 "10vbk4vplmzp3p1mhwnhj81g6i5xvam9pdvmiy6cmd0xvnmdyy77"))))
5036 (build-system gnu-build-system)
5037 (arguments
5038 (list
5039 #:configure-flags #~(list "LDFLAGS=-pthread")
5040 #:phases
5041 #~(modify-phases %standard-phases
5042 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
5043 ;; allow calibrating the network interface in Guix System.
5044 (add-after 'unpack 'patch-absolute-file-names
5045 (lambda* (#:key inputs #:allow-other-keys)
5046 (let ((kmod (assoc-ref inputs "kmod")))
5047 ;; Fix for using a more modern gettext.
5048 (substitute* "autogen.sh"
5049 (("autoreconf")
5050 "autoreconf --force"))
5051 (substitute* "configure.ac"
5052 (("^AM_GNU_GETTEXT_VERSION.*$")
5053 (string-append "AM_GNU_GETTEXT_VERSION(["
5054 #$(package-version (this-package-native-input "gettext-minimal"))
5055 "])\n")))
5056 ;; Give the right 'modprobe' file name so that essential
5057 ;; modules such as msr.ko can be loaded.
5058 (substitute* (find-files "src" "\\.cpp$")
5059 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
5060 ;; These programs are only needed to calibrate, so using
5061 ;; relative file names avoids adding extra inputs. When they
5062 ;; are missing powertop gracefully handles it.
5063 (("/usr/s?bin/(hciconfig|hcitool|xset)" _ command)
5064 command
5065 command))))))))
5066 (native-inputs
5067 (list autoconf
5068 autoconf-archive
5069 automake
5070 gettext-minimal
5071 libtool
5072 pkg-config))
5073 (inputs
5074 (list kmod libnl ncurses pciutils zlib))
5075 (home-page "https://01.org/powertop/")
5076 (synopsis "Analyze power consumption on x86-based laptops")
5077 (description
5078 "PowerTOP is a Linux tool to diagnose issues with power consumption and
5079power management. In addition to being a diagnostic tool, PowerTOP also has
5080an interactive mode where the user can experiment various power management
5081settings for cases where the operating system has not enabled these
5082settings.")
5083 (license license:gpl2)))
5084
5085(define-public aumix
5086 (package
5087 (name "aumix")
5088 (version "2.9.1")
5089 (source (origin
5090 (method url-fetch)
5091 (uri (string-append
5092 "https://web.archive.org/web/20211201184543/"
5093 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
5094 version ".tar.bz2"))
5095 (sha256
5096 (base32
5097 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
5098 (build-system gnu-build-system)
5099 (arguments
5100 ;; Allow compilation with GCC 10.
5101 '(#:configure-flags '("CFLAGS=-O2 -g -fcommon")))
5102 (inputs (list ncurses))
5103 (home-page (string-append "https://web.archive.org/web/20211201184543/"
5104 "http://jpj.net/~trevor/aumix.html"))
5105 (synopsis "Audio mixer for X and the console")
5106 (description
5107 "Aumix adjusts an audio mixer from X, the console, a terminal,
5108the command line or a script.")
5109 (license license:gpl2+)))
5110
5111(define-public iotop-python
5112 ;; The last release is from 2013 and gives a misleading CONFIG_TASK_DELAY_ACCT
5113 ;; error on ‘newer’ kernels.
5114 (let ((revision "0")
5115 (commit "a14256a3ff74eeee59493ac088561f1bafab85a7"))
5116 (package
5117 (name "iotop-python")
5118 (version (git-version "0.6" revision commit))
5119 (source
5120 (origin
5121 (method git-fetch)
5122 (uri (git-reference
5123 (url "https://repo.or.cz/iotop.git")
5124 (commit commit)))
5125 (file-name (git-file-name name version))
5126 (sha256
5127 (base32 "00h5p8fk1zi237q8mqds8apqbis9iw0yih1hl0pr63dsnyzmmrpw"))))
5128 (build-system pyproject-build-system)
5129 (arguments
5130 (list
5131 #:tests? #f ; No tests.
5132 #:phases
5133 #~(modify-phases %standard-phases
5134 (add-after 'unpack 'fix-build-with-python3
5135 (lambda _
5136 (substitute* "setup.py"
5137 (("itervalues")
5138 "values")))))))
5139 (native-inputs (list python python-setuptools))
5140 (home-page "http://guichaz.free.fr/iotop/")
5141 (synopsis "Displays the IO activity of running processes")
5142 (description
5143 "Iotop is a Python program with a top like user interface to show the
5144processes currently causing I/O.")
5145 (license license:gpl2+))))
5146
5147(define-public iotop
5148 (package
5149 (name "iotop")
5150 (version "1.31")
5151 (source
5152 (origin
5153 (method git-fetch)
5154 (uri (git-reference
5155 (url "https://github.com/Tomas-M/iotop")
5156 (commit (string-append "v" version))))
5157 (file-name (git-file-name name version))
5158 (sha256
5159 (base32 "19ccdiw3flzk7gki90rc1nifmma79g2l87vhls4d2xr4z763m4nc"))))
5160 (build-system gnu-build-system)
5161 (arguments
5162 (list #:make-flags
5163 #~(list (string-append "CC=" #$(cc-for-target))
5164 (string-append "PREFIX=" #$output))
5165 #:tests? #f ; no tests
5166 #:phases
5167 #~(modify-phases %standard-phases
5168 (delete 'configure)))) ; no configure script
5169 (native-inputs (list pkg-config))
5170 (inputs (list ncurses))
5171 (home-page "https://github.com/Tomas-M/iotop")
5172 (synopsis "Interactive @command{top}-like input/output activity monitor")
5173 (description
5174 "iotop identifies which processes and threads are most responsible for
5175@acronym{I/O, input/output} activity such as disc reads and writes. It sorts
5176them in a live, interactive table overview similar to that of the well-known
5177@command{top}.
5178
5179This information makes it much easier for an administrator to see which tasks
5180are blocking others and adjust their priority (using @command{ionice}) or stop
5181or kill them altogether.")
5182 (license license:gpl2+)))
5183
5184(define-public fuse
5185 (package
5186 (name "fuse")
5187 (version "3.18.1")
5188 (source (origin
5189 (method url-fetch)
5190 (uri
5191 (string-append "https://github.com/libfuse/libfuse/releases/"
5192 "download/fuse-" version
5193 "/fuse-" version ".tar.gz"))
5194 (sha256
5195 (base32
5196 "0b1jp5gp2gv40gv6cvmv86rcr4l0mdh050qbvnxl0xcwya45qffx"))))
5197 (build-system meson-build-system)
5198 (outputs (list "out" "debug" "static"))
5199 (inputs
5200 (list bash-minimal util-linux))
5201 (arguments
5202 `(#:configure-flags
5203 ,#~(list
5204 (string-append "-Dudevrulesdir=" #$output "/udev/rules.d")
5205 "-Duseroot=false"
5206 ;; Build static libraries.
5207 "--default-library=both")
5208 #:tests? #f
5209 #:modules ((guix build meson-build-system)
5210 (guix build utils)
5211 (ice-9 ftw))
5212 #:phases
5213 ,#~(modify-phases %standard-phases
5214 (add-after 'unpack 'set-file-names
5215 (lambda* (#:key inputs #:allow-other-keys)
5216 ;; libfuse calls out to mount(8) and umount(8). Make sure
5217 ;; it refers to the right ones.
5218 (substitute* '("lib/mount_util.c")
5219 (("/bin/(u?)mount" _ maybe-u)
5220 (search-input-file inputs
5221 (string-append "bin/"
5222 maybe-u "mount"))))
5223 (substitute* '("util/mount.fuse.c")
5224 (("/bin/sh")
5225 (search-input-file inputs "/bin/sh")))
5226
5227 ;; This hack leads libfuse to search for 'fusermount' in
5228 ;; $PATH, where it may find a setuid-root binary, instead of
5229 ;; trying solely $out/sbin/fusermount and failing because
5230 ;; it's not setuid.
5231 (substitute* "lib/meson.build"
5232 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
5233 "-DFUSERMOUNT_DIR=\"/var/empty\"'"))))
5234 (add-after 'unpack 'fix-install
5235 (lambda* (#:key inputs #:allow-other-keys)
5236 (substitute* '("util/meson.build")
5237 (("install_helper.sh") "true"))
5238 (substitute* '("util/meson.build")
5239 (("fuseconf_path = .*")
5240 "fuseconf_path = '/etc/fuse.conf'"))))
5241 (add-before 'configure 'set-paths
5242 (lambda* (#:key inputs outputs #:allow-other-keys)
5243 (let ((dummy-init.d
5244 (string-append (getcwd) "/etc/init.d")))
5245 (setenv "MOUNT_FUSE_PATH"
5246 (string-append #$output "/sbin"))
5247 (setenv "UDEV_RULES_PATH"
5248 (string-append #$output
5249 "/lib/udev/rules.d")))))
5250 (add-after 'install 'install-static-libraries
5251 (lambda* (#:key outputs #:allow-other-keys)
5252 (let ((out (assoc-ref outputs "out"))
5253 (static (assoc-ref outputs "static")))
5254 (mkdir-p (string-append static "/lib"))
5255 (for-each
5256 (lambda (static-library)
5257 (rename-file
5258 (string-append out "/lib/" static-library)
5259 (string-append static "/lib/" static-library)))
5260 (scandir (string-append out "/lib")
5261 (lambda (file-name)
5262 (string-suffix? ".a" file-name))))))))))
5263 (supported-systems (remove target-hurd? %supported-systems))
5264 (home-page "https://github.com/libfuse/libfuse")
5265 (synopsis "Support file systems implemented in user space")
5266 (description
5267 "As a consequence of its monolithic design, file system code for Linux
5268normally goes into the kernel itself---which is not only a robustness issue,
5269but also an impediment to system extensibility. FUSE, for \"file systems in
5270user space\", is a kernel module and user-space library that tries to address
5271part of this problem by allowing users to run file system implementations as
5272user-space processes.")
5273 (license (list license:lgpl2.1 ; library
5274 license:gpl2+)))) ; command-line utilities
5275
5276(define-public fuse-2
5277 (package
5278 (inherit fuse)
5279 (name "fuse")
5280 (version "2.9.9")
5281 (source
5282 (origin
5283 (method url-fetch)
5284 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
5285 "download/fuse-" version
5286 "/fuse-" version ".tar.gz"))
5287 (sha256
5288 (base32 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
5289 (patches (search-patches "fuse-overlapping-headers.patch"
5290 "fuse-glibc-2.34.patch"))))
5291 (build-system gnu-build-system)
5292 (native-inputs
5293 (list autoconf automake gettext-minimal libtool))
5294 (arguments
5295 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
5296 (assoc-ref %outputs "out")
5297 "/sbin")
5298 (string-append "INIT_D_PATH="
5299 (assoc-ref %outputs "out")
5300 "/etc/init.d")
5301
5302 ;; The rule makes /dev/fuse 666.
5303 (string-append "UDEV_RULES_PATH="
5304 (assoc-ref %outputs "out")
5305 "/lib/udev/rules.d"))
5306 #:phases
5307 (modify-phases %standard-phases
5308 (add-before 'bootstrap 'force-bootstrap
5309 (lambda _
5310 ;; Force a bootstrap to make the patch changes effective.
5311 (delete-file "configure")))
5312 (add-before 'build 'set-file-names
5313 (lambda* (#:key inputs #:allow-other-keys)
5314 ;; libfuse calls out to mount(8) and umount(8). Make sure
5315 ;; it refers to the right ones.
5316 (substitute* '("lib/mount_util.c" "util/mount_util.c")
5317 (("/bin/(u?)mount" _ maybe-u)
5318 (search-input-file inputs
5319 (string-append "bin/"
5320 maybe-u "mount"))))
5321 (substitute* '("util/mount.fuse.c")
5322 (("/bin/sh")
5323 (search-input-file inputs "/bin/sh")))
5324
5325 ;; This hack leads libfuse to search for 'fusermount' in
5326 ;; $PATH, where it may find a setuid-root binary, instead of
5327 ;; trying solely $out/sbin/fusermount and failing because
5328 ;; it's not setuid.
5329 (substitute* "lib/Makefile"
5330 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
5331 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))))))))
5332
5333(define-public unionfs-fuse
5334 (package
5335 (name "unionfs-fuse")
5336 (version "3.3")
5337 (source (origin
5338 (method git-fetch)
5339 (uri (git-reference
5340 (url "https://github.com/rpodgorny/unionfs-fuse")
5341 (commit (string-append "v" version))))
5342 (file-name (git-file-name name version))
5343 (sha256
5344 (base32
5345 "1wl5m5qnwf3s1792xphr35pb80sx8ybaqi3n3ddi5vvk3qjc4iws"))))
5346 (build-system cmake-build-system)
5347 (arguments
5348 (list
5349 #:phases
5350 #~(modify-phases %standard-phases
5351 (replace 'check
5352 ;; The epitome of ‘I tried’: run the 2 trivial tests that don't rely
5353 ;; on the fuse kernel module being loaded. All others would fail.
5354 (lambda* (#:key tests? #:allow-other-keys)
5355 (when tests?
5356 (invoke "pytest" "../source/test_all.py" "-k" "test_help")))))))
5357 (native-inputs
5358 (list pkg-config
5359
5360 ;; Only for the test ‘suite’.
5361 python
5362 python-pytest))
5363 (inputs
5364 (list fuse))
5365 (home-page "https://github.com/rpodgorny/unionfs-fuse")
5366 (synopsis "User-space union file system")
5367 (description
5368 "UnionFS-FUSE is a flexible union file system implementation in user
5369space, using the FUSE library. Mounting a union file system allows you to
5370\"aggregate\" the contents of several directories into a single mount point.
5371UnionFS-FUSE additionally supports copy-on-write.")
5372 (license license:bsd-3)))
5373
5374(define fuse-static
5375 (package (inherit fuse)
5376 (name "fuse-static")
5377 (source
5378 (origin
5379 (inherit (package-source fuse))
5380 (modules '((guix build utils)))
5381 (snippet
5382 #~(begin
5383 ;; Normally libfuse invokes mount(8) so that /etc/mtab is updated.
5384 ;; Change calls to 'mtab_needs_update' to 0 so that it doesn't do
5385 ;; that, allowing us to remove the dependency on util-linux
5386 ;; (something that is useful in initrds.)
5387 (substitute* "lib/mount_util.c"
5388 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)") "0")
5389 (("/bin/") ""))))))
5390 (arguments
5391 (substitute-keyword-arguments arguments
5392 ((#:configure-flags flags '())
5393 #~(cons "-Ddefault_library=static"
5394 #$flags))))))
5395
5396(define-public unionfs-fuse/static
5397 (package (inherit unionfs-fuse)
5398 (synopsis "User-space union file system (statically linked)")
5399 (name (string-append (package-name unionfs-fuse) "-static"))
5400 (source
5401 (origin
5402 (inherit (package-source unionfs-fuse))
5403 (modules '((guix build utils)))
5404 (snippet
5405 #~(begin
5406 ;; Add -ldl to the libraries, because libfuse.a needs that.
5407 (substitute* "src/CMakeLists.txt"
5408 (("target_link_libraries(.*)\\)" _ libs)
5409 (string-append "target_link_libraries"
5410 libs " dl)")))))))
5411 (arguments
5412 (substitute-keyword-arguments arguments
5413 ((#:configure-flags flags #~'())
5414 #~(cons "-DCMAKE_EXE_LINKER_FLAGS=-static" #$flags))
5415 ((#:phases phases #~%standard-phases)
5416 #~(modify-phases #$phases
5417 (add-after 'install 'post-install
5418 (lambda _
5419 ;; By default, 'unionfs' keeps references to
5420 ;; $glibc/share/locale and similar stuff. Remove them.
5421 (remove-store-references (string-append #$output "/bin/unionfs"))
5422 ;; 'unionfsctl' has references to glibc as well. Since
5423 ;; we don't need it, remove it.
5424 (delete-file (string-append #$output "/bin/unionfsctl"))))))))
5425 (inputs (list fuse-static))))
5426
5427(define-public sshfs
5428 (package
5429 (name "sshfs")
5430 (version "3.7.6")
5431 (source (origin
5432 (method url-fetch)
5433 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
5434 "download/sshfs-" version "/sshfs-" version
5435 ".tar.xz"))
5436 (sha256
5437 (base32
5438 "14sq94g160i56v5sc39wgilxnd6yf661bzxpn6f7w1qa8lqwn6va"))))
5439 (build-system meson-build-system)
5440 (arguments
5441 ;; XXX: tests are skipped: FUSE kernel module does not seem to be loaded
5442 '(#:tests? #f))
5443 (inputs
5444 (list fuse glib))
5445 (native-inputs
5446 (list pkg-config
5447 ;; man page
5448 python-docutils))
5449 (home-page "https://github.com/libfuse/sshfs")
5450 (synopsis "Mount remote file systems over SSH")
5451 (description
5452 "This is a file system client based on the SSH File Transfer Protocol.
5453Since most SSH servers already support this protocol it is very easy to set
5454up: on the server side there's nothing to do; on the client side mounting the
5455file system is as easy as logging into the server with an SSH client.")
5456 (license license:gpl2+)))
5457
5458(define-public archivemount
5459 (package
5460 (name "archivemount")
5461 (version "0.9.1")
5462 (source
5463 (origin
5464 (method url-fetch)
5465 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
5466 "archivemount-" version ".tar.gz"))
5467 (sha256
5468 (base32 "1cy5b6qril9c3ry6fv7ir87s8iyy5vxxmbyx90dm86fbra0vjaf5"))))
5469 (build-system gnu-build-system)
5470 (inputs (list fuse-2 libarchive))
5471 (native-inputs (list pkg-config))
5472 (home-page "https://www.cybernoia.de/software/archivemount.html")
5473 (synopsis "Tool for mounting archive files with FUSE")
5474 (description "archivemount is a FUSE-based file system for Unix variants,
5475including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
5476mount point where it can be read from or written to as with any other file
5477system. This makes accessing the contents of the archive, which may be
5478compressed, transparent to other programs, without decompressing them.")
5479 (license license:lgpl2.0+)))
5480
5481(define-public numactl
5482 (package
5483 (name "numactl")
5484 (version "2.0.16")
5485 (source (origin
5486 (method url-fetch)
5487 (uri (string-append
5488 "https://github.com/numactl/numactl/releases/download/v"
5489 version "/numactl-" version ".tar.gz"))
5490 (sha256
5491 (base32
5492 "1j67wx3383fwqbvhg4nwqf72vpdgimmrvkpn3b9s2xzr7a4jy90v"))))
5493 (build-system gnu-build-system)
5494 (arguments
5495 `(,@(if (target-riscv64?)
5496 `(#:make-flags (list "LDFLAGS=-latomic"))
5497 '())
5498 ;; There's a 'test' target, but it requires NUMA support in the kernel
5499 ;; to run, which we can't assume to have.
5500 #:tests? #f))
5501 (home-page "https://github.com/numactl/numactl")
5502 (synopsis "Tools for non-uniform memory access (NUMA) machines")
5503 (description
5504 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
5505memory is not all in one place. The @command{numactl} program allows you to
5506run your application program on specific CPUs and memory nodes. It does this
5507by supplying a NUMA memory policy to the operating system before running your
5508program.
5509
5510The package contains other commands, such as @command{numastat},
5511@command{memhog}, and @command{numademo} which provides a quick overview of
5512NUMA performance on your system.")
5513 (license (list license:gpl2 ;programs
5514 license:lgpl2.1)))) ;library
5515
5516(define-public kbd-neo
5517 (package
5518 (name "kbd-neo")
5519 (version "2486")
5520 (source
5521 (origin
5522 (method url-fetch)
5523 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
5524 version "/linux/console/neo.map"))
5525 (file-name (string-append name "-" version ".map"))
5526 (sha256
5527 (base32
5528 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
5529 (build-system trivial-build-system)
5530 (arguments
5531 `(#:modules ((guix build utils))
5532 #:builder (begin
5533 (use-modules (guix build utils))
5534 (let ((out (string-append %output "/share/keymaps"))
5535 (source (assoc-ref %build-inputs "source")))
5536 (mkdir-p out)
5537 (copy-file source (string-append out "/neo.map"))
5538 #t))))
5539 (home-page "https://neo-layout.org")
5540 (synopsis "Neo2 console layout")
5541 (description
5542 "Kbd-neo provides the Neo2 keyboard layout for use with
5543@command{loadkeys(1)} from @code{kbd(4)}.")
5544 ;; The file is located in an svn directory, the entire content of
5545 ;; the directory is licensed as GPL3.
5546 (license license:gpl3+)))
5547
5548(define-public kbd
5549 (package
5550 (name "kbd")
5551 (version "2.5.1")
5552 (source
5553 (origin
5554 (method url-fetch)
5555 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-" version
5556 ".tar.xz"))
5557 (sha256
5558 (base32 "10s608i4blprgy9nynlid0hglfdrrgln6wwjs9rhjf56hwilbpyc"))
5559 (modules '((guix build utils)))
5560 (snippet
5561 '(begin
5562 (substitute* '("src/unicode_start" "src/unicode_stop")
5563 ;; Assume the Coreutils are in $PATH.
5564 (("/usr/bin/tty")
5565 "tty"))))))
5566 (build-system gnu-build-system)
5567 (arguments
5568 (list
5569 #:phases
5570 #~(modify-phases %standard-phases
5571 (add-before 'build 'pre-build
5572 (lambda* (#:key inputs #:allow-other-keys)
5573 (substitute* "src/libkbdfile/kbdfile.c"
5574 (("bzip2")
5575 (search-input-file inputs "/bin/bzip2"))
5576 (("gzip")
5577 (search-input-file inputs "/bin/gzip"))
5578 (("xz -d")
5579 (string-append (search-input-file inputs "/bin/xz") " -d"))
5580 (("zstd")
5581 (search-input-file inputs "/bin/zstd")))))
5582 (add-after 'install 'post-install
5583 (lambda _
5584 ;; Make sure these programs find their comrades.
5585 (let ((bin (string-append #$output "/bin")))
5586 (for-each (lambda (prog)
5587 (wrap-program (string-append bin "/" prog)
5588 `("PATH" ":" prefix (,bin))))
5589 '("unicode_start" "unicode_stop"))))))))
5590 (native-inputs (list autoconf pkg-config))
5591 (inputs
5592 (list bash-minimal
5593 ;; for wrap-program
5594 bzip2
5595 gzip
5596 linux-pam
5597 xz
5598 zstd))
5599 (native-search-paths
5600 (list (search-path-specification
5601 (variable "LOADKEYS_KEYMAP_PATH")
5602 ;; Append ‘/**’ to recursively search all directories. One can then
5603 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
5604 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
5605 (files (list "share/keymaps/**")))))
5606 (home-page "https://kbd-project.org/")
5607 (synopsis "Linux keyboard utilities and keyboard maps")
5608 (description
5609 "This package contains keytable files and keyboard utilities compatible
5610for systems using the Linux kernel. This includes commands such as
5611@code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
5612 (license license:gpl2+)))
5613
5614(define-public loadkeys-static
5615 (package
5616 (inherit kbd)
5617 (name "loadkeys-static")
5618 (arguments
5619 (substitute-keyword-arguments arguments
5620 ((#:configure-flags flags #~(list))
5621 #~(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
5622 "--disable-vlock" ;so we don't need libpam
5623 "--disable-libkeymap")
5624 #$flags))
5625 ((#:make-flags flags #~(list))
5626 #~(cons "LDFLAGS=-all-static -lrt -lpthread" #$flags))
5627 ((#:phases phases #~%standard-phases)
5628 #~(modify-phases #$phases
5629 (replace 'install
5630 (lambda _
5631 ;; The binary keeps references to gzip, among other things,
5632 ;; which we don't need in the initrd, so strip references.
5633 (remove-store-references "src/loadkeys")
5634
5635 (install-file "src/loadkeys"
5636 (string-append #$output "/bin"))))
5637 (delete 'post-install)))
5638 ((#:strip-flags _ #~(list))
5639 #~(list "--strip-all"))
5640 ((#:allowed-references _ '())
5641 '())))
5642
5643 (synopsis "Statically-linked @command{loadkeys} program")
5644
5645 ;; This package is meant to be used internally in the initrd so don't
5646 ;; expose it.
5647 (properties '((hidden? . #t)))))
5648
5649(define-public inotify-tools
5650 (package
5651 (name "inotify-tools")
5652 (version "3.22.6.0")
5653 (source (origin
5654 (method git-fetch)
5655 (uri (git-reference
5656 (url "https://github.com/rvoicilas/inotify-tools")
5657 (commit version)))
5658 (file-name (git-file-name name version))
5659 (sha256
5660 (base32
5661 "1j9j8k5zjp8m4cl53zjncnll9z4dnvzr4ygmfcjk0ci81i59b18i"))))
5662 (build-system gnu-build-system)
5663 (native-inputs
5664 (list autoconf automake libtool))
5665 (arguments
5666 `(#:configure-flags
5667 (list "--disable-static")))
5668 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
5669 (synopsis "Monitor file accesses")
5670 (description
5671 "The inotify-tools packages provides a C library and command-line tools
5672to use Linux' inotify mechanism, which allows file accesses to be monitored.")
5673 (license license:gpl2+)))
5674
5675(define-public kmod
5676 (package
5677 (name "kmod")
5678 (version "29")
5679 (source (origin
5680 (method url-fetch)
5681 (uri
5682 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
5683 "kmod-" version ".tar.xz"))
5684 (sha256
5685 (base32
5686 "0am54mi5rk72g5q7k6l6f36gw3r9vwgjmyna43ywcjhqmakyx00b"))
5687 (patches (search-patches "kmod-module-directory.patch"))))
5688 (build-system gnu-build-system)
5689 (arguments
5690 (list #:configure-flags #~(list "--with-xz" "--with-zlib" "--with-zstd"
5691 "--disable-test-modules")
5692 #:phases
5693 #~(modify-phases %standard-phases
5694 (add-after 'unpack 'disable-tests
5695 (lambda _
5696 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
5697 (substitute* "Makefile.in"
5698 (("testsuite/test-modprobe") "")
5699 (("testsuite/test-depmod") "")
5700 (("testsuite/test-blacklist") ""))))
5701 (add-after 'install 'install-modprobe&co
5702 (lambda _
5703 (for-each (lambda (tool)
5704 (symlink "kmod"
5705 (string-append #$output "/bin/" tool)))
5706 '("insmod" "rmmod" "lsmod" "modprobe"
5707 "modinfo" "depmod")))))))
5708 (native-inputs (list pkg-config zstd)) ;zstd needed for tests
5709 (inputs (list xz zlib `(,zstd "lib")))
5710 (supported-systems (remove target-hurd? %supported-systems))
5711 (home-page "https://www.kernel.org/")
5712 (synopsis "Kernel module tools")
5713 (description "Kmod is a set of tools to handle common tasks with Linux
5714kernel modules like insert, remove, list, check properties, resolve
5715dependencies and aliases.
5716
5717These tools are designed on top of libkmod, a library that is shipped with
5718kmod. The aim is to be compatible with tools, configurations and indices
5719from the module-init-tools project.")
5720 (license license:gpl2+))) ; library under lgpl2.1+
5721
5722(define-public earlyoom
5723 (package
5724 (name "earlyoom")
5725 (version "1.9.0")
5726 (source (origin
5727 (method git-fetch)
5728 (uri (git-reference
5729 (url "https://github.com/rfjakob/earlyoom")
5730 (commit (string-append "v" version))))
5731 (file-name (git-file-name name version))
5732 (sha256
5733 (base32
5734 "107d2vgdlkqm8ggacxn1biamganvqz29nhi0zbn7yhmfmzvs1mbq"))))
5735 (build-system gnu-build-system)
5736 (arguments
5737 (list
5738 #:imported-modules %go-build-system-modules
5739 #:modules '((guix build gnu-build-system)
5740 ((guix build go-build-system) #:prefix go:)
5741 (guix build union)
5742 (guix build utils))
5743 #:phases
5744 #~(modify-phases %standard-phases
5745 (delete 'configure) ; no configure script
5746 (add-before 'build 'setup-go-environment
5747 (assoc-ref go:%standard-phases 'setup-go-environment))
5748 (add-before 'check 'set-go-HOME
5749 (lambda _
5750 (setenv "HOME" (getcwd))))
5751 (add-before 'check 'disable-failing-test
5752 (lambda _
5753 ;; This test relies on writing to /proc/%d/oom_score_adj.
5754 (substitute* "Makefile"
5755 (("go test -v" match)
5756 (string-append match " -vet=off -skip 'TestI'"))))))
5757 #:make-flags
5758 #~(list (string-append "CC=" #$(cc-for-target))
5759 (string-append "VERSION=v" #$version)
5760 (string-append "PREFIX=" #$output)
5761 (string-append "SYSCONFDIR=" #$output "/etc")
5762 ;; Do not try installing systemd files to /etc/systemd.
5763 "SYSTEMDUNITDIR=/tmp/dummy")
5764 #:test-target "test"))
5765 (native-inputs
5766 (append
5767 ;; To generate the manpage.
5768 (if (or (target-x86-64?) (target-x86-32?))
5769 (list pandoc)
5770 '())
5771 (list
5772 ;; For the test suite.
5773 cppcheck
5774 go
5775 go-github-com-c9s-goprocinfo)))
5776 (home-page "https://github.com/rfjakob/earlyoom")
5777 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
5778 (description "Early OOM is a minimalist out of memory (OOM) daemon that
5779runs in user space and provides a more responsive and configurable alternative
5780to the in-kernel OOM killer.")
5781 (license license:expat)))
5782
5783(define-public eudev
5784 (package
5785 (name "eudev")
5786 (version "3.2.14")
5787 (source (origin
5788 (method git-fetch)
5789 (uri (git-reference (url "https://github.com/eudev-project/eudev")
5790 (commit (string-append "v" version))))
5791 (file-name (git-file-name name version))
5792 (sha256
5793 (base32
5794 "1f6lz57igi7iw2ls3fpzgw42bfznam4nf9368h7x8yf1mb737yxz"))))
5795 (build-system gnu-build-system)
5796 (arguments
5797 (list
5798 ;; The binary should be built to look for its rules under
5799 ;; /etc/udev/rules.d, which is where the udev-shepherd-service keeps
5800 ;; them.
5801 #:make-flags #~(list "udevrulesdir=/etc/udev/rules.d")
5802 #:phases
5803 #~(modify-phases %standard-phases
5804 (add-before 'bootstrap 'patch-file-names
5805 (lambda* (#:key inputs native-inputs #:allow-other-keys)
5806 (substitute* "man/make.sh"
5807 (("/usr/bin/xsltproc")
5808 (search-input-file (or native-inputs inputs) "/bin/xsltproc")))))
5809 (add-before 'bootstrap 'install-in-lib
5810 (lambda _
5811 ;; When the udev-service-type instantiates /etc, it collects
5812 ;; hardware files from the <package>/lib/udev/hwdb.d directories
5813 ;; of different packages. Since we set sysconfdir to /etc, the
5814 ;; only package-dependent location we can install hwdb files is
5815 ;; in <package>/lib/udev/hwdb.d. Eudev is configured to install
5816 ;; these files in sysconfdir, but they should be placed into
5817 ;; udevlibexecdir.
5818 (copy-file "hwdb/Makefile.am" "hwdb/files.am")
5819 (call-with-output-file "hwdb/Makefile.am"
5820 (lambda (port)
5821 (format port "hardwarelibdir = $(udevlibexecdir)/hwdb.d\n")
5822 (format port "include ./files.am")))
5823 (substitute* "hwdb/files.am"
5824 (("dist_udevhwdb_DATA =")
5825 "dist_hardwarelib_DATA ="))
5826 ;; Do not install the empty udev.conf template.
5827 (substitute* "src/udev/Makefile.am"
5828 (("dist_udevconf_DATA =")
5829 "dist_noinst_DATA ="))
5830 ;; Do not ensure that /etc/udev/rules.d exists.
5831 (substitute* "rules/Makefile.am"
5832 (("\\$\\(MKDIR_P\\) \\$\\(DESTDIR\\)\\$\\(udevconfdir\\)/rules\\.d")
5833 "true"))))
5834 (add-after 'install 'move-static-library
5835 (lambda _
5836 (let ((source (string-append #$output "/lib/libudev.a"))
5837 (target (string-append #$output:static "/lib/libudev.a")))
5838 (mkdir-p (dirname target))
5839 (link source target)
5840 (delete-file source)
5841 ;; Remove reference to the static library from the .la file
5842 ;; such that Libtool looks for it in the usual places.
5843 (substitute* (string-append #$output "/lib/libudev.la")
5844 (("old_library=.*")
5845 "old_library=''\n")))))
5846 (replace 'install
5847 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
5848 ;; Although the runtime udevrulesdir is set to
5849 ;; /etc/udev/rules.d, the package should provide its default
5850 ;; rules under $libdir/udev/rules.d.
5851 (let* ((default-udev-rules.d (string-append #$output
5852 "/lib/udev/rules.d"))
5853 (make-flags (cons (string-append "udevrulesdir="
5854 default-udev-rules.d)
5855 (delete "udevrulesdir=/etc/udev/rules.d"
5856 make-flags))))
5857 (apply (assoc-ref %standard-phases 'install)
5858 `(,@args #:make-flags ,make-flags))))))
5859 #:configure-flags
5860 #~(list "--enable-manpages"
5861 ;; By default, autoconf uses $prefix/etc. The udev-service-type
5862 ;; makes sure /etc is set up with rules and hardware file
5863 ;; descriptions.
5864 "--sysconfdir=/etc")))
5865 (native-search-paths
5866 (list (search-path-specification
5867 (variable "UDEV_HWDB_PATH")
5868 (files '("lib/udev/hwdb.d")))))
5869 (native-inputs
5870 (list autoconf
5871 automake
5872 gperf
5873 libtool
5874 pkg-config
5875 ;; For tests.
5876 perl
5877 python-wrapper
5878 ;; For documentation.
5879 docbook-xml-4.2
5880 docbook-xsl
5881 libxslt))
5882 (inputs
5883 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
5884 ;; and similar; it also installs the '60-persistent-storage.rules' file,
5885 ;; which contains the rules to do that.
5886 (list `(,util-linux "lib") ;for blkid
5887 kmod))
5888 (outputs '("out" "static"))
5889 (home-page "https://github.com/eudev-project/eudev")
5890 (synopsis "Userspace device management")
5891 (description "Udev is a daemon which dynamically creates and removes
5892device nodes from /dev/, handles hotplug events and loads drivers at boot
5893time.")
5894 (license license:gpl2+)))
5895
5896(define-public python-evdev
5897 (package
5898 (name "python-evdev")
5899 (version "1.9.1")
5900 (source
5901 (origin
5902 (method git-fetch) ; no tests data in PyPi package
5903 (uri (git-reference
5904 (url "https://github.com/gvalkov/python-evdev")
5905 (commit (string-append "v" version))))
5906 (file-name (git-file-name name version))
5907 (sha256
5908 (base32 "09p7pj0xhv23hqlpx865klrxrf7x6sw1bdsgs6pq900jvz92pl16"))))
5909 (build-system pyproject-build-system)
5910 (arguments
5911 (list
5912 #:test-flags
5913 ;; Silent tests requiring access to /dev/uinput.
5914 #~(list "-k" (string-append "not test_open"
5915 " and not test_open_context"
5916 " and not test_enable_events"
5917 " and not test_abs_values"
5918 " and not test_write"))
5919 #:phases
5920 #~(modify-phases %standard-phases
5921 (add-before 'build 'fix-hard-coded-directory
5922 (lambda* (#:key inputs #:allow-other-keys)
5923 (substitute* "setup.py"
5924 (("/usr/include/linux")
5925 (string-append
5926 (assoc-ref inputs "kernel-headers") "/include/linux"))))))))
5927 (native-inputs
5928 (list python-pytest python-setuptools python-wheel))
5929 (home-page "https://github.com/gvalkov/python-evdev")
5930 (synopsis "Bindings to the Linux input handling subsystem")
5931 (description
5932 "Python-evdev provides bindings to the generic input event interface in
5933Linux. The @code{evdev} interface serves the purpose of passing events
5934generated in the kernel directly to userspace through character devices that
5935are typically located in @file{/dev/input/}.
5936
5937This package also comes with bindings to @code{uinput}, the userspace input
5938subsystem. @code{uinput} allows userspace programs to create and handle input
5939devices that can inject events directly into the input subsystem.")
5940 (license license:bsd-3)))
5941
5942(define-public interception-tools
5943 (package
5944 (name "interception-tools")
5945 (version "0.6.8")
5946 (home-page "https://gitlab.com/interception/linux/tools")
5947 (source (origin
5948 (method git-fetch)
5949 (uri (git-reference
5950 (url home-page)
5951 (commit (string-append "v" version))))
5952 (file-name (git-file-name name version))
5953 (sha256
5954 (base32
5955 "1sbidym6ld4c8cx2ww5i54zsv8v0kygv15zq1yimz44v4my605wf"))))
5956 (build-system cmake-build-system)
5957 (native-inputs
5958 (list pkg-config))
5959 (inputs
5960 (list boost libevdev eudev yaml-cpp))
5961 (arguments
5962 `(#:tests? #f)) ; no test suite
5963 (synopsis "Utilities for operating on input events of evdev devices")
5964 (description
5965 "Interception Tools provides a composable infrastructure on top of
5966@code{libudev} and @code{libevdev}. The following utilities are provided:
5967
5968@itemize
5969@item @command{udevmon} --- monitor input devices for launching tasks
5970@item @command{intercept} --- redirect device input events to stdout
5971@item @command{uinput} --- redirect device input events from stding to virtual device
5972@item @command{mux} --- mux streams of input events
5973@end itemize")
5974 ;; Dual-licensed under GPLv3+ or "something else" on request, per
5975 ;; 'README.md'.
5976 (license license:gpl3+)))
5977
5978(define-public interception-dual-function-keys
5979 (package
5980 (name "interception-dual-function-keys")
5981 (version "1.5.0")
5982 (home-page "https://gitlab.com/interception/linux/plugins/dual-function-keys")
5983 (source (origin
5984 (method git-fetch)
5985 (uri (git-reference
5986 (url home-page)
5987 (commit version)))
5988 (file-name (git-file-name name version))
5989 (sha256
5990 (base32
5991 "17jc02wh45yk427qryb0ydyim16607i31wyghbsahahd6mrh9ylv"))))
5992 (build-system gnu-build-system)
5993 (inputs
5994 (list libevdev yaml-cpp))
5995 (arguments
5996 `(#:make-flags (list ,(string-append "CC=" (cc-for-target))
5997 ,(string-append "CXX=" (cxx-for-target))
5998 (string-append "PREFIX=" %output))
5999 #:phases
6000 (modify-phases %standard-phases
6001 (add-after 'unpack 'fix-libevdev-path
6002 (lambda* (#:key inputs #:allow-other-keys)
6003 (let ((libevdev (assoc-ref inputs "libevdev")))
6004 (substitute* "config.mk"
6005 (("/usr/include/libevdev-1.0")
6006 (string-append libevdev "/include/libevdev-1.0")))
6007 #t)))
6008 ;; No configure script
6009 (delete 'configure))
6010 ;; No tests are included.
6011 #:tests? #f))
6012 (synopsis "Tap for one key, hold for another")
6013 (description
6014 "Dual Function Keys is a plugin for @code{interception-tools} that allows
6015one to send arbitrary keycodes when a given key is tapped or held.")
6016 (license license:expat)))
6017
6018(define-public lvm2
6019 (package
6020 (name "lvm2")
6021 (version "2.03.22")
6022 (source (origin
6023 (method url-fetch)
6024 (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2."
6025 version ".tgz")
6026 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
6027 version ".tgz")))
6028 (sha256
6029 (base32
6030 "0z6w6bknhwh1n3qfkb5ij6x57q3wjf28lq3l8kh7rkhsplinjnjc"))
6031 (patches (search-patches "lvm2-no-systemd.patch"))
6032 (modules '((guix build utils)))
6033 (snippet
6034 '(begin
6035 (use-modules (guix build utils))
6036
6037 ;; Honor sysconfdir.
6038 (substitute* "make.tmpl.in"
6039 (("^confdir = .*$")
6040 "confdir = @sysconfdir@\n")
6041 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
6042 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
6043 (build-system gnu-build-system)
6044 (arguments
6045 (list
6046 #:tests? #f ;The tests use 'mknod', which requires root access.
6047 #:configure-flags
6048 #~(list (string-append "--sysconfdir=" #$output "/etc/lvm")
6049 "--enable-udev_sync"
6050 "--enable-udev_rules"
6051 "--enable-pkgconfig"
6052 "--enable-cmdlib"
6053 "--enable-dmeventd" ;Requires '--enable-cmdlib'.
6054 ;; Make sure programs such as 'dmsetup' can
6055 ;; find libdevmapper.so.
6056 (string-append "LDFLAGS=-Wl,-rpath="
6057 #$output "/lib,-rpath="
6058 #$output "/lib/device-mapper")
6059 ;; This is needed when cross-compiling.
6060 #$@(if (%current-target-system)
6061 '("ac_cv_func_malloc_0_nonnull=yes"
6062 "ac_cv_func_realloc_0_nonnull=yes")
6063 '()))
6064 #:phases
6065 #~(modify-phases %standard-phases
6066 (add-after 'unpack 'update-config
6067 (lambda* (#:key inputs native-inputs #:allow-other-keys)
6068 (install-file (search-input-file (or native-inputs inputs)
6069 "/bin/config.sub")
6070 "autoconf")
6071 (install-file (search-input-file (or native-inputs inputs)
6072 "/bin/config.guess")
6073 "autoconf")))
6074 (add-after 'configure 'set-makefile-shell
6075 (lambda _
6076 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
6077 ;; expected.
6078 (setenv "SHELL" (which "sh"))
6079
6080 ;; Replace /bin/sh with the right file name.
6081 (patch-makefile-SHELL "make.tmpl"))))))
6082 (native-inputs (list config pkg-config procps)) ;tests use 'pgrep'
6083 (inputs (list libaio eudev))
6084 (supported-systems (remove target-hurd? %supported-systems))
6085 (home-page "https://sourceware.org/lvm2/")
6086 (synopsis "Logical volume management for Linux")
6087 (description
6088 "LVM2 is the logical volume management tool set for Linux-based systems.
6089This package includes the user-space libraries and tools, including the device
6090mapper. Kernel components are part of Linux-libre.")
6091
6092 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
6093 ;; Command-line tools are GPLv2.
6094 (license (list license:gpl2 license:lgpl2.1))))
6095
6096(define-public (libdevmapper-propagated-inputs)
6097 (list eudev))
6098
6099(define-public lvm2-static
6100 (package
6101 (inherit lvm2)
6102 (name "lvm2-static")
6103 (arguments
6104 (substitute-keyword-arguments arguments
6105 ((#:configure-flags flags #~(list))
6106 ;; LVM2 doesn't use Libtool, hence the custom option.
6107 #~(append (list "--enable-static_link")
6108 ;; Building dmeventd statically is complicated due to a
6109 ;; requirement on libdevmapper.a, which is being phased out
6110 ;; in favor of libdevice-mapper.a, which in turn is is not
6111 ;; easily made available at dmeventd build time. Just ignore
6112 ;; it until the situation improves.
6113 (delete "--enable-dmeventd" #$flags)))
6114 ((#:phases phases)
6115 #~(modify-phases #$phases
6116 (add-before 'configure 'adjust-Makefile
6117 (lambda _
6118 ;; These fixes are related to the upstream libdm->device_mapper
6119 ;; migration and will hopefully be fixed upstream in due time.
6120 (substitute* "tools/Makefile.in"
6121 ;; This variable is empty in a static configuration and causes
6122 ;; an erroneous GCC command line.
6123 (("-L\\$\\(interfacebuilddir\\)") "")
6124 ;; Remove obsolete reference to libdevmapper.a.
6125 (("-ldevmapper")
6126 ""))))
6127 (add-after 'install 'adjust-pkgconfig
6128 ;; The static eudev is missing its pkg config file, and I am not
6129 ;; rebuilding it at this point.
6130 (lambda* (#:key inputs #:allow-other-keys)
6131 (substitute* (string-append #$output
6132 "/lib/pkgconfig/devmapper.pc")
6133 (("Requires.private: .*")
6134 "")
6135 (("Libs.private:")
6136 (format #f "Libs.private: -L~a -ludev"
6137 (dirname
6138 (search-input-file inputs
6139 "lib/libudev.a")))))))))))
6140 (inputs (modify-inputs inputs
6141 (append (list eudev "static"))))
6142 (synopsis "Logical volume management for Linux (statically linked)")))
6143
6144(define-public thin-provisioning-tools
6145 (package
6146 (name "thin-provisioning-tools")
6147 (version "0.8.5")
6148 (source
6149 (origin
6150 (method git-fetch)
6151 (uri (git-reference
6152 (url "https://github.com/jthornber/thin-provisioning-tools")
6153 (commit (string-append "v" version))))
6154 (file-name (git-file-name name version))
6155 (sha256
6156 (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19"))))
6157 (build-system gnu-build-system)
6158 (arguments
6159 ;; Doesn't build with --enable-testing due to a function name collision
6160 ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released.
6161 (list #:tests? #f))
6162 (native-inputs (list autoconf automake))
6163 (inputs (list boost expat libaio))
6164 (synopsis "Tools for manipulating the metadata of device-mapper targets")
6165 (description "A suite of tools for manipulating the metadata of the
6166dm-thin, dm-cache and dm-era device-mapper targets.")
6167 (home-page "https://github.com/jthornber/thin-provisioning-tools")
6168 (license license:gpl3+)))
6169
6170(define-public watchdogd
6171 (package
6172 (name "watchdogd")
6173 (version "4.1")
6174 (source (origin
6175 (method git-fetch)
6176 (uri (git-reference
6177 (url "https://github.com/troglobit/watchdogd")
6178 (commit version)))
6179 (file-name (git-file-name name version))
6180 (sha256
6181 (base32
6182 "1n5xq5gxrj8b8j2g323k0jpxabjnq9piw8v2fqcyphj33kmgay23"))))
6183 (build-system gnu-build-system)
6184 (native-inputs (list autoconf automake libtool pkg-config))
6185 (inputs (list libconfuse libite libuev))
6186 (synopsis "Advanced system & process supervisor for Linux")
6187 (description "This package provides an advanced monitor of critical system
6188resources, supervises the heartbeat of processes, records deadline
6189transgressions, and initiates a controlled reset if needed.")
6190 (home-page "https://troglobit.com/projects/watchdogd/")
6191 (license license:isc)))
6192
6193(define-public wireless-tools
6194 (package
6195 (name "wireless-tools")
6196 (version "30.pre9")
6197 (source
6198 (origin
6199 (method url-fetch)
6200 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/"
6201 "Linux/wireless_tools." version ".tar.gz"))
6202 (sha256
6203 (base32 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
6204 (snippet
6205 #~(begin
6206 ;; Remove the older header files that are not free software.
6207 (for-each (lambda (n)
6208 (delete-file (format #f "wireless.~a.h" n)))
6209 '(10 11 12 13 14 15 16 17 18 19 20))))))
6210 (build-system gnu-build-system)
6211 (arguments
6212 (list #:make-flags
6213 #~(list (string-append "PREFIX=" #$output)
6214 (string-append "INSTALL_MAN=" #$output "/share/man")
6215 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
6216 "BUILD_STATIC=")
6217 #:phases
6218 #~(modify-phases %standard-phases
6219 (replace 'configure
6220 (lambda* (#:key target #:allow-other-keys)
6221 (when target
6222 ;; Cross-compilation: use the cross tools.
6223 (substitute* (find-files "." "Makefile")
6224 (("CC = .*$")
6225 (string-append "CC = " target "-gcc\n"))
6226 (("AR = .*$")
6227 (string-append "AR = " target "-ar\n"))
6228 (("RANLIB = .*$")
6229 (string-append "RANLIB = " target "-ranlib\n")))))))
6230 #:tests? #f))
6231 (synopsis "Tools for manipulating Linux Wireless Extensions")
6232 (description "Wireless Tools are used to manipulate the now-deprecated
6233Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
6234Extension was an interface allowing you to set Wireless LAN specific
6235parameters and get the specific stats. It is deprecated in favor the nl80211
6236interface.")
6237 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
6238 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
6239 ;; other files are distributed under gpl2.
6240 (license (list license:gpl2 license:lgpl2.1+))))
6241
6242(define-public crda
6243 (package
6244 (name "crda")
6245 (version "4.15")
6246 (source
6247 (origin
6248 (method git-fetch)
6249 (uri (git-reference
6250 (url "https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/crda.git")
6251 (commit (string-append "v" version))))
6252 (file-name (git-file-name name version))
6253 (sha256
6254 (base32 "1ajh8zx84p15y9wawh764zawniwn059iw9m32v56ajvkz9xbnkp2"))
6255 (patches (search-patches "crda-optional-gcrypt.patch"))))
6256 (build-system gnu-build-system)
6257 (arguments
6258 (list #:phases
6259 #~(modify-phases %standard-phases
6260 (delete 'configure)
6261 (add-after 'unpack 'gzip-deterministically
6262 (lambda _
6263 (substitute* "Makefile"
6264 (("gzip" command)
6265 (string-append command " --no-name")))))
6266 #$@(if (%current-target-system)
6267 #~((add-after 'unpack 'fix-pkg-config
6268 (lambda* (#:key target #:allow-other-keys)
6269 (substitute* "Makefile"
6270 (("pkg-config" command)
6271 (string-append target "-" command))))))
6272 #~())
6273 (add-before 'build 'patch-Makefile
6274 (lambda _
6275 (substitute* "Makefile"
6276 (("ldconfig") "true"))))
6277 (add-before 'build 'set-regulatory-db-file-name
6278 (lambda* (#:key native-inputs inputs #:allow-other-keys)
6279 ;; Tell CRDA where to find our database.
6280 (let ((regdb (assoc-ref (or native-inputs inputs)
6281 "wireless-regdb")))
6282 (substitute* "crda.c"
6283 (("\"/lib/crda/regulatory.bin\"")
6284 (string-append "\"" regdb
6285 "/lib/crda/regulatory.bin\"")))))))
6286 #:test-target "verify"
6287 #:make-flags
6288 #~(list
6289 (string-append "CC=" #$(cc-for-target))
6290 "V=1"
6291
6292 ;; Disable signature-checking on 'regulatory.bin'.
6293 ;; The reason is that this simplifies maintenance
6294 ;; on our side (no need to manage a distro key
6295 ;; pair), and we can guarantee integrity of
6296 ;; 'regulatory.bin' by other means anyway, such as
6297 ;; 'guix gc --verify'. See
6298 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
6299 ;; for a discssion.
6300 "USE_OPENSSL=0"
6301
6302 (string-append "PREFIX=" #$output)
6303 (string-append "SBINDIR=" #$output "/sbin/")
6304 (string-append "UDEV_RULE_DIR="
6305 #$output "/lib/udev/rules.d")
6306 (string-append "LDFLAGS=-Wl,-rpath="
6307 #$output "/lib -L.")
6308 (string-append "REG_BIN="
6309 #$(this-package-native-input "wireless-regdb")
6310 "/lib/crda/regulatory.bin")
6311 "all_noverify")))
6312 (native-inputs (list pkg-config wireless-regdb))
6313 (inputs (list libnl))
6314 (home-page
6315 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
6316 (synopsis "@acronym{CRDA, Central Regulatory Domain Agent} for WiFi")
6317 (description
6318 "The @acronym{CRDA, Central Regulatory Domain Agent} acts as the udev
6319helper for communication between the kernel Linux and user space for regulatory
6320compliance.")
6321 (license license:copyleft-next)))
6322
6323(define-public wireless-regdb
6324 (package
6325 (name "wireless-regdb")
6326 (version "2026.09.03")
6327 (source (origin
6328 (method url-fetch)
6329 (uri (string-append
6330 "mirror://kernel.org/software/network/wireless-regdb/"
6331 "wireless-regdb-" version ".tar.xz"))
6332 (sha256
6333 (base32 "13gmrcsbnkp98b20vqd50d8klxsvl60ydaw0qb8hr0kv480hjbmj"))
6334 ;; We're building 'regulatory.bin' and 'regulatory.db' by
6335 ;; ourselves.
6336 (snippet '(begin
6337 (map delete-file '("regulatory.bin"
6338 "regulatory.db"))))))
6339 (build-system gnu-build-system)
6340 (arguments
6341 (list
6342 #:phases
6343 #~(modify-phases %standard-phases
6344 (add-after 'unpack 'gzip-determinism
6345 (lambda _
6346 (substitute* "Makefile"
6347 (("gzip") "gzip --no-name"))))
6348 (replace 'build
6349 (lambda* (#:key (make-flags '()) #:allow-other-keys)
6350 (apply invoke "make" "regulatory.db" make-flags)))
6351 (add-after 'build 'build-regulatory.bin-unsigned
6352 (lambda* (#:key (make-flags '()) #:allow-other-keys)
6353 (apply invoke "make" "regulatory.bin"
6354 (cons*
6355 ;; Leave this empty so that db2bin.py doesn't try to sign
6356 ;; ‘regulatory.bin’. This allows us to avoid managing a key
6357 ;; pair for the whole distribution.
6358 "REGDB_PRIVKEY="
6359 ;; Don't generate a public key for the same reason. These are
6360 ;; used as Makefile targets and can't be the empty string.
6361 "REGDB_PUBCERT=/dev/null"
6362 "REGDB_PUBKEY=/dev/null"
6363 make-flags))))
6364 ;; We check if the 'regulatory.db' we just built is the same as the
6365 ;; one that got signed by upstream.
6366 (replace 'check
6367 (lambda _
6368 (invoke "openssl" "smime"
6369 "-verify" "-inform" "DER"
6370 "-signer" "wens.x509.pem"
6371 "-in" "regulatory.db.p7s" "-content" "regulatory.db"
6372 "-out" "/dev/null"
6373 "-CAfile" "wens.x509.pem")))
6374 (delete 'configure)) ; no configure script
6375 #:make-flags
6376 #~(list (string-append "PREFIX=" #$output)
6377 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware"))))
6378 (native-inputs (list openssl ; to verify signature
6379 python-wrapper))
6380 (home-page
6381 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
6382 (synopsis "Wireless regulatory database")
6383 (description
6384 "This package contains the wireless regulatory database used by the Linux
6385cfg80211 subsystem and the legacy @acronym{CRDA, Central Regulatory Database
6386Agent}. The database contains information on country-specific regulations for
6387the wireless spectrum.")
6388 (license license:isc)))
6389
6390(define-public lm-sensors
6391 (package
6392 (name "lm-sensors")
6393 (version "3.6.2")
6394 (source
6395 (origin
6396 (method git-fetch)
6397 (uri (git-reference
6398 (url "https://github.com/hramrach/lm-sensors")
6399 (commit (string-append "V" (string-join
6400 (string-split version #\.) "-")))))
6401 (file-name (git-file-name name version))
6402 (sha256
6403 (base32 "0p2ck8p9zb1w53l37pvm6c10vi6r8bfz51nd3sdwwsfhfhgvsr0j"))
6404 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
6405 (build-system gnu-build-system)
6406 (outputs '("lib" ; avoid perl in closure
6407 "out"))
6408 (arguments
6409 (list
6410 #:tests? #f ; no 'check' target
6411 #:make-flags
6412 #~(list (string-append "PREFIX=" #$output)
6413 (string-append "ETCDIR=" #$output:lib "/etc")
6414 (string-append "INCLUDEDIR=" #$output:lib "/include")
6415 (string-append "MANDIR=" #$output "/share/man")
6416 (string-append "LIBDIR=" #$output:lib "/lib"))
6417 #:phases
6418 #~(modify-phases %standard-phases
6419 (delete 'configure)
6420 (add-before 'build 'patch-exec-paths
6421 (lambda* (#:key inputs #:allow-other-keys)
6422 (substitute* "prog/detect/sensors-detect"
6423 (("`uname")
6424 (string-append
6425 "`" (assoc-ref inputs "coreutils") "/bin/uname"))
6426 (("(`|\")modprobe" all open-quote)
6427 (string-append
6428 open-quote #$(this-package-input "kmod") "/bin/modprobe")))
6429 (substitute* '("prog/pwm/pwmconfig" "prog/pwm/fancontrol")
6430 (("gnuplot")
6431 (search-input-file inputs "/bin/gnuplot"))
6432 (("cat ")
6433 (string-append (search-input-file inputs "/bin/cat") " "))
6434 (("e?grep " match)
6435 (string-append
6436 (search-input-file
6437 inputs (string-append "/bin/" (string-trim-right match)))
6438 " "))
6439 (("sed -e")
6440 (string-append (search-input-file inputs "/bin/sed") " -e"))
6441 (("cut -d")
6442 (string-append (search-input-file inputs "/bin/cut") " -d"))
6443 (("sleep ")
6444 (string-append (search-input-file inputs "/bin/sleep") " "))
6445 (("readlink -f")
6446 (string-append
6447 (search-input-file inputs "/bin/readlink") " -f"))))))))
6448 (inputs
6449 (list gnuplot kmod perl rrdtool))
6450 (native-inputs
6451 (list bison flex pkg-config which))
6452 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
6453 (synopsis "Utilities to read temperature/voltage/fan sensors")
6454 (description
6455 "Lm-sensors is a hardware health monitoring package for Linux. It allows
6456you to access information from temperature, voltage, and fan speed sensors.
6457It works with most newer systems.")
6458 (license license:gpl2+)))
6459
6460(define-public iucode-tool
6461 (package
6462 (name "iucode-tool")
6463 (version "2.3.1")
6464 (source (origin
6465 (method url-fetch)
6466 (uri (string-append "https://gitlab.com/iucode-tool/releases"
6467 "/raw/latest/iucode-tool_" version ".tar.xz"))
6468 (sha256
6469 (base32
6470 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
6471 (build-system gnu-build-system)
6472 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
6473 (synopsis "Manipulate Intel microcode bundles")
6474 (description
6475 "@command{iucode_tool} is a utility to work with microcode packages for
6476Intel processors. It can convert between formats, extract specific versions,
6477create a firmware image suitable for the Linux kernel, and more.")
6478 ;; cpuid.h is available for i686, x86_64, and ia64.
6479 (supported-systems '("i686-linux" "x86_64-linux"))
6480 (license license:gpl2+)))
6481
6482(define-public i2c-tools
6483 (package
6484 (name "i2c-tools")
6485 (version "4.3")
6486 (source (origin
6487 (method url-fetch)
6488 (uri (string-append
6489 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
6490 version ".tar.xz"))
6491 (sha256
6492 (base32
6493 "1y0fphjd5ah2j886x8i175r7viq0hmx666hyca0wi4dzrm290qxk"))))
6494 (build-system gnu-build-system)
6495 (arguments
6496 `(#:tests? #f ; no 'check' target
6497 #:make-flags
6498 ,#~(list (string-append "PREFIX=" #$output)
6499 (string-append "LDFLAGS+=-Wl,-rpath=" #$output "/lib")
6500 (string-append "CC=" #$(cc-for-target)))
6501 ;; No configure script.
6502 #:phases (modify-phases %standard-phases (delete 'configure))))
6503 (inputs
6504 (list perl))
6505 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
6506 (synopsis "I2C tools for Linux")
6507 (description
6508 "The i2c-tools package contains a heterogeneous set of I2C tools for
6509Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
6510EEPROM decoding scripts, EEPROM programming tools, and a python module for
6511SMBus access.")
6512 (license license:gpl2+)))
6513
6514(define-public i2c-tools-3
6515 (package
6516 (inherit i2c-tools)
6517 (name "i2c-tools")
6518 (version "3.1.2")
6519 (source (origin
6520 (method url-fetch)
6521 (uri (string-append
6522 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
6523 version ".tar.bz2"))
6524 (sha256
6525 (base32 "0hd4c1w8lnwc3j95h3vpd125170l1d4myspyrlpamqx6wbr6jpnv"))))
6526 (arguments
6527 (substitute-keyword-arguments arguments
6528 ((#:make-flags _)
6529 #~(list (string-append "prefix=" #$output)
6530 (string-append "CC=" #$(cc-for-target))))))))
6531
6532(define-public python-smbus
6533 (package
6534 (inherit i2c-tools)
6535 (name "python-smbus")
6536 (build-system pyproject-build-system)
6537 (arguments
6538 (list #:tests? #f ;; No test suite.
6539 #:phases
6540 #~(modify-phases %standard-phases
6541 (add-after 'unpack 'change-directory
6542 (lambda _ (chdir "py-smbus")))
6543 (add-after 'change-directory 'set-library-path
6544 (lambda _
6545 (substitute* "setup.py"
6546 (("-L\\.\\./lib")
6547 (string-append "-L" #$(this-package-input "i2c-tools")
6548 "/lib"))))))))
6549 (inputs (list i2c-tools))
6550 (native-inputs (list python-setuptools python-wheel))
6551 (synopsis "I2C/SMBus access for Python")
6552 (description "This package provides a Python library to access
6553@acronym{I2C, Inter-Integrated Circuit} and @acronym{SMBus, System
6554Management Bus} devices on Linux.")))
6555
6556(define-public xsensors
6557 (package
6558 (name "xsensors")
6559 (version "0.70")
6560 (source (origin
6561 (method url-fetch)
6562 (uri (string-append
6563 "http://www.linuxhardware.org/xsensors/xsensors-"
6564 version ".tar.gz"))
6565 (sha256
6566 (base32
6567 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
6568 (build-system gnu-build-system)
6569 (arguments
6570 `(#:phases
6571 (modify-phases %standard-phases
6572 (add-before 'configure 'enable-deprecated
6573 (lambda _
6574 (substitute* "src/Makefile.in"
6575 (("-DGDK_DISABLE_DEPRECATED") "")
6576 (("-DGTK_DISABLE_DEPRECATED") ""))))
6577 (add-before 'configure 'remove-Werror
6578 (lambda _
6579 (substitute* '("configure" "src/Makefile.in")
6580 (("-Werror") "")))))))
6581 (inputs (list (list lm-sensors "lib") gtk+-2))
6582 (native-inputs (list pkg-config))
6583 (home-page "http://www.linuxhardware.org/xsensors/")
6584 (synopsis "Hardware health information viewer")
6585 (description
6586 "Xsensors reads data from the libsensors library regarding hardware
6587health such as temperature, voltage and fan speed and displays the information
6588in a digital read-out.")
6589 (license license:gpl2+)))
6590
6591(define-public perf
6592 (package
6593 (name "perf")
6594 (version (package-version linux-libre))
6595 (source (package-source linux-libre))
6596 (build-system gnu-build-system)
6597 (arguments
6598 '(#:phases
6599 (modify-phases %standard-phases
6600 (replace 'configure
6601 (lambda* (#:key inputs #:allow-other-keys)
6602 (setenv "SHELL_PATH" (which "bash"))
6603 (chdir "tools/perf")
6604
6605 ;; In Linux 6.10.6, 'Makefile.config' overrides PKG_CONFIG_PATH
6606 ;; when looking for libtraceevent and thus fails to find it.
6607 ;; Remove that.
6608 (substitute* "Makefile.config"
6609 (("PKG_CONFIG_PATH=[[:graph:]]+")
6610 ""))
6611
6612 ;; This file hard-codes file system layouts for specific distros
6613 ;; but not for ours; address that. With this change, one can run
6614 ;; "perf report --symfs=$HOME/.guix-profile" (without
6615 ;; "/lib/debug") and 'perf' should be able to find separate debug
6616 ;; info files.
6617 (substitute* "util/dso.c"
6618 (("/usr/lib/debug")
6619 "/lib/debug")))))
6620 #:make-flags (list (string-append "prefix="
6621 (assoc-ref %outputs "out"))
6622 "CC=gcc"
6623 "WERROR=0"
6624
6625 ;; By default, 'config/Makefile' uses lib64 on
6626 ;; x86_64. Work around that.
6627 "lib=lib")
6628 #:tests? #f)) ;no tests
6629 (native-inputs
6630 (list pkg-config
6631 bison
6632 flex
6633 ;; For build scripts.
6634 python-3
6635 ;; Documentation
6636 docbook-xsl
6637 xmlto
6638 asciidoc))
6639 (inputs
6640 (list slang ;for the interactive TUI
6641 zlib
6642 ;; newt
6643 python-3 ;'perf' links against libpython
6644 elfutils
6645 libiberty ;used alongside BDF for symbol demangling
6646 libunwind ;better stack walking
6647 libtraceevent
6648 numactl)) ;for 'perf bench numa mem'
6649 (home-page "https://perf.wiki.kernel.org/")
6650 (synopsis "Linux profiling with performance counters")
6651 (description
6652 "perf is a tool suite for profiling using hardware performance counters,
6653with support in the Linux kernel. perf can instrument CPU performance
6654counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
6655of lightweight profiling. This package contains the user-land tools and in
6656particular the @code{perf} command.")
6657 (license (package-license linux-libre))))
6658
6659(define-public pflask
6660 (package
6661 (name "pflask")
6662 (version "0.2")
6663 (source (origin
6664 (method git-fetch)
6665 (uri (git-reference
6666 (url "https://github.com/ghedo/pflask")
6667 (commit (string-append "v" version))))
6668 (file-name (git-file-name name version))
6669 (sha256
6670 (base32
6671 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
6672 (build-system cmake-build-system)
6673 (arguments
6674 '(#:tests? #f)) ; no tests
6675 (home-page "https://ghedo.github.io/pflask/")
6676 (synopsis "Simple tool for creating Linux namespace containers")
6677 (description "pflask is a simple tool for creating Linux namespace
6678containers. It can be used for running a command or even booting an OS inside
6679an isolated container, created with the help of Linux namespaces. It is
6680similar in functionality to chroot, although pflask provides better isolation
6681thanks to the use of namespaces.")
6682 (license license:bsd-2)))
6683
6684(define-public singularity
6685 (package
6686 (name "singularity")
6687 (version "2.6.1")
6688 (source (origin
6689 (method url-fetch)
6690 (uri (string-append "https://github.com/singularityware/singularity/"
6691 "releases/download/" version
6692 "/singularity-" version ".tar.gz"))
6693 (sha256
6694 (base32
6695 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
6696 (modules '((guix build utils)))
6697 (snippet
6698 '(begin
6699 ;; Do not create directories in /var.
6700 (substitute* "Makefile.in"
6701 (("\\$\\(MAKE\\) .*install-data-hook") ""))
6702
6703 ;; The original source overrides PATH so that it points to
6704 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
6705 ;; on Guix System. Leave PATH unchanged so we refer to the
6706 ;; installed Coreutils, grep, etc.
6707 (substitute* "bin/singularity.in"
6708 (("^PATH=.*" all)
6709 (string-append "#" all "\n")))
6710
6711 (substitute* (find-files "libexec/cli" "\\.exec$")
6712 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
6713 _ program)
6714 (string-append "/run/privileged/bin/singularity-"
6715 program "-helper")))
6716
6717 ;; These squashfs mount options are apparently no longer
6718 ;; supported since Linux-libre 5.4.5.
6719 (substitute* "src/lib/image/squashfs/mount.c"
6720 (("\"errors=remount-ro\"")
6721 "NULL"))))))
6722 (build-system gnu-build-system)
6723 (arguments
6724 (list
6725 #:configure-flags #~(list "--localstatedir=/var")
6726 #:phases
6727 #~(modify-phases %standard-phases
6728 (add-after 'unpack 'patch-references
6729 (lambda _
6730 (substitute* "libexec/cli/build.exec.in"
6731 (("-mksquashfs") (string-append "-" (which "mksquashfs"))))
6732 (substitute* (append
6733 (find-files "libexec" "functions")
6734 (find-files "libexec/bootstrap-scripts" ".*sh$")
6735 (find-files "libexec/cli" ".*exec$"))
6736 (("\\| grep ")
6737 (string-append "| " (which "grep") " "))
6738 (("egrep ")
6739 (string-append (which "egrep") " "))
6740 ((" sed ")
6741 (string-append " " (which "sed") " ")))))
6742 (add-after 'install 'set-PATH
6743 (lambda _
6744 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
6745 ;; But don't override PATH, so that other tools like zcat and
6746 ;; tar can still be found if they are available.
6747 (let ((coreutils #$(this-package-input "coreutils")))
6748 (wrap-program (string-append #$output "/bin/singularity")
6749 `("PATH" prefix (,(string-append coreutils "/bin"))))
6750 (substitute* (string-append #$output "/bin/run-singularity")
6751 (("/usr/bin/env singularity")
6752 (string-append (which "env") " "
6753 #$output "/bin/singularity")))))))))
6754 (inputs
6755 (list bash-minimal
6756 coreutils
6757 libarchive
6758 python-wrapper
6759 squashfs-tools
6760 zlib))
6761 (home-page "https://singularity.lbl.gov/")
6762 (synopsis "Container platform")
6763 (description "Singularity is a container platform supporting a number of
6764container image formats. It can build SquashFS container images or import
6765existing Docker images. Singularity requires kernel support for container
6766isolation or root privileges.")
6767 (license license:bsd-3)))
6768
6769(define-public python-spython
6770 (package
6771 (name "python-spython")
6772 (version "0.3.13")
6773 (source
6774 (origin
6775 (method url-fetch)
6776 (uri (pypi-uri "spython" version))
6777 (sha256
6778 (base32 "0kly851k6mj7xzcybciav5d0pq5q04pzg7c5a1g712bqbxkha4ck"))))
6779 (build-system pyproject-build-system)
6780 (arguments
6781 (list
6782 #:phases
6783 #~(modify-phases %standard-phases
6784 ;; Configure absolute path to singularity.
6785 (add-after 'unpack 'configure
6786 (lambda* (#:key inputs #:allow-other-keys)
6787 (let ((singularity (search-input-file inputs "bin/singularity")))
6788 (substitute* "spython/utils/terminal.py"
6789 (("software=\"singularity\"")
6790 (string-append "software=\"" singularity "\"")))
6791 (substitute* (list "spython/utils/terminal.py"
6792 "spython/main/help.py"
6793 "spython/main/base/command.py")
6794 (("\\[\"singularity\"")
6795 (string-append "[\"" singularity "\"")))
6796 (substitute* "spython/main/execute.py"
6797 (("shutil.which\\(\"singularity\"\\)")
6798 (string-append "shutil.which(\"" singularity "\")"))))))
6799 ;; Skip tests that require network access.
6800 (add-before 'check 'skip-tests
6801 (lambda _
6802 (delete-file "spython/tests/test_client.py"))))))
6803 (inputs
6804 (list singularity))
6805 (native-inputs
6806 (list python-pytest python-setuptools python-wheel))
6807 (home-page "https://github.com/singularityhub/singularity-cli")
6808 (synopsis "Singularity Python client")
6809 (description "@code{python-spython} is a Python library to interact with
6810Singularity containers.")
6811 (license license:mpl2.0)))
6812
6813(define-public libnvme
6814 (package
6815 (name "libnvme")
6816 (version "1.16.2")
6817 (source (origin
6818 (method git-fetch)
6819 (uri (git-reference
6820 (url "https://github.com/linux-nvme/libnvme.git")
6821 (commit (string-append "v" version))))
6822 (sha256
6823 (base32 "05h1kjs8lgdmfsdz5vcfl470zhw7j36jp7a9wip20ibb6g3s9r1k"))
6824 (file-name (git-file-name name version))))
6825 (build-system meson-build-system)
6826 (outputs (list "out" "doc")) ; docs are 80% of all output
6827 (arguments
6828 (list
6829 #:configure-flags
6830 #~(let ((doc (string-append #$output:doc "/share/doc/" #$name)))
6831 (list (string-append "-Dhtmldir=" doc "/html")
6832 (string-append "-Drstdir=" doc "/rst")
6833 "-Ddocs-build=true" "-Ddocs=all"))))
6834 (native-inputs (list pkg-config perl python python-sphinx))
6835 ;; libnvme.pc, libnvme-mi.pc lists these in Requires.private.
6836 (propagated-inputs (list dbus json-c openssl))
6837 (home-page "https://github.com/linux-nvme/libnvme")
6838 (synopsis "C Library for NVM Express on Linux")
6839 (description "libnvme provides type definitions for NVMe specification
6840structures, enumerations, and bit fields, helper functions to construct,
6841dispatch, and decode commands and payloads, and utilities to connect, scan,
6842and manage nvme devices on a Linux system.")
6843 (license license:lgpl2.1+)))
6844
6845(define-public nvme-cli
6846 (package
6847 (name "nvme-cli")
6848 (version "2.16")
6849 (home-page "https://github.com/linux-nvme/nvme-cli")
6850 (source (origin
6851 (method git-fetch)
6852 (uri (git-reference
6853 (url home-page)
6854 (commit (string-append "v" version))))
6855 (sha256
6856 (base32 "1877fvhd4573900zwk7y2mk2vvmgnws2wa37sv176ikxj647jvw1"))
6857 (file-name (git-file-name name version))))
6858 (build-system meson-build-system)
6859 (outputs (list "out" "doc")) ; docs make up ~70% of total size
6860 (arguments
6861 (list
6862 #:configure-flags #~(list (format #f "-Dhtmldir=~a/share/doc/~a/html"
6863 #$output:doc #$name)
6864 "-Ddocs=all")))
6865 (native-inputs (list pkg-config))
6866 (inputs (list libnvme json-c zlib))
6867 (synopsis "NVM-Express user space tooling for Linux")
6868 (description "Nvme-cli is a utility to provide standards compliant tooling
6869for NVM-Express drives. It was made specifically for Linux as it relies on the
6870IOCTLs defined by the mainline kernel driver.")
6871 (license license:gpl2+)))
6872
6873(define-public acpi
6874 (package
6875 (name "acpi")
6876 (version "1.7")
6877 (source (origin
6878 (method url-fetch)
6879 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
6880 version "/" name "-" version ".tar.gz"))
6881 (sha256
6882 (base32
6883 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
6884 (build-system gnu-build-system)
6885 (home-page "http://acpiclient.sourceforge.net")
6886 (synopsis "Display information on ACPI devices")
6887 (description "@code{acpi} attempts to replicate the functionality of the
6888\"old\" @code{apm} command on ACPI systems, including battery and thermal
6889information. It does not support ACPI suspending, only displays information
6890about ACPI devices.")
6891 (license license:gpl2+)))
6892
6893(define-public acpid
6894 (package
6895 (name "acpid")
6896 (version "2.0.34")
6897 (source (origin
6898 (method url-fetch)
6899 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
6900 version ".tar.xz"))
6901 (sha256
6902 (base32
6903 "0cxkdbd087kj9ikprvvjpk0ixzqbipf2rmj6qyp7r15wzj65q29d"))))
6904 (build-system gnu-build-system)
6905 (home-page "https://sourceforge.net/projects/acpid2/")
6906 (synopsis "Daemon for delivering ACPI events to user-space programs")
6907 (description
6908 "acpid is designed to notify user-space programs of Advanced
6909Configuration and Power Interface (ACPI) events. acpid should be started
6910during the system boot, and will run as a background process. When an ACPI
6911event is received from the kernel, acpid will examine the list of rules
6912specified in /etc/acpi/events and execute the rules that match the event.")
6913 (license license:gpl2+)))
6914
6915(define-public sysfsutils
6916 (package
6917 (name "sysfsutils")
6918 (version "2.1.0")
6919 (source
6920 (origin
6921 (method url-fetch)
6922 (uri
6923 (string-append
6924 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
6925 version ".tar.gz"))
6926 (sha256
6927 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
6928 (build-system gnu-build-system)
6929 (home-page "https://linux-diag.sourceforge.net/Sysfsutils.html")
6930 (synopsis "System utilities based on Linux sysfs")
6931 (description
6932 "These are a set of utilities built upon sysfs, a virtual file system in
6933Linux kernel versions 2.5+ that exposes a system's device tree. The package
6934also contains the libsysfs library.")
6935 ;; The library is under lgpl2.1+ (all files say "or any later version").
6936 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
6937 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
6938
6939(define-public cpufrequtils
6940 (let ((commit "a2f0c39d5f21596bb9f5223e895c0ff210b265d0")
6941 (revision "1"))
6942 (package
6943 (name "cpufrequtils")
6944 (version (git-version "008" revision commit))
6945 (source
6946 (origin
6947 (method git-fetch)
6948 (uri
6949 (git-reference
6950 (url "https://git.kernel.org/pub/scm/linux/kernel/git/brodo/cpufrequtils.git")
6951 (commit commit)))
6952 (file-name (git-file-name name version))
6953 (sha256
6954 (base32 "01n2hp6v89cilqqvqvlcprphyhnljsjclh4h1zf3b1l7ypz29lbp"))))
6955 (build-system gnu-build-system)
6956 (arguments
6957 (list
6958 #:tests? #f ;no test suite
6959 #:make-flags
6960 #~(let ((out #$output))
6961 (list "PROC=false" ;obsoleted by sysfs in Linux 2.6(!)
6962 (string-append "CC=" #$(cc-for-target))
6963 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
6964 "INSTALL=install"
6965 (string-append "bindir=" out "/bin")
6966 (string-append "sbindir=" out "/sbin")
6967 (string-append "mandir=" out "/share/man")
6968 (string-append "includedir=" out "/include")
6969 (string-append "libdir=" out "/lib")
6970 (string-append "localedir=" out "/share/locale")
6971 (string-append "docdir=" out "/share/doc/" #$name)))
6972 #:phases
6973 #~(modify-phases %standard-phases
6974 (delete 'configure)))) ;no configure script
6975 (native-inputs (list gettext-minimal))
6976 (home-page
6977 "http://ftp.be.debian.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html")
6978 (synopsis "Utilities to get and set CPU frequency on Linux")
6979 (description
6980 "The cpufrequtils suite contains utilities to retrieve CPU frequency
6981information, and set the CPU frequency if supported, using the cpufreq
6982capabilities of the Linux kernel.")
6983 (license license:gpl2))))
6984
6985(define-public libite
6986 (package
6987 (name "libite")
6988 (version "2.5.2")
6989 (source
6990 (origin
6991 (method git-fetch)
6992 (uri (git-reference
6993 (url "https://github.com/troglobit/libite")
6994 (commit (string-append "v" version))))
6995 (file-name (git-file-name name version))
6996 (sha256
6997 (base32 "0i27ppb557kdc1hm7nf0f5r7sxvqma31pr57h79whl6qcp28gy4a"))))
6998 (build-system gnu-build-system)
6999 (arguments
7000 `(#:configure-flags
7001 (list "--disable-static")
7002 #:phases
7003 (modify-phases %standard-phases
7004 (add-after 'unpack 'fix-tests
7005 (lambda* (#:key inputs #:allow-other-keys)
7006 ;; replace paths to the executables
7007 (substitute* "test/which.c"
7008 (("/usr/bin/which")
7009 (search-input-file inputs "/bin/which"))
7010 (("ls\"")
7011 (string-append
7012 (search-input-file inputs "/bin/ls") "\"")))
7013 ;; create pidfile in /tmp instead of /var
7014 (substitute* "test/pidfile.c" (("/var/tmp") "/tmp")))))))
7015 (native-inputs (list autoconf automake libtool which))
7016 (synopsis "Library providing missing pieces in GNU libc")
7017 (description "This package provides many of the missing pieces in GNU
7018libc. Most notably the string functions: strlcpy(3), strlcat(3) and the *BSD
7019sys/queue.h and sys/tree.h API's.")
7020 (home-page "https://troglobit.com/projects/libite/")
7021 (license license:expat)))
7022
7023(define-public libuev
7024 (package
7025 (name "libuev")
7026 (version "2.4.0")
7027 (source
7028 (origin
7029 (method git-fetch)
7030 (uri (git-reference
7031 (url "https://github.com/troglobit/libuev")
7032 (commit (string-append "v" version))))
7033 (file-name (git-file-name name version))
7034 (sha256
7035 (base32
7036 "0ih82lxfdcq179kknzdl5c8vi1l0n5j7yh68y8f6kwsrm457paf7"))))
7037 (build-system gnu-build-system)
7038 (native-inputs (list autoconf automake libtool))
7039 (synopsis "Lightweight event loop library for epoll family APIs")
7040 (description "This package provides small event loop that wraps the
7041epoll family of APIs.")
7042 (home-page "https://troglobit.com/projects/libuev/")
7043 (license license:expat)))
7044
7045(define-public libraw1394
7046 (package
7047 (name "libraw1394")
7048 (version "2.1.2")
7049 (source (origin
7050 (method url-fetch)
7051 (uri (string-append
7052 "mirror://kernel.org/linux/libs/ieee1394/"
7053 name "-" version ".tar.xz"))
7054 (sha256
7055 (base32
7056 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
7057 (build-system gnu-build-system)
7058 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
7059 (synopsis "Interface library for the Linux IEEE1394 drivers")
7060 (description
7061 "Libraw1394 is the only supported interface to the kernel side raw1394 of
7062the Linux IEEE-1394 subsystem, which provides direct access to the connected
70631394 buses to user space. Through libraw1394/raw1394, applications can directly
7064send to and receive from other nodes without requiring a kernel driver for the
7065protocol in question.")
7066 (license license:lgpl2.1+)))
7067
7068(define-public libavc1394
7069 (package
7070 (name "libavc1394")
7071 (version "0.5.4")
7072 (source (origin
7073 (method url-fetch)
7074 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
7075 name "-" version ".tar.gz"))
7076 (sha256
7077 (base32
7078 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
7079 (build-system gnu-build-system)
7080 (native-inputs
7081 (list pkg-config))
7082 (propagated-inputs
7083 (list libraw1394)) ; required by libavc1394.pc
7084 (home-page "https://sourceforge.net/projects/libavc1394/")
7085 (synopsis "AV/C protocol library for IEEE 1394")
7086 (description
7087 "Libavc1394 is a programming interface to the AV/C specification from
7088the 1394 Trade Association. AV/C stands for Audio/Video Control.")
7089 (license license:lgpl2.1+)))
7090
7091(define-public libiec61883
7092 (package
7093 (name "libiec61883")
7094 (version "1.2.0")
7095 (source (origin
7096 (method url-fetch)
7097 (uri (string-append
7098 "mirror://kernel.org/linux/libs/ieee1394/"
7099 name "-" version ".tar.xz"))
7100 (sha256
7101 (base32
7102 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
7103 (build-system gnu-build-system)
7104 (native-inputs
7105 (list pkg-config))
7106 (propagated-inputs
7107 (list libraw1394)) ; required by libiec61883.pc
7108 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
7109 (synopsis "Isochronous streaming media library for IEEE 1394")
7110 (description
7111 "The libiec61883 library provides a higher level API for streaming DV,
7112MPEG-2 and audio over Linux IEEE 1394.")
7113 (license license:lgpl2.1+)))
7114
7115(define-public mdadm
7116 (package
7117 (name "mdadm")
7118 (version "4.2")
7119 (source (origin
7120 (method url-fetch)
7121 (uri (string-append
7122 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
7123 version ".tar.xz"))
7124 (sha256
7125 (base32
7126 "07ghmibmbnkdy91ng87zdllzicm299l20dhs9m5bfjw6f1b22726"))))
7127 (build-system gnu-build-system)
7128 (arguments
7129 (list #:make-flags
7130 #~(list (string-append "CC=" #$(cc-for-target))
7131 "INSTALL=install"
7132 "CHECK_RUN_DIR=0"
7133 ;; TODO: tell it where to find 'sendmail'
7134 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
7135 (string-append "BINDIR=" #$output "/sbin")
7136 (string-append "MANDIR=" #$output "/share/man")
7137 (string-append "UDEVDIR=" #$output "/lib/udev"))
7138 #:phases
7139 #~(modify-phases %standard-phases
7140 (add-before 'build 'patch-program-paths
7141 (lambda* (#:key native-inputs inputs #:allow-other-keys)
7142 (let ((coreutils (assoc-ref (or native-inputs inputs)
7143 "coreutils")))
7144 (substitute* "udev-md-raid-arrays.rules"
7145 (("/usr/bin/(readlink|basename)" all program)
7146 (string-append coreutils "/bin/" program))))))
7147 (add-before 'build 'remove-W-error
7148 (lambda _
7149 ;; We cannot build with -Werror on i686 due to a
7150 ;; 'sign-compare' warning in util.c.
7151 (substitute* "Makefile"
7152 (("-Werror") ""))))
7153 (delete 'configure))
7154 ;; Tests must be run as root.
7155 #:tests? #f))
7156 (inputs
7157 (list eudev))
7158 (supported-systems (remove target-hurd? %supported-systems))
7159 (home-page "http://neil.brown.name/blog/mdadm")
7160 (synopsis "Tool for managing Linux Software RAID arrays")
7161 (description
7162 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
7163assemble, report on, and monitor arrays. It can also move spares between raid
7164arrays when needed.")
7165 (license license:gpl2+)))
7166
7167(define-public mdadm-static
7168 (package
7169 (inherit mdadm)
7170 (name "mdadm-static")
7171 (arguments
7172 (substitute-keyword-arguments arguments
7173 ((#:make-flags flags)
7174 #~(cons* "LDFLAGS = -static"
7175 "CXFLAGS = -DNO_LIBUDEV"
7176 #$flags))
7177 ((#:phases phases)
7178 #~(modify-phases #$phases
7179 (add-after 'install 'remove-cruft
7180 (lambda* (#:key outputs #:allow-other-keys)
7181 (let* ((out (assoc-ref outputs "out"))
7182 (precious? (lambda (file)
7183 (member file '("." ".." "sbin"))))
7184 (directories (scandir out (negate precious?))))
7185 (with-directory-excursion out
7186 (for-each delete-file-recursively directories)
7187 (remove-store-references "sbin/mdadm")
7188 (delete-file "sbin/mdmon")))))))
7189 ((#:modules modules %default-gnu-modules)
7190 `((ice-9 ftw) ,@modules))
7191 ((#:strip-flags _ '())
7192 ''("--strip-all")) ;strip a few extra KiB
7193 ((#:allowed-references _ '("out"))
7194 '("out")))) ;refer only self
7195 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
7196
7197(define-public multipath-tools
7198 (package
7199 (name "multipath-tools")
7200 (version "0.11.0")
7201 (home-page "https://github.com/opensvc/multipath-tools")
7202 (source (origin
7203 (method git-fetch)
7204 (uri (git-reference (url home-page) (commit version)))
7205 (file-name (git-file-name name version))
7206 (sha256
7207 (base32
7208 "1yl2cd4xgw2l5xzx5dbdf7awhrvfbjsrspli9i6bmxc5j4jkvazr"))
7209 (modules '((guix build utils)))
7210 (snippet
7211 '(begin
7212 ;; Drop bundled valgrind headers.
7213 (delete-file-recursively "third-party")
7214 (substitute* '("multipathd/main.c"
7215 "libmpathutil/debug.c")
7216 (("#include \"../third-party/")
7217 "#include \""))))))
7218 (build-system gnu-build-system)
7219 (arguments
7220 (list
7221 #:test-target "test"
7222 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
7223 (string-append "prefix=" #$output)
7224 ;; Install Udev rules below this directory, relative
7225 ;; to the prefix.
7226 (string-append "systemd_prefix=" #$output))
7227 #:phases
7228 #~(modify-phases %standard-phases
7229 (add-after 'unpack 'patch-source
7230 (lambda* (#:key inputs #:allow-other-keys)
7231 (let ((libdevmapper.h
7232 (search-input-file inputs "include/libdevmapper.h"))
7233 (libudev.h
7234 (search-input-file inputs "include/libudev.h")))
7235 (substitute* "Makefile.inc"
7236 (("/bin/echo") "echo")
7237 (("\\$\\(prefix\\)/usr") "$(prefix)")
7238 (("configdir.*:= \\$\\(prefix\\)/etc/multipath/conf.d")
7239 "configdir := /etc/multipath/conf.d")
7240 ;; Do not save timestamp to avoid gzip "timestamp
7241 ;; out-of-range" warnings.
7242 (("gzip -9") "gzip -9n"))
7243 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
7244 (("/usr/include/libdevmapper.h") libdevmapper.h)
7245 (("/usr/include/libudev.h") libudev.h)))))
7246 (add-after 'unpack 'skip-failing-tests
7247 (lambda _
7248 ;; This test and the module's setup() test an arbitrary block
7249 ;; device node name, but the build environment has none.
7250 (substitute* "tests/devt.c"
7251 (("return get_one_devt.*") "return 0;\n")
7252 (("cmocka_unit_test\\(test_devt2devname_devt_good\\),") ""))
7253 ;; The above triggers -Werror=unused-function. Ignore it.
7254 (substitute* "tests/Makefile"
7255 (("CFLAGS \\+= " match)
7256 (string-append match "-Wno-error=unused-function ")))))
7257 (delete 'configure) ;no configure script
7258 (add-before 'build 'no-fortify-3
7259 (lambda _
7260 ;; NOTE: The check made seems to wrongly assume the
7261 ;; FORTIFY_SOURCE=3 is valid. However, when compiling, warnings
7262 ;; are emitted from glibc, resulting in failed build. Fix this
7263 ;; by forcing the usage of FORTIFY_SOURCE=2.
7264 (substitute* "create-config.mk"
7265 (("FORTIFY_SOURCE=3")
7266 "FORTIFY_SOURCE=2"))))
7267 (add-before 'build 'set-LDFLAGS
7268 (lambda _
7269 ;; Note: this cannot be passed as a make flag because that will
7270 ;; override the build system LDFLAGS.
7271 (setenv "LDFLAGS"
7272 (string-append "-Wl,-rpath=" #$output "/lib")))))))
7273
7274 (native-inputs
7275 (list perl pkg-config valgrind/pinned
7276 ;; For tests.
7277 cmocka))
7278 (inputs
7279 (list json-c
7280 libaio
7281 liburcu
7282 lvm2
7283 readline
7284 eudev
7285 ;; For libmount.
7286 `(,util-linux "lib")))
7287 (synopsis "Access block devices through multiple paths")
7288 (description
7289 "This package provides the following binaries to drive the
7290Linux Device Mapper multipathing driver:
7291@enumerate
7292@item @command{multipath} - Device mapper target autoconfig.
7293@item @command{multipathd} - Multipath daemon.
7294@item @command{mpathpersist} - Manages SCSI persistent reservations on
7295@code{dm} multipath devices.
7296@item @command{kpartx} - Create device maps from partition tables.
7297@end enumerate")
7298 (license (list license:gpl2+ ;main distribution
7299 license:lgpl2.0+)))) ;libmpathcmd/mpath_cmd.h
7300
7301(define-public libaio
7302 (package
7303 (name "libaio")
7304 (version "0.3.113")
7305 (source (origin
7306 (method url-fetch)
7307 (uri (list
7308 (string-append "https://releases.pagure.org/libaio/"
7309 name "-" version ".tar.gz")))
7310 (sha256
7311 (base32
7312 "02r0g2vfv6kfljplm3ga93w4xw13q2wixbn9hwi7ahqdzp2x2i1c"))
7313 (patches (search-patches "libaio-32bit-test.patch"))))
7314 (build-system gnu-build-system)
7315 (arguments
7316 (list #:make-flags
7317 #~(list (string-append "prefix=" #$output)
7318 (string-append "CC=" #$(cc-for-target)))
7319 #:test-target "partcheck" ; need root for a full 'check'
7320 #:phases
7321 #~(modify-phases %standard-phases
7322 (add-after 'unpack 'disable-problematic-tests
7323 (lambda _
7324 (with-directory-excursion "harness/cases"
7325 ;; The 21.t test fails with "Expected 4096, got
7326 ;; 18446744073709551605" (see:
7327 ;; https://pagure.io/libaio/issue/26).
7328 (rename-file "21.t" "21.t.disabled"))))
7329 (delete 'configure) ; no configure script
7330 #$@(if (target-riscv64?)
7331 #~((add-after 'unpack 'patch-test
7332 (lambda* (#:key build-inputs #:allow-other-keys)
7333 (invoke "patch" "-p1" "-i"
7334 #$(local-file
7335 (search-patch
7336 "libaio-riscv-test5.patch"))))))
7337 #~()))))
7338 (native-inputs
7339 (if (target-riscv64?)
7340 (list (search-patch "libaio-riscv-test5.patch")
7341 patch)
7342 '()))
7343 (home-page "https://pagure.io/libaio")
7344 (synopsis "Linux-native asynchronous I/O access library")
7345 (description
7346 "This library enables userspace to use Linux kernel asynchronous I/O
7347system calls, important for the performance of databases and other advanced
7348applications.")
7349 (license license:lgpl2.1+)))
7350
7351(define-public blktrace
7352 ;; Take a newer commit to get the latest patches.
7353 (let ((commit "b9ea6e507e8849f01d06aa48c0c59c5cee4820be")
7354 (revision "1"))
7355 (package
7356 (name "blktrace")
7357 (version (git-version "1.3.0" revision commit))
7358 (home-page
7359 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
7360 (source (origin
7361 (method git-fetch)
7362 (uri (git-reference
7363 (url home-page)
7364 (commit commit)))
7365 (sha256
7366 (base32 "0a4830mlqckbhchar1xcn2w4f24bzb75bigdig5wpm2axl0zc8cq"))
7367 (file-name (git-file-name name version))))
7368 (build-system gnu-build-system)
7369 (arguments
7370 (list
7371 #:make-flags
7372 #~(list (string-append "CC=" #$(cc-for-target))
7373 (string-append "prefix=" #$output))
7374 #:tests? #f ; no tests
7375 #:phases
7376 #~(modify-phases %standard-phases
7377 (delete 'configure) ; no configure script
7378 (add-after 'unpack 'fix-gnuplot-path
7379 (lambda* (#:key inputs #:allow-other-keys)
7380 (substitute* "btt/bno_plot.py"
7381 (("gnuplot %s")
7382 (string-append
7383 (search-input-file inputs "/bin/gnuplot" ) " %s"))))))))
7384 (inputs
7385 (list libaio
7386 gnuplot
7387 python-wrapper)) ; for 'bno_plot.py'
7388 (synopsis "Block layer IO tracing mechanism")
7389 (description "Blktrace is a block layer IO tracing mechanism which provides
7390detailed information about request queue operations to user space. It extracts
7391event traces from the kernel (via the relaying through the debug file system).")
7392 (license license:gpl2))))
7393
7394(define-public sbc
7395 (package
7396 (name "sbc")
7397 (version "2.2")
7398 (source
7399 (origin
7400 (method url-fetch)
7401 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-" version
7402 ".tar.xz"))
7403 (sha256
7404 (base32 "17mfhc9rn25vrqgfpihpjjc8syp3r56paqyhzg1gjnjyydpagbd1"))))
7405 (build-system gnu-build-system)
7406 (arguments
7407 (list
7408 #:configure-flags
7409 #~(list "--disable-tester")))
7410 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
7411 (synopsis "Bluetooth subband audio codec")
7412 (description
7413 "The SBC is a digital audio encoder and decoder used to transfer data to
7414Bluetooth audio output devices like headphones or loudspeakers.")
7415 (license license:gpl2+)))
7416
7417(define-public sbctester
7418 (package
7419 (inherit sbc)
7420 (name "sbctester")
7421 (arguments
7422 (list
7423 #:phases
7424 #~(modify-phases %standard-phases
7425 (add-after 'unpack 'write-build-files
7426 (lambda _
7427 (begin
7428 (for-each delete-file
7429 (list "Makefile.in" "aclocal.m4" "configure"
7430 "config.h.in"))
7431 (delete-file-recursively "build-aux")
7432 (with-output-to-file "configure.ac"
7433 (lambda _
7434 (format #t
7435 "AC_PREREQ([2.69])
7436 AC_INIT([sbctester], [~a])
7437 AC_CONFIG_HEADERS(config.h)
7438 AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
7439 COMPILER_FLAGS
7440 AC_LANG([C])
7441 AC_PROG_CC
7442 AC_PROG_CC_PIE
7443 AC_PROG_INSTALL
7444 AC_PROG_LIBTOOL
7445 PKG_CHECK_MODULES(SNDFILE, sndfile, dummy=yes,
7446 AC_MSG_ERROR(sndfile library is required))
7447 AC_SUBST(SNDFILE_LIBS)
7448 AC_CONFIG_FILES([Makefile])
7449 AC_OUTPUT
7450 AC_MSG_RESULT([$PACKAGE_NAME $VERSION])
7451 ~%"
7452 #$(package-version sbc))))
7453 (with-output-to-file "Makefile.am"
7454 (lambda _
7455 (format #t
7456 "bin_PROGRAMS = src/sbctester
7457 src_sbctester_SOURCES = src/sbctester.c
7458 src_sbctester_LDADD = @SNDFILE_LIBS@ -lm")))))))))
7459 (inputs (list libsndfile))
7460 (native-inputs (list autoconf automake libtool pkg-config))
7461 (synopsis "Test utility for the sbc codec")
7462 (description
7463 "Utility to detect differences between two audio files, encoded with
7464SBC.")))
7465
7466(define-public bluez
7467 (package
7468 (name "bluez")
7469 (version "5.79")
7470 (source (origin
7471 (method url-fetch)
7472 (uri (string-append
7473 "mirror://kernel.org/linux/bluetooth/bluez-"
7474 version ".tar.xz"))
7475 (sha256
7476 (base32
7477 "12pal1m4xlr8k7kxb6isv5lbaca2wc5zcgy0907wfwcz78qaar21"))))
7478 (build-system gnu-build-system)
7479 (arguments
7480 (list
7481 #:configure-flags
7482 #~(list "--sysconfdir=/etc"
7483 "--localstatedir=/var"
7484 "--enable-library"
7485 "--enable-wiimote"
7486 "--disable-systemd"
7487 ;; TODO: is this needed? Not installed by default since 5.55.
7488 "--enable-hid2hci"
7489 ;; Install dbus/udev files to the correct location.
7490 (string-append "--with-dbusconfdir=" #$output "/etc")
7491 (string-append "--with-udevdir=" #$output "/lib/udev"))
7492 #:phases
7493 #~(modify-phases %standard-phases
7494 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
7495 ;; issue (discussion on upstream mailing list:
7496 ;; https://marc.info/?t=149578476300002&r=1&w=2)
7497 (add-before 'check 'skip-wonky-test
7498 (lambda _
7499 (substitute* "unit/test-gatt.c"
7500 (("tester_init\\(&argc, &argv\\);") "return 77;"))))
7501 (replace 'install
7502 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
7503 ;; Override the sysconfdir and localstatedir locations only for
7504 ;; the installation phase. Otherwise, the installation fails when
7505 ;; it tries to write to /etc/bluetooth and /var.
7506 (define make-flags*
7507 (append make-flags (list (string-append "sysconfdir="
7508 #$output "/etc")
7509 (string-append "localstatedir="
7510 #$output "/var"))))
7511 (apply (assoc-ref %standard-phases 'install)
7512 (append args (list #:make-flags make-flags*)))))
7513 (add-after 'install 'post-install
7514 (lambda* (#:key inputs outputs #:allow-other-keys)
7515 (let* ((servicedir (string-append #$output
7516 "/share/dbus-1/services"))
7517 (service "obexd/src/org.bluez.obex.service")
7518 (rule (string-append
7519 #$output "/lib/udev/rules.d/97-hid2hci.rules")))
7520 ;; Install the obex dbus service file.
7521 (substitute* service
7522 (("/bin/false")
7523 (string-append #$output "/libexec/bluetooth/obexd")))
7524 (install-file service servicedir)
7525 ;; Fix paths in the udev rule.
7526 (substitute* rule
7527 (("hid2hci --method")
7528 (string-append #$output "/lib/udev/hid2hci --method"))
7529 (("/sbin/udevadm")
7530 (search-input-file inputs "/bin/udevadm")))))))))
7531 (native-inputs
7532 (list gettext-minimal
7533 pkg-config
7534 python
7535 python-docutils
7536 python-pygments))
7537 (inputs
7538 (list glib dbus eudev libical readline))
7539 (home-page "https://www.bluez.org/")
7540 (synopsis "Linux Bluetooth protocol stack")
7541 (description
7542 "BlueZ provides support for the core Bluetooth layers and protocols. It
7543is flexible, efficient and uses a modular implementation.")
7544 (license license:gpl2+)))
7545
7546(define-public fuse-exfat
7547 (package
7548 (name "fuse-exfat")
7549 (version "1.4.0")
7550 (source (origin
7551 (method url-fetch)
7552 (uri (string-append
7553 "https://github.com/relan/exfat/releases/download/v"
7554 version "/" name "-" version ".tar.gz"))
7555 (sha256
7556 (base32
7557 "07h0ngnydfy8n8h9ni3jn8zlmcj4pzqa0nk0hk0i4yhfbv2yvkx1"))))
7558 (build-system gnu-build-system)
7559 (native-inputs
7560 (list pkg-config))
7561 (inputs
7562 (list fuse-2))
7563 (home-page "https://github.com/relan/exfat")
7564 (synopsis "Mount exFAT file systems")
7565 (description
7566 "This package provides a FUSE-based file system that provides read and
7567write access to exFAT devices.")
7568 (license license:gpl2+)))
7569
7570(define-public gpm
7571 (package
7572 (name "gpm")
7573 (version "1.20.7")
7574 (source (origin
7575 (method url-fetch)
7576 (uri (string-append
7577 "https://www.nico.schottelius.org/software/gpm/archives/"
7578 "gpm-" version ".tar.bz2"))
7579 (patches (search-patches "gpm-glibc-2.26.patch"))
7580 (sha256
7581 (base32
7582 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))
7583 (modules '((guix build utils)))
7584 (snippet
7585 '(begin
7586 ;; Take a patch from upstream to fix building with -fno-common,
7587 ;; which is default in GCC 10:
7588 ;; https://github.com/telmich/gpm/pull/37
7589 (substitute* "src/headers/daemon.h"
7590 (("^time_t[[:blank:]]+last_selection_time;")
7591 "extern time_t last_selection_time;"))))))
7592 (build-system gnu-build-system)
7593 (arguments
7594 '(#:phases (modify-phases %standard-phases
7595 (replace 'bootstrap
7596 (lambda _
7597 ;; The tarball was not generated with 'make dist' so we
7598 ;; need to bootstrap things ourselves.
7599 (substitute* "autogen.sh"
7600 (("/bin/sh") (which "sh")))
7601 (invoke "./autogen.sh")
7602 (patch-makefile-SHELL "Makefile.include.in")
7603 #t)))
7604
7605 ;; Make sure programs find libgpm.so.
7606 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
7607 (assoc-ref %outputs "out")
7608 "/lib"))))
7609 (native-inputs
7610 (list texinfo
7611 bison
7612 flex
7613 autoconf
7614 automake
7615 libtool))
7616 (supported-systems (remove target-hurd? %supported-systems))
7617 (home-page "https://www.nico.schottelius.org/software/gpm/")
7618 (synopsis "Mouse support for the Linux console")
7619 (description
7620 "The GPM (general-purpose mouse) daemon is a mouse server for
7621applications running on the Linux console. It allows users to select items
7622and copy/paste text in the console and in xterm.")
7623 (license license:gpl2+)))
7624
7625(define-public gamemode
7626 (package
7627 (name "gamemode")
7628 (version "1.8.2")
7629 (source (origin
7630 (method git-fetch)
7631 (uri (git-reference
7632 (url "https://github.com/FeralInteractive/gamemode")
7633 (commit version)))
7634 (file-name (git-file-name name version))
7635 (sha256
7636 (base32 "14i3y385jzpr30lxk38z84rq76sy4cz0pwm54rm62f4mnk0xwjjp"))))
7637 (build-system meson-build-system)
7638 (arguments
7639 (list
7640 #:configure-flags
7641 #~(list
7642 ;; Don't build sample programs.
7643 "-Dwith-examples=false"
7644 ;; Build gamemoderun and other utilities.
7645 "-Dwith-util=true"
7646 ;; Use elogind instead of systemd for sd-bus.
7647 "-Dwith-sd-bus-provider=elogind"
7648 ;; Install PAM limits.d config to the package prefix; a Guix
7649 ;; service can then install it to /etc/security/limits.d/.
7650 (string-append "-Dwith-pam-limits-dir=" #$output
7651 "/etc/security/limits.d")
7652 ;; Guix does not use systemd.
7653 "-Dwith-systemd-user-unit=false"
7654 "-Dwith-systemd-group=false")
7655 #:phases
7656 #~(modify-phases %standard-phases
7657 (add-after 'unpack 'patch-references
7658 (lambda _
7659 (substitute* '("lib/gamemode_client.h"
7660 "data/gamemoderun")
7661 (("libgamemode(auto)?\\.so\\.0" lib)
7662 (string-append #$output "/lib/" lib))))))))
7663 (native-inputs
7664 (list pkg-config))
7665 (inputs
7666 (list
7667 dbus
7668 elogind
7669 libinih))
7670 (synopsis "Optimise Linux system performance on demand")
7671 (description "GameMode is a daemon and library for Linux that allows games to
7672request a set of optimisations be temporarily applied to the host OS and/or a
7673game process. GameMode was designed primarily as a stop-gap solution to problems
7674with the Intel and AMD CPU powersave or ondemand governors, but is now host to a
7675range of optimisation features and configurations, including CPU governor, I/O
7676priority, process niceness, kernel scheduler, screensaver inhibiting, GPU
7677performance mode, and custom scripts.")
7678 (home-page "https://github.com/FeralInteractive/gamemode")
7679 (license license:bsd-3)))
7680
7681(define-public btrfs-progs
7682 (package
7683 (name "btrfs-progs")
7684 (version "7.0")
7685 (source (origin
7686 (method url-fetch)
7687 (uri (string-append "mirror://kernel.org/linux/kernel/"
7688 "people/kdave/btrfs-progs/" "btrfs-progs-v"
7689 version ".tar.xz"))
7690 (sha256
7691 (base32
7692 "16cs5n1hm06ppkylkd9p7v13wdc0sb7y85xll0kj7mxwdj3xd1n2"))))
7693 (build-system gnu-build-system)
7694 (outputs '("out" "static")) ;static versions of the binaries in "out"
7695 (arguments
7696 (list
7697 #:configure-flags
7698 #~(list
7699 ;; Without --disable-documentation, it complains about missing
7700 ;; python-sphinx on systems where this package isn't available
7701 ;; (because it requires Rust).
7702 #$@(if (member (%current-system)
7703 (package-transitive-supported-systems
7704 python-sphinx))
7705 '()
7706 '("--disable-documentation"))
7707 ;; The ‘Python support’ was never actually installed by previous
7708 ;; versions of this package, but did prevent cross-compilation.
7709 "--disable-python")
7710 #:phases #~(modify-phases %standard-phases
7711 (add-after 'unpack 'patch-makefile
7712 (lambda* (#:key outputs #:allow-other-keys)
7713 (substitute* "Makefile"
7714 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
7715 (string-append (assoc-ref outputs "out")
7716 "/lib/udev/rules.d")))))
7717 (add-after 'build 'build-static
7718 (lambda _
7719 (invoke "make" "static")))
7720 (add-after 'install 'install-bash-completion
7721 (lambda* (#:key outputs #:allow-other-keys)
7722 (let* ((out (assoc-ref outputs "out"))
7723 (bashcomp (string-append out
7724 "/etc/bash_completion.d")))
7725 (mkdir-p bashcomp)
7726 (copy-file "btrfs-completion"
7727 (string-append bashcomp "/btrfs")))))
7728 (add-after 'install 'install-static
7729 (let ((staticbin (string-append (assoc-ref %outputs
7730 "static")
7731 "/bin")))
7732 (lambda _
7733 (invoke "make"
7734 (string-append "bindir=" staticbin)
7735 "install-static")))))
7736 #:tests? #f ;XXX: require the 'btrfs' kernel module.
7737 #:test-target "test"
7738 #:parallel-tests? #f)) ;tests fail when run in parallel
7739 (inputs (list e2fsprogs ;for btrfs-convert
7740 eudev
7741 lzo
7742 `(,util-linux "lib") ;for libblkid and libuuid
7743 `(,util-linux "static") ;ditto
7744 zlib
7745 `(,zlib "static")
7746 `(,zstd "lib")
7747 `(,zstd "static")))
7748 (native-inputs
7749 (append
7750 ;; For building documentation. Since python-sphinx requires Rust, add
7751 ;; it conditionally depending on such support.
7752 (if (supported-package? python-sphinx)
7753 (list python-wrapper python-sphinx python-sphinx-rtd-theme)
7754 '())
7755 (list pkg-config
7756 acl ;for tests
7757 lvm2 ;for dmsetup
7758 grep ;need Perl regexp support
7759 libaio
7760 liburing
7761 util-linux ;for fallocate
7762 which)))
7763 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
7764 (synopsis "Create and manage btrfs copy-on-write file systems")
7765 (description
7766 "Btrfs is a @acronym{CoW, copy-on-write} file system for Linux
7767aimed at implementing advanced features while focusing on fault tolerance,
7768repair and easy administration.")
7769 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
7770 ;; GPL2: Everything else.
7771 (license (list license:gpl2 license:gpl2+))))
7772
7773(define-public btrfs-progs/static
7774 (package
7775 (name "btrfs-progs-static")
7776 (version (package-version btrfs-progs))
7777 (source #f)
7778 (build-system trivial-build-system)
7779 (inputs
7780 `(("btrfs-progs:static" ,btrfs-progs "static")))
7781 (arguments
7782 `(#:modules ((guix build utils))
7783 #:builder
7784 (begin
7785 (use-modules (guix build utils)
7786 (ice-9 ftw)
7787 (srfi srfi-26))
7788
7789 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
7790 (out (assoc-ref %outputs "out"))
7791 (source (string-append btrfs "/bin/btrfs.static"))
7792 (target (string-append out "/bin/btrfs")))
7793 (mkdir-p (dirname target))
7794 (copy-file source target)
7795 (remove-store-references target)
7796 (chmod target #o555)
7797 #t))))
7798 (home-page (package-home-page btrfs-progs))
7799 (synopsis "Statically-linked btrfs command from btrfs-progs")
7800 (description "This package provides the statically-linked @command{btrfs}
7801from the btrfs-progs package. It is meant to be used in initrds.")
7802 (license (package-license btrfs-progs))))
7803
7804(define-public cramfs-tools
7805 (package
7806 (name "cramfs-tools")
7807 (home-page "https://github.com/npitre/cramfs-tools")
7808 (version "2.2")
7809 (source (origin
7810 (method git-fetch)
7811 (uri (git-reference
7812 (url home-page)
7813 (commit (string-append "v" version))))
7814 (sha256
7815 (base32 "1rx63qx2sdpzrgcmp7cskin670rnlp45jn90wxqgnqxvc5vr9l5k"))
7816 (file-name (git-file-name name version))))
7817 (build-system gnu-build-system)
7818 (arguments
7819 (list #:tests? #f ; No tests.
7820 #:phases
7821 #~(modify-phases %standard-phases
7822 (delete 'configure)
7823 (replace 'install
7824 (lambda _
7825 (let ((sbin (string-append #$output "/sbin")))
7826 (install-file "mkcramfs" sbin)
7827 (install-file "cramfsck" sbin)))))))
7828 (inputs
7829 (list zlib))
7830 (synopsis "Tools to manage Cramfs file systems")
7831 (description "Cramfs is a Linux file system designed to be simple, small,
7832and to compress things well. It is used on a number of embedded systems and
7833small devices. This version has additional features such as uncompressed
7834blocks and random block placement.")
7835 (license license:gpl2+)))
7836
7837(define-public compsize
7838 (let ((commit "d79eacf77abe3b799387bb8a4e07a18f1f1031e8")
7839 (revision "0"))
7840 (package
7841 (name "compsize")
7842 (version (git-version "1.5" revision commit))
7843 (home-page "https://github.com/kilobyte/compsize")
7844 (source (origin
7845 (method git-fetch)
7846 (uri (git-reference
7847 (url home-page)
7848 (commit commit)))
7849 (sha256
7850 (base32 "02fvgy12m50rg1snp555a1kc3cm01g2imb81cih7ikhkbjbca0d7"))
7851 (file-name (git-file-name name version))
7852 (patches
7853 (search-patches "compsize-fix-btrfs-progs-compatibility.patch"))))
7854 (build-system gnu-build-system)
7855 (inputs
7856 (list btrfs-progs))
7857 (arguments
7858 `(#:tests? #f ; No tests.
7859 #:make-flags
7860 (list (string-append "CC=" ,(cc-for-target)))
7861 #:phases
7862 (modify-phases %standard-phases
7863 (delete 'configure)
7864 (replace 'install
7865 (lambda* (#:key outputs #:allow-other-keys)
7866 (let ((out (assoc-ref outputs "out")))
7867 (install-file "compsize" (string-append out "/bin"))
7868 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
7869 (synopsis "Find compression type/ratio on Btrfs files")
7870 (description "@command{compsize} takes a list of files (given as
7871arguments) on a Btrfs file system and measures used compression types and
7872effective compression ratio, producing a report.
7873
7874A directory has no extents but has a (recursive) list of files. A non-regular
7875file is silently ignored.
7876
7877As it makes no sense to talk about compression ratio of a partial extent,
7878every referenced extent is counted whole, exactly once -- no matter if you use
7879only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
7880uncompressed size will not match the number given by @command{tar} or
7881@command{du}. On the other hand, the space used should be accurate (although
7882obviously it can be shared with files outside our set).")
7883 (license license:gpl2+))))
7884
7885(define-public f2fs-tools
7886 (package
7887 (name "f2fs-tools")
7888 (version "1.16.0")
7889 (source (origin
7890 (method git-fetch)
7891 (uri (git-reference
7892 (url "https://git.kernel.org/pub/scm/linux/kernel\
7893/git/jaegeuk/f2fs-tools.git")
7894 (commit (string-append "v" version))))
7895 (file-name (git-file-name name version))
7896 (sha256
7897 (base32
7898 "0832ix3jnmfagx53wr6clc3q4ay7cbashfj7jirk01gyzwbvblfc"))))
7899 (build-system gnu-build-system)
7900 (native-inputs
7901 (list autoconf automake libtool pkg-config))
7902 (inputs
7903 (list `(,util-linux "lib"))) ;for libuuid
7904 (home-page "https://f2fs.wiki.kernel.org/")
7905 (synopsis "Userland tools for f2fs")
7906 (description
7907 "F2FS, the Flash-Friendly File System, is a modern file system
7908designed to be fast and durable on flash devices such as solid-state
7909disks and SD cards. This package provides the userland utilities.")
7910 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
7911 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
7912 (license (list license:gpl2 license:lgpl2.1))))
7913
7914(define-public f2fs-tools-1.7
7915 (package
7916 (inherit f2fs-tools)
7917 (name "f2fs-tools")
7918 (version "1.7.0")
7919 (source (origin
7920 (method git-fetch)
7921 (uri (git-reference
7922 (url (git-reference-url
7923 (origin-uri (package-source f2fs-tools))))
7924 (commit (string-append "v" version))))
7925 (file-name (git-file-name name version))
7926 (sha256
7927 (base32
7928 "0wpzklw8smnngng0dm25jdmi7v5zfhpz02dksyxpz0a7kzzvnqqm"))))
7929 (inputs
7930 (list `(,util-linux "lib") libselinux))
7931 (arguments
7932 '(#:configure-flags '("CFLAGS=-fcommon")
7933 #:phases
7934 (modify-phases %standard-phases
7935 (add-after 'install 'install-headers
7936 (lambda* (#:key outputs #:allow-other-keys)
7937 (let* ((out (assoc-ref outputs "out"))
7938 (out-include (string-append out "/include")))
7939 (install-file "include/f2fs_fs.h" out-include)
7940 (install-file "mkfs/f2fs_format_utils.h" out-include)))))))))
7941
7942(define-public f2fs-tools/static
7943 (static-package
7944 (package
7945 (inherit f2fs-tools)
7946 (name "f2fs-tools-static")
7947 (arguments
7948 `(#:configure-flags
7949 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
7950 (libuuid (assoc-ref %build-inputs "libuuid")))
7951 (list
7952 (string-append "libuuid_CFLAGS=-I" libuuid "/include/uuid")
7953 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
7954 (string-append "libblkid_CFLAGS=-I" libuuid "/include/uuid "
7955 "-I" libuuid "/include/blkid")
7956 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
7957 #:disallowed-references (,(this-package-input "libuuid"))
7958 #:make-flags '("LDFLAGS=-all-static")
7959 #:phases
7960 (modify-phases %standard-phases ; TODO: f2fs phases.
7961 (add-after 'install 'remove-store-references
7962 (lambda* (#:key outputs #:allow-other-keys)
7963 ;; Work around bug in our util-linux.
7964 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
7965 (remove-store-references (string-append (assoc-ref outputs "out")
7966 "/sbin/mkfs.f2fs"))
7967 #t)))))
7968 (inputs
7969 `(("libuuid:static" ,util-linux "static")
7970 ("libuuid" ,util-linux "lib")))))) ; for include files
7971
7972(define-public f2fs-fsck/static
7973 (package
7974 (name "f2fs-fsck-static")
7975 (version (package-version f2fs-tools/static))
7976 (source #f)
7977 (build-system trivial-build-system)
7978 (arguments
7979 `(#:modules ((guix build utils))
7980 #:builder
7981 (begin
7982 (use-modules (guix build utils)
7983 (ice-9 ftw)
7984 (srfi srfi-26))
7985 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
7986 (fsck "fsck.f2fs")
7987 (out (assoc-ref %outputs "out"))
7988 (sbin (string-append out "/sbin")))
7989 (mkdir-p sbin)
7990 (with-directory-excursion sbin
7991 (install-file (string-append f2fs-tools "/sbin/" fsck)
7992 ".")
7993 (remove-store-references fsck)
7994 (chmod fsck #o555))
7995 #t))))
7996 (inputs
7997 (list f2fs-tools/static))
7998 (home-page (package-home-page f2fs-tools/static))
7999 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
8000 (description "This package provides statically-linked fsck.f2fs command taken
8001from the f2fs-tools package. It is meant to be used in initrds.")
8002 (license (package-license f2fs-tools/static))))
8003
8004(define-public freefall
8005 (package
8006 (name "freefall")
8007 (version (package-version linux-libre))
8008 (source (package-source linux-libre))
8009 (build-system gnu-build-system)
8010 (arguments
8011 '(#:phases (modify-phases %standard-phases
8012 (add-after 'unpack 'enter-subdirectory
8013 (lambda _
8014 (chdir "tools/laptop/freefall")
8015 #t))
8016 (delete 'configure)
8017 (add-before 'build 'increase-timeout
8018 (lambda _
8019 ;; The default of 2 seconds is too low: it assumes an
8020 ;; open lid and AC power without actually checking.
8021 (substitute* "freefall.c"
8022 (("alarm\\(2\\)") "alarm(5)"))
8023 #t)))
8024 #:make-flags (list (string-append "PREFIX="
8025 (assoc-ref %outputs "out"))
8026 "CC=gcc")
8027 #:tests? #f)) ;no tests
8028 (home-page (package-home-page linux-libre))
8029 (synopsis "Free-fall protection for spinning laptop hard drives")
8030 (description
8031 "Prevents shock damage to the internal spinning hard drive(s) of some
8032HP and Dell laptops. When sudden movement is detected, all input/output
8033operations on the drive are suspended and its heads are parked on the ramp,
8034where they are less likely to cause damage to the spinning disc. Requires a
8035drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
8036feature, and a laptop with an accelerometer. It has no effect on SSDs.")
8037 (license license:gpl2)))
8038
8039
8040(define-public nbfc-linux
8041 (let ((version "0.1.7")
8042 (commit "4c2b75e4a875459e86a9892319889ff945e9cadf")
8043 (revision "0"))
8044 (package
8045 (name "nbfc-linux")
8046 (version (git-version version revision commit))
8047 (source (origin
8048 (method git-fetch)
8049 (uri (git-reference
8050 (url "https://github.com/nbfc-linux/nbfc-linux")
8051 (commit commit)))
8052 (file-name (git-file-name name version))
8053 (sha256
8054 (base32
8055 "0mmyfaigrh3fd5v11a8p38km4m02qzsfx8yh72g0z405bzhqn5jk"))))
8056 (build-system gnu-build-system)
8057 (arguments
8058 `(#:make-flags (list (string-append "CC="
8059 ,(cc-for-target))
8060 (string-append "PREFIX="
8061 (assoc-ref %outputs "out")))
8062 #:tests? #f
8063 #:phases (modify-phases %standard-phases
8064 (delete 'configure))))
8065 (native-inputs (list pkg-config))
8066 (propagated-inputs (list python dmidecode))
8067 (synopsis "NoteBook FanControl ported to Linux")
8068 (description
8069 "This package provides a C port of NoteBook FanControl (NBFC), a fan
8070control service for notebooks. It provides the same utilities with the same
8071interfaces as the original NBFC, although the implementation differs.")
8072 (home-page "https://github.com/nbfc-linux/nbfc-linux")
8073 (license license:gpl3+))))
8074
8075(define-public thinkfan
8076 (package
8077 (name "thinkfan")
8078 (version "2.0.0")
8079 (source
8080 (origin
8081 (method git-fetch)
8082 (uri (git-reference
8083 (url "https://github.com/vmatare/thinkfan")
8084 (commit version)))
8085 (file-name (git-file-name name version))
8086 (sha256
8087 (base32 "1jdjqdbv0m7yf9g4rxs7nq1ldh2b81a7qx4vcf9lzw7jwlydd822"))))
8088 (build-system cmake-build-system)
8089 (arguments
8090 (list
8091 #:modules '((guix build cmake-build-system)
8092 (guix build utils)
8093 (srfi srfi-26))
8094 #:tests? #f ; no test target
8095 #:configure-flags
8096 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
8097 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
8098 ;; inefficient’.
8099 #~(list "-DUSE_ATASMART:BOOL=ON")
8100 #:phases
8101 #~(modify-phases %standard-phases
8102 (add-after 'unpack 'create-init-scripts
8103 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
8104 ;; systemd to patch and install their service files. Fake their
8105 ;; presence rather than duplicating the build system below. Leave
8106 ;; things like ‘/bin/kill’ because they're not worth a dependency.
8107 ;; The sysvinit needs manual patching, but since upstream doesn't
8108 ;; even provide the option to install it: don't.
8109 (lambda _
8110 (substitute* "CMakeLists.txt"
8111 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
8112 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
8113 ;; That was easy! Now we just need to fix the destinations.
8114 (("/etc" directory)
8115 (string-append #$output directory))))))))
8116 (native-inputs
8117 (list pkg-config))
8118 (inputs
8119 `(("libatasmart" ,libatasmart)
8120 ("lm-sensors" ,lm-sensors "lib")
8121 ("yaml-cpp" ,yaml-cpp)))
8122 (home-page "https://github.com/vmatare/thinkfan")
8123 (synopsis "Simple fan control program")
8124 (description
8125 "Thinkfan is a simple fan control program. It reads temperatures,
8126checks them against configured limits and switches to appropriate (also
8127pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
8128other @code{hwmon} driver that enables temperature reading and fan control
8129from userspace.")
8130 (license license:gpl3+)))
8131
8132(define-public tpacpi-bat
8133 (package
8134 (name "tpacpi-bat")
8135 (version "3.2")
8136 (source
8137 (origin
8138 (method git-fetch)
8139 (uri (git-reference
8140 (url "https://github.com/teleshoes/tpacpi-bat")
8141 (commit (string-append "v" version))))
8142 (file-name (git-file-name name version))
8143 (sha256
8144 (base32 "0nd8s2bqbhl0sjpflphb4l9ix71p7kvnbvkq4dg9a1v0sxafyygm"))))
8145 (build-system gnu-build-system)
8146 (arguments
8147 `(#:tests? #f ; no test target
8148 #:phases
8149 (modify-phases %standard-phases
8150 (add-after 'unpack 'refer-to-inputs
8151 (lambda* (#:key inputs #:allow-other-keys)
8152 (substitute* "tpacpi-bat"
8153 (("cat ")
8154 (string-append (search-input-file inputs "bin/cat") " "))
8155 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
8156 ;; loaded. That's the administrator's prerogative; disable it.
8157 (("system \"(modprobe .*)\"" _ match)
8158 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))))
8159 (delete 'configure) ; nothing to configure
8160 (delete 'build) ; nothing to build
8161 (replace 'install
8162 (lambda* (#:key outputs #:allow-other-keys)
8163 (let* ((out (assoc-ref outputs "out"))
8164 (bin (string-append out "/bin"))
8165 (doc (string-append out "/share/doc/" ,name "-" ,version)))
8166 (install-file "tpacpi-bat" bin)
8167
8168 ;; There's no man page. Install other forms of documentation.
8169 (for-each (lambda (file)
8170 (let ((target (string-append doc "/" file)))
8171 (mkdir-p (dirname target))
8172 (copy-recursively file target)))
8173 (list "battery_asl" "examples" "README.md"))))))))
8174 (inputs
8175 (list coreutils-minimal
8176 perl))
8177 (home-page "https://github.com/teleshoes/tpacpi-bat")
8178 (synopsis "ThinkPad battery charge controller")
8179 (description
8180 "Tpacpi-bat is a command-line interface to control battery charging on
8181@uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
8182ThinkPad models released after 2011}, starting with the xx20 series. It can
8183query and set the thresholds at which one or both batteries will start and stop
8184charging, inhibit charging batteries for a set period of time, or force them to
8185discharge when they otherwise would not.
8186
8187This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
8188kernel module provided by the @code{acpi-call-linux-module} package, which must
8189be installed and loaded separately. Only the original vendor firmware is
8190supported.")
8191 (license license:gpl3+)))
8192
8193(define-public tmon
8194 (package
8195 (name "tmon")
8196 ;; Tmon's ‘VERSION = 1.0’ hasn't been touched since 2013; the code has.
8197 (version (package-version linux-libre))
8198 (source (package-source linux-libre))
8199 (build-system gnu-build-system)
8200 (arguments
8201 (list
8202 #:tests? #f ; no test suite
8203 #:make-flags
8204 #~(list (string-append "CC=" #$(cc-for-target))
8205 (string-append "INSTALL_ROOT=" #$output)
8206 "BINDIR=bin")
8207 #:phases
8208 #~(modify-phases %standard-phases
8209 (add-after 'unpack 'enter-subdirectory
8210 (lambda _
8211 (chdir "tools/thermal/tmon")))
8212 (add-after 'install 'install-man-page
8213 (lambda _
8214 (let ((man8 (string-append #$output "/share/man/man8")))
8215 (install-file "tmon.8" man8))))
8216 (delete 'configure)))) ; no configure script
8217 (inputs
8218 (list ncurses))
8219 (home-page (package-home-page linux-libre))
8220 (synopsis "Monitor and test the Linux thermal subsystem in real time")
8221 (description
8222 "Tmon is a tool to interact with the complex thermal subsystem of the
8223kernel Linux. It helps visualize thermal relationships and real-time thermal
8224data, tune and test cooling devices and sensors, and collect thermal data for
8225further analysis.
8226
8227As computers become smaller and more thermally constrained, more sensors are
8228added and new cooling capabilities introduced. Thermal relationships can change
8229dynamically. Their complexity grows exponentially among cooling devices, zones,
8230sensors, and trip points.
8231
8232Linux exposes this relationship through @file{/sys/class/thermal} with a matrix
8233of symbolic links, trip point bindings, and device instances. To traverse it
8234by hand is no trivial task: @command{tmon} aims to make it understandable.")
8235 (license (list license:gpl2 ; the man page
8236 license:gpl2+)))) ; the actual rest
8237
8238(define-public turbostat
8239 (package
8240 (name "turbostat")
8241 ;; XXX turbostat reports a version like ‘20.09.30’ but using it here would
8242 ;; make it harder to benefit from ‘free’ linux-libre package updates.
8243 (version (package-version linux-libre))
8244 (source (package-source linux-libre))
8245 (build-system gnu-build-system)
8246 (arguments
8247 (list
8248 #:tests? #f ;no test suite
8249 #:make-flags
8250 #~(list (string-append "CC=" #$(cc-for-target))
8251 (string-append "PREFIX=" #$output))
8252 #:phases
8253 #~(modify-phases %standard-phases
8254 (add-after 'unpack 'enter-subdirectory
8255 (lambda _
8256 (chdir "tools/power/x86/turbostat")))
8257 (delete 'configure)))) ;no configure script
8258 (inputs
8259 (list libcap))
8260 (supported-systems '("i686-linux" "x86_64-linux"))
8261 (home-page (package-home-page linux-libre))
8262 (synopsis "Report x86 processor frequency and idle statistics")
8263 (description
8264 "Turbostat reports x86 processor topology, frequency, idle power state
8265statistics, temperature, and power consumption. Some information is unavailable
8266on older processors.
8267
8268It can be used to identify machines that are inefficient in terms of power usage
8269or idle time, report the rate of @acronym{SMI, system management interrupt}s
8270occurring on the system, or verify the effects of power management tuning.
8271
8272@command{turbostat} reads hardware counters but doesn't write to them, so it
8273won't interfere with the OS or other running processes---including multiple
8274invocations of itself.")
8275 (license license:gpl2)))
8276
8277(define-public ntfs-3g
8278 (package
8279 (name "ntfs-3g")
8280 (version "2026.7.7")
8281 (source (origin
8282 (method git-fetch)
8283 (uri
8284 (git-reference
8285 (url "https://github.com/tuxera/ntfs-3g")
8286 (commit version)))
8287 (file-name (git-file-name name version))
8288 (sha256
8289 (base32
8290 "0kkpmi28qihwmnyvdnkj0azrd7zr6wkv590pjfmbbhn1w4qfp7gd"))
8291 (patches
8292 (search-patches "ntfs-3g-autoconf-sbin-helpers.patch"
8293 "ntfs-3g-consistent-sbindir-usage.patch"))))
8294 (build-system gnu-build-system)
8295 (inputs (list util-linux ; libuuid
8296 kmod
8297 fuse-2))
8298 (native-inputs (list pkg-config autoconf automake libtool
8299 libgcrypt)) ; for m4 macros
8300 (arguments
8301 (list
8302 #:configure-flags
8303 #~(list "--disable-static"
8304 "--disable-ldconfig" ;not necessary
8305 "--exec-prefix=${prefix}"
8306 "--with-fuse=external" ;use our own FUSE
8307 "--enable-mount-helper"
8308 (string-append "--with-modprobe-helper="
8309 #$(this-package-input "kmod") "/bin/modprobe")
8310 "--enable-posix-acls"
8311 "--enable-xattr-mappings")
8312 #:phases
8313 #~(modify-phases %standard-phases
8314 ;; If users install ntfs-3g, they probably want to make it the
8315 ;; default driver as well, so we opt for sensible defaults and link
8316 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
8317 ;; mount NTFS file systems.)
8318 (add-after 'install 'install-link
8319 (lambda* (#:key outputs #:allow-other-keys)
8320 (let* ((out (assoc-ref outputs "out"))
8321 (sbin (string-append out "/sbin")))
8322 (symlink "mount.ntfs-3g"
8323 (string-append sbin "/mount.ntfs"))))))))
8324 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
8325 (synopsis "Read-write access to NTFS file systems")
8326 (description
8327 "NTFS-3G provides read-write access to NTFS file systems, which are
8328commonly found on Microsoft Windows. It is implemented as a FUSE file system.
8329The package provides additional NTFS tools.")
8330 (license license:gpl2+)))
8331
8332(define-public ntfs-3g/static
8333 (static-package
8334 (package
8335 (inherit ntfs-3g)
8336 (name "ntfs-3g-static")
8337 (arguments
8338 (substitute-keyword-arguments arguments
8339 ((#:configure-flags flags)
8340 #~(cons* "--enable-really-static"
8341 ;; The FUSE driver isn't currently used by our initrd.
8342 "--disable-ntfs-3g"
8343 #$flags))
8344 ((#:phases phases)
8345 #~(modify-phases #$phases
8346 (add-after 'unpack 'make-really-static-really-static
8347 (lambda _
8348 (substitute* "ntfsprogs/Makefile.am"
8349 ((" -static") " -all-static"))))
8350 (delete 'install-link))))))))
8351
8352(define-public ntfsfix/static
8353 (package
8354 (name "ntfsfix-static")
8355 (version (package-version ntfs-3g/static))
8356 (source #f)
8357 (build-system trivial-build-system)
8358 (arguments
8359 (list
8360 #:modules `((guix build utils))
8361 #:builder
8362 #~(begin
8363 (use-modules (guix build utils))
8364 (let ((bin (string-append #$output "/bin")))
8365 (install-file (search-input-file %build-inputs "/bin/ntfsfix") bin)
8366 (with-directory-excursion bin
8367 (remove-store-references "ntfsfix"))))))
8368 (inputs (list ntfs-3g/static))
8369 (home-page (package-home-page ntfs-3g/static))
8370 (synopsis "Statically linked @command{ntfsfix} from ntfs-3g")
8371 (description
8372 "This package provides a statically linked @command{ntfsfix} taken
8373from the ntfs-3g package. It is meant to be used in initrds.")
8374 (license (package-license ntfs-3g/static))))
8375
8376(define-public rdma-core
8377 (package
8378 (name "rdma-core")
8379 (version "62.0")
8380 (source (origin
8381 (method url-fetch)
8382 (uri (string-append "https://github.com/linux-rdma/rdma-core"
8383 "/releases/download/v" version "/rdma-core-"
8384 version ".tar.gz"))
8385 (sha256
8386 (base32
8387 "1802afy4q80zl7qkxlyq71ll5fsksva43f8xfd6vlqj1c47dc2n0"))))
8388 (build-system cmake-build-system)
8389 (arguments
8390 `(#:tests? #f ;no tests
8391
8392 ;; Upstream uses the "ninja" build system and encourage distros
8393 ;; to do the same for consistency.
8394 #:generator "Ninja"
8395 #:configure-flags
8396 (list (string-append "-DRST2MAN_EXECUTABLE="
8397 (search-input-file
8398 %build-inputs "/bin/rst2man.py")))))
8399 (native-inputs
8400 (list pkg-config python-wrapper python-docutils-0.19)) ;for 'rst2man'
8401 (inputs
8402 (list libnl eudev))
8403 (home-page "https://github.com/linux-rdma/rdma-core")
8404 (synopsis "Utilities and libraries for working with RDMA devices")
8405 (description
8406 "This package provides userspace components for the InfiniBand
8407subsystem of the Linux kernel. Specifically it contains userspace
8408libraries for the following device nodes:
8409
8410@enumerate
8411@item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
8412@item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
8413@item @file{/dev/infiniband/umadX} (@code{libibumad})
8414@end enumerate
8415
8416The following service daemons are also provided:
8417@enumerate
8418@item @code{srp_daemon} (for the @code{ib_srp} kernel module)
8419@item @code{iwpmd} (for iWARP kernel providers)
8420@item @code{ibacm} (for InfiniBand communication management assistant)
8421@end enumerate")
8422 ;; All library code is dual licensed under GPL2 and a custom MIT
8423 ;; variant. The package also includes some components covered by
8424 ;; other licenses. Consult COPYING.md for full details.
8425 (license
8426 (list license:gpl2
8427 (license:x11-style "See COPYING.BSD_MIT in the distribution")
8428 license:bsd-2 ; Files referring to COPYING.BSD_FB
8429 license:cc0 ; most files in ccan/
8430 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
8431
8432(define-public perftest
8433 (package
8434 (name "perftest")
8435 (version "4.5-0.20")
8436 (home-page "https://github.com/linux-rdma/perftest")
8437 (source (origin
8438 (method git-fetch)
8439 (uri (git-reference (url home-page)
8440 (commit (string-append "v" version))))
8441 (file-name (git-file-name name version))
8442 (sha256
8443 (base32
8444 "1hrpzmkz1kq4jwpy6b5fl8073iy7dllcq2hfzdw6waaf5920vd64"))))
8445 (build-system gnu-build-system)
8446 (native-inputs
8447 (list autoconf automake libtool))
8448 (inputs (list pciutils rdma-core))
8449 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
8450 (description "This is a collection of tests written over uverbs intended
8451for use as a performance micro-benchmark. The tests may be used for hardware
8452or software tuning as well as for functional testing.
8453
8454The collection contains a set of bandwidth and latency benchmark such as:
8455@enumerate
8456@item Send - @code{ib_send_bw} and @code{ib_send_lat}
8457@item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
8458@item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
8459@item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
8460@item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
8461@end enumerate")
8462 (license license:gpl2)))
8463
8464(define-public rng-tools
8465 (package
8466 (name "rng-tools")
8467 (home-page "https://github.com/nhorman/rng-tools")
8468 (version "6.17")
8469 (source (origin
8470 (method git-fetch)
8471 (uri (git-reference (url home-page)
8472 (commit (string-append "v" version))))
8473 (file-name (git-file-name name version))
8474 (sha256
8475 (base32
8476 "0vvqi9ha4jbk4086x2q98p4ip3z56sfdpyckdyknsd36zhp6z8n2"))
8477 (patches
8478 (search-patches "rng-tools-revert-build-randstat.patch"))
8479 (patch-flags '("-p0"))))
8480 (build-system gnu-build-system)
8481 (arguments
8482 (list
8483 ;; Disable support for various hardware entropy sources as they need
8484 ;; dependencies that are not yet in Guix, and would significantly
8485 ;; increase closure size.
8486 #:configure-flags #~(list "--without-nistbeacon"
8487 "--without-pkcs11"
8488 "--without-rtlsdr"
8489 "--without-qrypt")
8490 #:phases
8491 #~(modify-phases %standard-phases
8492 (add-before 'check 'disable-failing-test
8493 (lambda _
8494 (substitute* "tests/Makefile"
8495 ;; This test requires a hwrng, rdrand, or tpm device.
8496 ;; Worse, it appears to fail if that isn't sufficiently random.
8497 (("\\brngtestjitter\\.sh\\b") " ")))))))
8498 (native-inputs
8499 (list autoconf automake pkg-config))
8500 (inputs
8501 (list libcap sysfsutils openssl))
8502 (synopsis "Random number generator daemon")
8503 (description
8504 "Monitor a hardware random number generator, and supply entropy
8505from that to the system kernel's @file{/dev/random} machinery.")
8506 ;; The source package is offered under the GPL2+, but the files
8507 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
8508 (license (list license:gpl2 license:gpl2+))))
8509
8510(define-public cpupower
8511 (package
8512 (name "cpupower")
8513 (version (package-version linux-libre))
8514 (source (package-source linux-libre))
8515 (build-system gnu-build-system)
8516 (arguments
8517 (list #:make-flags
8518 #~(list "CC=gcc"
8519 (string-append "DESTDIR=" #$output)
8520 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
8521 "docdir=/share/doc/cpupower" ;drop default ‘packages/’
8522 "confdir=$(docdir)/examples"
8523 ;; The Makefile recommends the following changes.
8524 "DEBUG=false"
8525 "[email protected]")
8526 #:tests? #f ; no tests
8527 #:phases
8528 #~(modify-phases %standard-phases
8529 (add-after 'unpack 'enter-subdirectory
8530 (lambda _
8531 (chdir "tools/power/cpupower")))
8532 (delete 'configure) ; no configure script
8533 (add-before 'build 'fix-makefiles
8534 (lambda _
8535 (substitute* "Makefile"
8536 (("/usr/") "/")
8537 (("/bin/(install)" _ command) command))
8538 (substitute* "bench/Makefile"
8539 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))))
8540 (native-inputs (list gettext-minimal
8541 which)) ;to find gettext
8542 (inputs (list pciutils))
8543 (home-page (package-home-page linux-libre))
8544 (synopsis "CPU frequency and voltage scaling tools for Linux")
8545 (description
8546 "cpupower is a set of user-space tools that use the cpufreq feature of the
8547Linux kernel to retrieve and control processor features related to power saving,
8548such as frequency and voltage scaling.")
8549 (license license:gpl2)))
8550
8551(define-public x86-energy-perf-policy
8552 (package
8553 (name "x86-energy-perf-policy")
8554 (version (package-version linux-libre))
8555 (source (package-source linux-libre))
8556 (build-system gnu-build-system)
8557 (arguments
8558 '(#:tests? #f
8559 #:phases
8560 (modify-phases %standard-phases
8561 (add-after 'unpack 'enter-subdirectory
8562 (lambda _
8563 (chdir "tools/power/x86/x86_energy_perf_policy")
8564 #t))
8565 (delete 'configure)
8566 (add-before 'build 'fix-makefile
8567 (lambda _
8568 (substitute* "Makefile" (("/usr") ""))
8569 #t)))
8570 #:make-flags
8571 (let ((out (assoc-ref %outputs "out")))
8572 (list (string-append "DESTDIR=" out)
8573 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
8574 (supported-systems '("i686-linux" "x86_64-linux"))
8575 (home-page (package-home-page linux-libre))
8576 (synopsis "Display and update Intel-CPU energy-performance policy")
8577 (description
8578 "@command{x86_energy_perf_policy} displays and updates energy-performance
8579policy settings specific to Intel Architecture Processors. Settings are
8580accessed via Model Specific Register (MSR) updates, no matter if the Linux
8581cpufreq sub-system is enabled or not.")
8582 (license license:gpl2)))
8583
8584(define-public haveged
8585 (package
8586 (name "haveged")
8587 (version "1.9.19")
8588 (source
8589 (origin
8590 (method git-fetch)
8591 (uri (git-reference
8592 (url "https://github.com/jirka-h/haveged")
8593 (commit (string-append "v" version))))
8594 (file-name (git-file-name name version))
8595 (sha256
8596 (base32 "1qka68dlfz9z3gjfvfwvh60l2121c1yx0z264jqsf2vjp5f0xbmn"))))
8597 (build-system gnu-build-system)
8598 (arguments
8599 `(#:configure-flags
8600 (list "--disable-static")))
8601 (home-page "https://www.issihosts.com/haveged")
8602 (synopsis "Entropy source for the Linux random number generator")
8603 (description
8604 "haveged generates an unpredictable stream of random numbers for use by
8605Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
8606standard mechanisms for filling the entropy pool may not be sufficient for
8607systems with high needs or limited user interaction, such as headless servers.
8608
8609@command{haveged} runs as a privileged daemon, harvesting randomness from the
8610indirect effects of hardware events on hidden processor state using the
8611@acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
8612It tunes itself to its environment and provides the same built-in test suite
8613for the output stream as used on certified hardware security devices.
8614
8615The quality of the randomness produced by this algorithm has not been proven.
8616It is recommended to run it together with another entropy source like rngd, and
8617not as a replacement for it.")
8618 (license (list (license:non-copyleft "file://nist/mconf.h")
8619 (license:non-copyleft "file://nist/packtest.c")
8620 license:public-domain ; nist/dfft.c
8621 license:gpl3+)))) ; everything else
8622
8623(define-public hotspot
8624 (package
8625 (name "hotspot")
8626 (version "1.6.0")
8627 (source (origin
8628 (method git-fetch)
8629 (uri (git-reference
8630 (url "https://github.com/KDAB/hotspot")
8631 (commit version)
8632 ;; Include the bundled perfparser and PrefixTickLabels
8633 ;; libraries, which are to be used in source form.
8634 (recursive? #t)))
8635 (file-name (git-file-name name version))
8636 (sha256
8637 (base32
8638 "065pcibr4m2ixjlq9nf45g22f73zsxabll361bjjnmkfv6xhz1r4"))))
8639 (build-system qt-build-system)
8640 (arguments
8641 (list
8642 ;; As mentioned in the option help text, the KAuth helper cannot be
8643 ;; installed to a custom prefix and the build fails with "file cannot
8644 ;; create directory: /polkit-1/actions. Maybe need administrative"
8645 ;; (see: <https://bugs.kde.org/show_bug.cgi?id=363678>).
8646 #:configure-flags #~(list "-DINSTALL_KAUTH_HELPER=OFF"
8647 "-DQT6_BUILD=ON")
8648 #:qtbase qtbase
8649 ;; The 'tst_models' and 'tst_callgraphgenerator' fail, with
8650 ;; the later seemingly requiring sudo or access to the kernel
8651 ;; trace points.
8652 #:test-exclude
8653 (string-append
8654 "("
8655 (string-join
8656 ;; The 'tst_models' expected output doesn't exactly
8657 ;; match.
8658 '("tst_models"
8659 ;; The 'tst_callgraphgenerator' perf invocation
8660 ;; fails when run in the build container.
8661 "tst_callgraphgenerator"
8662 ;; The 'tst_perfparser' test requires sudo/access
8663 ;; to the kernel scheduler trace points.
8664 "tst_perfparser")
8665 "|")
8666 ")")
8667 #:phases
8668 #~(modify-phases %standard-phases
8669 (add-after 'unpack 'patch-perfparser
8670 ;; XXX: This phase is copied from qt-creator: keep them in sync!
8671 (lambda* (#:key inputs #:allow-other-keys)
8672 ;; perfparser attempts to dynamically load the demangle
8673 ;; libraries; use their absolute file name to avoid having to
8674 ;; set LD_LIBRARY_PATH.
8675 (let ((librustc_demangle.so
8676 (with-exception-handler (lambda (ex)
8677 (if (search-error? ex)
8678 #f
8679 (raise-exception ex)))
8680 (lambda ()
8681 (search-input-file inputs "lib/librustc_demangle.so"))
8682 #:unwind? #t)))
8683 (substitute* "3rdparty/perfparser/app/demangler.cpp"
8684 (("loadDemangleLib\\(QStringLiteral\\(\"rustc_demangle\")"
8685 all)
8686 (if librustc_demangle.so
8687 (format #f "loadDemangleLib(QStringLiteral(~s)"
8688 librustc_demangle.so)
8689 all)) ;no rustc_demangle; leave unchanged
8690 (("loadDemangleLib\\(QStringLiteral\\(\"d_demangle\")")
8691 (format #f "loadDemangleLib(QStringLiteral(~s)"
8692 (search-input-file inputs
8693 "lib/libd_demangle.so")))))))
8694 (add-after 'unpack 'path-paths
8695 (lambda* (#:key inputs #:allow-other-keys)
8696 (substitute* "src/perfoutputwidgetkonsole.cpp"
8697 (("\"tail\"")
8698 (format #f "~s" (search-input-file inputs "bin/tail"))))
8699 (substitute* "src/perfrecord.cpp"
8700 (("\"perf( )?\"" _ space)
8701 (string-append "\"" (search-input-file inputs "bin/perf")
8702 (or space "") "\""))))))))
8703 (native-inputs
8704 (list extra-cmake-modules
8705 vulkan-headers))
8706 (inputs
8707 (append
8708 (list coreutils-minimal
8709 d-demangler
8710 elfutils
8711 karchive
8712 kconfig
8713 kcoreaddons
8714 kddockwidgets
8715 kgraphviewer
8716 ki18n
8717 kio
8718 kiconthemes
8719 kitemmodels
8720 kitemviews
8721 knotifications
8722 kparts
8723 ksyntaxhighlighting
8724 kwindowsystem
8725 libxkbcommon
8726 perf
8727 qtdeclarative
8728 qtsvg
8729 solid
8730 threadweaver
8731 `(,zstd "lib"))
8732 (if (supported-package? rust-rustc-demangle-capi-0.1)
8733 (list rust-rustc-demangle-capi-0.1)
8734 '())))
8735 (home-page "https://github.com/KDAB/hotspot")
8736 (synopsis "Performance analysis GUI for Linux perf")
8737 (description "Hotspot is a standalone GUI for performance data analysis.
8738It aims to be similar to KCachegrind, but for data collected with
8739@command{perf}, a profiler for use with the kernel Linux. Its main feature is
8740graphically visualizing a @file{perf.data} file.")
8741 (license (list license:gpl2+ license:gpl3+)))) ;dual licensed
8742
8743(define-public ecryptfs-utils
8744 (package
8745 (name "ecryptfs-utils")
8746 (version "111")
8747 (source
8748 (origin
8749 (method url-fetch)
8750 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
8751 version "/+download/ecryptfs-utils_"
8752 version ".orig.tar.gz"))
8753 (sha256
8754 (base32
8755 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
8756 (build-system gnu-build-system)
8757 (arguments
8758 `(#:configure-flags (list "--disable-pywrap")
8759 #:modules (,@%default-gnu-modules
8760 (ice-9 binary-ports)
8761 (rnrs bytevectors)
8762 (srfi srfi-26))
8763 #:phases
8764 (modify-phases %standard-phases
8765 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
8766 (lambda* (#:key inputs outputs #:allow-other-keys)
8767 (let ((out (assoc-ref outputs "out"))
8768 (util-linux (assoc-ref inputs "util-linux"))
8769 (cryptsetup (assoc-ref inputs "cryptsetup-minimal"))
8770 (linux-pam (assoc-ref inputs "linux-pam"))
8771 (lvm2 (assoc-ref inputs "lvm2")))
8772 (substitute* '("src/utils/ecryptfs-mount-private"
8773 "src/utils/ecryptfs-umount-private"
8774 "src/utils/ecryptfs-setup-private"
8775 "src/utils/ecryptfs-setup-swap"
8776 "src/utils/mount.ecryptfs.c"
8777 "src/utils/umount.ecryptfs.c"
8778 "src/pam_ecryptfs/pam_ecryptfs.c"
8779 "src/desktop/ecryptfs-mount-private.desktop.in"
8780 "src/desktop/ecryptfs-setup-private.desktop.in")
8781 (("/bin/mount")
8782 (string-append util-linux "/bin/mount"))
8783 (("/bin/umount")
8784 (string-append util-linux "/bin/umount"))
8785 (("/sbin/mount.ecryptfs_private")
8786 (string-append out "/sbin/mount.ecryptfs_private"))
8787 (("/sbin/umount.ecryptfs_private")
8788 (string-append out "/sbin/umount.ecryptfs_private"))
8789 (("/usr/bin/ecryptfs-mount-private")
8790 (string-append out "/bin/ecryptfs-mount-private"))
8791 (("/usr/bin/ecryptfs-rewrite-file")
8792 (string-append out "/bin/ecryptfs-rewrite-file"))
8793 (("/usr/bin/ecryptfs-setup-private")
8794 (string-append out "/bin/ecryptfs-setup-private"))
8795 (("/sbin/cryptsetup")
8796 (string-append cryptsetup "/sbin/cryptsetup"))
8797 (("/sbin/unix_chkpwd")
8798 (string-append linux-pam "/sbin/unix_chkpwd"))
8799 (("/sbin/dmsetup")
8800 (string-append lvm2 "/sbin/dmsetup"))))))
8801 (add-after 'install 'wrap-scripts
8802 (lambda* (#:key inputs outputs #:allow-other-keys)
8803 (let* ((out (assoc-ref outputs "out"))
8804 (bin (string-append out "/bin"))
8805 (add (map (lambda (bin)
8806 (dirname (search-input-file
8807 inputs (string-append "bin/" bin))))
8808 ;; For simplicity, we wrap all scripts the same.
8809 (list "awk" "find" "gettext" "grep" "keyctl" "ls"
8810 "lsof" "mount" "rsync" "sed" "which")))
8811 (script? (lambda (file)
8812 (call-with-input-file file
8813 (lambda (port)
8814 (bytevector=? (string->utf8 "#!")
8815 (get-bytevector-n port 2)))))))
8816 (for-each (lambda (file)
8817 (when (script? file)
8818 (wrap-program file
8819 ;; '= would be better than 'suffix but break
8820 ;; setuid binaries.
8821 `("PATH" ":" suffix (,@add
8822 ,(string-append bin))))))
8823 (find-files bin "."))))))))
8824 (native-inputs
8825 (list intltool perl ; for pod2man
8826 pkg-config))
8827 (inputs
8828 (list coreutils
8829 cryptsetup-minimal
8830 findutils
8831 gawk
8832 grep
8833 keyutils
8834 linux-pam
8835 lsof
8836 lvm2
8837 nss
8838 rsync
8839 sed
8840 util-linux
8841 which))
8842 (home-page "https://ecryptfs.org/")
8843 (synopsis "Cryptographic file system utilities")
8844 (description
8845 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
8846Each file's cryptographic meta-data is stored inside the file itself, along
8847with the encrypted contents. This allows individual encrypted files to be
8848copied between hosts and still be decrypted with the proper key. eCryptfs is a
8849native Linux file system, and has been part of the Linux kernel since version
88502.6.19. This package contains the userland utilities to manage it.")
8851 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
8852 ;; grant additional permission to link with OpenSSL.
8853 (license license:gpl2+)))
8854
8855(define-public module-init-tools
8856 (package
8857 (name "module-init-tools")
8858 (version "3.16")
8859 (source (origin
8860 (method url-fetch)
8861 (uri (string-append
8862 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
8863 "module-init-tools-" version ".tar.bz2"))
8864 (sha256
8865 (base32
8866 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
8867 (patches (search-patches "module-init-tools-moduledir.patch"))))
8868 (build-system gnu-build-system)
8869 (arguments
8870 ;; FIXME: The upstream tarball lacks man pages, and building them would
8871 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
8872 ;; but they vanished. In the meantime, fake it.
8873 '(#:phases
8874 (modify-phases %standard-phases
8875 (add-before 'configure 'fake-docbook
8876 (lambda _
8877 (substitute* "Makefile.in"
8878 (("^DOCBOOKTOMAN.*$")
8879 "DOCBOOKTOMAN = true\n"))
8880 #t)))))
8881 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
8882 (synopsis "Tools for loading and managing Linux kernel modules")
8883 (description
8884 "Tools for loading and managing Linux kernel modules, such as
8885@code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
8886 (license license:gpl2+)))
8887
8888(define-public mce-inject
8889 (let ((revision "0") ; no git tags :-/
8890 (commit "4cbe46321b4a81365ff3aafafe63967264dbfec5"))
8891 (package
8892 (name "mce-inject")
8893 (version (git-version "0.0.0" revision commit))
8894 (source
8895 (origin
8896 (method git-fetch)
8897 (uri (git-reference
8898 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git")
8899 (commit commit)))
8900 (file-name (git-file-name name version))
8901 (sha256
8902 (base32 "0gjapg2hrlxp8ssrnhvc19i3r1xpcnql7xv0zjgbv09zyha08g6z"))))
8903 (build-system gnu-build-system)
8904 (arguments
8905 ;; There is no test suite. There's a test/ directory, but it just holds
8906 ;; example text files you could feed to the programme to crash something.
8907 (list #:tests? #f
8908 #:make-flags
8909 #~(list (string-append "prefix=" #$output)
8910 (string-append "CC=" #$(cc-for-target)))
8911 #:phases
8912 #~(modify-phases %standard-phases
8913 (delete 'configure) ; no configure script
8914 (add-after 'install 'install-examples
8915 (lambda* (#:key outputs #:allow-other-keys)
8916 (let* ((out (assoc-ref outputs "out"))
8917 (doc (string-append out "/share/doc/" #$name))
8918 (dir (string-append doc "/examples")))
8919 (copy-recursively "test" dir )))))))
8920 (native-inputs
8921 (list bison flex))
8922 (supported-systems (list "i686-linux" "x86_64-linux"))
8923 (home-page
8924 "https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git/about/")
8925 (synopsis
8926 "Inject x86 @acronym{MCEs, machine-check exceptions} into Linux")
8927 (description
8928 "This simple tool injects fake @acronym{MCEs, machine-check exceptions}
8929into a running Linux kernel, to debug or test the kernel's @acronym{EDAC, error
8930detection and correction}-handling code specific to x86 and x86_64 platforms.
8931
8932Real MCEs are internal CPU errors. Handling them correctly can be important to
8933system stability and even prevent physical damage. In contrast, simulated MCEs
8934produced by @command{mce-inject} are purely synthetic: injection happens only at
8935the software level, inside the kernel, and is not visible to the platform
8936hardware or firmware.
8937
8938A convenient feature of @command{mce-inject} is that the input language used to
8939describe MCEs is similar to the format used in Linux panic messages, with a few
8940extensions. In general, you should be able to pipe in any logged MCE panic to
8941simulate that same MCE.
8942
8943The target kernel must have the @code{CONFIG_X86_MCE_INJECT} option enabled and
8944the @code{mce-inject} module loaded if it exists.")
8945 (license license:gpl2))))
8946
8947(define-public mcelog
8948 (package
8949 (name "mcelog")
8950 (version "195")
8951 (source
8952 (origin
8953 (method git-fetch)
8954 (uri (git-reference
8955 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git")
8956 (commit (string-append "v" version))))
8957 (file-name (git-file-name name version))
8958 (sha256
8959 (base32 "1bg2bj8flybd8kzmmaaslisc6lc1fs9nbv09im6r32dq48skx5aj"))
8960 (modules '((guix build utils)))
8961 (snippet
8962 `(begin
8963 ;; The checkout lacks a .git directory, breaking ‘git describe’.
8964 (substitute* "Makefile"
8965 (("\"unknown\"") (string-append "\"v" ,version "\"")))))))
8966 (build-system gnu-build-system)
8967 (arguments
8968 (list
8969 ;; The tests will only run as root on certain supported CPU models.
8970 #:tests? #f
8971 #:make-flags
8972 #~(list (string-append "CC=" #$(cc-for-target))
8973 (string-append "prefix=" #$output)
8974 (string-append "DOCDIR=" #$output "/share/doc/"
8975 #$name "-" #$version)
8976 "etcprefix=$(DOCDIR)/examples")
8977 #:phases
8978 #~(modify-phases %standard-phases
8979 (delete 'configure)))) ; no configure script
8980 (native-inputs
8981 (list python-wrapper)) ; to generate example mcelog.conf
8982 (supported-systems (list "i686-linux" "x86_64-linux"))
8983 (home-page "https://mcelog.org/")
8984 (synopsis "Machine check monitor for x86 Linux systems")
8985 (description
8986 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
8987systems running the kernel Linux. It can also perform user-defined tasks, such
8988as bringing bad pages off-line, when configurable error thresholds are
8989exceeded.")
8990 (license license:gpl2)))
8991
8992(define-public mtd-utils
8993 (package
8994 (name "mtd-utils")
8995 (version "2.1.5")
8996 (source (origin
8997 (method url-fetch)
8998 (uri (string-append
8999 "ftp://ftp.infradead.org/pub/mtd-utils/"
9000 "mtd-utils-" version ".tar.bz2"))
9001 (sha256
9002 (base32
9003 "0ilz8hkcyvfcnqpy25kbr8fb71x9vl28wbmw56vvd68n2byjfviq"))))
9004 (arguments
9005 (list #:configure-flags
9006 (if (%current-target-system) ; When cross-compiling.
9007 #~(list)
9008 #~(list "--enable-unit-tests"))
9009
9010 #:parallel-tests? #f)) ;tests may fail when running in parallel
9011 (native-inputs
9012 (list cmocka pkg-config))
9013 (inputs
9014 (list acl ; extended attributes (xattr)
9015 lzo
9016 openssl ; optional crypto support
9017 `(,util-linux "lib")
9018 zlib
9019 `(,zstd "lib")))
9020 (build-system gnu-build-system)
9021 (synopsis "MTD Flash Storage Utilities")
9022 (description "This package provides utilities for testing, partitioning, etc
9023of flash storage.")
9024 (home-page "http://www.linux-mtd.infradead.org/")
9025 (license
9026 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
9027 license:mpl1.1 ; All ftl* files
9028 license:expat)))) ; libiniparser
9029
9030(define-public libseccomp
9031 (package
9032 (name "libseccomp")
9033 (version "2.6.0")
9034 (source (origin
9035 (method git-fetch)
9036 (uri (git-reference
9037 (url "https://github.com/seccomp/libseccomp")
9038 (commit (string-append "v" version))))
9039 (file-name (git-file-name name version))
9040 (sha256
9041 (base32
9042 "189yh66aj3z3jvns739qbj504f3mcl3w44pxxizw877pbj3kal11"))))
9043 (build-system gnu-build-system)
9044 (arguments
9045 (list
9046 #:configure-flags #~(list "--disable-static")
9047 #:phases #~(modify-phases %standard-phases
9048 #$@(if (target-ppc32?)
9049 ;; This test is removed upstream. See upstream commit
9050 ;; 7db46d72f13c172b290818f624c2966bd0db5677
9051 #~((add-after 'unpack 'skip-62-sim-arch-tests
9052 (lambda _
9053 (substitute*
9054 "tests/62-sim-arch_transactions.tests"
9055 (("test type: bpf-sim-fuzz") "")
9056 (("62-sim-arch_transactions 5") "")))))
9057 #~())
9058 (add-before 'check 'skip-load-test
9059 (lambda _
9060 ;; This test does a native system call and fails when
9061 ;; run under QEMU user-mode emulation. Just skip it.
9062 (delete-file "tests/52-basic-load.tests"))))))
9063 (native-inputs
9064 (list autoconf automake gperf libtool which))
9065 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
9066 (description "The libseccomp library provides an easy to use, platform
9067independent, interface to the Linux Kernel's syscall filtering mechanism. The
9068libseccomp API is designed to abstract away the underlying BPF based syscall
9069filter language and present a more conventional function-call based filtering
9070interface that should be familiar to, and easily adopted by, application
9071developers.")
9072 (home-page "https://github.com/seccomp/libseccomp")
9073 (license license:lgpl2.1)))
9074
9075(define-public radeontop
9076 (package
9077 (name "radeontop")
9078 (version "1.4")
9079 (source
9080 (origin
9081 (method git-fetch)
9082 (uri (git-reference
9083 (url "https://github.com/clbr/radeontop")
9084 (commit (string-append "v" version))))
9085 (file-name (git-file-name name version))
9086 (sha256
9087 (base32 "0kwqddidr45s1blp0h8r8h1dd1p50l516yb6mb4s6zsc827xzgg3"))))
9088 (build-system gnu-build-system)
9089 (arguments
9090 `(#:phases (modify-phases %standard-phases
9091 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
9092 ;; dependency, and doesn't even work on release(!) tarballs.
9093 (add-after 'unpack 'report-correct-version
9094 (lambda _
9095 (substitute* "getver.sh"
9096 (("ver=unknown")
9097 (string-append "ver=" ,version)))))
9098 (delete 'configure)) ; no configure script
9099 #:make-flags (list (string-append "CC=" ,(cc-for-target))
9100 (string-append "PREFIX=" %output))
9101 #:tests? #f)) ; no tests
9102 (native-inputs
9103 (list gettext-minimal pkg-config))
9104 (inputs
9105 (list libdrm libpciaccess libxcb ncurses))
9106 (home-page "https://github.com/clbr/radeontop/")
9107 (synopsis "Usage monitor for AMD Radeon graphics")
9108 (description "RadeonTop monitors resource consumption on supported AMD
9109Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
9110a terminal or saved to a file for further processing. It measures both the
9111activity of the GPU as a whole, which is also accurate during OpenCL
9112computations, as well as separate component statistics that are only meaningful
9113under OpenGL graphics workloads.")
9114 (license license:gpl3)))
9115
9116(define-public efivar
9117 (package
9118 (name "efivar")
9119 (version "39")
9120 (source (origin
9121 (method git-fetch)
9122 (uri (git-reference
9123 (url "https://github.com/rhboot/efivar")
9124 (commit version)))
9125 (file-name (git-file-name name version))
9126 (sha256
9127 (base32
9128 "1zd9dghg1z2rrsazv3d9rj7nik6kdqz42jiak65pipz7mpjn9zdk"))
9129 (patches (search-patches "efivar-fix-fprint-format.patch"))))
9130 (build-system gnu-build-system)
9131 (arguments
9132 (list
9133 ;; Tests require a UEFI system and is not detected in the chroot.
9134 #:tests? #f
9135 #:make-flags #~(list (string-append "prefix="
9136 #$output)
9137 (string-append "libdir="
9138 #$output "/lib")
9139 (string-append "CC="
9140 #$(cc-for-target))
9141 "HOSTCC=gcc"
9142 (string-append "LDFLAGS=-Wl,-rpath="
9143 #$output "/lib")
9144 ;; Strictly only needed for i686-linux/32bit
9145 "CFLAGS=-g -O2 -Wno-error=format")
9146 #:phases #~(modify-phases %standard-phases
9147 (add-after 'unpack 'build-deterministically
9148 (lambda _
9149 (substitute* "src/include/defaults.mk"
9150 ;; Don't use -march=native.
9151 (("-march=native")
9152 ""))))
9153 (delete 'configure))))
9154 (native-inputs (list mandoc pkg-config))
9155 (inputs (list popt))
9156 (home-page "https://github.com/rhboot/efivar")
9157 (synopsis "Tool and library to manipulate EFI variables")
9158 (description "This package provides a library and a command line
9159interface to the variable facility of UEFI boot firmware.")
9160 (license license:lgpl2.1+)))
9161
9162(define-public efibootmgr
9163 (package
9164 (name "efibootmgr")
9165 (version "18")
9166 (source
9167 (origin
9168 (method git-fetch)
9169 (uri (git-reference
9170 (url "https://github.com/rhboot/efibootmgr")
9171 (commit version)))
9172 (file-name (git-file-name name version))
9173 (sha256
9174 (base32 "1j19m3dngcb7jl88ib32phbh5r7c02dhhakq8jk6z7y408c111hd"))))
9175 (build-system gnu-build-system)
9176 (arguments
9177 (list
9178 #:tests? #f ;no tests
9179 #:make-flags
9180 #~(append (list (string-append "prefix=" #$output)
9181 (string-append "libdir=" #$output "/lib")
9182 ;; EFIDIR denotes a subdirectory relative to the
9183 ;; EFI System Partition where the loader will be
9184 ;; installed (known as OS_VENDOR in the code).
9185 ;; GRUB overrides this, as such it's only used if
9186 ;; nothing else is specified on the command line.
9187 "EFIDIR=gnu")
9188 #$(if (%current-target-system)
9189 #~(list
9190 (string-append "CC=" #$(cc-for-target))
9191 (string-append "PKG_CONFIG=" #$(pkg-config-for-target))
9192 (string-append "EXTRAINCDIRS="
9193 #$(this-package-input "efivar") "/include"))
9194 #~'()))
9195 #:phases #~(modify-phases %standard-phases (delete 'configure))))
9196 (native-inputs
9197 (list pkg-config))
9198 (inputs
9199 (list efivar popt))
9200 (home-page "https://github.com/rhboot/efibootmgr")
9201 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
9202 (description
9203 "@code{efibootmgr} is a user-space application to modify the Intel
9204Extensible Firmware Interface (EFI) Boot Manager. This application can
9205create and destroy boot entries, change the boot order, change the next
9206running boot option, and more.")
9207 (license license:gpl2+)))
9208
9209(define-public sysstat
9210 (package
9211 (name "sysstat")
9212 (version "12.7.5")
9213 (source
9214 (origin
9215 (method url-fetch)
9216 (uri (string-append "https://sysstat.github.io/sysstat-packages/"
9217 "sysstat-" version ".tar.xz"))
9218 (sha256
9219 (base32 "0ssdrm3k0fclq5b5i0aznfwdkbac9l9cf88idaq3pls9lm040rjp"))))
9220 (build-system gnu-build-system)
9221 (native-inputs (list gettext-minimal))
9222 (arguments
9223 `(#:tests? #f ; no test suite.
9224 ;; Without this flag, it tries to install the man pages with group 'root'
9225 ;; and fails because /etc/passwd lacks an entry for the root user.
9226 #:configure-flags
9227 (list "--disable-file-attr"
9228 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
9229 #:phases
9230 (modify-phases %standard-phases
9231 ;; The build process tries to create '/var/lib/sa', so we skip that
9232 ;; instruction.
9233 (add-after 'build 'skip-touching-var
9234 (lambda _
9235 (substitute* "Makefile"
9236 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
9237 "")))))))
9238 (home-page "https://sysstat.github.io")
9239 (synopsis "Performance monitoring tools for Linux")
9240 (description "The sysstat utilities are a collection of performance
9241monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
9242@code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
9243@code{sadf} and @code{sa}.")
9244 (license license:gpl2+)))
9245
9246(define-public acpilight
9247 (package
9248 (name "acpilight")
9249 (version "1.2")
9250 (source (origin
9251 (method git-fetch)
9252 (uri (git-reference
9253 (url "https://gitlab.com/wavexx/acpilight.git")
9254 (commit (string-append "v" version))))
9255 (file-name (git-file-name name version))
9256 (sha256
9257 (base32
9258 "1r0r3nx6x6vkpal6vci0zaa1n9dfacypldf6k8fxg7919vzxdn1w"))))
9259 (build-system gnu-build-system)
9260 (arguments
9261 (list #:tests? #f ; no tests
9262 #:make-flags
9263 #~(list (string-append "prefix=" #$output)
9264 (string-append "sysconfdir=" #$output "/lib")) ;udev rule
9265 #:phases
9266 #~(modify-phases %standard-phases
9267 (delete 'configure)
9268 (add-after 'unpack 'patch
9269 (lambda* (#:key inputs #:allow-other-keys)
9270 ;; Prevent reloading udev at build time
9271 (substitute* "Makefile"
9272 (("udevadm") "true"))
9273 (substitute* "90-backlight.rules"
9274 (("/bin")
9275 (string-append #$(this-package-input "coreutils")
9276 "/bin"))))))))
9277 (inputs (list coreutils python))
9278 (home-page "https://gitlab.com/wavexx/acpilight")
9279 (synopsis "Backward-compatibile xbacklight replacement")
9280 (description "acpilight is a backward-compatibile replacement for
9281xbacklight that uses the ACPI interface to set the display brightness. On
9282modern laptops acpilight can control both display and keyboard backlight
9283uniformly on either X11, the console or Wayland.")
9284 (license license:gpl3+)))
9285
9286(define-public light
9287 (package
9288 (name "light")
9289 (version "1.2.2")
9290 (source
9291 (origin
9292 (method git-fetch)
9293 (uri (git-reference
9294 (url "https://github.com/haikarainen/light")
9295 (commit (string-append "v" version))))
9296 (sha256
9297 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
9298 (file-name (git-file-name name version))))
9299 (build-system gnu-build-system)
9300 (arguments
9301 `(#:configure-flags '("CFLAGS=-fcommon")
9302 #:phases
9303 (modify-phases %standard-phases
9304 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
9305 (lambda* (#:key inputs #:allow-other-keys)
9306 (substitute* "90-backlight.rules"
9307 (("/bin/chgrp") (which "chgrp"))
9308 (("/bin/chmod") (which "chmod")))
9309 #t))
9310 (add-after 'install 'install-udev-rules
9311 (lambda* (#:key outputs #:allow-other-keys)
9312 (let ((out (assoc-ref outputs "out")))
9313 (install-file
9314 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
9315 #t))))))
9316 (native-inputs
9317 (list autoconf automake))
9318 (home-page "https://haikarainen.github.io/light/")
9319 (synopsis "GNU/Linux application to control backlights")
9320 (description
9321 "Light is a program to send commands to screen backlight controllers
9322under GNU/Linux. Features include:
9323
9324@itemize
9325@item It does not rely on X.
9326@item Light can automatically figure out the best controller to use, making
9327full use of underlying hardware.
9328@item It is possible to set a minimum brightness value, as some controllers
9329set the screen to be pitch black at a value of 0 (or higher).
9330@end itemize\n")
9331 (license license:gpl3+)))
9332
9333(define-public brightnessctl
9334 (package
9335 (name "brightnessctl")
9336 (version "0.5.1")
9337 (home-page "https://github.com/Hummer12007/brightnessctl")
9338 (source (origin
9339 (method git-fetch)
9340 (uri (git-reference (url home-page) (commit version)))
9341 (file-name (git-file-name name version))
9342 (sha256
9343 (base32
9344 "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq"))
9345 (patches (search-patches "brightnessctl-elogind-support.patch"))))
9346 (build-system gnu-build-system)
9347 (arguments
9348 `(#:tests? #f ; no tests
9349 #:make-flags (list (string-append "CC=" ,(cc-for-target))
9350 (string-append "PREFIX=" %output)
9351 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/")
9352 "ENABLE_SYSTEMD=1")
9353 #:phases
9354 (modify-phases %standard-phases
9355 (delete 'configure)
9356 (add-after 'unpack 'adjust-udev-rules
9357 (lambda _
9358 (substitute* "Makefile"
9359 (("INSTALL_UDEV_RULES=0") "INSTALL_UDEV_RULES=1"))
9360 (substitute* "90-brightnessctl.rules"
9361 (("/bin/") "/run/current-system/profile/bin/"))
9362 #t)))))
9363 (native-inputs
9364 (list pkg-config))
9365 (inputs
9366 (list elogind))
9367 (synopsis "Backlight and LED brightness control")
9368 (description
9369 "This program allows you read and control device brightness. Devices
9370include backlight and LEDs. It can also preserve current brightness before
9371applying the operation, such as on lid close.
9372
9373The appropriate permissions must be set on the backlight or LED control
9374interface in sysfs, which can be accomplished with the included udev rules.")
9375 (license license:expat)))
9376
9377(define-public tlp
9378 (package
9379 (name "tlp")
9380 (version "1.9.0")
9381 (source
9382 (origin
9383 (method git-fetch)
9384 (uri (git-reference
9385 (url "https://github.com/linrunner/TLP")
9386 (commit version)))
9387 (file-name (git-file-name name version))
9388 (sha256
9389 (base32 "0msskz42yy0ddq6gqak0dsl77wsym24ly3bkpymfwl9dr3wzikv8"))))
9390 (native-inputs
9391 (list shellcheck))
9392 (inputs
9393 `(("dbus" ,dbus)
9394 ("ethtool" ,ethtool)
9395 ("eudev" ,eudev)
9396 ("grep" ,grep)
9397 ("guile" ,guile-3.0) ;for wrap-script
9398 ("hdparm" ,hdparm)
9399 ("inetutils" ,inetutils)
9400 ("iw" ,iw)
9401 ("kmod" ,kmod)
9402 ("pciutils" ,pciutils)
9403 ("perl" ,perl)
9404 ("sed" ,sed)
9405 ("usbutils" ,usbutils)
9406 ("util-linux" ,util-linux)
9407 ("wireless-tools" ,wireless-tools)
9408 ,@(if (let ((system (or (%current-target-system)
9409 (%current-system))))
9410 (or (string-prefix? "i686-" system)
9411 (string-prefix? "x86_64-" system)))
9412 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
9413 '())))
9414 (build-system gnu-build-system)
9415 (arguments
9416 ;; XXX: The full test suite is run with "checkall" but it requires
9417 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
9418 (list
9419 #:make-flags
9420 #~(list "TLP_CONFUSR=/etc/tlp.conf" "TLP_CONFDIR=/etc/tlp.d")
9421 #:test-target "shellcheck"
9422 #:modules '((guix build gnu-build-system)
9423 (guix build utils)
9424 (srfi srfi-1))
9425 #:phases
9426 #~(modify-phases %standard-phases
9427 (delete 'configure) ; no configure script
9428 (add-before 'build 'setenv
9429 (lambda _
9430 (setenv "TLP_WITH_SYSTEMD" "0")
9431 (setenv "TLP_NO_INIT" "1")))
9432 (add-before 'build 'fix-installation
9433 (lambda _
9434 ;; Stop the Makefile from trying to create system directories.
9435 (substitute* "Makefile"
9436 (("= /usr") (string-append "= " #$output))
9437 (("= /etc") (string-append "= " #$output "/etc"))
9438 (("install -d -m 755 \\$\\(_VAR\\)") "#"))))
9439 (add-before 'build 'fix-perl-calls
9440 ;; Shell scripts in "bat.d" and "func.d" call "perl". Fix
9441 ;; invocation without wrapping every one of them.
9442 (lambda* (#:key inputs #:allow-other-keys)
9443 (substitute* (append (find-files "bat.d" ".")
9444 (find-files "func.d" "."))
9445 (("(^|[^/])perl" _ prefix)
9446 (string-append prefix
9447 (search-input-file inputs "bin/perl"))))))
9448 (replace 'install
9449 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
9450 (add-after 'install 'wrap
9451 (lambda* (#:key inputs outputs #:allow-other-keys)
9452 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
9453 (sbin (string-append (assoc-ref outputs "out") "/sbin"))
9454 ;; Used to ignore symlinks which don't need wrapping
9455 (regular-file-predicate
9456 (lambda (file stat) (eq? 'regular (stat:type stat))))
9457 (bin-files (find-files bin regular-file-predicate))
9458 (sbin-files (find-files sbin regular-file-predicate)))
9459 (define (bin-directory input-name)
9460 (let ((p (assoc-ref inputs input-name)))
9461 (and p (string-append p "/bin"))))
9462 (define (sbin-directory input-name)
9463 (string-append (assoc-ref inputs input-name) "/sbin"))
9464 (for-each (lambda (program)
9465 ;; Programs rely on $0 so we use wrap-script
9466 ;; instead of wrap-program
9467 (wrap-script program
9468 `("PATH" ":" prefix
9469 ,(append
9470 (filter-map bin-directory
9471 '("bash"
9472 "coreutils"
9473 "dbus"
9474 "eudev"
9475 "grep"
9476 "inetutils"
9477 "kmod"
9478 "perl"
9479 "sed"
9480 "usbutils"
9481 "util-linux"
9482 "x86-energy-perf-policy"))
9483 (filter-map sbin-directory
9484 '("ethtool"
9485 "hdparm"
9486 "iw"
9487 "pciutils"
9488 "util-linux"
9489 "wireless-tools"))))))
9490 (append bin-files sbin-files))))))))
9491 (home-page "https://linrunner.de/en/tlp/tlp.html")
9492 (synopsis "Power management tool for Linux")
9493 (description "TLP is a power management tool for Linux. It comes with
9494a default configuration already optimized for battery life. Nevertheless,
9495TLP is customizable to fulfil system requirements. TLP settings are applied
9496every time the power supply source is changed.")
9497 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
9498 ;; rest is GPLv2+.
9499 (license (list license:gpl2+ license:gpl3+))))
9500
9501(define-public tlpui
9502 (package
9503 (name "tlpui")
9504 (version "1.9.0")
9505 (source
9506 (origin
9507 (method git-fetch)
9508 (uri (git-reference
9509 (url "https://github.com/d4nj1/TLPUI")
9510 (commit (string-append "tlpui-" version))))
9511 (file-name (git-file-name name version))
9512 (sha256
9513 (base32 "00rkq389zs525s7ckjj6cm34s25rsrgz47p28pp43ld35i538g9w"))))
9514 (build-system pyproject-build-system)
9515 (arguments
9516 (list
9517 #:phases
9518 #~(modify-phases %standard-phases
9519 (add-after 'unpack 'set-absolute-locations
9520 (lambda* (#:key inputs #:allow-other-keys)
9521 (let ((defaults.conf
9522 (search-input-file inputs "/share/tlp/defaults.conf"))
9523 (lspci (search-input-file inputs "/bin/lspci"))
9524 (lsusb (search-input-file inputs "/bin/lsusb"))
9525 (tlp-stat (search-input-file inputs "/bin/tlp-stat")))
9526 (with-directory-excursion "tlpui"
9527 (substitute* '("file.py" "settingshelper.py" "statui.py")
9528 (("\"tlp-stat\"")
9529 (string-append "'" tlp-stat "'"))
9530 (("/usr/share/tlp/defaults.conf")
9531 defaults.conf))
9532 (substitute* "ui_config_objects/gtkusblist.py"
9533 (("\"lsusb\"")
9534 (string-append "'" lsusb "'")))
9535 (substitute* "ui_config_objects/gtkpcilist.py"
9536 (("\"lspci\"")
9537 (string-append "'" lspci "'")))
9538 ;; Settings check if various tlp executables, lspci and
9539 ;; usbutils are available. Skip this phase since we know
9540 ;; for sure they are (and it avoids patching each location).
9541 (substitute* "settingshelper.py"
9542 (("(command_exists = ).*" _ lead)
9543 (string-append lead "True\n")))))))
9544 (add-after 'install 'install-desktop-file
9545 (lambda _
9546 (let ((dir (string-append #$output "/share/applications")))
9547 (install-file "tlpui.desktop" dir))))
9548 (add-after 'wrap 'wrap-gi-python
9549 (lambda _
9550 (let ((gi-typelib-path (getenv "GI_TYPELIB_PATH")))
9551 (wrap-program (string-append #$output "/bin/tlpui")
9552 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))))))))
9553 (native-inputs
9554 (list `(,glib "bin")
9555 gobject-introspection
9556 python-poetry-core
9557 python-pytest
9558 python-pyyaml))
9559 (inputs
9560 (list gtk+
9561 pciutils
9562 python-pygobject
9563 tlp
9564 usbutils))
9565 (propagated-inputs (list (librsvg-for-system)))
9566 (home-page "https://github.com/d4nj1/TLPUI")
9567 (synopsis "User interface for TLP written in Python")
9568 (description
9569 "The Python scripts in this project generate a GTK-UI to change
9570TLP configuration files easily. It aims to protect users from setting
9571bad configuration and to deliver a basic overview of all the valid
9572configuration values.")
9573 (license license:gpl2+)))
9574
9575(define-public lshw
9576 (package
9577 (name "lshw")
9578 (version "B.02.19.2")
9579 (source (origin
9580 (method url-fetch)
9581 (uri (string-append "https://www.ezix.org/software/"
9582 "files/lshw-" version
9583 ".tar.gz"))
9584 (sha256
9585 (base32
9586 "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
9587 (build-system gnu-build-system)
9588 (arguments
9589 `(#:phases (modify-phases %standard-phases (delete 'configure))
9590 #:tests? #f ; no tests
9591 #:make-flags
9592 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
9593 (synopsis "List hardware information")
9594 (description
9595 "@command{lshw} (Hardware Lister) is a small tool to provide
9596detailed information on the hardware configuration of the machine.
9597It can report exact memory configuration, firmware version, mainboard
9598configuration, CPU version and speed, cache configuration, bus speed,
9599and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
9600machines (PowerMac G4 is known to work).")
9601 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
9602 (license license:gpl2+)))
9603
9604(define-public libmnl
9605 (package
9606 (name "libmnl")
9607 (version "1.0.5")
9608 (source
9609 (origin
9610 (method url-fetch)
9611 (uri (string-append "mirror://netfilter.org/libmnl/"
9612 "libmnl-" version ".tar.bz2"))
9613 (sha256
9614 (base32
9615 "09851ns07399rbz0y8slrlmnw3fn1nakr8d37pxjn5gkks8rnjr7"))))
9616 (build-system gnu-build-system)
9617 (home-page "https://www.netfilter.org/projects/libmnl/")
9618 (synopsis "Netlink utility library")
9619 (description "Libmnl is a minimalistic user-space library oriented to
9620Netlink developers. There are a lot of common tasks in parsing, validating,
9621constructing of both the Netlink header and TLVs that are repetitive and easy to
9622get wrong. This library aims to provide simple helpers that allows you to
9623re-use code and to avoid re-inventing the wheel.")
9624 (properties
9625 '((release-monitoring-url . "https://www.netfilter.org/pub/libmnl/")))
9626 (license license:lgpl2.1+)))
9627
9628(define-public libnftnl
9629 (package
9630 (name "libnftnl")
9631 (version "1.2.8")
9632 (source
9633 (origin
9634 (method url-fetch)
9635 (uri (string-append "mirror://netfilter.org/libnftnl/"
9636 "libnftnl-" version ".tar.xz"))
9637 (sha256
9638 (base32 "15ddcyp91lxjh2wfi8xicjpffhn9rpiqsa8djbkqvc69npbabzip"))))
9639 (build-system gnu-build-system)
9640 (native-inputs
9641 (list pkg-config))
9642 (inputs
9643 (list libmnl))
9644 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
9645 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
9646 (description "Libnftnl is a userspace library providing a low-level netlink
9647programming interface to the in-kernel nf_tables subsystem. The library
9648libnftnl has been previously known as libnftables. This library is currently
9649used by nftables.")
9650 (license license:gpl2+)))
9651
9652;;; The symbol libnftl/fixed should be used when libnftnl needs fixes
9653;;; (security or else) and this deprecation could be removed.
9654(define-deprecated/public-alias libnftnl/fixed libnftnl/pinned)
9655
9656;; This is used in iptables, which contributes to rust. We're pinning this
9657;; variant to avoid accidental rebuilds of rust.
9658(define-public libnftnl/pinned
9659 (package
9660 (inherit libnftnl)
9661 (version "1.2.8")
9662 (source
9663 (origin
9664 (method url-fetch)
9665 (uri (string-append "mirror://netfilter.org/libnftnl/"
9666 "libnftnl-" version ".tar.xz"))
9667 (sha256
9668 (base32 "15ddcyp91lxjh2wfi8xicjpffhn9rpiqsa8djbkqvc69npbabzip"))))
9669 (build-system gnu-build-system)
9670 (native-inputs
9671 (list pkg-config))
9672 (inputs
9673 (list libmnl))))
9674
9675(define-public nftables
9676 (package
9677 (name "nftables")
9678 (version "1.0.8")
9679 (source
9680 (origin
9681 (method url-fetch)
9682 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
9683 version ".tar.xz")
9684 (string-append "https://www.nftables.org/projects/nftables"
9685 "/files/nftables-" version ".tar.xz")))
9686 (sha256
9687 (base32 "0l1xpwr9qfbl3bxa97v8s2lbibiz0xma9q0qi34xp0hswh6p8wwk"))))
9688 (build-system gnu-build-system)
9689 (arguments `(#:configure-flags
9690 '("--disable-static"
9691 "--with-cli=readline"
9692 "--with-json")
9693 #:phases
9694 (modify-phases %standard-phases
9695 (add-before 'configure 'autoreconf
9696 (lambda _
9697 (invoke "autoreconf" "-fi"))))))
9698 (inputs (list gmp libmnl libnftnl readline jansson))
9699 (native-inputs (list pkg-config
9700 bison
9701 flex
9702 docbook2x
9703 autoconf
9704 automake
9705 libtool))
9706 (home-page "https://www.nftables.org")
9707 (synopsis "Userspace utility for Linux packet filtering")
9708 (description "nftables is the project that aims to replace the existing
9709{ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
9710filtering framework, a new userspace utility and also a compatibility layer for
9711{ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
9712infrastructure such as the existing hooks, the connection tracking system, the
9713userspace queueing component and the logging subsystem.")
9714 (license license:gpl2)))
9715
9716(define-public libnetfilter-conntrack
9717 (package
9718 (name "libnetfilter-conntrack")
9719 (version "1.0.9")
9720 (source
9721 (origin
9722 (method url-fetch)
9723 (uri (string-append "https://netfilter.org/projects/"
9724 "libnetfilter_conntrack/files/"
9725 "libnetfilter_conntrack-"
9726 version ".tar.bz2"))
9727 (sha256
9728 (base32 "1a3rnpsba64dzy97wwjrxal89wr0nf9znvag2j18nkp3kzs9vgb7"))))
9729 (build-system gnu-build-system)
9730 (native-inputs (list pkg-config))
9731 (inputs (list libnfnetlink libmnl))
9732 (synopsis "Library for kernel connection tracking state table")
9733 (description "libnetfilter_conntrack is a userspace library providing a
9734programming interface (API) to the in-kernel connection tracking state table.
9735The library libnetfilter_conntrack has been previously known as
9736libnfnetlink_conntrack and libctnetlink. This library is currently used by
9737conntrack-tools among many other applications.")
9738 (home-page "https://netfilter.org/projects/libnetfilter_conntrack/index.html")
9739 (supported-systems (filter target-linux? %supported-systems))
9740 (properties '((upstream-name . "libnetfilter_conntrack")))
9741 (license license:gpl2+)))
9742
9743(define-public libnetfilter-cttimeout
9744 (package
9745 (name "libnetfilter-cttimeout")
9746 (version "1.0.1")
9747 (source
9748 (origin
9749 (method url-fetch)
9750 (uri (string-append "https://netfilter.org/projects/"
9751 "libnetfilter_cttimeout/files/"
9752 "libnetfilter_cttimeout-" version ".tar.bz2"))
9753 (sha256
9754 (base32 "0983cpyvxyycbnzqlrzml80pph2z51r6s7sxp06ciq8468pxln8b"))))
9755 (build-system gnu-build-system)
9756 (native-inputs (list pkg-config))
9757 (inputs (list libmnl))
9758 (synopsis "Library for kernel connection tracking timeout infrastructure")
9759 (description "libnetfilter_cttimeout is the userspace library that
9760provides the programming interface to the fine-grain connection tracking
9761timeout infrastructure. With this library, you can create, update and delete
9762timeout policies that can be attached to traffic flows. This library is used
9763by conntrack-tools.")
9764 (home-page "https://netfilter.org/projects/libnetfilter_cttimeout/index.html")
9765 (supported-systems (filter target-linux? %supported-systems))
9766 (properties '((upstream-name . "libnetfilter_cttimeout")))
9767 (license license:gpl2)))
9768
9769(define-public libnetfilter-cthelper
9770 (package
9771 (name "libnetfilter-cthelper")
9772 (version "1.0.1")
9773 (source
9774 (origin
9775 (method url-fetch)
9776 (uri (string-append "https://netfilter.org/projects/"
9777 "libnetfilter_cthelper/files/"
9778 "libnetfilter_cthelper-" version ".tar.bz2"))
9779 (sha256
9780 (base32 "04n95ngil5l8m8v64dfjm1dwq0wd3kf4vw1zblsrff13hxa3s1ql"))))
9781 (build-system gnu-build-system)
9782 (native-inputs (list pkg-config))
9783 (inputs (list libmnl))
9784 (synopsis "Library for user-space connection tracking helpers")
9785 (description "libnetfilter_cthelper is a userspace library that provides a
9786programming interface to user-space connection tracking helpers.
9787@enumerate
9788@item
9789register new user-space connection tracking helpers
9790@item
9791unregister user-space connection tracking helpers
9792@item
9793list existing registered user-space connection tracking helpers
9794@end enumerate")
9795 (home-page "https://netfilter.org/projects/libnetfilter_cthelper/index.html")
9796 (supported-systems (filter target-linux? %supported-systems))
9797 (properties '((upstream-name . "libnetfilter_cthelper")))
9798 (license license:gpl2+)))
9799
9800(define-public libnetfilter-queue
9801 (package
9802 (name "libnetfilter-queue")
9803 (version "1.0.5")
9804 (source
9805 (origin
9806 (method url-fetch)
9807 (uri (string-append "https://netfilter.org/projects/"
9808 "libnetfilter_queue/files/"
9809 "libnetfilter_queue-" version ".tar.bz2"))
9810 (sha256
9811 (base32
9812 "1xdra6i4p8jkv943ygjw646qx8df27f7p5852kc06vjx608krzzr"))))
9813 (build-system gnu-build-system)
9814 (native-inputs (list pkg-config))
9815 (inputs (list libmnl libnfnetlink))
9816 (synopsis "Library for kernel netfilter infrastructure and state")
9817 (description "libnetfilter_queue is a userspace library providing an API
9818to packets that have been queued by the kernel packet filter. It is is part
9819of a system that deprecates the old ip_queue/libipq mechanism.")
9820 (home-page "https://netfilter.org/projects/libnetfilter_queue/index.html")
9821 (supported-systems (filter target-linux? %supported-systems))
9822 (properties '((upstream-name . "libnetfilter_queue")))
9823 (license license:gpl2+)))
9824
9825(define-public conntrack-tools
9826 (package
9827 (name "conntrack-tools")
9828 (version "1.4.8")
9829 (source
9830 (origin
9831 (method url-fetch)
9832 (uri (string-append "https://netfilter.org/projects/"
9833 "conntrack-tools/files/"
9834 "conntrack-tools-" version ".tar.xz"))
9835 (sha256
9836 (base32 "1mnynl5a63j25arapwvkjbm3a2cqm3aaklwfwwclhmpnqps7fxh6"))))
9837 (build-system gnu-build-system)
9838 (native-inputs (list bison flex pkg-config))
9839 (inputs (list libtirpc
9840 libnetfilter-conntrack
9841 libnetfilter-cttimeout
9842 libnetfilter-cthelper
9843 libnetfilter-queue
9844 libnfnetlink
9845 libmnl))
9846 (synopsis "Set of tools targeting the conntrack kernel subsystem")
9847 (description "The tool conntrack provides a full featured interface that
9848is intended to replace the old @file{/proc/net/ip_conntrack} interface. Using
9849conntrack, you can view and manage the in-kernel connection tracking state
9850table from userspace. On the other hand, conntrackd covers the specific
9851aspects of stateful firewalls to enable highly available scenarios, and can be
9852used as statistics collector as well.
9853
9854Since 1.2.0, the conntrack-tools includes the @command{nfct} command line
9855utility. This utility only supports the nfnetlink_cttimeout by now. In the
9856long run, we expect that it will replace conntrack by providing a syntax
9857similar to nftables.")
9858 (home-page "https://netfilter.org/projects/conntrack-tools/index.html")
9859 (supported-systems (filter target-linux? %supported-systems))
9860 (license license:gpl2+)))
9861
9862(define-public libnetfilter-acct
9863 (package
9864 (name "libnetfilter-acct")
9865 (version "1.0.3")
9866 (source
9867 (origin
9868 (method url-fetch)
9869 (uri (string-append "https://netfilter.org/projects/"
9870 "libnetfilter_acct/files/"
9871 "libnetfilter_acct-" version ".tar.bz2"))
9872 (sha256
9873 (base32
9874 "06lsjndgfjsgfjr43px2n2wk3nr7whz6r405mks3887y7vpwwl22"))))
9875 (build-system gnu-build-system)
9876 (native-inputs (list pkg-config))
9877 (inputs (list libmnl))
9878 (synopsis "Library providing interface to extended accounting infrastructure")
9879 (description "libnetfilter_acct is the userspace library providing interface
9880to extended accounting infrastructure.
9881
9882@enumerate
9883@item
9884creating accounting objects
9885@item
9886retrieving accounting objects (and atomically set to zero)
9887@item
9888deleting accounting objects
9889@end enumerate
9890For the nfnetlink_acct subsystem.")
9891 (home-page "https://netfilter.org/projects/libnetfilter_acct/index.html")
9892 (supported-systems (filter target-linux? %supported-systems))
9893 (properties '((upstream-name . "libnetfilter_acct")))
9894 (license license:lgpl2.1+)))
9895
9896(define-public nfacct
9897 (package
9898 (name "nfacct")
9899 (version "1.0.2")
9900 (source
9901 (origin
9902 (method url-fetch)
9903 (uri (string-append "https://netfilter.org/projects/" name
9904 "/files/nfacct-" version ".tar.bz2"))
9905 (sha256
9906 (base32
9907 "0sdxbxjyapbqcp2ami5jd10vz4xbbdvx39f3wfy1iqsbflc25zzc"))))
9908 (build-system gnu-build-system)
9909 (native-inputs (list pkg-config))
9910 (inputs (list libmnl libnetfilter-acct))
9911 (synopsis "Command line tool to create/retrieve/delete accounting objects")
9912 (description "nfacct is the command line tool to create/retrieve/delete
9913accounting objects
9914@enumerate
9915@item
9916listing the objects of the nfacct table in plain text/XML
9917@item
9918atomically get and reset objects of the nfacct table
9919@item
9920adding new objects to the nfacct table
9921@item
9922deleting objects from the nfacct table
9923@end enumerate")
9924 (home-page "https://netfilter.org/projects/nfacct/index.html")
9925 (supported-systems (filter target-linux? %supported-systems))
9926 (license license:gpl2+)))
9927
9928(define-public libnetfilter-log
9929 (package
9930 (name "libnetfilter-log")
9931 (version "1.0.2")
9932 (source
9933 (origin
9934 (method url-fetch)
9935 (uri (string-append "https://netfilter.org/projects/"
9936 "libnetfilter_log/files/"
9937 "libnetfilter_log-" version ".tar.bz2"))
9938 (sha256
9939 (base32
9940 "1spy9xs41v76kid5ana8n126f3mvgq6fjibbfbj4kn0larbhix73"))))
9941 (build-system gnu-build-system)
9942 (native-inputs (list pkg-config))
9943 (inputs (list libnfnetlink libmnl))
9944 (synopsis "Library providing interface to packets logged by netfilter")
9945 (description "libnetfilter_log is a userspace library providing interface to
9946packets that have been logged by the kernel packet filter. It is is part of a
9947system that deprecates the old syslog/dmesg based packet logging. This library
9948has been previously known as libnfnetlink_log.
9949
9950@enumerate
9951@item
9952receiving to-be-logged packets from the kernel nfnetlink_log subsystem
9953@end enumerate")
9954 (home-page "https://netfilter.org/projects/libnetfilter_log/index.html")
9955 (supported-systems (filter target-linux? %supported-systems))
9956 (properties '((upstream-name . "libnetfilter_log")))
9957 (license license:gpl2+)))
9958
9959(define-public ulogd
9960 (package
9961 (name "ulogd")
9962 (version "2.0.7")
9963 (source
9964 (origin
9965 (method url-fetch)
9966 (uri (string-append "https://netfilter.org/projects/" name
9967 "/files/ulogd-" version ".tar.bz2"))
9968 (sha256
9969 (base32
9970 "0ax9959c4bapq78n13bbaibcf1gwjir3ngx8l2dh45lw9m4ha2lr"))))
9971 (build-system gnu-build-system)
9972 (outputs '("out"
9973 ;; additional non-default output plugins
9974 "json" "pcap" "sqlite3" "pgsql" "mysql"))
9975 (native-inputs (list pkg-config))
9976 (inputs (list libnfnetlink
9977 libmnl
9978 libnetfilter-log
9979 libnetfilter-conntrack
9980 libnetfilter-acct
9981 sqlite
9982 libpcap
9983 jansson
9984 postgresql
9985 (list mariadb "dev")
9986 zlib
9987 openssl))
9988 (arguments
9989 (list #:configure-flags
9990 #~(list (string-append "--with-pgsql="
9991 (assoc-ref %build-inputs "postgresql"))
9992 (string-append "--with-mysql="
9993 (assoc-ref %build-inputs "mariadb")))
9994 #:phases
9995 #~(modify-phases %standard-phases
9996 (add-after 'install 'install-doc
9997 (lambda _
9998 (let ((out-etc (string-append #$output "/etc"))
9999 (ulogd.conf "ulogd.conf"))
10000 (mkdir-p out-etc)
10001 (copy-file ulogd.conf (string-append out-etc "/"
10002 ulogd.conf)))))
10003 (add-after 'install 'setup-plugin-outputs
10004 (lambda* (#:key outputs #:allow-other-keys)
10005 (with-directory-excursion
10006 (string-append #$output "/lib/ulogd/")
10007 (for-each
10008 (lambda (output-name)
10009 (let ((output-dir (string-append
10010 (assoc-ref outputs output-name)
10011 "/lib/ulogd/")))
10012 (mkdir-p output-dir)
10013 (for-each
10014 (lambda (plugin)
10015 (copy-file plugin (string-append output-dir plugin))
10016 (delete-file plugin))
10017 (find-files "."
10018 (string-append "ulogd_output_"
10019 (string-upcase output-name)
10020 ".*$")))))
10021 (list "json" "pcap" "sqlite3" "pgsql" "mysql"))))))))
10022 (synopsis "Logging daemon for netfilter and iptables")
10023 (description "ulogd is a userspace logging daemon for netfilter/iptables
10024related logging. This includes per-packet logging of security violations,
10025per-packet logging for accounting, per-flow logging and flexible user-defined
10026accounting.
10027
10028@enumerate
10029@item
10030Packet and flow-based traffic accounting
10031@item
10032Flexible user-defined traffic accounting via nfacct infrastructure
10033@item
10034SQL database back-end support: SQLite3, PostgreSQL, MySQL
10035@item
10036Text-based output formats: CSV, XML, Netfilter's LOG, Netfilter's conntrack
10037@end enumerate")
10038 (home-page "https://netfilter.org/projects/nfacct/index.html")
10039 (supported-systems (filter target-linux? %supported-systems))
10040 (license license:gpl2)))
10041
10042(define-public proot
10043 (package
10044 (name "proot")
10045 (version "5.4.0")
10046 (source
10047 (origin
10048 (method git-fetch)
10049 (uri (git-reference
10050 (url "https://github.com/proot-me/PRoot")
10051 (commit (string-append "v" version))))
10052 (file-name (git-file-name name version))
10053 (sha256
10054 (base32 "186qsg4yvisqjgf8w5jxhnlig7x341vpqwcgp8as3r59qmqkpmk7"))
10055 ;; Waiting for upstream inclusion at
10056 ;; https://github.com/proot-me/proot/pull/355
10057 (patches (search-patches "proot-add-clone3.patch"
10058 "proot-add-missing-include.patch"))))
10059 (build-system gnu-build-system)
10060 ;; Many architectures are not supported (see:
10061 ;; https://github.com/proot-me/proot/blob/master/src/arch.h#L51).
10062 (supported-systems '("x86_64-linux" "i686-linux"
10063 "armhf-linux" "aarch64-linux" "i586-gnu" "x86_64-gnu"))
10064 (arguments
10065 ;; Disable the test suite on armhf-linux, as there are too many
10066 ;; failures to keep track of (see for example:
10067 ;; https://github.com/proot-me/proot/issues/286).
10068 (list
10069 #:tests? (not (or (%current-target-system)
10070 (string-prefix? "armhf"
10071 (or (%current-system)))))
10072 #:make-flags
10073 #~'("-C" "src")
10074 #:phases
10075 #~(modify-phases %standard-phases
10076 (add-after 'unpack 'patch-sources
10077 (lambda* (#:key inputs #:allow-other-keys)
10078 (substitute* (find-files "src" "\\.[ch]$")
10079 (("\"/bin/sh\"")
10080 (format #f "~s" (search-input-file inputs "/bin/sh"))))
10081
10082 (substitute* "src/GNUmakefile"
10083 (("/bin/echo") (which "echo"))
10084 (("^VERSION = .*")
10085 (string-append "VERSION := " #$version "\n")))
10086
10087 (substitute* (find-files "test" "\\.sh$")
10088 ;; Some of the tests try to "bind-mount" /bin/true.
10089 (("-b /bin/true:")
10090 (string-append "-b " (which "true") ":"))
10091 ;; Likewise for /bin.
10092 (("-b /bin:") "-b /gnu:")
10093 ;; Others try to run /bin/sh.
10094 (("/bin/sh") (which "sh"))
10095 ;; Others assume /etc/fstab exists.
10096 (("/etc/fstab") "/etc/passwd"))
10097 (substitute* "test/GNUmakefile"
10098 (("-b /bin:") "-b /gnu:"))
10099 (substitute* "test/test-c6b77b77.mk"
10100 (("/bin/bash") (which "bash"))
10101 (("/usr/bin/test") (which "test")))
10102 (substitute* "test/test-16573e73.c"
10103 (("/bin/([a-z-]+)" _ program)
10104 (which program)))
10105 (substitute* "test/test-5467b986.sh"
10106 (("-w /usr") "-w /gnu")
10107 (("-w usr") "-w gnu")
10108 (("/usr/share") "/gnu/store")
10109 (("share") "store"))
10110 (substitute* "test/test-092c5e26.sh"
10111 (("-q echo ")
10112 "-q $(which echo) "))
10113
10114 ;; The socket tests requires networking.
10115 (for-each delete-file
10116 (find-files "test" "test-socket.*\\.sh$"))))
10117 (delete 'configure)
10118 (add-after 'build 'build-manpage
10119 (lambda _
10120 (with-directory-excursion "doc"
10121 (invoke "make" "proot/man.1" "SUFFIX=.py"))))
10122 (replace 'check
10123 (lambda* (#:key tests? #:allow-other-keys)
10124 (when tests?
10125 ;; Most of the tests expect "/bin" to be in $PATH so
10126 ;; they can run things that live in $ROOTFS/bin.
10127 (setenv "PATH" (string-append (getenv "PATH") ":/bin"))
10128 (invoke "make" "check" "-C" "test"
10129 "-j" (number->string (parallel-job-count))))))
10130 (replace 'install
10131 (lambda _
10132 ;; The 'install' rule does nearly nothing.
10133 (let ((man1 (string-append #$output "/share/man/man1")))
10134 ;; TODO: 'make install-care' (does not even
10135 ;; build currently.)
10136 (invoke "make" "-C" "src" "install"
10137 (string-append "PREFIX=" #$output))
10138 (mkdir-p man1)
10139 (copy-file "doc/proot/man.1"
10140 (string-append man1 "/proot.1"))))))))
10141 (native-inputs (list which
10142 ;; For 'mcookie', used by some of the tests.
10143 util-linux
10144 coreutils
10145 pkg-config
10146 ;; For rst2man, used to generate the manual page.
10147 python-docutils-0.19))
10148 (inputs (list libarchive talloc))
10149 (home-page "https://github.com/proot-me/PRoot")
10150 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
10151 (description
10152 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
10153and @code{binfmt_misc}. This means that users don't need any privileges or
10154setup to do things like using an arbitrary directory as the new root
10155file system, making files accessible somewhere else in the file system
10156hierarchy, or executing programs built for another CPU architecture
10157transparently through QEMU user-mode. Also, developers can use PRoot as a
10158generic process instrumentation engine thanks to its extension mechanism.
10159Technically PRoot relies on @code{ptrace}, an unprivileged system-call
10160available in the kernel Linux.")
10161 (license license:gpl2+)))
10162
10163(define-public proot-static
10164 (package
10165 (inherit proot)
10166 (name "proot-static")
10167 (synopsis
10168 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
10169 (inputs (list talloc/static))
10170 (arguments
10171 (substitute-keyword-arguments arguments
10172 ((#:make-flags flags)
10173 #~(cons* "LDFLAGS = -ltalloc -static -static-libgcc" #$flags))
10174 ((#:phases phases)
10175 #~(modify-phases #$phases
10176 (add-after 'strip 'remove-store-references
10177 (lambda _
10178 (with-directory-excursion #$output
10179 (remove-store-references "bin/proot"))))))
10180 ((#:allowed-references _ '("out"))
10181 '("out"))))))
10182
10183(define-public cpuid
10184 (package
10185 (name "cpuid")
10186 (version "20260220")
10187 (source (origin
10188 (method url-fetch)
10189 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
10190 version ".src.tar.gz"))
10191 (sha256
10192 (base32
10193 "1ywg1fzbk153sil3n0mdrah3728j76dbjj8c24gig4g5bbbhyqp7"))))
10194 (build-system gnu-build-system)
10195 (arguments
10196 (list #:make-flags
10197 #~(list (string-append "CC=" #$(cc-for-target)))
10198 #:tests? #f ; no tests
10199 #:phases
10200 #~(modify-phases %standard-phases
10201 (delete 'configure) ; no configure script
10202 (add-before 'install 'fix-makefile
10203 (lambda* (#:key outputs #:allow-other-keys)
10204 (substitute* "Makefile"
10205 (("\\$\\(BUILDROOT\\)/usr")
10206 (assoc-ref outputs "out"))))))))
10207 (inputs (list perl))
10208 (supported-systems '("i686-linux" "x86_64-linux"))
10209 (home-page "https://www.etallen.com/cpuid.html")
10210 (synopsis "Dump x86 CPUID processor information")
10211 (description "cpuid dumps detailed information about the CPU(s) gathered
10212from the CPUID instruction, and also determines the exact model of CPU(s). It
10213supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
10214NexGen, Rise, and SiS CPUs.")
10215 (license license:gpl2+)))
10216
10217(define-public jmtpfs
10218 (package
10219 (name "jmtpfs")
10220 (version "0.5")
10221 (source
10222 (origin
10223 (method git-fetch)
10224 (uri (git-reference
10225 (url "https://github.com/JasonFerrara/jmtpfs")
10226 (commit (string-append "v" version))))
10227 (file-name (git-file-name name version))
10228 (sha256
10229 (base32
10230 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
10231 (build-system gnu-build-system)
10232 (inputs
10233 (list file fuse-2 libmtp))
10234 (native-inputs
10235 (list pkg-config))
10236 (home-page "https://github.com/JasonFerrara/jmtpfs")
10237 (synopsis "Use a FUSE file system to access data over MTP")
10238 (description "jmtpfs uses @acronym{FUSE, File system in USEr space} to
10239provide access to data over @acronym{MTP, the Media Transfer Protocol}.
10240Unprivileged users can mount the MTP device as a file system.")
10241 (license license:gpl3)))
10242
10243(define-public procenv
10244 (package
10245 (name "procenv")
10246 (version "0.60")
10247 (source
10248 (origin
10249 (method git-fetch)
10250 (uri (git-reference
10251 (url "https://github.com/jamesodhunt/procenv")
10252 (commit version)))
10253 (file-name (git-file-name name version))
10254 (sha256
10255 (base32 "00d7q0h4qjc8lg435lq77lp2fx6ikm5piq90m81mr1dqqna1g6pz"))))
10256 (build-system gnu-build-system)
10257 (native-inputs
10258 (list pkg-config
10259 ;; For tests.
10260 check groff))
10261 (inputs
10262 (list expat libcap libselinux))
10263 (synopsis "Utility to show process environment")
10264 (description
10265 "Procenv is a command-line tool that displays as much detail about
10266itself and its environment as possible. It can be used as a test
10267tool, to understand the type of environment a process runs in, and for
10268comparing system environments.")
10269 (home-page "https://github.com/jamesodhunt/procenv/")
10270 (license license:gpl3+)))
10271
10272(define-public cassini-headers
10273 (package
10274 (name "cassini-headers")
10275 (version "14.0.0")
10276 (home-page "https://github.com/HewlettPackard/shs-cassini-headers")
10277 (source (origin
10278 (method git-fetch)
10279 (uri (git-reference
10280 (url home-page)
10281 (commit (string-append "release/shs-" version))))
10282 (file-name (git-file-name name version))
10283 (sha256
10284 (base32
10285 "074r1snc682f1b6vgswyz55n8zjf5rhqnsl31xsswih7q9q38jda"))
10286 (patches (search-patches "cassini-headers-memset.patch"))))
10287 (build-system copy-build-system)
10288 (arguments
10289 (list #:install-plan
10290 #~'(("include" "include")
10291 ("share/cassini-headers" "share/cassini-headers"))))
10292 (synopsis "Cassini network hardware definitions and headers")
10293 (description
10294 "This package provides hardware definitions and C headers for use by
10295the Linux driver and by user-space applications for the Cassini/Slingshot
10296high-speed network interconnect made by HPE (formerly Cray). User-land
10297software uses @file{cxi_prov_hw.h} from this package.")
10298 ;; As per include/cxi_prov_hw.h it is __aarch64__ or __x86_64__ only.
10299 (supported-systems '("x86_64-linux" "aarch64-linux"))
10300 (license (list license:gpl2 license:bsd-2)))) ;dual-licensed
10301
10302(define-public cxi-driver
10303 (package
10304 (name "cxi-driver")
10305 (version "14.0.0")
10306 (home-page "https://github.com/HewlettPackard/shs-cxi-driver")
10307 (source
10308 (origin
10309 (method git-fetch)
10310 (uri (git-reference
10311 (url home-page)
10312 (commit (string-append "release/shs-" version))))
10313 (file-name (git-file-name name version))
10314 (sha256
10315 (base32
10316 "07dhdm1az9hvy48iq8bn0wypwyml59yr5aqqyf1yhwrf1basry9g"))))
10317 ;; TODO: Actually build the Linux driver.
10318 (build-system copy-build-system)
10319 (arguments
10320 (list #:install-plan #~'(("include" "include"))))
10321 (propagated-inputs (list cassini-headers))
10322 (synopsis "Linux driver for the Cassini/Slingshot interconnect")
10323 (description
10324 "This is the Linux driver for the Cray/HPE Cassini 1 and 2 high-speed
10325network interconnect (aka. Slingshot), and its Ethernet driver. It includes
10326the @file{uapi/misc/cxi.h} C header file for use by user-land software.
10327
10328Currently the Linux driver itself is missing from this package.")
10329 (license license:gpl2+)))
10330
10331(define-public cxi-driver-for-libfabric-1
10332 ;; This old version defines constants such as 'CXI_MAP_IOVA_ALLOC' that
10333 ;; libfabric 1.22.0 relies on.
10334 (let ((commit "5f0ec0ead6ef3f98542a2ef5e76b89d14dd22150")
10335 (revision "0"))
10336 (package
10337 (inherit cxi-driver)
10338 (name "cxi-driver")
10339 (version (git-version "1.0.0" ;per .spec file
10340 revision commit))
10341 (home-page "https://github.com/HewlettPackard/shs-cxi-driver")
10342 (source
10343 (origin
10344 (method git-fetch)
10345 (uri (git-reference (url home-page) (commit commit)))
10346 (file-name (git-file-name name version))
10347 (sha256
10348 (base32
10349 "19cly014ihgdidrc1aki2xsbfhpc0g73v0vxcky8r27xza7rz5bg")))))))
10350
10351(define-public libcxi
10352 (package
10353 (name "libcxi")
10354 ;; Note: Do not upgrade until
10355 ;; <https://github.com/HewlettPackard/shs-libcxi/issues/18> is resolved.
10356 (version "13.0.0")
10357 (home-page "https://github.com/HewlettPackard/shs-libcxi")
10358 (source
10359 (origin
10360 (method git-fetch)
10361 (uri (git-reference (url home-page)
10362 (commit (string-append "release/shs-" version))))
10363 (file-name (git-file-name name version))
10364 (sha256
10365 (base32 "1m8mds1h8plhfn2ja9br31xaiy82ky69685cp1rznanl18inaiff"))))
10366 (build-system gnu-build-system)
10367 (arguments
10368 (list #:configure-flags
10369 #~(list "--disable-static"
10370 (string-append "--with-udevrulesdir="
10371 #$output "/lib/udev/rules.d"))
10372
10373 #:phases
10374 #~(modify-phases %standard-phases
10375 (add-before 'configure 'set-cassini-file-names
10376 (lambda* (#:key inputs #:allow-other-keys)
10377 (substitute* "utils/cxi_dump_csrs.py"
10378 (("/usr/share/cassini-headers/csr_defs.json")
10379 (search-input-file
10380 inputs
10381 "/share/cassini-headers/csr_defs.json"))))))))
10382 (native-inputs (list autoconf
10383 automake
10384 libtool
10385 pkg-config
10386 python-wrapper))
10387 (inputs (list libconfig
10388 libuv
10389 fuse-2
10390 libyaml
10391 libnl
10392 numactl
10393 eudev
10394 (list lm-sensors "lib")))
10395 (propagated-inputs (list cassini-headers cxi-driver))
10396 (synopsis "Interface to the Cassini/Slingshot high-speed interconnect")
10397 (description
10398 "Libcxi provides applications with a low-level interface to the
10399Cray/HPE Cassini high-speed @acronym{NIC, network interface controller}, also
10400known as Slingshot.")
10401
10402 ;; License is spelled out in 'cray-libcxi.spec' and in source file
10403 ;; headers.
10404 (license (list license:lgpl2.1+ license:bsd-3)))) ;dual-licensed
10405
10406(define-public libfabric
10407 (package
10408 (name "libfabric")
10409 (version "2.5.1")
10410 (source
10411 (origin
10412 (method git-fetch)
10413 (uri (git-reference
10414 (url "https://github.com/ofiwg/libfabric")
10415 (commit (string-append "v" version))))
10416 (file-name (git-file-name name version))
10417 (sha256 (base32 "15z0g1z62hv6kkiksvpxl6xv07wdmnvqhm5vnh0vq4ipr8f5vikp"))))
10418 (build-system gnu-build-system)
10419 (native-inputs
10420 (list autoconf
10421 automake
10422 libtool))
10423 (inputs
10424 (let ((if-supported ;XXX: modified from openmpi
10425 (lambda (package . extra)
10426 (if (and (not (%current-target-system))
10427 (member (%current-system)
10428 (package-transitive-supported-systems package)))
10429 (cons package extra)
10430 '()))))
10431 (append (list rdma-core libnl)
10432 (if-supported psm)
10433 (if-supported psm2)
10434 (if-supported libcxi curl json-c))))
10435 (arguments
10436 (list #:configure-flags
10437 #~(append (if #$(target-64bit?)
10438 (list "--enable-efa")
10439 '())
10440 (list #$@(if (this-package-input "libcxi")
10441 #~("--enable-cxi")
10442 #~())
10443 #$@(if (this-package-input "rocr-runtime")
10444 #~((string-append "--with-rocr="
10445 #$(this-package-input "rocr-runtime")))
10446 #~())
10447 "--enable-verbs"))
10448 #:phases
10449 #~(modify-phases %standard-phases
10450 (add-after 'install 'remove-libtool-archive
10451 (lambda _
10452 ;; 'libfabric.la' has '-ljson-c' without a corresponding
10453 ;; '-L' in 'dependency_libs', which in turn causes users
10454 ;; such as Open MPI to fail at link time due to '-ljson-c'
10455 ;; not being found, even when building a shared library.
10456 ;; So, remove the .la file.
10457 (delete-file
10458 (string-append #$output
10459 "/lib/libfabric.la")))))))
10460 (home-page "https://ofiwg.github.io/libfabric/")
10461 (synopsis "Open Fabric Interfaces")
10462 (description
10463 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
10464communication services to applications. OFI is best described as a collection
10465of libraries and applications used to export fabric services. The key
10466components of OFI are: application interfaces, provider libraries, kernel
10467services, daemons, and test applications.
10468
10469Libfabric is a core component of OFI. It is the library that defines and
10470exports the user-space API of OFI, and is typically the only software that
10471applications deal with directly. It works in conjunction with provider
10472libraries, which are often integrated directly into libfabric.")
10473 (license (list license:bsd-2 license:gpl2)))) ;dual
10474
10475;; Note: ROCm support is kept separate to avoid a significant increase in
10476;; closure size: <https://codeberg.org/guix/guix/issues/7225>.
10477(define-public libfabric-rocm
10478 (package/inherit libfabric
10479 (name "libfabric-rocm")
10480 (inputs (modify-inputs inputs
10481 (append rocr-runtime)))
10482 (synopsis "Open Fabric Interfaces (with ROCm support)")))
10483
10484(define-public libfabric-1 ;needed by Open MPI 4.x
10485 (package
10486 (inherit libfabric)
10487 (name "libfabric")
10488 (version "1.22.0")
10489 (source
10490 (origin
10491 (method git-fetch)
10492 (uri (git-reference
10493 (url "https://github.com/ofiwg/libfabric")
10494 (commit (string-append "v" version))))
10495 (file-name (git-file-name name version))
10496 (sha256 (base32 "1scwkfdnlg20hld03pdq83jq1q3nmvj1gravpn02pacqq18bv9xk"))))
10497 (inputs
10498 (modify-inputs inputs
10499 (append cxi-driver-for-libfabric-1)))))
10500
10501(define-public psm
10502 (package
10503 (name "psm")
10504 (version "3.3.20170428")
10505 (home-page "https://github.com/intel/psm")
10506 (source
10507 (origin
10508 (method git-fetch)
10509 (uri (git-reference (url home-page)
10510 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
10511 (file-name (string-append "psm-" version ".tar.gz"))
10512 (sha256
10513 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
10514 (patches (search-patches
10515 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
10516 "psm-ldflags.patch" ; build shared lib with LDFLAGS
10517 "psm-repro.patch" ; reproducibility
10518 "psm-disable-memory-stats.patch"))
10519 (modules '((guix build utils)))
10520 (snippet
10521 ;; That file declares its own 'strlcat' as static. To avoid a
10522 ;; conflict with the function now in glibc 2.39, give it a
10523 ;; different name.
10524 #~(substitute* "ptl_ips/ips_proto_dump.c"
10525 (("strlcat")
10526 "psm_custom_strlcat")))))
10527 (build-system gnu-build-system)
10528 (outputs '("out" "debug"))
10529 (inputs `(("libuuid" ,util-linux "lib")))
10530 (arguments
10531 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
10532 ,(string-append "INSTALL_PREFIX=" %output)
10533 ,(string-append "CFLAGS=-Wall -fpic -fPIC -D_GNU_SOURCE"
10534 " -funwind-tables -O3 -g3"
10535 " -DPSM_USE_SYS_UUID"
10536 " -Wno-strict-aliasing -DNVALGRIND"
10537 " -fcommon")
10538 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
10539 #:tests? #f
10540 #:phases (modify-phases %standard-phases
10541 (delete 'configure)
10542 (add-after 'unpack 'patch-/usr/include
10543 (lambda _
10544 (substitute* "Makefile"
10545 (("\\$\\{DESTDIR}/usr/include")
10546 (string-append %output "/include")))
10547 (substitute* "Makefile"
10548 (("/lib64") "/lib"))
10549 #t))
10550 (add-after 'unpack 'patch-sysmacros
10551 (lambda _
10552 (substitute* "ipath/ipath_proto.c"
10553 (("#include <sys/poll.h>" m)
10554 (string-append m "\n"
10555 "#include <sys/sysmacros.h>")))
10556 #t)))))
10557 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
10558 (description
10559 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
10560communications interface for the True Scale family of products. PSM users are
10561enabled with mechanisms necessary to implement higher level communications
10562interfaces in parallel environments.")
10563 ;; Only Intel-compatible processors are supported.
10564 (supported-systems '("i686-linux" "x86_64-linux"))
10565 (license (list license:bsd-2 license:gpl2)))) ;dual
10566
10567(define-public snapscreenshot
10568 (package
10569 (name "snapscreenshot")
10570 (version "1.0.14.3")
10571 (source
10572 (origin
10573 (method url-fetch)
10574 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
10575 name "-" version ".tar.bz2"))
10576 (sha256
10577 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
10578 (build-system gnu-build-system)
10579 (arguments
10580 `(#:make-flags
10581 (let ((out (assoc-ref %outputs "out")))
10582 (list (string-append "BINDIR=" out "/bin")
10583 (string-append "MANDIR=" out "/share/man")))
10584 #:tests? #f ; no test suite
10585 #:phases
10586 (modify-phases %standard-phases
10587 (delete 'configure) ; ./configure is a snarky no-op
10588 (add-before 'install 'fix-ownership
10589 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
10590 (lambda _
10591 (substitute* "depfun.mak"
10592 ((" -o bin -g bin ") " "))
10593 #t))
10594 (add-before 'install 'create-output-directories
10595 (lambda* (#:key outputs #:allow-other-keys)
10596 (let ((out (assoc-ref outputs "out")))
10597 (mkdir-p (string-append out "/share/man/man1"))
10598 #t))))))
10599 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
10600 (synopsis "Take screenshots of one or more Linux text consoles")
10601 (description
10602 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
10603Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
10604relevant @file{/dev/vcs*} file(s).")
10605 (license license:gpl2)))
10606
10607(define-public fbcat
10608 (package
10609 (name "fbcat")
10610 (version "0.5.2")
10611 (source
10612 (origin
10613 (method url-fetch)
10614 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
10615 version "/" name "-" version ".tar.gz"))
10616 (sha256
10617 (base32 "07q6f0xj7b4gjvn69qfn0g04yd0ch8ndzyigcz8nnrhli0cvsbh6"))))
10618 (build-system gnu-build-system)
10619 (outputs (list "out" "fbgrab"))
10620 (arguments
10621 (list
10622 #:make-flags
10623 #~(list "CC=gcc" (string-append "PREFIX=" #$output))
10624 #:tests? #f ;no tests
10625 #:phases
10626 #~(modify-phases %standard-phases
10627 (delete 'configure) ;no configure script
10628 (add-after 'build 'qualify-references
10629 (lambda* (#:key inputs #:allow-other-keys)
10630 (let ((pnmtopng (assoc-ref inputs "pnmtopng")))
10631 (substitute* "fbgrab"
10632 (("fbcat" all)
10633 (string-append #$output "/bin/" all))
10634 (("pnmtopng")
10635 (search-input-file inputs "/bin/pnmtopng"))))))
10636 (add-after 'install 'split-fbgrab-output
10637 (lambda _
10638 (for-each (lambda (file)
10639 (let ((old (string-append #$output "/" file))
10640 (new (string-append #$output:fbgrab "/" file)))
10641 (mkdir-p (dirname new))
10642 (rename-file old new)))
10643 (list "bin/fbgrab" "share/man/man1/fbgrab.1")))))))
10644 (inputs
10645 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
10646 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
10647 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
10648 (list netpbm))
10649 (home-page "https://jwilk.net/software/fbcat")
10650 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
10651 (description
10652 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
10653a dump thereof. It supports a wide range of drivers and pixel formats.
10654
10655@command{fbcat} can take screenshots of virtually any application that can be
10656made to write its output to the framebuffer, including (but not limited to)
10657text-mode or graphical applications that don't use a display server.
10658
10659Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
10660emulates the behaviour of Gunnar Monell's older fbgrab utility.")
10661 (license license:gpl2)))
10662
10663(define-public fbgrab
10664 (package
10665 (name "fbgrab")
10666 (version "1.5")
10667 (source (origin
10668 (method git-fetch)
10669 (uri (git-reference
10670 (url "https://github.com/GunnarMonell/fbgrab")
10671 (commit version)))
10672 (file-name (git-file-name name version))
10673 (sha256
10674 (base32
10675 "1npn7l8jg0nhjraybjl38v8635zawzmn06ql3hs3vhci1vi1r90r"))))
10676 (build-system gnu-build-system)
10677 (arguments
10678 (list #:tests? #f ;no test suite
10679 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
10680 (string-append "DESTDIR=" #$output))
10681 #:phases #~(modify-phases %standard-phases
10682 (add-after 'unpack 'strip-/usr-prefix
10683 (lambda _
10684 (substitute* "Makefile"
10685 (("/usr") ""))))
10686 (delete 'configure))))
10687 (inputs (list libpng zlib))
10688 (home-page "https://github.com/GunnarMonell/fbgrab")
10689 (synopsis "Linux framebuffer screenshot/conversion utility")
10690 (description "FBGrab is a framebuffer screenshot program that captures the
10691Linux framebuffer and converts it to a PNG image. It can also convert a
10692framebuffer dump file (copy) to a PNG image.")
10693 (license license:gpl2))) ;GPL 2.0 only (per SPDX identifier in fbgrab.c)
10694
10695(define-public libcgroup
10696 (package
10697 (name "libcgroup")
10698 (version "3.2.0")
10699 (home-page "https://github.com/libcgroup/libcgroup")
10700 (source
10701 (origin
10702 (method url-fetch)
10703 (uri (string-append
10704 "https://github.com/libcgroup/libcgroup/releases/download/v"
10705 version "/" name "-" version ".tar.gz"))
10706 (sha256
10707 (base32 "1zmxhqp8kj2n7yvj82nsy5sx07yrxj4r37w41lz5q8bpqgbc43ws"))))
10708 (build-system gnu-build-system)
10709 (arguments
10710 ;; Tests are virtualized with lxc, it is not very feasible
10711 ;; to make them executable under guix build. Also, note that
10712 ;; origin is using source tarball release which is prepared
10713 ;; after testing.
10714 (list #:tests? #f
10715 #:configure-flags
10716 #~'("--disable-systemd")))
10717 (native-inputs
10718 (list bison flex))
10719 (inputs
10720 (list linux-pam))
10721 (synopsis "Control groups management tools")
10722 (description "Control groups is Linux kernel method for process resource
10723restriction, permission handling and more. This package provides userspace
10724interface to this kernel feature.")
10725 (license license:lgpl2.1)))
10726
10727(define-public mbpfan
10728 (package
10729 (name "mbpfan")
10730 (version "2.4.0")
10731 (source
10732 (origin
10733 (method git-fetch)
10734 (uri (git-reference
10735 (url "https://github.com/dgraziotin/mbpfan")
10736 (commit (string-append "v" version))))
10737 (file-name (git-file-name name version))
10738 (sha256
10739 (base32 "146sshsjafi26n741jvi9mdbazwf74jlacxfwkky4fhbq98idlhp"))))
10740 (build-system gnu-build-system)
10741 (arguments
10742 (list #:tests? #f ; tests ask to be run as root
10743 #:make-flags
10744 #~(list (string-append "DESTDIR=" #$output)
10745 (string-append "CC=" #$(cc-for-target)))
10746 #:phases
10747 #~(modify-phases %standard-phases
10748 (add-after 'unpack 'patch-paths
10749 (lambda _
10750 (substitute* "Makefile"
10751 (("/usr") ""))))
10752 (delete 'configure)))) ; there's no configure phase
10753 (home-page "https://github.com/dgraziotin/mbpfan")
10754 (synopsis "Control fan speed on Macbooks")
10755 (description
10756 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
10757the @code{coretemp} module and sets the fan speed using the @code{applesmc}
10758module. It can be executed as a daemon or in the foreground with root
10759privileges.")
10760 (license license:gpl3+)))
10761
10762(define-public psm2
10763 (package
10764 (name "psm2")
10765 (version "12.0")
10766 (source (origin
10767 (method git-fetch)
10768 (uri (git-reference
10769 (url "https://github.com/intel/opa-psm2")
10770 ;; tag 'psm-v12.0' = commit ad5dd1b
10771 (commit (string-append "psm-v" version))))
10772 (file-name (git-file-name name version))
10773 (sha256
10774 (base32
10775 "04nar65ac11qqx41vkfs7iip8kfiah0zms7l4rmsxncpiz2iqfik"))
10776 (patches
10777 (search-patches
10778 "psm2-compile-ctor-without-avx.patch"))
10779 (modules '((guix build utils)))
10780 (snippet
10781 ;; That file declares its own 'strlcat' as static. To avoid a
10782 ;; conflict with the function now in glibc 2.39, give it a
10783 ;; different name.
10784 #~(substitute* "ptl_ips/ips_proto_dump.c"
10785 (("strlcat")
10786 "psm2_custom_strlcat")))))
10787 (build-system gnu-build-system)
10788 (arguments
10789 (list #:make-flags
10790 #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
10791 #:tests? #f
10792 #:phases #~(modify-phases %standard-phases
10793 (delete 'configure)
10794 (add-after 'unpack 'patch-Makefiles
10795 (lambda _
10796 (substitute* "Makefile"
10797 (("/lib64") "/lib")
10798 (("/usr") ""))
10799 (substitute* "compat/Makefile"
10800 (("/lib64") "/lib")
10801 (("/usr") ""))))
10802 (replace 'install
10803 (lambda _
10804 (setenv "DESTDIR" #$output)
10805 (invoke "make" "install"))))))
10806 (inputs
10807 (list rdma-core numactl))
10808 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
10809 (description
10810 "This package is low-level user-level Intel's communications interface.
10811The PSM2 API is a high-performance vendor-specific protocol that provides a
10812low-level communications interface for the Intel Omni-Path family of
10813high-speed networking devices.")
10814 (home-page "https://github.com/intel/opa-psm2")
10815 ;; Only the x86_64 architecture is supported.
10816 (supported-systems '("x86_64-linux"))
10817 (license (list license:bsd-3 license:gpl2)))) ; dual
10818
10819(define-public libpfm4
10820 (package
10821 (name "libpfm4")
10822 (version "4.9.0")
10823 (source (origin
10824 (method url-fetch)
10825 (uri (string-append "mirror://sourceforge/perfmon2/"
10826 name "/libpfm-" version ".tar.gz"))
10827 (sha256
10828 (base32
10829 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
10830 (build-system gnu-build-system)
10831 (arguments
10832 '(#:modules ((guix build utils)
10833 (guix build gnu-build-system))
10834 #:phases (modify-phases %standard-phases
10835 (delete 'configure)
10836 (delete 'check)
10837 (replace 'build
10838 (lambda* (#:key inputs outputs #:allow-other-keys)
10839 (let* ((out (assoc-ref outputs "out")))
10840 (setenv "CC" "gcc")
10841 (setenv "CFLAGS" "-Wno-format-truncation")
10842 (invoke "make")
10843 #t)))
10844 (replace 'install
10845 (lambda* (#:key outputs #:allow-other-keys)
10846 (let* ((out (assoc-ref outputs "out")))
10847 (invoke "make"
10848 (string-append "PREFIX=" out)
10849 "install")
10850 #t))))))
10851 (synopsis "Performance event monitoring library")
10852 (description
10853 "This package provides a library called libpfm4, which is used to develop
10854monitoring tools exploiting the performance monitoring events such as those
10855provided by the Performance Monitoring Unit (PMU) of modern processors.
10856
10857Libpfm4 helps convert from an event name, expressed as a string, to the event
10858encoding that is either the raw event as documented by the hardware vendor or
10859the OS-specific encoding. In the latter case, the library is able to prepare
10860the OS-specific data structures needed by the kernel to setup the event.
10861
10862libpfm4 provides support for the @code{perf_events} interface, which was
10863introduced in Linux 2.6.31.")
10864 (home-page "https://perfmon2.sourceforge.net/")
10865 (license license:expat)))
10866
10867(define-public libnfnetlink
10868 (package
10869 (name "libnfnetlink")
10870 (version "1.0.2")
10871 (source (origin
10872 (method url-fetch)
10873 (uri (string-append
10874 "https://www.netfilter.org/projects/libnfnetlink/files/"
10875 "libnfnetlink-" version ".tar.bz2"))
10876 (sha256
10877 (base32
10878 "0xn3rcrzxr6g82kfxzs9bqn2zvl2kf2yda30drwb9vr6sk1wfr5h"))))
10879 (build-system gnu-build-system)
10880 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
10881 (synopsis "Low-level netfilter netlink communication library")
10882 (description
10883 "@code{libnfnetlink} is the low-level library for netfilter related
10884kernel/userspace communication. It provides a generic messaging
10885infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
10886nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
10887management tools in userspace.")
10888 (license license:gpl2)))
10889
10890(define-public libinih
10891 (package
10892 (name "libinih")
10893 (version "62")
10894 (source (origin
10895 (method git-fetch)
10896 (uri (git-reference
10897 (url "https://github.com/benhoyt/inih")
10898 (commit (string-append "r" version))))
10899 (file-name (git-file-name name version))
10900 (sha256
10901 (base32
10902 "0yl5057682gvk1iszjkz4hy73yv45l7wr3fwhbgyf7r7fwx0cwwf"))))
10903 (build-system meson-build-system)
10904 ;; Install static libraries for use by the initrd's xfsprogs/static.
10905 (outputs (list "out" "static"))
10906 (arguments
10907 `(#:configure-flags
10908 (list "-Ddistro_install=true"
10909 "-Ddefault_library=both")
10910 #:phases
10911 (modify-phases %standard-phases
10912 (add-after 'install 'separate-static
10913 (lambda* (#:key outputs #:allow-other-keys)
10914 (let ((out (assoc-ref outputs "out"))
10915 (static (assoc-ref outputs "static")))
10916 (with-directory-excursion out
10917 (for-each (lambda (source)
10918 (let ((target (string-append static "/" source)))
10919 (mkdir-p (dirname target))
10920 (rename-file source target)))
10921 (find-files "lib" "\\.a$")))))))))
10922 (home-page "https://github.com/benhoyt/inih")
10923 (synopsis "Simple .INI parser library for C")
10924 (description "The inih (INI Not Invented Here) library is a simple .INI file
10925parser written in C. It's only a couple of pages of code, and it was designed to
10926be small and simple, so it's good for embedded systems. It's also more or less
10927compatible with Python's ConfigParser style of .INI files, including RFC
10928822-style multi-line syntax and name: value entries.")
10929 (license license:bsd-3)))
10930
10931(define-public simpleini
10932 (package
10933 (name "simpleini")
10934 (version "4.25")
10935 (source (origin
10936 (method git-fetch)
10937 (uri (git-reference
10938 (url "https://github.com/brofield/simpleini")
10939 (commit (string-append "v" version))))
10940 (file-name (git-file-name name version))
10941 (sha256
10942 (base32
10943 "1v9s0kr5ca1gdbnlkdz7chzypy0wz95f09l0r6jnmff4qy6db56l"))))
10944 (build-system cmake-build-system)
10945 (arguments
10946 (list #:configure-flags #~(list "-DSIMPLEINI_USE_SYSTEM_GTEST=ON")))
10947 (native-inputs (list googletest))
10948 (home-page "https://github.com/brofield/simpleini")
10949 (synopsis "Simple API to read and write INI-style files")
10950 (description
10951 "SimpleIni provides a simple API to read and write INI-style
10952configuration files. It supports data files in ASCII, MBCS and Unicode.")
10953 (license license:expat)))
10954
10955(define-public xfsprogs
10956 (package
10957 (name "xfsprogs")
10958 (version "6.12.0")
10959 (source
10960 (origin
10961 (method url-fetch)
10962 (uri (string-append "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
10963 "xfsprogs-" version ".tar.gz"))
10964 (sha256
10965 (base32 "1n46n27fxx1137kni3drrhzhp1l8ksxabcsmi8yzxbhpbnl4q293"))))
10966 (build-system gnu-build-system)
10967 (outputs (list "out" "python"))
10968 (arguments
10969 (list
10970 #:tests? #f ;kernel/user integration tests are in package "xfstests"
10971 #:configure-flags
10972 #~(list "--disable-static")
10973 #:make-flags
10974 #~(list "V=1")
10975 #:phases
10976 #~(modify-phases %standard-phases
10977 (add-after 'install 'separate-python-output
10978 (lambda _
10979 (for-each
10980 (lambda (script)
10981 (mkdir-p (string-append #$output:python (dirname script)))
10982 (rename-file (string-append #$output script)
10983 (string-append #$output:python script)))
10984 (list "/sbin/xfs_scrub_all"))))
10985 (add-after 'install 'install-headers
10986 (lambda* (#:key make-flags #:allow-other-keys)
10987 (apply invoke "make" "install-dev" make-flags))))))
10988 (native-inputs (list gettext-minimal))
10989 (inputs (list libinih
10990 liburcu
10991 (list util-linux "lib")
10992 python-wrapper))
10993 (home-page "https://xfs.wiki.kernel.org/")
10994 (synopsis "XFS file system tools")
10995 (description "This package provides commands to create and check XFS
10996file systems.")
10997 ;; The library "libhandle" and the headers in "xfslibs-dev" are
10998 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
10999 (license (list license:gpl2 license:lgpl2.1))))
11000
11001(define-public xfsprogs-5.9
11002 (package
11003 (inherit xfsprogs)
11004 (name "xfsprogs")
11005 (version "5.9.0")
11006 (source (origin
11007 (method url-fetch)
11008 (uri (string-append
11009 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
11010 "xfsprogs-" version ".tar.gz"))
11011 (sha256
11012 (base32
11013 "13xkn9jpmwp4fm9r68vhgznkmxhnv83n2b39mhy2qdaph90w2a1l"))))
11014 (arguments
11015 (substitute-keyword-arguments arguments
11016 ((#:configure-flags configure-flags #~(list))
11017 #~(cons* "--enable-gettext=no" #$configure-flags))))
11018 (native-inputs
11019 (modify-inputs native-inputs
11020 (delete "gettext-minimal")))))
11021
11022(define-public xfsprogs/static
11023 (package
11024 (inherit xfsprogs)
11025 (name "xfsprogs-static")
11026 (outputs (list "out"))
11027 (arguments
11028 (substitute-keyword-arguments arguments
11029 ((#:configure-flags configure-flags #~(list))
11030 #~(append #$configure-flags
11031 (list "--enable-static")))
11032 ((#:make-flags make-flags #~(list))
11033 #~(cons* "LLDFLAGS=-all-static" #$make-flags))
11034 ((#:phases _ #~%standard-phases)
11035 #~(modify-phases %standard-phases
11036 (add-after 'install 'delete-useless-files
11037 (lambda _
11038 (with-directory-excursion #$output
11039 (for-each delete-file-recursively
11040 (list "include" "lib")))))))))
11041 (inputs
11042 (modify-inputs inputs
11043 (delete "python-wrapper")
11044 (prepend (list libinih "static")
11045 (list util-linux "static"))))
11046 (synopsis "Statically linked XFS file system tools")))
11047
11048(define-public xfs-repair/static
11049 (package
11050 (name "xfs-repair-static")
11051 (version (package-version xfsprogs/static))
11052 (source #f)
11053 (build-system trivial-build-system)
11054 (arguments
11055 (list
11056 #:modules `((guix build utils))
11057 #:builder
11058 #~(begin
11059 (use-modules (guix build utils))
11060 (let ((sbin (string-append #$output "/sbin")))
11061 (install-file (search-input-file %build-inputs "/sbin/xfs_repair")
11062 sbin)
11063 (with-directory-excursion sbin
11064 (remove-store-references "xfs_repair"))))))
11065 (inputs (list xfsprogs/static))
11066 (home-page (package-home-page xfsprogs/static))
11067 (synopsis "Statically linked @command{xfs_repair} from xfsprogs")
11068 (description
11069 "This package provides a statically linked @command{xfs_repair} taken
11070from the xfsprogs package. It is meant to be used in initrds.")
11071 (license (package-license xfsprogs/static))))
11072
11073(define-deprecated-package xfs_repair/static
11074 "xfs_repair-static" xfs-repair/static)
11075
11076(define-public genext2fs
11077 (package
11078 (name "genext2fs")
11079 (version "1.5.0")
11080 (source (origin
11081 (method git-fetch)
11082 (uri (git-reference
11083 (url "https://github.com/bestouff/genext2fs")
11084 (commit "474111097321f03de9e009aa9f7d4a8948e310b2")))
11085 (file-name (git-file-name name version))
11086 (sha256
11087 (base32 "14lgvml5zz99845ja47jpf4iirjzfqv36ffzachh3hw2ggji9c7l"))))
11088 (build-system gnu-build-system)
11089 (native-inputs
11090 (list autoconf automake))
11091 (home-page "https://github.com/bestouff/genext2fs")
11092 (synopsis "Generate ext2 file system as a normal user")
11093 (description "This package provides a program to generate an ext2
11094file system as a normal (non-root) user. It does not require you to mount
11095the image file to copy files on it, nor does it require that you become
11096the superuser to make device nodes.")
11097 (license license:gpl2)))
11098
11099(define-public fakeroot
11100 (package
11101 (name "fakeroot")
11102 (version "1.38")
11103 (source
11104 (origin
11105 ;; There are no tags in the repository, so take this snapshot.
11106 (method url-fetch)
11107 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
11108 "fakeroot/fakeroot_" version ".orig.tar.gz"))
11109 (file-name (string-append name "-" version ".tar.gz"))
11110 (sha256
11111 (base32 "00p07xi1j61i4bbxymydihff8frw9bs0g0fr6rpm88q94wclcl1p"))
11112 (modules '((guix build utils)
11113 (ice-9 ftw)))
11114 (snippet
11115 `(begin
11116 ;; Delete pregenerated man page translations, but not the originals.
11117 (with-directory-excursion "doc"
11118 (for-each (lambda (language)
11119 (for-each delete-file
11120 (find-files language "\\.[0-9]$")))
11121 (scandir "."
11122 (lambda (file)
11123 (and (not (string-prefix? "." file))
11124 (eq? 'directory
11125 (stat:type (lstat file))))))))))))
11126 (build-system gnu-build-system)
11127 (arguments
11128 `(#:configure-flags
11129 (list "--disable-static")
11130 #:phases
11131 (modify-phases %standard-phases
11132 (add-after 'unpack 'patch-Makefile.am
11133 (lambda _
11134 (substitute* "Makefile.am"
11135 (("/bin/sh") (which "sh")))))
11136 (add-after 'unpack 'patch-script
11137 (lambda* (#:key inputs #:allow-other-keys)
11138 (substitute* "scripts/fakeroot.in"
11139 (("getopt")
11140 (string-append (assoc-ref inputs "util-linux")
11141 "/bin/getopt"))
11142 (("sed")
11143 (string-append (assoc-ref inputs "sed")
11144 "/bin/sed"))
11145 (("cat|cut" command)
11146 (string-append (assoc-ref inputs "coreutils")
11147 "/bin/" command)) )))
11148 (replace 'bootstrap
11149 (lambda _
11150 ;; The "preroll" script takes care of Autoconf and also
11151 ;; prepares the translated manuals.
11152 (invoke "sh" "./preroll")))
11153 (add-before 'configure 'setenv
11154 (lambda _
11155 (setenv "LIBS" "-lacl")))
11156 (add-before 'check 'prepare-check
11157 (lambda _
11158 (setenv "SHELL" (which "bash"))
11159 (setenv "VERBOSE" "1")
11160 (substitute* "test/t.touchinstall"
11161 ;; We don't have the name of the root user, so use ID=0.
11162 (("grep root") "grep \"\\<0\\>\""))
11163 (substitute* "test/tartest"
11164 ;; We don't have the name of the root group, so use ID=0.
11165 (("ROOTGROUP=root") "ROOTGROUP=0")
11166 ;; We don't have the name of the daemon user, so use IDs.
11167 (("daemon:sys") "1:3")
11168 (("daemon:") "1:"))
11169 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
11170 (substitute* "test/compare-tar"
11171 (("tar -tvf") "tar --numeric-owner -tvf")))))))
11172 (native-inputs
11173 (list autoconf-2.71 automake gettext-minimal libtool po4a-minimal
11174 perl sharutils xz)) ; for tests
11175 (inputs
11176 (list acl libcap util-linux sed coreutils))
11177 (synopsis "Run commands in an environment with fake root privileges")
11178 (description
11179 "@command{fakeroot} runs a command in an environment where it appears to
11180have root privileges for file manipulation. This is useful for allowing users
11181to create archives (@file{tar}, @file{ar}, @file{deb}, etc.) with files in
11182them with root permissions and/or ownership.
11183
11184Without fakeroot, one would have to have root privileges to create the
11185constituent files of the archives with the correct permissions and ownership,
11186and then pack them up, or one would have to construct the archives directly,
11187without using the archiver.")
11188 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
11189 (license license:gpl3+)))
11190
11191(define-public fakechroot
11192 ;; XXX: Build from the change submitted at
11193 ;; <https://github.com/dex4er/fakechroot/pull/85> to allow compilation
11194 ;; against glibc 2.33. Switch back to the official repository on the next
11195 ;; release.
11196 (let ((commit "e7c1f3a446e594a4d0cce5f5d499c9439ce1d5c5")
11197 (revision "0"))
11198 (package
11199 (name "fakechroot")
11200 (version (git-version "2.20.1" revision commit))
11201 (source (origin
11202 (method git-fetch)
11203 (uri (git-reference
11204 (url "https://github.com/lipnitsk/fakechroot")
11205 (commit commit)))
11206 (file-name (git-file-name name version))
11207 (sha256
11208 (base32
11209 "0gac6a6djx3nf343vd33sr5qqngz8ss3aij54zl8x9wb47pc11kb"))))
11210 (build-system gnu-build-system)
11211 (arguments
11212 ;; XXX: The tests heavily assume they run on an FHS system so for now
11213 ;; skip them.
11214 '(#:tests? #f
11215 #:configure-flags '("--disable-static")))
11216 (native-inputs (list autoconf automake libtool perl))
11217 (synopsis "Emulate @code{chroot} by overriding file system calls")
11218 (description
11219 "@command{fakechroot} runs a command in an environment were is additional
11220possibility to use @code{chroot} command without root privileges. This is
11221useful for allowing users to create own chrooted environment with possibility
11222to install another packages without need for root privileges.
11223
11224It works by providing @file{libfakechroot.so}, a shared library meant to be
11225set as @code{LD_PRELOAD} to override the C library file system functions.")
11226 (home-page "https://github.com/dex4er/fakechroot/")
11227 (license license:lgpl2.1+))))
11228
11229(define-public falcosecurity-libs
11230 (package
11231 (name "falcosecurity-libs")
11232 (version "0.20.0")
11233 (source (origin
11234 (method git-fetch)
11235 (uri (git-reference
11236 (url "https://github.com/falcosecurity/libs/")
11237 (commit version)))
11238 (file-name (git-file-name name version))
11239 (sha256
11240 (base32
11241 "041ir9wk44v7isidwl7fzxrjvs85j637wcr7xirasd8ysxa0r4qv"))
11242 (patches
11243 (search-patches
11244 "falcosecurity-libs-bpf-probes-fix.patch"
11245 "falcosecurity-libs-shared-build.patch"))))
11246 (build-system cmake-build-system)
11247 (arguments
11248 (list
11249 #:configure-flags
11250 #~(list "-DUSE_BUNDLED_DEPS=OFF"
11251 "-DBUILD_DRIVER=OFF"
11252 "-DENABLE_DKMS=OFF"
11253 "-DBUILD_LIBSCAP_MODERN_BPF=ON"
11254 "-DSCAP_FILES_SUITE_ENABLE=OFF" ;attempts to download scap files
11255 "-DBUILD_SHARED_LIBS=ON"
11256 #$(string-append "-DFALCOSECURITY_LIBS_VERSION=" version))
11257 ;; Only the libsinsp test suite is run, as the one for libscap requires
11258 ;; elevated privileges.
11259 #:modules '((guix build cmake-build-system)
11260 ((guix build gnu-build-system) #:prefix gnu:)
11261 (guix build utils))
11262 #:phases
11263 #~(modify-phases %standard-phases
11264 (add-after 'unpack 'disable-problematic-tests
11265 (lambda _
11266 (substitute* "userspace/libsinsp/test/user.ut.cpp"
11267 ;; The 'system_lookup' test assumes a root user
11268 ;; exists in the build environment.
11269 (("TEST_F\\(usergroup_manager_test, system_lookup)")
11270 "TEST_F(usergroup_manager_test, DISABLED_system_lookup)"))))
11271 (replace 'check
11272 (lambda* (#:rest args)
11273 (apply (assoc-ref gnu:%standard-phases 'check)
11274 #:test-target "run-unit-test-libsinsp" args)))
11275 (add-after 'install 'delete-src
11276 (lambda _
11277 (delete-file-recursively
11278 (string-append #$output "/src")))))))
11279 (native-inputs
11280 (list bpftool
11281 clang-18 ;avoid stack limit exceeded build error
11282 googletest
11283 pkg-config
11284 valijson)) ;header-only library
11285 (inputs
11286 (list elfutils))
11287 (propagated-inputs
11288 ;; The following inputs are in the 'Requires' field of libscap.pc,
11289 ;; libsinp.pc or libpman.pc.
11290 (list c-ares
11291 grpc
11292 jsoncpp
11293 libbpf
11294 libelf
11295 openssl
11296 protobuf
11297 uthash ;included in libscap headers
11298 zlib
11299 ;; These are in the 'Requires.private' field of libscap.pc and
11300 ;; libsinp.pc. They are required because the headers are installed
11301 ;; to a non-standard directory, and thus need to be found via the
11302 ;; 'Cflags' field, which in turn mandates that both the pkg-config
11303 ;; modules listed in the 'Requires' and 'Requires.private' be
11304 ;; available.
11305 curl
11306 re2
11307 onetbb))
11308 (home-page "https://github.com/falcosecurity/libs/")
11309 (synopsis "Falco security libraries")
11310 (description "The Falco security libraries include @code{libsinsp} and
11311@code{libscap}. @code{libscap} manages the data capture process, while
11312@code{libsinsp} is a system inspection library that enriches events from
11313@code{libscap} with machine state. @code{libsinsp} also performs events
11314filtering with rule evaluation through its internal rule engine. These
11315libraries are used by the @command{sysdig} command-line utility.")
11316 (license license:asl2.0)))
11317
11318(define-public inputattach
11319 (package
11320 (name "inputattach")
11321 (version "0.42.0")
11322 (source (origin
11323 (method git-fetch)
11324 (uri (git-reference
11325 (url "https://github.com/linuxwacom/input-wacom")
11326 (commit (string-append "input-wacom-" version))))
11327 (file-name (git-file-name name version))
11328 (sha256
11329 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
11330 (build-system gnu-build-system)
11331 (arguments
11332 `(#:phases
11333 (modify-phases %standard-phases
11334 (delete 'bootstrap)
11335 (delete 'configure)
11336 (replace 'build
11337 (lambda* (#:key inputs #:allow-other-keys)
11338 (with-directory-excursion "inputattach"
11339 (invoke "gcc" "-O2" "-o" "inputattach"
11340 "inputattach.c"))))
11341 (delete 'check)
11342 (replace 'install
11343 (lambda* (#:key outputs #:allow-other-keys)
11344 (let ((target-dir (string-append
11345 (assoc-ref outputs "out")
11346 "/bin/")))
11347 (mkdir-p target-dir)
11348 (copy-file "inputattach/inputattach"
11349 (string-append target-dir
11350 "inputattach"))
11351 #t))))))
11352 (home-page "https://linuxwacom.github.io/")
11353 (synopsis "Dispatch input peripherals events to a device file")
11354 (description "inputattach dispatches input events from several device
11355types and interfaces and translates so that the X server can use them.")
11356 (license license:gpl2+)))
11357
11358(define-public keyd
11359 (package
11360 (name "keyd")
11361 (version "2.6.0")
11362 (source
11363 (origin
11364 (method git-fetch)
11365 (uri (git-reference
11366 (url "https://github.com/rvaiya/keyd")
11367 (commit (string-append "v" version))))
11368 (sha256
11369 (base32
11370 "14rgrg8d1ys1cqq46mgi34yqg9jd1q3yw1acw5r5jpwwk0da7g4p"))))
11371 (arguments
11372 (list #:tests? #f ; tests require root
11373 #:make-flags
11374 #~(list (string-append "CC=" #$(cc-for-target))
11375 "PREFIX="
11376 (string-append "DESTDIR=" #$output))
11377 #:phases
11378 '(modify-phases
11379 %standard-phases
11380 (delete 'configure)))) ; no autoconf
11381 (build-system gnu-build-system)
11382 (inputs (list linux-libre-headers))
11383 (synopsis "Key remapping daemon for Linux")
11384 (description
11385 "Keyd is a keyboard remapping utility with intuitive ini configuration
11386file format. Keyd has several features, many of which are traditionally only
11387found in custom keyboard firmware like QMK.")
11388 (home-page "https://github.com/rvaiya/keyd")
11389 (license license:expat)))
11390
11391(define-public pipewire
11392 (package
11393 (name "pipewire")
11394 (version "1.6.8")
11395 (source (origin
11396 (method git-fetch)
11397 (uri (git-reference
11398 (url "https://gitlab.freedesktop.org/pipewire/pipewire")
11399 (commit version)))
11400 (file-name (git-file-name name version))
11401 (sha256
11402 (base32
11403 "1yc70gi4a98q7kbghp08nyp3wvlik120v2w25a14b93gpgwbl55k"))))
11404 (build-system meson-build-system)
11405 (arguments
11406 (list
11407 #:configure-flags
11408 #~(list (string-append "-Dudevrulesdir=" #$output "/lib/udev/rules.d")
11409 "-Dman=enabled"
11410 "-Drlimits-install=false"
11411 "-Dsession-managers=[]"
11412 "-Dsysconfdir=/etc"
11413 "-Dlibsystemd=disabled"
11414
11415 ;; XXX: link with -Wl,--no-as-needed so that libgcc_s.so.1 does not get dropped
11416 ;; Otherwise test_loop will fail with:
11417 ;; libgcc_s.so.1 must be installed for pthread_cancel to work
11418 "-Db_asneeded=false")))
11419 (native-inputs
11420 (list `(,glib "bin")
11421 pkg-config
11422 doxygen
11423 python
11424 python-docutils))
11425 (inputs (list alsa-lib
11426 avahi
11427 bluez
11428 dbus
11429 eudev
11430 ffmpeg
11431 gst-plugins-base
11432 gstreamer
11433 jack-2
11434 ldacbt
11435 libcamera-minimal
11436 libdrm
11437 libfdk
11438 libfreeaptx
11439 libsndfile
11440 libusb
11441 openssl ; raop sink
11442 libva
11443 pulseaudio
11444 readline ; for pw-cli
11445 sbc
11446 vulkan-headers
11447 vulkan-loader
11448 webrtc-audio-processing))
11449 (home-page "https://pipewire.org/")
11450 (synopsis "Server and user space API to deal with multimedia pipelines")
11451 (description
11452 "PipeWire is a project that aims to greatly improve handling of audio and
11453video under Linux. It aims to support the usecases currently handled by both
11454PulseAudio and Jack and at the same time provide same level of powerful handling
11455of Video input and output. It also introduces a security model that makes
11456interacting with audio and video devices from containerized applications easy,
11457with supporting Flatpak applications being the primary goal. Alongside Wayland
11458and Flatpak we expect PipeWire to provide a core building block for the future
11459of Linux application development.")
11460 (license license:lgpl2.0+)))
11461
11462(define-public pipewire-minimal
11463 ;; Used as libpipewire to reduce closure size and avoid dependency cycles.
11464 (hidden-package
11465 (package
11466 (inherit pipewire)
11467 (name "pipewire-minimal")
11468 (arguments
11469 (list
11470 #:configure-flags
11471 #~(list "-Dsession-managers=[]"
11472 "-Ddbus=disabled"
11473 "-Dflatpak=disabled"
11474 ;; XXX: Otherwise test_loop will fail with:
11475 ;; libgcc_s.so.1 must be installed for pthread_cancel to work
11476 "-Db_asneeded=false")))
11477 (native-inputs '())
11478 (inputs '()))))
11479
11480(define-public pipewire-minimal-1.4
11481 (package
11482 (inherit pipewire-minimal)
11483 (name "pipewire")
11484 (version "1.4.10")
11485 (source (origin
11486 (method git-fetch)
11487 (uri (git-reference
11488 (url "https://gitlab.freedesktop.org/pipewire/pipewire")
11489 (commit version)))
11490 (file-name (git-file-name name version))
11491 (sha256
11492 (base32
11493 "14rsdbcsyyhjh7hvbq3d84f6s0fllvq6vpg39cxcd7l8fn4zc2zw"))))))
11494
11495(define-public wireplumber
11496 (package
11497 (name "wireplumber")
11498 (version "0.5.15")
11499 (source
11500 (origin
11501 (method git-fetch)
11502 (uri (git-reference
11503 (url
11504 "https://gitlab.freedesktop.org/pipewire/wireplumber.git")
11505 (commit version)))
11506 (file-name (git-file-name name version))
11507 (sha256
11508 (base32 "1a7fzfdxipjaq0fb695jbpipnlr67yl273x1gd9mmpbnqmgnphnv"))))
11509 (build-system meson-build-system)
11510 (arguments
11511 `(#:configure-flags '("-Dsystemd=disabled"
11512 "-Dsystem-lua=true")))
11513 (native-inputs
11514 (list `(,glib "bin")
11515 pkg-config python-minimal))
11516 (inputs (list dbus elogind glib lua pipewire))
11517 (home-page "https://gitlab.freedesktop.org/pipewire/wireplumber")
11518 (synopsis "Session / policy manager implementation for PipeWire")
11519 (description "WirePlumber is a modular session / policy manager for
11520PipeWire and a GObject-based high-level library that wraps PipeWire's API,
11521providing convenience for writing the daemon's modules as well as external
11522tools for managing PipeWire.")
11523 (license license:expat)))
11524
11525(define-public wireplumber-minimal
11526 (let ((base wireplumber))
11527 (package
11528 (inherit base)
11529 (name "wireplumber-minimal")
11530 (arguments
11531 (substitute-keyword-arguments arguments
11532 ((#:configure-flags flags ''())
11533 #~(cons "-Delogind=disabled" #$flags))))
11534 (inputs
11535 (modify-inputs inputs
11536 (delete "elogind"))))))
11537
11538(define-public ell
11539 (package
11540 (name "ell")
11541 (version "0.83")
11542 (source (origin
11543 (method git-fetch)
11544 (uri (git-reference
11545 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
11546 (commit version)))
11547 (file-name (git-file-name name version))
11548 (sha256
11549 (base32
11550 "1ywq84jgvf7f86srqwpq31w2kzdp875fx039x5g4lx486plgf526"))
11551 (modules '((guix build utils)))
11552 (snippet
11553 #~(begin
11554 (substitute* "Makefile.am"
11555 ;; requires hwdb.bin
11556 (("unit/test-hwdb.*") ""))))))
11557 (build-system gnu-build-system)
11558 (arguments
11559 ;; Tests launch dbus-daemon instances that all try to bind to
11560 ;; "/tmp/ell-test-bus". Thus, we need to run them sequentially.
11561 '(#:parallel-tests? #f))
11562 (inputs
11563 (list dbus))
11564 (native-inputs
11565 (list autoconf automake libtool pkg-config procps))
11566 (home-page "https://01.org/ell")
11567 (synopsis "Embedded Linux Library")
11568 (description "The Embedded Linux* Library (ELL) provides core, low-level
11569functionality for system daemons. It typically has no dependencies other than
11570the Linux kernel, C standard library, and libdl (for dynamic linking). While
11571ELL is designed to be efficient and compact enough for use on embedded Linux
11572platforms, it is not limited to resource-constrained systems.")
11573 (license license:lgpl2.1+)))
11574
11575(define-public kexec-tools
11576 (package
11577 (name "kexec-tools")
11578 (version "2.0.31")
11579 (source (origin
11580 (method url-fetch)
11581 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
11582 "/kexec/kexec-tools-" version ".tar.xz"))
11583 (sha256
11584 (base32
11585 "0c9cj9xvcm81gcwnkvvh9vh82v59kdz5llmblc2wkqb6vh6kb3wa"))))
11586 (build-system gnu-build-system)
11587 (arguments
11588 ;; There are no automated tests.
11589 '(#:tests? #f))
11590 ;; This variant of binutils is used for the 64 bit support needed to
11591 ;; assemble the `purgatory/arch/i386/compat_x86_64.S' program on i686-linux.
11592 (native-inputs (list (make-ld-wrapper "ld-wrapper"
11593 #:binutils binutils)
11594 binutils))
11595 (home-page "https://projects.horms.net/projects/kexec/")
11596 (synopsis "Tools for booting directly into different kernels")
11597 (description "This package provides the @code{kexec} program and ancillary
11598utilities. Using @code{kexec}, it is possible to boot directly into a new
11599kernel from the context of an already-running kernel, bypassing the normal
11600system boot process.")
11601 (supported-systems (delete "riscv64-linux" %supported-systems))
11602 (license license:gpl2)))
11603
11604(define-public cachefilesd
11605 (package
11606 (name "cachefilesd")
11607 (version "0.10.10")
11608 (source (origin
11609 (method url-fetch)
11610 (uri (string-append
11611 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
11612 "/cachefilesd.git/snapshot/cachefilesd-"
11613 version ".tar.gz"))
11614 (sha256
11615 (base32
11616 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
11617 (build-system gnu-build-system)
11618 (outputs '("out"))
11619 (arguments
11620 `(#:tests? #f ; there are no tests
11621 #:make-flags
11622 (let ((prefix-dir (lambda (var dir)
11623 (string-append var "=" %output "/" dir))))
11624 (list (string-append "CC=" ,(cc-for-target))
11625 (prefix-dir "SBINDIR" "sbin/")
11626 (prefix-dir "ETCDIR" "etc/")
11627 (prefix-dir "MANDIR" "share/man/")))
11628 #:phases (modify-phases %standard-phases (delete 'configure))))
11629 (home-page "https://people.redhat.com/~dhowells/cachefs/")
11630 (synopsis "CacheFiles userspace management daemon")
11631 (description "@code{cachefilesd} is a userspace daemon that manages the
11632cache data store that is used by network file systems such as @code{AFS} and
11633@code{NFS} to cache data locally on disk. The content of the cache is
11634persistent over reboots.")
11635 (license license:gpl2+)))
11636
11637(define-public libbpf
11638 (package
11639 (name "libbpf")
11640 (version "1.7.0")
11641 (source
11642 (origin
11643 (method git-fetch)
11644 (uri (git-reference
11645 (url "https://github.com/libbpf/libbpf")
11646 (commit (string-append "v" version))))
11647 (file-name (git-file-name name version))
11648 (sha256
11649 (base32
11650 "1r1ysy8xpdz2nqs0svk4772fbykqh414mqivwylbj5r9v1nf8r02"))))
11651 (build-system gnu-build-system)
11652 (arguments
11653 (list
11654 #:tests? #f ;self-tests run in QEMU
11655 #:make-flags
11656 #~(list (string-append "PREFIX=" #$output)
11657 (string-append "LIBDIR=$(PREFIX)/lib")
11658 (string-append "CC=" #$(cc-for-target)))
11659 #:phases
11660 #~(modify-phases %standard-phases
11661 (delete 'configure)
11662 (add-before 'build 'pre-build
11663 (lambda _
11664 (chdir "src")))
11665 (replace 'install
11666 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
11667 (apply (assoc-ref %standard-phases 'install)
11668 (append args
11669 (list #:make-flags
11670 (append (list "install"
11671 ;; Also install the kernel
11672 ;; user API (uAPI) headers.
11673 "install_uapi_headers")
11674 make-flags)))))))))
11675 (native-inputs (list pkg-config))
11676 (propagated-inputs (list elfutils zlib)) ;in Requires.private of libbpf.pc
11677 (home-page "https://github.com/libbpf/libbpf")
11678 (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
11679 (description
11680 "Libbpf supports building BPF CO-RE-enabled applications, which, in
11681contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
11682headers.")
11683 (license (list license:lgpl2.1 license:bsd-2))))
11684
11685(define-public libbpf-0.8
11686 (package
11687 (inherit libbpf)
11688 (name "libbpf")
11689 (version "0.8.1")
11690 (source
11691 (origin
11692 (method git-fetch)
11693 (uri (git-reference
11694 (url "https://github.com/libbpf/libbpf")
11695 (commit (string-append "v" version))))
11696 (file-name (git-file-name name version))
11697 (sha256
11698 (base32
11699 "1zzpkk4x3f20483dzw43b3ml03d63vvkmqf4j8y3b61b67wm59bm"))))
11700 (arguments
11701 (list
11702 #:tests? #f ;self-tests run in QEMU
11703 #:make-flags
11704 #~(list (string-append "PREFIX=" #$output)
11705 (string-append "LIBDIR=$(PREFIX)/lib")
11706 (string-append "CC=" #$(cc-for-target)))
11707 #:phases #~(modify-phases %standard-phases
11708 (delete 'configure)
11709 (add-before 'build 'pre-build
11710 (lambda _
11711 (chdir "src"))))))
11712 (native-inputs (list pkg-config))
11713 (propagated-inputs (list elfutils zlib)))) ;in Requires.private of libbpf.pc
11714
11715(define-public bcc
11716 (package
11717 (name "bcc")
11718 (version "0.30.0")
11719 (source
11720 (origin
11721 (method git-fetch)
11722 (uri (git-reference
11723 (url "https://github.com/iovisor/bcc")
11724 (commit (string-append "v" version))))
11725 (file-name (git-file-name name version))
11726 (sha256
11727 (base32
11728 "0b5la0yn6x6ll73drnrm5v5yibbrzkvl86hqivkrmnpgy8cqn0cy"))))
11729 (build-system cmake-build-system)
11730 (native-inputs
11731 (list bison
11732 flex
11733 (@ (gnu packages compression) zip)))
11734 (inputs
11735 (list bash-minimal ;for wrap-program
11736 clang-15
11737 elfutils
11738 luajit
11739 libbpf
11740 python-setuptools
11741 python-wrapper))
11742 (arguments
11743 (list
11744 ;; Tests all require root permissions and a "standard" file hierarchy.
11745 #:tests? #f
11746 #:configure-flags #~(list (string-append "-DREVISION=" #$version)
11747 "-DCMAKE_USE_LIBBPF_PACKAGE=ON")
11748 #:phases
11749 #~(modify-phases %standard-phases
11750 (add-after 'unpack 'substitute-libbc
11751 (lambda _
11752 (substitute* "src/python/bcc/libbcc.py"
11753 (("(libbcc\\.so.*)\\b" _ libbcc)
11754 (string-append #$output "/lib/" libbcc)))))
11755 (add-after 'install 'wrap-tools
11756 (lambda _
11757 (use-modules (ice-9 textual-ports))
11758 (let* ((out #$output)
11759 (lib (string-append out "/lib"))
11760 (tools (string-append out "/share/bcc/tools"))
11761 (python-executable?
11762 (lambda (filename _)
11763 (call-with-input-file filename
11764 (lambda (port)
11765 (string-contains (get-line port)
11766 "/bin/python"))))))
11767 (for-each (lambda (python-executable)
11768 (format #t "Wrapping: ~A.~%" python-executable)
11769 (wrap-program python-executable
11770 `("GUIX_PYTHONPATH" ":" prefix
11771 (,(string-append lib
11772 "/python"
11773 #$(version-major+minor
11774 (package-version python))
11775 "/site-packages")))))
11776 (find-files tools python-executable?))))))))
11777 (home-page "https://github.com/iovisor/bcc")
11778 (synopsis "Tools for BPF on Linux")
11779 (description
11780 "BCC is a toolkit for creating efficient kernel tracing and manipulation
11781programs, and includes several useful tools and examples. It makes use of
11782extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
11783that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
11784and above.")
11785 (license license:asl2.0)))
11786
11787(define-public bpftool
11788 (package
11789 (name "bpftool")
11790 (version (package-version linux-libre))
11791 (source (package-source linux-libre))
11792 (build-system gnu-build-system)
11793 (arguments
11794 `(#:tests? #f ;This package has no tests.
11795 #:phases (modify-phases %standard-phases
11796 (delete 'configure)
11797 (replace 'build
11798 (lambda* (#:key inputs #:allow-other-keys)
11799 (invoke "make" "-C" "tools/bpf/bpftool"
11800 ,(string-append "CC=" (cc-for-target)))))
11801 (replace 'install
11802 (lambda* (#:key outputs #:allow-other-keys)
11803 (let* ((out (assoc-ref outputs "out")))
11804 (mkdir-p (string-append out "/sbin"))
11805 (mkdir-p (string-append out
11806 "/share/bash-completion/completions"))
11807 (invoke "make"
11808 (string-append "prefix=" out)
11809 (string-append
11810 "bash_compdir=" out
11811 "/share/bash-completion/completions")
11812 "-C" "tools/bpf/bpftool"
11813 "install")))))))
11814 (inputs (list elfutils ;provides libelf
11815 libcap openssl readline zlib))
11816 (native-inputs (list bison python))
11817 ;; This tool does not have a proper web page.
11818 (home-page
11819 "https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/bpf/bpftool")
11820 (synopsis "Tool for inspection and manipulation of eBPF programs and maps")
11821 (description "@command{bpftool} allows for inspection and simple
11822modification of BPF objects on the system.")
11823 (license (package-license linux-libre))))
11824
11825(define-public bpftrace
11826 (package
11827 (name "bpftrace")
11828 (version "0.21.2")
11829 (source
11830 (origin
11831 (method git-fetch)
11832 (uri (git-reference
11833 (url "https://github.com/bpftrace/bpftrace")
11834 (commit (string-append "v" version))))
11835 (file-name (git-file-name name version))
11836 (sha256
11837 (base32 "0icbhf1wk523a7lcmwqa67zc6hl6h02p5mfg26cizva447kbwsgz"))))
11838 (build-system cmake-build-system)
11839 (arguments
11840 (list
11841 #:test-exclude "(runtime_tests|tools-parsing-test)"
11842 #:phases
11843 #~(modify-phases %standard-phases
11844 ;; This patch also fixes broken compilation due to improper detection
11845 ;; of bfd features. This is taken from following upstream PR:
11846 ;; https://github.com/bpftrace/bpftrace/pull/3332
11847 (add-after 'unpack 'patch-paths-and-bfd-defs
11848 (lambda _
11849 (substitute* '("cmake/FindLibBfd.cmake"
11850 "src/CMakeLists.txt")
11851 (("LIBSFRAME_FOUND")
11852 "LIBSFRAME_LIBRARIES")
11853 (("LIBZSTD_FOUND")
11854 "LIBZSTD_LIBRARIES"))
11855 (with-directory-excursion "tests"
11856 (substitute* (find-files ".")
11857 (("/bin/sh")
11858 (which "sh")))
11859 (substitute* '("child.cpp"
11860 "runtime/call"
11861 "procmon.cpp")
11862 (("/bin/ls")
11863 (which "ls"))))))
11864 (add-after 'unpack 'fix-paths
11865 (lambda* (#:key inputs outputs #:allow-other-keys)
11866 (substitute* '("tests/child.cpp")
11867 (("/bin/sleep")
11868 (search-input-file inputs "bin/sleep")))))
11869 (add-before 'check 'set-test-filter
11870 (lambda _
11871 (setenv "GTEST_FILTER"
11872 (string-join
11873 (list ; "-" disables all following tests
11874 "-ast.probe_name_uprobe"
11875 "bpftrace.add_probes_uprobe_wildcard_file"
11876 "bpftrace.add_probes_uprobe_wildcard_file_uprobe_multi"
11877 "bpftrace.add_probes_usdt_wildcard"
11878 "Parser.multiple_attach_points_kprobe"
11879 "Parser.uretprobe_offset"
11880 "semantic_analyser.builtin_functions"
11881 "semantic_analyser.call_func"
11882 "semantic_analyser.call_uaddr")
11883 ":")))))))
11884 (native-inputs (list bison coreutils dwarves flex googletest xxd))
11885 (inputs (list bcc clang-15 elfutils libbpf libiberty cereal))
11886 (home-page "https://github.com/bpftrace/bpftrace")
11887 (synopsis "High-level tracing language for Linux eBPF")
11888 (description
11889 "bpftrace is a high-level tracing language for Linux enhanced Berkeley
11890Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses
11891LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for
11892interacting with the Linux BPF system, as well as existing Linux tracing
11893capabilities: kernel dynamic tracing (kprobes), user-level dynamic
11894tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk
11895and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was
11896created by Alastair Robertson.")
11897 (license license:asl2.0)))
11898
11899(define-public ttyebus-linux-module
11900 (let ((revision "0")
11901 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))
11902 (package
11903 (name "ttyebus-linux-module")
11904 (version (git-version "1.5" revision commit))
11905 (source
11906 (origin
11907 (method git-fetch)
11908 (uri (git-reference
11909 (url "https://github.com/eBUS/ttyebus")
11910 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")))
11911 (file-name (git-file-name name version))
11912 (sha256
11913 (base32
11914 "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani"))))
11915 (supported-systems '("armhf-linux" "aarch64-linux"))
11916 (build-system linux-module-build-system)
11917 (arguments
11918 `(#:tests? #f))
11919 (home-page "https://github.com/eBUS/ttyebus")
11920 (synopsis "Low-latency Raspberry Pi UART driver")
11921 (description "This package provides a Linux kernel module that will
11922provide a serial device @code{/dev/ttyebus} with almost no latency upon
11923receiving. It is dedicated to the PL011 UART of the Raspberry Pi.")
11924 (license license:gpl3+))))
11925
11926(define-public ipset
11927 (package
11928 (name "ipset")
11929 (version "7.17")
11930 (source
11931 (origin
11932 (method url-fetch)
11933 (uri (string-append "https://ipset.netfilter.org/"
11934 "ipset-" version ".tar.bz2"))
11935 (sha256
11936 (base32 "1n34mkrdha9rggd0fizjx6baqkiqqd1yfhb5ml663mlx93zwjjdy"))))
11937 (build-system gnu-build-system)
11938 (inputs
11939 (list libmnl))
11940 (native-inputs
11941 (list pkg-config))
11942 (arguments
11943 `(#:configure-flags '("--disable-static"
11944 "--with-kmod=no")))
11945 (home-page "https://ipset.netfilter.org/")
11946 (synopsis "Administration tool for IP sets")
11947 (description "IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel which
11948can be administered by the ipset utility. Depending on the type,
11949currently an IP set may store IP addresses, (TCP/UDP) port numbers or
11950IP addresses with MAC addresses in a way which ensures lightning speed
11951when matching an entry against a set.
11952
11953If you want to
11954@itemize @bullet
11955@item store multiple IP addresses or port numbers and match against the entire
11956collection using a single iptables rule.
11957@item dynamically update iptables rules against IP addresses or ports without
11958performance penalty.
11959@item express complex IP address and ports based rulesets with a single
11960iptables rule and benefit from the speed of IP sets.
11961@end itemize\n
11962then IP sets may be the proper tool for you.")
11963 (license license:gpl2+)))
11964
11965(define-public liburing
11966 (package
11967 (name "liburing")
11968 (version "2.15")
11969 (source (origin
11970 (method git-fetch)
11971 (uri (git-reference
11972 (url "https://github.com/axboe/liburing")
11973 (commit (string-append "liburing-" version))))
11974 (file-name (git-file-name name version))
11975 (sha256
11976 (base32
11977 "1vq47c15fv60992qla7y9s3b52v958zkbfpr0hscji1n6bj6w4x0"))))
11978 (build-system gnu-build-system)
11979 (arguments
11980 `(;; Tests are dependent on kernel version and features
11981 #:tests? #f
11982 #:phases
11983 (modify-phases %standard-phases
11984 (replace 'configure
11985 ;; configure fails if it is followed by SHELL, CONFIG_SHELL,
11986 ;; --enable-fast-install, and --build
11987 (lambda* (#:key outputs #:allow-other-keys)
11988 (let ((out (assoc-ref outputs "out")))
11989 (setenv "SHELL" (which "sh"))
11990 (setenv "CONFIG_SHELL" (which "sh"))
11991 (invoke "./configure" (string-append "--prefix=" out))))))))
11992 (home-page "https://github.com/axboe/liburing")
11993 (synopsis "Interface to the Linux kernel @code{io_uring} interface")
11994 (description "This is the io_uring library, liburing. liburing provides
11995helpers to setup and teardown io_uring instances, and also a simplified
11996interface for applications that don't need (or want) to deal with the full
11997kernel side implementation.")
11998 (license license:expat)))
11999
12000(define-public erofs-utils
12001 (package
12002 (name "erofs-utils")
12003 (version "1.8.10")
12004 (source
12005 (origin
12006 (method git-fetch)
12007 (uri (git-reference
12008 (url "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git")
12009 (commit (string-append "v" version))))
12010 (file-name (git-file-name name version))
12011 (sha256
12012 (base32 "1qlig9q1fdjl0zn7206dbv7w5ssjg4az4hg7y3vk69ly0zbmwkil"))))
12013 (build-system gnu-build-system)
12014 (inputs
12015 (list lz4
12016 `(,util-linux "lib")
12017 zlib))
12018 (native-inputs
12019 (list autoconf automake libtool pkg-config))
12020 (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/")
12021 (synopsis "User-space tools for the EROFS file system")
12022 (description
12023 "@acronym{EROFS, The Enhanced Read-Only File System} is a compressed,
12024read-only file system optimized for resource-scarce devices. This package
12025provides user-space tools for creating EROFS file systems.")
12026 (license license:gpl2+)))
12027
12028(define-public erofs-utils/static
12029 (static-package
12030 (package
12031 (inherit erofs-utils)
12032 (name "erofs-utils-static")
12033 (arguments
12034 (substitute-keyword-arguments (package-arguments erofs-utils)
12035 ((#:configure-flags flags #~'())
12036 #~(append #$flags (list "--without-uuid" "--without-zlib"))))))))
12037
12038(define-public rasdaemon
12039 (package
12040 (name "rasdaemon")
12041 (version "0.8.4")
12042 (source
12043 (origin
12044 (method git-fetch)
12045 (uri (git-reference
12046 (url "https://github.com/mchehab/rasdaemon")
12047 (commit (string-append "v" version))))
12048 (file-name (git-file-name name version))
12049 (sha256
12050 (base32 "1930g35igfdw5bzcd6diy59rm1q4yirpjgqznfqfsichnmk04kmf"))))
12051 (native-inputs (list autoconf automake libtool pkg-config))
12052 (inputs
12053 (list bash-minimal
12054 dmidecode
12055 kmod
12056 libtraceevent
12057 pciutils
12058 perl
12059 perl-dbd-sqlite
12060 sqlite))
12061 (arguments
12062 (list
12063 #:configure-flags
12064 #~(list "--enable-all"
12065 ;; Don't install unused /etc/sysconfig/rasdaemon environment file.
12066 "--with-sysconfdefdir=."
12067 "--localstatedir=/var")
12068 #:phases
12069 #~(modify-phases %standard-phases
12070 (add-after 'unpack 'rename-README
12071 (lambda _
12072 ;; Required by autoreconf
12073 (rename-file "README.md" "README")))
12074 (add-before 'configure 'munge-autotools
12075 (lambda _
12076 ;; For some reason upstream forces sysconfdir=/etc. This results
12077 ;; in EPERM during the install phase. Removing the offending
12078 ;; line lets sysconfdir correctly pick up DESTDIR.
12079 (substitute* "configure.ac"
12080 (("^test .* sysconfdir=/etc\n$") ""))))
12081 (add-after 'install 'wrap-rasdaemon
12082 (lambda* (#:key inputs #:allow-other-keys)
12083 (let ((path (map dirname
12084 (list (search-input-file inputs "/sbin/dmidecode")
12085 (search-input-file inputs "/bin/modprobe")))))
12086 (wrap-program (string-append #$output "/sbin/ras-mc-ctl")
12087 `("PATH" ":" prefix ,path)
12088 `("PERL5LIB" ":" prefix ,(string-split (getenv "PERL5LIB") #\:)))))))))
12089 (build-system gnu-build-system)
12090 (home-page "https://github.com/mchehab/rasdaemon")
12091 (synopsis "Platform Reliability, Availability, and Serviceability tools")
12092 (description
12093 "The @code{rasdaemon} daemon monitors platform @acronym{RAS, Reliability
12094Availability and Serviceability} reports from Linux kernel trace events.
12095These trace events are logged in @file{/sys/kernel/debug/tracing} and reported
12096through standard log mechanisms like syslog.")
12097 (license license:gpl2)))
12098
12099(define-public renameat2
12100 ;; This is a Gist, with no release or tags.
12101 (let ((revision "0")
12102 (commit "5c5193f20142511a5fc7069a539f4e5aba0ea470"))
12103 (package
12104 (name "renameat2")
12105 (version (git-version "0.0.0" revision commit))
12106 (source (origin
12107 (method url-fetch)
12108 (uri (string-append "https://gist.githubusercontent.com/"
12109 "eatnumber1/f97ac7dad7b1f5a9721f/raw/"
12110 commit "/renameat2.c"))
12111 (sha256
12112 (base32
12113 "07b4hsxqjm610sdkm4nxhp0gnl2s7gzlh4zdnja5ay40v4x24bb9"))))
12114 (build-system gnu-build-system)
12115 (arguments
12116 (list
12117 #:tests? #f ;no test suite
12118 #:phases #~(modify-phases %standard-phases
12119 (delete 'configure)
12120 (replace 'build
12121 (lambda _
12122 (invoke #$(cc-for-target) "renameat2.c"
12123 "-o" "renameat2")))
12124 (replace 'install
12125 (lambda _
12126 (install-file "renameat2"
12127 (string-append #$output "/bin")))))))
12128 (home-page "https://gist.github.com/eatnumber1/f97ac7dad7b1f5a9721f")
12129 (synopsis "Command to call the renameat2 Linux system call")
12130 (description "This package provides a @command{renameat2} command that
12131calls the Linux-specific @code{renameat2} system call.")
12132 (license license:expat))))
12133
12134(define-public libgpiod
12135 (package
12136 (name "libgpiod")
12137 (version "2.2.2")
12138 (source
12139 (origin
12140 (method git-fetch)
12141 (uri
12142 (git-reference
12143 (url "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
12144 (commit (string-append "v" version))))
12145 (file-name (git-file-name name version))
12146 (sha256 (base32 "10yiwrw80x0057w825zxmdbd54w9lbyf49bgqk1cryqapglfzqri"))))
12147 (build-system gnu-build-system)
12148 (arguments
12149 (list #:configure-flags
12150 #~(list "--enable-tools=yes"
12151 "--enable-bindings-cxx")))
12152 (native-inputs
12153 (list automake
12154 autoconf-2.71
12155 libtool
12156 autoconf-archive
12157 pkg-config))
12158 (synopsis "Interact with the Linux GPIO character device")
12159 (description
12160 "This package provides a C library with C++ bindings and
12161command-line tools for interacting with GPIO devices that avoids the usage of
12162older system-wide @file{/sys} interface.")
12163 (home-page "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/")
12164 (license (list license:lgpl2.1+ ;; libgpiod
12165 license:gpl2+ ;; gpio-tools
12166 license:lgpl3+)))) ;; C++ bindings
12167
12168(define-public python-libgpiod
12169 (package
12170 (name "python-libgpiod")
12171 (version "2.3.0")
12172 (source
12173 (origin
12174 (method git-fetch)
12175 (uri
12176 (git-reference
12177 (url "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
12178 (commit (string-append "python-v" version))))
12179 (file-name (git-file-name name version))
12180 (sha256 (base32 "1lkd7lgpb28pqf7p6lrwl0ss7r5ryiddmdcisnz6ixy796qhr8kr"))))
12181 (build-system pyproject-build-system)
12182 (arguments
12183 (list
12184 #:tests? #f ; tests require root, see README.md
12185 #:phases
12186 #~(modify-phases %standard-phases
12187 (add-after 'unpack 'cd-to-python-bindings
12188 (lambda _
12189 (chdir "bindings/python"))))))
12190 (native-inputs
12191 (list python-setuptools
12192 python-wheel
12193 libgpiod))
12194 (synopsis "Interact with the Linux GPIO character device")
12195 (description
12196 "This package provides Python bindings for interacting with GPIO devices
12197that avoids the usage of older system-wide @file{/sys} interface.")
12198 (home-page "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/")
12199 (license (list license:lgpl2.1+ ;; libgpiod
12200 license:gpl2+ ;; gpio-tools
12201 license:lgpl3+)))) ;; C++ bindings
12202
12203(define-public libtraceevent
12204 (package
12205 (name "libtraceevent")
12206 (version "1.9.0")
12207 (source
12208 (origin
12209 (method git-fetch)
12210 (uri (git-reference
12211 (url "https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git")
12212 (commit (string-append name "-" version))))
12213 (file-name (git-file-name name version))
12214 (sha256
12215 (base32 "10fklw4znjhm8mlg6hwlipdyk7v3053lnrc5bpqifnsc8gwqbaz0"))))
12216 (build-system meson-build-system)
12217 (arguments
12218 (list
12219 #:configure-flags
12220 #~(list "-Ddoc=false")))
12221 (home-page "https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/")
12222 (synopsis "Linux kernel trace event library")
12223 (description
12224 "This library parses raw Linux kernel trace event formats.")
12225 (license (list license:gpl2
12226 license:lgpl2.1))))
12227
12228(define-public libtracefs
12229 (package
12230 (name "libtracefs")
12231 (version "1.8.3")
12232 (source
12233 (origin
12234 (method git-fetch)
12235 (uri (git-reference
12236 (url "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git")
12237 (commit (string-append name "-" version))))
12238 (file-name (git-file-name name version))
12239 (sha256
12240 (base32 "1bc4mwf488nlja64zawjznvb6640vchjb25xa02v53x6qfb1mpmq"))))
12241 (build-system meson-build-system)
12242 (arguments
12243 (list
12244 #:configure-flags
12245 #~(list "-Ddoc=false")))
12246 (native-inputs
12247 (list bison
12248 flex
12249 pkg-config))
12250 (inputs (list libtraceevent))
12251 (home-page "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/")
12252 (synopsis "Linux kernel trace file system library")
12253 (description
12254 "This library provides APIs to access the Linux kernel's trace file
12255system.")
12256 (license (list license:gpl2
12257 license:lgpl2.1))))
12258
12259(define-public libtree
12260 (package
12261 (name "libtree")
12262 (version "3.1.1")
12263 (source
12264 (origin
12265 (method git-fetch)
12266 (uri (git-reference
12267 (url "https://github.com/haampie/libtree")
12268 (commit (string-append "v" version))))
12269 (file-name (git-file-name name version))
12270 (patches (search-patches "libtree-fix-check-non-x86.patch"))
12271 (sha256
12272 (base32 "1jbc60cslzcfxk9jwva51ncr1zl1nz0fkgfjdckgv81is11nswmb"))))
12273 (arguments
12274 (list #:make-flags
12275 ;; NOTE: Official documentation recommends to build libtree with
12276 ;; "-static" flag.
12277 #~(list (string-append "CC=" #$(cc-for-target))
12278 (string-append "PREFIX=" #$output))
12279 #:phases
12280 #~(modify-phases %standard-phases
12281 (add-after 'unpack 'fix-tests
12282 ;; XXX: '08_nodeflib' fails as 'libtree' returns a non-zero
12283 ;; code in one of the tests.
12284 ;;
12285 ;; See <https://github.com/haampie/libtree/issues/80>).
12286 (lambda _
12287 (substitute* "tests/08_nodeflib/Makefile"
12288 (("! ../../libtree -vvv exe_b")
12289 "../../libtree -vvv exe_b"))))
12290 (delete 'configure))))
12291 (build-system gnu-build-system)
12292 (home-page "https://github.com/haampie/libtree")
12293 (synopsis "Show output of @command{ldd} as a tree")
12294 (description
12295 "This tool turns @command{ldd} into a tree and explains how shared
12296libraries are found or why they cannot be located.")
12297 (license license:expat)))
12298
12299(define-public touchegg
12300 (package
12301 (name "touchegg")
12302 (version "2.0.18")
12303 (source
12304 (origin
12305 (method git-fetch)
12306 (uri (git-reference
12307 (url "https://github.com/JoseExposito/touchegg")
12308 (commit version)))
12309 (file-name (git-file-name name version))
12310 (sha256
12311 (base32 "0m8zgihij14b8dxrxxvpl8sdsx49mjlnxnm0fhgfxscy7n07kcpc"))))
12312 (build-system cmake-build-system)
12313 (arguments
12314 `(#:tests? #f ; No tests exist
12315 #:configure-flags
12316 (list "-DUSE_SYSTEMD=OFF"))) ; No systemd
12317 (native-inputs
12318 (list
12319 pkg-config))
12320 (inputs
12321 (list
12322 cairo
12323 gtk+
12324 libgudev
12325 libinput
12326 libxrandr
12327 libxtst
12328 pugixml))
12329 (home-page "https://github.com/JoseExposito/touchegg")
12330 (synopsis "Multitouch gesture recognizer")
12331 (description
12332 "Touchégg is an application that runs in the background and transform the
12333gestures you make on your touchpad or touchscreen into visible actions in your
12334desktop.")
12335 (license license:gpl3+)))
12336
12337(define-public evtest
12338 (package
12339 (name "evtest")
12340 (version "1.36")
12341 (source (origin
12342 (method git-fetch)
12343 (uri (git-reference
12344 (url "https://gitlab.freedesktop.org/libevdev/evtest")
12345 (commit (string-append "evtest-" version))))
12346 (file-name (git-file-name name version))
12347 (sha256
12348 (base32
12349 "0mwjvz0fwwcwm4fpw0m4x8bcxpnzjkiy7fpb438vf4i5g5q0dc1k"))))
12350 (build-system gnu-build-system)
12351 (arguments
12352 (list #:tests? #f ;No tests exist
12353 #:make-flags #~(list (string-append "CC="
12354 #$(cc-for-target))
12355 (string-append "PREFIX="
12356 #$output))
12357 #:phases #~(modify-phases %standard-phases
12358 (add-after 'unpack 'generate-doc
12359 (lambda _
12360 (invoke "asciidoc" "-d" "manpage"
12361 "-b" "docbook"
12362 "-o" "evtest.1.xml"
12363 "evtest.txt")
12364 (invoke "xsltproc" "--nonet"
12365 (string-append
12366 #$(this-package-native-input "docbook-xsl")
12367 "/xml/xsl/docbook-xsl-"
12368 #$(package-version
12369 (this-package-native-input "docbook-xsl"))
12370 "/manpages/docbook.xsl")
12371 "evtest.1.xml")))
12372 (replace 'bootstrap
12373 (lambda _
12374 (setenv "CONFIG_SHELL" (which "sh"))
12375 (invoke "autoreconf" "-fi"))))))
12376 (native-inputs (list autoconf
12377 automake
12378 bash-minimal
12379 xmlto
12380 docbook-xsl
12381 libxslt
12382 asciidoc))
12383 (home-page "https://gitlab.freedesktop.org/libevdev/evtest")
12384 (synopsis "Kernel evdev device information and monitor")
12385 (description
12386 "@code{evtest} is a tool to print @code{evdev} kernel events. It reads
12387directly from the kernel device and prints a device description and the events
12388with the value and the symbolic name.")
12389 (license license:gpl2+)))
12390
12391(define-public tp-smapi-module
12392 (package
12393 (name "tp-smapi-module")
12394 (version "0.44")
12395 (source (origin
12396 (method git-fetch)
12397 (uri (git-reference
12398 (url "https://github.com/linux-thinkpad/tp_smapi")
12399 (commit (string-append "tp-smapi/" version))))
12400 (file-name (git-file-name name version))
12401 (sha256
12402 (base32
12403 "0kzbks07bh5jbi1n311zp9cbp1xxyzi7nys8wq1k0k5ig81h9w6k"))))
12404 (build-system linux-module-build-system)
12405 (arguments
12406 `(#:tests? #f)) ;there are none.
12407 (home-page "https://github.com/linux-thinkpad/tp_smapi")
12408 (synopsis
12409 "Linux Kernel module exposing features of ThinkPad hardware")
12410 (description
12411 "This package provides a Linux Kernel module that controls
12412battery charging of specific ThinkPad laptops. It also includes an improved
12413version of the HDAPS driver. The underlying hardware interfaces are
12414@acronym{SMAPI, System Management Application Program Interface} and direct
12415access to the embedded controller.")
12416 (license license:gpl2+)))
12417
12418(define-public modprobed-db
12419 (package
12420 (name "modprobed-db")
12421 (version "2.48")
12422 (source (origin
12423 (method git-fetch)
12424 (uri (git-reference
12425 (url "https://github.com/graysky2/modprobed-db")
12426 (commit (string-append "v" version))))
12427 (file-name (git-file-name name version))
12428 (sha256
12429 (base32
12430 "0jscinga32jjvy3vwl4s1pyd5fjgqhmmk010k665nhil302hzjdc"))))
12431 (build-system gnu-build-system)
12432 (arguments
12433 (list #:tests? #f ;no tests
12434 #:make-flags
12435 #~(list (string-append "PREFIX=" #$output)
12436 "INITDIR_SYSTEMD=no-thanks")
12437 #:phases
12438 #~(modify-phases %standard-phases
12439 (delete 'configure)
12440 (add-after 'install 'fix-path
12441 (lambda* (#:key inputs #:allow-other-keys)
12442 (substitute* (string-append #$output "/bin/modprobed-db")
12443 (("/usr") #$output)
12444 (((string-append "(" (string-join (list "awk"
12445 "cp"
12446 "cut"
12447 "getent"
12448 "grep"
12449 "logname"
12450 "md5sum"
12451 "mkdir"
12452 "mv"
12453 "sed"
12454 "sort"
12455 "uniq"
12456 "wc")
12457 "|") ")") m)
12458 (search-input-file inputs (string-append "/bin/" m)))
12459 (("modprobe ")
12460 (string-append
12461 (search-input-file inputs "/bin/modprobe") " "))))))))
12462 (inputs (list coreutils kmod gawk glibc grep sed))
12463 (home-page "https://wiki.archlinux.org/title/Modprobed-db")
12464 (synopsis "Keep track of Linux modules that have been probed")
12465 (description
12466 "Modprobed-db is a useful utility for users wishing to build a minimal
12467kernel via a @code{make localmodconfig}. In a nutshell, this @command{make}
12468target creates a config based on the current config and a list of modules you
12469define (that @command{modprobed-db} keeps for you). It then disables any
12470module option that is not needed thus not building extraneous modules. This
12471results in a system-specific, streamlined kernel package and footprint as well
12472as reduced compilation times.
12473
12474Modprobed-db simply logs every module ever probed on the target system to a
12475text-based database (@file{$XDG_CONFIG_HOME/modprobed-db}), which can be read
12476directly by @code{make localmodconfig} as described above.")
12477 (license license:expat)))
12478
12479(define-public kernel-hardening-checker
12480 (package
12481 (name "kernel-hardening-checker")
12482 (version "0.6.17.1")
12483 (source (origin
12484 (method git-fetch)
12485 (uri (git-reference
12486 (url "https://github.com/a13xp0p0v/kernel-hardening-checker")
12487 (commit (string-append "v" version))))
12488 (file-name (git-file-name name version))
12489 (sha256
12490 (base32
12491 "04r9bbayhs1ik84908q148k9djawy69zarxw0vc31dfbf64mni62"))))
12492 (build-system pyproject-build-system)
12493 (arguments
12494 (list #:tests? #f)) ;no active tests, runtime only, see GitHub Actions
12495 (native-inputs
12496 (list python-setuptools))
12497 (home-page "https://github.com/a13xp0p0v/kernel-hardening-checker")
12498 (synopsis
12499 "Tool for checking the security hardening options of the Linux kernel")
12500 (description
12501 "@code{kernel-hardening-checker} is a tool for checking the security
12502hardening options of the Linux kernel. Provided preferences are based on
12503suggestions from various sources, including:
12504
12505@itemize
12506@item KSPP recommended settings
12507@item CLIP OS kernel configuration
12508@item Last public grsecurity patch (options which they disable)
12509@item SECURITY_LOCKDOWN_LSM patchset
12510@item Direct feedback from the Linux kernel maintainers
12511@end itemize\n
12512This tool supports checking Kconfig options and kernel cmdline parameters.")
12513 (license license:gpl3)))
12514
12515(define-public firejail
12516 (package
12517 (name "firejail")
12518 (version "0.9.78")
12519 (source (origin
12520 (method git-fetch)
12521 (uri (git-reference
12522 (url "https://github.com/netblue30/firejail")
12523 (commit version)))
12524 (file-name (git-file-name name version))
12525 (sha256
12526 (base32
12527 "18bsnwyg7aidm74qckrp437gr0zy9bpq1b1wr6mfnj61v74fwwxs"))))
12528 (arguments
12529 (list #:phases
12530 #~(modify-phases %standard-phases
12531 (replace 'check
12532 (lambda* (#:key tests? #:allow-other-keys)
12533 (when tests?
12534 (with-directory-excursion "test"
12535 (invoke "make"))))))))
12536 (build-system gnu-build-system)
12537 (inputs
12538 (list apparmor xdg-dbus-proxy))
12539 (synopsis "Linux namespaces sandbox program")
12540 (description
12541 "Firejail is a SUID sandbox program that reduces the risk of security
12542breaches by restricting the running environment of untrusted applications
12543using Linux namespaces, seccomp-bpf and Linux capabilities. The software
12544includes sandbox profiles for a number of common Linux programs. Firejail
12545should be added to the list of setuid programs in the system configuration to
12546work properly.")
12547 (home-page "https://github.com/netblue30/firejail")
12548 (supported-systems
12549 (filter (cut string-suffix? "-linux" <>) %supported-systems))
12550 (license license:gpl2+)))
12551
12552(define-public firejail-disable-sandbox-check
12553 (package/inherit
12554 firejail
12555 (name "firejail-disable-sandbox-check")
12556 (arguments
12557 (substitute-keyword-arguments arguments
12558 ((#:configure-flags flags #~'())
12559 #~(append #$flags
12560 (list "--disable-sandbox-check")))))
12561 (description
12562 (string-append (package-description firejail)
12563 " Builded with @code{--disable-sandbox-check}, which is
12564 only intended for development."))))
12565
12566(define-public edac-utils
12567 (package
12568 (name "edac-utils")
12569 (version "0.18")
12570 (source (origin
12571 (method git-fetch)
12572 (uri (git-reference
12573 (url "https://github.com/grondo/edac-utils.git")
12574 (commit version)))
12575 (file-name (string-append name "-" version "-checkout"))
12576 (sha256
12577 (base32
12578 "04j686m58wsnyy5di7rz0sw9jahlm4ziwxjmgs31pjb87vzw3xgp"))))
12579 (build-system gnu-build-system)
12580 (native-inputs
12581 (list perl))
12582 (inputs
12583 (list sysfsutils))
12584 (synopsis "Memory error detection and correction userspace helpers")
12585 (description "This package provides userspace helpers for memory
12586error detection and correction (EDAC).")
12587 (home-page "https://github.com/grondo/edac-utils")
12588 (license license:gpl2+)))
12589
12590(define-public spectre-meltdown-checker
12591 (package
12592 (name "spectre-meltdown-checker")
12593 (version "0.46")
12594 (source (origin
12595 (method git-fetch)
12596 (uri (git-reference
12597 (url "https://github.com/speed47/spectre-meltdown-checker")
12598 (commit (string-append "v" version))))
12599 (file-name (git-file-name name version))
12600 (patches
12601 (search-patches
12602 "spectre-meltdown-checker-externalize-fwdb.patch"))
12603 ;; Remove builtin firmware database.
12604 (modules '((guix build utils)))
12605 (snippet '(substitute* "spectre-meltdown-checker.sh"
12606 (("^# [AI],.*") "")))
12607 (sha256
12608 (base32
12609 "0j42p6dayb7k87kf8sqimxlaswis3qh0569a15zccyknv9vf129k"))))
12610 (build-system copy-build-system)
12611 (arguments
12612 (list
12613 #:install-plan
12614 #~'(("spectre-meltdown-checker.sh" "bin/spectre-meltdown-checker"))
12615 #:phases
12616 #~(modify-phases %standard-phases
12617 (add-after 'unpack 'fixpath
12618 (lambda* (#:key inputs #:allow-other-keys)
12619 (define* (find-command inputs cmd #:optional (bin "bin"))
12620 (search-input-file inputs (string-append bin "/" cmd)))
12621 (substitute* "spectre-meltdown-checker.sh"
12622 ;; ${opt_arch_prefix}CMD
12623 (("\\$\\{opt_arch_prefix\\}\\<(nm|objdump|readelf|strings)\\>"
12624 all cmd)
12625 (find-command inputs cmd))
12626
12627 ;; Commands safe to substitute directly.
12628 (("\\<(awk|(base|dir)name|bunzip2|g(un)?zip|lz4)\\>" all cmd)
12629 (find-command inputs cmd))
12630 (("\\<(lzop|mktemp|modprobe|pgrep|rmmod|umount)\\>" all cmd)
12631 (find-command inputs cmd))
12632 (("\\<(unlzma|unxz|unzstd|uuencode)\\>" all cmd)
12633 (find-command inputs cmd))
12634
12635 ;; Commands which should only be substituted based on their
12636 ;; surroundings: First up, dd.
12637 (("\\<(dd)\\> if=" all cmd)
12638 (string-append
12639 (find-command inputs cmd)
12640 " if="))
12641
12642 ;; Another special case: sysctl is in sbin.
12643 (("(if |\\$\\( *)\\<(sysctl)\\>" all pre cmd)
12644 (string-append pre (find-command inputs cmd "sbin")))
12645
12646 ;; Meow
12647 (("cat (<<EOF|\"\\$)" all what)
12648 (string-append (find-command inputs "cat") " " what))
12649 (("'cat'")
12650 (string-append "'" (find-command inputs "cat") "'"))
12651 (("\"cat\"")
12652 (string-append "\"" (find-command inputs "cat") "\""))
12653
12654 ;; ${COMMAND} -
12655 ;; ${COMMAND} ^
12656 (("\\<(base64|cut|grep|head|id|mount)\\> ([-^])" all cmd suffix)
12657 (string-append (find-command inputs cmd) " " suffix))
12658 (("\\<(od|perl|rm|uname|xargs)\\> ([-^])" all cmd suffix)
12659 (string-append (find-command inputs cmd) " " suffix))
12660
12661 ;; ${COMMAND} |
12662 (("\\<(dmesg)\\> \\|" all cmd)
12663 (string-append (find-command inputs cmd) " |"))
12664 ;; | ${COMMAND}
12665 (("\\| \\<(grep|sed|sort|stat|tr)\\>" all cmd)
12666 (string-append "| " (find-command inputs cmd)))
12667
12668 ;; Command in sub-shell, i.e. $($COMMAND ...)
12669 (("\\$\\( *(\\<cat|find|grep|mount|nproc|stat|tr\\>)"
12670 all cmd)
12671 (string-append "$(" (find-command inputs cmd)))
12672
12673 ;; command -v
12674 (("command -v \"*\\<(base64|nproc|perl|printf)\\>\"*" all cmd)
12675 (string-append "command -v " (find-command inputs cmd)))))))))
12676 (inputs (list kmod lz4 lzop perl procps sharutils util-linux zstd))
12677 (home-page "https://github.com/speed47/spectre-meltdown-checker")
12678 (synopsis "CPU vulnerability / mitigation checker")
12679 (description
12680 "This package provides a shell script to assess your system's resilience
12681against the several transient execution CVEs that were published since early
126822018, and gives guidance as to how to mitigate them.")
12683 (license license:gpl3)))
12684
12685(define-public csmith
12686 (package
12687 (name "csmith")
12688 (version "2.3.0")
12689 (source (origin
12690 (method git-fetch)
12691 (uri (git-reference
12692 (url "https://github.com/csmith-project/csmith")
12693 (commit (string-append "csmith-" version))))
12694 (file-name (git-file-name name version))
12695 (sha256
12696 (base32
12697 "0nhrsnv6cny14xz68qb1h30fbwc05adkisk51p3x63mydm60ddl3"))))
12698 (build-system gnu-build-system)
12699 (native-inputs
12700 (list autoconf automake libtool m4 perl))
12701 (arguments
12702 (list
12703 #:tests? #f ;no test suite
12704 ;; Do not install headers under 'include/csmith-VERSION' but in
12705 ;; 'include/csmith'.
12706 #:phases
12707 `(modify-phases %standard-phases
12708 (add-after 'unpack 'patch-includedir
12709 (lambda _
12710 (substitute* "runtime/Makefile.am"
12711 (("\\$\\(includedir\\)/\\$\\(PACKAGE\\)-\\$\\(VERSION\\)")
12712 "$(includedir)/$(PACKAGE)"))))
12713 (add-before 'bootstrap 'force-bootstrap
12714 (lambda _
12715 (delete-file "configure"))))))
12716 (home-page "https://github.com/csmith-project/csmith")
12717 (synopsis "Random generator of C programs")
12718 (description "The primary purpose of Csmith is to find compiler bugs with
12719random programs using differential testing.")
12720 (license license:bsd-4)))
12721
12722(define-public ipvsadm
12723 (package
12724 (name "ipvsadm")
12725 (version "1.31")
12726 (source
12727 (origin
12728 (method url-fetch)
12729 (uri (string-append "https://kernel.org/pub/linux/utils/kernel"
12730 "/ipvsadm/ipvsadm-" version ".tar.xz"))
12731 (sha256
12732 (base32 "1nyzpv1hx75k9lh0vfxfhc0p2fpqaqb38xpvs8sn88m1nljmw2hs"))))
12733 (build-system gnu-build-system)
12734 (native-inputs (list linux-libre-headers pkg-config which))
12735 (inputs (list libnl popt))
12736 (arguments
12737 (list #:tests? #f
12738 #:parallel-build? #f ;build fails randomly with '-j'
12739 #:make-flags
12740 #~(list (string-join
12741 (list "CFLAGS="
12742 (string-append "-I"
12743 #$(this-package-input "libnl")
12744 "/include/libnl3")
12745 (string-append "-L" #$(this-package-input "libnl")
12746 "/lib")
12747 "-fPIC")
12748 " ")
12749 (string-append "CC=" #$(cc-for-target))
12750 (string-append "SBIN=" #$output "/sbin")
12751 (string-append "INIT=" #$output "/etc/init.d")
12752 (string-append "MANDIR=" #$output "/share/man"))
12753 #:phases #~(modify-phases %standard-phases
12754 (delete 'configure))))
12755 (home-page "http://www.linuxvirtualserver.org/software/ipvs.html")
12756 (synopsis "IP virtual server administration utility")
12757 (description "@code{ipvsadm(8)} is used to set up, maintain or inspect the
12758virtual server table in the Linux kernel. The Linux Virtual Server can be used
12759to build scalable network services based on a cluster of two or more nodes.")
12760 (license license:gpl2+)))
12761
12762(define-public ryzenadj
12763 (package
12764 (name "ryzenadj")
12765 (version "0.17.0")
12766 (source
12767 (origin
12768 (method git-fetch)
12769 (uri (git-reference
12770 (url "https://github.com/flygoat/ryzenadj")
12771 (commit (string-append "v" version))))
12772 (file-name (git-file-name name version))
12773 (sha256
12774 (base32 "0dpznl4h1f5syq5464a0h9grqlvlp0qmjxr59nq3gp363gr5vjfv"))
12775 (modules '((guix build utils)))
12776 (snippet
12777 '(begin
12778 (delete-file-recursively "win32")))))
12779 (build-system cmake-build-system)
12780 (inputs (list pciutils))
12781 (arguments
12782 (list
12783 #:tests? #f ;No test suite
12784 #:build-type "Release"))
12785 (home-page "https://github.com/flygoat/ryzenadj")
12786 (synopsis "Power management tool for AMD Ryzen APUs")
12787 (description
12788 "@command{ryzenadj} is an utility to adjust power management settings for
12789AMD Ryzen mobile processors. You will need to ensure it can access /dev/mem,
12790for instance by using the \"iomem=relaxed\" kernel argument.")
12791 (license license:lgpl3)))
12792
12793(define-public ryzen-smu
12794 (package
12795 (name "ryzen-smu")
12796 (version "0.1.5")
12797 (source (origin
12798 (method git-fetch)
12799 (uri (git-reference
12800 (url "https://gitlab.com/leogx9r/ryzen_smu.git")
12801 (commit (string-append "v" version))))
12802 (file-name (git-file-name name version))
12803 (sha256
12804 (base32
12805 "010la2a8zp7rljlg5ssc9ragzva4ca05gvzlicjagl508659d2wz"))))
12806 (build-system linux-module-build-system)
12807 (arguments
12808 `(#:tests? #f)) ; no tests
12809 (synopsis "System Management Unit driver for AMD Ryzen processors")
12810 (description "This package provides a way to access the
12811System Management Unit for certain AMD Ryzen processors.
12812This includes access to the System Management Network.")
12813 (home-page "https://gitlab.com/leogx9r/ryzen_smu")
12814 (license license:gpl2)))
12815
12816(define-public hid-wiimote-plus
12817 (package
12818 (name "hid-wiimote-plus")
12819 (version "1.0.0")
12820 (source
12821 (origin
12822 (method git-fetch)
12823 (uri (git-reference
12824 (url "https://github.com/dkosmari/hid-wiimote-plus")
12825 (commit (string-append "v" version))))
12826 (file-name (git-file-name name version))
12827 (sha256
12828 (base32 "0vly8z9876yiaxx77ca9lbf9hfv5xichkkxxczjhbs2qwr819k1k"))))
12829 (build-system linux-module-build-system)
12830 (arguments
12831 (list #:tests? #f)) ; No tests.
12832 (synopsis "WiiMote HID kernel module")
12833 (description "This package provides a WiiMote driver that follows the
12834Linux input convention. Specifically, that allows you to use the D-pad
12835as a gamepad.")
12836 (home-page "https://github.com/dkosmari/hid-wiimote-plus")
12837 (license license:gpl2+)))
12838
12839(define-public python-evemu
12840 (package
12841 (name "python-evemu")
12842 (version "2.7.0")
12843 (source (origin
12844 (method git-fetch)
12845 (uri (git-reference
12846 (url "https://gitlab.freedesktop.org/libevdev/evemu")
12847 (commit (string-append "v" version))))
12848 (file-name (git-file-name name version))
12849 (sha256
12850 (base32
12851 "1sxf6v2wnajj9srlkfjfymjmmp4dlq73gzjcjmaw015a3c0xl029"))))
12852 (build-system gnu-build-system)
12853 (arguments
12854 (list #:tests? #f ; would open device files
12855 #:phases
12856 #~(modify-phases %standard-phases
12857 (add-after 'unpack 'patch
12858 (lambda* (#:key inputs #:allow-other-keys)
12859 (substitute* "python/evemu/base.py"
12860 (("\"libevdev.so\"")
12861 (string-append "\"" (assoc-ref inputs "libevdev")
12862 "/lib/libevdev.so\""))))))))
12863 (native-inputs
12864 (list asciidoc autoconf automake libtool docbook-xsl pkg-config
12865 python-wrapper xmlto))
12866 (inputs
12867 (list libevdev))
12868 (synopsis "Record and replay input device events")
12869 (description "This package provides a way to record and replay device
12870descriptions and events, making it possible to emulate input devices
12871through the Linux kernel's input system. Emulated devices are for most
12872practical purposes indistinguishable from real devices.
12873
12874It provides a command line program and also a Python library.")
12875 (home-page "https://www.freedesktop.org/wiki/Evemu/")
12876 (license license:gpl3)))
12877
12878(define-public dualsensectl
12879 (package
12880 (name "dualsensectl")
12881 (version "0.7")
12882 (source (origin
12883 (method git-fetch)
12884 (uri (git-reference
12885 (url "https://github.com/nowrep/dualsensectl.git")
12886 (commit (string-append "v" version))))
12887 (file-name (git-file-name name version))
12888 (sha256
12889 (base32
12890 "05snsp5r3hc2yc1nf0w4aam1my4h0lkxnmy7k4glxvasd9jwahzw"))))
12891 (build-system meson-build-system)
12892 (native-inputs
12893 (list pkg-config))
12894 (inputs
12895 (list eudev dbus hidapi))
12896 (synopsis "Linux tool for controlling PS5 DualSense controller")
12897 (description "This package provides a Linux tool for controlling a PS5
12898DualSense controller. It has to be already connected via USB or connected
12899via Bluetooth.")
12900 (home-page "https://github.com/nowrep/dualsensectl")
12901 (license license:gpl2)))