projects/guix·blob sysadmin-team · refs

12900 lines · 554.3 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
6335 ;; We're building 'regulatory.bin' by ourselves.
6336 (snippet '(begin
6337 (delete-file "regulatory.bin")))))
6338 (build-system gnu-build-system)
6339 (arguments
6340 (list
6341 #:phases
6342 #~(modify-phases %standard-phases
6343 (add-after 'unpack 'gzip-determinism
6344 (lambda _
6345 (substitute* "Makefile"
6346 (("gzip") "gzip --no-name"))))
6347 (add-after 'unpack 'omit-signature
6348 (lambda _
6349 (substitute* "Makefile"
6350 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
6351 ;; don't provide (see below). Disable it.
6352 ((" regulatory\\.db\\.p7s") "")
6353 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
6354 ;; but ‘make install’ depends only on the latter while
6355 ;; installing both (and failing). Depend on it explicitly.
6356 (("^install: " all) (string-append all "regulatory.db ")))))
6357 (delete 'configure)) ; no configure script
6358
6359 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
6360 ;; is computed and can be equal to 'maintainer-clean'; when that
6361 ;; happens, we can end up deleting the 'regulatory.bin' file that we
6362 ;; just built. Thus, build things sequentially.
6363 #:parallel-build? #f
6364
6365 #:tests? #f ; no tests
6366 #:make-flags
6367 #~(list (string-append "PREFIX=" #$output)
6368 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
6369
6370 ;; Leave this empty so that db2bin.py doesn't try to sign
6371 ;; ‘regulatory.bin’. This allows us to avoid managing a key
6372 ;; pair for the whole distribution.
6373 (string-append "REGDB_PRIVKEY=")
6374 ;; Don't generate a public key for the same reason. These are
6375 ;; used as Makefile targets and can't be the empty string.
6376 (string-append "REGDB_PUBCERT=/dev/null")
6377 (string-append "REGDB_PUBKEY=/dev/null"))))
6378 (native-inputs
6379 (list 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 for the
6385@acronym{CRDA, Central Regulatory Database Agent}. The database contains
6386information on country-specific regulations for the wireless spectrum.")
6387 (license license:isc)))
6388
6389(define-public lm-sensors
6390 (package
6391 (name "lm-sensors")
6392 (version "3.6.2")
6393 (source
6394 (origin
6395 (method git-fetch)
6396 (uri (git-reference
6397 (url "https://github.com/hramrach/lm-sensors")
6398 (commit (string-append "V" (string-join
6399 (string-split version #\.) "-")))))
6400 (file-name (git-file-name name version))
6401 (sha256
6402 (base32 "0p2ck8p9zb1w53l37pvm6c10vi6r8bfz51nd3sdwwsfhfhgvsr0j"))
6403 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
6404 (build-system gnu-build-system)
6405 (outputs '("lib" ; avoid perl in closure
6406 "out"))
6407 (arguments
6408 (list
6409 #:tests? #f ; no 'check' target
6410 #:make-flags
6411 #~(list (string-append "PREFIX=" #$output)
6412 (string-append "ETCDIR=" #$output:lib "/etc")
6413 (string-append "INCLUDEDIR=" #$output:lib "/include")
6414 (string-append "MANDIR=" #$output "/share/man")
6415 (string-append "LIBDIR=" #$output:lib "/lib"))
6416 #:phases
6417 #~(modify-phases %standard-phases
6418 (delete 'configure)
6419 (add-before 'build 'patch-exec-paths
6420 (lambda* (#:key inputs #:allow-other-keys)
6421 (substitute* "prog/detect/sensors-detect"
6422 (("`uname")
6423 (string-append
6424 "`" (assoc-ref inputs "coreutils") "/bin/uname"))
6425 (("(`|\")modprobe" all open-quote)
6426 (string-append
6427 open-quote #$(this-package-input "kmod") "/bin/modprobe")))
6428 (substitute* '("prog/pwm/pwmconfig" "prog/pwm/fancontrol")
6429 (("gnuplot")
6430 (search-input-file inputs "/bin/gnuplot"))
6431 (("cat ")
6432 (string-append (search-input-file inputs "/bin/cat") " "))
6433 (("e?grep " match)
6434 (string-append
6435 (search-input-file
6436 inputs (string-append "/bin/" (string-trim-right match)))
6437 " "))
6438 (("sed -e")
6439 (string-append (search-input-file inputs "/bin/sed") " -e"))
6440 (("cut -d")
6441 (string-append (search-input-file inputs "/bin/cut") " -d"))
6442 (("sleep ")
6443 (string-append (search-input-file inputs "/bin/sleep") " "))
6444 (("readlink -f")
6445 (string-append
6446 (search-input-file inputs "/bin/readlink") " -f"))))))))
6447 (inputs
6448 (list gnuplot kmod perl rrdtool))
6449 (native-inputs
6450 (list bison flex pkg-config which))
6451 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
6452 (synopsis "Utilities to read temperature/voltage/fan sensors")
6453 (description
6454 "Lm-sensors is a hardware health monitoring package for Linux. It allows
6455you to access information from temperature, voltage, and fan speed sensors.
6456It works with most newer systems.")
6457 (license license:gpl2+)))
6458
6459(define-public iucode-tool
6460 (package
6461 (name "iucode-tool")
6462 (version "2.3.1")
6463 (source (origin
6464 (method url-fetch)
6465 (uri (string-append "https://gitlab.com/iucode-tool/releases"
6466 "/raw/latest/iucode-tool_" version ".tar.xz"))
6467 (sha256
6468 (base32
6469 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
6470 (build-system gnu-build-system)
6471 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
6472 (synopsis "Manipulate Intel microcode bundles")
6473 (description
6474 "@command{iucode_tool} is a utility to work with microcode packages for
6475Intel processors. It can convert between formats, extract specific versions,
6476create a firmware image suitable for the Linux kernel, and more.")
6477 ;; cpuid.h is available for i686, x86_64, and ia64.
6478 (supported-systems '("i686-linux" "x86_64-linux"))
6479 (license license:gpl2+)))
6480
6481(define-public i2c-tools
6482 (package
6483 (name "i2c-tools")
6484 (version "4.3")
6485 (source (origin
6486 (method url-fetch)
6487 (uri (string-append
6488 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
6489 version ".tar.xz"))
6490 (sha256
6491 (base32
6492 "1y0fphjd5ah2j886x8i175r7viq0hmx666hyca0wi4dzrm290qxk"))))
6493 (build-system gnu-build-system)
6494 (arguments
6495 `(#:tests? #f ; no 'check' target
6496 #:make-flags
6497 ,#~(list (string-append "PREFIX=" #$output)
6498 (string-append "LDFLAGS+=-Wl,-rpath=" #$output "/lib")
6499 (string-append "CC=" #$(cc-for-target)))
6500 ;; No configure script.
6501 #:phases (modify-phases %standard-phases (delete 'configure))))
6502 (inputs
6503 (list perl))
6504 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
6505 (synopsis "I2C tools for Linux")
6506 (description
6507 "The i2c-tools package contains a heterogeneous set of I2C tools for
6508Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
6509EEPROM decoding scripts, EEPROM programming tools, and a python module for
6510SMBus access.")
6511 (license license:gpl2+)))
6512
6513(define-public i2c-tools-3
6514 (package
6515 (inherit i2c-tools)
6516 (name "i2c-tools")
6517 (version "3.1.2")
6518 (source (origin
6519 (method url-fetch)
6520 (uri (string-append
6521 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
6522 version ".tar.bz2"))
6523 (sha256
6524 (base32 "0hd4c1w8lnwc3j95h3vpd125170l1d4myspyrlpamqx6wbr6jpnv"))))
6525 (arguments
6526 (substitute-keyword-arguments arguments
6527 ((#:make-flags _)
6528 #~(list (string-append "prefix=" #$output)
6529 (string-append "CC=" #$(cc-for-target))))))))
6530
6531(define-public python-smbus
6532 (package
6533 (inherit i2c-tools)
6534 (name "python-smbus")
6535 (build-system pyproject-build-system)
6536 (arguments
6537 (list #:tests? #f ;; No test suite.
6538 #:phases
6539 #~(modify-phases %standard-phases
6540 (add-after 'unpack 'change-directory
6541 (lambda _ (chdir "py-smbus")))
6542 (add-after 'change-directory 'set-library-path
6543 (lambda _
6544 (substitute* "setup.py"
6545 (("-L\\.\\./lib")
6546 (string-append "-L" #$(this-package-input "i2c-tools")
6547 "/lib"))))))))
6548 (inputs (list i2c-tools))
6549 (native-inputs (list python-setuptools python-wheel))
6550 (synopsis "I2C/SMBus access for Python")
6551 (description "This package provides a Python library to access
6552@acronym{I2C, Inter-Integrated Circuit} and @acronym{SMBus, System
6553Management Bus} devices on Linux.")))
6554
6555(define-public xsensors
6556 (package
6557 (name "xsensors")
6558 (version "0.70")
6559 (source (origin
6560 (method url-fetch)
6561 (uri (string-append
6562 "http://www.linuxhardware.org/xsensors/xsensors-"
6563 version ".tar.gz"))
6564 (sha256
6565 (base32
6566 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
6567 (build-system gnu-build-system)
6568 (arguments
6569 `(#:phases
6570 (modify-phases %standard-phases
6571 (add-before 'configure 'enable-deprecated
6572 (lambda _
6573 (substitute* "src/Makefile.in"
6574 (("-DGDK_DISABLE_DEPRECATED") "")
6575 (("-DGTK_DISABLE_DEPRECATED") ""))))
6576 (add-before 'configure 'remove-Werror
6577 (lambda _
6578 (substitute* '("configure" "src/Makefile.in")
6579 (("-Werror") "")))))))
6580 (inputs (list (list lm-sensors "lib") gtk+-2))
6581 (native-inputs (list pkg-config))
6582 (home-page "http://www.linuxhardware.org/xsensors/")
6583 (synopsis "Hardware health information viewer")
6584 (description
6585 "Xsensors reads data from the libsensors library regarding hardware
6586health such as temperature, voltage and fan speed and displays the information
6587in a digital read-out.")
6588 (license license:gpl2+)))
6589
6590(define-public perf
6591 (package
6592 (name "perf")
6593 (version (package-version linux-libre))
6594 (source (package-source linux-libre))
6595 (build-system gnu-build-system)
6596 (arguments
6597 '(#:phases
6598 (modify-phases %standard-phases
6599 (replace 'configure
6600 (lambda* (#:key inputs #:allow-other-keys)
6601 (setenv "SHELL_PATH" (which "bash"))
6602 (chdir "tools/perf")
6603
6604 ;; In Linux 6.10.6, 'Makefile.config' overrides PKG_CONFIG_PATH
6605 ;; when looking for libtraceevent and thus fails to find it.
6606 ;; Remove that.
6607 (substitute* "Makefile.config"
6608 (("PKG_CONFIG_PATH=[[:graph:]]+")
6609 ""))
6610
6611 ;; This file hard-codes file system layouts for specific distros
6612 ;; but not for ours; address that. With this change, one can run
6613 ;; "perf report --symfs=$HOME/.guix-profile" (without
6614 ;; "/lib/debug") and 'perf' should be able to find separate debug
6615 ;; info files.
6616 (substitute* "util/dso.c"
6617 (("/usr/lib/debug")
6618 "/lib/debug")))))
6619 #:make-flags (list (string-append "prefix="
6620 (assoc-ref %outputs "out"))
6621 "CC=gcc"
6622 "WERROR=0"
6623
6624 ;; By default, 'config/Makefile' uses lib64 on
6625 ;; x86_64. Work around that.
6626 "lib=lib")
6627 #:tests? #f)) ;no tests
6628 (native-inputs
6629 (list pkg-config
6630 bison
6631 flex
6632 ;; For build scripts.
6633 python-3
6634 ;; Documentation
6635 docbook-xsl
6636 xmlto
6637 asciidoc))
6638 (inputs
6639 (list slang ;for the interactive TUI
6640 zlib
6641 ;; newt
6642 python-3 ;'perf' links against libpython
6643 elfutils
6644 libiberty ;used alongside BDF for symbol demangling
6645 libunwind ;better stack walking
6646 libtraceevent
6647 numactl)) ;for 'perf bench numa mem'
6648 (home-page "https://perf.wiki.kernel.org/")
6649 (synopsis "Linux profiling with performance counters")
6650 (description
6651 "perf is a tool suite for profiling using hardware performance counters,
6652with support in the Linux kernel. perf can instrument CPU performance
6653counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
6654of lightweight profiling. This package contains the user-land tools and in
6655particular the @code{perf} command.")
6656 (license (package-license linux-libre))))
6657
6658(define-public pflask
6659 (package
6660 (name "pflask")
6661 (version "0.2")
6662 (source (origin
6663 (method git-fetch)
6664 (uri (git-reference
6665 (url "https://github.com/ghedo/pflask")
6666 (commit (string-append "v" version))))
6667 (file-name (git-file-name name version))
6668 (sha256
6669 (base32
6670 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
6671 (build-system cmake-build-system)
6672 (arguments
6673 '(#:tests? #f)) ; no tests
6674 (home-page "https://ghedo.github.io/pflask/")
6675 (synopsis "Simple tool for creating Linux namespace containers")
6676 (description "pflask is a simple tool for creating Linux namespace
6677containers. It can be used for running a command or even booting an OS inside
6678an isolated container, created with the help of Linux namespaces. It is
6679similar in functionality to chroot, although pflask provides better isolation
6680thanks to the use of namespaces.")
6681 (license license:bsd-2)))
6682
6683(define-public singularity
6684 (package
6685 (name "singularity")
6686 (version "2.6.1")
6687 (source (origin
6688 (method url-fetch)
6689 (uri (string-append "https://github.com/singularityware/singularity/"
6690 "releases/download/" version
6691 "/singularity-" version ".tar.gz"))
6692 (sha256
6693 (base32
6694 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
6695 (modules '((guix build utils)))
6696 (snippet
6697 '(begin
6698 ;; Do not create directories in /var.
6699 (substitute* "Makefile.in"
6700 (("\\$\\(MAKE\\) .*install-data-hook") ""))
6701
6702 ;; The original source overrides PATH so that it points to
6703 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
6704 ;; on Guix System. Leave PATH unchanged so we refer to the
6705 ;; installed Coreutils, grep, etc.
6706 (substitute* "bin/singularity.in"
6707 (("^PATH=.*" all)
6708 (string-append "#" all "\n")))
6709
6710 (substitute* (find-files "libexec/cli" "\\.exec$")
6711 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
6712 _ program)
6713 (string-append "/run/privileged/bin/singularity-"
6714 program "-helper")))
6715
6716 ;; These squashfs mount options are apparently no longer
6717 ;; supported since Linux-libre 5.4.5.
6718 (substitute* "src/lib/image/squashfs/mount.c"
6719 (("\"errors=remount-ro\"")
6720 "NULL"))))))
6721 (build-system gnu-build-system)
6722 (arguments
6723 (list
6724 #:configure-flags #~(list "--localstatedir=/var")
6725 #:phases
6726 #~(modify-phases %standard-phases
6727 (add-after 'unpack 'patch-references
6728 (lambda _
6729 (substitute* "libexec/cli/build.exec.in"
6730 (("-mksquashfs") (string-append "-" (which "mksquashfs"))))
6731 (substitute* (append
6732 (find-files "libexec" "functions")
6733 (find-files "libexec/bootstrap-scripts" ".*sh$")
6734 (find-files "libexec/cli" ".*exec$"))
6735 (("\\| grep ")
6736 (string-append "| " (which "grep") " "))
6737 (("egrep ")
6738 (string-append (which "egrep") " "))
6739 ((" sed ")
6740 (string-append " " (which "sed") " ")))))
6741 (add-after 'install 'set-PATH
6742 (lambda _
6743 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
6744 ;; But don't override PATH, so that other tools like zcat and
6745 ;; tar can still be found if they are available.
6746 (let ((coreutils #$(this-package-input "coreutils")))
6747 (wrap-program (string-append #$output "/bin/singularity")
6748 `("PATH" prefix (,(string-append coreutils "/bin"))))
6749 (substitute* (string-append #$output "/bin/run-singularity")
6750 (("/usr/bin/env singularity")
6751 (string-append (which "env") " "
6752 #$output "/bin/singularity")))))))))
6753 (inputs
6754 (list bash-minimal
6755 coreutils
6756 libarchive
6757 python-wrapper
6758 squashfs-tools
6759 zlib))
6760 (home-page "https://singularity.lbl.gov/")
6761 (synopsis "Container platform")
6762 (description "Singularity is a container platform supporting a number of
6763container image formats. It can build SquashFS container images or import
6764existing Docker images. Singularity requires kernel support for container
6765isolation or root privileges.")
6766 (license license:bsd-3)))
6767
6768(define-public python-spython
6769 (package
6770 (name "python-spython")
6771 (version "0.3.13")
6772 (source
6773 (origin
6774 (method url-fetch)
6775 (uri (pypi-uri "spython" version))
6776 (sha256
6777 (base32 "0kly851k6mj7xzcybciav5d0pq5q04pzg7c5a1g712bqbxkha4ck"))))
6778 (build-system pyproject-build-system)
6779 (arguments
6780 (list
6781 #:phases
6782 #~(modify-phases %standard-phases
6783 ;; Configure absolute path to singularity.
6784 (add-after 'unpack 'configure
6785 (lambda* (#:key inputs #:allow-other-keys)
6786 (let ((singularity (search-input-file inputs "bin/singularity")))
6787 (substitute* "spython/utils/terminal.py"
6788 (("software=\"singularity\"")
6789 (string-append "software=\"" singularity "\"")))
6790 (substitute* (list "spython/utils/terminal.py"
6791 "spython/main/help.py"
6792 "spython/main/base/command.py")
6793 (("\\[\"singularity\"")
6794 (string-append "[\"" singularity "\"")))
6795 (substitute* "spython/main/execute.py"
6796 (("shutil.which\\(\"singularity\"\\)")
6797 (string-append "shutil.which(\"" singularity "\")"))))))
6798 ;; Skip tests that require network access.
6799 (add-before 'check 'skip-tests
6800 (lambda _
6801 (delete-file "spython/tests/test_client.py"))))))
6802 (inputs
6803 (list singularity))
6804 (native-inputs
6805 (list python-pytest python-setuptools python-wheel))
6806 (home-page "https://github.com/singularityhub/singularity-cli")
6807 (synopsis "Singularity Python client")
6808 (description "@code{python-spython} is a Python library to interact with
6809Singularity containers.")
6810 (license license:mpl2.0)))
6811
6812(define-public libnvme
6813 (package
6814 (name "libnvme")
6815 (version "1.16.2")
6816 (source (origin
6817 (method git-fetch)
6818 (uri (git-reference
6819 (url "https://github.com/linux-nvme/libnvme.git")
6820 (commit (string-append "v" version))))
6821 (sha256
6822 (base32 "05h1kjs8lgdmfsdz5vcfl470zhw7j36jp7a9wip20ibb6g3s9r1k"))
6823 (file-name (git-file-name name version))))
6824 (build-system meson-build-system)
6825 (outputs (list "out" "doc")) ; docs are 80% of all output
6826 (arguments
6827 (list
6828 #:configure-flags
6829 #~(let ((doc (string-append #$output:doc "/share/doc/" #$name)))
6830 (list (string-append "-Dhtmldir=" doc "/html")
6831 (string-append "-Drstdir=" doc "/rst")
6832 "-Ddocs-build=true" "-Ddocs=all"))))
6833 (native-inputs (list pkg-config perl python python-sphinx))
6834 ;; libnvme.pc, libnvme-mi.pc lists these in Requires.private.
6835 (propagated-inputs (list dbus json-c openssl))
6836 (home-page "https://github.com/linux-nvme/libnvme")
6837 (synopsis "C Library for NVM Express on Linux")
6838 (description "libnvme provides type definitions for NVMe specification
6839structures, enumerations, and bit fields, helper functions to construct,
6840dispatch, and decode commands and payloads, and utilities to connect, scan,
6841and manage nvme devices on a Linux system.")
6842 (license license:lgpl2.1+)))
6843
6844(define-public nvme-cli
6845 (package
6846 (name "nvme-cli")
6847 (version "2.16")
6848 (home-page "https://github.com/linux-nvme/nvme-cli")
6849 (source (origin
6850 (method git-fetch)
6851 (uri (git-reference
6852 (url home-page)
6853 (commit (string-append "v" version))))
6854 (sha256
6855 (base32 "1877fvhd4573900zwk7y2mk2vvmgnws2wa37sv176ikxj647jvw1"))
6856 (file-name (git-file-name name version))))
6857 (build-system meson-build-system)
6858 (outputs (list "out" "doc")) ; docs make up ~70% of total size
6859 (arguments
6860 (list
6861 #:configure-flags #~(list (format #f "-Dhtmldir=~a/share/doc/~a/html"
6862 #$output:doc #$name)
6863 "-Ddocs=all")))
6864 (native-inputs (list pkg-config))
6865 (inputs (list libnvme json-c zlib))
6866 (synopsis "NVM-Express user space tooling for Linux")
6867 (description "Nvme-cli is a utility to provide standards compliant tooling
6868for NVM-Express drives. It was made specifically for Linux as it relies on the
6869IOCTLs defined by the mainline kernel driver.")
6870 (license license:gpl2+)))
6871
6872(define-public acpi
6873 (package
6874 (name "acpi")
6875 (version "1.7")
6876 (source (origin
6877 (method url-fetch)
6878 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
6879 version "/" name "-" version ".tar.gz"))
6880 (sha256
6881 (base32
6882 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
6883 (build-system gnu-build-system)
6884 (home-page "http://acpiclient.sourceforge.net")
6885 (synopsis "Display information on ACPI devices")
6886 (description "@code{acpi} attempts to replicate the functionality of the
6887\"old\" @code{apm} command on ACPI systems, including battery and thermal
6888information. It does not support ACPI suspending, only displays information
6889about ACPI devices.")
6890 (license license:gpl2+)))
6891
6892(define-public acpid
6893 (package
6894 (name "acpid")
6895 (version "2.0.34")
6896 (source (origin
6897 (method url-fetch)
6898 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
6899 version ".tar.xz"))
6900 (sha256
6901 (base32
6902 "0cxkdbd087kj9ikprvvjpk0ixzqbipf2rmj6qyp7r15wzj65q29d"))))
6903 (build-system gnu-build-system)
6904 (home-page "https://sourceforge.net/projects/acpid2/")
6905 (synopsis "Daemon for delivering ACPI events to user-space programs")
6906 (description
6907 "acpid is designed to notify user-space programs of Advanced
6908Configuration and Power Interface (ACPI) events. acpid should be started
6909during the system boot, and will run as a background process. When an ACPI
6910event is received from the kernel, acpid will examine the list of rules
6911specified in /etc/acpi/events and execute the rules that match the event.")
6912 (license license:gpl2+)))
6913
6914(define-public sysfsutils
6915 (package
6916 (name "sysfsutils")
6917 (version "2.1.0")
6918 (source
6919 (origin
6920 (method url-fetch)
6921 (uri
6922 (string-append
6923 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
6924 version ".tar.gz"))
6925 (sha256
6926 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
6927 (build-system gnu-build-system)
6928 (home-page "https://linux-diag.sourceforge.net/Sysfsutils.html")
6929 (synopsis "System utilities based on Linux sysfs")
6930 (description
6931 "These are a set of utilities built upon sysfs, a virtual file system in
6932Linux kernel versions 2.5+ that exposes a system's device tree. The package
6933also contains the libsysfs library.")
6934 ;; The library is under lgpl2.1+ (all files say "or any later version").
6935 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
6936 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
6937
6938(define-public cpufrequtils
6939 (let ((commit "a2f0c39d5f21596bb9f5223e895c0ff210b265d0")
6940 (revision "1"))
6941 (package
6942 (name "cpufrequtils")
6943 (version (git-version "008" revision commit))
6944 (source
6945 (origin
6946 (method git-fetch)
6947 (uri
6948 (git-reference
6949 (url "https://git.kernel.org/pub/scm/linux/kernel/git/brodo/cpufrequtils.git")
6950 (commit commit)))
6951 (file-name (git-file-name name version))
6952 (sha256
6953 (base32 "01n2hp6v89cilqqvqvlcprphyhnljsjclh4h1zf3b1l7ypz29lbp"))))
6954 (build-system gnu-build-system)
6955 (arguments
6956 (list
6957 #:tests? #f ;no test suite
6958 #:make-flags
6959 #~(let ((out #$output))
6960 (list "PROC=false" ;obsoleted by sysfs in Linux 2.6(!)
6961 (string-append "CC=" #$(cc-for-target))
6962 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
6963 "INSTALL=install"
6964 (string-append "bindir=" out "/bin")
6965 (string-append "sbindir=" out "/sbin")
6966 (string-append "mandir=" out "/share/man")
6967 (string-append "includedir=" out "/include")
6968 (string-append "libdir=" out "/lib")
6969 (string-append "localedir=" out "/share/locale")
6970 (string-append "docdir=" out "/share/doc/" #$name)))
6971 #:phases
6972 #~(modify-phases %standard-phases
6973 (delete 'configure)))) ;no configure script
6974 (native-inputs (list gettext-minimal))
6975 (home-page
6976 "http://ftp.be.debian.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html")
6977 (synopsis "Utilities to get and set CPU frequency on Linux")
6978 (description
6979 "The cpufrequtils suite contains utilities to retrieve CPU frequency
6980information, and set the CPU frequency if supported, using the cpufreq
6981capabilities of the Linux kernel.")
6982 (license license:gpl2))))
6983
6984(define-public libite
6985 (package
6986 (name "libite")
6987 (version "2.5.2")
6988 (source
6989 (origin
6990 (method git-fetch)
6991 (uri (git-reference
6992 (url "https://github.com/troglobit/libite")
6993 (commit (string-append "v" version))))
6994 (file-name (git-file-name name version))
6995 (sha256
6996 (base32 "0i27ppb557kdc1hm7nf0f5r7sxvqma31pr57h79whl6qcp28gy4a"))))
6997 (build-system gnu-build-system)
6998 (arguments
6999 `(#:configure-flags
7000 (list "--disable-static")
7001 #:phases
7002 (modify-phases %standard-phases
7003 (add-after 'unpack 'fix-tests
7004 (lambda* (#:key inputs #:allow-other-keys)
7005 ;; replace paths to the executables
7006 (substitute* "test/which.c"
7007 (("/usr/bin/which")
7008 (search-input-file inputs "/bin/which"))
7009 (("ls\"")
7010 (string-append
7011 (search-input-file inputs "/bin/ls") "\"")))
7012 ;; create pidfile in /tmp instead of /var
7013 (substitute* "test/pidfile.c" (("/var/tmp") "/tmp")))))))
7014 (native-inputs (list autoconf automake libtool which))
7015 (synopsis "Library providing missing pieces in GNU libc")
7016 (description "This package provides many of the missing pieces in GNU
7017libc. Most notably the string functions: strlcpy(3), strlcat(3) and the *BSD
7018sys/queue.h and sys/tree.h API's.")
7019 (home-page "https://troglobit.com/projects/libite/")
7020 (license license:expat)))
7021
7022(define-public libuev
7023 (package
7024 (name "libuev")
7025 (version "2.4.0")
7026 (source
7027 (origin
7028 (method git-fetch)
7029 (uri (git-reference
7030 (url "https://github.com/troglobit/libuev")
7031 (commit (string-append "v" version))))
7032 (file-name (git-file-name name version))
7033 (sha256
7034 (base32
7035 "0ih82lxfdcq179kknzdl5c8vi1l0n5j7yh68y8f6kwsrm457paf7"))))
7036 (build-system gnu-build-system)
7037 (native-inputs (list autoconf automake libtool))
7038 (synopsis "Lightweight event loop library for epoll family APIs")
7039 (description "This package provides small event loop that wraps the
7040epoll family of APIs.")
7041 (home-page "https://troglobit.com/projects/libuev/")
7042 (license license:expat)))
7043
7044(define-public libraw1394
7045 (package
7046 (name "libraw1394")
7047 (version "2.1.2")
7048 (source (origin
7049 (method url-fetch)
7050 (uri (string-append
7051 "mirror://kernel.org/linux/libs/ieee1394/"
7052 name "-" version ".tar.xz"))
7053 (sha256
7054 (base32
7055 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
7056 (build-system gnu-build-system)
7057 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
7058 (synopsis "Interface library for the Linux IEEE1394 drivers")
7059 (description
7060 "Libraw1394 is the only supported interface to the kernel side raw1394 of
7061the Linux IEEE-1394 subsystem, which provides direct access to the connected
70621394 buses to user space. Through libraw1394/raw1394, applications can directly
7063send to and receive from other nodes without requiring a kernel driver for the
7064protocol in question.")
7065 (license license:lgpl2.1+)))
7066
7067(define-public libavc1394
7068 (package
7069 (name "libavc1394")
7070 (version "0.5.4")
7071 (source (origin
7072 (method url-fetch)
7073 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
7074 name "-" version ".tar.gz"))
7075 (sha256
7076 (base32
7077 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
7078 (build-system gnu-build-system)
7079 (native-inputs
7080 (list pkg-config))
7081 (propagated-inputs
7082 (list libraw1394)) ; required by libavc1394.pc
7083 (home-page "https://sourceforge.net/projects/libavc1394/")
7084 (synopsis "AV/C protocol library for IEEE 1394")
7085 (description
7086 "Libavc1394 is a programming interface to the AV/C specification from
7087the 1394 Trade Association. AV/C stands for Audio/Video Control.")
7088 (license license:lgpl2.1+)))
7089
7090(define-public libiec61883
7091 (package
7092 (name "libiec61883")
7093 (version "1.2.0")
7094 (source (origin
7095 (method url-fetch)
7096 (uri (string-append
7097 "mirror://kernel.org/linux/libs/ieee1394/"
7098 name "-" version ".tar.xz"))
7099 (sha256
7100 (base32
7101 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
7102 (build-system gnu-build-system)
7103 (native-inputs
7104 (list pkg-config))
7105 (propagated-inputs
7106 (list libraw1394)) ; required by libiec61883.pc
7107 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
7108 (synopsis "Isochronous streaming media library for IEEE 1394")
7109 (description
7110 "The libiec61883 library provides a higher level API for streaming DV,
7111MPEG-2 and audio over Linux IEEE 1394.")
7112 (license license:lgpl2.1+)))
7113
7114(define-public mdadm
7115 (package
7116 (name "mdadm")
7117 (version "4.2")
7118 (source (origin
7119 (method url-fetch)
7120 (uri (string-append
7121 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
7122 version ".tar.xz"))
7123 (sha256
7124 (base32
7125 "07ghmibmbnkdy91ng87zdllzicm299l20dhs9m5bfjw6f1b22726"))))
7126 (build-system gnu-build-system)
7127 (arguments
7128 (list #:make-flags
7129 #~(list (string-append "CC=" #$(cc-for-target))
7130 "INSTALL=install"
7131 "CHECK_RUN_DIR=0"
7132 ;; TODO: tell it where to find 'sendmail'
7133 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
7134 (string-append "BINDIR=" #$output "/sbin")
7135 (string-append "MANDIR=" #$output "/share/man")
7136 (string-append "UDEVDIR=" #$output "/lib/udev"))
7137 #:phases
7138 #~(modify-phases %standard-phases
7139 (add-before 'build 'patch-program-paths
7140 (lambda* (#:key native-inputs inputs #:allow-other-keys)
7141 (let ((coreutils (assoc-ref (or native-inputs inputs)
7142 "coreutils")))
7143 (substitute* "udev-md-raid-arrays.rules"
7144 (("/usr/bin/(readlink|basename)" all program)
7145 (string-append coreutils "/bin/" program))))))
7146 (add-before 'build 'remove-W-error
7147 (lambda _
7148 ;; We cannot build with -Werror on i686 due to a
7149 ;; 'sign-compare' warning in util.c.
7150 (substitute* "Makefile"
7151 (("-Werror") ""))))
7152 (delete 'configure))
7153 ;; Tests must be run as root.
7154 #:tests? #f))
7155 (inputs
7156 (list eudev))
7157 (supported-systems (remove target-hurd? %supported-systems))
7158 (home-page "http://neil.brown.name/blog/mdadm")
7159 (synopsis "Tool for managing Linux Software RAID arrays")
7160 (description
7161 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
7162assemble, report on, and monitor arrays. It can also move spares between raid
7163arrays when needed.")
7164 (license license:gpl2+)))
7165
7166(define-public mdadm-static
7167 (package
7168 (inherit mdadm)
7169 (name "mdadm-static")
7170 (arguments
7171 (substitute-keyword-arguments arguments
7172 ((#:make-flags flags)
7173 #~(cons* "LDFLAGS = -static"
7174 "CXFLAGS = -DNO_LIBUDEV"
7175 #$flags))
7176 ((#:phases phases)
7177 #~(modify-phases #$phases
7178 (add-after 'install 'remove-cruft
7179 (lambda* (#:key outputs #:allow-other-keys)
7180 (let* ((out (assoc-ref outputs "out"))
7181 (precious? (lambda (file)
7182 (member file '("." ".." "sbin"))))
7183 (directories (scandir out (negate precious?))))
7184 (with-directory-excursion out
7185 (for-each delete-file-recursively directories)
7186 (remove-store-references "sbin/mdadm")
7187 (delete-file "sbin/mdmon")))))))
7188 ((#:modules modules %default-gnu-modules)
7189 `((ice-9 ftw) ,@modules))
7190 ((#:strip-flags _ '())
7191 ''("--strip-all")) ;strip a few extra KiB
7192 ((#:allowed-references _ '("out"))
7193 '("out")))) ;refer only self
7194 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
7195
7196(define-public multipath-tools
7197 (package
7198 (name "multipath-tools")
7199 (version "0.11.0")
7200 (home-page "https://github.com/opensvc/multipath-tools")
7201 (source (origin
7202 (method git-fetch)
7203 (uri (git-reference (url home-page) (commit version)))
7204 (file-name (git-file-name name version))
7205 (sha256
7206 (base32
7207 "1yl2cd4xgw2l5xzx5dbdf7awhrvfbjsrspli9i6bmxc5j4jkvazr"))
7208 (modules '((guix build utils)))
7209 (snippet
7210 '(begin
7211 ;; Drop bundled valgrind headers.
7212 (delete-file-recursively "third-party")
7213 (substitute* '("multipathd/main.c"
7214 "libmpathutil/debug.c")
7215 (("#include \"../third-party/")
7216 "#include \""))))))
7217 (build-system gnu-build-system)
7218 (arguments
7219 (list
7220 #:test-target "test"
7221 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
7222 (string-append "prefix=" #$output)
7223 ;; Install Udev rules below this directory, relative
7224 ;; to the prefix.
7225 (string-append "systemd_prefix=" #$output))
7226 #:phases
7227 #~(modify-phases %standard-phases
7228 (add-after 'unpack 'patch-source
7229 (lambda* (#:key inputs #:allow-other-keys)
7230 (let ((libdevmapper.h
7231 (search-input-file inputs "include/libdevmapper.h"))
7232 (libudev.h
7233 (search-input-file inputs "include/libudev.h")))
7234 (substitute* "Makefile.inc"
7235 (("/bin/echo") "echo")
7236 (("\\$\\(prefix\\)/usr") "$(prefix)")
7237 (("configdir.*:= \\$\\(prefix\\)/etc/multipath/conf.d")
7238 "configdir := /etc/multipath/conf.d")
7239 ;; Do not save timestamp to avoid gzip "timestamp
7240 ;; out-of-range" warnings.
7241 (("gzip -9") "gzip -9n"))
7242 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
7243 (("/usr/include/libdevmapper.h") libdevmapper.h)
7244 (("/usr/include/libudev.h") libudev.h)))))
7245 (add-after 'unpack 'skip-failing-tests
7246 (lambda _
7247 ;; This test and the module's setup() test an arbitrary block
7248 ;; device node name, but the build environment has none.
7249 (substitute* "tests/devt.c"
7250 (("return get_one_devt.*") "return 0;\n")
7251 (("cmocka_unit_test\\(test_devt2devname_devt_good\\),") ""))
7252 ;; The above triggers -Werror=unused-function. Ignore it.
7253 (substitute* "tests/Makefile"
7254 (("CFLAGS \\+= " match)
7255 (string-append match "-Wno-error=unused-function ")))))
7256 (delete 'configure) ;no configure script
7257 (add-before 'build 'no-fortify-3
7258 (lambda _
7259 ;; NOTE: The check made seems to wrongly assume the
7260 ;; FORTIFY_SOURCE=3 is valid. However, when compiling, warnings
7261 ;; are emitted from glibc, resulting in failed build. Fix this
7262 ;; by forcing the usage of FORTIFY_SOURCE=2.
7263 (substitute* "create-config.mk"
7264 (("FORTIFY_SOURCE=3")
7265 "FORTIFY_SOURCE=2"))))
7266 (add-before 'build 'set-LDFLAGS
7267 (lambda _
7268 ;; Note: this cannot be passed as a make flag because that will
7269 ;; override the build system LDFLAGS.
7270 (setenv "LDFLAGS"
7271 (string-append "-Wl,-rpath=" #$output "/lib")))))))
7272
7273 (native-inputs
7274 (list perl pkg-config valgrind/pinned
7275 ;; For tests.
7276 cmocka))
7277 (inputs
7278 (list json-c
7279 libaio
7280 liburcu
7281 lvm2
7282 readline
7283 eudev
7284 ;; For libmount.
7285 `(,util-linux "lib")))
7286 (synopsis "Access block devices through multiple paths")
7287 (description
7288 "This package provides the following binaries to drive the
7289Linux Device Mapper multipathing driver:
7290@enumerate
7291@item @command{multipath} - Device mapper target autoconfig.
7292@item @command{multipathd} - Multipath daemon.
7293@item @command{mpathpersist} - Manages SCSI persistent reservations on
7294@code{dm} multipath devices.
7295@item @command{kpartx} - Create device maps from partition tables.
7296@end enumerate")
7297 (license (list license:gpl2+ ;main distribution
7298 license:lgpl2.0+)))) ;libmpathcmd/mpath_cmd.h
7299
7300(define-public libaio
7301 (package
7302 (name "libaio")
7303 (version "0.3.113")
7304 (source (origin
7305 (method url-fetch)
7306 (uri (list
7307 (string-append "https://releases.pagure.org/libaio/"
7308 name "-" version ".tar.gz")))
7309 (sha256
7310 (base32
7311 "02r0g2vfv6kfljplm3ga93w4xw13q2wixbn9hwi7ahqdzp2x2i1c"))
7312 (patches (search-patches "libaio-32bit-test.patch"))))
7313 (build-system gnu-build-system)
7314 (arguments
7315 (list #:make-flags
7316 #~(list (string-append "prefix=" #$output)
7317 (string-append "CC=" #$(cc-for-target)))
7318 #:test-target "partcheck" ; need root for a full 'check'
7319 #:phases
7320 #~(modify-phases %standard-phases
7321 (add-after 'unpack 'disable-problematic-tests
7322 (lambda _
7323 (with-directory-excursion "harness/cases"
7324 ;; The 21.t test fails with "Expected 4096, got
7325 ;; 18446744073709551605" (see:
7326 ;; https://pagure.io/libaio/issue/26).
7327 (rename-file "21.t" "21.t.disabled"))))
7328 (delete 'configure) ; no configure script
7329 #$@(if (target-riscv64?)
7330 #~((add-after 'unpack 'patch-test
7331 (lambda* (#:key build-inputs #:allow-other-keys)
7332 (invoke "patch" "-p1" "-i"
7333 #$(local-file
7334 (search-patch
7335 "libaio-riscv-test5.patch"))))))
7336 #~()))))
7337 (native-inputs
7338 (if (target-riscv64?)
7339 (list (search-patch "libaio-riscv-test5.patch")
7340 patch)
7341 '()))
7342 (home-page "https://pagure.io/libaio")
7343 (synopsis "Linux-native asynchronous I/O access library")
7344 (description
7345 "This library enables userspace to use Linux kernel asynchronous I/O
7346system calls, important for the performance of databases and other advanced
7347applications.")
7348 (license license:lgpl2.1+)))
7349
7350(define-public blktrace
7351 ;; Take a newer commit to get the latest patches.
7352 (let ((commit "b9ea6e507e8849f01d06aa48c0c59c5cee4820be")
7353 (revision "1"))
7354 (package
7355 (name "blktrace")
7356 (version (git-version "1.3.0" revision commit))
7357 (home-page
7358 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
7359 (source (origin
7360 (method git-fetch)
7361 (uri (git-reference
7362 (url home-page)
7363 (commit commit)))
7364 (sha256
7365 (base32 "0a4830mlqckbhchar1xcn2w4f24bzb75bigdig5wpm2axl0zc8cq"))
7366 (file-name (git-file-name name version))))
7367 (build-system gnu-build-system)
7368 (arguments
7369 (list
7370 #:make-flags
7371 #~(list (string-append "CC=" #$(cc-for-target))
7372 (string-append "prefix=" #$output))
7373 #:tests? #f ; no tests
7374 #:phases
7375 #~(modify-phases %standard-phases
7376 (delete 'configure) ; no configure script
7377 (add-after 'unpack 'fix-gnuplot-path
7378 (lambda* (#:key inputs #:allow-other-keys)
7379 (substitute* "btt/bno_plot.py"
7380 (("gnuplot %s")
7381 (string-append
7382 (search-input-file inputs "/bin/gnuplot" ) " %s"))))))))
7383 (inputs
7384 (list libaio
7385 gnuplot
7386 python-wrapper)) ; for 'bno_plot.py'
7387 (synopsis "Block layer IO tracing mechanism")
7388 (description "Blktrace is a block layer IO tracing mechanism which provides
7389detailed information about request queue operations to user space. It extracts
7390event traces from the kernel (via the relaying through the debug file system).")
7391 (license license:gpl2))))
7392
7393(define-public sbc
7394 (package
7395 (name "sbc")
7396 (version "2.2")
7397 (source
7398 (origin
7399 (method url-fetch)
7400 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-" version
7401 ".tar.xz"))
7402 (sha256
7403 (base32 "17mfhc9rn25vrqgfpihpjjc8syp3r56paqyhzg1gjnjyydpagbd1"))))
7404 (build-system gnu-build-system)
7405 (arguments
7406 (list
7407 #:configure-flags
7408 #~(list "--disable-tester")))
7409 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
7410 (synopsis "Bluetooth subband audio codec")
7411 (description
7412 "The SBC is a digital audio encoder and decoder used to transfer data to
7413Bluetooth audio output devices like headphones or loudspeakers.")
7414 (license license:gpl2+)))
7415
7416(define-public sbctester
7417 (package
7418 (inherit sbc)
7419 (name "sbctester")
7420 (arguments
7421 (list
7422 #:phases
7423 #~(modify-phases %standard-phases
7424 (add-after 'unpack 'write-build-files
7425 (lambda _
7426 (begin
7427 (for-each delete-file
7428 (list "Makefile.in" "aclocal.m4" "configure"
7429 "config.h.in"))
7430 (delete-file-recursively "build-aux")
7431 (with-output-to-file "configure.ac"
7432 (lambda _
7433 (format #t
7434 "AC_PREREQ([2.69])
7435 AC_INIT([sbctester], [~a])
7436 AC_CONFIG_HEADERS(config.h)
7437 AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
7438 COMPILER_FLAGS
7439 AC_LANG([C])
7440 AC_PROG_CC
7441 AC_PROG_CC_PIE
7442 AC_PROG_INSTALL
7443 AC_PROG_LIBTOOL
7444 PKG_CHECK_MODULES(SNDFILE, sndfile, dummy=yes,
7445 AC_MSG_ERROR(sndfile library is required))
7446 AC_SUBST(SNDFILE_LIBS)
7447 AC_CONFIG_FILES([Makefile])
7448 AC_OUTPUT
7449 AC_MSG_RESULT([$PACKAGE_NAME $VERSION])
7450 ~%"
7451 #$(package-version sbc))))
7452 (with-output-to-file "Makefile.am"
7453 (lambda _
7454 (format #t
7455 "bin_PROGRAMS = src/sbctester
7456 src_sbctester_SOURCES = src/sbctester.c
7457 src_sbctester_LDADD = @SNDFILE_LIBS@ -lm")))))))))
7458 (inputs (list libsndfile))
7459 (native-inputs (list autoconf automake libtool pkg-config))
7460 (synopsis "Test utility for the sbc codec")
7461 (description
7462 "Utility to detect differences between two audio files, encoded with
7463SBC.")))
7464
7465(define-public bluez
7466 (package
7467 (name "bluez")
7468 (version "5.79")
7469 (source (origin
7470 (method url-fetch)
7471 (uri (string-append
7472 "mirror://kernel.org/linux/bluetooth/bluez-"
7473 version ".tar.xz"))
7474 (sha256
7475 (base32
7476 "12pal1m4xlr8k7kxb6isv5lbaca2wc5zcgy0907wfwcz78qaar21"))))
7477 (build-system gnu-build-system)
7478 (arguments
7479 (list
7480 #:configure-flags
7481 #~(list "--sysconfdir=/etc"
7482 "--localstatedir=/var"
7483 "--enable-library"
7484 "--enable-wiimote"
7485 "--disable-systemd"
7486 ;; TODO: is this needed? Not installed by default since 5.55.
7487 "--enable-hid2hci"
7488 ;; Install dbus/udev files to the correct location.
7489 (string-append "--with-dbusconfdir=" #$output "/etc")
7490 (string-append "--with-udevdir=" #$output "/lib/udev"))
7491 #:phases
7492 #~(modify-phases %standard-phases
7493 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
7494 ;; issue (discussion on upstream mailing list:
7495 ;; https://marc.info/?t=149578476300002&r=1&w=2)
7496 (add-before 'check 'skip-wonky-test
7497 (lambda _
7498 (substitute* "unit/test-gatt.c"
7499 (("tester_init\\(&argc, &argv\\);") "return 77;"))))
7500 (replace 'install
7501 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
7502 ;; Override the sysconfdir and localstatedir locations only for
7503 ;; the installation phase. Otherwise, the installation fails when
7504 ;; it tries to write to /etc/bluetooth and /var.
7505 (define make-flags*
7506 (append make-flags (list (string-append "sysconfdir="
7507 #$output "/etc")
7508 (string-append "localstatedir="
7509 #$output "/var"))))
7510 (apply (assoc-ref %standard-phases 'install)
7511 (append args (list #:make-flags make-flags*)))))
7512 (add-after 'install 'post-install
7513 (lambda* (#:key inputs outputs #:allow-other-keys)
7514 (let* ((servicedir (string-append #$output
7515 "/share/dbus-1/services"))
7516 (service "obexd/src/org.bluez.obex.service")
7517 (rule (string-append
7518 #$output "/lib/udev/rules.d/97-hid2hci.rules")))
7519 ;; Install the obex dbus service file.
7520 (substitute* service
7521 (("/bin/false")
7522 (string-append #$output "/libexec/bluetooth/obexd")))
7523 (install-file service servicedir)
7524 ;; Fix paths in the udev rule.
7525 (substitute* rule
7526 (("hid2hci --method")
7527 (string-append #$output "/lib/udev/hid2hci --method"))
7528 (("/sbin/udevadm")
7529 (search-input-file inputs "/bin/udevadm")))))))))
7530 (native-inputs
7531 (list gettext-minimal
7532 pkg-config
7533 python
7534 python-docutils
7535 python-pygments))
7536 (inputs
7537 (list glib dbus eudev libical readline))
7538 (home-page "https://www.bluez.org/")
7539 (synopsis "Linux Bluetooth protocol stack")
7540 (description
7541 "BlueZ provides support for the core Bluetooth layers and protocols. It
7542is flexible, efficient and uses a modular implementation.")
7543 (license license:gpl2+)))
7544
7545(define-public fuse-exfat
7546 (package
7547 (name "fuse-exfat")
7548 (version "1.4.0")
7549 (source (origin
7550 (method url-fetch)
7551 (uri (string-append
7552 "https://github.com/relan/exfat/releases/download/v"
7553 version "/" name "-" version ".tar.gz"))
7554 (sha256
7555 (base32
7556 "07h0ngnydfy8n8h9ni3jn8zlmcj4pzqa0nk0hk0i4yhfbv2yvkx1"))))
7557 (build-system gnu-build-system)
7558 (native-inputs
7559 (list pkg-config))
7560 (inputs
7561 (list fuse-2))
7562 (home-page "https://github.com/relan/exfat")
7563 (synopsis "Mount exFAT file systems")
7564 (description
7565 "This package provides a FUSE-based file system that provides read and
7566write access to exFAT devices.")
7567 (license license:gpl2+)))
7568
7569(define-public gpm
7570 (package
7571 (name "gpm")
7572 (version "1.20.7")
7573 (source (origin
7574 (method url-fetch)
7575 (uri (string-append
7576 "https://www.nico.schottelius.org/software/gpm/archives/"
7577 "gpm-" version ".tar.bz2"))
7578 (patches (search-patches "gpm-glibc-2.26.patch"))
7579 (sha256
7580 (base32
7581 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))
7582 (modules '((guix build utils)))
7583 (snippet
7584 '(begin
7585 ;; Take a patch from upstream to fix building with -fno-common,
7586 ;; which is default in GCC 10:
7587 ;; https://github.com/telmich/gpm/pull/37
7588 (substitute* "src/headers/daemon.h"
7589 (("^time_t[[:blank:]]+last_selection_time;")
7590 "extern time_t last_selection_time;"))))))
7591 (build-system gnu-build-system)
7592 (arguments
7593 '(#:phases (modify-phases %standard-phases
7594 (replace 'bootstrap
7595 (lambda _
7596 ;; The tarball was not generated with 'make dist' so we
7597 ;; need to bootstrap things ourselves.
7598 (substitute* "autogen.sh"
7599 (("/bin/sh") (which "sh")))
7600 (invoke "./autogen.sh")
7601 (patch-makefile-SHELL "Makefile.include.in")
7602 #t)))
7603
7604 ;; Make sure programs find libgpm.so.
7605 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
7606 (assoc-ref %outputs "out")
7607 "/lib"))))
7608 (native-inputs
7609 (list texinfo
7610 bison
7611 flex
7612 autoconf
7613 automake
7614 libtool))
7615 (supported-systems (remove target-hurd? %supported-systems))
7616 (home-page "https://www.nico.schottelius.org/software/gpm/")
7617 (synopsis "Mouse support for the Linux console")
7618 (description
7619 "The GPM (general-purpose mouse) daemon is a mouse server for
7620applications running on the Linux console. It allows users to select items
7621and copy/paste text in the console and in xterm.")
7622 (license license:gpl2+)))
7623
7624(define-public gamemode
7625 (package
7626 (name "gamemode")
7627 (version "1.8.2")
7628 (source (origin
7629 (method git-fetch)
7630 (uri (git-reference
7631 (url "https://github.com/FeralInteractive/gamemode")
7632 (commit version)))
7633 (file-name (git-file-name name version))
7634 (sha256
7635 (base32 "14i3y385jzpr30lxk38z84rq76sy4cz0pwm54rm62f4mnk0xwjjp"))))
7636 (build-system meson-build-system)
7637 (arguments
7638 (list
7639 #:configure-flags
7640 #~(list
7641 ;; Don't build sample programs.
7642 "-Dwith-examples=false"
7643 ;; Build gamemoderun and other utilities.
7644 "-Dwith-util=true"
7645 ;; Use elogind instead of systemd for sd-bus.
7646 "-Dwith-sd-bus-provider=elogind"
7647 ;; Install PAM limits.d config to the package prefix; a Guix
7648 ;; service can then install it to /etc/security/limits.d/.
7649 (string-append "-Dwith-pam-limits-dir=" #$output
7650 "/etc/security/limits.d")
7651 ;; Guix does not use systemd.
7652 "-Dwith-systemd-user-unit=false"
7653 "-Dwith-systemd-group=false")
7654 #:phases
7655 #~(modify-phases %standard-phases
7656 (add-after 'unpack 'patch-references
7657 (lambda _
7658 (substitute* '("lib/gamemode_client.h"
7659 "data/gamemoderun")
7660 (("libgamemode(auto)?\\.so\\.0" lib)
7661 (string-append #$output "/lib/" lib))))))))
7662 (native-inputs
7663 (list pkg-config))
7664 (inputs
7665 (list
7666 dbus
7667 elogind
7668 libinih))
7669 (synopsis "Optimise Linux system performance on demand")
7670 (description "GameMode is a daemon and library for Linux that allows games to
7671request a set of optimisations be temporarily applied to the host OS and/or a
7672game process. GameMode was designed primarily as a stop-gap solution to problems
7673with the Intel and AMD CPU powersave or ondemand governors, but is now host to a
7674range of optimisation features and configurations, including CPU governor, I/O
7675priority, process niceness, kernel scheduler, screensaver inhibiting, GPU
7676performance mode, and custom scripts.")
7677 (home-page "https://github.com/FeralInteractive/gamemode")
7678 (license license:bsd-3)))
7679
7680(define-public btrfs-progs
7681 (package
7682 (name "btrfs-progs")
7683 (version "7.0")
7684 (source (origin
7685 (method url-fetch)
7686 (uri (string-append "mirror://kernel.org/linux/kernel/"
7687 "people/kdave/btrfs-progs/" "btrfs-progs-v"
7688 version ".tar.xz"))
7689 (sha256
7690 (base32
7691 "16cs5n1hm06ppkylkd9p7v13wdc0sb7y85xll0kj7mxwdj3xd1n2"))))
7692 (build-system gnu-build-system)
7693 (outputs '("out" "static")) ;static versions of the binaries in "out"
7694 (arguments
7695 (list
7696 #:configure-flags
7697 #~(list
7698 ;; Without --disable-documentation, it complains about missing
7699 ;; python-sphinx on systems where this package isn't available
7700 ;; (because it requires Rust).
7701 #$@(if (member (%current-system)
7702 (package-transitive-supported-systems
7703 python-sphinx))
7704 '()
7705 '("--disable-documentation"))
7706 ;; The ‘Python support’ was never actually installed by previous
7707 ;; versions of this package, but did prevent cross-compilation.
7708 "--disable-python")
7709 #:phases #~(modify-phases %standard-phases
7710 (add-after 'unpack 'patch-makefile
7711 (lambda* (#:key outputs #:allow-other-keys)
7712 (substitute* "Makefile"
7713 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
7714 (string-append (assoc-ref outputs "out")
7715 "/lib/udev/rules.d")))))
7716 (add-after 'build 'build-static
7717 (lambda _
7718 (invoke "make" "static")))
7719 (add-after 'install 'install-bash-completion
7720 (lambda* (#:key outputs #:allow-other-keys)
7721 (let* ((out (assoc-ref outputs "out"))
7722 (bashcomp (string-append out
7723 "/etc/bash_completion.d")))
7724 (mkdir-p bashcomp)
7725 (copy-file "btrfs-completion"
7726 (string-append bashcomp "/btrfs")))))
7727 (add-after 'install 'install-static
7728 (let ((staticbin (string-append (assoc-ref %outputs
7729 "static")
7730 "/bin")))
7731 (lambda _
7732 (invoke "make"
7733 (string-append "bindir=" staticbin)
7734 "install-static")))))
7735 #:tests? #f ;XXX: require the 'btrfs' kernel module.
7736 #:test-target "test"
7737 #:parallel-tests? #f)) ;tests fail when run in parallel
7738 (inputs (list e2fsprogs ;for btrfs-convert
7739 eudev
7740 lzo
7741 `(,util-linux "lib") ;for libblkid and libuuid
7742 `(,util-linux "static") ;ditto
7743 zlib
7744 `(,zlib "static")
7745 `(,zstd "lib")
7746 `(,zstd "static")))
7747 (native-inputs
7748 (append
7749 ;; For building documentation. Since python-sphinx requires Rust, add
7750 ;; it conditionally depending on such support.
7751 (if (supported-package? python-sphinx)
7752 (list python-wrapper python-sphinx python-sphinx-rtd-theme)
7753 '())
7754 (list pkg-config
7755 acl ;for tests
7756 lvm2 ;for dmsetup
7757 grep ;need Perl regexp support
7758 libaio
7759 liburing
7760 util-linux ;for fallocate
7761 which)))
7762 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
7763 (synopsis "Create and manage btrfs copy-on-write file systems")
7764 (description
7765 "Btrfs is a @acronym{CoW, copy-on-write} file system for Linux
7766aimed at implementing advanced features while focusing on fault tolerance,
7767repair and easy administration.")
7768 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
7769 ;; GPL2: Everything else.
7770 (license (list license:gpl2 license:gpl2+))))
7771
7772(define-public btrfs-progs/static
7773 (package
7774 (name "btrfs-progs-static")
7775 (version (package-version btrfs-progs))
7776 (source #f)
7777 (build-system trivial-build-system)
7778 (inputs
7779 `(("btrfs-progs:static" ,btrfs-progs "static")))
7780 (arguments
7781 `(#:modules ((guix build utils))
7782 #:builder
7783 (begin
7784 (use-modules (guix build utils)
7785 (ice-9 ftw)
7786 (srfi srfi-26))
7787
7788 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
7789 (out (assoc-ref %outputs "out"))
7790 (source (string-append btrfs "/bin/btrfs.static"))
7791 (target (string-append out "/bin/btrfs")))
7792 (mkdir-p (dirname target))
7793 (copy-file source target)
7794 (remove-store-references target)
7795 (chmod target #o555)
7796 #t))))
7797 (home-page (package-home-page btrfs-progs))
7798 (synopsis "Statically-linked btrfs command from btrfs-progs")
7799 (description "This package provides the statically-linked @command{btrfs}
7800from the btrfs-progs package. It is meant to be used in initrds.")
7801 (license (package-license btrfs-progs))))
7802
7803(define-public cramfs-tools
7804 (package
7805 (name "cramfs-tools")
7806 (home-page "https://github.com/npitre/cramfs-tools")
7807 (version "2.2")
7808 (source (origin
7809 (method git-fetch)
7810 (uri (git-reference
7811 (url home-page)
7812 (commit (string-append "v" version))))
7813 (sha256
7814 (base32 "1rx63qx2sdpzrgcmp7cskin670rnlp45jn90wxqgnqxvc5vr9l5k"))
7815 (file-name (git-file-name name version))))
7816 (build-system gnu-build-system)
7817 (arguments
7818 (list #:tests? #f ; No tests.
7819 #:phases
7820 #~(modify-phases %standard-phases
7821 (delete 'configure)
7822 (replace 'install
7823 (lambda _
7824 (let ((sbin (string-append #$output "/sbin")))
7825 (install-file "mkcramfs" sbin)
7826 (install-file "cramfsck" sbin)))))))
7827 (inputs
7828 (list zlib))
7829 (synopsis "Tools to manage Cramfs file systems")
7830 (description "Cramfs is a Linux file system designed to be simple, small,
7831and to compress things well. It is used on a number of embedded systems and
7832small devices. This version has additional features such as uncompressed
7833blocks and random block placement.")
7834 (license license:gpl2+)))
7835
7836(define-public compsize
7837 (let ((commit "d79eacf77abe3b799387bb8a4e07a18f1f1031e8")
7838 (revision "0"))
7839 (package
7840 (name "compsize")
7841 (version (git-version "1.5" revision commit))
7842 (home-page "https://github.com/kilobyte/compsize")
7843 (source (origin
7844 (method git-fetch)
7845 (uri (git-reference
7846 (url home-page)
7847 (commit commit)))
7848 (sha256
7849 (base32 "02fvgy12m50rg1snp555a1kc3cm01g2imb81cih7ikhkbjbca0d7"))
7850 (file-name (git-file-name name version))
7851 (patches
7852 (search-patches "compsize-fix-btrfs-progs-compatibility.patch"))))
7853 (build-system gnu-build-system)
7854 (inputs
7855 (list btrfs-progs))
7856 (arguments
7857 `(#:tests? #f ; No tests.
7858 #:make-flags
7859 (list (string-append "CC=" ,(cc-for-target)))
7860 #:phases
7861 (modify-phases %standard-phases
7862 (delete 'configure)
7863 (replace 'install
7864 (lambda* (#:key outputs #:allow-other-keys)
7865 (let ((out (assoc-ref outputs "out")))
7866 (install-file "compsize" (string-append out "/bin"))
7867 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
7868 (synopsis "Find compression type/ratio on Btrfs files")
7869 (description "@command{compsize} takes a list of files (given as
7870arguments) on a Btrfs file system and measures used compression types and
7871effective compression ratio, producing a report.
7872
7873A directory has no extents but has a (recursive) list of files. A non-regular
7874file is silently ignored.
7875
7876As it makes no sense to talk about compression ratio of a partial extent,
7877every referenced extent is counted whole, exactly once -- no matter if you use
7878only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
7879uncompressed size will not match the number given by @command{tar} or
7880@command{du}. On the other hand, the space used should be accurate (although
7881obviously it can be shared with files outside our set).")
7882 (license license:gpl2+))))
7883
7884(define-public f2fs-tools
7885 (package
7886 (name "f2fs-tools")
7887 (version "1.16.0")
7888 (source (origin
7889 (method git-fetch)
7890 (uri (git-reference
7891 (url "https://git.kernel.org/pub/scm/linux/kernel\
7892/git/jaegeuk/f2fs-tools.git")
7893 (commit (string-append "v" version))))
7894 (file-name (git-file-name name version))
7895 (sha256
7896 (base32
7897 "0832ix3jnmfagx53wr6clc3q4ay7cbashfj7jirk01gyzwbvblfc"))))
7898 (build-system gnu-build-system)
7899 (native-inputs
7900 (list autoconf automake libtool pkg-config))
7901 (inputs
7902 (list `(,util-linux "lib"))) ;for libuuid
7903 (home-page "https://f2fs.wiki.kernel.org/")
7904 (synopsis "Userland tools for f2fs")
7905 (description
7906 "F2FS, the Flash-Friendly File System, is a modern file system
7907designed to be fast and durable on flash devices such as solid-state
7908disks and SD cards. This package provides the userland utilities.")
7909 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
7910 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
7911 (license (list license:gpl2 license:lgpl2.1))))
7912
7913(define-public f2fs-tools-1.7
7914 (package
7915 (inherit f2fs-tools)
7916 (name "f2fs-tools")
7917 (version "1.7.0")
7918 (source (origin
7919 (method git-fetch)
7920 (uri (git-reference
7921 (url (git-reference-url
7922 (origin-uri (package-source f2fs-tools))))
7923 (commit (string-append "v" version))))
7924 (file-name (git-file-name name version))
7925 (sha256
7926 (base32
7927 "0wpzklw8smnngng0dm25jdmi7v5zfhpz02dksyxpz0a7kzzvnqqm"))))
7928 (inputs
7929 (list `(,util-linux "lib") libselinux))
7930 (arguments
7931 '(#:configure-flags '("CFLAGS=-fcommon")
7932 #:phases
7933 (modify-phases %standard-phases
7934 (add-after 'install 'install-headers
7935 (lambda* (#:key outputs #:allow-other-keys)
7936 (let* ((out (assoc-ref outputs "out"))
7937 (out-include (string-append out "/include")))
7938 (install-file "include/f2fs_fs.h" out-include)
7939 (install-file "mkfs/f2fs_format_utils.h" out-include)))))))))
7940
7941(define-public f2fs-tools/static
7942 (static-package
7943 (package
7944 (inherit f2fs-tools)
7945 (name "f2fs-tools-static")
7946 (arguments
7947 `(#:configure-flags
7948 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
7949 (libuuid (assoc-ref %build-inputs "libuuid")))
7950 (list
7951 (string-append "libuuid_CFLAGS=-I" libuuid "/include/uuid")
7952 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
7953 (string-append "libblkid_CFLAGS=-I" libuuid "/include/uuid "
7954 "-I" libuuid "/include/blkid")
7955 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
7956 #:disallowed-references (,(this-package-input "libuuid"))
7957 #:make-flags '("LDFLAGS=-all-static")
7958 #:phases
7959 (modify-phases %standard-phases ; TODO: f2fs phases.
7960 (add-after 'install 'remove-store-references
7961 (lambda* (#:key outputs #:allow-other-keys)
7962 ;; Work around bug in our util-linux.
7963 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
7964 (remove-store-references (string-append (assoc-ref outputs "out")
7965 "/sbin/mkfs.f2fs"))
7966 #t)))))
7967 (inputs
7968 `(("libuuid:static" ,util-linux "static")
7969 ("libuuid" ,util-linux "lib")))))) ; for include files
7970
7971(define-public f2fs-fsck/static
7972 (package
7973 (name "f2fs-fsck-static")
7974 (version (package-version f2fs-tools/static))
7975 (source #f)
7976 (build-system trivial-build-system)
7977 (arguments
7978 `(#:modules ((guix build utils))
7979 #:builder
7980 (begin
7981 (use-modules (guix build utils)
7982 (ice-9 ftw)
7983 (srfi srfi-26))
7984 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
7985 (fsck "fsck.f2fs")
7986 (out (assoc-ref %outputs "out"))
7987 (sbin (string-append out "/sbin")))
7988 (mkdir-p sbin)
7989 (with-directory-excursion sbin
7990 (install-file (string-append f2fs-tools "/sbin/" fsck)
7991 ".")
7992 (remove-store-references fsck)
7993 (chmod fsck #o555))
7994 #t))))
7995 (inputs
7996 (list f2fs-tools/static))
7997 (home-page (package-home-page f2fs-tools/static))
7998 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
7999 (description "This package provides statically-linked fsck.f2fs command taken
8000from the f2fs-tools package. It is meant to be used in initrds.")
8001 (license (package-license f2fs-tools/static))))
8002
8003(define-public freefall
8004 (package
8005 (name "freefall")
8006 (version (package-version linux-libre))
8007 (source (package-source linux-libre))
8008 (build-system gnu-build-system)
8009 (arguments
8010 '(#:phases (modify-phases %standard-phases
8011 (add-after 'unpack 'enter-subdirectory
8012 (lambda _
8013 (chdir "tools/laptop/freefall")
8014 #t))
8015 (delete 'configure)
8016 (add-before 'build 'increase-timeout
8017 (lambda _
8018 ;; The default of 2 seconds is too low: it assumes an
8019 ;; open lid and AC power without actually checking.
8020 (substitute* "freefall.c"
8021 (("alarm\\(2\\)") "alarm(5)"))
8022 #t)))
8023 #:make-flags (list (string-append "PREFIX="
8024 (assoc-ref %outputs "out"))
8025 "CC=gcc")
8026 #:tests? #f)) ;no tests
8027 (home-page (package-home-page linux-libre))
8028 (synopsis "Free-fall protection for spinning laptop hard drives")
8029 (description
8030 "Prevents shock damage to the internal spinning hard drive(s) of some
8031HP and Dell laptops. When sudden movement is detected, all input/output
8032operations on the drive are suspended and its heads are parked on the ramp,
8033where they are less likely to cause damage to the spinning disc. Requires a
8034drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
8035feature, and a laptop with an accelerometer. It has no effect on SSDs.")
8036 (license license:gpl2)))
8037
8038
8039(define-public nbfc-linux
8040 (let ((version "0.1.7")
8041 (commit "4c2b75e4a875459e86a9892319889ff945e9cadf")
8042 (revision "0"))
8043 (package
8044 (name "nbfc-linux")
8045 (version (git-version version revision commit))
8046 (source (origin
8047 (method git-fetch)
8048 (uri (git-reference
8049 (url "https://github.com/nbfc-linux/nbfc-linux")
8050 (commit commit)))
8051 (file-name (git-file-name name version))
8052 (sha256
8053 (base32
8054 "0mmyfaigrh3fd5v11a8p38km4m02qzsfx8yh72g0z405bzhqn5jk"))))
8055 (build-system gnu-build-system)
8056 (arguments
8057 `(#:make-flags (list (string-append "CC="
8058 ,(cc-for-target))
8059 (string-append "PREFIX="
8060 (assoc-ref %outputs "out")))
8061 #:tests? #f
8062 #:phases (modify-phases %standard-phases
8063 (delete 'configure))))
8064 (native-inputs (list pkg-config))
8065 (propagated-inputs (list python dmidecode))
8066 (synopsis "NoteBook FanControl ported to Linux")
8067 (description
8068 "This package provides a C port of NoteBook FanControl (NBFC), a fan
8069control service for notebooks. It provides the same utilities with the same
8070interfaces as the original NBFC, although the implementation differs.")
8071 (home-page "https://github.com/nbfc-linux/nbfc-linux")
8072 (license license:gpl3+))))
8073
8074(define-public thinkfan
8075 (package
8076 (name "thinkfan")
8077 (version "2.0.0")
8078 (source
8079 (origin
8080 (method git-fetch)
8081 (uri (git-reference
8082 (url "https://github.com/vmatare/thinkfan")
8083 (commit version)))
8084 (file-name (git-file-name name version))
8085 (sha256
8086 (base32 "1jdjqdbv0m7yf9g4rxs7nq1ldh2b81a7qx4vcf9lzw7jwlydd822"))))
8087 (build-system cmake-build-system)
8088 (arguments
8089 (list
8090 #:modules '((guix build cmake-build-system)
8091 (guix build utils)
8092 (srfi srfi-26))
8093 #:tests? #f ; no test target
8094 #:configure-flags
8095 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
8096 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
8097 ;; inefficient’.
8098 #~(list "-DUSE_ATASMART:BOOL=ON")
8099 #:phases
8100 #~(modify-phases %standard-phases
8101 (add-after 'unpack 'create-init-scripts
8102 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
8103 ;; systemd to patch and install their service files. Fake their
8104 ;; presence rather than duplicating the build system below. Leave
8105 ;; things like ‘/bin/kill’ because they're not worth a dependency.
8106 ;; The sysvinit needs manual patching, but since upstream doesn't
8107 ;; even provide the option to install it: don't.
8108 (lambda _
8109 (substitute* "CMakeLists.txt"
8110 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
8111 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
8112 ;; That was easy! Now we just need to fix the destinations.
8113 (("/etc" directory)
8114 (string-append #$output directory))))))))
8115 (native-inputs
8116 (list pkg-config))
8117 (inputs
8118 `(("libatasmart" ,libatasmart)
8119 ("lm-sensors" ,lm-sensors "lib")
8120 ("yaml-cpp" ,yaml-cpp)))
8121 (home-page "https://github.com/vmatare/thinkfan")
8122 (synopsis "Simple fan control program")
8123 (description
8124 "Thinkfan is a simple fan control program. It reads temperatures,
8125checks them against configured limits and switches to appropriate (also
8126pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
8127other @code{hwmon} driver that enables temperature reading and fan control
8128from userspace.")
8129 (license license:gpl3+)))
8130
8131(define-public tpacpi-bat
8132 (package
8133 (name "tpacpi-bat")
8134 (version "3.2")
8135 (source
8136 (origin
8137 (method git-fetch)
8138 (uri (git-reference
8139 (url "https://github.com/teleshoes/tpacpi-bat")
8140 (commit (string-append "v" version))))
8141 (file-name (git-file-name name version))
8142 (sha256
8143 (base32 "0nd8s2bqbhl0sjpflphb4l9ix71p7kvnbvkq4dg9a1v0sxafyygm"))))
8144 (build-system gnu-build-system)
8145 (arguments
8146 `(#:tests? #f ; no test target
8147 #:phases
8148 (modify-phases %standard-phases
8149 (add-after 'unpack 'refer-to-inputs
8150 (lambda* (#:key inputs #:allow-other-keys)
8151 (substitute* "tpacpi-bat"
8152 (("cat ")
8153 (string-append (search-input-file inputs "bin/cat") " "))
8154 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
8155 ;; loaded. That's the administrator's prerogative; disable it.
8156 (("system \"(modprobe .*)\"" _ match)
8157 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))))
8158 (delete 'configure) ; nothing to configure
8159 (delete 'build) ; nothing to build
8160 (replace 'install
8161 (lambda* (#:key outputs #:allow-other-keys)
8162 (let* ((out (assoc-ref outputs "out"))
8163 (bin (string-append out "/bin"))
8164 (doc (string-append out "/share/doc/" ,name "-" ,version)))
8165 (install-file "tpacpi-bat" bin)
8166
8167 ;; There's no man page. Install other forms of documentation.
8168 (for-each (lambda (file)
8169 (let ((target (string-append doc "/" file)))
8170 (mkdir-p (dirname target))
8171 (copy-recursively file target)))
8172 (list "battery_asl" "examples" "README.md"))))))))
8173 (inputs
8174 (list coreutils-minimal
8175 perl))
8176 (home-page "https://github.com/teleshoes/tpacpi-bat")
8177 (synopsis "ThinkPad battery charge controller")
8178 (description
8179 "Tpacpi-bat is a command-line interface to control battery charging on
8180@uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
8181ThinkPad models released after 2011}, starting with the xx20 series. It can
8182query and set the thresholds at which one or both batteries will start and stop
8183charging, inhibit charging batteries for a set period of time, or force them to
8184discharge when they otherwise would not.
8185
8186This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
8187kernel module provided by the @code{acpi-call-linux-module} package, which must
8188be installed and loaded separately. Only the original vendor firmware is
8189supported.")
8190 (license license:gpl3+)))
8191
8192(define-public tmon
8193 (package
8194 (name "tmon")
8195 ;; Tmon's ‘VERSION = 1.0’ hasn't been touched since 2013; the code has.
8196 (version (package-version linux-libre))
8197 (source (package-source linux-libre))
8198 (build-system gnu-build-system)
8199 (arguments
8200 (list
8201 #:tests? #f ; no test suite
8202 #:make-flags
8203 #~(list (string-append "CC=" #$(cc-for-target))
8204 (string-append "INSTALL_ROOT=" #$output)
8205 "BINDIR=bin")
8206 #:phases
8207 #~(modify-phases %standard-phases
8208 (add-after 'unpack 'enter-subdirectory
8209 (lambda _
8210 (chdir "tools/thermal/tmon")))
8211 (add-after 'install 'install-man-page
8212 (lambda _
8213 (let ((man8 (string-append #$output "/share/man/man8")))
8214 (install-file "tmon.8" man8))))
8215 (delete 'configure)))) ; no configure script
8216 (inputs
8217 (list ncurses))
8218 (home-page (package-home-page linux-libre))
8219 (synopsis "Monitor and test the Linux thermal subsystem in real time")
8220 (description
8221 "Tmon is a tool to interact with the complex thermal subsystem of the
8222kernel Linux. It helps visualize thermal relationships and real-time thermal
8223data, tune and test cooling devices and sensors, and collect thermal data for
8224further analysis.
8225
8226As computers become smaller and more thermally constrained, more sensors are
8227added and new cooling capabilities introduced. Thermal relationships can change
8228dynamically. Their complexity grows exponentially among cooling devices, zones,
8229sensors, and trip points.
8230
8231Linux exposes this relationship through @file{/sys/class/thermal} with a matrix
8232of symbolic links, trip point bindings, and device instances. To traverse it
8233by hand is no trivial task: @command{tmon} aims to make it understandable.")
8234 (license (list license:gpl2 ; the man page
8235 license:gpl2+)))) ; the actual rest
8236
8237(define-public turbostat
8238 (package
8239 (name "turbostat")
8240 ;; XXX turbostat reports a version like ‘20.09.30’ but using it here would
8241 ;; make it harder to benefit from ‘free’ linux-libre package updates.
8242 (version (package-version linux-libre))
8243 (source (package-source linux-libre))
8244 (build-system gnu-build-system)
8245 (arguments
8246 (list
8247 #:tests? #f ;no test suite
8248 #:make-flags
8249 #~(list (string-append "CC=" #$(cc-for-target))
8250 (string-append "PREFIX=" #$output))
8251 #:phases
8252 #~(modify-phases %standard-phases
8253 (add-after 'unpack 'enter-subdirectory
8254 (lambda _
8255 (chdir "tools/power/x86/turbostat")))
8256 (delete 'configure)))) ;no configure script
8257 (inputs
8258 (list libcap))
8259 (supported-systems '("i686-linux" "x86_64-linux"))
8260 (home-page (package-home-page linux-libre))
8261 (synopsis "Report x86 processor frequency and idle statistics")
8262 (description
8263 "Turbostat reports x86 processor topology, frequency, idle power state
8264statistics, temperature, and power consumption. Some information is unavailable
8265on older processors.
8266
8267It can be used to identify machines that are inefficient in terms of power usage
8268or idle time, report the rate of @acronym{SMI, system management interrupt}s
8269occurring on the system, or verify the effects of power management tuning.
8270
8271@command{turbostat} reads hardware counters but doesn't write to them, so it
8272won't interfere with the OS or other running processes---including multiple
8273invocations of itself.")
8274 (license license:gpl2)))
8275
8276(define-public ntfs-3g
8277 (package
8278 (name "ntfs-3g")
8279 (version "2026.7.7")
8280 (source (origin
8281 (method git-fetch)
8282 (uri
8283 (git-reference
8284 (url "https://github.com/tuxera/ntfs-3g")
8285 (commit version)))
8286 (file-name (git-file-name name version))
8287 (sha256
8288 (base32
8289 "0kkpmi28qihwmnyvdnkj0azrd7zr6wkv590pjfmbbhn1w4qfp7gd"))
8290 (patches
8291 (search-patches "ntfs-3g-autoconf-sbin-helpers.patch"
8292 "ntfs-3g-consistent-sbindir-usage.patch"))))
8293 (build-system gnu-build-system)
8294 (inputs (list util-linux ; libuuid
8295 kmod
8296 fuse-2))
8297 (native-inputs (list pkg-config autoconf automake libtool
8298 libgcrypt)) ; for m4 macros
8299 (arguments
8300 (list
8301 #:configure-flags
8302 #~(list "--disable-static"
8303 "--disable-ldconfig" ;not necessary
8304 "--exec-prefix=${prefix}"
8305 "--with-fuse=external" ;use our own FUSE
8306 "--enable-mount-helper"
8307 (string-append "--with-modprobe-helper="
8308 #$(this-package-input "kmod") "/bin/modprobe")
8309 "--enable-posix-acls"
8310 "--enable-xattr-mappings")
8311 #:phases
8312 #~(modify-phases %standard-phases
8313 ;; If users install ntfs-3g, they probably want to make it the
8314 ;; default driver as well, so we opt for sensible defaults and link
8315 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
8316 ;; mount NTFS file systems.)
8317 (add-after 'install 'install-link
8318 (lambda* (#:key outputs #:allow-other-keys)
8319 (let* ((out (assoc-ref outputs "out"))
8320 (sbin (string-append out "/sbin")))
8321 (symlink "mount.ntfs-3g"
8322 (string-append sbin "/mount.ntfs"))))))))
8323 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
8324 (synopsis "Read-write access to NTFS file systems")
8325 (description
8326 "NTFS-3G provides read-write access to NTFS file systems, which are
8327commonly found on Microsoft Windows. It is implemented as a FUSE file system.
8328The package provides additional NTFS tools.")
8329 (license license:gpl2+)))
8330
8331(define-public ntfs-3g/static
8332 (static-package
8333 (package
8334 (inherit ntfs-3g)
8335 (name "ntfs-3g-static")
8336 (arguments
8337 (substitute-keyword-arguments arguments
8338 ((#:configure-flags flags)
8339 #~(cons* "--enable-really-static"
8340 ;; The FUSE driver isn't currently used by our initrd.
8341 "--disable-ntfs-3g"
8342 #$flags))
8343 ((#:phases phases)
8344 #~(modify-phases #$phases
8345 (add-after 'unpack 'make-really-static-really-static
8346 (lambda _
8347 (substitute* "ntfsprogs/Makefile.am"
8348 ((" -static") " -all-static"))))
8349 (delete 'install-link))))))))
8350
8351(define-public ntfsfix/static
8352 (package
8353 (name "ntfsfix-static")
8354 (version (package-version ntfs-3g/static))
8355 (source #f)
8356 (build-system trivial-build-system)
8357 (arguments
8358 (list
8359 #:modules `((guix build utils))
8360 #:builder
8361 #~(begin
8362 (use-modules (guix build utils))
8363 (let ((bin (string-append #$output "/bin")))
8364 (install-file (search-input-file %build-inputs "/bin/ntfsfix") bin)
8365 (with-directory-excursion bin
8366 (remove-store-references "ntfsfix"))))))
8367 (inputs (list ntfs-3g/static))
8368 (home-page (package-home-page ntfs-3g/static))
8369 (synopsis "Statically linked @command{ntfsfix} from ntfs-3g")
8370 (description
8371 "This package provides a statically linked @command{ntfsfix} taken
8372from the ntfs-3g package. It is meant to be used in initrds.")
8373 (license (package-license ntfs-3g/static))))
8374
8375(define-public rdma-core
8376 (package
8377 (name "rdma-core")
8378 (version "62.0")
8379 (source (origin
8380 (method url-fetch)
8381 (uri (string-append "https://github.com/linux-rdma/rdma-core"
8382 "/releases/download/v" version "/rdma-core-"
8383 version ".tar.gz"))
8384 (sha256
8385 (base32
8386 "1802afy4q80zl7qkxlyq71ll5fsksva43f8xfd6vlqj1c47dc2n0"))))
8387 (build-system cmake-build-system)
8388 (arguments
8389 `(#:tests? #f ;no tests
8390
8391 ;; Upstream uses the "ninja" build system and encourage distros
8392 ;; to do the same for consistency.
8393 #:generator "Ninja"
8394 #:configure-flags
8395 (list (string-append "-DRST2MAN_EXECUTABLE="
8396 (search-input-file
8397 %build-inputs "/bin/rst2man.py")))))
8398 (native-inputs
8399 (list pkg-config python-wrapper python-docutils-0.19)) ;for 'rst2man'
8400 (inputs
8401 (list libnl eudev))
8402 (home-page "https://github.com/linux-rdma/rdma-core")
8403 (synopsis "Utilities and libraries for working with RDMA devices")
8404 (description
8405 "This package provides userspace components for the InfiniBand
8406subsystem of the Linux kernel. Specifically it contains userspace
8407libraries for the following device nodes:
8408
8409@enumerate
8410@item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
8411@item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
8412@item @file{/dev/infiniband/umadX} (@code{libibumad})
8413@end enumerate
8414
8415The following service daemons are also provided:
8416@enumerate
8417@item @code{srp_daemon} (for the @code{ib_srp} kernel module)
8418@item @code{iwpmd} (for iWARP kernel providers)
8419@item @code{ibacm} (for InfiniBand communication management assistant)
8420@end enumerate")
8421 ;; All library code is dual licensed under GPL2 and a custom MIT
8422 ;; variant. The package also includes some components covered by
8423 ;; other licenses. Consult COPYING.md for full details.
8424 (license
8425 (list license:gpl2
8426 (license:x11-style "See COPYING.BSD_MIT in the distribution")
8427 license:bsd-2 ; Files referring to COPYING.BSD_FB
8428 license:cc0 ; most files in ccan/
8429 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
8430
8431(define-public perftest
8432 (package
8433 (name "perftest")
8434 (version "4.5-0.20")
8435 (home-page "https://github.com/linux-rdma/perftest")
8436 (source (origin
8437 (method git-fetch)
8438 (uri (git-reference (url home-page)
8439 (commit (string-append "v" version))))
8440 (file-name (git-file-name name version))
8441 (sha256
8442 (base32
8443 "1hrpzmkz1kq4jwpy6b5fl8073iy7dllcq2hfzdw6waaf5920vd64"))))
8444 (build-system gnu-build-system)
8445 (native-inputs
8446 (list autoconf automake libtool))
8447 (inputs (list pciutils rdma-core))
8448 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
8449 (description "This is a collection of tests written over uverbs intended
8450for use as a performance micro-benchmark. The tests may be used for hardware
8451or software tuning as well as for functional testing.
8452
8453The collection contains a set of bandwidth and latency benchmark such as:
8454@enumerate
8455@item Send - @code{ib_send_bw} and @code{ib_send_lat}
8456@item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
8457@item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
8458@item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
8459@item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
8460@end enumerate")
8461 (license license:gpl2)))
8462
8463(define-public rng-tools
8464 (package
8465 (name "rng-tools")
8466 (home-page "https://github.com/nhorman/rng-tools")
8467 (version "6.17")
8468 (source (origin
8469 (method git-fetch)
8470 (uri (git-reference (url home-page)
8471 (commit (string-append "v" version))))
8472 (file-name (git-file-name name version))
8473 (sha256
8474 (base32
8475 "0vvqi9ha4jbk4086x2q98p4ip3z56sfdpyckdyknsd36zhp6z8n2"))
8476 (patches
8477 (search-patches "rng-tools-revert-build-randstat.patch"))
8478 (patch-flags '("-p0"))))
8479 (build-system gnu-build-system)
8480 (arguments
8481 (list
8482 ;; Disable support for various hardware entropy sources as they need
8483 ;; dependencies that are not yet in Guix, and would significantly
8484 ;; increase closure size.
8485 #:configure-flags #~(list "--without-nistbeacon"
8486 "--without-pkcs11"
8487 "--without-rtlsdr"
8488 "--without-qrypt")
8489 #:phases
8490 #~(modify-phases %standard-phases
8491 (add-before 'check 'disable-failing-test
8492 (lambda _
8493 (substitute* "tests/Makefile"
8494 ;; This test requires a hwrng, rdrand, or tpm device.
8495 ;; Worse, it appears to fail if that isn't sufficiently random.
8496 (("\\brngtestjitter\\.sh\\b") " ")))))))
8497 (native-inputs
8498 (list autoconf automake pkg-config))
8499 (inputs
8500 (list libcap sysfsutils openssl))
8501 (synopsis "Random number generator daemon")
8502 (description
8503 "Monitor a hardware random number generator, and supply entropy
8504from that to the system kernel's @file{/dev/random} machinery.")
8505 ;; The source package is offered under the GPL2+, but the files
8506 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
8507 (license (list license:gpl2 license:gpl2+))))
8508
8509(define-public cpupower
8510 (package
8511 (name "cpupower")
8512 (version (package-version linux-libre))
8513 (source (package-source linux-libre))
8514 (build-system gnu-build-system)
8515 (arguments
8516 (list #:make-flags
8517 #~(list "CC=gcc"
8518 (string-append "DESTDIR=" #$output)
8519 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
8520 "docdir=/share/doc/cpupower" ;drop default ‘packages/’
8521 "confdir=$(docdir)/examples"
8522 ;; The Makefile recommends the following changes.
8523 "DEBUG=false"
8524 "[email protected]")
8525 #:tests? #f ; no tests
8526 #:phases
8527 #~(modify-phases %standard-phases
8528 (add-after 'unpack 'enter-subdirectory
8529 (lambda _
8530 (chdir "tools/power/cpupower")))
8531 (delete 'configure) ; no configure script
8532 (add-before 'build 'fix-makefiles
8533 (lambda _
8534 (substitute* "Makefile"
8535 (("/usr/") "/")
8536 (("/bin/(install)" _ command) command))
8537 (substitute* "bench/Makefile"
8538 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))))
8539 (native-inputs (list gettext-minimal
8540 which)) ;to find gettext
8541 (inputs (list pciutils))
8542 (home-page (package-home-page linux-libre))
8543 (synopsis "CPU frequency and voltage scaling tools for Linux")
8544 (description
8545 "cpupower is a set of user-space tools that use the cpufreq feature of the
8546Linux kernel to retrieve and control processor features related to power saving,
8547such as frequency and voltage scaling.")
8548 (license license:gpl2)))
8549
8550(define-public x86-energy-perf-policy
8551 (package
8552 (name "x86-energy-perf-policy")
8553 (version (package-version linux-libre))
8554 (source (package-source linux-libre))
8555 (build-system gnu-build-system)
8556 (arguments
8557 '(#:tests? #f
8558 #:phases
8559 (modify-phases %standard-phases
8560 (add-after 'unpack 'enter-subdirectory
8561 (lambda _
8562 (chdir "tools/power/x86/x86_energy_perf_policy")
8563 #t))
8564 (delete 'configure)
8565 (add-before 'build 'fix-makefile
8566 (lambda _
8567 (substitute* "Makefile" (("/usr") ""))
8568 #t)))
8569 #:make-flags
8570 (let ((out (assoc-ref %outputs "out")))
8571 (list (string-append "DESTDIR=" out)
8572 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
8573 (supported-systems '("i686-linux" "x86_64-linux"))
8574 (home-page (package-home-page linux-libre))
8575 (synopsis "Display and update Intel-CPU energy-performance policy")
8576 (description
8577 "@command{x86_energy_perf_policy} displays and updates energy-performance
8578policy settings specific to Intel Architecture Processors. Settings are
8579accessed via Model Specific Register (MSR) updates, no matter if the Linux
8580cpufreq sub-system is enabled or not.")
8581 (license license:gpl2)))
8582
8583(define-public haveged
8584 (package
8585 (name "haveged")
8586 (version "1.9.19")
8587 (source
8588 (origin
8589 (method git-fetch)
8590 (uri (git-reference
8591 (url "https://github.com/jirka-h/haveged")
8592 (commit (string-append "v" version))))
8593 (file-name (git-file-name name version))
8594 (sha256
8595 (base32 "1qka68dlfz9z3gjfvfwvh60l2121c1yx0z264jqsf2vjp5f0xbmn"))))
8596 (build-system gnu-build-system)
8597 (arguments
8598 `(#:configure-flags
8599 (list "--disable-static")))
8600 (home-page "https://www.issihosts.com/haveged")
8601 (synopsis "Entropy source for the Linux random number generator")
8602 (description
8603 "haveged generates an unpredictable stream of random numbers for use by
8604Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
8605standard mechanisms for filling the entropy pool may not be sufficient for
8606systems with high needs or limited user interaction, such as headless servers.
8607
8608@command{haveged} runs as a privileged daemon, harvesting randomness from the
8609indirect effects of hardware events on hidden processor state using the
8610@acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
8611It tunes itself to its environment and provides the same built-in test suite
8612for the output stream as used on certified hardware security devices.
8613
8614The quality of the randomness produced by this algorithm has not been proven.
8615It is recommended to run it together with another entropy source like rngd, and
8616not as a replacement for it.")
8617 (license (list (license:non-copyleft "file://nist/mconf.h")
8618 (license:non-copyleft "file://nist/packtest.c")
8619 license:public-domain ; nist/dfft.c
8620 license:gpl3+)))) ; everything else
8621
8622(define-public hotspot
8623 (package
8624 (name "hotspot")
8625 (version "1.6.0")
8626 (source (origin
8627 (method git-fetch)
8628 (uri (git-reference
8629 (url "https://github.com/KDAB/hotspot")
8630 (commit version)
8631 ;; Include the bundled perfparser and PrefixTickLabels
8632 ;; libraries, which are to be used in source form.
8633 (recursive? #t)))
8634 (file-name (git-file-name name version))
8635 (sha256
8636 (base32
8637 "065pcibr4m2ixjlq9nf45g22f73zsxabll361bjjnmkfv6xhz1r4"))))
8638 (build-system qt-build-system)
8639 (arguments
8640 (list
8641 ;; As mentioned in the option help text, the KAuth helper cannot be
8642 ;; installed to a custom prefix and the build fails with "file cannot
8643 ;; create directory: /polkit-1/actions. Maybe need administrative"
8644 ;; (see: <https://bugs.kde.org/show_bug.cgi?id=363678>).
8645 #:configure-flags #~(list "-DINSTALL_KAUTH_HELPER=OFF"
8646 "-DQT6_BUILD=ON")
8647 #:qtbase qtbase
8648 ;; The 'tst_models' and 'tst_callgraphgenerator' fail, with
8649 ;; the later seemingly requiring sudo or access to the kernel
8650 ;; trace points.
8651 #:test-exclude
8652 (string-append
8653 "("
8654 (string-join
8655 ;; The 'tst_models' expected output doesn't exactly
8656 ;; match.
8657 '("tst_models"
8658 ;; The 'tst_callgraphgenerator' perf invocation
8659 ;; fails when run in the build container.
8660 "tst_callgraphgenerator"
8661 ;; The 'tst_perfparser' test requires sudo/access
8662 ;; to the kernel scheduler trace points.
8663 "tst_perfparser")
8664 "|")
8665 ")")
8666 #:phases
8667 #~(modify-phases %standard-phases
8668 (add-after 'unpack 'patch-perfparser
8669 ;; XXX: This phase is copied from qt-creator: keep them in sync!
8670 (lambda* (#:key inputs #:allow-other-keys)
8671 ;; perfparser attempts to dynamically load the demangle
8672 ;; libraries; use their absolute file name to avoid having to
8673 ;; set LD_LIBRARY_PATH.
8674 (let ((librustc_demangle.so
8675 (with-exception-handler (lambda (ex)
8676 (if (search-error? ex)
8677 #f
8678 (raise-exception ex)))
8679 (lambda ()
8680 (search-input-file inputs "lib/librustc_demangle.so"))
8681 #:unwind? #t)))
8682 (substitute* "3rdparty/perfparser/app/demangler.cpp"
8683 (("loadDemangleLib\\(QStringLiteral\\(\"rustc_demangle\")"
8684 all)
8685 (if librustc_demangle.so
8686 (format #f "loadDemangleLib(QStringLiteral(~s)"
8687 librustc_demangle.so)
8688 all)) ;no rustc_demangle; leave unchanged
8689 (("loadDemangleLib\\(QStringLiteral\\(\"d_demangle\")")
8690 (format #f "loadDemangleLib(QStringLiteral(~s)"
8691 (search-input-file inputs
8692 "lib/libd_demangle.so")))))))
8693 (add-after 'unpack 'path-paths
8694 (lambda* (#:key inputs #:allow-other-keys)
8695 (substitute* "src/perfoutputwidgetkonsole.cpp"
8696 (("\"tail\"")
8697 (format #f "~s" (search-input-file inputs "bin/tail"))))
8698 (substitute* "src/perfrecord.cpp"
8699 (("\"perf( )?\"" _ space)
8700 (string-append "\"" (search-input-file inputs "bin/perf")
8701 (or space "") "\""))))))))
8702 (native-inputs
8703 (list extra-cmake-modules
8704 vulkan-headers))
8705 (inputs
8706 (append
8707 (list coreutils-minimal
8708 d-demangler
8709 elfutils
8710 karchive
8711 kconfig
8712 kcoreaddons
8713 kddockwidgets
8714 kgraphviewer
8715 ki18n
8716 kio
8717 kiconthemes
8718 kitemmodels
8719 kitemviews
8720 knotifications
8721 kparts
8722 ksyntaxhighlighting
8723 kwindowsystem
8724 libxkbcommon
8725 perf
8726 qtdeclarative
8727 qtsvg
8728 solid
8729 threadweaver
8730 `(,zstd "lib"))
8731 (if (supported-package? rust-rustc-demangle-capi-0.1)
8732 (list rust-rustc-demangle-capi-0.1)
8733 '())))
8734 (home-page "https://github.com/KDAB/hotspot")
8735 (synopsis "Performance analysis GUI for Linux perf")
8736 (description "Hotspot is a standalone GUI for performance data analysis.
8737It aims to be similar to KCachegrind, but for data collected with
8738@command{perf}, a profiler for use with the kernel Linux. Its main feature is
8739graphically visualizing a @file{perf.data} file.")
8740 (license (list license:gpl2+ license:gpl3+)))) ;dual licensed
8741
8742(define-public ecryptfs-utils
8743 (package
8744 (name "ecryptfs-utils")
8745 (version "111")
8746 (source
8747 (origin
8748 (method url-fetch)
8749 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
8750 version "/+download/ecryptfs-utils_"
8751 version ".orig.tar.gz"))
8752 (sha256
8753 (base32
8754 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
8755 (build-system gnu-build-system)
8756 (arguments
8757 `(#:configure-flags (list "--disable-pywrap")
8758 #:modules (,@%default-gnu-modules
8759 (ice-9 binary-ports)
8760 (rnrs bytevectors)
8761 (srfi srfi-26))
8762 #:phases
8763 (modify-phases %standard-phases
8764 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
8765 (lambda* (#:key inputs outputs #:allow-other-keys)
8766 (let ((out (assoc-ref outputs "out"))
8767 (util-linux (assoc-ref inputs "util-linux"))
8768 (cryptsetup (assoc-ref inputs "cryptsetup-minimal"))
8769 (linux-pam (assoc-ref inputs "linux-pam"))
8770 (lvm2 (assoc-ref inputs "lvm2")))
8771 (substitute* '("src/utils/ecryptfs-mount-private"
8772 "src/utils/ecryptfs-umount-private"
8773 "src/utils/ecryptfs-setup-private"
8774 "src/utils/ecryptfs-setup-swap"
8775 "src/utils/mount.ecryptfs.c"
8776 "src/utils/umount.ecryptfs.c"
8777 "src/pam_ecryptfs/pam_ecryptfs.c"
8778 "src/desktop/ecryptfs-mount-private.desktop.in"
8779 "src/desktop/ecryptfs-setup-private.desktop.in")
8780 (("/bin/mount")
8781 (string-append util-linux "/bin/mount"))
8782 (("/bin/umount")
8783 (string-append util-linux "/bin/umount"))
8784 (("/sbin/mount.ecryptfs_private")
8785 (string-append out "/sbin/mount.ecryptfs_private"))
8786 (("/sbin/umount.ecryptfs_private")
8787 (string-append out "/sbin/umount.ecryptfs_private"))
8788 (("/usr/bin/ecryptfs-mount-private")
8789 (string-append out "/bin/ecryptfs-mount-private"))
8790 (("/usr/bin/ecryptfs-rewrite-file")
8791 (string-append out "/bin/ecryptfs-rewrite-file"))
8792 (("/usr/bin/ecryptfs-setup-private")
8793 (string-append out "/bin/ecryptfs-setup-private"))
8794 (("/sbin/cryptsetup")
8795 (string-append cryptsetup "/sbin/cryptsetup"))
8796 (("/sbin/unix_chkpwd")
8797 (string-append linux-pam "/sbin/unix_chkpwd"))
8798 (("/sbin/dmsetup")
8799 (string-append lvm2 "/sbin/dmsetup"))))))
8800 (add-after 'install 'wrap-scripts
8801 (lambda* (#:key inputs outputs #:allow-other-keys)
8802 (let* ((out (assoc-ref outputs "out"))
8803 (bin (string-append out "/bin"))
8804 (add (map (lambda (bin)
8805 (dirname (search-input-file
8806 inputs (string-append "bin/" bin))))
8807 ;; For simplicity, we wrap all scripts the same.
8808 (list "awk" "find" "gettext" "grep" "keyctl" "ls"
8809 "lsof" "mount" "rsync" "sed" "which")))
8810 (script? (lambda (file)
8811 (call-with-input-file file
8812 (lambda (port)
8813 (bytevector=? (string->utf8 "#!")
8814 (get-bytevector-n port 2)))))))
8815 (for-each (lambda (file)
8816 (when (script? file)
8817 (wrap-program file
8818 ;; '= would be better than 'suffix but break
8819 ;; setuid binaries.
8820 `("PATH" ":" suffix (,@add
8821 ,(string-append bin))))))
8822 (find-files bin "."))))))))
8823 (native-inputs
8824 (list intltool perl ; for pod2man
8825 pkg-config))
8826 (inputs
8827 (list coreutils
8828 cryptsetup-minimal
8829 findutils
8830 gawk
8831 grep
8832 keyutils
8833 linux-pam
8834 lsof
8835 lvm2
8836 nss
8837 rsync
8838 sed
8839 util-linux
8840 which))
8841 (home-page "https://ecryptfs.org/")
8842 (synopsis "Cryptographic file system utilities")
8843 (description
8844 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
8845Each file's cryptographic meta-data is stored inside the file itself, along
8846with the encrypted contents. This allows individual encrypted files to be
8847copied between hosts and still be decrypted with the proper key. eCryptfs is a
8848native Linux file system, and has been part of the Linux kernel since version
88492.6.19. This package contains the userland utilities to manage it.")
8850 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
8851 ;; grant additional permission to link with OpenSSL.
8852 (license license:gpl2+)))
8853
8854(define-public module-init-tools
8855 (package
8856 (name "module-init-tools")
8857 (version "3.16")
8858 (source (origin
8859 (method url-fetch)
8860 (uri (string-append
8861 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
8862 "module-init-tools-" version ".tar.bz2"))
8863 (sha256
8864 (base32
8865 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
8866 (patches (search-patches "module-init-tools-moduledir.patch"))))
8867 (build-system gnu-build-system)
8868 (arguments
8869 ;; FIXME: The upstream tarball lacks man pages, and building them would
8870 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
8871 ;; but they vanished. In the meantime, fake it.
8872 '(#:phases
8873 (modify-phases %standard-phases
8874 (add-before 'configure 'fake-docbook
8875 (lambda _
8876 (substitute* "Makefile.in"
8877 (("^DOCBOOKTOMAN.*$")
8878 "DOCBOOKTOMAN = true\n"))
8879 #t)))))
8880 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
8881 (synopsis "Tools for loading and managing Linux kernel modules")
8882 (description
8883 "Tools for loading and managing Linux kernel modules, such as
8884@code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
8885 (license license:gpl2+)))
8886
8887(define-public mce-inject
8888 (let ((revision "0") ; no git tags :-/
8889 (commit "4cbe46321b4a81365ff3aafafe63967264dbfec5"))
8890 (package
8891 (name "mce-inject")
8892 (version (git-version "0.0.0" revision commit))
8893 (source
8894 (origin
8895 (method git-fetch)
8896 (uri (git-reference
8897 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git")
8898 (commit commit)))
8899 (file-name (git-file-name name version))
8900 (sha256
8901 (base32 "0gjapg2hrlxp8ssrnhvc19i3r1xpcnql7xv0zjgbv09zyha08g6z"))))
8902 (build-system gnu-build-system)
8903 (arguments
8904 ;; There is no test suite. There's a test/ directory, but it just holds
8905 ;; example text files you could feed to the programme to crash something.
8906 (list #:tests? #f
8907 #:make-flags
8908 #~(list (string-append "prefix=" #$output)
8909 (string-append "CC=" #$(cc-for-target)))
8910 #:phases
8911 #~(modify-phases %standard-phases
8912 (delete 'configure) ; no configure script
8913 (add-after 'install 'install-examples
8914 (lambda* (#:key outputs #:allow-other-keys)
8915 (let* ((out (assoc-ref outputs "out"))
8916 (doc (string-append out "/share/doc/" #$name))
8917 (dir (string-append doc "/examples")))
8918 (copy-recursively "test" dir )))))))
8919 (native-inputs
8920 (list bison flex))
8921 (supported-systems (list "i686-linux" "x86_64-linux"))
8922 (home-page
8923 "https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git/about/")
8924 (synopsis
8925 "Inject x86 @acronym{MCEs, machine-check exceptions} into Linux")
8926 (description
8927 "This simple tool injects fake @acronym{MCEs, machine-check exceptions}
8928into a running Linux kernel, to debug or test the kernel's @acronym{EDAC, error
8929detection and correction}-handling code specific to x86 and x86_64 platforms.
8930
8931Real MCEs are internal CPU errors. Handling them correctly can be important to
8932system stability and even prevent physical damage. In contrast, simulated MCEs
8933produced by @command{mce-inject} are purely synthetic: injection happens only at
8934the software level, inside the kernel, and is not visible to the platform
8935hardware or firmware.
8936
8937A convenient feature of @command{mce-inject} is that the input language used to
8938describe MCEs is similar to the format used in Linux panic messages, with a few
8939extensions. In general, you should be able to pipe in any logged MCE panic to
8940simulate that same MCE.
8941
8942The target kernel must have the @code{CONFIG_X86_MCE_INJECT} option enabled and
8943the @code{mce-inject} module loaded if it exists.")
8944 (license license:gpl2))))
8945
8946(define-public mcelog
8947 (package
8948 (name "mcelog")
8949 (version "195")
8950 (source
8951 (origin
8952 (method git-fetch)
8953 (uri (git-reference
8954 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git")
8955 (commit (string-append "v" version))))
8956 (file-name (git-file-name name version))
8957 (sha256
8958 (base32 "1bg2bj8flybd8kzmmaaslisc6lc1fs9nbv09im6r32dq48skx5aj"))
8959 (modules '((guix build utils)))
8960 (snippet
8961 `(begin
8962 ;; The checkout lacks a .git directory, breaking ‘git describe’.
8963 (substitute* "Makefile"
8964 (("\"unknown\"") (string-append "\"v" ,version "\"")))))))
8965 (build-system gnu-build-system)
8966 (arguments
8967 (list
8968 ;; The tests will only run as root on certain supported CPU models.
8969 #:tests? #f
8970 #:make-flags
8971 #~(list (string-append "CC=" #$(cc-for-target))
8972 (string-append "prefix=" #$output)
8973 (string-append "DOCDIR=" #$output "/share/doc/"
8974 #$name "-" #$version)
8975 "etcprefix=$(DOCDIR)/examples")
8976 #:phases
8977 #~(modify-phases %standard-phases
8978 (delete 'configure)))) ; no configure script
8979 (native-inputs
8980 (list python-wrapper)) ; to generate example mcelog.conf
8981 (supported-systems (list "i686-linux" "x86_64-linux"))
8982 (home-page "https://mcelog.org/")
8983 (synopsis "Machine check monitor for x86 Linux systems")
8984 (description
8985 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
8986systems running the kernel Linux. It can also perform user-defined tasks, such
8987as bringing bad pages off-line, when configurable error thresholds are
8988exceeded.")
8989 (license license:gpl2)))
8990
8991(define-public mtd-utils
8992 (package
8993 (name "mtd-utils")
8994 (version "2.1.5")
8995 (source (origin
8996 (method url-fetch)
8997 (uri (string-append
8998 "ftp://ftp.infradead.org/pub/mtd-utils/"
8999 "mtd-utils-" version ".tar.bz2"))
9000 (sha256
9001 (base32
9002 "0ilz8hkcyvfcnqpy25kbr8fb71x9vl28wbmw56vvd68n2byjfviq"))))
9003 (arguments
9004 (list #:configure-flags
9005 (if (%current-target-system) ; When cross-compiling.
9006 #~(list)
9007 #~(list "--enable-unit-tests"))
9008
9009 #:parallel-tests? #f)) ;tests may fail when running in parallel
9010 (native-inputs
9011 (list cmocka pkg-config))
9012 (inputs
9013 (list acl ; extended attributes (xattr)
9014 lzo
9015 openssl ; optional crypto support
9016 `(,util-linux "lib")
9017 zlib
9018 `(,zstd "lib")))
9019 (build-system gnu-build-system)
9020 (synopsis "MTD Flash Storage Utilities")
9021 (description "This package provides utilities for testing, partitioning, etc
9022of flash storage.")
9023 (home-page "http://www.linux-mtd.infradead.org/")
9024 (license
9025 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
9026 license:mpl1.1 ; All ftl* files
9027 license:expat)))) ; libiniparser
9028
9029(define-public libseccomp
9030 (package
9031 (name "libseccomp")
9032 (version "2.6.0")
9033 (source (origin
9034 (method git-fetch)
9035 (uri (git-reference
9036 (url "https://github.com/seccomp/libseccomp")
9037 (commit (string-append "v" version))))
9038 (file-name (git-file-name name version))
9039 (sha256
9040 (base32
9041 "189yh66aj3z3jvns739qbj504f3mcl3w44pxxizw877pbj3kal11"))))
9042 (build-system gnu-build-system)
9043 (arguments
9044 (list
9045 #:configure-flags #~(list "--disable-static")
9046 #:phases #~(modify-phases %standard-phases
9047 #$@(if (target-ppc32?)
9048 ;; This test is removed upstream. See upstream commit
9049 ;; 7db46d72f13c172b290818f624c2966bd0db5677
9050 #~((add-after 'unpack 'skip-62-sim-arch-tests
9051 (lambda _
9052 (substitute*
9053 "tests/62-sim-arch_transactions.tests"
9054 (("test type: bpf-sim-fuzz") "")
9055 (("62-sim-arch_transactions 5") "")))))
9056 #~())
9057 (add-before 'check 'skip-load-test
9058 (lambda _
9059 ;; This test does a native system call and fails when
9060 ;; run under QEMU user-mode emulation. Just skip it.
9061 (delete-file "tests/52-basic-load.tests"))))))
9062 (native-inputs
9063 (list autoconf automake gperf libtool which))
9064 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
9065 (description "The libseccomp library provides an easy to use, platform
9066independent, interface to the Linux Kernel's syscall filtering mechanism. The
9067libseccomp API is designed to abstract away the underlying BPF based syscall
9068filter language and present a more conventional function-call based filtering
9069interface that should be familiar to, and easily adopted by, application
9070developers.")
9071 (home-page "https://github.com/seccomp/libseccomp")
9072 (license license:lgpl2.1)))
9073
9074(define-public radeontop
9075 (package
9076 (name "radeontop")
9077 (version "1.4")
9078 (source
9079 (origin
9080 (method git-fetch)
9081 (uri (git-reference
9082 (url "https://github.com/clbr/radeontop")
9083 (commit (string-append "v" version))))
9084 (file-name (git-file-name name version))
9085 (sha256
9086 (base32 "0kwqddidr45s1blp0h8r8h1dd1p50l516yb6mb4s6zsc827xzgg3"))))
9087 (build-system gnu-build-system)
9088 (arguments
9089 `(#:phases (modify-phases %standard-phases
9090 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
9091 ;; dependency, and doesn't even work on release(!) tarballs.
9092 (add-after 'unpack 'report-correct-version
9093 (lambda _
9094 (substitute* "getver.sh"
9095 (("ver=unknown")
9096 (string-append "ver=" ,version)))))
9097 (delete 'configure)) ; no configure script
9098 #:make-flags (list (string-append "CC=" ,(cc-for-target))
9099 (string-append "PREFIX=" %output))
9100 #:tests? #f)) ; no tests
9101 (native-inputs
9102 (list gettext-minimal pkg-config))
9103 (inputs
9104 (list libdrm libpciaccess libxcb ncurses))
9105 (home-page "https://github.com/clbr/radeontop/")
9106 (synopsis "Usage monitor for AMD Radeon graphics")
9107 (description "RadeonTop monitors resource consumption on supported AMD
9108Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
9109a terminal or saved to a file for further processing. It measures both the
9110activity of the GPU as a whole, which is also accurate during OpenCL
9111computations, as well as separate component statistics that are only meaningful
9112under OpenGL graphics workloads.")
9113 (license license:gpl3)))
9114
9115(define-public efivar
9116 (package
9117 (name "efivar")
9118 (version "39")
9119 (source (origin
9120 (method git-fetch)
9121 (uri (git-reference
9122 (url "https://github.com/rhboot/efivar")
9123 (commit version)))
9124 (file-name (git-file-name name version))
9125 (sha256
9126 (base32
9127 "1zd9dghg1z2rrsazv3d9rj7nik6kdqz42jiak65pipz7mpjn9zdk"))
9128 (patches (search-patches "efivar-fix-fprint-format.patch"))))
9129 (build-system gnu-build-system)
9130 (arguments
9131 (list
9132 ;; Tests require a UEFI system and is not detected in the chroot.
9133 #:tests? #f
9134 #:make-flags #~(list (string-append "prefix="
9135 #$output)
9136 (string-append "libdir="
9137 #$output "/lib")
9138 (string-append "CC="
9139 #$(cc-for-target))
9140 "HOSTCC=gcc"
9141 (string-append "LDFLAGS=-Wl,-rpath="
9142 #$output "/lib")
9143 ;; Strictly only needed for i686-linux/32bit
9144 "CFLAGS=-g -O2 -Wno-error=format")
9145 #:phases #~(modify-phases %standard-phases
9146 (add-after 'unpack 'build-deterministically
9147 (lambda _
9148 (substitute* "src/include/defaults.mk"
9149 ;; Don't use -march=native.
9150 (("-march=native")
9151 ""))))
9152 (delete 'configure))))
9153 (native-inputs (list mandoc pkg-config))
9154 (inputs (list popt))
9155 (home-page "https://github.com/rhboot/efivar")
9156 (synopsis "Tool and library to manipulate EFI variables")
9157 (description "This package provides a library and a command line
9158interface to the variable facility of UEFI boot firmware.")
9159 (license license:lgpl2.1+)))
9160
9161(define-public efibootmgr
9162 (package
9163 (name "efibootmgr")
9164 (version "18")
9165 (source
9166 (origin
9167 (method git-fetch)
9168 (uri (git-reference
9169 (url "https://github.com/rhboot/efibootmgr")
9170 (commit version)))
9171 (file-name (git-file-name name version))
9172 (sha256
9173 (base32 "1j19m3dngcb7jl88ib32phbh5r7c02dhhakq8jk6z7y408c111hd"))))
9174 (build-system gnu-build-system)
9175 (arguments
9176 (list
9177 #:tests? #f ;no tests
9178 #:make-flags
9179 #~(append (list (string-append "prefix=" #$output)
9180 (string-append "libdir=" #$output "/lib")
9181 ;; EFIDIR denotes a subdirectory relative to the
9182 ;; EFI System Partition where the loader will be
9183 ;; installed (known as OS_VENDOR in the code).
9184 ;; GRUB overrides this, as such it's only used if
9185 ;; nothing else is specified on the command line.
9186 "EFIDIR=gnu")
9187 #$(if (%current-target-system)
9188 #~(list
9189 (string-append "CC=" #$(cc-for-target))
9190 (string-append "PKG_CONFIG=" #$(pkg-config-for-target))
9191 (string-append "EXTRAINCDIRS="
9192 #$(this-package-input "efivar") "/include"))
9193 #~'()))
9194 #:phases #~(modify-phases %standard-phases (delete 'configure))))
9195 (native-inputs
9196 (list pkg-config))
9197 (inputs
9198 (list efivar popt))
9199 (home-page "https://github.com/rhboot/efibootmgr")
9200 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
9201 (description
9202 "@code{efibootmgr} is a user-space application to modify the Intel
9203Extensible Firmware Interface (EFI) Boot Manager. This application can
9204create and destroy boot entries, change the boot order, change the next
9205running boot option, and more.")
9206 (license license:gpl2+)))
9207
9208(define-public sysstat
9209 (package
9210 (name "sysstat")
9211 (version "12.7.5")
9212 (source
9213 (origin
9214 (method url-fetch)
9215 (uri (string-append "https://sysstat.github.io/sysstat-packages/"
9216 "sysstat-" version ".tar.xz"))
9217 (sha256
9218 (base32 "0ssdrm3k0fclq5b5i0aznfwdkbac9l9cf88idaq3pls9lm040rjp"))))
9219 (build-system gnu-build-system)
9220 (native-inputs (list gettext-minimal))
9221 (arguments
9222 `(#:tests? #f ; no test suite.
9223 ;; Without this flag, it tries to install the man pages with group 'root'
9224 ;; and fails because /etc/passwd lacks an entry for the root user.
9225 #:configure-flags
9226 (list "--disable-file-attr"
9227 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
9228 #:phases
9229 (modify-phases %standard-phases
9230 ;; The build process tries to create '/var/lib/sa', so we skip that
9231 ;; instruction.
9232 (add-after 'build 'skip-touching-var
9233 (lambda _
9234 (substitute* "Makefile"
9235 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
9236 "")))))))
9237 (home-page "https://sysstat.github.io")
9238 (synopsis "Performance monitoring tools for Linux")
9239 (description "The sysstat utilities are a collection of performance
9240monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
9241@code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
9242@code{sadf} and @code{sa}.")
9243 (license license:gpl2+)))
9244
9245(define-public acpilight
9246 (package
9247 (name "acpilight")
9248 (version "1.2")
9249 (source (origin
9250 (method git-fetch)
9251 (uri (git-reference
9252 (url "https://gitlab.com/wavexx/acpilight.git")
9253 (commit (string-append "v" version))))
9254 (file-name (git-file-name name version))
9255 (sha256
9256 (base32
9257 "1r0r3nx6x6vkpal6vci0zaa1n9dfacypldf6k8fxg7919vzxdn1w"))))
9258 (build-system gnu-build-system)
9259 (arguments
9260 (list #:tests? #f ; no tests
9261 #:make-flags
9262 #~(list (string-append "prefix=" #$output)
9263 (string-append "sysconfdir=" #$output "/lib")) ;udev rule
9264 #:phases
9265 #~(modify-phases %standard-phases
9266 (delete 'configure)
9267 (add-after 'unpack 'patch
9268 (lambda* (#:key inputs #:allow-other-keys)
9269 ;; Prevent reloading udev at build time
9270 (substitute* "Makefile"
9271 (("udevadm") "true"))
9272 (substitute* "90-backlight.rules"
9273 (("/bin")
9274 (string-append #$(this-package-input "coreutils")
9275 "/bin"))))))))
9276 (inputs (list coreutils python))
9277 (home-page "https://gitlab.com/wavexx/acpilight")
9278 (synopsis "Backward-compatibile xbacklight replacement")
9279 (description "acpilight is a backward-compatibile replacement for
9280xbacklight that uses the ACPI interface to set the display brightness. On
9281modern laptops acpilight can control both display and keyboard backlight
9282uniformly on either X11, the console or Wayland.")
9283 (license license:gpl3+)))
9284
9285(define-public light
9286 (package
9287 (name "light")
9288 (version "1.2.2")
9289 (source
9290 (origin
9291 (method git-fetch)
9292 (uri (git-reference
9293 (url "https://github.com/haikarainen/light")
9294 (commit (string-append "v" version))))
9295 (sha256
9296 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
9297 (file-name (git-file-name name version))))
9298 (build-system gnu-build-system)
9299 (arguments
9300 `(#:configure-flags '("CFLAGS=-fcommon")
9301 #:phases
9302 (modify-phases %standard-phases
9303 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
9304 (lambda* (#:key inputs #:allow-other-keys)
9305 (substitute* "90-backlight.rules"
9306 (("/bin/chgrp") (which "chgrp"))
9307 (("/bin/chmod") (which "chmod")))
9308 #t))
9309 (add-after 'install 'install-udev-rules
9310 (lambda* (#:key outputs #:allow-other-keys)
9311 (let ((out (assoc-ref outputs "out")))
9312 (install-file
9313 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
9314 #t))))))
9315 (native-inputs
9316 (list autoconf automake))
9317 (home-page "https://haikarainen.github.io/light/")
9318 (synopsis "GNU/Linux application to control backlights")
9319 (description
9320 "Light is a program to send commands to screen backlight controllers
9321under GNU/Linux. Features include:
9322
9323@itemize
9324@item It does not rely on X.
9325@item Light can automatically figure out the best controller to use, making
9326full use of underlying hardware.
9327@item It is possible to set a minimum brightness value, as some controllers
9328set the screen to be pitch black at a value of 0 (or higher).
9329@end itemize\n")
9330 (license license:gpl3+)))
9331
9332(define-public brightnessctl
9333 (package
9334 (name "brightnessctl")
9335 (version "0.5.1")
9336 (home-page "https://github.com/Hummer12007/brightnessctl")
9337 (source (origin
9338 (method git-fetch)
9339 (uri (git-reference (url home-page) (commit version)))
9340 (file-name (git-file-name name version))
9341 (sha256
9342 (base32
9343 "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq"))
9344 (patches (search-patches "brightnessctl-elogind-support.patch"))))
9345 (build-system gnu-build-system)
9346 (arguments
9347 `(#:tests? #f ; no tests
9348 #:make-flags (list (string-append "CC=" ,(cc-for-target))
9349 (string-append "PREFIX=" %output)
9350 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/")
9351 "ENABLE_SYSTEMD=1")
9352 #:phases
9353 (modify-phases %standard-phases
9354 (delete 'configure)
9355 (add-after 'unpack 'adjust-udev-rules
9356 (lambda _
9357 (substitute* "Makefile"
9358 (("INSTALL_UDEV_RULES=0") "INSTALL_UDEV_RULES=1"))
9359 (substitute* "90-brightnessctl.rules"
9360 (("/bin/") "/run/current-system/profile/bin/"))
9361 #t)))))
9362 (native-inputs
9363 (list pkg-config))
9364 (inputs
9365 (list elogind))
9366 (synopsis "Backlight and LED brightness control")
9367 (description
9368 "This program allows you read and control device brightness. Devices
9369include backlight and LEDs. It can also preserve current brightness before
9370applying the operation, such as on lid close.
9371
9372The appropriate permissions must be set on the backlight or LED control
9373interface in sysfs, which can be accomplished with the included udev rules.")
9374 (license license:expat)))
9375
9376(define-public tlp
9377 (package
9378 (name "tlp")
9379 (version "1.9.0")
9380 (source
9381 (origin
9382 (method git-fetch)
9383 (uri (git-reference
9384 (url "https://github.com/linrunner/TLP")
9385 (commit version)))
9386 (file-name (git-file-name name version))
9387 (sha256
9388 (base32 "0msskz42yy0ddq6gqak0dsl77wsym24ly3bkpymfwl9dr3wzikv8"))))
9389 (native-inputs
9390 (list shellcheck))
9391 (inputs
9392 `(("dbus" ,dbus)
9393 ("ethtool" ,ethtool)
9394 ("eudev" ,eudev)
9395 ("grep" ,grep)
9396 ("guile" ,guile-3.0) ;for wrap-script
9397 ("hdparm" ,hdparm)
9398 ("inetutils" ,inetutils)
9399 ("iw" ,iw)
9400 ("kmod" ,kmod)
9401 ("pciutils" ,pciutils)
9402 ("perl" ,perl)
9403 ("sed" ,sed)
9404 ("usbutils" ,usbutils)
9405 ("util-linux" ,util-linux)
9406 ("wireless-tools" ,wireless-tools)
9407 ,@(if (let ((system (or (%current-target-system)
9408 (%current-system))))
9409 (or (string-prefix? "i686-" system)
9410 (string-prefix? "x86_64-" system)))
9411 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
9412 '())))
9413 (build-system gnu-build-system)
9414 (arguments
9415 ;; XXX: The full test suite is run with "checkall" but it requires
9416 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
9417 (list
9418 #:make-flags
9419 #~(list "TLP_CONFUSR=/etc/tlp.conf" "TLP_CONFDIR=/etc/tlp.d")
9420 #:test-target "shellcheck"
9421 #:modules '((guix build gnu-build-system)
9422 (guix build utils)
9423 (srfi srfi-1))
9424 #:phases
9425 #~(modify-phases %standard-phases
9426 (delete 'configure) ; no configure script
9427 (add-before 'build 'setenv
9428 (lambda _
9429 (setenv "TLP_WITH_SYSTEMD" "0")
9430 (setenv "TLP_NO_INIT" "1")))
9431 (add-before 'build 'fix-installation
9432 (lambda _
9433 ;; Stop the Makefile from trying to create system directories.
9434 (substitute* "Makefile"
9435 (("= /usr") (string-append "= " #$output))
9436 (("= /etc") (string-append "= " #$output "/etc"))
9437 (("install -d -m 755 \\$\\(_VAR\\)") "#"))))
9438 (add-before 'build 'fix-perl-calls
9439 ;; Shell scripts in "bat.d" and "func.d" call "perl". Fix
9440 ;; invocation without wrapping every one of them.
9441 (lambda* (#:key inputs #:allow-other-keys)
9442 (substitute* (append (find-files "bat.d" ".")
9443 (find-files "func.d" "."))
9444 (("(^|[^/])perl" _ prefix)
9445 (string-append prefix
9446 (search-input-file inputs "bin/perl"))))))
9447 (replace 'install
9448 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
9449 (add-after 'install 'wrap
9450 (lambda* (#:key inputs outputs #:allow-other-keys)
9451 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
9452 (sbin (string-append (assoc-ref outputs "out") "/sbin"))
9453 ;; Used to ignore symlinks which don't need wrapping
9454 (regular-file-predicate
9455 (lambda (file stat) (eq? 'regular (stat:type stat))))
9456 (bin-files (find-files bin regular-file-predicate))
9457 (sbin-files (find-files sbin regular-file-predicate)))
9458 (define (bin-directory input-name)
9459 (let ((p (assoc-ref inputs input-name)))
9460 (and p (string-append p "/bin"))))
9461 (define (sbin-directory input-name)
9462 (string-append (assoc-ref inputs input-name) "/sbin"))
9463 (for-each (lambda (program)
9464 ;; Programs rely on $0 so we use wrap-script
9465 ;; instead of wrap-program
9466 (wrap-script program
9467 `("PATH" ":" prefix
9468 ,(append
9469 (filter-map bin-directory
9470 '("bash"
9471 "coreutils"
9472 "dbus"
9473 "eudev"
9474 "grep"
9475 "inetutils"
9476 "kmod"
9477 "perl"
9478 "sed"
9479 "usbutils"
9480 "util-linux"
9481 "x86-energy-perf-policy"))
9482 (filter-map sbin-directory
9483 '("ethtool"
9484 "hdparm"
9485 "iw"
9486 "pciutils"
9487 "util-linux"
9488 "wireless-tools"))))))
9489 (append bin-files sbin-files))))))))
9490 (home-page "https://linrunner.de/en/tlp/tlp.html")
9491 (synopsis "Power management tool for Linux")
9492 (description "TLP is a power management tool for Linux. It comes with
9493a default configuration already optimized for battery life. Nevertheless,
9494TLP is customizable to fulfil system requirements. TLP settings are applied
9495every time the power supply source is changed.")
9496 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
9497 ;; rest is GPLv2+.
9498 (license (list license:gpl2+ license:gpl3+))))
9499
9500(define-public tlpui
9501 (package
9502 (name "tlpui")
9503 (version "1.9.0")
9504 (source
9505 (origin
9506 (method git-fetch)
9507 (uri (git-reference
9508 (url "https://github.com/d4nj1/TLPUI")
9509 (commit (string-append "tlpui-" version))))
9510 (file-name (git-file-name name version))
9511 (sha256
9512 (base32 "00rkq389zs525s7ckjj6cm34s25rsrgz47p28pp43ld35i538g9w"))))
9513 (build-system pyproject-build-system)
9514 (arguments
9515 (list
9516 #:phases
9517 #~(modify-phases %standard-phases
9518 (add-after 'unpack 'set-absolute-locations
9519 (lambda* (#:key inputs #:allow-other-keys)
9520 (let ((defaults.conf
9521 (search-input-file inputs "/share/tlp/defaults.conf"))
9522 (lspci (search-input-file inputs "/bin/lspci"))
9523 (lsusb (search-input-file inputs "/bin/lsusb"))
9524 (tlp-stat (search-input-file inputs "/bin/tlp-stat")))
9525 (with-directory-excursion "tlpui"
9526 (substitute* '("file.py" "settingshelper.py" "statui.py")
9527 (("\"tlp-stat\"")
9528 (string-append "'" tlp-stat "'"))
9529 (("/usr/share/tlp/defaults.conf")
9530 defaults.conf))
9531 (substitute* "ui_config_objects/gtkusblist.py"
9532 (("\"lsusb\"")
9533 (string-append "'" lsusb "'")))
9534 (substitute* "ui_config_objects/gtkpcilist.py"
9535 (("\"lspci\"")
9536 (string-append "'" lspci "'")))
9537 ;; Settings check if various tlp executables, lspci and
9538 ;; usbutils are available. Skip this phase since we know
9539 ;; for sure they are (and it avoids patching each location).
9540 (substitute* "settingshelper.py"
9541 (("(command_exists = ).*" _ lead)
9542 (string-append lead "True\n")))))))
9543 (add-after 'install 'install-desktop-file
9544 (lambda _
9545 (let ((dir (string-append #$output "/share/applications")))
9546 (install-file "tlpui.desktop" dir))))
9547 (add-after 'wrap 'wrap-gi-python
9548 (lambda _
9549 (let ((gi-typelib-path (getenv "GI_TYPELIB_PATH")))
9550 (wrap-program (string-append #$output "/bin/tlpui")
9551 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))))))))
9552 (native-inputs
9553 (list `(,glib "bin")
9554 gobject-introspection
9555 python-poetry-core
9556 python-pytest
9557 python-pyyaml))
9558 (inputs
9559 (list gtk+
9560 pciutils
9561 python-pygobject
9562 tlp
9563 usbutils))
9564 (propagated-inputs (list (librsvg-for-system)))
9565 (home-page "https://github.com/d4nj1/TLPUI")
9566 (synopsis "User interface for TLP written in Python")
9567 (description
9568 "The Python scripts in this project generate a GTK-UI to change
9569TLP configuration files easily. It aims to protect users from setting
9570bad configuration and to deliver a basic overview of all the valid
9571configuration values.")
9572 (license license:gpl2+)))
9573
9574(define-public lshw
9575 (package
9576 (name "lshw")
9577 (version "B.02.19.2")
9578 (source (origin
9579 (method url-fetch)
9580 (uri (string-append "https://www.ezix.org/software/"
9581 "files/lshw-" version
9582 ".tar.gz"))
9583 (sha256
9584 (base32
9585 "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
9586 (build-system gnu-build-system)
9587 (arguments
9588 `(#:phases (modify-phases %standard-phases (delete 'configure))
9589 #:tests? #f ; no tests
9590 #:make-flags
9591 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
9592 (synopsis "List hardware information")
9593 (description
9594 "@command{lshw} (Hardware Lister) is a small tool to provide
9595detailed information on the hardware configuration of the machine.
9596It can report exact memory configuration, firmware version, mainboard
9597configuration, CPU version and speed, cache configuration, bus speed,
9598and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
9599machines (PowerMac G4 is known to work).")
9600 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
9601 (license license:gpl2+)))
9602
9603(define-public libmnl
9604 (package
9605 (name "libmnl")
9606 (version "1.0.5")
9607 (source
9608 (origin
9609 (method url-fetch)
9610 (uri (string-append "mirror://netfilter.org/libmnl/"
9611 "libmnl-" version ".tar.bz2"))
9612 (sha256
9613 (base32
9614 "09851ns07399rbz0y8slrlmnw3fn1nakr8d37pxjn5gkks8rnjr7"))))
9615 (build-system gnu-build-system)
9616 (home-page "https://www.netfilter.org/projects/libmnl/")
9617 (synopsis "Netlink utility library")
9618 (description "Libmnl is a minimalistic user-space library oriented to
9619Netlink developers. There are a lot of common tasks in parsing, validating,
9620constructing of both the Netlink header and TLVs that are repetitive and easy to
9621get wrong. This library aims to provide simple helpers that allows you to
9622re-use code and to avoid re-inventing the wheel.")
9623 (properties
9624 '((release-monitoring-url . "https://www.netfilter.org/pub/libmnl/")))
9625 (license license:lgpl2.1+)))
9626
9627(define-public libnftnl
9628 (package
9629 (name "libnftnl")
9630 (version "1.2.8")
9631 (source
9632 (origin
9633 (method url-fetch)
9634 (uri (string-append "mirror://netfilter.org/libnftnl/"
9635 "libnftnl-" version ".tar.xz"))
9636 (sha256
9637 (base32 "15ddcyp91lxjh2wfi8xicjpffhn9rpiqsa8djbkqvc69npbabzip"))))
9638 (build-system gnu-build-system)
9639 (native-inputs
9640 (list pkg-config))
9641 (inputs
9642 (list libmnl))
9643 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
9644 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
9645 (description "Libnftnl is a userspace library providing a low-level netlink
9646programming interface to the in-kernel nf_tables subsystem. The library
9647libnftnl has been previously known as libnftables. This library is currently
9648used by nftables.")
9649 (license license:gpl2+)))
9650
9651;;; The symbol libnftl/fixed should be used when libnftnl needs fixes
9652;;; (security or else) and this deprecation could be removed.
9653(define-deprecated/public-alias libnftnl/fixed libnftnl/pinned)
9654
9655;; This is used in iptables, which contributes to rust. We're pinning this
9656;; variant to avoid accidental rebuilds of rust.
9657(define-public libnftnl/pinned
9658 (package
9659 (inherit libnftnl)
9660 (version "1.2.8")
9661 (source
9662 (origin
9663 (method url-fetch)
9664 (uri (string-append "mirror://netfilter.org/libnftnl/"
9665 "libnftnl-" version ".tar.xz"))
9666 (sha256
9667 (base32 "15ddcyp91lxjh2wfi8xicjpffhn9rpiqsa8djbkqvc69npbabzip"))))
9668 (build-system gnu-build-system)
9669 (native-inputs
9670 (list pkg-config))
9671 (inputs
9672 (list libmnl))))
9673
9674(define-public nftables
9675 (package
9676 (name "nftables")
9677 (version "1.0.8")
9678 (source
9679 (origin
9680 (method url-fetch)
9681 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
9682 version ".tar.xz")
9683 (string-append "https://www.nftables.org/projects/nftables"
9684 "/files/nftables-" version ".tar.xz")))
9685 (sha256
9686 (base32 "0l1xpwr9qfbl3bxa97v8s2lbibiz0xma9q0qi34xp0hswh6p8wwk"))))
9687 (build-system gnu-build-system)
9688 (arguments `(#:configure-flags
9689 '("--disable-static"
9690 "--with-cli=readline"
9691 "--with-json")
9692 #:phases
9693 (modify-phases %standard-phases
9694 (add-before 'configure 'autoreconf
9695 (lambda _
9696 (invoke "autoreconf" "-fi"))))))
9697 (inputs (list gmp libmnl libnftnl readline jansson))
9698 (native-inputs (list pkg-config
9699 bison
9700 flex
9701 docbook2x
9702 autoconf
9703 automake
9704 libtool))
9705 (home-page "https://www.nftables.org")
9706 (synopsis "Userspace utility for Linux packet filtering")
9707 (description "nftables is the project that aims to replace the existing
9708{ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
9709filtering framework, a new userspace utility and also a compatibility layer for
9710{ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
9711infrastructure such as the existing hooks, the connection tracking system, the
9712userspace queueing component and the logging subsystem.")
9713 (license license:gpl2)))
9714
9715(define-public libnetfilter-conntrack
9716 (package
9717 (name "libnetfilter-conntrack")
9718 (version "1.0.9")
9719 (source
9720 (origin
9721 (method url-fetch)
9722 (uri (string-append "https://netfilter.org/projects/"
9723 "libnetfilter_conntrack/files/"
9724 "libnetfilter_conntrack-"
9725 version ".tar.bz2"))
9726 (sha256
9727 (base32 "1a3rnpsba64dzy97wwjrxal89wr0nf9znvag2j18nkp3kzs9vgb7"))))
9728 (build-system gnu-build-system)
9729 (native-inputs (list pkg-config))
9730 (inputs (list libnfnetlink libmnl))
9731 (synopsis "Library for kernel connection tracking state table")
9732 (description "libnetfilter_conntrack is a userspace library providing a
9733programming interface (API) to the in-kernel connection tracking state table.
9734The library libnetfilter_conntrack has been previously known as
9735libnfnetlink_conntrack and libctnetlink. This library is currently used by
9736conntrack-tools among many other applications.")
9737 (home-page "https://netfilter.org/projects/libnetfilter_conntrack/index.html")
9738 (supported-systems (filter target-linux? %supported-systems))
9739 (properties '((upstream-name . "libnetfilter_conntrack")))
9740 (license license:gpl2+)))
9741
9742(define-public libnetfilter-cttimeout
9743 (package
9744 (name "libnetfilter-cttimeout")
9745 (version "1.0.1")
9746 (source
9747 (origin
9748 (method url-fetch)
9749 (uri (string-append "https://netfilter.org/projects/"
9750 "libnetfilter_cttimeout/files/"
9751 "libnetfilter_cttimeout-" version ".tar.bz2"))
9752 (sha256
9753 (base32 "0983cpyvxyycbnzqlrzml80pph2z51r6s7sxp06ciq8468pxln8b"))))
9754 (build-system gnu-build-system)
9755 (native-inputs (list pkg-config))
9756 (inputs (list libmnl))
9757 (synopsis "Library for kernel connection tracking timeout infrastructure")
9758 (description "libnetfilter_cttimeout is the userspace library that
9759provides the programming interface to the fine-grain connection tracking
9760timeout infrastructure. With this library, you can create, update and delete
9761timeout policies that can be attached to traffic flows. This library is used
9762by conntrack-tools.")
9763 (home-page "https://netfilter.org/projects/libnetfilter_cttimeout/index.html")
9764 (supported-systems (filter target-linux? %supported-systems))
9765 (properties '((upstream-name . "libnetfilter_cttimeout")))
9766 (license license:gpl2)))
9767
9768(define-public libnetfilter-cthelper
9769 (package
9770 (name "libnetfilter-cthelper")
9771 (version "1.0.1")
9772 (source
9773 (origin
9774 (method url-fetch)
9775 (uri (string-append "https://netfilter.org/projects/"
9776 "libnetfilter_cthelper/files/"
9777 "libnetfilter_cthelper-" version ".tar.bz2"))
9778 (sha256
9779 (base32 "04n95ngil5l8m8v64dfjm1dwq0wd3kf4vw1zblsrff13hxa3s1ql"))))
9780 (build-system gnu-build-system)
9781 (native-inputs (list pkg-config))
9782 (inputs (list libmnl))
9783 (synopsis "Library for user-space connection tracking helpers")
9784 (description "libnetfilter_cthelper is a userspace library that provides a
9785programming interface to user-space connection tracking helpers.
9786@enumerate
9787@item
9788register new user-space connection tracking helpers
9789@item
9790unregister user-space connection tracking helpers
9791@item
9792list existing registered user-space connection tracking helpers
9793@end enumerate")
9794 (home-page "https://netfilter.org/projects/libnetfilter_cthelper/index.html")
9795 (supported-systems (filter target-linux? %supported-systems))
9796 (properties '((upstream-name . "libnetfilter_cthelper")))
9797 (license license:gpl2+)))
9798
9799(define-public libnetfilter-queue
9800 (package
9801 (name "libnetfilter-queue")
9802 (version "1.0.5")
9803 (source
9804 (origin
9805 (method url-fetch)
9806 (uri (string-append "https://netfilter.org/projects/"
9807 "libnetfilter_queue/files/"
9808 "libnetfilter_queue-" version ".tar.bz2"))
9809 (sha256
9810 (base32
9811 "1xdra6i4p8jkv943ygjw646qx8df27f7p5852kc06vjx608krzzr"))))
9812 (build-system gnu-build-system)
9813 (native-inputs (list pkg-config))
9814 (inputs (list libmnl libnfnetlink))
9815 (synopsis "Library for kernel netfilter infrastructure and state")
9816 (description "libnetfilter_queue is a userspace library providing an API
9817to packets that have been queued by the kernel packet filter. It is is part
9818of a system that deprecates the old ip_queue/libipq mechanism.")
9819 (home-page "https://netfilter.org/projects/libnetfilter_queue/index.html")
9820 (supported-systems (filter target-linux? %supported-systems))
9821 (properties '((upstream-name . "libnetfilter_queue")))
9822 (license license:gpl2+)))
9823
9824(define-public conntrack-tools
9825 (package
9826 (name "conntrack-tools")
9827 (version "1.4.8")
9828 (source
9829 (origin
9830 (method url-fetch)
9831 (uri (string-append "https://netfilter.org/projects/"
9832 "conntrack-tools/files/"
9833 "conntrack-tools-" version ".tar.xz"))
9834 (sha256
9835 (base32 "1mnynl5a63j25arapwvkjbm3a2cqm3aaklwfwwclhmpnqps7fxh6"))))
9836 (build-system gnu-build-system)
9837 (native-inputs (list bison flex pkg-config))
9838 (inputs (list libtirpc
9839 libnetfilter-conntrack
9840 libnetfilter-cttimeout
9841 libnetfilter-cthelper
9842 libnetfilter-queue
9843 libnfnetlink
9844 libmnl))
9845 (synopsis "Set of tools targeting the conntrack kernel subsystem")
9846 (description "The tool conntrack provides a full featured interface that
9847is intended to replace the old @file{/proc/net/ip_conntrack} interface. Using
9848conntrack, you can view and manage the in-kernel connection tracking state
9849table from userspace. On the other hand, conntrackd covers the specific
9850aspects of stateful firewalls to enable highly available scenarios, and can be
9851used as statistics collector as well.
9852
9853Since 1.2.0, the conntrack-tools includes the @command{nfct} command line
9854utility. This utility only supports the nfnetlink_cttimeout by now. In the
9855long run, we expect that it will replace conntrack by providing a syntax
9856similar to nftables.")
9857 (home-page "https://netfilter.org/projects/conntrack-tools/index.html")
9858 (supported-systems (filter target-linux? %supported-systems))
9859 (license license:gpl2+)))
9860
9861(define-public libnetfilter-acct
9862 (package
9863 (name "libnetfilter-acct")
9864 (version "1.0.3")
9865 (source
9866 (origin
9867 (method url-fetch)
9868 (uri (string-append "https://netfilter.org/projects/"
9869 "libnetfilter_acct/files/"
9870 "libnetfilter_acct-" version ".tar.bz2"))
9871 (sha256
9872 (base32
9873 "06lsjndgfjsgfjr43px2n2wk3nr7whz6r405mks3887y7vpwwl22"))))
9874 (build-system gnu-build-system)
9875 (native-inputs (list pkg-config))
9876 (inputs (list libmnl))
9877 (synopsis "Library providing interface to extended accounting infrastructure")
9878 (description "libnetfilter_acct is the userspace library providing interface
9879to extended accounting infrastructure.
9880
9881@enumerate
9882@item
9883creating accounting objects
9884@item
9885retrieving accounting objects (and atomically set to zero)
9886@item
9887deleting accounting objects
9888@end enumerate
9889For the nfnetlink_acct subsystem.")
9890 (home-page "https://netfilter.org/projects/libnetfilter_acct/index.html")
9891 (supported-systems (filter target-linux? %supported-systems))
9892 (properties '((upstream-name . "libnetfilter_acct")))
9893 (license license:lgpl2.1+)))
9894
9895(define-public nfacct
9896 (package
9897 (name "nfacct")
9898 (version "1.0.2")
9899 (source
9900 (origin
9901 (method url-fetch)
9902 (uri (string-append "https://netfilter.org/projects/" name
9903 "/files/nfacct-" version ".tar.bz2"))
9904 (sha256
9905 (base32
9906 "0sdxbxjyapbqcp2ami5jd10vz4xbbdvx39f3wfy1iqsbflc25zzc"))))
9907 (build-system gnu-build-system)
9908 (native-inputs (list pkg-config))
9909 (inputs (list libmnl libnetfilter-acct))
9910 (synopsis "Command line tool to create/retrieve/delete accounting objects")
9911 (description "nfacct is the command line tool to create/retrieve/delete
9912accounting objects
9913@enumerate
9914@item
9915listing the objects of the nfacct table in plain text/XML
9916@item
9917atomically get and reset objects of the nfacct table
9918@item
9919adding new objects to the nfacct table
9920@item
9921deleting objects from the nfacct table
9922@end enumerate")
9923 (home-page "https://netfilter.org/projects/nfacct/index.html")
9924 (supported-systems (filter target-linux? %supported-systems))
9925 (license license:gpl2+)))
9926
9927(define-public libnetfilter-log
9928 (package
9929 (name "libnetfilter-log")
9930 (version "1.0.2")
9931 (source
9932 (origin
9933 (method url-fetch)
9934 (uri (string-append "https://netfilter.org/projects/"
9935 "libnetfilter_log/files/"
9936 "libnetfilter_log-" version ".tar.bz2"))
9937 (sha256
9938 (base32
9939 "1spy9xs41v76kid5ana8n126f3mvgq6fjibbfbj4kn0larbhix73"))))
9940 (build-system gnu-build-system)
9941 (native-inputs (list pkg-config))
9942 (inputs (list libnfnetlink libmnl))
9943 (synopsis "Library providing interface to packets logged by netfilter")
9944 (description "libnetfilter_log is a userspace library providing interface to
9945packets that have been logged by the kernel packet filter. It is is part of a
9946system that deprecates the old syslog/dmesg based packet logging. This library
9947has been previously known as libnfnetlink_log.
9948
9949@enumerate
9950@item
9951receiving to-be-logged packets from the kernel nfnetlink_log subsystem
9952@end enumerate")
9953 (home-page "https://netfilter.org/projects/libnetfilter_log/index.html")
9954 (supported-systems (filter target-linux? %supported-systems))
9955 (properties '((upstream-name . "libnetfilter_log")))
9956 (license license:gpl2+)))
9957
9958(define-public ulogd
9959 (package
9960 (name "ulogd")
9961 (version "2.0.7")
9962 (source
9963 (origin
9964 (method url-fetch)
9965 (uri (string-append "https://netfilter.org/projects/" name
9966 "/files/ulogd-" version ".tar.bz2"))
9967 (sha256
9968 (base32
9969 "0ax9959c4bapq78n13bbaibcf1gwjir3ngx8l2dh45lw9m4ha2lr"))))
9970 (build-system gnu-build-system)
9971 (outputs '("out"
9972 ;; additional non-default output plugins
9973 "json" "pcap" "sqlite3" "pgsql" "mysql"))
9974 (native-inputs (list pkg-config))
9975 (inputs (list libnfnetlink
9976 libmnl
9977 libnetfilter-log
9978 libnetfilter-conntrack
9979 libnetfilter-acct
9980 sqlite
9981 libpcap
9982 jansson
9983 postgresql
9984 (list mariadb "dev")
9985 zlib
9986 openssl))
9987 (arguments
9988 (list #:configure-flags
9989 #~(list (string-append "--with-pgsql="
9990 (assoc-ref %build-inputs "postgresql"))
9991 (string-append "--with-mysql="
9992 (assoc-ref %build-inputs "mariadb")))
9993 #:phases
9994 #~(modify-phases %standard-phases
9995 (add-after 'install 'install-doc
9996 (lambda _
9997 (let ((out-etc (string-append #$output "/etc"))
9998 (ulogd.conf "ulogd.conf"))
9999 (mkdir-p out-etc)
10000 (copy-file ulogd.conf (string-append out-etc "/"
10001 ulogd.conf)))))
10002 (add-after 'install 'setup-plugin-outputs
10003 (lambda* (#:key outputs #:allow-other-keys)
10004 (with-directory-excursion
10005 (string-append #$output "/lib/ulogd/")
10006 (for-each
10007 (lambda (output-name)
10008 (let ((output-dir (string-append
10009 (assoc-ref outputs output-name)
10010 "/lib/ulogd/")))
10011 (mkdir-p output-dir)
10012 (for-each
10013 (lambda (plugin)
10014 (copy-file plugin (string-append output-dir plugin))
10015 (delete-file plugin))
10016 (find-files "."
10017 (string-append "ulogd_output_"
10018 (string-upcase output-name)
10019 ".*$")))))
10020 (list "json" "pcap" "sqlite3" "pgsql" "mysql"))))))))
10021 (synopsis "Logging daemon for netfilter and iptables")
10022 (description "ulogd is a userspace logging daemon for netfilter/iptables
10023related logging. This includes per-packet logging of security violations,
10024per-packet logging for accounting, per-flow logging and flexible user-defined
10025accounting.
10026
10027@enumerate
10028@item
10029Packet and flow-based traffic accounting
10030@item
10031Flexible user-defined traffic accounting via nfacct infrastructure
10032@item
10033SQL database back-end support: SQLite3, PostgreSQL, MySQL
10034@item
10035Text-based output formats: CSV, XML, Netfilter's LOG, Netfilter's conntrack
10036@end enumerate")
10037 (home-page "https://netfilter.org/projects/nfacct/index.html")
10038 (supported-systems (filter target-linux? %supported-systems))
10039 (license license:gpl2)))
10040
10041(define-public proot
10042 (package
10043 (name "proot")
10044 (version "5.4.0")
10045 (source
10046 (origin
10047 (method git-fetch)
10048 (uri (git-reference
10049 (url "https://github.com/proot-me/PRoot")
10050 (commit (string-append "v" version))))
10051 (file-name (git-file-name name version))
10052 (sha256
10053 (base32 "186qsg4yvisqjgf8w5jxhnlig7x341vpqwcgp8as3r59qmqkpmk7"))
10054 ;; Waiting for upstream inclusion at
10055 ;; https://github.com/proot-me/proot/pull/355
10056 (patches (search-patches "proot-add-clone3.patch"
10057 "proot-add-missing-include.patch"))))
10058 (build-system gnu-build-system)
10059 ;; Many architectures are not supported (see:
10060 ;; https://github.com/proot-me/proot/blob/master/src/arch.h#L51).
10061 (supported-systems '("x86_64-linux" "i686-linux"
10062 "armhf-linux" "aarch64-linux" "i586-gnu" "x86_64-gnu"))
10063 (arguments
10064 ;; Disable the test suite on armhf-linux, as there are too many
10065 ;; failures to keep track of (see for example:
10066 ;; https://github.com/proot-me/proot/issues/286).
10067 (list
10068 #:tests? (not (or (%current-target-system)
10069 (string-prefix? "armhf"
10070 (or (%current-system)))))
10071 #:make-flags
10072 #~'("-C" "src")
10073 #:phases
10074 #~(modify-phases %standard-phases
10075 (add-after 'unpack 'patch-sources
10076 (lambda* (#:key inputs #:allow-other-keys)
10077 (substitute* (find-files "src" "\\.[ch]$")
10078 (("\"/bin/sh\"")
10079 (format #f "~s" (search-input-file inputs "/bin/sh"))))
10080
10081 (substitute* "src/GNUmakefile"
10082 (("/bin/echo") (which "echo"))
10083 (("^VERSION = .*")
10084 (string-append "VERSION := " #$version "\n")))
10085
10086 (substitute* (find-files "test" "\\.sh$")
10087 ;; Some of the tests try to "bind-mount" /bin/true.
10088 (("-b /bin/true:")
10089 (string-append "-b " (which "true") ":"))
10090 ;; Likewise for /bin.
10091 (("-b /bin:") "-b /gnu:")
10092 ;; Others try to run /bin/sh.
10093 (("/bin/sh") (which "sh"))
10094 ;; Others assume /etc/fstab exists.
10095 (("/etc/fstab") "/etc/passwd"))
10096 (substitute* "test/GNUmakefile"
10097 (("-b /bin:") "-b /gnu:"))
10098 (substitute* "test/test-c6b77b77.mk"
10099 (("/bin/bash") (which "bash"))
10100 (("/usr/bin/test") (which "test")))
10101 (substitute* "test/test-16573e73.c"
10102 (("/bin/([a-z-]+)" _ program)
10103 (which program)))
10104 (substitute* "test/test-5467b986.sh"
10105 (("-w /usr") "-w /gnu")
10106 (("-w usr") "-w gnu")
10107 (("/usr/share") "/gnu/store")
10108 (("share") "store"))
10109 (substitute* "test/test-092c5e26.sh"
10110 (("-q echo ")
10111 "-q $(which echo) "))
10112
10113 ;; The socket tests requires networking.
10114 (for-each delete-file
10115 (find-files "test" "test-socket.*\\.sh$"))))
10116 (delete 'configure)
10117 (add-after 'build 'build-manpage
10118 (lambda _
10119 (with-directory-excursion "doc"
10120 (invoke "make" "proot/man.1" "SUFFIX=.py"))))
10121 (replace 'check
10122 (lambda* (#:key tests? #:allow-other-keys)
10123 (when tests?
10124 ;; Most of the tests expect "/bin" to be in $PATH so
10125 ;; they can run things that live in $ROOTFS/bin.
10126 (setenv "PATH" (string-append (getenv "PATH") ":/bin"))
10127 (invoke "make" "check" "-C" "test"
10128 "-j" (number->string (parallel-job-count))))))
10129 (replace 'install
10130 (lambda _
10131 ;; The 'install' rule does nearly nothing.
10132 (let ((man1 (string-append #$output "/share/man/man1")))
10133 ;; TODO: 'make install-care' (does not even
10134 ;; build currently.)
10135 (invoke "make" "-C" "src" "install"
10136 (string-append "PREFIX=" #$output))
10137 (mkdir-p man1)
10138 (copy-file "doc/proot/man.1"
10139 (string-append man1 "/proot.1"))))))))
10140 (native-inputs (list which
10141 ;; For 'mcookie', used by some of the tests.
10142 util-linux
10143 coreutils
10144 pkg-config
10145 ;; For rst2man, used to generate the manual page.
10146 python-docutils-0.19))
10147 (inputs (list libarchive talloc))
10148 (home-page "https://github.com/proot-me/PRoot")
10149 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
10150 (description
10151 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
10152and @code{binfmt_misc}. This means that users don't need any privileges or
10153setup to do things like using an arbitrary directory as the new root
10154file system, making files accessible somewhere else in the file system
10155hierarchy, or executing programs built for another CPU architecture
10156transparently through QEMU user-mode. Also, developers can use PRoot as a
10157generic process instrumentation engine thanks to its extension mechanism.
10158Technically PRoot relies on @code{ptrace}, an unprivileged system-call
10159available in the kernel Linux.")
10160 (license license:gpl2+)))
10161
10162(define-public proot-static
10163 (package
10164 (inherit proot)
10165 (name "proot-static")
10166 (synopsis
10167 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
10168 (inputs (list talloc/static))
10169 (arguments
10170 (substitute-keyword-arguments arguments
10171 ((#:make-flags flags)
10172 #~(cons* "LDFLAGS = -ltalloc -static -static-libgcc" #$flags))
10173 ((#:phases phases)
10174 #~(modify-phases #$phases
10175 (add-after 'strip 'remove-store-references
10176 (lambda _
10177 (with-directory-excursion #$output
10178 (remove-store-references "bin/proot"))))))
10179 ((#:allowed-references _ '("out"))
10180 '("out"))))))
10181
10182(define-public cpuid
10183 (package
10184 (name "cpuid")
10185 (version "20260220")
10186 (source (origin
10187 (method url-fetch)
10188 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
10189 version ".src.tar.gz"))
10190 (sha256
10191 (base32
10192 "1ywg1fzbk153sil3n0mdrah3728j76dbjj8c24gig4g5bbbhyqp7"))))
10193 (build-system gnu-build-system)
10194 (arguments
10195 (list #:make-flags
10196 #~(list (string-append "CC=" #$(cc-for-target)))
10197 #:tests? #f ; no tests
10198 #:phases
10199 #~(modify-phases %standard-phases
10200 (delete 'configure) ; no configure script
10201 (add-before 'install 'fix-makefile
10202 (lambda* (#:key outputs #:allow-other-keys)
10203 (substitute* "Makefile"
10204 (("\\$\\(BUILDROOT\\)/usr")
10205 (assoc-ref outputs "out"))))))))
10206 (inputs (list perl))
10207 (supported-systems '("i686-linux" "x86_64-linux"))
10208 (home-page "https://www.etallen.com/cpuid.html")
10209 (synopsis "Dump x86 CPUID processor information")
10210 (description "cpuid dumps detailed information about the CPU(s) gathered
10211from the CPUID instruction, and also determines the exact model of CPU(s). It
10212supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
10213NexGen, Rise, and SiS CPUs.")
10214 (license license:gpl2+)))
10215
10216(define-public jmtpfs
10217 (package
10218 (name "jmtpfs")
10219 (version "0.5")
10220 (source
10221 (origin
10222 (method git-fetch)
10223 (uri (git-reference
10224 (url "https://github.com/JasonFerrara/jmtpfs")
10225 (commit (string-append "v" version))))
10226 (file-name (git-file-name name version))
10227 (sha256
10228 (base32
10229 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
10230 (build-system gnu-build-system)
10231 (inputs
10232 (list file fuse-2 libmtp))
10233 (native-inputs
10234 (list pkg-config))
10235 (home-page "https://github.com/JasonFerrara/jmtpfs")
10236 (synopsis "Use a FUSE file system to access data over MTP")
10237 (description "jmtpfs uses @acronym{FUSE, File system in USEr space} to
10238provide access to data over @acronym{MTP, the Media Transfer Protocol}.
10239Unprivileged users can mount the MTP device as a file system.")
10240 (license license:gpl3)))
10241
10242(define-public procenv
10243 (package
10244 (name "procenv")
10245 (version "0.60")
10246 (source
10247 (origin
10248 (method git-fetch)
10249 (uri (git-reference
10250 (url "https://github.com/jamesodhunt/procenv")
10251 (commit version)))
10252 (file-name (git-file-name name version))
10253 (sha256
10254 (base32 "00d7q0h4qjc8lg435lq77lp2fx6ikm5piq90m81mr1dqqna1g6pz"))))
10255 (build-system gnu-build-system)
10256 (native-inputs
10257 (list pkg-config
10258 ;; For tests.
10259 check groff))
10260 (inputs
10261 (list expat libcap libselinux))
10262 (synopsis "Utility to show process environment")
10263 (description
10264 "Procenv is a command-line tool that displays as much detail about
10265itself and its environment as possible. It can be used as a test
10266tool, to understand the type of environment a process runs in, and for
10267comparing system environments.")
10268 (home-page "https://github.com/jamesodhunt/procenv/")
10269 (license license:gpl3+)))
10270
10271(define-public cassini-headers
10272 (package
10273 (name "cassini-headers")
10274 (version "14.0.0")
10275 (home-page "https://github.com/HewlettPackard/shs-cassini-headers")
10276 (source (origin
10277 (method git-fetch)
10278 (uri (git-reference
10279 (url home-page)
10280 (commit (string-append "release/shs-" version))))
10281 (file-name (git-file-name name version))
10282 (sha256
10283 (base32
10284 "074r1snc682f1b6vgswyz55n8zjf5rhqnsl31xsswih7q9q38jda"))
10285 (patches (search-patches "cassini-headers-memset.patch"))))
10286 (build-system copy-build-system)
10287 (arguments
10288 (list #:install-plan
10289 #~'(("include" "include")
10290 ("share/cassini-headers" "share/cassini-headers"))))
10291 (synopsis "Cassini network hardware definitions and headers")
10292 (description
10293 "This package provides hardware definitions and C headers for use by
10294the Linux driver and by user-space applications for the Cassini/Slingshot
10295high-speed network interconnect made by HPE (formerly Cray). User-land
10296software uses @file{cxi_prov_hw.h} from this package.")
10297 ;; As per include/cxi_prov_hw.h it is __aarch64__ or __x86_64__ only.
10298 (supported-systems '("x86_64-linux" "aarch64-linux"))
10299 (license (list license:gpl2 license:bsd-2)))) ;dual-licensed
10300
10301(define-public cxi-driver
10302 (package
10303 (name "cxi-driver")
10304 (version "14.0.0")
10305 (home-page "https://github.com/HewlettPackard/shs-cxi-driver")
10306 (source
10307 (origin
10308 (method git-fetch)
10309 (uri (git-reference
10310 (url home-page)
10311 (commit (string-append "release/shs-" version))))
10312 (file-name (git-file-name name version))
10313 (sha256
10314 (base32
10315 "07dhdm1az9hvy48iq8bn0wypwyml59yr5aqqyf1yhwrf1basry9g"))))
10316 ;; TODO: Actually build the Linux driver.
10317 (build-system copy-build-system)
10318 (arguments
10319 (list #:install-plan #~'(("include" "include"))))
10320 (propagated-inputs (list cassini-headers))
10321 (synopsis "Linux driver for the Cassini/Slingshot interconnect")
10322 (description
10323 "This is the Linux driver for the Cray/HPE Cassini 1 and 2 high-speed
10324network interconnect (aka. Slingshot), and its Ethernet driver. It includes
10325the @file{uapi/misc/cxi.h} C header file for use by user-land software.
10326
10327Currently the Linux driver itself is missing from this package.")
10328 (license license:gpl2+)))
10329
10330(define-public cxi-driver-for-libfabric-1
10331 ;; This old version defines constants such as 'CXI_MAP_IOVA_ALLOC' that
10332 ;; libfabric 1.22.0 relies on.
10333 (let ((commit "5f0ec0ead6ef3f98542a2ef5e76b89d14dd22150")
10334 (revision "0"))
10335 (package
10336 (inherit cxi-driver)
10337 (name "cxi-driver")
10338 (version (git-version "1.0.0" ;per .spec file
10339 revision commit))
10340 (home-page "https://github.com/HewlettPackard/shs-cxi-driver")
10341 (source
10342 (origin
10343 (method git-fetch)
10344 (uri (git-reference (url home-page) (commit commit)))
10345 (file-name (git-file-name name version))
10346 (sha256
10347 (base32
10348 "19cly014ihgdidrc1aki2xsbfhpc0g73v0vxcky8r27xza7rz5bg")))))))
10349
10350(define-public libcxi
10351 (package
10352 (name "libcxi")
10353 ;; Note: Do not upgrade until
10354 ;; <https://github.com/HewlettPackard/shs-libcxi/issues/18> is resolved.
10355 (version "13.0.0")
10356 (home-page "https://github.com/HewlettPackard/shs-libcxi")
10357 (source
10358 (origin
10359 (method git-fetch)
10360 (uri (git-reference (url home-page)
10361 (commit (string-append "release/shs-" version))))
10362 (file-name (git-file-name name version))
10363 (sha256
10364 (base32 "1m8mds1h8plhfn2ja9br31xaiy82ky69685cp1rznanl18inaiff"))))
10365 (build-system gnu-build-system)
10366 (arguments
10367 (list #:configure-flags
10368 #~(list "--disable-static"
10369 (string-append "--with-udevrulesdir="
10370 #$output "/lib/udev/rules.d"))
10371
10372 #:phases
10373 #~(modify-phases %standard-phases
10374 (add-before 'configure 'set-cassini-file-names
10375 (lambda* (#:key inputs #:allow-other-keys)
10376 (substitute* "utils/cxi_dump_csrs.py"
10377 (("/usr/share/cassini-headers/csr_defs.json")
10378 (search-input-file
10379 inputs
10380 "/share/cassini-headers/csr_defs.json"))))))))
10381 (native-inputs (list autoconf
10382 automake
10383 libtool
10384 pkg-config
10385 python-wrapper))
10386 (inputs (list libconfig
10387 libuv
10388 fuse-2
10389 libyaml
10390 libnl
10391 numactl
10392 eudev
10393 (list lm-sensors "lib")))
10394 (propagated-inputs (list cassini-headers cxi-driver))
10395 (synopsis "Interface to the Cassini/Slingshot high-speed interconnect")
10396 (description
10397 "Libcxi provides applications with a low-level interface to the
10398Cray/HPE Cassini high-speed @acronym{NIC, network interface controller}, also
10399known as Slingshot.")
10400
10401 ;; License is spelled out in 'cray-libcxi.spec' and in source file
10402 ;; headers.
10403 (license (list license:lgpl2.1+ license:bsd-3)))) ;dual-licensed
10404
10405(define-public libfabric
10406 (package
10407 (name "libfabric")
10408 (version "2.5.1")
10409 (source
10410 (origin
10411 (method git-fetch)
10412 (uri (git-reference
10413 (url "https://github.com/ofiwg/libfabric")
10414 (commit (string-append "v" version))))
10415 (file-name (git-file-name name version))
10416 (sha256 (base32 "15z0g1z62hv6kkiksvpxl6xv07wdmnvqhm5vnh0vq4ipr8f5vikp"))))
10417 (build-system gnu-build-system)
10418 (native-inputs
10419 (list autoconf
10420 automake
10421 libtool))
10422 (inputs
10423 (let ((if-supported ;XXX: modified from openmpi
10424 (lambda (package . extra)
10425 (if (and (not (%current-target-system))
10426 (member (%current-system)
10427 (package-transitive-supported-systems package)))
10428 (cons package extra)
10429 '()))))
10430 (append (list rdma-core libnl)
10431 (if-supported psm)
10432 (if-supported psm2)
10433 (if-supported libcxi curl json-c))))
10434 (arguments
10435 (list #:configure-flags
10436 #~(append (if #$(target-64bit?)
10437 (list "--enable-efa")
10438 '())
10439 (list #$@(if (this-package-input "libcxi")
10440 #~("--enable-cxi")
10441 #~())
10442 #$@(if (this-package-input "rocr-runtime")
10443 #~((string-append "--with-rocr="
10444 #$(this-package-input "rocr-runtime")))
10445 #~())
10446 "--enable-verbs"))
10447 #:phases
10448 #~(modify-phases %standard-phases
10449 (add-after 'install 'remove-libtool-archive
10450 (lambda _
10451 ;; 'libfabric.la' has '-ljson-c' without a corresponding
10452 ;; '-L' in 'dependency_libs', which in turn causes users
10453 ;; such as Open MPI to fail at link time due to '-ljson-c'
10454 ;; not being found, even when building a shared library.
10455 ;; So, remove the .la file.
10456 (delete-file
10457 (string-append #$output
10458 "/lib/libfabric.la")))))))
10459 (home-page "https://ofiwg.github.io/libfabric/")
10460 (synopsis "Open Fabric Interfaces")
10461 (description
10462 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
10463communication services to applications. OFI is best described as a collection
10464of libraries and applications used to export fabric services. The key
10465components of OFI are: application interfaces, provider libraries, kernel
10466services, daemons, and test applications.
10467
10468Libfabric is a core component of OFI. It is the library that defines and
10469exports the user-space API of OFI, and is typically the only software that
10470applications deal with directly. It works in conjunction with provider
10471libraries, which are often integrated directly into libfabric.")
10472 (license (list license:bsd-2 license:gpl2)))) ;dual
10473
10474;; Note: ROCm support is kept separate to avoid a significant increase in
10475;; closure size: <https://codeberg.org/guix/guix/issues/7225>.
10476(define-public libfabric-rocm
10477 (package/inherit libfabric
10478 (name "libfabric-rocm")
10479 (inputs (modify-inputs inputs
10480 (append rocr-runtime)))
10481 (synopsis "Open Fabric Interfaces (with ROCm support)")))
10482
10483(define-public libfabric-1 ;needed by Open MPI 4.x
10484 (package
10485 (inherit libfabric)
10486 (name "libfabric")
10487 (version "1.22.0")
10488 (source
10489 (origin
10490 (method git-fetch)
10491 (uri (git-reference
10492 (url "https://github.com/ofiwg/libfabric")
10493 (commit (string-append "v" version))))
10494 (file-name (git-file-name name version))
10495 (sha256 (base32 "1scwkfdnlg20hld03pdq83jq1q3nmvj1gravpn02pacqq18bv9xk"))))
10496 (inputs
10497 (modify-inputs inputs
10498 (append cxi-driver-for-libfabric-1)))))
10499
10500(define-public psm
10501 (package
10502 (name "psm")
10503 (version "3.3.20170428")
10504 (home-page "https://github.com/intel/psm")
10505 (source
10506 (origin
10507 (method git-fetch)
10508 (uri (git-reference (url home-page)
10509 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
10510 (file-name (string-append "psm-" version ".tar.gz"))
10511 (sha256
10512 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
10513 (patches (search-patches
10514 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
10515 "psm-ldflags.patch" ; build shared lib with LDFLAGS
10516 "psm-repro.patch" ; reproducibility
10517 "psm-disable-memory-stats.patch"))
10518 (modules '((guix build utils)))
10519 (snippet
10520 ;; That file declares its own 'strlcat' as static. To avoid a
10521 ;; conflict with the function now in glibc 2.39, give it a
10522 ;; different name.
10523 #~(substitute* "ptl_ips/ips_proto_dump.c"
10524 (("strlcat")
10525 "psm_custom_strlcat")))))
10526 (build-system gnu-build-system)
10527 (outputs '("out" "debug"))
10528 (inputs `(("libuuid" ,util-linux "lib")))
10529 (arguments
10530 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
10531 ,(string-append "INSTALL_PREFIX=" %output)
10532 ,(string-append "CFLAGS=-Wall -fpic -fPIC -D_GNU_SOURCE"
10533 " -funwind-tables -O3 -g3"
10534 " -DPSM_USE_SYS_UUID"
10535 " -Wno-strict-aliasing -DNVALGRIND"
10536 " -fcommon")
10537 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
10538 #:tests? #f
10539 #:phases (modify-phases %standard-phases
10540 (delete 'configure)
10541 (add-after 'unpack 'patch-/usr/include
10542 (lambda _
10543 (substitute* "Makefile"
10544 (("\\$\\{DESTDIR}/usr/include")
10545 (string-append %output "/include")))
10546 (substitute* "Makefile"
10547 (("/lib64") "/lib"))
10548 #t))
10549 (add-after 'unpack 'patch-sysmacros
10550 (lambda _
10551 (substitute* "ipath/ipath_proto.c"
10552 (("#include <sys/poll.h>" m)
10553 (string-append m "\n"
10554 "#include <sys/sysmacros.h>")))
10555 #t)))))
10556 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
10557 (description
10558 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
10559communications interface for the True Scale family of products. PSM users are
10560enabled with mechanisms necessary to implement higher level communications
10561interfaces in parallel environments.")
10562 ;; Only Intel-compatible processors are supported.
10563 (supported-systems '("i686-linux" "x86_64-linux"))
10564 (license (list license:bsd-2 license:gpl2)))) ;dual
10565
10566(define-public snapscreenshot
10567 (package
10568 (name "snapscreenshot")
10569 (version "1.0.14.3")
10570 (source
10571 (origin
10572 (method url-fetch)
10573 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
10574 name "-" version ".tar.bz2"))
10575 (sha256
10576 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
10577 (build-system gnu-build-system)
10578 (arguments
10579 `(#:make-flags
10580 (let ((out (assoc-ref %outputs "out")))
10581 (list (string-append "BINDIR=" out "/bin")
10582 (string-append "MANDIR=" out "/share/man")))
10583 #:tests? #f ; no test suite
10584 #:phases
10585 (modify-phases %standard-phases
10586 (delete 'configure) ; ./configure is a snarky no-op
10587 (add-before 'install 'fix-ownership
10588 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
10589 (lambda _
10590 (substitute* "depfun.mak"
10591 ((" -o bin -g bin ") " "))
10592 #t))
10593 (add-before 'install 'create-output-directories
10594 (lambda* (#:key outputs #:allow-other-keys)
10595 (let ((out (assoc-ref outputs "out")))
10596 (mkdir-p (string-append out "/share/man/man1"))
10597 #t))))))
10598 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
10599 (synopsis "Take screenshots of one or more Linux text consoles")
10600 (description
10601 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
10602Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
10603relevant @file{/dev/vcs*} file(s).")
10604 (license license:gpl2)))
10605
10606(define-public fbcat
10607 (package
10608 (name "fbcat")
10609 (version "0.5.2")
10610 (source
10611 (origin
10612 (method url-fetch)
10613 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
10614 version "/" name "-" version ".tar.gz"))
10615 (sha256
10616 (base32 "07q6f0xj7b4gjvn69qfn0g04yd0ch8ndzyigcz8nnrhli0cvsbh6"))))
10617 (build-system gnu-build-system)
10618 (outputs (list "out" "fbgrab"))
10619 (arguments
10620 (list
10621 #:make-flags
10622 #~(list "CC=gcc" (string-append "PREFIX=" #$output))
10623 #:tests? #f ;no tests
10624 #:phases
10625 #~(modify-phases %standard-phases
10626 (delete 'configure) ;no configure script
10627 (add-after 'build 'qualify-references
10628 (lambda* (#:key inputs #:allow-other-keys)
10629 (let ((pnmtopng (assoc-ref inputs "pnmtopng")))
10630 (substitute* "fbgrab"
10631 (("fbcat" all)
10632 (string-append #$output "/bin/" all))
10633 (("pnmtopng")
10634 (search-input-file inputs "/bin/pnmtopng"))))))
10635 (add-after 'install 'split-fbgrab-output
10636 (lambda _
10637 (for-each (lambda (file)
10638 (let ((old (string-append #$output "/" file))
10639 (new (string-append #$output:fbgrab "/" file)))
10640 (mkdir-p (dirname new))
10641 (rename-file old new)))
10642 (list "bin/fbgrab" "share/man/man1/fbgrab.1")))))))
10643 (inputs
10644 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
10645 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
10646 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
10647 (list netpbm))
10648 (home-page "https://jwilk.net/software/fbcat")
10649 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
10650 (description
10651 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
10652a dump thereof. It supports a wide range of drivers and pixel formats.
10653
10654@command{fbcat} can take screenshots of virtually any application that can be
10655made to write its output to the framebuffer, including (but not limited to)
10656text-mode or graphical applications that don't use a display server.
10657
10658Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
10659emulates the behaviour of Gunnar Monell's older fbgrab utility.")
10660 (license license:gpl2)))
10661
10662(define-public fbgrab
10663 (package
10664 (name "fbgrab")
10665 (version "1.5")
10666 (source (origin
10667 (method git-fetch)
10668 (uri (git-reference
10669 (url "https://github.com/GunnarMonell/fbgrab")
10670 (commit version)))
10671 (file-name (git-file-name name version))
10672 (sha256
10673 (base32
10674 "1npn7l8jg0nhjraybjl38v8635zawzmn06ql3hs3vhci1vi1r90r"))))
10675 (build-system gnu-build-system)
10676 (arguments
10677 (list #:tests? #f ;no test suite
10678 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
10679 (string-append "DESTDIR=" #$output))
10680 #:phases #~(modify-phases %standard-phases
10681 (add-after 'unpack 'strip-/usr-prefix
10682 (lambda _
10683 (substitute* "Makefile"
10684 (("/usr") ""))))
10685 (delete 'configure))))
10686 (inputs (list libpng zlib))
10687 (home-page "https://github.com/GunnarMonell/fbgrab")
10688 (synopsis "Linux framebuffer screenshot/conversion utility")
10689 (description "FBGrab is a framebuffer screenshot program that captures the
10690Linux framebuffer and converts it to a PNG image. It can also convert a
10691framebuffer dump file (copy) to a PNG image.")
10692 (license license:gpl2))) ;GPL 2.0 only (per SPDX identifier in fbgrab.c)
10693
10694(define-public libcgroup
10695 (package
10696 (name "libcgroup")
10697 (version "3.2.0")
10698 (home-page "https://github.com/libcgroup/libcgroup")
10699 (source
10700 (origin
10701 (method url-fetch)
10702 (uri (string-append
10703 "https://github.com/libcgroup/libcgroup/releases/download/v"
10704 version "/" name "-" version ".tar.gz"))
10705 (sha256
10706 (base32 "1zmxhqp8kj2n7yvj82nsy5sx07yrxj4r37w41lz5q8bpqgbc43ws"))))
10707 (build-system gnu-build-system)
10708 (arguments
10709 ;; Tests are virtualized with lxc, it is not very feasible
10710 ;; to make them executable under guix build. Also, note that
10711 ;; origin is using source tarball release which is prepared
10712 ;; after testing.
10713 (list #:tests? #f
10714 #:configure-flags
10715 #~'("--disable-systemd")))
10716 (native-inputs
10717 (list bison flex))
10718 (inputs
10719 (list linux-pam))
10720 (synopsis "Control groups management tools")
10721 (description "Control groups is Linux kernel method for process resource
10722restriction, permission handling and more. This package provides userspace
10723interface to this kernel feature.")
10724 (license license:lgpl2.1)))
10725
10726(define-public mbpfan
10727 (package
10728 (name "mbpfan")
10729 (version "2.4.0")
10730 (source
10731 (origin
10732 (method git-fetch)
10733 (uri (git-reference
10734 (url "https://github.com/dgraziotin/mbpfan")
10735 (commit (string-append "v" version))))
10736 (file-name (git-file-name name version))
10737 (sha256
10738 (base32 "146sshsjafi26n741jvi9mdbazwf74jlacxfwkky4fhbq98idlhp"))))
10739 (build-system gnu-build-system)
10740 (arguments
10741 (list #:tests? #f ; tests ask to be run as root
10742 #:make-flags
10743 #~(list (string-append "DESTDIR=" #$output)
10744 (string-append "CC=" #$(cc-for-target)))
10745 #:phases
10746 #~(modify-phases %standard-phases
10747 (add-after 'unpack 'patch-paths
10748 (lambda _
10749 (substitute* "Makefile"
10750 (("/usr") ""))))
10751 (delete 'configure)))) ; there's no configure phase
10752 (home-page "https://github.com/dgraziotin/mbpfan")
10753 (synopsis "Control fan speed on Macbooks")
10754 (description
10755 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
10756the @code{coretemp} module and sets the fan speed using the @code{applesmc}
10757module. It can be executed as a daemon or in the foreground with root
10758privileges.")
10759 (license license:gpl3+)))
10760
10761(define-public psm2
10762 (package
10763 (name "psm2")
10764 (version "12.0")
10765 (source (origin
10766 (method git-fetch)
10767 (uri (git-reference
10768 (url "https://github.com/intel/opa-psm2")
10769 ;; tag 'psm-v12.0' = commit ad5dd1b
10770 (commit (string-append "psm-v" version))))
10771 (file-name (git-file-name name version))
10772 (sha256
10773 (base32
10774 "04nar65ac11qqx41vkfs7iip8kfiah0zms7l4rmsxncpiz2iqfik"))
10775 (patches
10776 (search-patches
10777 "psm2-compile-ctor-without-avx.patch"))
10778 (modules '((guix build utils)))
10779 (snippet
10780 ;; That file declares its own 'strlcat' as static. To avoid a
10781 ;; conflict with the function now in glibc 2.39, give it a
10782 ;; different name.
10783 #~(substitute* "ptl_ips/ips_proto_dump.c"
10784 (("strlcat")
10785 "psm2_custom_strlcat")))))
10786 (build-system gnu-build-system)
10787 (arguments
10788 (list #:make-flags
10789 #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
10790 #:tests? #f
10791 #:phases #~(modify-phases %standard-phases
10792 (delete 'configure)
10793 (add-after 'unpack 'patch-Makefiles
10794 (lambda _
10795 (substitute* "Makefile"
10796 (("/lib64") "/lib")
10797 (("/usr") ""))
10798 (substitute* "compat/Makefile"
10799 (("/lib64") "/lib")
10800 (("/usr") ""))))
10801 (replace 'install
10802 (lambda _
10803 (setenv "DESTDIR" #$output)
10804 (invoke "make" "install"))))))
10805 (inputs
10806 (list rdma-core numactl))
10807 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
10808 (description
10809 "This package is low-level user-level Intel's communications interface.
10810The PSM2 API is a high-performance vendor-specific protocol that provides a
10811low-level communications interface for the Intel Omni-Path family of
10812high-speed networking devices.")
10813 (home-page "https://github.com/intel/opa-psm2")
10814 ;; Only the x86_64 architecture is supported.
10815 (supported-systems '("x86_64-linux"))
10816 (license (list license:bsd-3 license:gpl2)))) ; dual
10817
10818(define-public libpfm4
10819 (package
10820 (name "libpfm4")
10821 (version "4.9.0")
10822 (source (origin
10823 (method url-fetch)
10824 (uri (string-append "mirror://sourceforge/perfmon2/"
10825 name "/libpfm-" version ".tar.gz"))
10826 (sha256
10827 (base32
10828 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
10829 (build-system gnu-build-system)
10830 (arguments
10831 '(#:modules ((guix build utils)
10832 (guix build gnu-build-system))
10833 #:phases (modify-phases %standard-phases
10834 (delete 'configure)
10835 (delete 'check)
10836 (replace 'build
10837 (lambda* (#:key inputs outputs #:allow-other-keys)
10838 (let* ((out (assoc-ref outputs "out")))
10839 (setenv "CC" "gcc")
10840 (setenv "CFLAGS" "-Wno-format-truncation")
10841 (invoke "make")
10842 #t)))
10843 (replace 'install
10844 (lambda* (#:key outputs #:allow-other-keys)
10845 (let* ((out (assoc-ref outputs "out")))
10846 (invoke "make"
10847 (string-append "PREFIX=" out)
10848 "install")
10849 #t))))))
10850 (synopsis "Performance event monitoring library")
10851 (description
10852 "This package provides a library called libpfm4, which is used to develop
10853monitoring tools exploiting the performance monitoring events such as those
10854provided by the Performance Monitoring Unit (PMU) of modern processors.
10855
10856Libpfm4 helps convert from an event name, expressed as a string, to the event
10857encoding that is either the raw event as documented by the hardware vendor or
10858the OS-specific encoding. In the latter case, the library is able to prepare
10859the OS-specific data structures needed by the kernel to setup the event.
10860
10861libpfm4 provides support for the @code{perf_events} interface, which was
10862introduced in Linux 2.6.31.")
10863 (home-page "https://perfmon2.sourceforge.net/")
10864 (license license:expat)))
10865
10866(define-public libnfnetlink
10867 (package
10868 (name "libnfnetlink")
10869 (version "1.0.2")
10870 (source (origin
10871 (method url-fetch)
10872 (uri (string-append
10873 "https://www.netfilter.org/projects/libnfnetlink/files/"
10874 "libnfnetlink-" version ".tar.bz2"))
10875 (sha256
10876 (base32
10877 "0xn3rcrzxr6g82kfxzs9bqn2zvl2kf2yda30drwb9vr6sk1wfr5h"))))
10878 (build-system gnu-build-system)
10879 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
10880 (synopsis "Low-level netfilter netlink communication library")
10881 (description
10882 "@code{libnfnetlink} is the low-level library for netfilter related
10883kernel/userspace communication. It provides a generic messaging
10884infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
10885nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
10886management tools in userspace.")
10887 (license license:gpl2)))
10888
10889(define-public libinih
10890 (package
10891 (name "libinih")
10892 (version "62")
10893 (source (origin
10894 (method git-fetch)
10895 (uri (git-reference
10896 (url "https://github.com/benhoyt/inih")
10897 (commit (string-append "r" version))))
10898 (file-name (git-file-name name version))
10899 (sha256
10900 (base32
10901 "0yl5057682gvk1iszjkz4hy73yv45l7wr3fwhbgyf7r7fwx0cwwf"))))
10902 (build-system meson-build-system)
10903 ;; Install static libraries for use by the initrd's xfsprogs/static.
10904 (outputs (list "out" "static"))
10905 (arguments
10906 `(#:configure-flags
10907 (list "-Ddistro_install=true"
10908 "-Ddefault_library=both")
10909 #:phases
10910 (modify-phases %standard-phases
10911 (add-after 'install 'separate-static
10912 (lambda* (#:key outputs #:allow-other-keys)
10913 (let ((out (assoc-ref outputs "out"))
10914 (static (assoc-ref outputs "static")))
10915 (with-directory-excursion out
10916 (for-each (lambda (source)
10917 (let ((target (string-append static "/" source)))
10918 (mkdir-p (dirname target))
10919 (rename-file source target)))
10920 (find-files "lib" "\\.a$")))))))))
10921 (home-page "https://github.com/benhoyt/inih")
10922 (synopsis "Simple .INI parser library for C")
10923 (description "The inih (INI Not Invented Here) library is a simple .INI file
10924parser written in C. It's only a couple of pages of code, and it was designed to
10925be small and simple, so it's good for embedded systems. It's also more or less
10926compatible with Python's ConfigParser style of .INI files, including RFC
10927822-style multi-line syntax and name: value entries.")
10928 (license license:bsd-3)))
10929
10930(define-public simpleini
10931 (package
10932 (name "simpleini")
10933 (version "4.25")
10934 (source (origin
10935 (method git-fetch)
10936 (uri (git-reference
10937 (url "https://github.com/brofield/simpleini")
10938 (commit (string-append "v" version))))
10939 (file-name (git-file-name name version))
10940 (sha256
10941 (base32
10942 "1v9s0kr5ca1gdbnlkdz7chzypy0wz95f09l0r6jnmff4qy6db56l"))))
10943 (build-system cmake-build-system)
10944 (arguments
10945 (list #:configure-flags #~(list "-DSIMPLEINI_USE_SYSTEM_GTEST=ON")))
10946 (native-inputs (list googletest))
10947 (home-page "https://github.com/brofield/simpleini")
10948 (synopsis "Simple API to read and write INI-style files")
10949 (description
10950 "SimpleIni provides a simple API to read and write INI-style
10951configuration files. It supports data files in ASCII, MBCS and Unicode.")
10952 (license license:expat)))
10953
10954(define-public xfsprogs
10955 (package
10956 (name "xfsprogs")
10957 (version "6.12.0")
10958 (source
10959 (origin
10960 (method url-fetch)
10961 (uri (string-append "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
10962 "xfsprogs-" version ".tar.gz"))
10963 (sha256
10964 (base32 "1n46n27fxx1137kni3drrhzhp1l8ksxabcsmi8yzxbhpbnl4q293"))))
10965 (build-system gnu-build-system)
10966 (outputs (list "out" "python"))
10967 (arguments
10968 (list
10969 #:tests? #f ;kernel/user integration tests are in package "xfstests"
10970 #:configure-flags
10971 #~(list "--disable-static")
10972 #:make-flags
10973 #~(list "V=1")
10974 #:phases
10975 #~(modify-phases %standard-phases
10976 (add-after 'install 'separate-python-output
10977 (lambda _
10978 (for-each
10979 (lambda (script)
10980 (mkdir-p (string-append #$output:python (dirname script)))
10981 (rename-file (string-append #$output script)
10982 (string-append #$output:python script)))
10983 (list "/sbin/xfs_scrub_all"))))
10984 (add-after 'install 'install-headers
10985 (lambda* (#:key make-flags #:allow-other-keys)
10986 (apply invoke "make" "install-dev" make-flags))))))
10987 (native-inputs (list gettext-minimal))
10988 (inputs (list libinih
10989 liburcu
10990 (list util-linux "lib")
10991 python-wrapper))
10992 (home-page "https://xfs.wiki.kernel.org/")
10993 (synopsis "XFS file system tools")
10994 (description "This package provides commands to create and check XFS
10995file systems.")
10996 ;; The library "libhandle" and the headers in "xfslibs-dev" are
10997 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
10998 (license (list license:gpl2 license:lgpl2.1))))
10999
11000(define-public xfsprogs-5.9
11001 (package
11002 (inherit xfsprogs)
11003 (name "xfsprogs")
11004 (version "5.9.0")
11005 (source (origin
11006 (method url-fetch)
11007 (uri (string-append
11008 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
11009 "xfsprogs-" version ".tar.gz"))
11010 (sha256
11011 (base32
11012 "13xkn9jpmwp4fm9r68vhgznkmxhnv83n2b39mhy2qdaph90w2a1l"))))
11013 (arguments
11014 (substitute-keyword-arguments arguments
11015 ((#:configure-flags configure-flags #~(list))
11016 #~(cons* "--enable-gettext=no" #$configure-flags))))
11017 (native-inputs
11018 (modify-inputs native-inputs
11019 (delete "gettext-minimal")))))
11020
11021(define-public xfsprogs/static
11022 (package
11023 (inherit xfsprogs)
11024 (name "xfsprogs-static")
11025 (outputs (list "out"))
11026 (arguments
11027 (substitute-keyword-arguments arguments
11028 ((#:configure-flags configure-flags #~(list))
11029 #~(append #$configure-flags
11030 (list "--enable-static")))
11031 ((#:make-flags make-flags #~(list))
11032 #~(cons* "LLDFLAGS=-all-static" #$make-flags))
11033 ((#:phases _ #~%standard-phases)
11034 #~(modify-phases %standard-phases
11035 (add-after 'install 'delete-useless-files
11036 (lambda _
11037 (with-directory-excursion #$output
11038 (for-each delete-file-recursively
11039 (list "include" "lib")))))))))
11040 (inputs
11041 (modify-inputs inputs
11042 (delete "python-wrapper")
11043 (prepend (list libinih "static")
11044 (list util-linux "static"))))
11045 (synopsis "Statically linked XFS file system tools")))
11046
11047(define-public xfs-repair/static
11048 (package
11049 (name "xfs-repair-static")
11050 (version (package-version xfsprogs/static))
11051 (source #f)
11052 (build-system trivial-build-system)
11053 (arguments
11054 (list
11055 #:modules `((guix build utils))
11056 #:builder
11057 #~(begin
11058 (use-modules (guix build utils))
11059 (let ((sbin (string-append #$output "/sbin")))
11060 (install-file (search-input-file %build-inputs "/sbin/xfs_repair")
11061 sbin)
11062 (with-directory-excursion sbin
11063 (remove-store-references "xfs_repair"))))))
11064 (inputs (list xfsprogs/static))
11065 (home-page (package-home-page xfsprogs/static))
11066 (synopsis "Statically linked @command{xfs_repair} from xfsprogs")
11067 (description
11068 "This package provides a statically linked @command{xfs_repair} taken
11069from the xfsprogs package. It is meant to be used in initrds.")
11070 (license (package-license xfsprogs/static))))
11071
11072(define-deprecated-package xfs_repair/static
11073 "xfs_repair-static" xfs-repair/static)
11074
11075(define-public genext2fs
11076 (package
11077 (name "genext2fs")
11078 (version "1.5.0")
11079 (source (origin
11080 (method git-fetch)
11081 (uri (git-reference
11082 (url "https://github.com/bestouff/genext2fs")
11083 (commit "474111097321f03de9e009aa9f7d4a8948e310b2")))
11084 (file-name (git-file-name name version))
11085 (sha256
11086 (base32 "14lgvml5zz99845ja47jpf4iirjzfqv36ffzachh3hw2ggji9c7l"))))
11087 (build-system gnu-build-system)
11088 (native-inputs
11089 (list autoconf automake))
11090 (home-page "https://github.com/bestouff/genext2fs")
11091 (synopsis "Generate ext2 file system as a normal user")
11092 (description "This package provides a program to generate an ext2
11093file system as a normal (non-root) user. It does not require you to mount
11094the image file to copy files on it, nor does it require that you become
11095the superuser to make device nodes.")
11096 (license license:gpl2)))
11097
11098(define-public fakeroot
11099 (package
11100 (name "fakeroot")
11101 (version "1.38")
11102 (source
11103 (origin
11104 ;; There are no tags in the repository, so take this snapshot.
11105 (method url-fetch)
11106 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
11107 "fakeroot/fakeroot_" version ".orig.tar.gz"))
11108 (file-name (string-append name "-" version ".tar.gz"))
11109 (sha256
11110 (base32 "00p07xi1j61i4bbxymydihff8frw9bs0g0fr6rpm88q94wclcl1p"))
11111 (modules '((guix build utils)
11112 (ice-9 ftw)))
11113 (snippet
11114 `(begin
11115 ;; Delete pregenerated man page translations, but not the originals.
11116 (with-directory-excursion "doc"
11117 (for-each (lambda (language)
11118 (for-each delete-file
11119 (find-files language "\\.[0-9]$")))
11120 (scandir "."
11121 (lambda (file)
11122 (and (not (string-prefix? "." file))
11123 (eq? 'directory
11124 (stat:type (lstat file))))))))))))
11125 (build-system gnu-build-system)
11126 (arguments
11127 `(#:configure-flags
11128 (list "--disable-static")
11129 #:phases
11130 (modify-phases %standard-phases
11131 (add-after 'unpack 'patch-Makefile.am
11132 (lambda _
11133 (substitute* "Makefile.am"
11134 (("/bin/sh") (which "sh")))))
11135 (add-after 'unpack 'patch-script
11136 (lambda* (#:key inputs #:allow-other-keys)
11137 (substitute* "scripts/fakeroot.in"
11138 (("getopt")
11139 (string-append (assoc-ref inputs "util-linux")
11140 "/bin/getopt"))
11141 (("sed")
11142 (string-append (assoc-ref inputs "sed")
11143 "/bin/sed"))
11144 (("cat|cut" command)
11145 (string-append (assoc-ref inputs "coreutils")
11146 "/bin/" command)) )))
11147 (replace 'bootstrap
11148 (lambda _
11149 ;; The "preroll" script takes care of Autoconf and also
11150 ;; prepares the translated manuals.
11151 (invoke "sh" "./preroll")))
11152 (add-before 'configure 'setenv
11153 (lambda _
11154 (setenv "LIBS" "-lacl")))
11155 (add-before 'check 'prepare-check
11156 (lambda _
11157 (setenv "SHELL" (which "bash"))
11158 (setenv "VERBOSE" "1")
11159 (substitute* "test/t.touchinstall"
11160 ;; We don't have the name of the root user, so use ID=0.
11161 (("grep root") "grep \"\\<0\\>\""))
11162 (substitute* "test/tartest"
11163 ;; We don't have the name of the root group, so use ID=0.
11164 (("ROOTGROUP=root") "ROOTGROUP=0")
11165 ;; We don't have the name of the daemon user, so use IDs.
11166 (("daemon:sys") "1:3")
11167 (("daemon:") "1:"))
11168 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
11169 (substitute* "test/compare-tar"
11170 (("tar -tvf") "tar --numeric-owner -tvf")))))))
11171 (native-inputs
11172 (list autoconf-2.71 automake gettext-minimal libtool po4a-minimal
11173 perl sharutils xz)) ; for tests
11174 (inputs
11175 (list acl libcap util-linux sed coreutils))
11176 (synopsis "Run commands in an environment with fake root privileges")
11177 (description
11178 "@command{fakeroot} runs a command in an environment where it appears to
11179have root privileges for file manipulation. This is useful for allowing users
11180to create archives (@file{tar}, @file{ar}, @file{deb}, etc.) with files in
11181them with root permissions and/or ownership.
11182
11183Without fakeroot, one would have to have root privileges to create the
11184constituent files of the archives with the correct permissions and ownership,
11185and then pack them up, or one would have to construct the archives directly,
11186without using the archiver.")
11187 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
11188 (license license:gpl3+)))
11189
11190(define-public fakechroot
11191 ;; XXX: Build from the change submitted at
11192 ;; <https://github.com/dex4er/fakechroot/pull/85> to allow compilation
11193 ;; against glibc 2.33. Switch back to the official repository on the next
11194 ;; release.
11195 (let ((commit "e7c1f3a446e594a4d0cce5f5d499c9439ce1d5c5")
11196 (revision "0"))
11197 (package
11198 (name "fakechroot")
11199 (version (git-version "2.20.1" revision commit))
11200 (source (origin
11201 (method git-fetch)
11202 (uri (git-reference
11203 (url "https://github.com/lipnitsk/fakechroot")
11204 (commit commit)))
11205 (file-name (git-file-name name version))
11206 (sha256
11207 (base32
11208 "0gac6a6djx3nf343vd33sr5qqngz8ss3aij54zl8x9wb47pc11kb"))))
11209 (build-system gnu-build-system)
11210 (arguments
11211 ;; XXX: The tests heavily assume they run on an FHS system so for now
11212 ;; skip them.
11213 '(#:tests? #f
11214 #:configure-flags '("--disable-static")))
11215 (native-inputs (list autoconf automake libtool perl))
11216 (synopsis "Emulate @code{chroot} by overriding file system calls")
11217 (description
11218 "@command{fakechroot} runs a command in an environment were is additional
11219possibility to use @code{chroot} command without root privileges. This is
11220useful for allowing users to create own chrooted environment with possibility
11221to install another packages without need for root privileges.
11222
11223It works by providing @file{libfakechroot.so}, a shared library meant to be
11224set as @code{LD_PRELOAD} to override the C library file system functions.")
11225 (home-page "https://github.com/dex4er/fakechroot/")
11226 (license license:lgpl2.1+))))
11227
11228(define-public falcosecurity-libs
11229 (package
11230 (name "falcosecurity-libs")
11231 (version "0.20.0")
11232 (source (origin
11233 (method git-fetch)
11234 (uri (git-reference
11235 (url "https://github.com/falcosecurity/libs/")
11236 (commit version)))
11237 (file-name (git-file-name name version))
11238 (sha256
11239 (base32
11240 "041ir9wk44v7isidwl7fzxrjvs85j637wcr7xirasd8ysxa0r4qv"))
11241 (patches
11242 (search-patches
11243 "falcosecurity-libs-bpf-probes-fix.patch"
11244 "falcosecurity-libs-shared-build.patch"))))
11245 (build-system cmake-build-system)
11246 (arguments
11247 (list
11248 #:configure-flags
11249 #~(list "-DUSE_BUNDLED_DEPS=OFF"
11250 "-DBUILD_DRIVER=OFF"
11251 "-DENABLE_DKMS=OFF"
11252 "-DBUILD_LIBSCAP_MODERN_BPF=ON"
11253 "-DSCAP_FILES_SUITE_ENABLE=OFF" ;attempts to download scap files
11254 "-DBUILD_SHARED_LIBS=ON"
11255 #$(string-append "-DFALCOSECURITY_LIBS_VERSION=" version))
11256 ;; Only the libsinsp test suite is run, as the one for libscap requires
11257 ;; elevated privileges.
11258 #:modules '((guix build cmake-build-system)
11259 ((guix build gnu-build-system) #:prefix gnu:)
11260 (guix build utils))
11261 #:phases
11262 #~(modify-phases %standard-phases
11263 (add-after 'unpack 'disable-problematic-tests
11264 (lambda _
11265 (substitute* "userspace/libsinsp/test/user.ut.cpp"
11266 ;; The 'system_lookup' test assumes a root user
11267 ;; exists in the build environment.
11268 (("TEST_F\\(usergroup_manager_test, system_lookup)")
11269 "TEST_F(usergroup_manager_test, DISABLED_system_lookup)"))))
11270 (replace 'check
11271 (lambda* (#:rest args)
11272 (apply (assoc-ref gnu:%standard-phases 'check)
11273 #:test-target "run-unit-test-libsinsp" args)))
11274 (add-after 'install 'delete-src
11275 (lambda _
11276 (delete-file-recursively
11277 (string-append #$output "/src")))))))
11278 (native-inputs
11279 (list bpftool
11280 clang-18 ;avoid stack limit exceeded build error
11281 googletest
11282 pkg-config
11283 valijson)) ;header-only library
11284 (inputs
11285 (list elfutils))
11286 (propagated-inputs
11287 ;; The following inputs are in the 'Requires' field of libscap.pc,
11288 ;; libsinp.pc or libpman.pc.
11289 (list c-ares
11290 grpc
11291 jsoncpp
11292 libbpf
11293 libelf
11294 openssl
11295 protobuf
11296 uthash ;included in libscap headers
11297 zlib
11298 ;; These are in the 'Requires.private' field of libscap.pc and
11299 ;; libsinp.pc. They are required because the headers are installed
11300 ;; to a non-standard directory, and thus need to be found via the
11301 ;; 'Cflags' field, which in turn mandates that both the pkg-config
11302 ;; modules listed in the 'Requires' and 'Requires.private' be
11303 ;; available.
11304 curl
11305 re2
11306 onetbb))
11307 (home-page "https://github.com/falcosecurity/libs/")
11308 (synopsis "Falco security libraries")
11309 (description "The Falco security libraries include @code{libsinsp} and
11310@code{libscap}. @code{libscap} manages the data capture process, while
11311@code{libsinsp} is a system inspection library that enriches events from
11312@code{libscap} with machine state. @code{libsinsp} also performs events
11313filtering with rule evaluation through its internal rule engine. These
11314libraries are used by the @command{sysdig} command-line utility.")
11315 (license license:asl2.0)))
11316
11317(define-public inputattach
11318 (package
11319 (name "inputattach")
11320 (version "0.42.0")
11321 (source (origin
11322 (method git-fetch)
11323 (uri (git-reference
11324 (url "https://github.com/linuxwacom/input-wacom")
11325 (commit (string-append "input-wacom-" version))))
11326 (file-name (git-file-name name version))
11327 (sha256
11328 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
11329 (build-system gnu-build-system)
11330 (arguments
11331 `(#:phases
11332 (modify-phases %standard-phases
11333 (delete 'bootstrap)
11334 (delete 'configure)
11335 (replace 'build
11336 (lambda* (#:key inputs #:allow-other-keys)
11337 (with-directory-excursion "inputattach"
11338 (invoke "gcc" "-O2" "-o" "inputattach"
11339 "inputattach.c"))))
11340 (delete 'check)
11341 (replace 'install
11342 (lambda* (#:key outputs #:allow-other-keys)
11343 (let ((target-dir (string-append
11344 (assoc-ref outputs "out")
11345 "/bin/")))
11346 (mkdir-p target-dir)
11347 (copy-file "inputattach/inputattach"
11348 (string-append target-dir
11349 "inputattach"))
11350 #t))))))
11351 (home-page "https://linuxwacom.github.io/")
11352 (synopsis "Dispatch input peripherals events to a device file")
11353 (description "inputattach dispatches input events from several device
11354types and interfaces and translates so that the X server can use them.")
11355 (license license:gpl2+)))
11356
11357(define-public keyd
11358 (package
11359 (name "keyd")
11360 (version "2.6.0")
11361 (source
11362 (origin
11363 (method git-fetch)
11364 (uri (git-reference
11365 (url "https://github.com/rvaiya/keyd")
11366 (commit (string-append "v" version))))
11367 (sha256
11368 (base32
11369 "14rgrg8d1ys1cqq46mgi34yqg9jd1q3yw1acw5r5jpwwk0da7g4p"))))
11370 (arguments
11371 (list #:tests? #f ; tests require root
11372 #:make-flags
11373 #~(list (string-append "CC=" #$(cc-for-target))
11374 "PREFIX="
11375 (string-append "DESTDIR=" #$output))
11376 #:phases
11377 '(modify-phases
11378 %standard-phases
11379 (delete 'configure)))) ; no autoconf
11380 (build-system gnu-build-system)
11381 (inputs (list linux-libre-headers))
11382 (synopsis "Key remapping daemon for Linux")
11383 (description
11384 "Keyd is a keyboard remapping utility with intuitive ini configuration
11385file format. Keyd has several features, many of which are traditionally only
11386found in custom keyboard firmware like QMK.")
11387 (home-page "https://github.com/rvaiya/keyd")
11388 (license license:expat)))
11389
11390(define-public pipewire
11391 (package
11392 (name "pipewire")
11393 (version "1.6.8")
11394 (source (origin
11395 (method git-fetch)
11396 (uri (git-reference
11397 (url "https://gitlab.freedesktop.org/pipewire/pipewire")
11398 (commit version)))
11399 (file-name (git-file-name name version))
11400 (sha256
11401 (base32
11402 "1yc70gi4a98q7kbghp08nyp3wvlik120v2w25a14b93gpgwbl55k"))))
11403 (build-system meson-build-system)
11404 (arguments
11405 (list
11406 #:configure-flags
11407 #~(list (string-append "-Dudevrulesdir=" #$output "/lib/udev/rules.d")
11408 "-Dman=enabled"
11409 "-Drlimits-install=false"
11410 "-Dsession-managers=[]"
11411 "-Dsysconfdir=/etc"
11412 "-Dlibsystemd=disabled"
11413
11414 ;; XXX: link with -Wl,--no-as-needed so that libgcc_s.so.1 does not get dropped
11415 ;; Otherwise test_loop will fail with:
11416 ;; libgcc_s.so.1 must be installed for pthread_cancel to work
11417 "-Db_asneeded=false")))
11418 (native-inputs
11419 (list `(,glib "bin")
11420 pkg-config
11421 doxygen
11422 python
11423 python-docutils))
11424 (inputs (list alsa-lib
11425 avahi
11426 bluez
11427 dbus
11428 eudev
11429 ffmpeg
11430 gst-plugins-base
11431 gstreamer
11432 jack-2
11433 ldacbt
11434 libcamera-minimal
11435 libdrm
11436 libfdk
11437 libfreeaptx
11438 libsndfile
11439 libusb
11440 openssl ; raop sink
11441 libva
11442 pulseaudio
11443 readline ; for pw-cli
11444 sbc
11445 vulkan-headers
11446 vulkan-loader
11447 webrtc-audio-processing))
11448 (home-page "https://pipewire.org/")
11449 (synopsis "Server and user space API to deal with multimedia pipelines")
11450 (description
11451 "PipeWire is a project that aims to greatly improve handling of audio and
11452video under Linux. It aims to support the usecases currently handled by both
11453PulseAudio and Jack and at the same time provide same level of powerful handling
11454of Video input and output. It also introduces a security model that makes
11455interacting with audio and video devices from containerized applications easy,
11456with supporting Flatpak applications being the primary goal. Alongside Wayland
11457and Flatpak we expect PipeWire to provide a core building block for the future
11458of Linux application development.")
11459 (license license:lgpl2.0+)))
11460
11461(define-public pipewire-minimal
11462 ;; Used as libpipewire to reduce closure size and avoid dependency cycles.
11463 (hidden-package
11464 (package
11465 (inherit pipewire)
11466 (name "pipewire-minimal")
11467 (arguments
11468 (list
11469 #:configure-flags
11470 #~(list "-Dsession-managers=[]"
11471 "-Ddbus=disabled"
11472 "-Dflatpak=disabled"
11473 ;; XXX: Otherwise test_loop will fail with:
11474 ;; libgcc_s.so.1 must be installed for pthread_cancel to work
11475 "-Db_asneeded=false")))
11476 (native-inputs '())
11477 (inputs '()))))
11478
11479(define-public pipewire-minimal-1.4
11480 (package
11481 (inherit pipewire-minimal)
11482 (name "pipewire")
11483 (version "1.4.10")
11484 (source (origin
11485 (method git-fetch)
11486 (uri (git-reference
11487 (url "https://gitlab.freedesktop.org/pipewire/pipewire")
11488 (commit version)))
11489 (file-name (git-file-name name version))
11490 (sha256
11491 (base32
11492 "14rsdbcsyyhjh7hvbq3d84f6s0fllvq6vpg39cxcd7l8fn4zc2zw"))))))
11493
11494(define-public wireplumber
11495 (package
11496 (name "wireplumber")
11497 (version "0.5.15")
11498 (source
11499 (origin
11500 (method git-fetch)
11501 (uri (git-reference
11502 (url
11503 "https://gitlab.freedesktop.org/pipewire/wireplumber.git")
11504 (commit version)))
11505 (file-name (git-file-name name version))
11506 (sha256
11507 (base32 "1a7fzfdxipjaq0fb695jbpipnlr67yl273x1gd9mmpbnqmgnphnv"))))
11508 (build-system meson-build-system)
11509 (arguments
11510 `(#:configure-flags '("-Dsystemd=disabled"
11511 "-Dsystem-lua=true")))
11512 (native-inputs
11513 (list `(,glib "bin")
11514 pkg-config python-minimal))
11515 (inputs (list dbus elogind glib lua pipewire))
11516 (home-page "https://gitlab.freedesktop.org/pipewire/wireplumber")
11517 (synopsis "Session / policy manager implementation for PipeWire")
11518 (description "WirePlumber is a modular session / policy manager for
11519PipeWire and a GObject-based high-level library that wraps PipeWire's API,
11520providing convenience for writing the daemon's modules as well as external
11521tools for managing PipeWire.")
11522 (license license:expat)))
11523
11524(define-public wireplumber-minimal
11525 (let ((base wireplumber))
11526 (package
11527 (inherit base)
11528 (name "wireplumber-minimal")
11529 (arguments
11530 (substitute-keyword-arguments arguments
11531 ((#:configure-flags flags ''())
11532 #~(cons "-Delogind=disabled" #$flags))))
11533 (inputs
11534 (modify-inputs inputs
11535 (delete "elogind"))))))
11536
11537(define-public ell
11538 (package
11539 (name "ell")
11540 (version "0.83")
11541 (source (origin
11542 (method git-fetch)
11543 (uri (git-reference
11544 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
11545 (commit version)))
11546 (file-name (git-file-name name version))
11547 (sha256
11548 (base32
11549 "1ywq84jgvf7f86srqwpq31w2kzdp875fx039x5g4lx486plgf526"))
11550 (modules '((guix build utils)))
11551 (snippet
11552 #~(begin
11553 (substitute* "Makefile.am"
11554 ;; requires hwdb.bin
11555 (("unit/test-hwdb.*") ""))))))
11556 (build-system gnu-build-system)
11557 (arguments
11558 ;; Tests launch dbus-daemon instances that all try to bind to
11559 ;; "/tmp/ell-test-bus". Thus, we need to run them sequentially.
11560 '(#:parallel-tests? #f))
11561 (inputs
11562 (list dbus))
11563 (native-inputs
11564 (list autoconf automake libtool pkg-config procps))
11565 (home-page "https://01.org/ell")
11566 (synopsis "Embedded Linux Library")
11567 (description "The Embedded Linux* Library (ELL) provides core, low-level
11568functionality for system daemons. It typically has no dependencies other than
11569the Linux kernel, C standard library, and libdl (for dynamic linking). While
11570ELL is designed to be efficient and compact enough for use on embedded Linux
11571platforms, it is not limited to resource-constrained systems.")
11572 (license license:lgpl2.1+)))
11573
11574(define-public kexec-tools
11575 (package
11576 (name "kexec-tools")
11577 (version "2.0.31")
11578 (source (origin
11579 (method url-fetch)
11580 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
11581 "/kexec/kexec-tools-" version ".tar.xz"))
11582 (sha256
11583 (base32
11584 "0c9cj9xvcm81gcwnkvvh9vh82v59kdz5llmblc2wkqb6vh6kb3wa"))))
11585 (build-system gnu-build-system)
11586 (arguments
11587 ;; There are no automated tests.
11588 '(#:tests? #f))
11589 ;; This variant of binutils is used for the 64 bit support needed to
11590 ;; assemble the `purgatory/arch/i386/compat_x86_64.S' program on i686-linux.
11591 (native-inputs (list (make-ld-wrapper "ld-wrapper"
11592 #:binutils binutils)
11593 binutils))
11594 (home-page "https://projects.horms.net/projects/kexec/")
11595 (synopsis "Tools for booting directly into different kernels")
11596 (description "This package provides the @code{kexec} program and ancillary
11597utilities. Using @code{kexec}, it is possible to boot directly into a new
11598kernel from the context of an already-running kernel, bypassing the normal
11599system boot process.")
11600 (supported-systems (delete "riscv64-linux" %supported-systems))
11601 (license license:gpl2)))
11602
11603(define-public cachefilesd
11604 (package
11605 (name "cachefilesd")
11606 (version "0.10.10")
11607 (source (origin
11608 (method url-fetch)
11609 (uri (string-append
11610 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
11611 "/cachefilesd.git/snapshot/cachefilesd-"
11612 version ".tar.gz"))
11613 (sha256
11614 (base32
11615 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
11616 (build-system gnu-build-system)
11617 (outputs '("out"))
11618 (arguments
11619 `(#:tests? #f ; there are no tests
11620 #:make-flags
11621 (let ((prefix-dir (lambda (var dir)
11622 (string-append var "=" %output "/" dir))))
11623 (list (string-append "CC=" ,(cc-for-target))
11624 (prefix-dir "SBINDIR" "sbin/")
11625 (prefix-dir "ETCDIR" "etc/")
11626 (prefix-dir "MANDIR" "share/man/")))
11627 #:phases (modify-phases %standard-phases (delete 'configure))))
11628 (home-page "https://people.redhat.com/~dhowells/cachefs/")
11629 (synopsis "CacheFiles userspace management daemon")
11630 (description "@code{cachefilesd} is a userspace daemon that manages the
11631cache data store that is used by network file systems such as @code{AFS} and
11632@code{NFS} to cache data locally on disk. The content of the cache is
11633persistent over reboots.")
11634 (license license:gpl2+)))
11635
11636(define-public libbpf
11637 (package
11638 (name "libbpf")
11639 (version "1.7.0")
11640 (source
11641 (origin
11642 (method git-fetch)
11643 (uri (git-reference
11644 (url "https://github.com/libbpf/libbpf")
11645 (commit (string-append "v" version))))
11646 (file-name (git-file-name name version))
11647 (sha256
11648 (base32
11649 "1r1ysy8xpdz2nqs0svk4772fbykqh414mqivwylbj5r9v1nf8r02"))))
11650 (build-system gnu-build-system)
11651 (arguments
11652 (list
11653 #:tests? #f ;self-tests run in QEMU
11654 #:make-flags
11655 #~(list (string-append "PREFIX=" #$output)
11656 (string-append "LIBDIR=$(PREFIX)/lib")
11657 (string-append "CC=" #$(cc-for-target)))
11658 #:phases
11659 #~(modify-phases %standard-phases
11660 (delete 'configure)
11661 (add-before 'build 'pre-build
11662 (lambda _
11663 (chdir "src")))
11664 (replace 'install
11665 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
11666 (apply (assoc-ref %standard-phases 'install)
11667 (append args
11668 (list #:make-flags
11669 (append (list "install"
11670 ;; Also install the kernel
11671 ;; user API (uAPI) headers.
11672 "install_uapi_headers")
11673 make-flags)))))))))
11674 (native-inputs (list pkg-config))
11675 (propagated-inputs (list elfutils zlib)) ;in Requires.private of libbpf.pc
11676 (home-page "https://github.com/libbpf/libbpf")
11677 (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
11678 (description
11679 "Libbpf supports building BPF CO-RE-enabled applications, which, in
11680contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
11681headers.")
11682 (license (list license:lgpl2.1 license:bsd-2))))
11683
11684(define-public libbpf-0.8
11685 (package
11686 (inherit libbpf)
11687 (name "libbpf")
11688 (version "0.8.1")
11689 (source
11690 (origin
11691 (method git-fetch)
11692 (uri (git-reference
11693 (url "https://github.com/libbpf/libbpf")
11694 (commit (string-append "v" version))))
11695 (file-name (git-file-name name version))
11696 (sha256
11697 (base32
11698 "1zzpkk4x3f20483dzw43b3ml03d63vvkmqf4j8y3b61b67wm59bm"))))
11699 (arguments
11700 (list
11701 #:tests? #f ;self-tests run in QEMU
11702 #:make-flags
11703 #~(list (string-append "PREFIX=" #$output)
11704 (string-append "LIBDIR=$(PREFIX)/lib")
11705 (string-append "CC=" #$(cc-for-target)))
11706 #:phases #~(modify-phases %standard-phases
11707 (delete 'configure)
11708 (add-before 'build 'pre-build
11709 (lambda _
11710 (chdir "src"))))))
11711 (native-inputs (list pkg-config))
11712 (propagated-inputs (list elfutils zlib)))) ;in Requires.private of libbpf.pc
11713
11714(define-public bcc
11715 (package
11716 (name "bcc")
11717 (version "0.30.0")
11718 (source
11719 (origin
11720 (method git-fetch)
11721 (uri (git-reference
11722 (url "https://github.com/iovisor/bcc")
11723 (commit (string-append "v" version))))
11724 (file-name (git-file-name name version))
11725 (sha256
11726 (base32
11727 "0b5la0yn6x6ll73drnrm5v5yibbrzkvl86hqivkrmnpgy8cqn0cy"))))
11728 (build-system cmake-build-system)
11729 (native-inputs
11730 (list bison
11731 flex
11732 (@ (gnu packages compression) zip)))
11733 (inputs
11734 (list bash-minimal ;for wrap-program
11735 clang-15
11736 elfutils
11737 luajit
11738 libbpf
11739 python-setuptools
11740 python-wrapper))
11741 (arguments
11742 (list
11743 ;; Tests all require root permissions and a "standard" file hierarchy.
11744 #:tests? #f
11745 #:configure-flags #~(list (string-append "-DREVISION=" #$version)
11746 "-DCMAKE_USE_LIBBPF_PACKAGE=ON")
11747 #:phases
11748 #~(modify-phases %standard-phases
11749 (add-after 'unpack 'substitute-libbc
11750 (lambda _
11751 (substitute* "src/python/bcc/libbcc.py"
11752 (("(libbcc\\.so.*)\\b" _ libbcc)
11753 (string-append #$output "/lib/" libbcc)))))
11754 (add-after 'install 'wrap-tools
11755 (lambda _
11756 (use-modules (ice-9 textual-ports))
11757 (let* ((out #$output)
11758 (lib (string-append out "/lib"))
11759 (tools (string-append out "/share/bcc/tools"))
11760 (python-executable?
11761 (lambda (filename _)
11762 (call-with-input-file filename
11763 (lambda (port)
11764 (string-contains (get-line port)
11765 "/bin/python"))))))
11766 (for-each (lambda (python-executable)
11767 (format #t "Wrapping: ~A.~%" python-executable)
11768 (wrap-program python-executable
11769 `("GUIX_PYTHONPATH" ":" prefix
11770 (,(string-append lib
11771 "/python"
11772 #$(version-major+minor
11773 (package-version python))
11774 "/site-packages")))))
11775 (find-files tools python-executable?))))))))
11776 (home-page "https://github.com/iovisor/bcc")
11777 (synopsis "Tools for BPF on Linux")
11778 (description
11779 "BCC is a toolkit for creating efficient kernel tracing and manipulation
11780programs, and includes several useful tools and examples. It makes use of
11781extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
11782that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
11783and above.")
11784 (license license:asl2.0)))
11785
11786(define-public bpftool
11787 (package
11788 (name "bpftool")
11789 (version (package-version linux-libre))
11790 (source (package-source linux-libre))
11791 (build-system gnu-build-system)
11792 (arguments
11793 `(#:tests? #f ;This package has no tests.
11794 #:phases (modify-phases %standard-phases
11795 (delete 'configure)
11796 (replace 'build
11797 (lambda* (#:key inputs #:allow-other-keys)
11798 (invoke "make" "-C" "tools/bpf/bpftool"
11799 ,(string-append "CC=" (cc-for-target)))))
11800 (replace 'install
11801 (lambda* (#:key outputs #:allow-other-keys)
11802 (let* ((out (assoc-ref outputs "out")))
11803 (mkdir-p (string-append out "/sbin"))
11804 (mkdir-p (string-append out
11805 "/share/bash-completion/completions"))
11806 (invoke "make"
11807 (string-append "prefix=" out)
11808 (string-append
11809 "bash_compdir=" out
11810 "/share/bash-completion/completions")
11811 "-C" "tools/bpf/bpftool"
11812 "install")))))))
11813 (inputs (list elfutils ;provides libelf
11814 libcap openssl readline zlib))
11815 (native-inputs (list bison python))
11816 ;; This tool does not have a proper web page.
11817 (home-page
11818 "https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/bpf/bpftool")
11819 (synopsis "Tool for inspection and manipulation of eBPF programs and maps")
11820 (description "@command{bpftool} allows for inspection and simple
11821modification of BPF objects on the system.")
11822 (license (package-license linux-libre))))
11823
11824(define-public bpftrace
11825 (package
11826 (name "bpftrace")
11827 (version "0.21.2")
11828 (source
11829 (origin
11830 (method git-fetch)
11831 (uri (git-reference
11832 (url "https://github.com/bpftrace/bpftrace")
11833 (commit (string-append "v" version))))
11834 (file-name (git-file-name name version))
11835 (sha256
11836 (base32 "0icbhf1wk523a7lcmwqa67zc6hl6h02p5mfg26cizva447kbwsgz"))))
11837 (build-system cmake-build-system)
11838 (arguments
11839 (list
11840 #:test-exclude "(runtime_tests|tools-parsing-test)"
11841 #:phases
11842 #~(modify-phases %standard-phases
11843 ;; This patch also fixes broken compilation due to improper detection
11844 ;; of bfd features. This is taken from following upstream PR:
11845 ;; https://github.com/bpftrace/bpftrace/pull/3332
11846 (add-after 'unpack 'patch-paths-and-bfd-defs
11847 (lambda _
11848 (substitute* '("cmake/FindLibBfd.cmake"
11849 "src/CMakeLists.txt")
11850 (("LIBSFRAME_FOUND")
11851 "LIBSFRAME_LIBRARIES")
11852 (("LIBZSTD_FOUND")
11853 "LIBZSTD_LIBRARIES"))
11854 (with-directory-excursion "tests"
11855 (substitute* (find-files ".")
11856 (("/bin/sh")
11857 (which "sh")))
11858 (substitute* '("child.cpp"
11859 "runtime/call"
11860 "procmon.cpp")
11861 (("/bin/ls")
11862 (which "ls"))))))
11863 (add-after 'unpack 'fix-paths
11864 (lambda* (#:key inputs outputs #:allow-other-keys)
11865 (substitute* '("tests/child.cpp")
11866 (("/bin/sleep")
11867 (search-input-file inputs "bin/sleep")))))
11868 (add-before 'check 'set-test-filter
11869 (lambda _
11870 (setenv "GTEST_FILTER"
11871 (string-join
11872 (list ; "-" disables all following tests
11873 "-ast.probe_name_uprobe"
11874 "bpftrace.add_probes_uprobe_wildcard_file"
11875 "bpftrace.add_probes_uprobe_wildcard_file_uprobe_multi"
11876 "bpftrace.add_probes_usdt_wildcard"
11877 "Parser.multiple_attach_points_kprobe"
11878 "Parser.uretprobe_offset"
11879 "semantic_analyser.builtin_functions"
11880 "semantic_analyser.call_func"
11881 "semantic_analyser.call_uaddr")
11882 ":")))))))
11883 (native-inputs (list bison coreutils dwarves flex googletest xxd))
11884 (inputs (list bcc clang-15 elfutils libbpf libiberty cereal))
11885 (home-page "https://github.com/bpftrace/bpftrace")
11886 (synopsis "High-level tracing language for Linux eBPF")
11887 (description
11888 "bpftrace is a high-level tracing language for Linux enhanced Berkeley
11889Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses
11890LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for
11891interacting with the Linux BPF system, as well as existing Linux tracing
11892capabilities: kernel dynamic tracing (kprobes), user-level dynamic
11893tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk
11894and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was
11895created by Alastair Robertson.")
11896 (license license:asl2.0)))
11897
11898(define-public ttyebus-linux-module
11899 (let ((revision "0")
11900 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))
11901 (package
11902 (name "ttyebus-linux-module")
11903 (version (git-version "1.5" revision commit))
11904 (source
11905 (origin
11906 (method git-fetch)
11907 (uri (git-reference
11908 (url "https://github.com/eBUS/ttyebus")
11909 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")))
11910 (file-name (git-file-name name version))
11911 (sha256
11912 (base32
11913 "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani"))))
11914 (supported-systems '("armhf-linux" "aarch64-linux"))
11915 (build-system linux-module-build-system)
11916 (arguments
11917 `(#:tests? #f))
11918 (home-page "https://github.com/eBUS/ttyebus")
11919 (synopsis "Low-latency Raspberry Pi UART driver")
11920 (description "This package provides a Linux kernel module that will
11921provide a serial device @code{/dev/ttyebus} with almost no latency upon
11922receiving. It is dedicated to the PL011 UART of the Raspberry Pi.")
11923 (license license:gpl3+))))
11924
11925(define-public ipset
11926 (package
11927 (name "ipset")
11928 (version "7.17")
11929 (source
11930 (origin
11931 (method url-fetch)
11932 (uri (string-append "https://ipset.netfilter.org/"
11933 "ipset-" version ".tar.bz2"))
11934 (sha256
11935 (base32 "1n34mkrdha9rggd0fizjx6baqkiqqd1yfhb5ml663mlx93zwjjdy"))))
11936 (build-system gnu-build-system)
11937 (inputs
11938 (list libmnl))
11939 (native-inputs
11940 (list pkg-config))
11941 (arguments
11942 `(#:configure-flags '("--disable-static"
11943 "--with-kmod=no")))
11944 (home-page "https://ipset.netfilter.org/")
11945 (synopsis "Administration tool for IP sets")
11946 (description "IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel which
11947can be administered by the ipset utility. Depending on the type,
11948currently an IP set may store IP addresses, (TCP/UDP) port numbers or
11949IP addresses with MAC addresses in a way which ensures lightning speed
11950when matching an entry against a set.
11951
11952If you want to
11953@itemize @bullet
11954@item store multiple IP addresses or port numbers and match against the entire
11955collection using a single iptables rule.
11956@item dynamically update iptables rules against IP addresses or ports without
11957performance penalty.
11958@item express complex IP address and ports based rulesets with a single
11959iptables rule and benefit from the speed of IP sets.
11960@end itemize\n
11961then IP sets may be the proper tool for you.")
11962 (license license:gpl2+)))
11963
11964(define-public liburing
11965 (package
11966 (name "liburing")
11967 (version "2.15")
11968 (source (origin
11969 (method git-fetch)
11970 (uri (git-reference
11971 (url "https://github.com/axboe/liburing")
11972 (commit (string-append "liburing-" version))))
11973 (file-name (git-file-name name version))
11974 (sha256
11975 (base32
11976 "1vq47c15fv60992qla7y9s3b52v958zkbfpr0hscji1n6bj6w4x0"))))
11977 (build-system gnu-build-system)
11978 (arguments
11979 `(;; Tests are dependent on kernel version and features
11980 #:tests? #f
11981 #:phases
11982 (modify-phases %standard-phases
11983 (replace 'configure
11984 ;; configure fails if it is followed by SHELL, CONFIG_SHELL,
11985 ;; --enable-fast-install, and --build
11986 (lambda* (#:key outputs #:allow-other-keys)
11987 (let ((out (assoc-ref outputs "out")))
11988 (setenv "SHELL" (which "sh"))
11989 (setenv "CONFIG_SHELL" (which "sh"))
11990 (invoke "./configure" (string-append "--prefix=" out))))))))
11991 (home-page "https://github.com/axboe/liburing")
11992 (synopsis "Interface to the Linux kernel @code{io_uring} interface")
11993 (description "This is the io_uring library, liburing. liburing provides
11994helpers to setup and teardown io_uring instances, and also a simplified
11995interface for applications that don't need (or want) to deal with the full
11996kernel side implementation.")
11997 (license license:expat)))
11998
11999(define-public erofs-utils
12000 (package
12001 (name "erofs-utils")
12002 (version "1.8.10")
12003 (source
12004 (origin
12005 (method git-fetch)
12006 (uri (git-reference
12007 (url "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git")
12008 (commit (string-append "v" version))))
12009 (file-name (git-file-name name version))
12010 (sha256
12011 (base32 "1qlig9q1fdjl0zn7206dbv7w5ssjg4az4hg7y3vk69ly0zbmwkil"))))
12012 (build-system gnu-build-system)
12013 (inputs
12014 (list lz4
12015 `(,util-linux "lib")
12016 zlib))
12017 (native-inputs
12018 (list autoconf automake libtool pkg-config))
12019 (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/")
12020 (synopsis "User-space tools for the EROFS file system")
12021 (description
12022 "@acronym{EROFS, The Enhanced Read-Only File System} is a compressed,
12023read-only file system optimized for resource-scarce devices. This package
12024provides user-space tools for creating EROFS file systems.")
12025 (license license:gpl2+)))
12026
12027(define-public erofs-utils/static
12028 (static-package
12029 (package
12030 (inherit erofs-utils)
12031 (name "erofs-utils-static")
12032 (arguments
12033 (substitute-keyword-arguments (package-arguments erofs-utils)
12034 ((#:configure-flags flags #~'())
12035 #~(append #$flags (list "--without-uuid" "--without-zlib"))))))))
12036
12037(define-public rasdaemon
12038 (package
12039 (name "rasdaemon")
12040 (version "0.8.4")
12041 (source
12042 (origin
12043 (method git-fetch)
12044 (uri (git-reference
12045 (url "https://github.com/mchehab/rasdaemon")
12046 (commit (string-append "v" version))))
12047 (file-name (git-file-name name version))
12048 (sha256
12049 (base32 "1930g35igfdw5bzcd6diy59rm1q4yirpjgqznfqfsichnmk04kmf"))))
12050 (native-inputs (list autoconf automake libtool pkg-config))
12051 (inputs
12052 (list bash-minimal
12053 dmidecode
12054 kmod
12055 libtraceevent
12056 pciutils
12057 perl
12058 perl-dbd-sqlite
12059 sqlite))
12060 (arguments
12061 (list
12062 #:configure-flags
12063 #~(list "--enable-all"
12064 ;; Don't install unused /etc/sysconfig/rasdaemon environment file.
12065 "--with-sysconfdefdir=."
12066 "--localstatedir=/var")
12067 #:phases
12068 #~(modify-phases %standard-phases
12069 (add-after 'unpack 'rename-README
12070 (lambda _
12071 ;; Required by autoreconf
12072 (rename-file "README.md" "README")))
12073 (add-before 'configure 'munge-autotools
12074 (lambda _
12075 ;; For some reason upstream forces sysconfdir=/etc. This results
12076 ;; in EPERM during the install phase. Removing the offending
12077 ;; line lets sysconfdir correctly pick up DESTDIR.
12078 (substitute* "configure.ac"
12079 (("^test .* sysconfdir=/etc\n$") ""))))
12080 (add-after 'install 'wrap-rasdaemon
12081 (lambda* (#:key inputs #:allow-other-keys)
12082 (let ((path (map dirname
12083 (list (search-input-file inputs "/sbin/dmidecode")
12084 (search-input-file inputs "/bin/modprobe")))))
12085 (wrap-program (string-append #$output "/sbin/ras-mc-ctl")
12086 `("PATH" ":" prefix ,path)
12087 `("PERL5LIB" ":" prefix ,(string-split (getenv "PERL5LIB") #\:)))))))))
12088 (build-system gnu-build-system)
12089 (home-page "https://github.com/mchehab/rasdaemon")
12090 (synopsis "Platform Reliability, Availability, and Serviceability tools")
12091 (description
12092 "The @code{rasdaemon} daemon monitors platform @acronym{RAS, Reliability
12093Availability and Serviceability} reports from Linux kernel trace events.
12094These trace events are logged in @file{/sys/kernel/debug/tracing} and reported
12095through standard log mechanisms like syslog.")
12096 (license license:gpl2)))
12097
12098(define-public renameat2
12099 ;; This is a Gist, with no release or tags.
12100 (let ((revision "0")
12101 (commit "5c5193f20142511a5fc7069a539f4e5aba0ea470"))
12102 (package
12103 (name "renameat2")
12104 (version (git-version "0.0.0" revision commit))
12105 (source (origin
12106 (method url-fetch)
12107 (uri (string-append "https://gist.githubusercontent.com/"
12108 "eatnumber1/f97ac7dad7b1f5a9721f/raw/"
12109 commit "/renameat2.c"))
12110 (sha256
12111 (base32
12112 "07b4hsxqjm610sdkm4nxhp0gnl2s7gzlh4zdnja5ay40v4x24bb9"))))
12113 (build-system gnu-build-system)
12114 (arguments
12115 (list
12116 #:tests? #f ;no test suite
12117 #:phases #~(modify-phases %standard-phases
12118 (delete 'configure)
12119 (replace 'build
12120 (lambda _
12121 (invoke #$(cc-for-target) "renameat2.c"
12122 "-o" "renameat2")))
12123 (replace 'install
12124 (lambda _
12125 (install-file "renameat2"
12126 (string-append #$output "/bin")))))))
12127 (home-page "https://gist.github.com/eatnumber1/f97ac7dad7b1f5a9721f")
12128 (synopsis "Command to call the renameat2 Linux system call")
12129 (description "This package provides a @command{renameat2} command that
12130calls the Linux-specific @code{renameat2} system call.")
12131 (license license:expat))))
12132
12133(define-public libgpiod
12134 (package
12135 (name "libgpiod")
12136 (version "2.2.2")
12137 (source
12138 (origin
12139 (method git-fetch)
12140 (uri
12141 (git-reference
12142 (url "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
12143 (commit (string-append "v" version))))
12144 (file-name (git-file-name name version))
12145 (sha256 (base32 "10yiwrw80x0057w825zxmdbd54w9lbyf49bgqk1cryqapglfzqri"))))
12146 (build-system gnu-build-system)
12147 (arguments
12148 (list #:configure-flags
12149 #~(list "--enable-tools=yes"
12150 "--enable-bindings-cxx")))
12151 (native-inputs
12152 (list automake
12153 autoconf-2.71
12154 libtool
12155 autoconf-archive
12156 pkg-config))
12157 (synopsis "Interact with the Linux GPIO character device")
12158 (description
12159 "This package provides a C library with C++ bindings and
12160command-line tools for interacting with GPIO devices that avoids the usage of
12161older system-wide @file{/sys} interface.")
12162 (home-page "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/")
12163 (license (list license:lgpl2.1+ ;; libgpiod
12164 license:gpl2+ ;; gpio-tools
12165 license:lgpl3+)))) ;; C++ bindings
12166
12167(define-public python-libgpiod
12168 (package
12169 (name "python-libgpiod")
12170 (version "2.3.0")
12171 (source
12172 (origin
12173 (method git-fetch)
12174 (uri
12175 (git-reference
12176 (url "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
12177 (commit (string-append "python-v" version))))
12178 (file-name (git-file-name name version))
12179 (sha256 (base32 "1lkd7lgpb28pqf7p6lrwl0ss7r5ryiddmdcisnz6ixy796qhr8kr"))))
12180 (build-system pyproject-build-system)
12181 (arguments
12182 (list
12183 #:tests? #f ; tests require root, see README.md
12184 #:phases
12185 #~(modify-phases %standard-phases
12186 (add-after 'unpack 'cd-to-python-bindings
12187 (lambda _
12188 (chdir "bindings/python"))))))
12189 (native-inputs
12190 (list python-setuptools
12191 python-wheel
12192 libgpiod))
12193 (synopsis "Interact with the Linux GPIO character device")
12194 (description
12195 "This package provides Python bindings for interacting with GPIO devices
12196that avoids the usage of older system-wide @file{/sys} interface.")
12197 (home-page "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/")
12198 (license (list license:lgpl2.1+ ;; libgpiod
12199 license:gpl2+ ;; gpio-tools
12200 license:lgpl3+)))) ;; C++ bindings
12201
12202(define-public libtraceevent
12203 (package
12204 (name "libtraceevent")
12205 (version "1.9.0")
12206 (source
12207 (origin
12208 (method git-fetch)
12209 (uri (git-reference
12210 (url "https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git")
12211 (commit (string-append name "-" version))))
12212 (file-name (git-file-name name version))
12213 (sha256
12214 (base32 "10fklw4znjhm8mlg6hwlipdyk7v3053lnrc5bpqifnsc8gwqbaz0"))))
12215 (build-system meson-build-system)
12216 (arguments
12217 (list
12218 #:configure-flags
12219 #~(list "-Ddoc=false")))
12220 (home-page "https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/")
12221 (synopsis "Linux kernel trace event library")
12222 (description
12223 "This library parses raw Linux kernel trace event formats.")
12224 (license (list license:gpl2
12225 license:lgpl2.1))))
12226
12227(define-public libtracefs
12228 (package
12229 (name "libtracefs")
12230 (version "1.8.3")
12231 (source
12232 (origin
12233 (method git-fetch)
12234 (uri (git-reference
12235 (url "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git")
12236 (commit (string-append name "-" version))))
12237 (file-name (git-file-name name version))
12238 (sha256
12239 (base32 "1bc4mwf488nlja64zawjznvb6640vchjb25xa02v53x6qfb1mpmq"))))
12240 (build-system meson-build-system)
12241 (arguments
12242 (list
12243 #:configure-flags
12244 #~(list "-Ddoc=false")))
12245 (native-inputs
12246 (list bison
12247 flex
12248 pkg-config))
12249 (inputs (list libtraceevent))
12250 (home-page "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/")
12251 (synopsis "Linux kernel trace file system library")
12252 (description
12253 "This library provides APIs to access the Linux kernel's trace file
12254system.")
12255 (license (list license:gpl2
12256 license:lgpl2.1))))
12257
12258(define-public libtree
12259 (package
12260 (name "libtree")
12261 (version "3.1.1")
12262 (source
12263 (origin
12264 (method git-fetch)
12265 (uri (git-reference
12266 (url "https://github.com/haampie/libtree")
12267 (commit (string-append "v" version))))
12268 (file-name (git-file-name name version))
12269 (patches (search-patches "libtree-fix-check-non-x86.patch"))
12270 (sha256
12271 (base32 "1jbc60cslzcfxk9jwva51ncr1zl1nz0fkgfjdckgv81is11nswmb"))))
12272 (arguments
12273 (list #:make-flags
12274 ;; NOTE: Official documentation recommends to build libtree with
12275 ;; "-static" flag.
12276 #~(list (string-append "CC=" #$(cc-for-target))
12277 (string-append "PREFIX=" #$output))
12278 #:phases
12279 #~(modify-phases %standard-phases
12280 (add-after 'unpack 'fix-tests
12281 ;; XXX: '08_nodeflib' fails as 'libtree' returns a non-zero
12282 ;; code in one of the tests.
12283 ;;
12284 ;; See <https://github.com/haampie/libtree/issues/80>).
12285 (lambda _
12286 (substitute* "tests/08_nodeflib/Makefile"
12287 (("! ../../libtree -vvv exe_b")
12288 "../../libtree -vvv exe_b"))))
12289 (delete 'configure))))
12290 (build-system gnu-build-system)
12291 (home-page "https://github.com/haampie/libtree")
12292 (synopsis "Show output of @command{ldd} as a tree")
12293 (description
12294 "This tool turns @command{ldd} into a tree and explains how shared
12295libraries are found or why they cannot be located.")
12296 (license license:expat)))
12297
12298(define-public touchegg
12299 (package
12300 (name "touchegg")
12301 (version "2.0.18")
12302 (source
12303 (origin
12304 (method git-fetch)
12305 (uri (git-reference
12306 (url "https://github.com/JoseExposito/touchegg")
12307 (commit version)))
12308 (file-name (git-file-name name version))
12309 (sha256
12310 (base32 "0m8zgihij14b8dxrxxvpl8sdsx49mjlnxnm0fhgfxscy7n07kcpc"))))
12311 (build-system cmake-build-system)
12312 (arguments
12313 `(#:tests? #f ; No tests exist
12314 #:configure-flags
12315 (list "-DUSE_SYSTEMD=OFF"))) ; No systemd
12316 (native-inputs
12317 (list
12318 pkg-config))
12319 (inputs
12320 (list
12321 cairo
12322 gtk+
12323 libgudev
12324 libinput
12325 libxrandr
12326 libxtst
12327 pugixml))
12328 (home-page "https://github.com/JoseExposito/touchegg")
12329 (synopsis "Multitouch gesture recognizer")
12330 (description
12331 "Touchégg is an application that runs in the background and transform the
12332gestures you make on your touchpad or touchscreen into visible actions in your
12333desktop.")
12334 (license license:gpl3+)))
12335
12336(define-public evtest
12337 (package
12338 (name "evtest")
12339 (version "1.36")
12340 (source (origin
12341 (method git-fetch)
12342 (uri (git-reference
12343 (url "https://gitlab.freedesktop.org/libevdev/evtest")
12344 (commit (string-append "evtest-" version))))
12345 (file-name (git-file-name name version))
12346 (sha256
12347 (base32
12348 "0mwjvz0fwwcwm4fpw0m4x8bcxpnzjkiy7fpb438vf4i5g5q0dc1k"))))
12349 (build-system gnu-build-system)
12350 (arguments
12351 (list #:tests? #f ;No tests exist
12352 #:make-flags #~(list (string-append "CC="
12353 #$(cc-for-target))
12354 (string-append "PREFIX="
12355 #$output))
12356 #:phases #~(modify-phases %standard-phases
12357 (add-after 'unpack 'generate-doc
12358 (lambda _
12359 (invoke "asciidoc" "-d" "manpage"
12360 "-b" "docbook"
12361 "-o" "evtest.1.xml"
12362 "evtest.txt")
12363 (invoke "xsltproc" "--nonet"
12364 (string-append
12365 #$(this-package-native-input "docbook-xsl")
12366 "/xml/xsl/docbook-xsl-"
12367 #$(package-version
12368 (this-package-native-input "docbook-xsl"))
12369 "/manpages/docbook.xsl")
12370 "evtest.1.xml")))
12371 (replace 'bootstrap
12372 (lambda _
12373 (setenv "CONFIG_SHELL" (which "sh"))
12374 (invoke "autoreconf" "-fi"))))))
12375 (native-inputs (list autoconf
12376 automake
12377 bash-minimal
12378 xmlto
12379 docbook-xsl
12380 libxslt
12381 asciidoc))
12382 (home-page "https://gitlab.freedesktop.org/libevdev/evtest")
12383 (synopsis "Kernel evdev device information and monitor")
12384 (description
12385 "@code{evtest} is a tool to print @code{evdev} kernel events. It reads
12386directly from the kernel device and prints a device description and the events
12387with the value and the symbolic name.")
12388 (license license:gpl2+)))
12389
12390(define-public tp-smapi-module
12391 (package
12392 (name "tp-smapi-module")
12393 (version "0.44")
12394 (source (origin
12395 (method git-fetch)
12396 (uri (git-reference
12397 (url "https://github.com/linux-thinkpad/tp_smapi")
12398 (commit (string-append "tp-smapi/" version))))
12399 (file-name (git-file-name name version))
12400 (sha256
12401 (base32
12402 "0kzbks07bh5jbi1n311zp9cbp1xxyzi7nys8wq1k0k5ig81h9w6k"))))
12403 (build-system linux-module-build-system)
12404 (arguments
12405 `(#:tests? #f)) ;there are none.
12406 (home-page "https://github.com/linux-thinkpad/tp_smapi")
12407 (synopsis
12408 "Linux Kernel module exposing features of ThinkPad hardware")
12409 (description
12410 "This package provides a Linux Kernel module that controls
12411battery charging of specific ThinkPad laptops. It also includes an improved
12412version of the HDAPS driver. The underlying hardware interfaces are
12413@acronym{SMAPI, System Management Application Program Interface} and direct
12414access to the embedded controller.")
12415 (license license:gpl2+)))
12416
12417(define-public modprobed-db
12418 (package
12419 (name "modprobed-db")
12420 (version "2.48")
12421 (source (origin
12422 (method git-fetch)
12423 (uri (git-reference
12424 (url "https://github.com/graysky2/modprobed-db")
12425 (commit (string-append "v" version))))
12426 (file-name (git-file-name name version))
12427 (sha256
12428 (base32
12429 "0jscinga32jjvy3vwl4s1pyd5fjgqhmmk010k665nhil302hzjdc"))))
12430 (build-system gnu-build-system)
12431 (arguments
12432 (list #:tests? #f ;no tests
12433 #:make-flags
12434 #~(list (string-append "PREFIX=" #$output)
12435 "INITDIR_SYSTEMD=no-thanks")
12436 #:phases
12437 #~(modify-phases %standard-phases
12438 (delete 'configure)
12439 (add-after 'install 'fix-path
12440 (lambda* (#:key inputs #:allow-other-keys)
12441 (substitute* (string-append #$output "/bin/modprobed-db")
12442 (("/usr") #$output)
12443 (((string-append "(" (string-join (list "awk"
12444 "cp"
12445 "cut"
12446 "getent"
12447 "grep"
12448 "logname"
12449 "md5sum"
12450 "mkdir"
12451 "mv"
12452 "sed"
12453 "sort"
12454 "uniq"
12455 "wc")
12456 "|") ")") m)
12457 (search-input-file inputs (string-append "/bin/" m)))
12458 (("modprobe ")
12459 (string-append
12460 (search-input-file inputs "/bin/modprobe") " "))))))))
12461 (inputs (list coreutils kmod gawk glibc grep sed))
12462 (home-page "https://wiki.archlinux.org/title/Modprobed-db")
12463 (synopsis "Keep track of Linux modules that have been probed")
12464 (description
12465 "Modprobed-db is a useful utility for users wishing to build a minimal
12466kernel via a @code{make localmodconfig}. In a nutshell, this @command{make}
12467target creates a config based on the current config and a list of modules you
12468define (that @command{modprobed-db} keeps for you). It then disables any
12469module option that is not needed thus not building extraneous modules. This
12470results in a system-specific, streamlined kernel package and footprint as well
12471as reduced compilation times.
12472
12473Modprobed-db simply logs every module ever probed on the target system to a
12474text-based database (@file{$XDG_CONFIG_HOME/modprobed-db}), which can be read
12475directly by @code{make localmodconfig} as described above.")
12476 (license license:expat)))
12477
12478(define-public kernel-hardening-checker
12479 (package
12480 (name "kernel-hardening-checker")
12481 (version "0.6.17.1")
12482 (source (origin
12483 (method git-fetch)
12484 (uri (git-reference
12485 (url "https://github.com/a13xp0p0v/kernel-hardening-checker")
12486 (commit (string-append "v" version))))
12487 (file-name (git-file-name name version))
12488 (sha256
12489 (base32
12490 "04r9bbayhs1ik84908q148k9djawy69zarxw0vc31dfbf64mni62"))))
12491 (build-system pyproject-build-system)
12492 (arguments
12493 (list #:tests? #f)) ;no active tests, runtime only, see GitHub Actions
12494 (native-inputs
12495 (list python-setuptools))
12496 (home-page "https://github.com/a13xp0p0v/kernel-hardening-checker")
12497 (synopsis
12498 "Tool for checking the security hardening options of the Linux kernel")
12499 (description
12500 "@code{kernel-hardening-checker} is a tool for checking the security
12501hardening options of the Linux kernel. Provided preferences are based on
12502suggestions from various sources, including:
12503
12504@itemize
12505@item KSPP recommended settings
12506@item CLIP OS kernel configuration
12507@item Last public grsecurity patch (options which they disable)
12508@item SECURITY_LOCKDOWN_LSM patchset
12509@item Direct feedback from the Linux kernel maintainers
12510@end itemize\n
12511This tool supports checking Kconfig options and kernel cmdline parameters.")
12512 (license license:gpl3)))
12513
12514(define-public firejail
12515 (package
12516 (name "firejail")
12517 (version "0.9.78")
12518 (source (origin
12519 (method git-fetch)
12520 (uri (git-reference
12521 (url "https://github.com/netblue30/firejail")
12522 (commit version)))
12523 (file-name (git-file-name name version))
12524 (sha256
12525 (base32
12526 "18bsnwyg7aidm74qckrp437gr0zy9bpq1b1wr6mfnj61v74fwwxs"))))
12527 (arguments
12528 (list #:phases
12529 #~(modify-phases %standard-phases
12530 (replace 'check
12531 (lambda* (#:key tests? #:allow-other-keys)
12532 (when tests?
12533 (with-directory-excursion "test"
12534 (invoke "make"))))))))
12535 (build-system gnu-build-system)
12536 (inputs
12537 (list apparmor xdg-dbus-proxy))
12538 (synopsis "Linux namespaces sandbox program")
12539 (description
12540 "Firejail is a SUID sandbox program that reduces the risk of security
12541breaches by restricting the running environment of untrusted applications
12542using Linux namespaces, seccomp-bpf and Linux capabilities. The software
12543includes sandbox profiles for a number of common Linux programs. Firejail
12544should be added to the list of setuid programs in the system configuration to
12545work properly.")
12546 (home-page "https://github.com/netblue30/firejail")
12547 (supported-systems
12548 (filter (cut string-suffix? "-linux" <>) %supported-systems))
12549 (license license:gpl2+)))
12550
12551(define-public firejail-disable-sandbox-check
12552 (package/inherit
12553 firejail
12554 (name "firejail-disable-sandbox-check")
12555 (arguments
12556 (substitute-keyword-arguments arguments
12557 ((#:configure-flags flags #~'())
12558 #~(append #$flags
12559 (list "--disable-sandbox-check")))))
12560 (description
12561 (string-append (package-description firejail)
12562 " Builded with @code{--disable-sandbox-check}, which is
12563 only intended for development."))))
12564
12565(define-public edac-utils
12566 (package
12567 (name "edac-utils")
12568 (version "0.18")
12569 (source (origin
12570 (method git-fetch)
12571 (uri (git-reference
12572 (url "https://github.com/grondo/edac-utils.git")
12573 (commit version)))
12574 (file-name (string-append name "-" version "-checkout"))
12575 (sha256
12576 (base32
12577 "04j686m58wsnyy5di7rz0sw9jahlm4ziwxjmgs31pjb87vzw3xgp"))))
12578 (build-system gnu-build-system)
12579 (native-inputs
12580 (list perl))
12581 (inputs
12582 (list sysfsutils))
12583 (synopsis "Memory error detection and correction userspace helpers")
12584 (description "This package provides userspace helpers for memory
12585error detection and correction (EDAC).")
12586 (home-page "https://github.com/grondo/edac-utils")
12587 (license license:gpl2+)))
12588
12589(define-public spectre-meltdown-checker
12590 (package
12591 (name "spectre-meltdown-checker")
12592 (version "0.46")
12593 (source (origin
12594 (method git-fetch)
12595 (uri (git-reference
12596 (url "https://github.com/speed47/spectre-meltdown-checker")
12597 (commit (string-append "v" version))))
12598 (file-name (git-file-name name version))
12599 (patches
12600 (search-patches
12601 "spectre-meltdown-checker-externalize-fwdb.patch"))
12602 ;; Remove builtin firmware database.
12603 (modules '((guix build utils)))
12604 (snippet '(substitute* "spectre-meltdown-checker.sh"
12605 (("^# [AI],.*") "")))
12606 (sha256
12607 (base32
12608 "0j42p6dayb7k87kf8sqimxlaswis3qh0569a15zccyknv9vf129k"))))
12609 (build-system copy-build-system)
12610 (arguments
12611 (list
12612 #:install-plan
12613 #~'(("spectre-meltdown-checker.sh" "bin/spectre-meltdown-checker"))
12614 #:phases
12615 #~(modify-phases %standard-phases
12616 (add-after 'unpack 'fixpath
12617 (lambda* (#:key inputs #:allow-other-keys)
12618 (define* (find-command inputs cmd #:optional (bin "bin"))
12619 (search-input-file inputs (string-append bin "/" cmd)))
12620 (substitute* "spectre-meltdown-checker.sh"
12621 ;; ${opt_arch_prefix}CMD
12622 (("\\$\\{opt_arch_prefix\\}\\<(nm|objdump|readelf|strings)\\>"
12623 all cmd)
12624 (find-command inputs cmd))
12625
12626 ;; Commands safe to substitute directly.
12627 (("\\<(awk|(base|dir)name|bunzip2|g(un)?zip|lz4)\\>" all cmd)
12628 (find-command inputs cmd))
12629 (("\\<(lzop|mktemp|modprobe|pgrep|rmmod|umount)\\>" all cmd)
12630 (find-command inputs cmd))
12631 (("\\<(unlzma|unxz|unzstd|uuencode)\\>" all cmd)
12632 (find-command inputs cmd))
12633
12634 ;; Commands which should only be substituted based on their
12635 ;; surroundings: First up, dd.
12636 (("\\<(dd)\\> if=" all cmd)
12637 (string-append
12638 (find-command inputs cmd)
12639 " if="))
12640
12641 ;; Another special case: sysctl is in sbin.
12642 (("(if |\\$\\( *)\\<(sysctl)\\>" all pre cmd)
12643 (string-append pre (find-command inputs cmd "sbin")))
12644
12645 ;; Meow
12646 (("cat (<<EOF|\"\\$)" all what)
12647 (string-append (find-command inputs "cat") " " what))
12648 (("'cat'")
12649 (string-append "'" (find-command inputs "cat") "'"))
12650 (("\"cat\"")
12651 (string-append "\"" (find-command inputs "cat") "\""))
12652
12653 ;; ${COMMAND} -
12654 ;; ${COMMAND} ^
12655 (("\\<(base64|cut|grep|head|id|mount)\\> ([-^])" all cmd suffix)
12656 (string-append (find-command inputs cmd) " " suffix))
12657 (("\\<(od|perl|rm|uname|xargs)\\> ([-^])" all cmd suffix)
12658 (string-append (find-command inputs cmd) " " suffix))
12659
12660 ;; ${COMMAND} |
12661 (("\\<(dmesg)\\> \\|" all cmd)
12662 (string-append (find-command inputs cmd) " |"))
12663 ;; | ${COMMAND}
12664 (("\\| \\<(grep|sed|sort|stat|tr)\\>" all cmd)
12665 (string-append "| " (find-command inputs cmd)))
12666
12667 ;; Command in sub-shell, i.e. $($COMMAND ...)
12668 (("\\$\\( *(\\<cat|find|grep|mount|nproc|stat|tr\\>)"
12669 all cmd)
12670 (string-append "$(" (find-command inputs cmd)))
12671
12672 ;; command -v
12673 (("command -v \"*\\<(base64|nproc|perl|printf)\\>\"*" all cmd)
12674 (string-append "command -v " (find-command inputs cmd)))))))))
12675 (inputs (list kmod lz4 lzop perl procps sharutils util-linux zstd))
12676 (home-page "https://github.com/speed47/spectre-meltdown-checker")
12677 (synopsis "CPU vulnerability / mitigation checker")
12678 (description
12679 "This package provides a shell script to assess your system's resilience
12680against the several transient execution CVEs that were published since early
126812018, and gives guidance as to how to mitigate them.")
12682 (license license:gpl3)))
12683
12684(define-public csmith
12685 (package
12686 (name "csmith")
12687 (version "2.3.0")
12688 (source (origin
12689 (method git-fetch)
12690 (uri (git-reference
12691 (url "https://github.com/csmith-project/csmith")
12692 (commit (string-append "csmith-" version))))
12693 (file-name (git-file-name name version))
12694 (sha256
12695 (base32
12696 "0nhrsnv6cny14xz68qb1h30fbwc05adkisk51p3x63mydm60ddl3"))))
12697 (build-system gnu-build-system)
12698 (native-inputs
12699 (list autoconf automake libtool m4 perl))
12700 (arguments
12701 (list
12702 #:tests? #f ;no test suite
12703 ;; Do not install headers under 'include/csmith-VERSION' but in
12704 ;; 'include/csmith'.
12705 #:phases
12706 `(modify-phases %standard-phases
12707 (add-after 'unpack 'patch-includedir
12708 (lambda _
12709 (substitute* "runtime/Makefile.am"
12710 (("\\$\\(includedir\\)/\\$\\(PACKAGE\\)-\\$\\(VERSION\\)")
12711 "$(includedir)/$(PACKAGE)"))))
12712 (add-before 'bootstrap 'force-bootstrap
12713 (lambda _
12714 (delete-file "configure"))))))
12715 (home-page "https://github.com/csmith-project/csmith")
12716 (synopsis "Random generator of C programs")
12717 (description "The primary purpose of Csmith is to find compiler bugs with
12718random programs using differential testing.")
12719 (license license:bsd-4)))
12720
12721(define-public ipvsadm
12722 (package
12723 (name "ipvsadm")
12724 (version "1.31")
12725 (source
12726 (origin
12727 (method url-fetch)
12728 (uri (string-append "https://kernel.org/pub/linux/utils/kernel"
12729 "/ipvsadm/ipvsadm-" version ".tar.xz"))
12730 (sha256
12731 (base32 "1nyzpv1hx75k9lh0vfxfhc0p2fpqaqb38xpvs8sn88m1nljmw2hs"))))
12732 (build-system gnu-build-system)
12733 (native-inputs (list linux-libre-headers pkg-config which))
12734 (inputs (list libnl popt))
12735 (arguments
12736 (list #:tests? #f
12737 #:parallel-build? #f ;build fails randomly with '-j'
12738 #:make-flags
12739 #~(list (string-join
12740 (list "CFLAGS="
12741 (string-append "-I"
12742 #$(this-package-input "libnl")
12743 "/include/libnl3")
12744 (string-append "-L" #$(this-package-input "libnl")
12745 "/lib")
12746 "-fPIC")
12747 " ")
12748 (string-append "CC=" #$(cc-for-target))
12749 (string-append "SBIN=" #$output "/sbin")
12750 (string-append "INIT=" #$output "/etc/init.d")
12751 (string-append "MANDIR=" #$output "/share/man"))
12752 #:phases #~(modify-phases %standard-phases
12753 (delete 'configure))))
12754 (home-page "http://www.linuxvirtualserver.org/software/ipvs.html")
12755 (synopsis "IP virtual server administration utility")
12756 (description "@code{ipvsadm(8)} is used to set up, maintain or inspect the
12757virtual server table in the Linux kernel. The Linux Virtual Server can be used
12758to build scalable network services based on a cluster of two or more nodes.")
12759 (license license:gpl2+)))
12760
12761(define-public ryzenadj
12762 (package
12763 (name "ryzenadj")
12764 (version "0.17.0")
12765 (source
12766 (origin
12767 (method git-fetch)
12768 (uri (git-reference
12769 (url "https://github.com/flygoat/ryzenadj")
12770 (commit (string-append "v" version))))
12771 (file-name (git-file-name name version))
12772 (sha256
12773 (base32 "0dpznl4h1f5syq5464a0h9grqlvlp0qmjxr59nq3gp363gr5vjfv"))
12774 (modules '((guix build utils)))
12775 (snippet
12776 '(begin
12777 (delete-file-recursively "win32")))))
12778 (build-system cmake-build-system)
12779 (inputs (list pciutils))
12780 (arguments
12781 (list
12782 #:tests? #f ;No test suite
12783 #:build-type "Release"))
12784 (home-page "https://github.com/flygoat/ryzenadj")
12785 (synopsis "Power management tool for AMD Ryzen APUs")
12786 (description
12787 "@command{ryzenadj} is an utility to adjust power management settings for
12788AMD Ryzen mobile processors. You will need to ensure it can access /dev/mem,
12789for instance by using the \"iomem=relaxed\" kernel argument.")
12790 (license license:lgpl3)))
12791
12792(define-public ryzen-smu
12793 (package
12794 (name "ryzen-smu")
12795 (version "0.1.5")
12796 (source (origin
12797 (method git-fetch)
12798 (uri (git-reference
12799 (url "https://gitlab.com/leogx9r/ryzen_smu.git")
12800 (commit (string-append "v" version))))
12801 (file-name (git-file-name name version))
12802 (sha256
12803 (base32
12804 "010la2a8zp7rljlg5ssc9ragzva4ca05gvzlicjagl508659d2wz"))))
12805 (build-system linux-module-build-system)
12806 (arguments
12807 `(#:tests? #f)) ; no tests
12808 (synopsis "System Management Unit driver for AMD Ryzen processors")
12809 (description "This package provides a way to access the
12810System Management Unit for certain AMD Ryzen processors.
12811This includes access to the System Management Network.")
12812 (home-page "https://gitlab.com/leogx9r/ryzen_smu")
12813 (license license:gpl2)))
12814
12815(define-public hid-wiimote-plus
12816 (package
12817 (name "hid-wiimote-plus")
12818 (version "1.0.0")
12819 (source
12820 (origin
12821 (method git-fetch)
12822 (uri (git-reference
12823 (url "https://github.com/dkosmari/hid-wiimote-plus")
12824 (commit (string-append "v" version))))
12825 (file-name (git-file-name name version))
12826 (sha256
12827 (base32 "0vly8z9876yiaxx77ca9lbf9hfv5xichkkxxczjhbs2qwr819k1k"))))
12828 (build-system linux-module-build-system)
12829 (arguments
12830 (list #:tests? #f)) ; No tests.
12831 (synopsis "WiiMote HID kernel module")
12832 (description "This package provides a WiiMote driver that follows the
12833Linux input convention. Specifically, that allows you to use the D-pad
12834as a gamepad.")
12835 (home-page "https://github.com/dkosmari/hid-wiimote-plus")
12836 (license license:gpl2+)))
12837
12838(define-public python-evemu
12839 (package
12840 (name "python-evemu")
12841 (version "2.7.0")
12842 (source (origin
12843 (method git-fetch)
12844 (uri (git-reference
12845 (url "https://gitlab.freedesktop.org/libevdev/evemu")
12846 (commit (string-append "v" version))))
12847 (file-name (git-file-name name version))
12848 (sha256
12849 (base32
12850 "1sxf6v2wnajj9srlkfjfymjmmp4dlq73gzjcjmaw015a3c0xl029"))))
12851 (build-system gnu-build-system)
12852 (arguments
12853 (list #:tests? #f ; would open device files
12854 #:phases
12855 #~(modify-phases %standard-phases
12856 (add-after 'unpack 'patch
12857 (lambda* (#:key inputs #:allow-other-keys)
12858 (substitute* "python/evemu/base.py"
12859 (("\"libevdev.so\"")
12860 (string-append "\"" (assoc-ref inputs "libevdev")
12861 "/lib/libevdev.so\""))))))))
12862 (native-inputs
12863 (list asciidoc autoconf automake libtool docbook-xsl pkg-config
12864 python-wrapper xmlto))
12865 (inputs
12866 (list libevdev))
12867 (synopsis "Record and replay input device events")
12868 (description "This package provides a way to record and replay device
12869descriptions and events, making it possible to emulate input devices
12870through the Linux kernel's input system. Emulated devices are for most
12871practical purposes indistinguishable from real devices.
12872
12873It provides a command line program and also a Python library.")
12874 (home-page "https://www.freedesktop.org/wiki/Evemu/")
12875 (license license:gpl3)))
12876
12877(define-public dualsensectl
12878 (package
12879 (name "dualsensectl")
12880 (version "0.7")
12881 (source (origin
12882 (method git-fetch)
12883 (uri (git-reference
12884 (url "https://github.com/nowrep/dualsensectl.git")
12885 (commit (string-append "v" version))))
12886 (file-name (git-file-name name version))
12887 (sha256
12888 (base32
12889 "05snsp5r3hc2yc1nf0w4aam1my4h0lkxnmy7k4glxvasd9jwahzw"))))
12890 (build-system meson-build-system)
12891 (native-inputs
12892 (list pkg-config))
12893 (inputs
12894 (list eudev dbus hidapi))
12895 (synopsis "Linux tool for controlling PS5 DualSense controller")
12896 (description "This package provides a Linux tool for controlling a PS5
12897DualSense controller. It has to be already connected via USB or connected
12898via Bluetooth.")
12899 (home-page "https://github.com/nowrep/dualsensectl")
12900 (license license:gpl2)))