projects/guix·blob haskell-team · refs

12909 lines · 554.8 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.8")
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 "0h8rwp1zipb0szf3y05pbmqyscdi4902x239bid7rbfifflxbs0j")))
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.54")
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 "1b5c7v7vxl27z3xrdnqxgyzdv2b8xy464majpv8bn0l1vl10pwwx")))
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.111")
800(define debian-patches-6.12
801 (linux-debian-patches
802 (string-append linux-debian-6.12-version "-1")
803 (base32 "11smpmxk42makqc57vl5q8hblnkj3v4dmcws75f1rbih2asvabzp")))
804(define-public linux-debian-6.12-pristine-source
805 (let ((version linux-debian-6.12-version)
806 (hash (base32 "044qhkby6dgrb4mmggk6j0m6dmlw96c9a7v0lq9gm221c9kxqncy")))
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 #:phases
3613 #~(modify-phases %standard-phases
3614 (add-after 'unpack 'patch-paths
3615 (lambda _
3616 ;; In the mv meson configuration, chimerautils refers
3617 ;; to it's own cp (_PATH_CP) and mv (_PATH_MV) by path.
3618 (substitute* "src.freebsd/coreutils/mv/meson.build"
3619 (("/bin/") (string-append #$output "/bin/"))))))))
3620 (inputs (list acl
3621 libedit
3622 libxo
3623 ncurses
3624 openssl
3625 zlib
3626 (list zstd "lib")))
3627 (native-inputs (list flex bison pkg-config))
3628 (home-page "https://github.com/chimera-linux/chimerautils")
3629 (synopsis "The FreeBSD-based core Linux userland from Chimera Linux")
3630 (description
3631 "This is a port of the FreeBSD userland for Linux provided by
3632the Chimera Linux distribution. Essentially, it is a collection of UNIX tools
3633such as @command{grep}, @command{cp}, @command{vi}, etc. and can be used as an
3634alternative to the corresponding implementations from the GNU project.")
3635 (license license:bsd-2)))
3636
3637(define-public dislocker
3638 (package
3639 (name "dislocker")
3640 (version "0.7.3")
3641 (home-page "https://github.com/Aorimn/dislocker")
3642 (source (origin
3643 (method git-fetch)
3644 (uri (git-reference
3645 (url home-page)
3646 (commit (string-append "v" version))))
3647 (file-name (git-file-name name version))
3648 (sha256
3649 (base32
3650 "1ak68s1v5dwh8y2dy5zjybmrh0pnqralmyqzis67y21m87g47h2k"))))
3651 (build-system cmake-build-system)
3652 (arguments
3653 '(#:tests? #f)) ;no test suite
3654 (inputs (list fuse-2 mbedtls-lts))
3655 (synopsis "FUSE driver to read/write Windows BitLocker drives")
3656 (description
3657 "This package provides means to to read BitLocker encrypted
3658partitions. Write functionality is also provided but check the README.")
3659 (license license:gpl2+)))
3660
3661(define-public dwarves
3662 (package
3663 (name "dwarves")
3664 (version "1.29")
3665 (source (origin
3666 (method git-fetch)
3667 (uri (git-reference
3668 (url "https://github.com/acmel/dwarves")
3669 (commit (string-append "v" version))))
3670 (file-name (git-file-name name version))
3671 (sha256
3672 (base32
3673 "1ia3r77zyw7r8mydy1zrrdnqzm9ginsvf9pqviq48rglihhddvli"))
3674 (patches
3675 (search-patches "dwarves-threading-reproducibility.patch"))))
3676 (build-system cmake-build-system)
3677 (arguments (list #:configure-flags #~(list "-D__LIB=lib"
3678 "-DLIBBPF_EMBEDDED=OFF")
3679 #:tests? #f)) ;no test suite
3680 (native-inputs (list pkg-config))
3681 (inputs (list libbpf))
3682 (home-page "https://github.com/acmel/dwarves")
3683 (synopsis "Debugging information processing library and utilities")
3684 (description "Dwarves is a set of tools that use the debugging information
3685inserted in ELF binaries by compilers such as GCC, used by well known
3686debuggers such as GDB.
3687
3688Utilities in the Dwarves suite include @command{pahole}, that can be used to
3689find alignment holes in structures and classes in languages such as C, C++,
3690but not limited to these. These tools can also be used to encode and read the
3691BTF type information format used with the kernel Linux @code{bpf} syscall.
3692
3693The @command{codiff} command can be used to compare the effects changes in
3694source code generate on the resulting binaries.
3695
3696The @command{pfunct} command can be used to find all sorts of information
3697about functions, inlines, decisions made by the compiler about inlining, etc.
3698
3699The @command{pahole} command can be used to use all this type information to
3700pretty print raw data according to command line directions.
3701
3702Headers can have its data format described from debugging info and offsets from
3703it can be used to further format a number of records.
3704
3705Finally, the @command{btfdiff} command can be used to compare the output of
3706pahole from BTF and DWARF, to make sure they produce the same results.")
3707 (license license:gpl2+)))
3708
3709(define-public fbset
3710 (package
3711 (name "fbset")
3712 (version "2.1")
3713 (source
3714 (origin
3715 (method url-fetch)
3716 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
3717 version ".tar.gz"))
3718 (sha256
3719 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
3720 (build-system gnu-build-system)
3721 (arguments
3722 '(#:modules ((guix build gnu-build-system)
3723 (guix build utils)
3724 (srfi srfi-26))
3725 #:phases
3726 (modify-phases %standard-phases
3727 (delete 'configure) ; no configure script
3728 (add-before 'install 'pre-install
3729 (lambda* (#:key outputs #:allow-other-keys)
3730 (let ((out (assoc-ref outputs "out")))
3731 (substitute* "Makefile"
3732 (("mknod ") "true ")
3733 ;; The Makefile doesn't honour PREFIX or similar.
3734 (("/usr") out))
3735 (mkdir out)
3736 (with-directory-excursion out
3737 (for-each mkdir-p (list "sbin"
3738 "man/man5"
3739 "man/man8")))
3740 #t)))
3741 (add-after 'install 'install-fb.modes
3742 (lambda* (#:key outputs #:allow-other-keys)
3743 (let* ((out (assoc-ref outputs "out"))
3744 (etc (string-append out "/etc")))
3745 (for-each (cut install-file <> etc)
3746 (find-files "etc" "^fb\\.modes"))
3747 (symlink "fb.modes.ATI"
3748 (string-append etc "/fb.modes"))
3749 #t))))
3750 ;; Parallel building races to create modes.tab.c.
3751 #:parallel-build? #f
3752 #:tests? #f)) ; no test suite
3753 (native-inputs
3754 (list bison flex))
3755 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
3756 (synopsis "Show and modify Linux frame buffer settings")
3757 (description
3758 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
3759different kinds of graphic displays. The @command{fbset} utility can query and
3760change various device settings such as depth, virtual resolution, and timing
3761parameters.")
3762 (license license:gpl2)))
3763
3764(define-public procps
3765 (package
3766 (name "procps")
3767 (version "4.0.3")
3768 (source (origin
3769 (method url-fetch)
3770 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
3771 "procps-ng-" version ".tar.xz"))
3772 (sha256
3773 (base32
3774 "14ms9mkqr1mgl3h5yl6w8m57cf39k382nv7qms78vqbaz728wg1h"))
3775 (patches (search-patches "procps-strtod-test.patch"))))
3776 (build-system gnu-build-system)
3777 (arguments
3778 (list #:modules '((guix build utils)
3779 (guix build gnu-build-system)
3780 (srfi srfi-1)
3781 (srfi srfi-26))
3782 #:configure-flags
3783 (if (%current-target-system)
3784 #~'("ac_cv_func_malloc_0_nonnull=yes"
3785 "ac_cv_func_realloc_0_nonnull=yes")
3786 #~'())
3787 #:phases
3788 #~(modify-phases %standard-phases
3789 (add-after 'install 'post-install
3790 ;; Remove commands and man pages redudant with
3791 ;; Coreutils.
3792 (lambda* (#:key outputs #:allow-other-keys)
3793 (let* ((out #$output)
3794 (dup (append-map (cut find-files out <>)
3795 '("^kill" "^uptime"))))
3796 (for-each delete-file dup))))
3797 #$@(if (system-hurd?)
3798 #~((add-after 'unpack 'skip-tests
3799 (lambda _
3800 (substitute* "library/tests/test_version.c"
3801 (("^int main\\(.*" all)
3802 (string-append all "{\n exit (77);//"))))))
3803 #~()))))
3804 (inputs (list ncurses))
3805 (native-inputs (list pkg-config))
3806 (home-page "https://gitlab.com/procps-ng/procps/")
3807 (synopsis "Utilities that give information about processes")
3808 (description
3809 "Procps is the package that has a bunch of small useful utilities
3810that give information about processes using the Linux /proc file system.
3811The package includes the programs free, pgrep, pidof, pkill, pmap, ps, pwdx,
3812slabtop, tload, top, vmstat, w, watch and sysctl.")
3813 (properties '((upstream-name . "procps-ng")))
3814 (license license:gpl2)))
3815
3816(define-public usbutils
3817 (package
3818 (name "usbutils")
3819 (version "018")
3820 (source
3821 (origin
3822 (method url-fetch)
3823 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
3824 "usbutils-" version ".tar.xz"))
3825 (sha256
3826 (base32 "14xd7j9fl3pm0z4dhqj3mf9paqk431kq4vi602f5hiw5nmcqpxl3"))))
3827 (build-system meson-build-system)
3828 (outputs (list "out" "python"))
3829 (arguments
3830 (list
3831 #:phases
3832 #~(modify-phases %standard-phases
3833 (add-after 'install 'separate-python-output
3834 ;; Separating one Python script shaves more than 106 MiB from :out.
3835 (lambda _
3836 (for-each (lambda (file)
3837 (let ((old (string-append #$output "/" file))
3838 (new (string-append #$output:python "/" file)))
3839 (mkdir-p (dirname new))
3840 (rename-file old new)))
3841 (list "bin/lsusb.py"))))
3842 (add-after 'install 'install-usbreset
3843 (lambda _
3844 (install-file "usbreset"
3845 (string-append #$output "/bin")))))))
3846 (native-inputs (list pkg-config))
3847 (inputs (list eudev libusb python))
3848 (home-page "http://www.linux-usb.org/")
3849 (synopsis
3850 "Tools for working with USB devices")
3851 (description
3852 "Collection of tools to query what type of USB devices are connected to
3853the system, including @command{lsusb}. The experimental @command{usbreset}
3854command included in the package, but be aware that it may not work for all
3855devices.")
3856 (license license:gpl2+)))
3857
3858(define-public usbip-utils
3859 (package
3860 (name "usbip-utils")
3861 (version (package-version linux-libre))
3862 (source (package-source linux-libre))
3863 (build-system gnu-build-system)
3864 (arguments
3865 '(#:configure-flags '("--disable-static")
3866 #:phases (modify-phases %standard-phases
3867 (add-after 'unpack 'enter-subdirectory
3868 (lambda _
3869 (chdir "tools/usb/usbip")
3870 #t)))))
3871 (native-inputs
3872 `(("automake" ,automake)
3873 ("autoreconf" ,autoconf)
3874 ("libtool" ,libtool)))
3875 (inputs (list eudev))
3876 (home-page (package-home-page linux-libre))
3877 (synopsis "Utilities for sharing USB devices over IP networks")
3878 (description
3879 "The USB/IP protocol enables to pass USB device from a server to
3880a client over the network. The server is a machine which shares an
3881USB device and the client is a machine which uses USB device provided by
3882a server over the network. The USB device may be either physical device
3883connected to a server or software entity created on a server using USB
3884gadget subsystem. The usbip-utils are userspace tools to used to handle
3885connection and management on both side. The client needs the @file{vhci-hcd}
3886Linux kernel module and the server needs the @file{usbip_host} Linux kernel
3887module.")
3888 (license license:gpl2)))
3889
3890(define-public e2fsprogs
3891 (package
3892 (name "e2fsprogs")
3893 (version "1.47.2")
3894 (source (origin
3895 (method url-fetch)
3896 (uri (string-append
3897 "mirror://kernel.org/linux/kernel/people/tytso/"
3898 "e2fsprogs/v" version "/"
3899 "e2fsprogs-" version ".tar.xz"))
3900 (sha256
3901 (base32
3902 "0g76fhnyzr2awwybd6c16439l80r5dv4kbfaq7cr908fr9j2w908"))))
3903 (build-system gnu-build-system)
3904 (inputs
3905 `((,util-linux "lib") ,@(if (target-hurd?) '() (list fuse))))
3906 (native-inputs (list pkg-config
3907 texinfo ;for the libext2fs Info manual
3908 ;; For tests.
3909 perl
3910 procps))
3911 (arguments
3912 `(;; util-linux is the preferred source for some of the libraries and
3913 ;; commands, so disable them (see, e.g.,
3914 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
3915 #:configure-flags (list "--disable-libblkid"
3916 "--disable-libuuid" "--disable-uuidd"
3917 "--disable-fsck"
3918
3919 ;; Use symlinks instead of hard links for
3920 ;; 'fsck.extN' etc. This makes the resulting nar
3921 ;; smaller and is preserved across copies.
3922 "--enable-symlink-install"
3923
3924 (string-append "LDFLAGS=-Wl,-rpath="
3925 (assoc-ref %outputs "out")
3926 "/lib")
3927
3928 ;; Install libext2fs et al.
3929 "--enable-elf-shlibs")
3930
3931 #:phases
3932 (modify-phases %standard-phases
3933 (add-before 'configure 'patch-shells
3934 (lambda _
3935 (substitute* "configure"
3936 (("/bin/sh (.*)parse-types.sh" _ dir)
3937 (string-append (which "sh") " " dir
3938 "parse-types.sh")))
3939 (substitute* "MCONFIG.in"
3940 (("INSTALL_SYMLINK = /bin/sh")
3941 "INSTALL_SYMLINK = sh"))
3942 (substitute* (find-files "." "^Makefile.in$")
3943 (("#!/bin/sh")
3944 (string-append "#!" (which "sh"))))))
3945 (add-after 'install 'install-libs
3946 (lambda* (#:key outputs #:allow-other-keys)
3947 (let* ((out (assoc-ref outputs "out"))
3948 (lib (string-append out "/lib")))
3949 (invoke "make" "install-libs")
3950
3951 ;; Make the .a writable so that 'strip' works.
3952 ;; Failing to do that, due to debug symbols, we
3953 ;; retain a reference to the final
3954 ;; linux-libre-headers, which refer to the
3955 ;; bootstrap binaries.
3956 (let ((archives (find-files lib "\\.a$")))
3957 (for-each (lambda (file)
3958 (chmod file #o666))
3959 archives)))))
3960 ,@(if (system-hurd?)
3961 '((add-after 'unpack 'skip-tests
3962 (lambda _
3963 (with-directory-excursion "tests"
3964 (for-each
3965 (lambda (directory)
3966 (delete-file-recursively directory))
3967 '("d_bad_ostype"
3968 "f_detect_junk"
3969 "f_extent_oobounds"
3970 "j_ext_long_revoke_trans"
3971 "j_ext_long_trans"
3972 "j_long_revoke_trans"
3973 "j_long_revoke_trans_mcsum_32bit"
3974 "j_long_revoke_trans_mcsum_64bit"
3975 "j_long_trans"
3976 "j_long_trans_mcsum_32bit"
3977 "j_long_trans_mcsum_64bit"
3978 "j_short_revoke_trans"
3979 "j_short_revoke_trans_mcsum_64bit"
3980 "j_short_trans_64bit"
3981 "j_short_trans"
3982 "j_short_trans_mcsum_64bit"
3983 "j_short_trans_old_csum"
3984 "j_short_trans_open_recover"
3985 "j_short_trans_recover"
3986 "j_short_trans_recover_mcsum_64bit"
3987 "j_short_uncommitted_trans"
3988 "j_short_uncommitted_trans_mcsum_64bit"
3989 "m_error_behavior"
3990 "m_minrootdir"
3991 "m_rootdir"
3992 "r_32to64bit_expand_full"
3993 "r_expand_full"
3994 "r_fixup_lastbg_big"
3995 "t_change_uuid"
3996 "t_change_uuid_mcsum"
3997 "t_change_uuid_mcsum_mounted"
3998 "t_change_uuid_mcsum_seed_mounted"
3999 "t_change_uuid_mounted"
4000 "t_disable_changed_csum_seed"
4001 "t_disable_changed_csum_seed_mounted"
4002 "t_disable_csum_seed"
4003 "t_disable_meta_csum_and_seed"
4004 "t_enable_csum_seed"
4005 "t_format_csum_seed"
4006 "t_replay_and_set"
4007 "u_compound_rollback"
4008 "u_corrupt_blk_csum"
4009 "u_corrupt_blk_csum_force"
4010 "u_corrupt_key_csum"
4011 "u_debugfs_opt"
4012 "u_dryrun"
4013 "u_e2fsck_opt"
4014 "u_errorout"
4015 "u_force"
4016 "u_force_dryrun"
4017 "u_incomplete"
4018 "u_mke2fs_opt"
4019 "u_mke2fs_opt_oddsize"
4020 "u_offset"
4021 "u_onefile_bad"
4022 "u_resize2fs_opt"
4023 "u_revert_64bitmcsum_onefile"
4024 "u_revert_all_onefile"
4025 "u_revert_upgrade_to_64bitmcsum"
4026 "u_tune2fs_opt"
4027 "u_undo_undo"
4028 "u_wrong_fs"))))))
4029 '()))))
4030 (home-page "https://e2fsprogs.sourceforge.net/")
4031 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
4032 (description
4033 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
4034 (license (list license:gpl2 ;programs
4035 license:lgpl2.0 ;libext2fs
4036 license:x11)))) ;libuuid
4037
4038(define e2fsprogs/static
4039 (static-package
4040 (package (inherit e2fsprogs)
4041 (arguments
4042 ;; Do not build shared libraries.
4043 (substitute-keyword-arguments arguments
4044 ((#:configure-flags _)
4045 '(list "--disable-blkid" "--disable-fuse2fs"))
4046 ((#:make-flags _)
4047 '(list)))))))
4048
4049(define-public e2fsck/static
4050 (package
4051 (name "e2fsck-static")
4052 (version (package-version e2fsprogs))
4053 (build-system trivial-build-system)
4054 (source #f)
4055 (inputs
4056 (list e2fsprogs/static))
4057 (arguments
4058 `(#:modules ((guix build utils))
4059 #:builder
4060 (begin
4061 (use-modules (guix build utils)
4062 (ice-9 ftw)
4063 (srfi srfi-26))
4064
4065 (let ((e2fsck (search-input-file %build-inputs "/sbin/e2fsck"))
4066 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
4067 (mkdir-p bin)
4068 (with-directory-excursion bin
4069 (copy-file e2fsck "e2fsck")
4070 (remove-store-references "e2fsck")
4071 (chmod "e2fsck" #o555))
4072 #t))))
4073 (home-page (package-home-page e2fsprogs))
4074 (synopsis "Statically-linked e2fsck command from e2fsprogs")
4075 (description "This package provides statically-linked e2fsck command taken
4076from the e2fsprogs package. It is meant to be used in initrds.")
4077 (license (package-license e2fsprogs))))
4078
4079(define-public extundelete
4080 (package
4081 (name "extundelete")
4082 (version "0.2.4")
4083 (source
4084 (origin
4085 (method url-fetch)
4086 (uri (string-append "mirror://sourceforge/extundelete/"
4087 "extundelete/" version "/extundelete-"
4088 version ".tar.bz2"))
4089 (sha256
4090 (base32
4091 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
4092 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
4093 (build-system gnu-build-system)
4094 (inputs (list e2fsprogs))
4095 (home-page "https://extundelete.sourceforge.net/")
4096 (synopsis "Recover deleted files from ext2/3/4 partitions")
4097 (description
4098 "Extundelete is a set of tools that can recover deleted files from an
4099ext3 or ext4 partition.")
4100 (license license:gpl2)))
4101
4102(define-public zerofree
4103 (package
4104 (name "zerofree")
4105 (version "1.1.1")
4106 (home-page "https://frippery.org/uml/")
4107 (source
4108 (origin
4109 (method url-fetch)
4110 (uri (string-append home-page name "-" version ".tgz"))
4111 (sha256
4112 (base32 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
4113 (build-system gnu-build-system)
4114 (arguments
4115 (list
4116 #:tests? #f ;no tests
4117 #:phases
4118 #~(modify-phases %standard-phases
4119 (delete 'configure) ;no configure script
4120 (replace 'install
4121 ;; The Makefile lacks an ‘install’ target.
4122 (lambda _
4123 (chmod "zerofree" #o555)
4124 (install-file "zerofree" (string-append #$output "/bin")))))))
4125 (inputs (list e2fsprogs))
4126 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
4127 (description
4128 "Zerofree finds the unallocated blocks with non-zero value content in an
4129ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
4130This is a simple way to make disk images more compressible.
4131Zerofree requires the file system to be unmounted or mounted read-only.")
4132 (license license:gpl2)))
4133
4134(define-public strace
4135 (package
4136 (name "strace")
4137 (version "7.0")
4138 (source
4139 (origin
4140 (method git-fetch)
4141 (uri (git-reference
4142 (url "https://github.com/strace/strace")
4143 (commit (string-append "v" version))))
4144 (file-name (git-file-name name version))
4145 (sha256
4146 (base32 "1rrcak1kg2w2dc7dbj6vfyp6a3j0ad7b2jrv6wmkw8h9p8zscx02"))
4147 (patches (search-patches "strace-readlink-tests.patch"))))
4148 (build-system gnu-build-system)
4149 (arguments
4150 (list
4151 #:phases
4152 #~(modify-phases %standard-phases
4153 ;; Needed for the 'bootstrap phase.
4154 (add-after 'unpack 'patch-source-shebangs-initial
4155 (assoc-ref %standard-phases 'patch-source-shebangs))
4156 (add-after 'unpack 'patch-test-shebangs
4157 (lambda _
4158 (substitute* '("tests/detach-vfork.test"
4159 "tests/gen_tests.sh"
4160 "tests/kill-on-exit.sh")
4161 (("#!/bin/sh")
4162 (string-append "#!" (which "sh")))))))
4163 #:configure-flags
4164 ''("--with-libunwind"
4165 ;; Don't fail if the architecture doesn't support different
4166 ;; personalities.
4167 "--enable-mpers=check")
4168 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
4169 #:parallel-tests? #f)) ; undeterministic failures
4170 (inputs (list libunwind))
4171 (native-inputs
4172 (list autoconf
4173 automake
4174 perl
4175 m4
4176 ;; For some tests
4177 util-linux))
4178 (home-page "https://strace.io")
4179 (synopsis "System call tracer for Linux")
4180 (description
4181 "strace is a system call tracer, i.e. a debugging tool which prints out a
4182trace of all the system calls made by a another process/program.")
4183 (license license:lgpl2.1+)))
4184
4185(define-public ltrace
4186 (package
4187 (name "ltrace")
4188 (version "0.7.3")
4189 (source (origin
4190 (method url-fetch)
4191 (uri (string-append "http://www.ltrace.org/ltrace_" version
4192 ".orig.tar.bz2"))
4193 (sha256
4194 (base32
4195 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
4196 (build-system gnu-build-system)
4197 (arguments
4198 ;; Compilation uses -Werror by default, but it fails.
4199 (list #:configure-flags #~'("--disable-werror")))
4200 (inputs (list elfutils))
4201 (home-page "https://www.ltrace.org/")
4202 (synopsis "Library call tracer for Linux")
4203 (description
4204 "ltrace intercepts and records dynamic library calls which are called by
4205an executed process and the signals received by that process. It can also
4206intercept and print the system calls executed by the program.")
4207 (license license:gpl2+)))
4208
4209(define-public alsa-ucm-conf
4210 (package
4211 (name "alsa-ucm-conf")
4212 (version "1.2.16.1")
4213 (source
4214 (origin
4215 (method git-fetch)
4216 (uri (git-reference
4217 (url "https://github.com/alsa-project/alsa-ucm-conf")
4218 (commit (string-append "v" version))))
4219 (file-name (git-file-name name version))
4220 (sha256
4221 (base32 "1dgr8dlxzm4cx4sbp6mbb9ihharyym1qmb8zy9zq171h33k4061w"))))
4222 (build-system copy-build-system)
4223 (arguments
4224 '(#:install-plan
4225 '(("ucm" "share/alsa/ucm")
4226 ("ucm2" "share/alsa/ucm2"))))
4227 (home-page "https://www.alsa-project.org/wiki/Main_Page")
4228 (synopsis "The Advanced Linux Sound Architecture Use Case Manager")
4229 (description
4230 "This package contains @acronym{ALSA, Advanced Linux Sound Architecture}
4231@acronym{UCM, Use Case Manager} configuration of audio input/output names and
4232routing for specific audio hardware.")
4233 (license license:bsd-3)))
4234
4235(define-public alsa-topology-conf
4236 (package
4237 (name "alsa-topology-conf")
4238 (version "1.2.5.1")
4239 (source
4240 (origin
4241 (method git-fetch)
4242 (uri (git-reference
4243 (url "https://github.com/alsa-project/alsa-topology-conf")
4244 (commit (string-append "v" version))))
4245 (file-name (git-file-name name version))
4246 (sha256
4247 (base32 "150065nc5ksrxcay0ia0f8ad2s0gpp3xgn7gc5xsyf0k5dwdby49"))))
4248 (build-system copy-build-system)
4249 (arguments
4250 '(#:install-plan
4251 '(("topology" "share/alsa/topology"))))
4252 (home-page "https://www.alsa-project.org/wiki/Main_Page")
4253 (synopsis "The Advanced Linux Sound Architecture libraries")
4254 (description
4255 "This package contains @acronym{ALSA, Advanced Linux Sound Architecture}
4256topology configuration files that can be used for specific audio hardware.")
4257 (license license:bsd-3)))
4258
4259(define-public alsa-lib
4260 (package
4261 (name "alsa-lib")
4262 (version "1.2.16.1")
4263 (source
4264 (origin
4265 (method git-fetch)
4266 (uri (git-reference
4267 (url "https://github.com/alsa-project/alsa-lib")
4268 (commit (string-append "v" version))))
4269 (file-name (git-file-name name version))
4270 (sha256
4271 (base32 "06r315gq2ps11w72bh3hpljpqjwx2avba3lxccmqpwl9njfcvfmc"))))
4272 (build-system gnu-build-system)
4273 (arguments
4274 (list
4275 #:configure-flags
4276 #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
4277 #:phases
4278 #~(modify-phases %standard-phases
4279 (replace 'bootstrap
4280 (lambda _
4281 (invoke "libtoolize" "--force" "--copy" "--automake")
4282 (invoke "aclocal")
4283 (invoke "autoheader")
4284 (invoke "automake" "--foreign" "--copy" "--add-missing")
4285 (invoke "autoconf")))
4286 (add-before 'install 'pre-install
4287 (lambda* _
4288 (let* ((ucm #$(this-package-input "alsa-ucm-conf"))
4289 (topology #$(this-package-input "alsa-topology-conf"))
4290 (alsa (string-append #$output "/share/alsa"))
4291 (ucm-share (string-append ucm "/share/alsa/ucm"))
4292 (ucm2-share (string-append ucm "/share/alsa/ucm2"))
4293 (topology-share (string-append topology "/share/alsa/topology")))
4294 (mkdir-p alsa)
4295 (symlink ucm-share (string-append alsa "/ucm"))
4296 (symlink ucm2-share (string-append alsa "/ucm2"))
4297 (symlink topology-share (string-append alsa "/topology"))))))))
4298 (inputs
4299 (list autoconf-2.72
4300 automake
4301 alsa-ucm-conf
4302 alsa-topology-conf
4303 libtool))
4304 (supported-systems (remove target-hurd? %supported-systems))
4305 (home-page "https://www.alsa-project.org/wiki/Main_Page")
4306 (synopsis "The Advanced Linux Sound Architecture libraries")
4307 (description
4308 "@acronym{ALSA, Advanced Linux Sound Architecture} provides audio and
4309@acronym{MIDI, Musical Instrument Digital Interface} functionality to the
4310Linux-based operating system.")
4311 (license license:lgpl2.1+)))
4312
4313(define-public alsa-utils
4314 (package
4315 (name "alsa-utils")
4316 (version "1.2.16")
4317 (source (origin
4318 (method url-fetch)
4319 (uri (string-append
4320 "https://www.alsa-project.org/files/pub/utils/"
4321 name "-" version ".tar.bz2"))
4322 (sha256
4323 (base32
4324 "0b13yb7jirxwkfvynq1vd5slpv0wa9bk2fcf31g1v6klx3arj8q9"))))
4325 (build-system gnu-build-system)
4326 (arguments
4327 (list
4328 #:configure-flags
4329 #~(list
4330 ;; The udev rule is responsible for restoring the volume.
4331 (string-append "--with-udev-rules-dir=" #$output "/lib/udev/rules.d"))
4332 #:phases
4333 #~(modify-phases %standard-phases
4334 (add-after 'unpack 'patch-alsactl-udev-rules
4335 (lambda* (#:key inputs #:allow-other-keys)
4336 (substitute* "alsactl/conf/90-alsa-restore.rules.in"
4337 (("/usr/bin/cat")
4338 (search-input-file inputs "bin/cat")))))
4339 (add-before 'install 'pre-install
4340 (lambda _
4341 ;; Don't try to mkdir /var/lib/alsa.
4342 (substitute* "Makefile"
4343 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
4344 "true\n")))))))
4345 (native-inputs
4346 (list docbook-xml-4.2 docbook-xsl gettext-minimal pkg-config xmlto))
4347 (inputs
4348 (list libsamplerate ncurses alsa-lib))
4349 (home-page "http://www.alsa-project.org/")
4350 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
4351 (description
4352 "The Advanced Linux Sound Architecture (ALSA) provides audio and
4353MIDI functionality to the Linux-based operating system.")
4354
4355 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
4356 ;; GPLv2-only.
4357 (license license:gpl2)))
4358
4359(define-public alsa-plugins
4360 (package
4361 (name "alsa-plugins")
4362 (version "1.2.12")
4363 (source
4364 (origin
4365 (method git-fetch)
4366 (uri (git-reference
4367 (url "https://github.com/alsa-project/alsa-plugins")
4368 (commit (string-append "v" version))))
4369 (file-name (git-file-name name version))
4370 (sha256
4371 (base32 "0izvzdvw3nj69l4a968p9d9xjxfxs7i3bdpj1r4cvm6b8w7j33z8"))))
4372 (build-system gnu-build-system)
4373 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
4374 ;; be split, there are references to both in files.
4375 ;; TODO: Remove OSS related plugins, they add support to run native
4376 ;; ALSA applications on OSS however we do not offer OSS and OSS is
4377 ;; obsolete.
4378 (outputs '("out" "pulseaudio" "jack"))
4379 (native-search-paths
4380 (list (search-path-specification
4381 (variable "ALSA_PLUGIN_DIR")
4382 (files '("lib/alsa-lib"))
4383 (separator #f))))
4384 (arguments
4385 `(#:configure-flags '(;; Do not install a "local" configuration targeted
4386 ;; for /etc/alsa. On Guix System plugins are loaded from
4387 ;; the ALSA service, and other distributions likely
4388 ;; won't use these files.
4389 "--with-alsalconfdir=/tmp/noop")
4390 #:phases
4391 (modify-phases %standard-phases
4392 (add-after 'install 'split
4393 (lambda* (#:key inputs outputs #:allow-other-keys)
4394 ;; Distribute the binaries to the various outputs.
4395 (let* ((out (assoc-ref outputs "out"))
4396 (jack (assoc-ref outputs "jack"))
4397 (jacklib (string-append jack "/lib/alsa-lib"))
4398 (pua (assoc-ref outputs "pulseaudio"))
4399 (pualib (string-append pua "/lib/alsa-lib")))
4400 ;; For jack.
4401 (mkdir-p jacklib)
4402 (for-each (lambda (file)
4403 (rename-file file (string-append jacklib "/" (basename file))))
4404 (find-files out ".*jack\\.(la|so)"))
4405 ;; For pulseaudio.
4406 (mkdir-p pualib)
4407 (for-each (lambda (file)
4408 (rename-file file (string-append pualib "/" (basename file))))
4409 (find-files out ".*pulse\\.(la|so)"))
4410 #t))))))
4411 (inputs
4412 (list alsa-lib
4413 jack-1
4414 speex ; libspeexdsp resampling plugin
4415 libsamplerate ; libsamplerate resampling plugin
4416 ffmpeg ; libavcodec resampling plugin, a52 plugin
4417 pulseaudio)) ; PulseAudio plugin
4418 (native-inputs
4419 (list autoconf automake libtool pkg-config))
4420 (home-page "http://www.alsa-project.org/")
4421 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
4422 (description
4423 "@acronym{ALSA, Advanced Linux Sound Architecture} provides audio and
4424@acronym{MIDI, Musical Instrument Digital Interface} functionality to the
4425Linux-based operating system. This package enhances @acronym{ALSA} by
4426providing additional plugins which include: upmixing, downmixing, jackd and
4427pulseaudio support for native alsa applications, format conversion (s16 to
4428a52), and external rate conversion.")
4429 (license (list license:gpl2+
4430 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
4431 license:lgpl2.1+))))
4432
4433(define-public snd-rane-sl3
4434 (let ((commit "01099892261b55ec5ee814292d840eeb664c1904")
4435 (revision "0"))
4436 (package
4437 (name "snd-rane-sl3")
4438 (version (git-version "0" revision commit))
4439 (source
4440 (origin
4441 (method git-fetch)
4442 (uri (git-reference
4443 (url "https://github.com/nvgeele/snd-rane-sl3")
4444 (commit commit)))
4445 (file-name (git-file-name name version))
4446 (sha256
4447 (base32 "1j2aan5xmbi8hgkzzwjb7rarqh4g65rg3s1qd1c8x5m6fpqdnvli"))))
4448 (build-system linux-module-build-system)
4449 (arguments
4450 (list
4451 #:tests? #f ;No tests.
4452 #:phases
4453 #~(modify-phases %standard-phases
4454 (delete 'configure)
4455 (add-before 'build 'change-directory
4456 (lambda _
4457 (chdir "snd-rane-sl3"))))))
4458 (inputs (list linux-libre-headers))
4459 (home-page "https://github.com/nvgeele/snd-rane-sl3")
4460 (synopsis
4461 "Linux ALSA kernel driver for the Rane SL3 USB Audio interface")
4462 (description
4463 "snd-rane-sl3 provides a native Linux kernel module that
4464enables the Rane SL3 to work as a standard ALSA audio device, supporting 6
4465channels (3 stereo pairs) of 24-bit PCM audio at 44.1kHz and 48kHz sample
4466rates.")
4467 (license license:gpl3))))
4468
4469(define-public iptables
4470 (package
4471 (name "iptables")
4472 (version "1.8.11")
4473 (source
4474 (origin
4475 (method url-fetch)
4476 (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
4477 version ".tar.xz")))
4478 (sha256
4479 (base32 "1cp7kw0d3fpmfmbl4adh88v02wnj4s5rfgyxsk52pjgqbvah6wyq"))))
4480 (build-system gnu-build-system)
4481 (native-inputs
4482 (list pkg-config flex bison))
4483 (inputs
4484 (list libmnl libnftnl/pinned))
4485 (arguments
4486 (list #:tests? #f ; no test suite
4487 #:configure-flags ; add $libdir to the RUNPATH of executables
4488 #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))))
4489 (home-page "https://www.netfilter.org/projects/iptables/index.html")
4490 (synopsis "Programs to configure Linux IP packet filtering rules")
4491 (description
4492 "@command{iptables} is the user-space command line program used to
4493configure the Linux 2.4.x and later IPv4 packet filtering ruleset
4494(@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
4495
4496This package also includes @command{ip6tables}, which is used to configure the
4497IPv6 packet filter.
4498
4499Both commands are targeted at system administrators.")
4500 (properties
4501 '((release-monitoring-url . "https://www.netfilter.org/pub/iptables/")))
4502 (license license:gpl2+)))
4503
4504(define-public iptables-nft
4505 (package
4506 (inherit iptables)
4507 (name "iptables-nft")
4508 (source #f)
4509 (build-system copy-build-system)
4510 (arguments
4511 (list
4512 #:phases
4513 #~(modify-phases %standard-phases
4514 (delete 'unpack)
4515 (replace 'install
4516 (lambda* (#:key inputs #:allow-other-keys)
4517 (for-each
4518 (lambda (command-path)
4519 (let ((link-path (string-append #$output command-path)))
4520 (mkdir-p (dirname link-path))
4521 (symlink (search-input-file inputs "sbin/xtables-nft-multi")
4522 link-path)))
4523 (apply append
4524 '("/bin/iptables-xml")
4525 (map (lambda (xtables)
4526 (list (string-append "/sbin/" xtables)
4527 (string-append "/sbin/" xtables "-restore")
4528 (string-append "/sbin/" xtables "-save")))
4529 '("arptables"
4530 "ebtables"
4531 "iptables"
4532 "ip6tables")))))))))
4533 (inputs (list iptables))
4534 (native-inputs '())
4535 (synopsis
4536 "Programs to configure Linux IP packet filtering rules (nftables API)")))
4537
4538(define-public irqbalance
4539 (package
4540 (name "irqbalance")
4541 (version "1.9.5")
4542 (source
4543 (origin
4544 (method git-fetch)
4545 (uri (git-reference
4546 (url "https://github.com/irqbalance/irqbalance")
4547 (commit (string-append "v" version))))
4548 (file-name (git-file-name name version))
4549 (sha256
4550 (base32 "13drfji15qi7rnnsjvflp5yc98ga5x7frgw21ddhxjspjdib5cd9"))))
4551 (build-system gnu-build-system)
4552 (inputs (list glib ncurses libnl libcap-ng))
4553 (native-inputs (list autoconf automake libtool pkg-config))
4554 (home-page "https://irqbalance.github.io/irqbalance/")
4555 (synopsis "Daemon used to load balance CPU interrupts")
4556 (description
4557 "Irqbalance is a daemon to help balance the CPU load generated by
4558interrupts across all of a systems CPUs. Irqbalance identifies the highest
4559volume interrupt sources, and isolates each of them to a single unique CPU, so
4560that load is spread as much as possible over an entire processor set, while
4561minimizing cache miss rates for irq handlers.")
4562 (license license:gpl2)))
4563
4564(define-public bolt
4565 (package
4566 (name "bolt")
4567 (version "0.9.10")
4568 (source (origin
4569 (method git-fetch)
4570 (uri (git-reference
4571 (url "https://gitlab.freedesktop.org/bolt/bolt")
4572 (commit version)))
4573 (file-name (git-file-name name version))
4574 (sha256
4575 (base32
4576 "1vw4vzyhkpm73snnfciy7x88ja72cv5isc27k91jvmy2350b29yx"))))
4577 (build-system meson-build-system)
4578 (arguments
4579 (list #:configure-flags '(list "--localstatedir=/var")
4580 #:glib-or-gtk? #t ;To wrap binaries and/or compile schemas
4581 #:phases #~(modify-phases %standard-phases
4582 (add-after 'unpack 'replace-directories
4583 (lambda* (#:key outputs #:allow-other-keys)
4584 (substitute* "meson.build"
4585 (("udev.get_variable\\(pkgconfig: 'udevdir'\\)")
4586 (string-append "'" #$output "/lib/udev'"))
4587 ;; Don't install in /var
4588 (("not systemd\\.found\\(\\)")
4589 "false"))))
4590 (add-before 'install 'no-polkit-magic
4591 (lambda* (#:key outputs #:allow-other-keys)
4592 (setenv "PKEXEC_UID" "something"))))))
4593 (native-inputs (list pkg-config
4594 `(,glib "bin") python asciidoc umockdev))
4595 (inputs (list eudev dbus polkit))
4596 (synopsis "Thunderbolt 3 device manager")
4597 (description
4598 "This package provides @command{boltd}, a userspace daemon
4599for Thunderbolt devices, and @command{boltctl}, a command-line utility for
4600managing those devices.
4601
4602The daemon @command{boltd} exposes devices via D-Bus to clients. It also
4603stores a database of previously authorized devices and will, depending on the
4604policy set for the individual devices, automatically authorize newly connected
4605devices without user interaction.
4606
4607The command-line utility @command{boltctl} manages Thunderbolt devices via
4608@command{boltd}. It can list devices, monitor changes, and initiate
4609authorization of devices.")
4610 (home-page "https://gitlab.freedesktop.org/bolt/bolt")
4611 (properties `((lint-hidden-cpe-vendors . ("boltcms" "puppet"))))
4612 (license license:gpl2+)))
4613
4614(define-public jitterentropy-rngd
4615 (package
4616 (name "jitterentropy-rngd")
4617 (version "1.2.8")
4618 (source
4619 (origin
4620 (method git-fetch)
4621 (uri (git-reference
4622 (url "https://github.com/smuellerDD/jitterentropy-rngd")
4623 (commit (string-append "v" version))))
4624 (file-name (git-file-name name version))
4625 (sha256
4626 (base32 "13br8s6gqnfc844ps38ya5nny3pndsmskszv3dsp1cxcgvmscg1c"))))
4627 (build-system gnu-build-system)
4628 (arguments
4629 (list
4630 #:tests? #f ; no test suite
4631 #:make-flags
4632 #~(list (string-append "CC=" #$(cc-for-target))
4633 (string-append "PREFIX=" #$output)
4634 "UNITDIR=$(PREFIX)/lib/systemd/system")
4635 #:phases
4636 #~(modify-phases %standard-phases
4637 (delete 'configure)))) ; no ./configure script
4638 (home-page "https://www.chronox.de/jent.html")
4639 (synopsis "CPU jitter random number generator daemon")
4640 (description
4641 "This simple daemon feeds entropy from the CPU Jitter @acronym{RNG, random
4642number generator} core to the kernel Linux's entropy estimator. This prevents
4643the @file{/dev/random} device from blocking and should benefit users of the
4644preferred @file{/dev/urandom} and @code{getrandom()} interfaces too.
4645
4646The CPU Jitter RNG itself is part of the kernel and claims to provide good
4647entropy by collecting and magnifying differences in CPU execution time as
4648measured by the high-resolution timer built into modern CPUs. It requires no
4649additional hardware or external entropy source.
4650
4651The random bit stream generated by @command{jitterentropy-rngd} is not processed
4652by a cryptographically secure whitening function. Nonetheless, its authors
4653believe it to be a suitable source of cryptographically secure key material or
4654other cryptographically sensitive data.
4655
4656If you agree with them, start this daemon as early as possible to provide
4657properly seeded random numbers to services like SSH or those using TLS during
4658early boot when entropy may be low, especially in virtualised environments.")
4659 (license (list license:bsd-3 ; or
4660 license:gpl2+))))
4661
4662(define-public ebtables
4663 (package
4664 (name "ebtables")
4665 (version "2.0.11")
4666 (source (origin
4667 (method url-fetch)
4668 (uri (string-append
4669 "mirror://netfilter.org/ebtables/ebtables-"
4670 version ".tar.gz"))
4671 (sha256
4672 (base32
4673 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
4674 (build-system gnu-build-system)
4675 (inputs
4676 (list perl iptables))
4677 (synopsis "Ethernet bridge frame table administration")
4678 (home-page "https://ebtables.netfilter.org/")
4679 (description
4680 "ebtables is an application program used to set up and maintain the
4681tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
4682analogous to the iptables application, but less complicated, due to the fact
4683that the Ethernet protocol is much simpler than the IP protocol.")
4684 (license license:gpl2+)))
4685
4686(define-public iproute
4687 (package
4688 (name "iproute2")
4689 (version "7.0.0")
4690 (source (origin
4691 (method url-fetch)
4692 (uri (string-append
4693 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
4694 version ".tar.xz"))
4695 (sha256
4696 (base32
4697 "0kiggxwnjsglxnj43wqkc0rmq0acxf6xqcgk7ddc0qyynpvr0a76"))))
4698 (build-system gnu-build-system)
4699 (arguments
4700 (list
4701 ;; There is a test suite, but it wants network namespaces and sudo.
4702 #:tests? #f
4703 #:make-flags
4704 #~(let ((out #$output))
4705 (list (string-append "CC=" #$(cc-for-target))
4706 "HOSTCC=gcc"
4707 (string-append "BASH_COMPDIR=" out
4708 "/etc/bash_completion.d")
4709 (string-append "PREFIX=" out)
4710 (string-append "LIBDIR=" out "/lib")
4711 (string-append "HDRDIR=" out "/include")
4712 (string-append "SBINDIR=" out "/sbin")
4713 (string-append "CONFDIR=" out "/etc")
4714 (string-append "MANDIR=" out "/share/man")
4715 #$@(if (target-ppc64le?)
4716 '("CCOPTS=-O2 -pipe -Wno-incompatible-pointer-types")
4717 '())))
4718 #:phases
4719 #~(modify-phases %standard-phases
4720 (replace 'configure
4721 (lambda* (#:key (configure-flags #~'()) #:allow-other-keys)
4722 ;; The configure script does not understand some of the
4723 ;; default options of gnu-build-system.
4724 (setenv "PKG_CONFIG" #$(pkg-config-for-target))
4725 (apply invoke "./configure"
4726 "--prefix" #$output
4727 configure-flags)))
4728 (add-before 'install 'pre-install
4729 (lambda _
4730 ;; Don't attempt to create /var/lib/arpd.
4731 (substitute* "Makefile"
4732 (("^.*ARPDDIR.*$") "")))))))
4733 (inputs
4734 (list bdb iptables libmnl))
4735 (native-inputs
4736 (list bison flex pkg-config))
4737 ;; For tests.
4738 ;; ("libmnl" ,libmnl)
4739 ;; ("util-linux" ,util-linux)
4740 (home-page
4741 "https://wiki.linuxfoundation.org/networking/iproute2")
4742 (synopsis
4743 "Utilities for controlling TCP/IP networking and traffic in Linux")
4744 (description
4745 "Iproute2 is a collection of utilities for controlling TCP/IP networking
4746and traffic with the Linux kernel. The most important of these are
4747@command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
4748control.
4749
4750Most network configuration manuals still refer to ifconfig and route as the
4751primary network configuration tools, but ifconfig is known to behave
4752inadequately in modern network environments, and both should be deprecated.")
4753 (license license:gpl2+)))
4754
4755(define-public net-tools
4756 ;; XXX: This package is basically unmaintained, but it provides a few
4757 ;; commands not yet provided by Inetutils, such as 'route', so we have to
4758 ;; live with it.
4759 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
4760 (revision "0"))
4761 (package
4762 (name "net-tools")
4763 (version (string-append "1.60-" revision "."
4764 (string-take commit 7)))
4765 (source
4766 (origin
4767 (method url-fetch)
4768 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
4769 "n/ne/net-tools/code.git/net-tools-code-" commit
4770 ".zip"))
4771 (file-name (string-append name "-" version ".zip"))
4772 (sha256
4773 (base32 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
4774 (home-page "https://net-tools.sourceforge.net/")
4775 (build-system gnu-build-system)
4776 (arguments
4777 (list
4778 ;; Binaries that depend on libnet-tools.a don't declare that
4779 ;; dependency, making it parallel-unsafe.
4780 #:parallel-build? #f
4781
4782 #:tests? #f ;no test suite
4783 #:make-flags
4784 #~(list #$(string-append "CC=" (cc-for-target))
4785 (string-append "BASEDIR=" #$output)
4786 (string-append "INSTALLNLSDIR=" #$output "/share/locale")
4787 (string-append "mandir=/share/man"))
4788 #:modules `((guix build gnu-build-system)
4789 (guix build utils)
4790 (srfi srfi-1)
4791 (srfi srfi-26))
4792 #:phases
4793 #~(modify-phases %standard-phases
4794 (replace 'configure
4795 (lambda _
4796 (mkdir-p (string-append #$output "/bin"))
4797 (mkdir-p (string-append #$output "/sbin"))
4798
4799 ;; Pretend we have everything...
4800 (system "yes | make config")
4801
4802 ;; ... except for the things we don't have.
4803 ;; HAVE_AFDECnet requires libdnet, which we don't have.
4804 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
4805 ;; that have been removed.
4806 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
4807 ;; think about adding them later.
4808 (substitute* '("config.make" "config.h")
4809 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
4810 ""))))
4811 (add-after 'install 'remove-redundant-commands
4812 (lambda _
4813 ;; Remove commands and man pages redundant with Inetutils.
4814 (for-each delete-file
4815 (append-map (cute find-files #$output <>)
4816 '("^hostname"
4817 "^(yp|nis|dns)?domainname"))))))))
4818 (native-inputs (list gettext-minimal unzip))
4819 (supported-systems (remove target-hurd? %supported-systems))
4820 (synopsis "Tools for controlling the network subsystem in Linux")
4821 (description
4822 "This package includes the important tools for controlling the network
4823subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
4824route. Additionally, this package contains utilities relating to particular
4825network hardware types (plipconfig, slattach) and advanced aspects of IP
4826configuration (iptunnel, ipmaddr).")
4827 (license license:gpl2+))))
4828
4829(define-public libcap
4830 (package
4831 (name "libcap")
4832 (version "2.64")
4833 (source (origin
4834 (method url-fetch)
4835 (uri (string-append
4836 "mirror://kernel.org/linux/libs/security/linux-privs/"
4837 "libcap2/libcap-" version ".tar.xz"))
4838 (sha256
4839 (base32
4840 "04qy0z6yhlljb29xxcb2srbdnymcrhsi28wrc705z3861cgmwin8"))))
4841 (build-system gnu-build-system)
4842 (arguments
4843 (list #:phases
4844 #~(modify-phases %standard-phases
4845 (delete 'configure)
4846 #$@(if (target-ppc32?)
4847 #~((add-after 'unpack 'apply-patch
4848 (lambda _
4849 (let ((patch
4850 #$(local-file
4851 (search-patch
4852 "libcap-magic-glibc-constant.patch"))))
4853 (invoke "patch" "--force" "-p1" "-i" patch)))))
4854 #~()))
4855 #:test-target "test"
4856 #:make-flags
4857 #~(list "lib=lib"
4858 (string-append "prefix=" #$output)
4859 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
4860 "RAISE_SETFCAP=no"
4861 ;; Tell the makefile to use TARGET-gcc and friends
4862 ;; when cross-compiling.
4863 #$@(if (%current-target-system)
4864 `((string-append "CROSS_COMPILE="
4865 ,(%current-target-system) "-")
4866 "BUILD_CC=gcc")
4867 '()))))
4868 (native-inputs (list perl))
4869 (supported-systems (remove target-hurd? %supported-systems))
4870 (home-page "https://sites.google.com/site/fullycapable/")
4871 (synopsis "Library for working with POSIX capabilities")
4872 (description
4873 "Libcap2 provides a programming interface to POSIX capabilities on
4874Linux-based operating systems.")
4875
4876 ;; License is BSD-3 or GPLv2, at the user's choice.
4877 (license (list license:bsd-3 license:gpl2))))
4878
4879(define-public bridge-utils
4880 (package
4881 (name "bridge-utils")
4882 (version "1.7.1")
4883 (source
4884 (origin
4885 (method url-fetch)
4886 (uri (string-append "mirror://kernel.org/linux/utils/net/"
4887 "bridge-utils/bridge-utils-" version ".tar.xz"))
4888 (sha256
4889 (base32 "03p6cmhm6cqhnfsfa1wv7frhb361y12daf7gr1h5qh51y7j8n7d6"))))
4890 (build-system gnu-build-system)
4891
4892 ;; The tarball lacks all the generated files.
4893 (native-inputs (list autoconf automake))
4894 (arguments
4895 '(#:tests? #f)) ; no 'check' target
4896
4897 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
4898 (synopsis "Manipulate Ethernet bridges")
4899 (description
4900 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
4901to connect two Ethernet segments together in a protocol independent way.
4902Packets are forwarded based on Ethernet address, rather than IP address (like
4903a router). Since forwarding is done at Layer 2, all protocols can go
4904transparently through a bridge.")
4905 (license license:gpl2+)))
4906
4907(define-public libnl
4908 (package
4909 (name "libnl")
4910 (version "3.12.0")
4911 (source (origin
4912 (method url-fetch)
4913 (uri (string-append
4914 "https://github.com/thom311/libnl/releases/download/"
4915 "libnl" (string-join (string-split version #\.) "_")
4916 "/libnl-" version ".tar.gz"))
4917 (sha256
4918 (base32
4919 "066xq01y2mx0xi7bwa5y6ciw1ygla15qdlzzyvyzb8zijrqwllgw"))))
4920 (build-system gnu-build-system)
4921 (native-inputs
4922 `(("bison" ,bison)
4923 ("flex" ,flex)
4924 ("pkg-config" ,pkg-config)
4925 ("swig" ,swig-4.0)
4926 ("libnl3-doc"
4927 ,(origin
4928 (method url-fetch)
4929 (uri (string-append
4930 "https://github.com/thom311/libnl/releases/download/libnl"
4931 (string-join (string-split version #\.) "_")
4932 "/libnl-doc-" version ".tar.gz"))
4933 (sha256
4934 (base32 "18f14pdycghy6fcd27faqgh19zpam6b45s8bgsk85kb9wwzq3yd4"))))))
4935 (outputs `("out" "doc"))
4936 (arguments
4937 `(#:phases
4938 (modify-phases %standard-phases
4939 (add-after 'install 'install-doc
4940 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
4941 (let ((dest (string-append (assoc-ref outputs "doc")
4942 "/share/doc/libnl")))
4943 (mkdir-p dest)
4944 (invoke "tar" "xf" (assoc-ref
4945 (or native-inputs inputs)
4946 "libnl3-doc")
4947 "--strip-components=1" "-C" dest)))))))
4948 (home-page "https://www.infradead.org/~tgr/libnl/")
4949 (synopsis "NetLink protocol library suite")
4950 (description
4951 "The libnl suite is a collection of libraries providing APIs to netlink
4952protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
4953between the kernel and user space processes. It was designed to be a more
4954flexible successor to ioctl to provide mainly networking related kernel
4955configuration and monitoring interfaces.")
4956
4957 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
4958 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
4959 (license license:gpl2)))
4960
4961;; libnl python extensions used to be outputs of libnl. However, as
4962;; cross-compiling python extensions is currently broken, create separate
4963;; packages for libnl python extensions.
4964(define (libnl-python-package python)
4965 (let ((name (string-append "libnl-" python)))
4966 (package
4967 (inherit libnl)
4968 (name name)
4969 (outputs '("out"))
4970 (arguments
4971 (list
4972 #:modules `((guix build gnu-build-system)
4973 (guix build utils)
4974 (srfi srfi-1))
4975 #:phases
4976 #~(modify-phases %standard-phases
4977 (replace 'install
4978 (lambda* (#:key inputs #:allow-other-keys)
4979 (define (python-inst python)
4980 (invoke python "setup.py" "build")
4981 (invoke python "setup.py" "install"
4982 (string-append "--prefix=" #$output))
4983 (invoke python "setup.py" "clean"))
4984 (let ((libdir (dirname (search-input-directory inputs
4985 "lib/libnl"))))
4986 (setenv "LDFLAGS" (string-append "-Wl,-rpath=" libdir)))
4987 (with-directory-excursion "./python"
4988 (python-inst #$python)))))))
4989 (inputs
4990 (append (cond
4991 ((string=? python "python2")
4992 (list python-2))
4993 ((string=? python "python3")
4994 (list python-setuptools python-wrapper)))
4995 (list libxcrypt))) ;required by Python.h
4996 (propagated-inputs (list libnl)))))
4997
4998(define-public libnl-python3 (libnl-python-package "python3"))
4999
5000(define-public iw
5001 (package
5002 (name "iw")
5003 (version "5.19")
5004 (source (origin
5005 (method url-fetch)
5006 (uri (string-append
5007 "mirror://kernel.org/software/network/iw/iw-"
5008 version ".tar.xz"))
5009 (sha256
5010 (base32
5011 "0kjdrihc7ibnjdpjqkq8sv0kmmvavgsww78cpjgbnlyx8zlvnrzi"))))
5012 (build-system gnu-build-system)
5013 (native-inputs (list pkg-config))
5014 (inputs (list libnl))
5015 (arguments
5016 (list #:make-flags
5017 #~(list
5018 (string-append "CC=" #$(cc-for-target))
5019 (string-append "PKG_CONFIG=" #$(pkg-config-for-target))
5020 (string-append "PREFIX=" (assoc-ref %outputs "out")))
5021 #:phases
5022 #~(modify-phases %standard-phases
5023 (delete 'configure)))) ; no configure script
5024 (home-page "https://wireless.wiki.kernel.org/")
5025 (synopsis "Tool for configuring wireless devices")
5026 (description
5027 "iw is a new nl80211 based CLI configuration utility for wireless
5028devices. It replaces @code{iwconfig}, which is deprecated.")
5029 (license license:isc)))
5030
5031(define-public powertop
5032 (package
5033 (name "powertop")
5034 (version "2.15")
5035 (source
5036 (origin
5037 (method git-fetch)
5038 (uri (git-reference
5039 (url "https://github.com/fenrus75/powertop")
5040 (commit (string-append "v" version))))
5041 (file-name (git-file-name name version))
5042 (sha256
5043 (base32 "10vbk4vplmzp3p1mhwnhj81g6i5xvam9pdvmiy6cmd0xvnmdyy77"))))
5044 (build-system gnu-build-system)
5045 (arguments
5046 (list
5047 #:configure-flags #~(list "LDFLAGS=-pthread")
5048 #:phases
5049 #~(modify-phases %standard-phases
5050 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
5051 ;; allow calibrating the network interface in Guix System.
5052 (add-after 'unpack 'patch-absolute-file-names
5053 (lambda* (#:key inputs #:allow-other-keys)
5054 (let ((kmod (assoc-ref inputs "kmod")))
5055 ;; Fix for using a more modern gettext.
5056 (substitute* "autogen.sh"
5057 (("autoreconf")
5058 "autoreconf --force"))
5059 (substitute* "configure.ac"
5060 (("^AM_GNU_GETTEXT_VERSION.*$")
5061 (string-append "AM_GNU_GETTEXT_VERSION(["
5062 #$(package-version (this-package-native-input "gettext-minimal"))
5063 "])\n")))
5064 ;; Give the right 'modprobe' file name so that essential
5065 ;; modules such as msr.ko can be loaded.
5066 (substitute* (find-files "src" "\\.cpp$")
5067 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
5068 ;; These programs are only needed to calibrate, so using
5069 ;; relative file names avoids adding extra inputs. When they
5070 ;; are missing powertop gracefully handles it.
5071 (("/usr/s?bin/(hciconfig|hcitool|xset)" _ command)
5072 command
5073 command))))))))
5074 (native-inputs
5075 (list autoconf
5076 autoconf-archive
5077 automake
5078 gettext-minimal
5079 libtool
5080 pkg-config))
5081 (inputs
5082 (list kmod libnl ncurses pciutils zlib))
5083 (home-page "https://01.org/powertop/")
5084 (synopsis "Analyze power consumption on x86-based laptops")
5085 (description
5086 "PowerTOP is a Linux tool to diagnose issues with power consumption and
5087power management. In addition to being a diagnostic tool, PowerTOP also has
5088an interactive mode where the user can experiment various power management
5089settings for cases where the operating system has not enabled these
5090settings.")
5091 (license license:gpl2)))
5092
5093(define-public aumix
5094 (package
5095 (name "aumix")
5096 (version "2.9.1")
5097 (source (origin
5098 (method url-fetch)
5099 (uri (string-append
5100 "https://web.archive.org/web/20211201184543/"
5101 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
5102 version ".tar.bz2"))
5103 (sha256
5104 (base32
5105 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
5106 (build-system gnu-build-system)
5107 (arguments
5108 ;; Allow compilation with GCC 10.
5109 '(#:configure-flags '("CFLAGS=-O2 -g -fcommon")))
5110 (inputs (list ncurses))
5111 (home-page (string-append "https://web.archive.org/web/20211201184543/"
5112 "http://jpj.net/~trevor/aumix.html"))
5113 (synopsis "Audio mixer for X and the console")
5114 (description
5115 "Aumix adjusts an audio mixer from X, the console, a terminal,
5116the command line or a script.")
5117 (license license:gpl2+)))
5118
5119(define-public iotop-python
5120 ;; The last release is from 2013 and gives a misleading CONFIG_TASK_DELAY_ACCT
5121 ;; error on ‘newer’ kernels.
5122 (let ((revision "0")
5123 (commit "a14256a3ff74eeee59493ac088561f1bafab85a7"))
5124 (package
5125 (name "iotop-python")
5126 (version (git-version "0.6" revision commit))
5127 (source
5128 (origin
5129 (method git-fetch)
5130 (uri (git-reference
5131 (url "https://repo.or.cz/iotop.git")
5132 (commit commit)))
5133 (file-name (git-file-name name version))
5134 (sha256
5135 (base32 "00h5p8fk1zi237q8mqds8apqbis9iw0yih1hl0pr63dsnyzmmrpw"))))
5136 (build-system pyproject-build-system)
5137 (arguments
5138 (list
5139 #:tests? #f ; No tests.
5140 #:phases
5141 #~(modify-phases %standard-phases
5142 (add-after 'unpack 'fix-build-with-python3
5143 (lambda _
5144 (substitute* "setup.py"
5145 (("itervalues")
5146 "values")))))))
5147 (native-inputs (list python python-setuptools))
5148 (home-page "http://guichaz.free.fr/iotop/")
5149 (synopsis "Displays the IO activity of running processes")
5150 (description
5151 "Iotop is a Python program with a top like user interface to show the
5152processes currently causing I/O.")
5153 (license license:gpl2+))))
5154
5155(define-public iotop
5156 (package
5157 (name "iotop")
5158 (version "1.31")
5159 (source
5160 (origin
5161 (method git-fetch)
5162 (uri (git-reference
5163 (url "https://github.com/Tomas-M/iotop")
5164 (commit (string-append "v" version))))
5165 (file-name (git-file-name name version))
5166 (sha256
5167 (base32 "19ccdiw3flzk7gki90rc1nifmma79g2l87vhls4d2xr4z763m4nc"))))
5168 (build-system gnu-build-system)
5169 (arguments
5170 (list #:make-flags
5171 #~(list (string-append "CC=" #$(cc-for-target))
5172 (string-append "PREFIX=" #$output))
5173 #:tests? #f ; no tests
5174 #:phases
5175 #~(modify-phases %standard-phases
5176 (delete 'configure)))) ; no configure script
5177 (native-inputs (list pkg-config))
5178 (inputs (list ncurses))
5179 (home-page "https://github.com/Tomas-M/iotop")
5180 (synopsis "Interactive @command{top}-like input/output activity monitor")
5181 (description
5182 "iotop identifies which processes and threads are most responsible for
5183@acronym{I/O, input/output} activity such as disc reads and writes. It sorts
5184them in a live, interactive table overview similar to that of the well-known
5185@command{top}.
5186
5187This information makes it much easier for an administrator to see which tasks
5188are blocking others and adjust their priority (using @command{ionice}) or stop
5189or kill them altogether.")
5190 (license license:gpl2+)))
5191
5192(define-public fuse
5193 (package
5194 (name "fuse")
5195 (version "3.18.1")
5196 (source (origin
5197 (method url-fetch)
5198 (uri
5199 (string-append "https://github.com/libfuse/libfuse/releases/"
5200 "download/fuse-" version
5201 "/fuse-" version ".tar.gz"))
5202 (sha256
5203 (base32
5204 "0b1jp5gp2gv40gv6cvmv86rcr4l0mdh050qbvnxl0xcwya45qffx"))))
5205 (build-system meson-build-system)
5206 (outputs (list "out" "debug" "static"))
5207 (inputs
5208 (list bash-minimal util-linux))
5209 (arguments
5210 `(#:configure-flags
5211 ,#~(list
5212 (string-append "-Dudevrulesdir=" #$output "/udev/rules.d")
5213 "-Duseroot=false"
5214 ;; Build static libraries.
5215 "--default-library=both")
5216 #:tests? #f
5217 #:modules ((guix build meson-build-system)
5218 (guix build utils)
5219 (ice-9 ftw))
5220 #:phases
5221 ,#~(modify-phases %standard-phases
5222 (add-after 'unpack 'set-file-names
5223 (lambda* (#:key inputs #:allow-other-keys)
5224 ;; libfuse calls out to mount(8) and umount(8). Make sure
5225 ;; it refers to the right ones.
5226 (substitute* '("lib/mount_util.c")
5227 (("/bin/(u?)mount" _ maybe-u)
5228 (search-input-file inputs
5229 (string-append "bin/"
5230 maybe-u "mount"))))
5231 (substitute* '("util/mount.fuse.c")
5232 (("/bin/sh")
5233 (search-input-file inputs "/bin/sh")))
5234
5235 ;; This hack leads libfuse to search for 'fusermount' in
5236 ;; $PATH, where it may find a setuid-root binary, instead of
5237 ;; trying solely $out/sbin/fusermount and failing because
5238 ;; it's not setuid.
5239 (substitute* "lib/meson.build"
5240 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
5241 "-DFUSERMOUNT_DIR=\"/var/empty\"'"))))
5242 (add-after 'unpack 'fix-install
5243 (lambda* (#:key inputs #:allow-other-keys)
5244 (substitute* '("util/meson.build")
5245 (("install_helper.sh") "true"))
5246 (substitute* '("util/meson.build")
5247 (("fuseconf_path = .*")
5248 "fuseconf_path = '/etc/fuse.conf'"))))
5249 (add-before 'configure 'set-paths
5250 (lambda* (#:key inputs outputs #:allow-other-keys)
5251 (let ((dummy-init.d
5252 (string-append (getcwd) "/etc/init.d")))
5253 (setenv "MOUNT_FUSE_PATH"
5254 (string-append #$output "/sbin"))
5255 (setenv "UDEV_RULES_PATH"
5256 (string-append #$output
5257 "/lib/udev/rules.d")))))
5258 (add-after 'install 'install-static-libraries
5259 (lambda* (#:key outputs #:allow-other-keys)
5260 (let ((out (assoc-ref outputs "out"))
5261 (static (assoc-ref outputs "static")))
5262 (mkdir-p (string-append static "/lib"))
5263 (for-each
5264 (lambda (static-library)
5265 (rename-file
5266 (string-append out "/lib/" static-library)
5267 (string-append static "/lib/" static-library)))
5268 (scandir (string-append out "/lib")
5269 (lambda (file-name)
5270 (string-suffix? ".a" file-name))))))))))
5271 (supported-systems (remove target-hurd? %supported-systems))
5272 (home-page "https://github.com/libfuse/libfuse")
5273 (synopsis "Support file systems implemented in user space")
5274 (description
5275 "As a consequence of its monolithic design, file system code for Linux
5276normally goes into the kernel itself---which is not only a robustness issue,
5277but also an impediment to system extensibility. FUSE, for \"file systems in
5278user space\", is a kernel module and user-space library that tries to address
5279part of this problem by allowing users to run file system implementations as
5280user-space processes.")
5281 (license (list license:lgpl2.1 ; library
5282 license:gpl2+)))) ; command-line utilities
5283
5284(define-public fuse-2
5285 (package
5286 (inherit fuse)
5287 (name "fuse")
5288 (version "2.9.9")
5289 (source
5290 (origin
5291 (method url-fetch)
5292 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
5293 "download/fuse-" version
5294 "/fuse-" version ".tar.gz"))
5295 (sha256
5296 (base32 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
5297 (patches (search-patches "fuse-overlapping-headers.patch"
5298 "fuse-glibc-2.34.patch"))))
5299 (build-system gnu-build-system)
5300 (native-inputs
5301 (list autoconf automake gettext-minimal libtool))
5302 (arguments
5303 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
5304 (assoc-ref %outputs "out")
5305 "/sbin")
5306 (string-append "INIT_D_PATH="
5307 (assoc-ref %outputs "out")
5308 "/etc/init.d")
5309
5310 ;; The rule makes /dev/fuse 666.
5311 (string-append "UDEV_RULES_PATH="
5312 (assoc-ref %outputs "out")
5313 "/lib/udev/rules.d"))
5314 #:phases
5315 (modify-phases %standard-phases
5316 (add-before 'bootstrap 'force-bootstrap
5317 (lambda _
5318 ;; Force a bootstrap to make the patch changes effective.
5319 (delete-file "configure")))
5320 (add-before 'build 'set-file-names
5321 (lambda* (#:key inputs #:allow-other-keys)
5322 ;; libfuse calls out to mount(8) and umount(8). Make sure
5323 ;; it refers to the right ones.
5324 (substitute* '("lib/mount_util.c" "util/mount_util.c")
5325 (("/bin/(u?)mount" _ maybe-u)
5326 (search-input-file inputs
5327 (string-append "bin/"
5328 maybe-u "mount"))))
5329 (substitute* '("util/mount.fuse.c")
5330 (("/bin/sh")
5331 (search-input-file inputs "/bin/sh")))
5332
5333 ;; This hack leads libfuse to search for 'fusermount' in
5334 ;; $PATH, where it may find a setuid-root binary, instead of
5335 ;; trying solely $out/sbin/fusermount and failing because
5336 ;; it's not setuid.
5337 (substitute* "lib/Makefile"
5338 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
5339 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))))))))
5340
5341(define-public unionfs-fuse
5342 (package
5343 (name "unionfs-fuse")
5344 (version "3.3")
5345 (source (origin
5346 (method git-fetch)
5347 (uri (git-reference
5348 (url "https://github.com/rpodgorny/unionfs-fuse")
5349 (commit (string-append "v" version))))
5350 (file-name (git-file-name name version))
5351 (sha256
5352 (base32
5353 "1wl5m5qnwf3s1792xphr35pb80sx8ybaqi3n3ddi5vvk3qjc4iws"))))
5354 (build-system cmake-build-system)
5355 (arguments
5356 (list
5357 #:phases
5358 #~(modify-phases %standard-phases
5359 (replace 'check
5360 ;; The epitome of ‘I tried’: run the 2 trivial tests that don't rely
5361 ;; on the fuse kernel module being loaded. All others would fail.
5362 (lambda* (#:key tests? #:allow-other-keys)
5363 (when tests?
5364 (invoke "pytest" "../source/test_all.py" "-k" "test_help")))))))
5365 (native-inputs
5366 (list pkg-config
5367
5368 ;; Only for the test ‘suite’.
5369 python
5370 python-pytest))
5371 (inputs
5372 (list fuse))
5373 (home-page "https://github.com/rpodgorny/unionfs-fuse")
5374 (synopsis "User-space union file system")
5375 (description
5376 "UnionFS-FUSE is a flexible union file system implementation in user
5377space, using the FUSE library. Mounting a union file system allows you to
5378\"aggregate\" the contents of several directories into a single mount point.
5379UnionFS-FUSE additionally supports copy-on-write.")
5380 (license license:bsd-3)))
5381
5382(define fuse-static
5383 (package (inherit fuse)
5384 (name "fuse-static")
5385 (source
5386 (origin
5387 (inherit (package-source fuse))
5388 (modules '((guix build utils)))
5389 (snippet
5390 #~(begin
5391 ;; Normally libfuse invokes mount(8) so that /etc/mtab is updated.
5392 ;; Change calls to 'mtab_needs_update' to 0 so that it doesn't do
5393 ;; that, allowing us to remove the dependency on util-linux
5394 ;; (something that is useful in initrds.)
5395 (substitute* "lib/mount_util.c"
5396 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)") "0")
5397 (("/bin/") ""))))))
5398 (arguments
5399 (substitute-keyword-arguments arguments
5400 ((#:configure-flags flags '())
5401 #~(cons "-Ddefault_library=static"
5402 #$flags))))))
5403
5404(define-public unionfs-fuse/static
5405 (package (inherit unionfs-fuse)
5406 (synopsis "User-space union file system (statically linked)")
5407 (name (string-append (package-name unionfs-fuse) "-static"))
5408 (source
5409 (origin
5410 (inherit (package-source unionfs-fuse))
5411 (modules '((guix build utils)))
5412 (snippet
5413 #~(begin
5414 ;; Add -ldl to the libraries, because libfuse.a needs that.
5415 (substitute* "src/CMakeLists.txt"
5416 (("target_link_libraries(.*)\\)" _ libs)
5417 (string-append "target_link_libraries"
5418 libs " dl)")))))))
5419 (arguments
5420 (substitute-keyword-arguments arguments
5421 ((#:configure-flags flags #~'())
5422 #~(cons "-DCMAKE_EXE_LINKER_FLAGS=-static" #$flags))
5423 ((#:phases phases #~%standard-phases)
5424 #~(modify-phases #$phases
5425 (add-after 'install 'post-install
5426 (lambda _
5427 ;; By default, 'unionfs' keeps references to
5428 ;; $glibc/share/locale and similar stuff. Remove them.
5429 (remove-store-references (string-append #$output "/bin/unionfs"))
5430 ;; 'unionfsctl' has references to glibc as well. Since
5431 ;; we don't need it, remove it.
5432 (delete-file (string-append #$output "/bin/unionfsctl"))))))))
5433 (inputs (list fuse-static))))
5434
5435(define-public sshfs
5436 (package
5437 (name "sshfs")
5438 (version "3.7.6")
5439 (source (origin
5440 (method url-fetch)
5441 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
5442 "download/sshfs-" version "/sshfs-" version
5443 ".tar.xz"))
5444 (sha256
5445 (base32
5446 "14sq94g160i56v5sc39wgilxnd6yf661bzxpn6f7w1qa8lqwn6va"))))
5447 (build-system meson-build-system)
5448 (arguments
5449 ;; XXX: tests are skipped: FUSE kernel module does not seem to be loaded
5450 '(#:tests? #f))
5451 (inputs
5452 (list fuse glib))
5453 (native-inputs
5454 (list pkg-config
5455 ;; man page
5456 python-docutils))
5457 (home-page "https://github.com/libfuse/sshfs")
5458 (synopsis "Mount remote file systems over SSH")
5459 (description
5460 "This is a file system client based on the SSH File Transfer Protocol.
5461Since most SSH servers already support this protocol it is very easy to set
5462up: on the server side there's nothing to do; on the client side mounting the
5463file system is as easy as logging into the server with an SSH client.")
5464 (license license:gpl2+)))
5465
5466(define-public archivemount
5467 (package
5468 (name "archivemount")
5469 (version "0.9.1")
5470 (source
5471 (origin
5472 (method url-fetch)
5473 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
5474 "archivemount-" version ".tar.gz"))
5475 (sha256
5476 (base32 "1cy5b6qril9c3ry6fv7ir87s8iyy5vxxmbyx90dm86fbra0vjaf5"))))
5477 (build-system gnu-build-system)
5478 (inputs (list fuse-2 libarchive))
5479 (native-inputs (list pkg-config))
5480 (home-page "https://www.cybernoia.de/software/archivemount.html")
5481 (synopsis "Tool for mounting archive files with FUSE")
5482 (description "archivemount is a FUSE-based file system for Unix variants,
5483including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
5484mount point where it can be read from or written to as with any other file
5485system. This makes accessing the contents of the archive, which may be
5486compressed, transparent to other programs, without decompressing them.")
5487 (license license:lgpl2.0+)))
5488
5489(define-public numactl
5490 (package
5491 (name "numactl")
5492 (version "2.0.16")
5493 (source (origin
5494 (method url-fetch)
5495 (uri (string-append
5496 "https://github.com/numactl/numactl/releases/download/v"
5497 version "/numactl-" version ".tar.gz"))
5498 (sha256
5499 (base32
5500 "1j67wx3383fwqbvhg4nwqf72vpdgimmrvkpn3b9s2xzr7a4jy90v"))))
5501 (build-system gnu-build-system)
5502 (arguments
5503 `(,@(if (target-riscv64?)
5504 `(#:make-flags (list "LDFLAGS=-latomic"))
5505 '())
5506 ;; There's a 'test' target, but it requires NUMA support in the kernel
5507 ;; to run, which we can't assume to have.
5508 #:tests? #f))
5509 (home-page "https://github.com/numactl/numactl")
5510 (synopsis "Tools for non-uniform memory access (NUMA) machines")
5511 (description
5512 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
5513memory is not all in one place. The @command{numactl} program allows you to
5514run your application program on specific CPUs and memory nodes. It does this
5515by supplying a NUMA memory policy to the operating system before running your
5516program.
5517
5518The package contains other commands, such as @command{numastat},
5519@command{memhog}, and @command{numademo} which provides a quick overview of
5520NUMA performance on your system.")
5521 (license (list license:gpl2 ;programs
5522 license:lgpl2.1)))) ;library
5523
5524(define-public kbd-neo
5525 (package
5526 (name "kbd-neo")
5527 (version "2486")
5528 (source
5529 (origin
5530 (method url-fetch)
5531 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
5532 version "/linux/console/neo.map"))
5533 (file-name (string-append name "-" version ".map"))
5534 (sha256
5535 (base32
5536 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
5537 (build-system trivial-build-system)
5538 (arguments
5539 `(#:modules ((guix build utils))
5540 #:builder (begin
5541 (use-modules (guix build utils))
5542 (let ((out (string-append %output "/share/keymaps"))
5543 (source (assoc-ref %build-inputs "source")))
5544 (mkdir-p out)
5545 (copy-file source (string-append out "/neo.map"))
5546 #t))))
5547 (home-page "https://neo-layout.org")
5548 (synopsis "Neo2 console layout")
5549 (description
5550 "Kbd-neo provides the Neo2 keyboard layout for use with
5551@command{loadkeys(1)} from @code{kbd(4)}.")
5552 ;; The file is located in an svn directory, the entire content of
5553 ;; the directory is licensed as GPL3.
5554 (license license:gpl3+)))
5555
5556(define-public kbd
5557 (package
5558 (name "kbd")
5559 (version "2.5.1")
5560 (source
5561 (origin
5562 (method url-fetch)
5563 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-" version
5564 ".tar.xz"))
5565 (sha256
5566 (base32 "10s608i4blprgy9nynlid0hglfdrrgln6wwjs9rhjf56hwilbpyc"))
5567 (modules '((guix build utils)))
5568 (snippet
5569 '(begin
5570 (substitute* '("src/unicode_start" "src/unicode_stop")
5571 ;; Assume the Coreutils are in $PATH.
5572 (("/usr/bin/tty")
5573 "tty"))))))
5574 (build-system gnu-build-system)
5575 (arguments
5576 (list
5577 #:phases
5578 #~(modify-phases %standard-phases
5579 (add-before 'build 'pre-build
5580 (lambda* (#:key inputs #:allow-other-keys)
5581 (substitute* "src/libkbdfile/kbdfile.c"
5582 (("bzip2")
5583 (search-input-file inputs "/bin/bzip2"))
5584 (("gzip")
5585 (search-input-file inputs "/bin/gzip"))
5586 (("xz -d")
5587 (string-append (search-input-file inputs "/bin/xz") " -d"))
5588 (("zstd")
5589 (search-input-file inputs "/bin/zstd")))))
5590 (add-after 'install 'post-install
5591 (lambda _
5592 ;; Make sure these programs find their comrades.
5593 (let ((bin (string-append #$output "/bin")))
5594 (for-each (lambda (prog)
5595 (wrap-program (string-append bin "/" prog)
5596 `("PATH" ":" prefix (,bin))))
5597 '("unicode_start" "unicode_stop"))))))))
5598 (native-inputs (list autoconf pkg-config))
5599 (inputs
5600 (list bash-minimal
5601 ;; for wrap-program
5602 bzip2
5603 gzip
5604 linux-pam
5605 xz
5606 zstd))
5607 (native-search-paths
5608 (list (search-path-specification
5609 (variable "LOADKEYS_KEYMAP_PATH")
5610 ;; Append ‘/**’ to recursively search all directories. One can then
5611 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
5612 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
5613 (files (list "share/keymaps/**")))))
5614 (home-page "https://kbd-project.org/")
5615 (synopsis "Linux keyboard utilities and keyboard maps")
5616 (description
5617 "This package contains keytable files and keyboard utilities compatible
5618for systems using the Linux kernel. This includes commands such as
5619@code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
5620 (license license:gpl2+)))
5621
5622(define-public loadkeys-static
5623 (package
5624 (inherit kbd)
5625 (name "loadkeys-static")
5626 (arguments
5627 (substitute-keyword-arguments arguments
5628 ((#:configure-flags flags #~(list))
5629 #~(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
5630 "--disable-vlock" ;so we don't need libpam
5631 "--disable-libkeymap")
5632 #$flags))
5633 ((#:make-flags flags #~(list))
5634 #~(cons "LDFLAGS=-all-static -lrt -lpthread" #$flags))
5635 ((#:phases phases #~%standard-phases)
5636 #~(modify-phases #$phases
5637 (replace 'install
5638 (lambda _
5639 ;; The binary keeps references to gzip, among other things,
5640 ;; which we don't need in the initrd, so strip references.
5641 (remove-store-references "src/loadkeys")
5642
5643 (install-file "src/loadkeys"
5644 (string-append #$output "/bin"))))
5645 (delete 'post-install)))
5646 ((#:strip-flags _ #~(list))
5647 #~(list "--strip-all"))
5648 ((#:allowed-references _ '())
5649 '())))
5650
5651 (synopsis "Statically-linked @command{loadkeys} program")
5652
5653 ;; This package is meant to be used internally in the initrd so don't
5654 ;; expose it.
5655 (properties '((hidden? . #t)))))
5656
5657(define-public inotify-tools
5658 (package
5659 (name "inotify-tools")
5660 (version "3.22.6.0")
5661 (source (origin
5662 (method git-fetch)
5663 (uri (git-reference
5664 (url "https://github.com/rvoicilas/inotify-tools")
5665 (commit version)))
5666 (file-name (git-file-name name version))
5667 (sha256
5668 (base32
5669 "1j9j8k5zjp8m4cl53zjncnll9z4dnvzr4ygmfcjk0ci81i59b18i"))))
5670 (build-system gnu-build-system)
5671 (native-inputs
5672 (list autoconf automake libtool))
5673 (arguments
5674 `(#:configure-flags
5675 (list "--disable-static")))
5676 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
5677 (synopsis "Monitor file accesses")
5678 (description
5679 "The inotify-tools packages provides a C library and command-line tools
5680to use Linux' inotify mechanism, which allows file accesses to be monitored.")
5681 (license license:gpl2+)))
5682
5683(define-public kmod
5684 (package
5685 (name "kmod")
5686 (version "29")
5687 (source (origin
5688 (method url-fetch)
5689 (uri
5690 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
5691 "kmod-" version ".tar.xz"))
5692 (sha256
5693 (base32
5694 "0am54mi5rk72g5q7k6l6f36gw3r9vwgjmyna43ywcjhqmakyx00b"))
5695 (patches (search-patches "kmod-module-directory.patch"))))
5696 (build-system gnu-build-system)
5697 (arguments
5698 (list #:configure-flags #~(list "--with-xz" "--with-zlib" "--with-zstd"
5699 "--disable-test-modules")
5700 #:phases
5701 #~(modify-phases %standard-phases
5702 (add-after 'unpack 'disable-tests
5703 (lambda _
5704 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
5705 (substitute* "Makefile.in"
5706 (("testsuite/test-modprobe") "")
5707 (("testsuite/test-depmod") "")
5708 (("testsuite/test-blacklist") ""))))
5709 (add-after 'install 'install-modprobe&co
5710 (lambda _
5711 (for-each (lambda (tool)
5712 (symlink "kmod"
5713 (string-append #$output "/bin/" tool)))
5714 '("insmod" "rmmod" "lsmod" "modprobe"
5715 "modinfo" "depmod")))))))
5716 (native-inputs (list pkg-config zstd)) ;zstd needed for tests
5717 (inputs (list xz zlib `(,zstd "lib")))
5718 (supported-systems (remove target-hurd? %supported-systems))
5719 (home-page "https://www.kernel.org/")
5720 (synopsis "Kernel module tools")
5721 (description "Kmod is a set of tools to handle common tasks with Linux
5722kernel modules like insert, remove, list, check properties, resolve
5723dependencies and aliases.
5724
5725These tools are designed on top of libkmod, a library that is shipped with
5726kmod. The aim is to be compatible with tools, configurations and indices
5727from the module-init-tools project.")
5728 (license license:gpl2+))) ; library under lgpl2.1+
5729
5730(define-public earlyoom
5731 (package
5732 (name "earlyoom")
5733 (version "1.9.0")
5734 (source (origin
5735 (method git-fetch)
5736 (uri (git-reference
5737 (url "https://github.com/rfjakob/earlyoom")
5738 (commit (string-append "v" version))))
5739 (file-name (git-file-name name version))
5740 (sha256
5741 (base32
5742 "107d2vgdlkqm8ggacxn1biamganvqz29nhi0zbn7yhmfmzvs1mbq"))))
5743 (build-system gnu-build-system)
5744 (arguments
5745 (list
5746 #:imported-modules %go-build-system-modules
5747 #:modules '((guix build gnu-build-system)
5748 ((guix build go-build-system) #:prefix go:)
5749 (guix build union)
5750 (guix build utils))
5751 #:phases
5752 #~(modify-phases %standard-phases
5753 (delete 'configure) ; no configure script
5754 (add-before 'build 'setup-go-environment
5755 (assoc-ref go:%standard-phases 'setup-go-environment))
5756 (add-before 'check 'set-go-HOME
5757 (lambda _
5758 (setenv "HOME" (getcwd))))
5759 (add-before 'check 'disable-failing-test
5760 (lambda _
5761 ;; This test relies on writing to /proc/%d/oom_score_adj.
5762 (substitute* "Makefile"
5763 (("go test -v" match)
5764 (string-append match " -vet=off -skip 'TestI'"))))))
5765 #:make-flags
5766 #~(list (string-append "CC=" #$(cc-for-target))
5767 (string-append "VERSION=v" #$version)
5768 (string-append "PREFIX=" #$output)
5769 (string-append "SYSCONFDIR=" #$output "/etc")
5770 ;; Do not try installing systemd files to /etc/systemd.
5771 "SYSTEMDUNITDIR=/tmp/dummy")
5772 #:test-target "test"))
5773 (native-inputs
5774 (append
5775 ;; To generate the manpage.
5776 (if (or (target-x86-64?) (target-x86-32?))
5777 (list pandoc)
5778 '())
5779 (list
5780 ;; For the test suite.
5781 cppcheck
5782 go
5783 go-github-com-c9s-goprocinfo)))
5784 (home-page "https://github.com/rfjakob/earlyoom")
5785 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
5786 (description "Early OOM is a minimalist out of memory (OOM) daemon that
5787runs in user space and provides a more responsive and configurable alternative
5788to the in-kernel OOM killer.")
5789 (license license:expat)))
5790
5791(define-public eudev
5792 (package
5793 (name "eudev")
5794 (version "3.2.14")
5795 (source (origin
5796 (method git-fetch)
5797 (uri (git-reference (url "https://github.com/eudev-project/eudev")
5798 (commit (string-append "v" version))))
5799 (file-name (git-file-name name version))
5800 (sha256
5801 (base32
5802 "1f6lz57igi7iw2ls3fpzgw42bfznam4nf9368h7x8yf1mb737yxz"))))
5803 (build-system gnu-build-system)
5804 (arguments
5805 (list
5806 ;; The binary should be built to look for its rules under
5807 ;; /etc/udev/rules.d, which is where the udev-shepherd-service keeps
5808 ;; them.
5809 #:make-flags #~(list "udevrulesdir=/etc/udev/rules.d")
5810 #:phases
5811 #~(modify-phases %standard-phases
5812 (add-before 'bootstrap 'patch-file-names
5813 (lambda* (#:key inputs native-inputs #:allow-other-keys)
5814 (substitute* "man/make.sh"
5815 (("/usr/bin/xsltproc")
5816 (search-input-file (or native-inputs inputs) "/bin/xsltproc")))))
5817 (add-before 'bootstrap 'install-in-lib
5818 (lambda _
5819 ;; When the udev-service-type instantiates /etc, it collects
5820 ;; hardware files from the <package>/lib/udev/hwdb.d directories
5821 ;; of different packages. Since we set sysconfdir to /etc, the
5822 ;; only package-dependent location we can install hwdb files is
5823 ;; in <package>/lib/udev/hwdb.d. Eudev is configured to install
5824 ;; these files in sysconfdir, but they should be placed into
5825 ;; udevlibexecdir.
5826 (copy-file "hwdb/Makefile.am" "hwdb/files.am")
5827 (call-with-output-file "hwdb/Makefile.am"
5828 (lambda (port)
5829 (format port "hardwarelibdir = $(udevlibexecdir)/hwdb.d\n")
5830 (format port "include ./files.am")))
5831 (substitute* "hwdb/files.am"
5832 (("dist_udevhwdb_DATA =")
5833 "dist_hardwarelib_DATA ="))
5834 ;; Do not install the empty udev.conf template.
5835 (substitute* "src/udev/Makefile.am"
5836 (("dist_udevconf_DATA =")
5837 "dist_noinst_DATA ="))
5838 ;; Do not ensure that /etc/udev/rules.d exists.
5839 (substitute* "rules/Makefile.am"
5840 (("\\$\\(MKDIR_P\\) \\$\\(DESTDIR\\)\\$\\(udevconfdir\\)/rules\\.d")
5841 "true"))))
5842 (add-after 'install 'move-static-library
5843 (lambda _
5844 (let ((source (string-append #$output "/lib/libudev.a"))
5845 (target (string-append #$output:static "/lib/libudev.a")))
5846 (mkdir-p (dirname target))
5847 (link source target)
5848 (delete-file source)
5849 ;; Remove reference to the static library from the .la file
5850 ;; such that Libtool looks for it in the usual places.
5851 (substitute* (string-append #$output "/lib/libudev.la")
5852 (("old_library=.*")
5853 "old_library=''\n")))))
5854 (replace 'install
5855 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
5856 ;; Although the runtime udevrulesdir is set to
5857 ;; /etc/udev/rules.d, the package should provide its default
5858 ;; rules under $libdir/udev/rules.d.
5859 (let* ((default-udev-rules.d (string-append #$output
5860 "/lib/udev/rules.d"))
5861 (make-flags (cons (string-append "udevrulesdir="
5862 default-udev-rules.d)
5863 (delete "udevrulesdir=/etc/udev/rules.d"
5864 make-flags))))
5865 (apply (assoc-ref %standard-phases 'install)
5866 `(,@args #:make-flags ,make-flags))))))
5867 #:configure-flags
5868 #~(list "--enable-manpages"
5869 ;; By default, autoconf uses $prefix/etc. The udev-service-type
5870 ;; makes sure /etc is set up with rules and hardware file
5871 ;; descriptions.
5872 "--sysconfdir=/etc")))
5873 (native-search-paths
5874 (list (search-path-specification
5875 (variable "UDEV_HWDB_PATH")
5876 (files '("lib/udev/hwdb.d")))))
5877 (native-inputs
5878 (list autoconf
5879 automake
5880 gperf
5881 libtool
5882 pkg-config
5883 ;; For tests.
5884 perl
5885 python-wrapper
5886 ;; For documentation.
5887 docbook-xml-4.2
5888 docbook-xsl
5889 libxslt))
5890 (inputs
5891 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
5892 ;; and similar; it also installs the '60-persistent-storage.rules' file,
5893 ;; which contains the rules to do that.
5894 (list `(,util-linux "lib") ;for blkid
5895 kmod))
5896 (outputs '("out" "static"))
5897 (home-page "https://github.com/eudev-project/eudev")
5898 (synopsis "Userspace device management")
5899 (description "Udev is a daemon which dynamically creates and removes
5900device nodes from /dev/, handles hotplug events and loads drivers at boot
5901time.")
5902 (license license:gpl2+)))
5903
5904(define-public python-evdev
5905 (package
5906 (name "python-evdev")
5907 (version "1.9.1")
5908 (source
5909 (origin
5910 (method git-fetch) ; no tests data in PyPi package
5911 (uri (git-reference
5912 (url "https://github.com/gvalkov/python-evdev")
5913 (commit (string-append "v" version))))
5914 (file-name (git-file-name name version))
5915 (sha256
5916 (base32 "09p7pj0xhv23hqlpx865klrxrf7x6sw1bdsgs6pq900jvz92pl16"))))
5917 (build-system pyproject-build-system)
5918 (arguments
5919 (list
5920 #:test-flags
5921 ;; Silent tests requiring access to /dev/uinput.
5922 #~(list "-k" (string-append "not test_open"
5923 " and not test_open_context"
5924 " and not test_enable_events"
5925 " and not test_abs_values"
5926 " and not test_write"))
5927 #:phases
5928 #~(modify-phases %standard-phases
5929 (add-before 'build 'fix-hard-coded-directory
5930 (lambda* (#:key inputs #:allow-other-keys)
5931 (substitute* "setup.py"
5932 (("/usr/include/linux")
5933 (string-append
5934 (assoc-ref inputs "kernel-headers") "/include/linux"))))))))
5935 (native-inputs
5936 (list python-pytest python-setuptools python-wheel))
5937 (home-page "https://github.com/gvalkov/python-evdev")
5938 (synopsis "Bindings to the Linux input handling subsystem")
5939 (description
5940 "Python-evdev provides bindings to the generic input event interface in
5941Linux. The @code{evdev} interface serves the purpose of passing events
5942generated in the kernel directly to userspace through character devices that
5943are typically located in @file{/dev/input/}.
5944
5945This package also comes with bindings to @code{uinput}, the userspace input
5946subsystem. @code{uinput} allows userspace programs to create and handle input
5947devices that can inject events directly into the input subsystem.")
5948 (license license:bsd-3)))
5949
5950(define-public interception-tools
5951 (package
5952 (name "interception-tools")
5953 (version "0.6.8")
5954 (home-page "https://gitlab.com/interception/linux/tools")
5955 (source (origin
5956 (method git-fetch)
5957 (uri (git-reference
5958 (url home-page)
5959 (commit (string-append "v" version))))
5960 (file-name (git-file-name name version))
5961 (sha256
5962 (base32
5963 "1sbidym6ld4c8cx2ww5i54zsv8v0kygv15zq1yimz44v4my605wf"))))
5964 (build-system cmake-build-system)
5965 (native-inputs
5966 (list pkg-config))
5967 (inputs
5968 (list boost libevdev eudev yaml-cpp))
5969 (arguments
5970 `(#:tests? #f)) ; no test suite
5971 (synopsis "Utilities for operating on input events of evdev devices")
5972 (description
5973 "Interception Tools provides a composable infrastructure on top of
5974@code{libudev} and @code{libevdev}. The following utilities are provided:
5975
5976@itemize
5977@item @command{udevmon} --- monitor input devices for launching tasks
5978@item @command{intercept} --- redirect device input events to stdout
5979@item @command{uinput} --- redirect device input events from stding to virtual device
5980@item @command{mux} --- mux streams of input events
5981@end itemize")
5982 ;; Dual-licensed under GPLv3+ or "something else" on request, per
5983 ;; 'README.md'.
5984 (license license:gpl3+)))
5985
5986(define-public interception-dual-function-keys
5987 (package
5988 (name "interception-dual-function-keys")
5989 (version "1.5.0")
5990 (home-page "https://gitlab.com/interception/linux/plugins/dual-function-keys")
5991 (source (origin
5992 (method git-fetch)
5993 (uri (git-reference
5994 (url home-page)
5995 (commit version)))
5996 (file-name (git-file-name name version))
5997 (sha256
5998 (base32
5999 "17jc02wh45yk427qryb0ydyim16607i31wyghbsahahd6mrh9ylv"))))
6000 (build-system gnu-build-system)
6001 (inputs
6002 (list libevdev yaml-cpp))
6003 (arguments
6004 `(#:make-flags (list ,(string-append "CC=" (cc-for-target))
6005 ,(string-append "CXX=" (cxx-for-target))
6006 (string-append "PREFIX=" %output))
6007 #:phases
6008 (modify-phases %standard-phases
6009 (add-after 'unpack 'fix-libevdev-path
6010 (lambda* (#:key inputs #:allow-other-keys)
6011 (let ((libevdev (assoc-ref inputs "libevdev")))
6012 (substitute* "config.mk"
6013 (("/usr/include/libevdev-1.0")
6014 (string-append libevdev "/include/libevdev-1.0")))
6015 #t)))
6016 ;; No configure script
6017 (delete 'configure))
6018 ;; No tests are included.
6019 #:tests? #f))
6020 (synopsis "Tap for one key, hold for another")
6021 (description
6022 "Dual Function Keys is a plugin for @code{interception-tools} that allows
6023one to send arbitrary keycodes when a given key is tapped or held.")
6024 (license license:expat)))
6025
6026(define-public lvm2
6027 (package
6028 (name "lvm2")
6029 (version "2.03.22")
6030 (source (origin
6031 (method url-fetch)
6032 (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2."
6033 version ".tgz")
6034 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
6035 version ".tgz")))
6036 (sha256
6037 (base32
6038 "0z6w6bknhwh1n3qfkb5ij6x57q3wjf28lq3l8kh7rkhsplinjnjc"))
6039 (patches (search-patches "lvm2-no-systemd.patch"))
6040 (modules '((guix build utils)))
6041 (snippet
6042 '(begin
6043 (use-modules (guix build utils))
6044
6045 ;; Honor sysconfdir.
6046 (substitute* "make.tmpl.in"
6047 (("^confdir = .*$")
6048 "confdir = @sysconfdir@\n")
6049 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
6050 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
6051 (build-system gnu-build-system)
6052 (arguments
6053 (list
6054 #:tests? #f ;The tests use 'mknod', which requires root access.
6055 #:configure-flags
6056 #~(list (string-append "--sysconfdir=" #$output "/etc/lvm")
6057 "--enable-udev_sync"
6058 "--enable-udev_rules"
6059 "--enable-pkgconfig"
6060 "--enable-cmdlib"
6061 "--enable-dmeventd" ;Requires '--enable-cmdlib'.
6062 ;; Make sure programs such as 'dmsetup' can
6063 ;; find libdevmapper.so.
6064 (string-append "LDFLAGS=-Wl,-rpath="
6065 #$output "/lib,-rpath="
6066 #$output "/lib/device-mapper")
6067 ;; This is needed when cross-compiling.
6068 #$@(if (%current-target-system)
6069 '("ac_cv_func_malloc_0_nonnull=yes"
6070 "ac_cv_func_realloc_0_nonnull=yes")
6071 '()))
6072 #:phases
6073 #~(modify-phases %standard-phases
6074 (add-after 'unpack 'update-config
6075 (lambda* (#:key inputs native-inputs #:allow-other-keys)
6076 (install-file (search-input-file (or native-inputs inputs)
6077 "/bin/config.sub")
6078 "autoconf")
6079 (install-file (search-input-file (or native-inputs inputs)
6080 "/bin/config.guess")
6081 "autoconf")))
6082 (add-after 'configure 'set-makefile-shell
6083 (lambda _
6084 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
6085 ;; expected.
6086 (setenv "SHELL" (which "sh"))
6087
6088 ;; Replace /bin/sh with the right file name.
6089 (patch-makefile-SHELL "make.tmpl"))))))
6090 (native-inputs (list config pkg-config procps)) ;tests use 'pgrep'
6091 (inputs (list libaio eudev))
6092 (supported-systems (remove target-hurd? %supported-systems))
6093 (home-page "https://sourceware.org/lvm2/")
6094 (synopsis "Logical volume management for Linux")
6095 (description
6096 "LVM2 is the logical volume management tool set for Linux-based systems.
6097This package includes the user-space libraries and tools, including the device
6098mapper. Kernel components are part of Linux-libre.")
6099
6100 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
6101 ;; Command-line tools are GPLv2.
6102 (license (list license:gpl2 license:lgpl2.1))))
6103
6104(define-public (libdevmapper-propagated-inputs)
6105 (list eudev))
6106
6107(define-public lvm2-static
6108 (package
6109 (inherit lvm2)
6110 (name "lvm2-static")
6111 (arguments
6112 (substitute-keyword-arguments arguments
6113 ((#:configure-flags flags #~(list))
6114 ;; LVM2 doesn't use Libtool, hence the custom option.
6115 #~(append (list "--enable-static_link")
6116 ;; Building dmeventd statically is complicated due to a
6117 ;; requirement on libdevmapper.a, which is being phased out
6118 ;; in favor of libdevice-mapper.a, which in turn is is not
6119 ;; easily made available at dmeventd build time. Just ignore
6120 ;; it until the situation improves.
6121 (delete "--enable-dmeventd" #$flags)))
6122 ((#:phases phases)
6123 #~(modify-phases #$phases
6124 (add-before 'configure 'adjust-Makefile
6125 (lambda _
6126 ;; These fixes are related to the upstream libdm->device_mapper
6127 ;; migration and will hopefully be fixed upstream in due time.
6128 (substitute* "tools/Makefile.in"
6129 ;; This variable is empty in a static configuration and causes
6130 ;; an erroneous GCC command line.
6131 (("-L\\$\\(interfacebuilddir\\)") "")
6132 ;; Remove obsolete reference to libdevmapper.a.
6133 (("-ldevmapper")
6134 ""))))
6135 (add-after 'install 'adjust-pkgconfig
6136 ;; The static eudev is missing its pkg config file, and I am not
6137 ;; rebuilding it at this point.
6138 (lambda* (#:key inputs #:allow-other-keys)
6139 (substitute* (string-append #$output
6140 "/lib/pkgconfig/devmapper.pc")
6141 (("Requires.private: .*")
6142 "")
6143 (("Libs.private:")
6144 (format #f "Libs.private: -L~a -ludev"
6145 (dirname
6146 (search-input-file inputs
6147 "lib/libudev.a")))))))))))
6148 (inputs (modify-inputs inputs
6149 (append (list eudev "static"))))
6150 (synopsis "Logical volume management for Linux (statically linked)")))
6151
6152(define-public thin-provisioning-tools
6153 (package
6154 (name "thin-provisioning-tools")
6155 (version "0.8.5")
6156 (source
6157 (origin
6158 (method git-fetch)
6159 (uri (git-reference
6160 (url "https://github.com/jthornber/thin-provisioning-tools")
6161 (commit (string-append "v" version))))
6162 (file-name (git-file-name name version))
6163 (sha256
6164 (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19"))))
6165 (build-system gnu-build-system)
6166 (arguments
6167 ;; Doesn't build with --enable-testing due to a function name collision
6168 ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released.
6169 (list #:tests? #f))
6170 (native-inputs (list autoconf automake))
6171 (inputs (list boost expat libaio))
6172 (synopsis "Tools for manipulating the metadata of device-mapper targets")
6173 (description "A suite of tools for manipulating the metadata of the
6174dm-thin, dm-cache and dm-era device-mapper targets.")
6175 (home-page "https://github.com/jthornber/thin-provisioning-tools")
6176 (license license:gpl3+)))
6177
6178(define-public watchdogd
6179 (package
6180 (name "watchdogd")
6181 (version "4.1")
6182 (source (origin
6183 (method git-fetch)
6184 (uri (git-reference
6185 (url "https://github.com/troglobit/watchdogd")
6186 (commit version)))
6187 (file-name (git-file-name name version))
6188 (sha256
6189 (base32
6190 "1n5xq5gxrj8b8j2g323k0jpxabjnq9piw8v2fqcyphj33kmgay23"))))
6191 (build-system gnu-build-system)
6192 (native-inputs (list autoconf automake libtool pkg-config))
6193 (inputs (list libconfuse libite libuev))
6194 (synopsis "Advanced system & process supervisor for Linux")
6195 (description "This package provides an advanced monitor of critical system
6196resources, supervises the heartbeat of processes, records deadline
6197transgressions, and initiates a controlled reset if needed.")
6198 (home-page "https://troglobit.com/projects/watchdogd/")
6199 (license license:isc)))
6200
6201(define-public wireless-tools
6202 (package
6203 (name "wireless-tools")
6204 (version "30.pre9")
6205 (source
6206 (origin
6207 (method url-fetch)
6208 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/"
6209 "Linux/wireless_tools." version ".tar.gz"))
6210 (sha256
6211 (base32 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
6212 (snippet
6213 #~(begin
6214 ;; Remove the older header files that are not free software.
6215 (for-each (lambda (n)
6216 (delete-file (format #f "wireless.~a.h" n)))
6217 '(10 11 12 13 14 15 16 17 18 19 20))))))
6218 (build-system gnu-build-system)
6219 (arguments
6220 (list #:make-flags
6221 #~(list (string-append "PREFIX=" #$output)
6222 (string-append "INSTALL_MAN=" #$output "/share/man")
6223 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
6224 "BUILD_STATIC=")
6225 #:phases
6226 #~(modify-phases %standard-phases
6227 (replace 'configure
6228 (lambda* (#:key target #:allow-other-keys)
6229 (when target
6230 ;; Cross-compilation: use the cross tools.
6231 (substitute* (find-files "." "Makefile")
6232 (("CC = .*$")
6233 (string-append "CC = " target "-gcc\n"))
6234 (("AR = .*$")
6235 (string-append "AR = " target "-ar\n"))
6236 (("RANLIB = .*$")
6237 (string-append "RANLIB = " target "-ranlib\n")))))))
6238 #:tests? #f))
6239 (synopsis "Tools for manipulating Linux Wireless Extensions")
6240 (description "Wireless Tools are used to manipulate the now-deprecated
6241Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
6242Extension was an interface allowing you to set Wireless LAN specific
6243parameters and get the specific stats. It is deprecated in favor the nl80211
6244interface.")
6245 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
6246 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
6247 ;; other files are distributed under gpl2.
6248 (license (list license:gpl2 license:lgpl2.1+))))
6249
6250(define-public crda
6251 (package
6252 (name "crda")
6253 (version "4.15")
6254 (source
6255 (origin
6256 (method git-fetch)
6257 (uri (git-reference
6258 (url "https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/crda.git")
6259 (commit (string-append "v" version))))
6260 (file-name (git-file-name name version))
6261 (sha256
6262 (base32 "1ajh8zx84p15y9wawh764zawniwn059iw9m32v56ajvkz9xbnkp2"))
6263 (patches (search-patches "crda-optional-gcrypt.patch"))))
6264 (build-system gnu-build-system)
6265 (arguments
6266 (list #:phases
6267 #~(modify-phases %standard-phases
6268 (delete 'configure)
6269 (add-after 'unpack 'gzip-deterministically
6270 (lambda _
6271 (substitute* "Makefile"
6272 (("gzip" command)
6273 (string-append command " --no-name")))))
6274 #$@(if (%current-target-system)
6275 #~((add-after 'unpack 'fix-pkg-config
6276 (lambda* (#:key target #:allow-other-keys)
6277 (substitute* "Makefile"
6278 (("pkg-config" command)
6279 (string-append target "-" command))))))
6280 #~())
6281 (add-before 'build 'patch-Makefile
6282 (lambda _
6283 (substitute* "Makefile"
6284 (("ldconfig") "true"))))
6285 (add-before 'build 'set-regulatory-db-file-name
6286 (lambda* (#:key native-inputs inputs #:allow-other-keys)
6287 ;; Tell CRDA where to find our database.
6288 (let ((regdb (assoc-ref (or native-inputs inputs)
6289 "wireless-regdb")))
6290 (substitute* "crda.c"
6291 (("\"/lib/crda/regulatory.bin\"")
6292 (string-append "\"" regdb
6293 "/lib/crda/regulatory.bin\"")))))))
6294 #:test-target "verify"
6295 #:make-flags
6296 #~(list
6297 (string-append "CC=" #$(cc-for-target))
6298 "V=1"
6299
6300 ;; Disable signature-checking on 'regulatory.bin'.
6301 ;; The reason is that this simplifies maintenance
6302 ;; on our side (no need to manage a distro key
6303 ;; pair), and we can guarantee integrity of
6304 ;; 'regulatory.bin' by other means anyway, such as
6305 ;; 'guix gc --verify'. See
6306 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
6307 ;; for a discssion.
6308 "USE_OPENSSL=0"
6309
6310 (string-append "PREFIX=" #$output)
6311 (string-append "SBINDIR=" #$output "/sbin/")
6312 (string-append "UDEV_RULE_DIR="
6313 #$output "/lib/udev/rules.d")
6314 (string-append "LDFLAGS=-Wl,-rpath="
6315 #$output "/lib -L.")
6316 (string-append "REG_BIN="
6317 #$(this-package-native-input "wireless-regdb")
6318 "/lib/crda/regulatory.bin")
6319 "all_noverify")))
6320 (native-inputs (list pkg-config wireless-regdb))
6321 (inputs (list libnl))
6322 (home-page
6323 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
6324 (synopsis "@acronym{CRDA, Central Regulatory Domain Agent} for WiFi")
6325 (description
6326 "The @acronym{CRDA, Central Regulatory Domain Agent} acts as the udev
6327helper for communication between the kernel Linux and user space for regulatory
6328compliance.")
6329 (license license:copyleft-next)))
6330
6331(define-public wireless-regdb
6332 (package
6333 (name "wireless-regdb")
6334 (version "2026.09.03")
6335 (source (origin
6336 (method url-fetch)
6337 (uri (string-append
6338 "mirror://kernel.org/software/network/wireless-regdb/"
6339 "wireless-regdb-" version ".tar.xz"))
6340 (sha256
6341 (base32 "13gmrcsbnkp98b20vqd50d8klxsvl60ydaw0qb8hr0kv480hjbmj"))
6342 ;; We're building 'regulatory.bin' and 'regulatory.db' by
6343 ;; ourselves.
6344 (snippet '(begin
6345 (map delete-file '("regulatory.bin"
6346 "regulatory.db"))))))
6347 (build-system gnu-build-system)
6348 (arguments
6349 (list
6350 #:phases
6351 #~(modify-phases %standard-phases
6352 (add-after 'unpack 'gzip-determinism
6353 (lambda _
6354 (substitute* "Makefile"
6355 (("gzip") "gzip --no-name"))))
6356 (replace 'build
6357 (lambda* (#:key (make-flags '()) #:allow-other-keys)
6358 (apply invoke "make" "regulatory.db" make-flags)))
6359 (add-after 'build 'build-regulatory.bin-unsigned
6360 (lambda* (#:key (make-flags '()) #:allow-other-keys)
6361 (apply invoke "make" "regulatory.bin"
6362 (cons*
6363 ;; Leave this empty so that db2bin.py doesn't try to sign
6364 ;; ‘regulatory.bin’. This allows us to avoid managing a key
6365 ;; pair for the whole distribution.
6366 "REGDB_PRIVKEY="
6367 ;; Don't generate a public key for the same reason. These are
6368 ;; used as Makefile targets and can't be the empty string.
6369 "REGDB_PUBCERT=/dev/null"
6370 "REGDB_PUBKEY=/dev/null"
6371 make-flags))))
6372 ;; We check if the 'regulatory.db' we just built is the same as the
6373 ;; one that got signed by upstream.
6374 (replace 'check
6375 (lambda _
6376 (invoke "openssl" "smime"
6377 "-verify" "-inform" "DER"
6378 "-signer" "wens.x509.pem"
6379 "-in" "regulatory.db.p7s" "-content" "regulatory.db"
6380 "-out" "/dev/null"
6381 "-CAfile" "wens.x509.pem")))
6382 (delete 'configure)) ; no configure script
6383 #:make-flags
6384 #~(list (string-append "PREFIX=" #$output)
6385 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware"))))
6386 (native-inputs (list openssl ; to verify signature
6387 python-wrapper))
6388 (home-page
6389 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
6390 (synopsis "Wireless regulatory database")
6391 (description
6392 "This package contains the wireless regulatory database used by the Linux
6393cfg80211 subsystem and the legacy @acronym{CRDA, Central Regulatory Database
6394Agent}. The database contains information on country-specific regulations for
6395the wireless spectrum.")
6396 (license license:isc)))
6397
6398(define-public lm-sensors
6399 (package
6400 (name "lm-sensors")
6401 (version "3.6.2")
6402 (source
6403 (origin
6404 (method git-fetch)
6405 (uri (git-reference
6406 (url "https://github.com/hramrach/lm-sensors")
6407 (commit (string-append "V" (string-join
6408 (string-split version #\.) "-")))))
6409 (file-name (git-file-name name version))
6410 (sha256
6411 (base32 "0p2ck8p9zb1w53l37pvm6c10vi6r8bfz51nd3sdwwsfhfhgvsr0j"))
6412 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
6413 (build-system gnu-build-system)
6414 (outputs '("lib" ; avoid perl in closure
6415 "out"))
6416 (arguments
6417 (list
6418 #:tests? #f ; no 'check' target
6419 #:make-flags
6420 #~(list (string-append "PREFIX=" #$output)
6421 (string-append "ETCDIR=" #$output:lib "/etc")
6422 (string-append "INCLUDEDIR=" #$output:lib "/include")
6423 (string-append "MANDIR=" #$output "/share/man")
6424 (string-append "LIBDIR=" #$output:lib "/lib"))
6425 #:phases
6426 #~(modify-phases %standard-phases
6427 (delete 'configure)
6428 (add-before 'build 'patch-exec-paths
6429 (lambda* (#:key inputs #:allow-other-keys)
6430 (substitute* "prog/detect/sensors-detect"
6431 (("`uname")
6432 (string-append
6433 "`" (assoc-ref inputs "coreutils") "/bin/uname"))
6434 (("(`|\")modprobe" all open-quote)
6435 (string-append
6436 open-quote #$(this-package-input "kmod") "/bin/modprobe")))
6437 (substitute* '("prog/pwm/pwmconfig" "prog/pwm/fancontrol")
6438 (("gnuplot")
6439 (search-input-file inputs "/bin/gnuplot"))
6440 (("cat ")
6441 (string-append (search-input-file inputs "/bin/cat") " "))
6442 (("e?grep " match)
6443 (string-append
6444 (search-input-file
6445 inputs (string-append "/bin/" (string-trim-right match)))
6446 " "))
6447 (("sed -e")
6448 (string-append (search-input-file inputs "/bin/sed") " -e"))
6449 (("cut -d")
6450 (string-append (search-input-file inputs "/bin/cut") " -d"))
6451 (("sleep ")
6452 (string-append (search-input-file inputs "/bin/sleep") " "))
6453 (("readlink -f")
6454 (string-append
6455 (search-input-file inputs "/bin/readlink") " -f"))))))))
6456 (inputs
6457 (list gnuplot kmod perl rrdtool))
6458 (native-inputs
6459 (list bison flex pkg-config which))
6460 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
6461 (synopsis "Utilities to read temperature/voltage/fan sensors")
6462 (description
6463 "Lm-sensors is a hardware health monitoring package for Linux. It allows
6464you to access information from temperature, voltage, and fan speed sensors.
6465It works with most newer systems.")
6466 (license license:gpl2+)))
6467
6468(define-public iucode-tool
6469 (package
6470 (name "iucode-tool")
6471 (version "2.3.1")
6472 (source (origin
6473 (method url-fetch)
6474 (uri (string-append "https://gitlab.com/iucode-tool/releases"
6475 "/raw/latest/iucode-tool_" version ".tar.xz"))
6476 (sha256
6477 (base32
6478 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
6479 (build-system gnu-build-system)
6480 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
6481 (synopsis "Manipulate Intel microcode bundles")
6482 (description
6483 "@command{iucode_tool} is a utility to work with microcode packages for
6484Intel processors. It can convert between formats, extract specific versions,
6485create a firmware image suitable for the Linux kernel, and more.")
6486 ;; cpuid.h is available for i686, x86_64, and ia64.
6487 (supported-systems '("i686-linux" "x86_64-linux"))
6488 (license license:gpl2+)))
6489
6490(define-public i2c-tools
6491 (package
6492 (name "i2c-tools")
6493 (version "4.3")
6494 (source (origin
6495 (method url-fetch)
6496 (uri (string-append
6497 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
6498 version ".tar.xz"))
6499 (sha256
6500 (base32
6501 "1y0fphjd5ah2j886x8i175r7viq0hmx666hyca0wi4dzrm290qxk"))))
6502 (build-system gnu-build-system)
6503 (arguments
6504 `(#:tests? #f ; no 'check' target
6505 #:make-flags
6506 ,#~(list (string-append "PREFIX=" #$output)
6507 (string-append "LDFLAGS+=-Wl,-rpath=" #$output "/lib")
6508 (string-append "CC=" #$(cc-for-target)))
6509 ;; No configure script.
6510 #:phases (modify-phases %standard-phases (delete 'configure))))
6511 (inputs
6512 (list perl))
6513 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
6514 (synopsis "I2C tools for Linux")
6515 (description
6516 "The i2c-tools package contains a heterogeneous set of I2C tools for
6517Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
6518EEPROM decoding scripts, EEPROM programming tools, and a python module for
6519SMBus access.")
6520 (license license:gpl2+)))
6521
6522(define-public i2c-tools-3
6523 (package
6524 (inherit i2c-tools)
6525 (name "i2c-tools")
6526 (version "3.1.2")
6527 (source (origin
6528 (method url-fetch)
6529 (uri (string-append
6530 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
6531 version ".tar.bz2"))
6532 (sha256
6533 (base32 "0hd4c1w8lnwc3j95h3vpd125170l1d4myspyrlpamqx6wbr6jpnv"))))
6534 (arguments
6535 (substitute-keyword-arguments arguments
6536 ((#:make-flags _)
6537 #~(list (string-append "prefix=" #$output)
6538 (string-append "CC=" #$(cc-for-target))))))))
6539
6540(define-public python-smbus
6541 (package
6542 (inherit i2c-tools)
6543 (name "python-smbus")
6544 (build-system pyproject-build-system)
6545 (arguments
6546 (list #:tests? #f ;; No test suite.
6547 #:phases
6548 #~(modify-phases %standard-phases
6549 (add-after 'unpack 'change-directory
6550 (lambda _ (chdir "py-smbus")))
6551 (add-after 'change-directory 'set-library-path
6552 (lambda _
6553 (substitute* "setup.py"
6554 (("-L\\.\\./lib")
6555 (string-append "-L" #$(this-package-input "i2c-tools")
6556 "/lib"))))))))
6557 (inputs (list i2c-tools))
6558 (native-inputs (list python-setuptools python-wheel))
6559 (synopsis "I2C/SMBus access for Python")
6560 (description "This package provides a Python library to access
6561@acronym{I2C, Inter-Integrated Circuit} and @acronym{SMBus, System
6562Management Bus} devices on Linux.")))
6563
6564(define-public xsensors
6565 (package
6566 (name "xsensors")
6567 (version "0.70")
6568 (source (origin
6569 (method url-fetch)
6570 (uri (string-append
6571 "http://www.linuxhardware.org/xsensors/xsensors-"
6572 version ".tar.gz"))
6573 (sha256
6574 (base32
6575 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
6576 (build-system gnu-build-system)
6577 (arguments
6578 `(#:phases
6579 (modify-phases %standard-phases
6580 (add-before 'configure 'enable-deprecated
6581 (lambda _
6582 (substitute* "src/Makefile.in"
6583 (("-DGDK_DISABLE_DEPRECATED") "")
6584 (("-DGTK_DISABLE_DEPRECATED") ""))))
6585 (add-before 'configure 'remove-Werror
6586 (lambda _
6587 (substitute* '("configure" "src/Makefile.in")
6588 (("-Werror") "")))))))
6589 (inputs (list (list lm-sensors "lib") gtk+-2))
6590 (native-inputs (list pkg-config))
6591 (home-page "http://www.linuxhardware.org/xsensors/")
6592 (synopsis "Hardware health information viewer")
6593 (description
6594 "Xsensors reads data from the libsensors library regarding hardware
6595health such as temperature, voltage and fan speed and displays the information
6596in a digital read-out.")
6597 (license license:gpl2+)))
6598
6599(define-public perf
6600 (package
6601 (name "perf")
6602 (version (package-version linux-libre))
6603 (source (package-source linux-libre))
6604 (build-system gnu-build-system)
6605 (arguments
6606 '(#:phases
6607 (modify-phases %standard-phases
6608 (replace 'configure
6609 (lambda* (#:key inputs #:allow-other-keys)
6610 (setenv "SHELL_PATH" (which "bash"))
6611 (chdir "tools/perf")
6612
6613 ;; In Linux 6.10.6, 'Makefile.config' overrides PKG_CONFIG_PATH
6614 ;; when looking for libtraceevent and thus fails to find it.
6615 ;; Remove that.
6616 (substitute* "Makefile.config"
6617 (("PKG_CONFIG_PATH=[[:graph:]]+")
6618 ""))
6619
6620 ;; This file hard-codes file system layouts for specific distros
6621 ;; but not for ours; address that. With this change, one can run
6622 ;; "perf report --symfs=$HOME/.guix-profile" (without
6623 ;; "/lib/debug") and 'perf' should be able to find separate debug
6624 ;; info files.
6625 (substitute* "util/dso.c"
6626 (("/usr/lib/debug")
6627 "/lib/debug")))))
6628 #:make-flags (list (string-append "prefix="
6629 (assoc-ref %outputs "out"))
6630 "CC=gcc"
6631 "WERROR=0"
6632
6633 ;; By default, 'config/Makefile' uses lib64 on
6634 ;; x86_64. Work around that.
6635 "lib=lib")
6636 #:tests? #f)) ;no tests
6637 (native-inputs
6638 (list pkg-config
6639 bison
6640 flex
6641 ;; For build scripts.
6642 python-3
6643 ;; Documentation
6644 docbook-xsl
6645 xmlto
6646 asciidoc))
6647 (inputs
6648 (list slang ;for the interactive TUI
6649 zlib
6650 ;; newt
6651 python-3 ;'perf' links against libpython
6652 elfutils
6653 libiberty ;used alongside BDF for symbol demangling
6654 libunwind ;better stack walking
6655 libtraceevent
6656 numactl)) ;for 'perf bench numa mem'
6657 (home-page "https://perf.wiki.kernel.org/")
6658 (synopsis "Linux profiling with performance counters")
6659 (description
6660 "perf is a tool suite for profiling using hardware performance counters,
6661with support in the Linux kernel. perf can instrument CPU performance
6662counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
6663of lightweight profiling. This package contains the user-land tools and in
6664particular the @code{perf} command.")
6665 (license (package-license linux-libre))))
6666
6667(define-public pflask
6668 (package
6669 (name "pflask")
6670 (version "0.2")
6671 (source (origin
6672 (method git-fetch)
6673 (uri (git-reference
6674 (url "https://github.com/ghedo/pflask")
6675 (commit (string-append "v" version))))
6676 (file-name (git-file-name name version))
6677 (sha256
6678 (base32
6679 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
6680 (build-system cmake-build-system)
6681 (arguments
6682 '(#:tests? #f)) ; no tests
6683 (home-page "https://ghedo.github.io/pflask/")
6684 (synopsis "Simple tool for creating Linux namespace containers")
6685 (description "pflask is a simple tool for creating Linux namespace
6686containers. It can be used for running a command or even booting an OS inside
6687an isolated container, created with the help of Linux namespaces. It is
6688similar in functionality to chroot, although pflask provides better isolation
6689thanks to the use of namespaces.")
6690 (license license:bsd-2)))
6691
6692(define-public singularity
6693 (package
6694 (name "singularity")
6695 (version "2.6.1")
6696 (source (origin
6697 (method url-fetch)
6698 (uri (string-append "https://github.com/singularityware/singularity/"
6699 "releases/download/" version
6700 "/singularity-" version ".tar.gz"))
6701 (sha256
6702 (base32
6703 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
6704 (modules '((guix build utils)))
6705 (snippet
6706 '(begin
6707 ;; Do not create directories in /var.
6708 (substitute* "Makefile.in"
6709 (("\\$\\(MAKE\\) .*install-data-hook") ""))
6710
6711 ;; The original source overrides PATH so that it points to
6712 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
6713 ;; on Guix System. Leave PATH unchanged so we refer to the
6714 ;; installed Coreutils, grep, etc.
6715 (substitute* "bin/singularity.in"
6716 (("^PATH=.*" all)
6717 (string-append "#" all "\n")))
6718
6719 (substitute* (find-files "libexec/cli" "\\.exec$")
6720 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
6721 _ program)
6722 (string-append "/run/privileged/bin/singularity-"
6723 program "-helper")))
6724
6725 ;; These squashfs mount options are apparently no longer
6726 ;; supported since Linux-libre 5.4.5.
6727 (substitute* "src/lib/image/squashfs/mount.c"
6728 (("\"errors=remount-ro\"")
6729 "NULL"))))))
6730 (build-system gnu-build-system)
6731 (arguments
6732 (list
6733 #:configure-flags #~(list "--localstatedir=/var")
6734 #:phases
6735 #~(modify-phases %standard-phases
6736 (add-after 'unpack 'patch-references
6737 (lambda _
6738 (substitute* "libexec/cli/build.exec.in"
6739 (("-mksquashfs") (string-append "-" (which "mksquashfs"))))
6740 (substitute* (append
6741 (find-files "libexec" "functions")
6742 (find-files "libexec/bootstrap-scripts" ".*sh$")
6743 (find-files "libexec/cli" ".*exec$"))
6744 (("\\| grep ")
6745 (string-append "| " (which "grep") " "))
6746 (("egrep ")
6747 (string-append (which "egrep") " "))
6748 ((" sed ")
6749 (string-append " " (which "sed") " ")))))
6750 (add-after 'install 'set-PATH
6751 (lambda _
6752 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
6753 ;; But don't override PATH, so that other tools like zcat and
6754 ;; tar can still be found if they are available.
6755 (let ((coreutils #$(this-package-input "coreutils")))
6756 (wrap-program (string-append #$output "/bin/singularity")
6757 `("PATH" prefix (,(string-append coreutils "/bin"))))
6758 (substitute* (string-append #$output "/bin/run-singularity")
6759 (("/usr/bin/env singularity")
6760 (string-append (which "env") " "
6761 #$output "/bin/singularity")))))))))
6762 (inputs
6763 (list bash-minimal
6764 coreutils
6765 libarchive
6766 python-wrapper
6767 squashfs-tools
6768 zlib))
6769 (home-page "https://singularity.lbl.gov/")
6770 (synopsis "Container platform")
6771 (description "Singularity is a container platform supporting a number of
6772container image formats. It can build SquashFS container images or import
6773existing Docker images. Singularity requires kernel support for container
6774isolation or root privileges.")
6775 (license license:bsd-3)))
6776
6777(define-public python-spython
6778 (package
6779 (name "python-spython")
6780 (version "0.3.13")
6781 (source
6782 (origin
6783 (method url-fetch)
6784 (uri (pypi-uri "spython" version))
6785 (sha256
6786 (base32 "0kly851k6mj7xzcybciav5d0pq5q04pzg7c5a1g712bqbxkha4ck"))))
6787 (build-system pyproject-build-system)
6788 (arguments
6789 (list
6790 #:phases
6791 #~(modify-phases %standard-phases
6792 ;; Configure absolute path to singularity.
6793 (add-after 'unpack 'configure
6794 (lambda* (#:key inputs #:allow-other-keys)
6795 (let ((singularity (search-input-file inputs "bin/singularity")))
6796 (substitute* "spython/utils/terminal.py"
6797 (("software=\"singularity\"")
6798 (string-append "software=\"" singularity "\"")))
6799 (substitute* (list "spython/utils/terminal.py"
6800 "spython/main/help.py"
6801 "spython/main/base/command.py")
6802 (("\\[\"singularity\"")
6803 (string-append "[\"" singularity "\"")))
6804 (substitute* "spython/main/execute.py"
6805 (("shutil.which\\(\"singularity\"\\)")
6806 (string-append "shutil.which(\"" singularity "\")"))))))
6807 ;; Skip tests that require network access.
6808 (add-before 'check 'skip-tests
6809 (lambda _
6810 (delete-file "spython/tests/test_client.py"))))))
6811 (inputs
6812 (list singularity))
6813 (native-inputs
6814 (list python-pytest python-setuptools python-wheel))
6815 (home-page "https://github.com/singularityhub/singularity-cli")
6816 (synopsis "Singularity Python client")
6817 (description "@code{python-spython} is a Python library to interact with
6818Singularity containers.")
6819 (license license:mpl2.0)))
6820
6821(define-public libnvme
6822 (package
6823 (name "libnvme")
6824 (version "1.16.2")
6825 (source (origin
6826 (method git-fetch)
6827 (uri (git-reference
6828 (url "https://github.com/linux-nvme/libnvme.git")
6829 (commit (string-append "v" version))))
6830 (sha256
6831 (base32 "05h1kjs8lgdmfsdz5vcfl470zhw7j36jp7a9wip20ibb6g3s9r1k"))
6832 (file-name (git-file-name name version))))
6833 (build-system meson-build-system)
6834 (outputs (list "out" "doc")) ; docs are 80% of all output
6835 (arguments
6836 (list
6837 #:configure-flags
6838 #~(let ((doc (string-append #$output:doc "/share/doc/" #$name)))
6839 (list (string-append "-Dhtmldir=" doc "/html")
6840 (string-append "-Drstdir=" doc "/rst")
6841 "-Ddocs-build=true" "-Ddocs=all"))))
6842 (native-inputs (list pkg-config perl python python-sphinx))
6843 ;; libnvme.pc, libnvme-mi.pc lists these in Requires.private.
6844 (propagated-inputs (list dbus json-c openssl))
6845 (home-page "https://github.com/linux-nvme/libnvme")
6846 (synopsis "C Library for NVM Express on Linux")
6847 (description "libnvme provides type definitions for NVMe specification
6848structures, enumerations, and bit fields, helper functions to construct,
6849dispatch, and decode commands and payloads, and utilities to connect, scan,
6850and manage nvme devices on a Linux system.")
6851 (license license:lgpl2.1+)))
6852
6853(define-public nvme-cli
6854 (package
6855 (name "nvme-cli")
6856 (version "2.16")
6857 (home-page "https://github.com/linux-nvme/nvme-cli")
6858 (source (origin
6859 (method git-fetch)
6860 (uri (git-reference
6861 (url home-page)
6862 (commit (string-append "v" version))))
6863 (sha256
6864 (base32 "1877fvhd4573900zwk7y2mk2vvmgnws2wa37sv176ikxj647jvw1"))
6865 (file-name (git-file-name name version))))
6866 (build-system meson-build-system)
6867 (outputs (list "out" "doc")) ; docs make up ~70% of total size
6868 (arguments
6869 (list
6870 #:configure-flags #~(list (format #f "-Dhtmldir=~a/share/doc/~a/html"
6871 #$output:doc #$name)
6872 "-Ddocs=all")))
6873 (native-inputs (list pkg-config))
6874 (inputs (list libnvme json-c zlib))
6875 (synopsis "NVM-Express user space tooling for Linux")
6876 (description "Nvme-cli is a utility to provide standards compliant tooling
6877for NVM-Express drives. It was made specifically for Linux as it relies on the
6878IOCTLs defined by the mainline kernel driver.")
6879 (license license:gpl2+)))
6880
6881(define-public acpi
6882 (package
6883 (name "acpi")
6884 (version "1.7")
6885 (source (origin
6886 (method url-fetch)
6887 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
6888 version "/" name "-" version ".tar.gz"))
6889 (sha256
6890 (base32
6891 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
6892 (build-system gnu-build-system)
6893 (home-page "http://acpiclient.sourceforge.net")
6894 (synopsis "Display information on ACPI devices")
6895 (description "@code{acpi} attempts to replicate the functionality of the
6896\"old\" @code{apm} command on ACPI systems, including battery and thermal
6897information. It does not support ACPI suspending, only displays information
6898about ACPI devices.")
6899 (license license:gpl2+)))
6900
6901(define-public acpid
6902 (package
6903 (name "acpid")
6904 (version "2.0.34")
6905 (source (origin
6906 (method url-fetch)
6907 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
6908 version ".tar.xz"))
6909 (sha256
6910 (base32
6911 "0cxkdbd087kj9ikprvvjpk0ixzqbipf2rmj6qyp7r15wzj65q29d"))))
6912 (build-system gnu-build-system)
6913 (home-page "https://sourceforge.net/projects/acpid2/")
6914 (synopsis "Daemon for delivering ACPI events to user-space programs")
6915 (description
6916 "acpid is designed to notify user-space programs of Advanced
6917Configuration and Power Interface (ACPI) events. acpid should be started
6918during the system boot, and will run as a background process. When an ACPI
6919event is received from the kernel, acpid will examine the list of rules
6920specified in /etc/acpi/events and execute the rules that match the event.")
6921 (license license:gpl2+)))
6922
6923(define-public sysfsutils
6924 (package
6925 (name "sysfsutils")
6926 (version "2.1.0")
6927 (source
6928 (origin
6929 (method url-fetch)
6930 (uri
6931 (string-append
6932 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
6933 version ".tar.gz"))
6934 (sha256
6935 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
6936 (build-system gnu-build-system)
6937 (home-page "https://linux-diag.sourceforge.net/Sysfsutils.html")
6938 (synopsis "System utilities based on Linux sysfs")
6939 (description
6940 "These are a set of utilities built upon sysfs, a virtual file system in
6941Linux kernel versions 2.5+ that exposes a system's device tree. The package
6942also contains the libsysfs library.")
6943 ;; The library is under lgpl2.1+ (all files say "or any later version").
6944 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
6945 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
6946
6947(define-public cpufrequtils
6948 (let ((commit "a2f0c39d5f21596bb9f5223e895c0ff210b265d0")
6949 (revision "1"))
6950 (package
6951 (name "cpufrequtils")
6952 (version (git-version "008" revision commit))
6953 (source
6954 (origin
6955 (method git-fetch)
6956 (uri
6957 (git-reference
6958 (url "https://git.kernel.org/pub/scm/linux/kernel/git/brodo/cpufrequtils.git")
6959 (commit commit)))
6960 (file-name (git-file-name name version))
6961 (sha256
6962 (base32 "01n2hp6v89cilqqvqvlcprphyhnljsjclh4h1zf3b1l7ypz29lbp"))))
6963 (build-system gnu-build-system)
6964 (arguments
6965 (list
6966 #:tests? #f ;no test suite
6967 #:make-flags
6968 #~(let ((out #$output))
6969 (list "PROC=false" ;obsoleted by sysfs in Linux 2.6(!)
6970 (string-append "CC=" #$(cc-for-target))
6971 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
6972 "INSTALL=install"
6973 (string-append "bindir=" out "/bin")
6974 (string-append "sbindir=" out "/sbin")
6975 (string-append "mandir=" out "/share/man")
6976 (string-append "includedir=" out "/include")
6977 (string-append "libdir=" out "/lib")
6978 (string-append "localedir=" out "/share/locale")
6979 (string-append "docdir=" out "/share/doc/" #$name)))
6980 #:phases
6981 #~(modify-phases %standard-phases
6982 (delete 'configure)))) ;no configure script
6983 (native-inputs (list gettext-minimal))
6984 (home-page
6985 "http://ftp.be.debian.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html")
6986 (synopsis "Utilities to get and set CPU frequency on Linux")
6987 (description
6988 "The cpufrequtils suite contains utilities to retrieve CPU frequency
6989information, and set the CPU frequency if supported, using the cpufreq
6990capabilities of the Linux kernel.")
6991 (license license:gpl2))))
6992
6993(define-public libite
6994 (package
6995 (name "libite")
6996 (version "2.5.2")
6997 (source
6998 (origin
6999 (method git-fetch)
7000 (uri (git-reference
7001 (url "https://github.com/troglobit/libite")
7002 (commit (string-append "v" version))))
7003 (file-name (git-file-name name version))
7004 (sha256
7005 (base32 "0i27ppb557kdc1hm7nf0f5r7sxvqma31pr57h79whl6qcp28gy4a"))))
7006 (build-system gnu-build-system)
7007 (arguments
7008 `(#:configure-flags
7009 (list "--disable-static")
7010 #:phases
7011 (modify-phases %standard-phases
7012 (add-after 'unpack 'fix-tests
7013 (lambda* (#:key inputs #:allow-other-keys)
7014 ;; replace paths to the executables
7015 (substitute* "test/which.c"
7016 (("/usr/bin/which")
7017 (search-input-file inputs "/bin/which"))
7018 (("ls\"")
7019 (string-append
7020 (search-input-file inputs "/bin/ls") "\"")))
7021 ;; create pidfile in /tmp instead of /var
7022 (substitute* "test/pidfile.c" (("/var/tmp") "/tmp")))))))
7023 (native-inputs (list autoconf automake libtool which))
7024 (synopsis "Library providing missing pieces in GNU libc")
7025 (description "This package provides many of the missing pieces in GNU
7026libc. Most notably the string functions: strlcpy(3), strlcat(3) and the *BSD
7027sys/queue.h and sys/tree.h API's.")
7028 (home-page "https://troglobit.com/projects/libite/")
7029 (license license:expat)))
7030
7031(define-public libuev
7032 (package
7033 (name "libuev")
7034 (version "2.4.0")
7035 (source
7036 (origin
7037 (method git-fetch)
7038 (uri (git-reference
7039 (url "https://github.com/troglobit/libuev")
7040 (commit (string-append "v" version))))
7041 (file-name (git-file-name name version))
7042 (sha256
7043 (base32
7044 "0ih82lxfdcq179kknzdl5c8vi1l0n5j7yh68y8f6kwsrm457paf7"))))
7045 (build-system gnu-build-system)
7046 (native-inputs (list autoconf automake libtool))
7047 (synopsis "Lightweight event loop library for epoll family APIs")
7048 (description "This package provides small event loop that wraps the
7049epoll family of APIs.")
7050 (home-page "https://troglobit.com/projects/libuev/")
7051 (license license:expat)))
7052
7053(define-public libraw1394
7054 (package
7055 (name "libraw1394")
7056 (version "2.1.2")
7057 (source (origin
7058 (method url-fetch)
7059 (uri (string-append
7060 "mirror://kernel.org/linux/libs/ieee1394/"
7061 name "-" version ".tar.xz"))
7062 (sha256
7063 (base32
7064 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
7065 (build-system gnu-build-system)
7066 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
7067 (synopsis "Interface library for the Linux IEEE1394 drivers")
7068 (description
7069 "Libraw1394 is the only supported interface to the kernel side raw1394 of
7070the Linux IEEE-1394 subsystem, which provides direct access to the connected
70711394 buses to user space. Through libraw1394/raw1394, applications can directly
7072send to and receive from other nodes without requiring a kernel driver for the
7073protocol in question.")
7074 (license license:lgpl2.1+)))
7075
7076(define-public libavc1394
7077 (package
7078 (name "libavc1394")
7079 (version "0.5.4")
7080 (source (origin
7081 (method url-fetch)
7082 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
7083 name "-" version ".tar.gz"))
7084 (sha256
7085 (base32
7086 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
7087 (build-system gnu-build-system)
7088 (native-inputs
7089 (list pkg-config))
7090 (propagated-inputs
7091 (list libraw1394)) ; required by libavc1394.pc
7092 (home-page "https://sourceforge.net/projects/libavc1394/")
7093 (synopsis "AV/C protocol library for IEEE 1394")
7094 (description
7095 "Libavc1394 is a programming interface to the AV/C specification from
7096the 1394 Trade Association. AV/C stands for Audio/Video Control.")
7097 (license license:lgpl2.1+)))
7098
7099(define-public libiec61883
7100 (package
7101 (name "libiec61883")
7102 (version "1.2.0")
7103 (source (origin
7104 (method url-fetch)
7105 (uri (string-append
7106 "mirror://kernel.org/linux/libs/ieee1394/"
7107 name "-" version ".tar.xz"))
7108 (sha256
7109 (base32
7110 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
7111 (build-system gnu-build-system)
7112 (native-inputs
7113 (list pkg-config))
7114 (propagated-inputs
7115 (list libraw1394)) ; required by libiec61883.pc
7116 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
7117 (synopsis "Isochronous streaming media library for IEEE 1394")
7118 (description
7119 "The libiec61883 library provides a higher level API for streaming DV,
7120MPEG-2 and audio over Linux IEEE 1394.")
7121 (license license:lgpl2.1+)))
7122
7123(define-public mdadm
7124 (package
7125 (name "mdadm")
7126 (version "4.2")
7127 (source (origin
7128 (method url-fetch)
7129 (uri (string-append
7130 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
7131 version ".tar.xz"))
7132 (sha256
7133 (base32
7134 "07ghmibmbnkdy91ng87zdllzicm299l20dhs9m5bfjw6f1b22726"))))
7135 (build-system gnu-build-system)
7136 (arguments
7137 (list #:make-flags
7138 #~(list (string-append "CC=" #$(cc-for-target))
7139 "INSTALL=install"
7140 "CHECK_RUN_DIR=0"
7141 ;; TODO: tell it where to find 'sendmail'
7142 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
7143 (string-append "BINDIR=" #$output "/sbin")
7144 (string-append "MANDIR=" #$output "/share/man")
7145 (string-append "UDEVDIR=" #$output "/lib/udev"))
7146 #:phases
7147 #~(modify-phases %standard-phases
7148 (add-before 'build 'patch-program-paths
7149 (lambda* (#:key native-inputs inputs #:allow-other-keys)
7150 (let ((coreutils (assoc-ref (or native-inputs inputs)
7151 "coreutils")))
7152 (substitute* "udev-md-raid-arrays.rules"
7153 (("/usr/bin/(readlink|basename)" all program)
7154 (string-append coreutils "/bin/" program))))))
7155 (add-before 'build 'remove-W-error
7156 (lambda _
7157 ;; We cannot build with -Werror on i686 due to a
7158 ;; 'sign-compare' warning in util.c.
7159 (substitute* "Makefile"
7160 (("-Werror") ""))))
7161 (delete 'configure))
7162 ;; Tests must be run as root.
7163 #:tests? #f))
7164 (inputs
7165 (list eudev))
7166 (supported-systems (remove target-hurd? %supported-systems))
7167 (home-page "http://neil.brown.name/blog/mdadm")
7168 (synopsis "Tool for managing Linux Software RAID arrays")
7169 (description
7170 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
7171assemble, report on, and monitor arrays. It can also move spares between raid
7172arrays when needed.")
7173 (license license:gpl2+)))
7174
7175(define-public mdadm-static
7176 (package
7177 (inherit mdadm)
7178 (name "mdadm-static")
7179 (arguments
7180 (substitute-keyword-arguments arguments
7181 ((#:make-flags flags)
7182 #~(cons* "LDFLAGS = -static"
7183 "CXFLAGS = -DNO_LIBUDEV"
7184 #$flags))
7185 ((#:phases phases)
7186 #~(modify-phases #$phases
7187 (add-after 'install 'remove-cruft
7188 (lambda* (#:key outputs #:allow-other-keys)
7189 (let* ((out (assoc-ref outputs "out"))
7190 (precious? (lambda (file)
7191 (member file '("." ".." "sbin"))))
7192 (directories (scandir out (negate precious?))))
7193 (with-directory-excursion out
7194 (for-each delete-file-recursively directories)
7195 (remove-store-references "sbin/mdadm")
7196 (delete-file "sbin/mdmon")))))))
7197 ((#:modules modules %default-gnu-modules)
7198 `((ice-9 ftw) ,@modules))
7199 ((#:strip-flags _ '())
7200 ''("--strip-all")) ;strip a few extra KiB
7201 ((#:allowed-references _ '("out"))
7202 '("out")))) ;refer only self
7203 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
7204
7205(define-public multipath-tools
7206 (package
7207 (name "multipath-tools")
7208 (version "0.11.0")
7209 (home-page "https://github.com/opensvc/multipath-tools")
7210 (source (origin
7211 (method git-fetch)
7212 (uri (git-reference (url home-page) (commit version)))
7213 (file-name (git-file-name name version))
7214 (sha256
7215 (base32
7216 "1yl2cd4xgw2l5xzx5dbdf7awhrvfbjsrspli9i6bmxc5j4jkvazr"))
7217 (modules '((guix build utils)))
7218 (snippet
7219 '(begin
7220 ;; Drop bundled valgrind headers.
7221 (delete-file-recursively "third-party")
7222 (substitute* '("multipathd/main.c"
7223 "libmpathutil/debug.c")
7224 (("#include \"../third-party/")
7225 "#include \""))))))
7226 (build-system gnu-build-system)
7227 (arguments
7228 (list
7229 #:test-target "test"
7230 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
7231 (string-append "prefix=" #$output)
7232 ;; Install Udev rules below this directory, relative
7233 ;; to the prefix.
7234 (string-append "systemd_prefix=" #$output))
7235 #:phases
7236 #~(modify-phases %standard-phases
7237 (add-after 'unpack 'patch-source
7238 (lambda* (#:key inputs #:allow-other-keys)
7239 (let ((libdevmapper.h
7240 (search-input-file inputs "include/libdevmapper.h"))
7241 (libudev.h
7242 (search-input-file inputs "include/libudev.h")))
7243 (substitute* "Makefile.inc"
7244 (("/bin/echo") "echo")
7245 (("\\$\\(prefix\\)/usr") "$(prefix)")
7246 (("configdir.*:= \\$\\(prefix\\)/etc/multipath/conf.d")
7247 "configdir := /etc/multipath/conf.d")
7248 ;; Do not save timestamp to avoid gzip "timestamp
7249 ;; out-of-range" warnings.
7250 (("gzip -9") "gzip -9n"))
7251 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
7252 (("/usr/include/libdevmapper.h") libdevmapper.h)
7253 (("/usr/include/libudev.h") libudev.h)))))
7254 (add-after 'unpack 'skip-failing-tests
7255 (lambda _
7256 ;; This test and the module's setup() test an arbitrary block
7257 ;; device node name, but the build environment has none.
7258 (substitute* "tests/devt.c"
7259 (("return get_one_devt.*") "return 0;\n")
7260 (("cmocka_unit_test\\(test_devt2devname_devt_good\\),") ""))
7261 ;; The above triggers -Werror=unused-function. Ignore it.
7262 (substitute* "tests/Makefile"
7263 (("CFLAGS \\+= " match)
7264 (string-append match "-Wno-error=unused-function ")))))
7265 (delete 'configure) ;no configure script
7266 (add-before 'build 'no-fortify-3
7267 (lambda _
7268 ;; NOTE: The check made seems to wrongly assume the
7269 ;; FORTIFY_SOURCE=3 is valid. However, when compiling, warnings
7270 ;; are emitted from glibc, resulting in failed build. Fix this
7271 ;; by forcing the usage of FORTIFY_SOURCE=2.
7272 (substitute* "create-config.mk"
7273 (("FORTIFY_SOURCE=3")
7274 "FORTIFY_SOURCE=2"))))
7275 (add-before 'build 'set-LDFLAGS
7276 (lambda _
7277 ;; Note: this cannot be passed as a make flag because that will
7278 ;; override the build system LDFLAGS.
7279 (setenv "LDFLAGS"
7280 (string-append "-Wl,-rpath=" #$output "/lib")))))))
7281
7282 (native-inputs
7283 (list perl pkg-config valgrind/pinned
7284 ;; For tests.
7285 cmocka))
7286 (inputs
7287 (list json-c
7288 libaio
7289 liburcu
7290 lvm2
7291 readline
7292 eudev
7293 ;; For libmount.
7294 `(,util-linux "lib")))
7295 (synopsis "Access block devices through multiple paths")
7296 (description
7297 "This package provides the following binaries to drive the
7298Linux Device Mapper multipathing driver:
7299@enumerate
7300@item @command{multipath} - Device mapper target autoconfig.
7301@item @command{multipathd} - Multipath daemon.
7302@item @command{mpathpersist} - Manages SCSI persistent reservations on
7303@code{dm} multipath devices.
7304@item @command{kpartx} - Create device maps from partition tables.
7305@end enumerate")
7306 (license (list license:gpl2+ ;main distribution
7307 license:lgpl2.0+)))) ;libmpathcmd/mpath_cmd.h
7308
7309(define-public libaio
7310 (package
7311 (name "libaio")
7312 (version "0.3.113")
7313 (source (origin
7314 (method url-fetch)
7315 (uri (list
7316 (string-append "https://releases.pagure.org/libaio/"
7317 name "-" version ".tar.gz")))
7318 (sha256
7319 (base32
7320 "02r0g2vfv6kfljplm3ga93w4xw13q2wixbn9hwi7ahqdzp2x2i1c"))
7321 (patches (search-patches "libaio-32bit-test.patch"))))
7322 (build-system gnu-build-system)
7323 (arguments
7324 (list #:make-flags
7325 #~(list (string-append "prefix=" #$output)
7326 (string-append "CC=" #$(cc-for-target)))
7327 #:test-target "partcheck" ; need root for a full 'check'
7328 #:phases
7329 #~(modify-phases %standard-phases
7330 (add-after 'unpack 'disable-problematic-tests
7331 (lambda _
7332 (with-directory-excursion "harness/cases"
7333 ;; The 21.t test fails with "Expected 4096, got
7334 ;; 18446744073709551605" (see:
7335 ;; https://pagure.io/libaio/issue/26).
7336 (rename-file "21.t" "21.t.disabled"))))
7337 (delete 'configure) ; no configure script
7338 #$@(if (target-riscv64?)
7339 #~((add-after 'unpack 'patch-test
7340 (lambda* (#:key build-inputs #:allow-other-keys)
7341 (invoke "patch" "-p1" "-i"
7342 #$(local-file
7343 (search-patch
7344 "libaio-riscv-test5.patch"))))))
7345 #~()))))
7346 (native-inputs
7347 (if (target-riscv64?)
7348 (list (search-patch "libaio-riscv-test5.patch")
7349 patch)
7350 '()))
7351 (home-page "https://pagure.io/libaio")
7352 (synopsis "Linux-native asynchronous I/O access library")
7353 (description
7354 "This library enables userspace to use Linux kernel asynchronous I/O
7355system calls, important for the performance of databases and other advanced
7356applications.")
7357 (license license:lgpl2.1+)))
7358
7359(define-public blktrace
7360 ;; Take a newer commit to get the latest patches.
7361 (let ((commit "b9ea6e507e8849f01d06aa48c0c59c5cee4820be")
7362 (revision "1"))
7363 (package
7364 (name "blktrace")
7365 (version (git-version "1.3.0" revision commit))
7366 (home-page
7367 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
7368 (source (origin
7369 (method git-fetch)
7370 (uri (git-reference
7371 (url home-page)
7372 (commit commit)))
7373 (sha256
7374 (base32 "0a4830mlqckbhchar1xcn2w4f24bzb75bigdig5wpm2axl0zc8cq"))
7375 (file-name (git-file-name name version))))
7376 (build-system gnu-build-system)
7377 (arguments
7378 (list
7379 #:make-flags
7380 #~(list (string-append "CC=" #$(cc-for-target))
7381 (string-append "prefix=" #$output))
7382 #:tests? #f ; no tests
7383 #:phases
7384 #~(modify-phases %standard-phases
7385 (delete 'configure) ; no configure script
7386 (add-after 'unpack 'fix-gnuplot-path
7387 (lambda* (#:key inputs #:allow-other-keys)
7388 (substitute* "btt/bno_plot.py"
7389 (("gnuplot %s")
7390 (string-append
7391 (search-input-file inputs "/bin/gnuplot" ) " %s"))))))))
7392 (inputs
7393 (list libaio
7394 gnuplot
7395 python-wrapper)) ; for 'bno_plot.py'
7396 (synopsis "Block layer IO tracing mechanism")
7397 (description "Blktrace is a block layer IO tracing mechanism which provides
7398detailed information about request queue operations to user space. It extracts
7399event traces from the kernel (via the relaying through the debug file system).")
7400 (license license:gpl2))))
7401
7402(define-public sbc
7403 (package
7404 (name "sbc")
7405 (version "2.2")
7406 (source
7407 (origin
7408 (method url-fetch)
7409 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-" version
7410 ".tar.xz"))
7411 (sha256
7412 (base32 "17mfhc9rn25vrqgfpihpjjc8syp3r56paqyhzg1gjnjyydpagbd1"))))
7413 (build-system gnu-build-system)
7414 (arguments
7415 (list
7416 #:configure-flags
7417 #~(list "--disable-tester")))
7418 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
7419 (synopsis "Bluetooth subband audio codec")
7420 (description
7421 "The SBC is a digital audio encoder and decoder used to transfer data to
7422Bluetooth audio output devices like headphones or loudspeakers.")
7423 (license license:gpl2+)))
7424
7425(define-public sbctester
7426 (package
7427 (inherit sbc)
7428 (name "sbctester")
7429 (arguments
7430 (list
7431 #:phases
7432 #~(modify-phases %standard-phases
7433 (add-after 'unpack 'write-build-files
7434 (lambda _
7435 (begin
7436 (for-each delete-file
7437 (list "Makefile.in" "aclocal.m4" "configure"
7438 "config.h.in"))
7439 (delete-file-recursively "build-aux")
7440 (with-output-to-file "configure.ac"
7441 (lambda _
7442 (format #t
7443 "AC_PREREQ([2.69])
7444 AC_INIT([sbctester], [~a])
7445 AC_CONFIG_HEADERS(config.h)
7446 AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
7447 COMPILER_FLAGS
7448 AC_LANG([C])
7449 AC_PROG_CC
7450 AC_PROG_CC_PIE
7451 AC_PROG_INSTALL
7452 AC_PROG_LIBTOOL
7453 PKG_CHECK_MODULES(SNDFILE, sndfile, dummy=yes,
7454 AC_MSG_ERROR(sndfile library is required))
7455 AC_SUBST(SNDFILE_LIBS)
7456 AC_CONFIG_FILES([Makefile])
7457 AC_OUTPUT
7458 AC_MSG_RESULT([$PACKAGE_NAME $VERSION])
7459 ~%"
7460 #$(package-version sbc))))
7461 (with-output-to-file "Makefile.am"
7462 (lambda _
7463 (format #t
7464 "bin_PROGRAMS = src/sbctester
7465 src_sbctester_SOURCES = src/sbctester.c
7466 src_sbctester_LDADD = @SNDFILE_LIBS@ -lm")))))))))
7467 (inputs (list libsndfile))
7468 (native-inputs (list autoconf automake libtool pkg-config))
7469 (synopsis "Test utility for the sbc codec")
7470 (description
7471 "Utility to detect differences between two audio files, encoded with
7472SBC.")))
7473
7474(define-public bluez
7475 (package
7476 (name "bluez")
7477 (version "5.79")
7478 (source (origin
7479 (method url-fetch)
7480 (uri (string-append
7481 "mirror://kernel.org/linux/bluetooth/bluez-"
7482 version ".tar.xz"))
7483 (sha256
7484 (base32
7485 "12pal1m4xlr8k7kxb6isv5lbaca2wc5zcgy0907wfwcz78qaar21"))))
7486 (build-system gnu-build-system)
7487 (arguments
7488 (list
7489 #:configure-flags
7490 #~(list "--sysconfdir=/etc"
7491 "--localstatedir=/var"
7492 "--enable-library"
7493 "--enable-wiimote"
7494 "--disable-systemd"
7495 ;; TODO: is this needed? Not installed by default since 5.55.
7496 "--enable-hid2hci"
7497 ;; Install dbus/udev files to the correct location.
7498 (string-append "--with-dbusconfdir=" #$output "/etc")
7499 (string-append "--with-udevdir=" #$output "/lib/udev"))
7500 #:phases
7501 #~(modify-phases %standard-phases
7502 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
7503 ;; issue (discussion on upstream mailing list:
7504 ;; https://marc.info/?t=149578476300002&r=1&w=2)
7505 (add-before 'check 'skip-wonky-test
7506 (lambda _
7507 (substitute* "unit/test-gatt.c"
7508 (("tester_init\\(&argc, &argv\\);") "return 77;"))))
7509 (replace 'install
7510 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
7511 ;; Override the sysconfdir and localstatedir locations only for
7512 ;; the installation phase. Otherwise, the installation fails when
7513 ;; it tries to write to /etc/bluetooth and /var.
7514 (define make-flags*
7515 (append make-flags (list (string-append "sysconfdir="
7516 #$output "/etc")
7517 (string-append "localstatedir="
7518 #$output "/var"))))
7519 (apply (assoc-ref %standard-phases 'install)
7520 (append args (list #:make-flags make-flags*)))))
7521 (add-after 'install 'post-install
7522 (lambda* (#:key inputs outputs #:allow-other-keys)
7523 (let* ((servicedir (string-append #$output
7524 "/share/dbus-1/services"))
7525 (service "obexd/src/org.bluez.obex.service")
7526 (rule (string-append
7527 #$output "/lib/udev/rules.d/97-hid2hci.rules")))
7528 ;; Install the obex dbus service file.
7529 (substitute* service
7530 (("/bin/false")
7531 (string-append #$output "/libexec/bluetooth/obexd")))
7532 (install-file service servicedir)
7533 ;; Fix paths in the udev rule.
7534 (substitute* rule
7535 (("hid2hci --method")
7536 (string-append #$output "/lib/udev/hid2hci --method"))
7537 (("/sbin/udevadm")
7538 (search-input-file inputs "/bin/udevadm")))))))))
7539 (native-inputs
7540 (list gettext-minimal
7541 pkg-config
7542 python
7543 python-docutils
7544 python-pygments))
7545 (inputs
7546 (list glib dbus eudev libical readline))
7547 (home-page "https://www.bluez.org/")
7548 (synopsis "Linux Bluetooth protocol stack")
7549 (description
7550 "BlueZ provides support for the core Bluetooth layers and protocols. It
7551is flexible, efficient and uses a modular implementation.")
7552 (license license:gpl2+)))
7553
7554(define-public fuse-exfat
7555 (package
7556 (name "fuse-exfat")
7557 (version "1.4.0")
7558 (source (origin
7559 (method url-fetch)
7560 (uri (string-append
7561 "https://github.com/relan/exfat/releases/download/v"
7562 version "/" name "-" version ".tar.gz"))
7563 (sha256
7564 (base32
7565 "07h0ngnydfy8n8h9ni3jn8zlmcj4pzqa0nk0hk0i4yhfbv2yvkx1"))))
7566 (build-system gnu-build-system)
7567 (native-inputs
7568 (list pkg-config))
7569 (inputs
7570 (list fuse-2))
7571 (home-page "https://github.com/relan/exfat")
7572 (synopsis "Mount exFAT file systems")
7573 (description
7574 "This package provides a FUSE-based file system that provides read and
7575write access to exFAT devices.")
7576 (license license:gpl2+)))
7577
7578(define-public gpm
7579 (package
7580 (name "gpm")
7581 (version "1.20.7")
7582 (source (origin
7583 (method url-fetch)
7584 (uri (string-append
7585 "https://www.nico.schottelius.org/software/gpm/archives/"
7586 "gpm-" version ".tar.bz2"))
7587 (patches (search-patches "gpm-glibc-2.26.patch"))
7588 (sha256
7589 (base32
7590 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))
7591 (modules '((guix build utils)))
7592 (snippet
7593 '(begin
7594 ;; Take a patch from upstream to fix building with -fno-common,
7595 ;; which is default in GCC 10:
7596 ;; https://github.com/telmich/gpm/pull/37
7597 (substitute* "src/headers/daemon.h"
7598 (("^time_t[[:blank:]]+last_selection_time;")
7599 "extern time_t last_selection_time;"))))))
7600 (build-system gnu-build-system)
7601 (arguments
7602 '(#:phases (modify-phases %standard-phases
7603 (replace 'bootstrap
7604 (lambda _
7605 ;; The tarball was not generated with 'make dist' so we
7606 ;; need to bootstrap things ourselves.
7607 (substitute* "autogen.sh"
7608 (("/bin/sh") (which "sh")))
7609 (invoke "./autogen.sh")
7610 (patch-makefile-SHELL "Makefile.include.in")
7611 #t)))
7612
7613 ;; Make sure programs find libgpm.so.
7614 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
7615 (assoc-ref %outputs "out")
7616 "/lib"))))
7617 (native-inputs
7618 (list texinfo
7619 bison
7620 flex
7621 autoconf
7622 automake
7623 libtool))
7624 (supported-systems (remove target-hurd? %supported-systems))
7625 (home-page "https://www.nico.schottelius.org/software/gpm/")
7626 (synopsis "Mouse support for the Linux console")
7627 (description
7628 "The GPM (general-purpose mouse) daemon is a mouse server for
7629applications running on the Linux console. It allows users to select items
7630and copy/paste text in the console and in xterm.")
7631 (license license:gpl2+)))
7632
7633(define-public gamemode
7634 (package
7635 (name "gamemode")
7636 (version "1.8.2")
7637 (source (origin
7638 (method git-fetch)
7639 (uri (git-reference
7640 (url "https://github.com/FeralInteractive/gamemode")
7641 (commit version)))
7642 (file-name (git-file-name name version))
7643 (sha256
7644 (base32 "14i3y385jzpr30lxk38z84rq76sy4cz0pwm54rm62f4mnk0xwjjp"))))
7645 (build-system meson-build-system)
7646 (arguments
7647 (list
7648 #:configure-flags
7649 #~(list
7650 ;; Don't build sample programs.
7651 "-Dwith-examples=false"
7652 ;; Build gamemoderun and other utilities.
7653 "-Dwith-util=true"
7654 ;; Use elogind instead of systemd for sd-bus.
7655 "-Dwith-sd-bus-provider=elogind"
7656 ;; Install PAM limits.d config to the package prefix; a Guix
7657 ;; service can then install it to /etc/security/limits.d/.
7658 (string-append "-Dwith-pam-limits-dir=" #$output
7659 "/etc/security/limits.d")
7660 ;; Guix does not use systemd.
7661 "-Dwith-systemd-user-unit=false"
7662 "-Dwith-systemd-group=false")
7663 #:phases
7664 #~(modify-phases %standard-phases
7665 (add-after 'unpack 'patch-references
7666 (lambda _
7667 (substitute* '("lib/gamemode_client.h"
7668 "data/gamemoderun")
7669 (("libgamemode(auto)?\\.so\\.0" lib)
7670 (string-append #$output "/lib/" lib))))))))
7671 (native-inputs
7672 (list pkg-config))
7673 (inputs
7674 (list
7675 dbus
7676 elogind
7677 libinih))
7678 (synopsis "Optimise Linux system performance on demand")
7679 (description "GameMode is a daemon and library for Linux that allows games to
7680request a set of optimisations be temporarily applied to the host OS and/or a
7681game process. GameMode was designed primarily as a stop-gap solution to problems
7682with the Intel and AMD CPU powersave or ondemand governors, but is now host to a
7683range of optimisation features and configurations, including CPU governor, I/O
7684priority, process niceness, kernel scheduler, screensaver inhibiting, GPU
7685performance mode, and custom scripts.")
7686 (home-page "https://github.com/FeralInteractive/gamemode")
7687 (license license:bsd-3)))
7688
7689(define-public btrfs-progs
7690 (package
7691 (name "btrfs-progs")
7692 (version "7.0")
7693 (source (origin
7694 (method url-fetch)
7695 (uri (string-append "mirror://kernel.org/linux/kernel/"
7696 "people/kdave/btrfs-progs/" "btrfs-progs-v"
7697 version ".tar.xz"))
7698 (sha256
7699 (base32
7700 "16cs5n1hm06ppkylkd9p7v13wdc0sb7y85xll0kj7mxwdj3xd1n2"))))
7701 (build-system gnu-build-system)
7702 (outputs '("out" "static")) ;static versions of the binaries in "out"
7703 (arguments
7704 (list
7705 #:configure-flags
7706 #~(list
7707 ;; Without --disable-documentation, it complains about missing
7708 ;; python-sphinx on systems where this package isn't available
7709 ;; (because it requires Rust).
7710 #$@(if (member (%current-system)
7711 (package-transitive-supported-systems
7712 python-sphinx))
7713 '()
7714 '("--disable-documentation"))
7715 ;; The ‘Python support’ was never actually installed by previous
7716 ;; versions of this package, but did prevent cross-compilation.
7717 "--disable-python")
7718 #:phases #~(modify-phases %standard-phases
7719 (add-after 'unpack 'patch-makefile
7720 (lambda* (#:key outputs #:allow-other-keys)
7721 (substitute* "Makefile"
7722 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
7723 (string-append (assoc-ref outputs "out")
7724 "/lib/udev/rules.d")))))
7725 (add-after 'build 'build-static
7726 (lambda _
7727 (invoke "make" "static")))
7728 (add-after 'install 'install-bash-completion
7729 (lambda* (#:key outputs #:allow-other-keys)
7730 (let* ((out (assoc-ref outputs "out"))
7731 (bashcomp (string-append out
7732 "/etc/bash_completion.d")))
7733 (mkdir-p bashcomp)
7734 (copy-file "btrfs-completion"
7735 (string-append bashcomp "/btrfs")))))
7736 (add-after 'install 'install-static
7737 (let ((staticbin (string-append (assoc-ref %outputs
7738 "static")
7739 "/bin")))
7740 (lambda _
7741 (invoke "make"
7742 (string-append "bindir=" staticbin)
7743 "install-static")))))
7744 #:tests? #f ;XXX: require the 'btrfs' kernel module.
7745 #:test-target "test"
7746 #:parallel-tests? #f)) ;tests fail when run in parallel
7747 (inputs (list e2fsprogs ;for btrfs-convert
7748 eudev
7749 lzo
7750 `(,util-linux "lib") ;for libblkid and libuuid
7751 `(,util-linux "static") ;ditto
7752 zlib
7753 `(,zlib "static")
7754 `(,zstd "lib")
7755 `(,zstd "static")))
7756 (native-inputs
7757 (append
7758 ;; For building documentation. Since python-sphinx requires Rust, add
7759 ;; it conditionally depending on such support.
7760 (if (supported-package? python-sphinx)
7761 (list python-wrapper python-sphinx python-sphinx-rtd-theme)
7762 '())
7763 (list pkg-config
7764 acl ;for tests
7765 lvm2 ;for dmsetup
7766 grep ;need Perl regexp support
7767 libaio
7768 liburing
7769 util-linux ;for fallocate
7770 which)))
7771 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
7772 (synopsis "Create and manage btrfs copy-on-write file systems")
7773 (description
7774 "Btrfs is a @acronym{CoW, copy-on-write} file system for Linux
7775aimed at implementing advanced features while focusing on fault tolerance,
7776repair and easy administration.")
7777 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
7778 ;; GPL2: Everything else.
7779 (license (list license:gpl2 license:gpl2+))))
7780
7781(define-public btrfs-progs/static
7782 (package
7783 (name "btrfs-progs-static")
7784 (version (package-version btrfs-progs))
7785 (source #f)
7786 (build-system trivial-build-system)
7787 (inputs
7788 `(("btrfs-progs:static" ,btrfs-progs "static")))
7789 (arguments
7790 `(#:modules ((guix build utils))
7791 #:builder
7792 (begin
7793 (use-modules (guix build utils)
7794 (ice-9 ftw)
7795 (srfi srfi-26))
7796
7797 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
7798 (out (assoc-ref %outputs "out"))
7799 (source (string-append btrfs "/bin/btrfs.static"))
7800 (target (string-append out "/bin/btrfs")))
7801 (mkdir-p (dirname target))
7802 (copy-file source target)
7803 (remove-store-references target)
7804 (chmod target #o555)
7805 #t))))
7806 (home-page (package-home-page btrfs-progs))
7807 (synopsis "Statically-linked btrfs command from btrfs-progs")
7808 (description "This package provides the statically-linked @command{btrfs}
7809from the btrfs-progs package. It is meant to be used in initrds.")
7810 (license (package-license btrfs-progs))))
7811
7812(define-public cramfs-tools
7813 (package
7814 (name "cramfs-tools")
7815 (home-page "https://github.com/npitre/cramfs-tools")
7816 (version "2.2")
7817 (source (origin
7818 (method git-fetch)
7819 (uri (git-reference
7820 (url home-page)
7821 (commit (string-append "v" version))))
7822 (sha256
7823 (base32 "1rx63qx2sdpzrgcmp7cskin670rnlp45jn90wxqgnqxvc5vr9l5k"))
7824 (file-name (git-file-name name version))))
7825 (build-system gnu-build-system)
7826 (arguments
7827 (list #:tests? #f ; No tests.
7828 #:phases
7829 #~(modify-phases %standard-phases
7830 (delete 'configure)
7831 (replace 'install
7832 (lambda _
7833 (let ((sbin (string-append #$output "/sbin")))
7834 (install-file "mkcramfs" sbin)
7835 (install-file "cramfsck" sbin)))))))
7836 (inputs
7837 (list zlib))
7838 (synopsis "Tools to manage Cramfs file systems")
7839 (description "Cramfs is a Linux file system designed to be simple, small,
7840and to compress things well. It is used on a number of embedded systems and
7841small devices. This version has additional features such as uncompressed
7842blocks and random block placement.")
7843 (license license:gpl2+)))
7844
7845(define-public compsize
7846 (let ((commit "d79eacf77abe3b799387bb8a4e07a18f1f1031e8")
7847 (revision "0"))
7848 (package
7849 (name "compsize")
7850 (version (git-version "1.5" revision commit))
7851 (home-page "https://github.com/kilobyte/compsize")
7852 (source (origin
7853 (method git-fetch)
7854 (uri (git-reference
7855 (url home-page)
7856 (commit commit)))
7857 (sha256
7858 (base32 "02fvgy12m50rg1snp555a1kc3cm01g2imb81cih7ikhkbjbca0d7"))
7859 (file-name (git-file-name name version))
7860 (patches
7861 (search-patches "compsize-fix-btrfs-progs-compatibility.patch"))))
7862 (build-system gnu-build-system)
7863 (inputs
7864 (list btrfs-progs))
7865 (arguments
7866 `(#:tests? #f ; No tests.
7867 #:make-flags
7868 (list (string-append "CC=" ,(cc-for-target)))
7869 #:phases
7870 (modify-phases %standard-phases
7871 (delete 'configure)
7872 (replace 'install
7873 (lambda* (#:key outputs #:allow-other-keys)
7874 (let ((out (assoc-ref outputs "out")))
7875 (install-file "compsize" (string-append out "/bin"))
7876 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
7877 (synopsis "Find compression type/ratio on Btrfs files")
7878 (description "@command{compsize} takes a list of files (given as
7879arguments) on a Btrfs file system and measures used compression types and
7880effective compression ratio, producing a report.
7881
7882A directory has no extents but has a (recursive) list of files. A non-regular
7883file is silently ignored.
7884
7885As it makes no sense to talk about compression ratio of a partial extent,
7886every referenced extent is counted whole, exactly once -- no matter if you use
7887only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
7888uncompressed size will not match the number given by @command{tar} or
7889@command{du}. On the other hand, the space used should be accurate (although
7890obviously it can be shared with files outside our set).")
7891 (license license:gpl2+))))
7892
7893(define-public f2fs-tools
7894 (package
7895 (name "f2fs-tools")
7896 (version "1.16.0")
7897 (source (origin
7898 (method git-fetch)
7899 (uri (git-reference
7900 (url "https://git.kernel.org/pub/scm/linux/kernel\
7901/git/jaegeuk/f2fs-tools.git")
7902 (commit (string-append "v" version))))
7903 (file-name (git-file-name name version))
7904 (sha256
7905 (base32
7906 "0832ix3jnmfagx53wr6clc3q4ay7cbashfj7jirk01gyzwbvblfc"))))
7907 (build-system gnu-build-system)
7908 (native-inputs
7909 (list autoconf automake libtool pkg-config))
7910 (inputs
7911 (list `(,util-linux "lib"))) ;for libuuid
7912 (home-page "https://f2fs.wiki.kernel.org/")
7913 (synopsis "Userland tools for f2fs")
7914 (description
7915 "F2FS, the Flash-Friendly File System, is a modern file system
7916designed to be fast and durable on flash devices such as solid-state
7917disks and SD cards. This package provides the userland utilities.")
7918 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
7919 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
7920 (license (list license:gpl2 license:lgpl2.1))))
7921
7922(define-public f2fs-tools-1.7
7923 (package
7924 (inherit f2fs-tools)
7925 (name "f2fs-tools")
7926 (version "1.7.0")
7927 (source (origin
7928 (method git-fetch)
7929 (uri (git-reference
7930 (url (git-reference-url
7931 (origin-uri (package-source f2fs-tools))))
7932 (commit (string-append "v" version))))
7933 (file-name (git-file-name name version))
7934 (sha256
7935 (base32
7936 "0wpzklw8smnngng0dm25jdmi7v5zfhpz02dksyxpz0a7kzzvnqqm"))))
7937 (inputs
7938 (list `(,util-linux "lib") libselinux))
7939 (arguments
7940 '(#:configure-flags '("CFLAGS=-fcommon")
7941 #:phases
7942 (modify-phases %standard-phases
7943 (add-after 'install 'install-headers
7944 (lambda* (#:key outputs #:allow-other-keys)
7945 (let* ((out (assoc-ref outputs "out"))
7946 (out-include (string-append out "/include")))
7947 (install-file "include/f2fs_fs.h" out-include)
7948 (install-file "mkfs/f2fs_format_utils.h" out-include)))))))))
7949
7950(define-public f2fs-tools/static
7951 (static-package
7952 (package
7953 (inherit f2fs-tools)
7954 (name "f2fs-tools-static")
7955 (arguments
7956 `(#:configure-flags
7957 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
7958 (libuuid (assoc-ref %build-inputs "libuuid")))
7959 (list
7960 (string-append "libuuid_CFLAGS=-I" libuuid "/include/uuid")
7961 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
7962 (string-append "libblkid_CFLAGS=-I" libuuid "/include/uuid "
7963 "-I" libuuid "/include/blkid")
7964 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
7965 #:disallowed-references (,(this-package-input "libuuid"))
7966 #:make-flags '("LDFLAGS=-all-static")
7967 #:phases
7968 (modify-phases %standard-phases ; TODO: f2fs phases.
7969 (add-after 'install 'remove-store-references
7970 (lambda* (#:key outputs #:allow-other-keys)
7971 ;; Work around bug in our util-linux.
7972 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
7973 (remove-store-references (string-append (assoc-ref outputs "out")
7974 "/sbin/mkfs.f2fs"))
7975 #t)))))
7976 (inputs
7977 `(("libuuid:static" ,util-linux "static")
7978 ("libuuid" ,util-linux "lib")))))) ; for include files
7979
7980(define-public f2fs-fsck/static
7981 (package
7982 (name "f2fs-fsck-static")
7983 (version (package-version f2fs-tools/static))
7984 (source #f)
7985 (build-system trivial-build-system)
7986 (arguments
7987 `(#:modules ((guix build utils))
7988 #:builder
7989 (begin
7990 (use-modules (guix build utils)
7991 (ice-9 ftw)
7992 (srfi srfi-26))
7993 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
7994 (fsck "fsck.f2fs")
7995 (out (assoc-ref %outputs "out"))
7996 (sbin (string-append out "/sbin")))
7997 (mkdir-p sbin)
7998 (with-directory-excursion sbin
7999 (install-file (string-append f2fs-tools "/sbin/" fsck)
8000 ".")
8001 (remove-store-references fsck)
8002 (chmod fsck #o555))
8003 #t))))
8004 (inputs
8005 (list f2fs-tools/static))
8006 (home-page (package-home-page f2fs-tools/static))
8007 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
8008 (description "This package provides statically-linked fsck.f2fs command taken
8009from the f2fs-tools package. It is meant to be used in initrds.")
8010 (license (package-license f2fs-tools/static))))
8011
8012(define-public freefall
8013 (package
8014 (name "freefall")
8015 (version (package-version linux-libre))
8016 (source (package-source linux-libre))
8017 (build-system gnu-build-system)
8018 (arguments
8019 '(#:phases (modify-phases %standard-phases
8020 (add-after 'unpack 'enter-subdirectory
8021 (lambda _
8022 (chdir "tools/laptop/freefall")
8023 #t))
8024 (delete 'configure)
8025 (add-before 'build 'increase-timeout
8026 (lambda _
8027 ;; The default of 2 seconds is too low: it assumes an
8028 ;; open lid and AC power without actually checking.
8029 (substitute* "freefall.c"
8030 (("alarm\\(2\\)") "alarm(5)"))
8031 #t)))
8032 #:make-flags (list (string-append "PREFIX="
8033 (assoc-ref %outputs "out"))
8034 "CC=gcc")
8035 #:tests? #f)) ;no tests
8036 (home-page (package-home-page linux-libre))
8037 (synopsis "Free-fall protection for spinning laptop hard drives")
8038 (description
8039 "Prevents shock damage to the internal spinning hard drive(s) of some
8040HP and Dell laptops. When sudden movement is detected, all input/output
8041operations on the drive are suspended and its heads are parked on the ramp,
8042where they are less likely to cause damage to the spinning disc. Requires a
8043drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
8044feature, and a laptop with an accelerometer. It has no effect on SSDs.")
8045 (license license:gpl2)))
8046
8047
8048(define-public nbfc-linux
8049 (let ((version "0.1.7")
8050 (commit "4c2b75e4a875459e86a9892319889ff945e9cadf")
8051 (revision "0"))
8052 (package
8053 (name "nbfc-linux")
8054 (version (git-version version revision commit))
8055 (source (origin
8056 (method git-fetch)
8057 (uri (git-reference
8058 (url "https://github.com/nbfc-linux/nbfc-linux")
8059 (commit commit)))
8060 (file-name (git-file-name name version))
8061 (sha256
8062 (base32
8063 "0mmyfaigrh3fd5v11a8p38km4m02qzsfx8yh72g0z405bzhqn5jk"))))
8064 (build-system gnu-build-system)
8065 (arguments
8066 `(#:make-flags (list (string-append "CC="
8067 ,(cc-for-target))
8068 (string-append "PREFIX="
8069 (assoc-ref %outputs "out")))
8070 #:tests? #f
8071 #:phases (modify-phases %standard-phases
8072 (delete 'configure))))
8073 (native-inputs (list pkg-config))
8074 (propagated-inputs (list python dmidecode))
8075 (synopsis "NoteBook FanControl ported to Linux")
8076 (description
8077 "This package provides a C port of NoteBook FanControl (NBFC), a fan
8078control service for notebooks. It provides the same utilities with the same
8079interfaces as the original NBFC, although the implementation differs.")
8080 (home-page "https://github.com/nbfc-linux/nbfc-linux")
8081 (license license:gpl3+))))
8082
8083(define-public thinkfan
8084 (package
8085 (name "thinkfan")
8086 (version "2.0.0")
8087 (source
8088 (origin
8089 (method git-fetch)
8090 (uri (git-reference
8091 (url "https://github.com/vmatare/thinkfan")
8092 (commit version)))
8093 (file-name (git-file-name name version))
8094 (sha256
8095 (base32 "1jdjqdbv0m7yf9g4rxs7nq1ldh2b81a7qx4vcf9lzw7jwlydd822"))))
8096 (build-system cmake-build-system)
8097 (arguments
8098 (list
8099 #:modules '((guix build cmake-build-system)
8100 (guix build utils)
8101 (srfi srfi-26))
8102 #:tests? #f ; no test target
8103 #:configure-flags
8104 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
8105 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
8106 ;; inefficient’.
8107 #~(list "-DUSE_ATASMART:BOOL=ON")
8108 #:phases
8109 #~(modify-phases %standard-phases
8110 (add-after 'unpack 'create-init-scripts
8111 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
8112 ;; systemd to patch and install their service files. Fake their
8113 ;; presence rather than duplicating the build system below. Leave
8114 ;; things like ‘/bin/kill’ because they're not worth a dependency.
8115 ;; The sysvinit needs manual patching, but since upstream doesn't
8116 ;; even provide the option to install it: don't.
8117 (lambda _
8118 (substitute* "CMakeLists.txt"
8119 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
8120 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
8121 ;; That was easy! Now we just need to fix the destinations.
8122 (("/etc" directory)
8123 (string-append #$output directory))))))))
8124 (native-inputs
8125 (list pkg-config))
8126 (inputs
8127 `(("libatasmart" ,libatasmart)
8128 ("lm-sensors" ,lm-sensors "lib")
8129 ("yaml-cpp" ,yaml-cpp)))
8130 (home-page "https://github.com/vmatare/thinkfan")
8131 (synopsis "Simple fan control program")
8132 (description
8133 "Thinkfan is a simple fan control program. It reads temperatures,
8134checks them against configured limits and switches to appropriate (also
8135pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
8136other @code{hwmon} driver that enables temperature reading and fan control
8137from userspace.")
8138 (license license:gpl3+)))
8139
8140(define-public tpacpi-bat
8141 (package
8142 (name "tpacpi-bat")
8143 (version "3.2")
8144 (source
8145 (origin
8146 (method git-fetch)
8147 (uri (git-reference
8148 (url "https://github.com/teleshoes/tpacpi-bat")
8149 (commit (string-append "v" version))))
8150 (file-name (git-file-name name version))
8151 (sha256
8152 (base32 "0nd8s2bqbhl0sjpflphb4l9ix71p7kvnbvkq4dg9a1v0sxafyygm"))))
8153 (build-system gnu-build-system)
8154 (arguments
8155 `(#:tests? #f ; no test target
8156 #:phases
8157 (modify-phases %standard-phases
8158 (add-after 'unpack 'refer-to-inputs
8159 (lambda* (#:key inputs #:allow-other-keys)
8160 (substitute* "tpacpi-bat"
8161 (("cat ")
8162 (string-append (search-input-file inputs "bin/cat") " "))
8163 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
8164 ;; loaded. That's the administrator's prerogative; disable it.
8165 (("system \"(modprobe .*)\"" _ match)
8166 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))))
8167 (delete 'configure) ; nothing to configure
8168 (delete 'build) ; nothing to build
8169 (replace 'install
8170 (lambda* (#:key outputs #:allow-other-keys)
8171 (let* ((out (assoc-ref outputs "out"))
8172 (bin (string-append out "/bin"))
8173 (doc (string-append out "/share/doc/" ,name "-" ,version)))
8174 (install-file "tpacpi-bat" bin)
8175
8176 ;; There's no man page. Install other forms of documentation.
8177 (for-each (lambda (file)
8178 (let ((target (string-append doc "/" file)))
8179 (mkdir-p (dirname target))
8180 (copy-recursively file target)))
8181 (list "battery_asl" "examples" "README.md"))))))))
8182 (inputs
8183 (list coreutils-minimal
8184 perl))
8185 (home-page "https://github.com/teleshoes/tpacpi-bat")
8186 (synopsis "ThinkPad battery charge controller")
8187 (description
8188 "Tpacpi-bat is a command-line interface to control battery charging on
8189@uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
8190ThinkPad models released after 2011}, starting with the xx20 series. It can
8191query and set the thresholds at which one or both batteries will start and stop
8192charging, inhibit charging batteries for a set period of time, or force them to
8193discharge when they otherwise would not.
8194
8195This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
8196kernel module provided by the @code{acpi-call-linux-module} package, which must
8197be installed and loaded separately. Only the original vendor firmware is
8198supported.")
8199 (license license:gpl3+)))
8200
8201(define-public tmon
8202 (package
8203 (name "tmon")
8204 ;; Tmon's ‘VERSION = 1.0’ hasn't been touched since 2013; the code has.
8205 (version (package-version linux-libre))
8206 (source (package-source linux-libre))
8207 (build-system gnu-build-system)
8208 (arguments
8209 (list
8210 #:tests? #f ; no test suite
8211 #:make-flags
8212 #~(list (string-append "CC=" #$(cc-for-target))
8213 (string-append "INSTALL_ROOT=" #$output)
8214 "BINDIR=bin")
8215 #:phases
8216 #~(modify-phases %standard-phases
8217 (add-after 'unpack 'enter-subdirectory
8218 (lambda _
8219 (chdir "tools/thermal/tmon")))
8220 (add-after 'install 'install-man-page
8221 (lambda _
8222 (let ((man8 (string-append #$output "/share/man/man8")))
8223 (install-file "tmon.8" man8))))
8224 (delete 'configure)))) ; no configure script
8225 (inputs
8226 (list ncurses))
8227 (home-page (package-home-page linux-libre))
8228 (synopsis "Monitor and test the Linux thermal subsystem in real time")
8229 (description
8230 "Tmon is a tool to interact with the complex thermal subsystem of the
8231kernel Linux. It helps visualize thermal relationships and real-time thermal
8232data, tune and test cooling devices and sensors, and collect thermal data for
8233further analysis.
8234
8235As computers become smaller and more thermally constrained, more sensors are
8236added and new cooling capabilities introduced. Thermal relationships can change
8237dynamically. Their complexity grows exponentially among cooling devices, zones,
8238sensors, and trip points.
8239
8240Linux exposes this relationship through @file{/sys/class/thermal} with a matrix
8241of symbolic links, trip point bindings, and device instances. To traverse it
8242by hand is no trivial task: @command{tmon} aims to make it understandable.")
8243 (license (list license:gpl2 ; the man page
8244 license:gpl2+)))) ; the actual rest
8245
8246(define-public turbostat
8247 (package
8248 (name "turbostat")
8249 ;; XXX turbostat reports a version like ‘20.09.30’ but using it here would
8250 ;; make it harder to benefit from ‘free’ linux-libre package updates.
8251 (version (package-version linux-libre))
8252 (source (package-source linux-libre))
8253 (build-system gnu-build-system)
8254 (arguments
8255 (list
8256 #:tests? #f ;no test suite
8257 #:make-flags
8258 #~(list (string-append "CC=" #$(cc-for-target))
8259 (string-append "PREFIX=" #$output))
8260 #:phases
8261 #~(modify-phases %standard-phases
8262 (add-after 'unpack 'enter-subdirectory
8263 (lambda _
8264 (chdir "tools/power/x86/turbostat")))
8265 (delete 'configure)))) ;no configure script
8266 (inputs
8267 (list libcap))
8268 (supported-systems '("i686-linux" "x86_64-linux"))
8269 (home-page (package-home-page linux-libre))
8270 (synopsis "Report x86 processor frequency and idle statistics")
8271 (description
8272 "Turbostat reports x86 processor topology, frequency, idle power state
8273statistics, temperature, and power consumption. Some information is unavailable
8274on older processors.
8275
8276It can be used to identify machines that are inefficient in terms of power usage
8277or idle time, report the rate of @acronym{SMI, system management interrupt}s
8278occurring on the system, or verify the effects of power management tuning.
8279
8280@command{turbostat} reads hardware counters but doesn't write to them, so it
8281won't interfere with the OS or other running processes---including multiple
8282invocations of itself.")
8283 (license license:gpl2)))
8284
8285(define-public ntfs-3g
8286 (package
8287 (name "ntfs-3g")
8288 (version "2026.7.7")
8289 (source (origin
8290 (method git-fetch)
8291 (uri
8292 (git-reference
8293 (url "https://github.com/tuxera/ntfs-3g")
8294 (commit version)))
8295 (file-name (git-file-name name version))
8296 (sha256
8297 (base32
8298 "0kkpmi28qihwmnyvdnkj0azrd7zr6wkv590pjfmbbhn1w4qfp7gd"))
8299 (patches
8300 (search-patches "ntfs-3g-autoconf-sbin-helpers.patch"
8301 "ntfs-3g-consistent-sbindir-usage.patch"))))
8302 (build-system gnu-build-system)
8303 (inputs (list util-linux ; libuuid
8304 kmod
8305 fuse-2))
8306 (native-inputs (list pkg-config autoconf automake libtool
8307 libgcrypt)) ; for m4 macros
8308 (arguments
8309 (list
8310 #:configure-flags
8311 #~(list "--disable-static"
8312 "--disable-ldconfig" ;not necessary
8313 "--exec-prefix=${prefix}"
8314 "--with-fuse=external" ;use our own FUSE
8315 "--enable-mount-helper"
8316 (string-append "--with-modprobe-helper="
8317 #$(this-package-input "kmod") "/bin/modprobe")
8318 "--enable-posix-acls"
8319 "--enable-xattr-mappings")
8320 #:phases
8321 #~(modify-phases %standard-phases
8322 ;; If users install ntfs-3g, they probably want to make it the
8323 ;; default driver as well, so we opt for sensible defaults and link
8324 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
8325 ;; mount NTFS file systems.)
8326 (add-after 'install 'install-link
8327 (lambda* (#:key outputs #:allow-other-keys)
8328 (let* ((out (assoc-ref outputs "out"))
8329 (sbin (string-append out "/sbin")))
8330 (symlink "mount.ntfs-3g"
8331 (string-append sbin "/mount.ntfs"))))))))
8332 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
8333 (synopsis "Read-write access to NTFS file systems")
8334 (description
8335 "NTFS-3G provides read-write access to NTFS file systems, which are
8336commonly found on Microsoft Windows. It is implemented as a FUSE file system.
8337The package provides additional NTFS tools.")
8338 (license license:gpl2+)))
8339
8340(define-public ntfs-3g/static
8341 (static-package
8342 (package
8343 (inherit ntfs-3g)
8344 (name "ntfs-3g-static")
8345 (arguments
8346 (substitute-keyword-arguments arguments
8347 ((#:configure-flags flags)
8348 #~(cons* "--enable-really-static"
8349 ;; The FUSE driver isn't currently used by our initrd.
8350 "--disable-ntfs-3g"
8351 #$flags))
8352 ((#:phases phases)
8353 #~(modify-phases #$phases
8354 (add-after 'unpack 'make-really-static-really-static
8355 (lambda _
8356 (substitute* "ntfsprogs/Makefile.am"
8357 ((" -static") " -all-static"))))
8358 (delete 'install-link))))))))
8359
8360(define-public ntfsfix/static
8361 (package
8362 (name "ntfsfix-static")
8363 (version (package-version ntfs-3g/static))
8364 (source #f)
8365 (build-system trivial-build-system)
8366 (arguments
8367 (list
8368 #:modules `((guix build utils))
8369 #:builder
8370 #~(begin
8371 (use-modules (guix build utils))
8372 (let ((bin (string-append #$output "/bin")))
8373 (install-file (search-input-file %build-inputs "/bin/ntfsfix") bin)
8374 (with-directory-excursion bin
8375 (remove-store-references "ntfsfix"))))))
8376 (inputs (list ntfs-3g/static))
8377 (home-page (package-home-page ntfs-3g/static))
8378 (synopsis "Statically linked @command{ntfsfix} from ntfs-3g")
8379 (description
8380 "This package provides a statically linked @command{ntfsfix} taken
8381from the ntfs-3g package. It is meant to be used in initrds.")
8382 (license (package-license ntfs-3g/static))))
8383
8384(define-public rdma-core
8385 (package
8386 (name "rdma-core")
8387 (version "62.0")
8388 (source (origin
8389 (method url-fetch)
8390 (uri (string-append "https://github.com/linux-rdma/rdma-core"
8391 "/releases/download/v" version "/rdma-core-"
8392 version ".tar.gz"))
8393 (sha256
8394 (base32
8395 "1802afy4q80zl7qkxlyq71ll5fsksva43f8xfd6vlqj1c47dc2n0"))))
8396 (build-system cmake-build-system)
8397 (arguments
8398 `(#:tests? #f ;no tests
8399
8400 ;; Upstream uses the "ninja" build system and encourage distros
8401 ;; to do the same for consistency.
8402 #:generator "Ninja"
8403 #:configure-flags
8404 (list (string-append "-DRST2MAN_EXECUTABLE="
8405 (search-input-file
8406 %build-inputs "/bin/rst2man.py")))))
8407 (native-inputs
8408 (list pkg-config python-wrapper python-docutils-0.19)) ;for 'rst2man'
8409 (inputs
8410 (list libnl eudev))
8411 (home-page "https://github.com/linux-rdma/rdma-core")
8412 (synopsis "Utilities and libraries for working with RDMA devices")
8413 (description
8414 "This package provides userspace components for the InfiniBand
8415subsystem of the Linux kernel. Specifically it contains userspace
8416libraries for the following device nodes:
8417
8418@enumerate
8419@item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
8420@item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
8421@item @file{/dev/infiniband/umadX} (@code{libibumad})
8422@end enumerate
8423
8424The following service daemons are also provided:
8425@enumerate
8426@item @code{srp_daemon} (for the @code{ib_srp} kernel module)
8427@item @code{iwpmd} (for iWARP kernel providers)
8428@item @code{ibacm} (for InfiniBand communication management assistant)
8429@end enumerate")
8430 ;; All library code is dual licensed under GPL2 and a custom MIT
8431 ;; variant. The package also includes some components covered by
8432 ;; other licenses. Consult COPYING.md for full details.
8433 (license
8434 (list license:gpl2
8435 (license:x11-style "See COPYING.BSD_MIT in the distribution")
8436 license:bsd-2 ; Files referring to COPYING.BSD_FB
8437 license:cc0 ; most files in ccan/
8438 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
8439
8440(define-public perftest
8441 (package
8442 (name "perftest")
8443 (version "4.5-0.20")
8444 (home-page "https://github.com/linux-rdma/perftest")
8445 (source (origin
8446 (method git-fetch)
8447 (uri (git-reference (url home-page)
8448 (commit (string-append "v" version))))
8449 (file-name (git-file-name name version))
8450 (sha256
8451 (base32
8452 "1hrpzmkz1kq4jwpy6b5fl8073iy7dllcq2hfzdw6waaf5920vd64"))))
8453 (build-system gnu-build-system)
8454 (native-inputs
8455 (list autoconf automake libtool))
8456 (inputs (list pciutils rdma-core))
8457 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
8458 (description "This is a collection of tests written over uverbs intended
8459for use as a performance micro-benchmark. The tests may be used for hardware
8460or software tuning as well as for functional testing.
8461
8462The collection contains a set of bandwidth and latency benchmark such as:
8463@enumerate
8464@item Send - @code{ib_send_bw} and @code{ib_send_lat}
8465@item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
8466@item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
8467@item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
8468@item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
8469@end enumerate")
8470 (license license:gpl2)))
8471
8472(define-public rng-tools
8473 (package
8474 (name "rng-tools")
8475 (home-page "https://github.com/nhorman/rng-tools")
8476 (version "6.17")
8477 (source (origin
8478 (method git-fetch)
8479 (uri (git-reference (url home-page)
8480 (commit (string-append "v" version))))
8481 (file-name (git-file-name name version))
8482 (sha256
8483 (base32
8484 "0vvqi9ha4jbk4086x2q98p4ip3z56sfdpyckdyknsd36zhp6z8n2"))
8485 (patches
8486 (search-patches "rng-tools-revert-build-randstat.patch"))
8487 (patch-flags '("-p0"))))
8488 (build-system gnu-build-system)
8489 (arguments
8490 (list
8491 ;; Disable support for various hardware entropy sources as they need
8492 ;; dependencies that are not yet in Guix, and would significantly
8493 ;; increase closure size.
8494 #:configure-flags #~(list "--without-nistbeacon"
8495 "--without-pkcs11"
8496 "--without-rtlsdr"
8497 "--without-qrypt")
8498 #:phases
8499 #~(modify-phases %standard-phases
8500 (add-before 'check 'disable-failing-test
8501 (lambda _
8502 (substitute* "tests/Makefile"
8503 ;; This test requires a hwrng, rdrand, or tpm device.
8504 ;; Worse, it appears to fail if that isn't sufficiently random.
8505 (("\\brngtestjitter\\.sh\\b") " ")))))))
8506 (native-inputs
8507 (list autoconf automake pkg-config))
8508 (inputs
8509 (list libcap sysfsutils openssl))
8510 (synopsis "Random number generator daemon")
8511 (description
8512 "Monitor a hardware random number generator, and supply entropy
8513from that to the system kernel's @file{/dev/random} machinery.")
8514 ;; The source package is offered under the GPL2+, but the files
8515 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
8516 (license (list license:gpl2 license:gpl2+))))
8517
8518(define-public cpupower
8519 (package
8520 (name "cpupower")
8521 (version (package-version linux-libre))
8522 (source (package-source linux-libre))
8523 (build-system gnu-build-system)
8524 (arguments
8525 (list #:make-flags
8526 #~(list "CC=gcc"
8527 (string-append "DESTDIR=" #$output)
8528 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
8529 "docdir=/share/doc/cpupower" ;drop default ‘packages/’
8530 "confdir=$(docdir)/examples"
8531 ;; The Makefile recommends the following changes.
8532 "DEBUG=false"
8533 "[email protected]")
8534 #:tests? #f ; no tests
8535 #:phases
8536 #~(modify-phases %standard-phases
8537 (add-after 'unpack 'enter-subdirectory
8538 (lambda _
8539 (chdir "tools/power/cpupower")))
8540 (delete 'configure) ; no configure script
8541 (add-before 'build 'fix-makefiles
8542 (lambda _
8543 (substitute* "Makefile"
8544 (("/usr/") "/")
8545 (("/bin/(install)" _ command) command))
8546 (substitute* "bench/Makefile"
8547 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))))
8548 (native-inputs (list gettext-minimal
8549 which)) ;to find gettext
8550 (inputs (list pciutils))
8551 (home-page (package-home-page linux-libre))
8552 (synopsis "CPU frequency and voltage scaling tools for Linux")
8553 (description
8554 "cpupower is a set of user-space tools that use the cpufreq feature of the
8555Linux kernel to retrieve and control processor features related to power saving,
8556such as frequency and voltage scaling.")
8557 (license license:gpl2)))
8558
8559(define-public x86-energy-perf-policy
8560 (package
8561 (name "x86-energy-perf-policy")
8562 (version (package-version linux-libre))
8563 (source (package-source linux-libre))
8564 (build-system gnu-build-system)
8565 (arguments
8566 '(#:tests? #f
8567 #:phases
8568 (modify-phases %standard-phases
8569 (add-after 'unpack 'enter-subdirectory
8570 (lambda _
8571 (chdir "tools/power/x86/x86_energy_perf_policy")
8572 #t))
8573 (delete 'configure)
8574 (add-before 'build 'fix-makefile
8575 (lambda _
8576 (substitute* "Makefile" (("/usr") ""))
8577 #t)))
8578 #:make-flags
8579 (let ((out (assoc-ref %outputs "out")))
8580 (list (string-append "DESTDIR=" out)
8581 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
8582 (supported-systems '("i686-linux" "x86_64-linux"))
8583 (home-page (package-home-page linux-libre))
8584 (synopsis "Display and update Intel-CPU energy-performance policy")
8585 (description
8586 "@command{x86_energy_perf_policy} displays and updates energy-performance
8587policy settings specific to Intel Architecture Processors. Settings are
8588accessed via Model Specific Register (MSR) updates, no matter if the Linux
8589cpufreq sub-system is enabled or not.")
8590 (license license:gpl2)))
8591
8592(define-public haveged
8593 (package
8594 (name "haveged")
8595 (version "1.9.19")
8596 (source
8597 (origin
8598 (method git-fetch)
8599 (uri (git-reference
8600 (url "https://github.com/jirka-h/haveged")
8601 (commit (string-append "v" version))))
8602 (file-name (git-file-name name version))
8603 (sha256
8604 (base32 "1qka68dlfz9z3gjfvfwvh60l2121c1yx0z264jqsf2vjp5f0xbmn"))))
8605 (build-system gnu-build-system)
8606 (arguments
8607 `(#:configure-flags
8608 (list "--disable-static")))
8609 (home-page "https://www.issihosts.com/haveged")
8610 (synopsis "Entropy source for the Linux random number generator")
8611 (description
8612 "haveged generates an unpredictable stream of random numbers for use by
8613Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
8614standard mechanisms for filling the entropy pool may not be sufficient for
8615systems with high needs or limited user interaction, such as headless servers.
8616
8617@command{haveged} runs as a privileged daemon, harvesting randomness from the
8618indirect effects of hardware events on hidden processor state using the
8619@acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
8620It tunes itself to its environment and provides the same built-in test suite
8621for the output stream as used on certified hardware security devices.
8622
8623The quality of the randomness produced by this algorithm has not been proven.
8624It is recommended to run it together with another entropy source like rngd, and
8625not as a replacement for it.")
8626 (license (list (license:non-copyleft "file://nist/mconf.h")
8627 (license:non-copyleft "file://nist/packtest.c")
8628 license:public-domain ; nist/dfft.c
8629 license:gpl3+)))) ; everything else
8630
8631(define-public hotspot
8632 (package
8633 (name "hotspot")
8634 (version "1.6.0")
8635 (source (origin
8636 (method git-fetch)
8637 (uri (git-reference
8638 (url "https://github.com/KDAB/hotspot")
8639 (commit version)
8640 ;; Include the bundled perfparser and PrefixTickLabels
8641 ;; libraries, which are to be used in source form.
8642 (recursive? #t)))
8643 (file-name (git-file-name name version))
8644 (sha256
8645 (base32
8646 "065pcibr4m2ixjlq9nf45g22f73zsxabll361bjjnmkfv6xhz1r4"))))
8647 (build-system qt-build-system)
8648 (arguments
8649 (list
8650 ;; As mentioned in the option help text, the KAuth helper cannot be
8651 ;; installed to a custom prefix and the build fails with "file cannot
8652 ;; create directory: /polkit-1/actions. Maybe need administrative"
8653 ;; (see: <https://bugs.kde.org/show_bug.cgi?id=363678>).
8654 #:configure-flags #~(list "-DINSTALL_KAUTH_HELPER=OFF"
8655 "-DQT6_BUILD=ON")
8656 #:qtbase qtbase
8657 ;; The 'tst_models' and 'tst_callgraphgenerator' fail, with
8658 ;; the later seemingly requiring sudo or access to the kernel
8659 ;; trace points.
8660 #:test-exclude
8661 (string-append
8662 "("
8663 (string-join
8664 ;; The 'tst_models' expected output doesn't exactly
8665 ;; match.
8666 '("tst_models"
8667 ;; The 'tst_callgraphgenerator' perf invocation
8668 ;; fails when run in the build container.
8669 "tst_callgraphgenerator"
8670 ;; The 'tst_perfparser' test requires sudo/access
8671 ;; to the kernel scheduler trace points.
8672 "tst_perfparser")
8673 "|")
8674 ")")
8675 #:phases
8676 #~(modify-phases %standard-phases
8677 (add-after 'unpack 'patch-perfparser
8678 ;; XXX: This phase is copied from qt-creator: keep them in sync!
8679 (lambda* (#:key inputs #:allow-other-keys)
8680 ;; perfparser attempts to dynamically load the demangle
8681 ;; libraries; use their absolute file name to avoid having to
8682 ;; set LD_LIBRARY_PATH.
8683 (let ((librustc_demangle.so
8684 (with-exception-handler (lambda (ex)
8685 (if (search-error? ex)
8686 #f
8687 (raise-exception ex)))
8688 (lambda ()
8689 (search-input-file inputs "lib/librustc_demangle.so"))
8690 #:unwind? #t)))
8691 (substitute* "3rdparty/perfparser/app/demangler.cpp"
8692 (("loadDemangleLib\\(QStringLiteral\\(\"rustc_demangle\")"
8693 all)
8694 (if librustc_demangle.so
8695 (format #f "loadDemangleLib(QStringLiteral(~s)"
8696 librustc_demangle.so)
8697 all)) ;no rustc_demangle; leave unchanged
8698 (("loadDemangleLib\\(QStringLiteral\\(\"d_demangle\")")
8699 (format #f "loadDemangleLib(QStringLiteral(~s)"
8700 (search-input-file inputs
8701 "lib/libd_demangle.so")))))))
8702 (add-after 'unpack 'path-paths
8703 (lambda* (#:key inputs #:allow-other-keys)
8704 (substitute* "src/perfoutputwidgetkonsole.cpp"
8705 (("\"tail\"")
8706 (format #f "~s" (search-input-file inputs "bin/tail"))))
8707 (substitute* "src/perfrecord.cpp"
8708 (("\"perf( )?\"" _ space)
8709 (string-append "\"" (search-input-file inputs "bin/perf")
8710 (or space "") "\""))))))))
8711 (native-inputs
8712 (list extra-cmake-modules
8713 vulkan-headers))
8714 (inputs
8715 (append
8716 (list coreutils-minimal
8717 d-demangler
8718 elfutils
8719 karchive
8720 kconfig
8721 kcoreaddons
8722 kddockwidgets
8723 kgraphviewer
8724 ki18n
8725 kio
8726 kiconthemes
8727 kitemmodels
8728 kitemviews
8729 knotifications
8730 kparts
8731 ksyntaxhighlighting
8732 kwindowsystem
8733 libxkbcommon
8734 perf
8735 qtdeclarative
8736 qtsvg
8737 solid
8738 threadweaver
8739 `(,zstd "lib"))
8740 (if (supported-package? rust-rustc-demangle-capi-0.1)
8741 (list rust-rustc-demangle-capi-0.1)
8742 '())))
8743 (home-page "https://github.com/KDAB/hotspot")
8744 (synopsis "Performance analysis GUI for Linux perf")
8745 (description "Hotspot is a standalone GUI for performance data analysis.
8746It aims to be similar to KCachegrind, but for data collected with
8747@command{perf}, a profiler for use with the kernel Linux. Its main feature is
8748graphically visualizing a @file{perf.data} file.")
8749 (license (list license:gpl2+ license:gpl3+)))) ;dual licensed
8750
8751(define-public ecryptfs-utils
8752 (package
8753 (name "ecryptfs-utils")
8754 (version "111")
8755 (source
8756 (origin
8757 (method url-fetch)
8758 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
8759 version "/+download/ecryptfs-utils_"
8760 version ".orig.tar.gz"))
8761 (sha256
8762 (base32
8763 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
8764 (build-system gnu-build-system)
8765 (arguments
8766 `(#:configure-flags (list "--disable-pywrap")
8767 #:modules (,@%default-gnu-modules
8768 (ice-9 binary-ports)
8769 (rnrs bytevectors)
8770 (srfi srfi-26))
8771 #:phases
8772 (modify-phases %standard-phases
8773 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
8774 (lambda* (#:key inputs outputs #:allow-other-keys)
8775 (let ((out (assoc-ref outputs "out"))
8776 (util-linux (assoc-ref inputs "util-linux"))
8777 (cryptsetup (assoc-ref inputs "cryptsetup-minimal"))
8778 (linux-pam (assoc-ref inputs "linux-pam"))
8779 (lvm2 (assoc-ref inputs "lvm2")))
8780 (substitute* '("src/utils/ecryptfs-mount-private"
8781 "src/utils/ecryptfs-umount-private"
8782 "src/utils/ecryptfs-setup-private"
8783 "src/utils/ecryptfs-setup-swap"
8784 "src/utils/mount.ecryptfs.c"
8785 "src/utils/umount.ecryptfs.c"
8786 "src/pam_ecryptfs/pam_ecryptfs.c"
8787 "src/desktop/ecryptfs-mount-private.desktop.in"
8788 "src/desktop/ecryptfs-setup-private.desktop.in")
8789 (("/bin/mount")
8790 (string-append util-linux "/bin/mount"))
8791 (("/bin/umount")
8792 (string-append util-linux "/bin/umount"))
8793 (("/sbin/mount.ecryptfs_private")
8794 (string-append out "/sbin/mount.ecryptfs_private"))
8795 (("/sbin/umount.ecryptfs_private")
8796 (string-append out "/sbin/umount.ecryptfs_private"))
8797 (("/usr/bin/ecryptfs-mount-private")
8798 (string-append out "/bin/ecryptfs-mount-private"))
8799 (("/usr/bin/ecryptfs-rewrite-file")
8800 (string-append out "/bin/ecryptfs-rewrite-file"))
8801 (("/usr/bin/ecryptfs-setup-private")
8802 (string-append out "/bin/ecryptfs-setup-private"))
8803 (("/sbin/cryptsetup")
8804 (string-append cryptsetup "/sbin/cryptsetup"))
8805 (("/sbin/unix_chkpwd")
8806 (string-append linux-pam "/sbin/unix_chkpwd"))
8807 (("/sbin/dmsetup")
8808 (string-append lvm2 "/sbin/dmsetup"))))))
8809 (add-after 'install 'wrap-scripts
8810 (lambda* (#:key inputs outputs #:allow-other-keys)
8811 (let* ((out (assoc-ref outputs "out"))
8812 (bin (string-append out "/bin"))
8813 (add (map (lambda (bin)
8814 (dirname (search-input-file
8815 inputs (string-append "bin/" bin))))
8816 ;; For simplicity, we wrap all scripts the same.
8817 (list "awk" "find" "gettext" "grep" "keyctl" "ls"
8818 "lsof" "mount" "rsync" "sed" "which")))
8819 (script? (lambda (file)
8820 (call-with-input-file file
8821 (lambda (port)
8822 (bytevector=? (string->utf8 "#!")
8823 (get-bytevector-n port 2)))))))
8824 (for-each (lambda (file)
8825 (when (script? file)
8826 (wrap-program file
8827 ;; '= would be better than 'suffix but break
8828 ;; setuid binaries.
8829 `("PATH" ":" suffix (,@add
8830 ,(string-append bin))))))
8831 (find-files bin "."))))))))
8832 (native-inputs
8833 (list intltool perl ; for pod2man
8834 pkg-config))
8835 (inputs
8836 (list coreutils
8837 cryptsetup-minimal
8838 findutils
8839 gawk
8840 grep
8841 keyutils
8842 linux-pam
8843 lsof
8844 lvm2
8845 nss
8846 rsync
8847 sed
8848 util-linux
8849 which))
8850 (home-page "https://ecryptfs.org/")
8851 (synopsis "Cryptographic file system utilities")
8852 (description
8853 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
8854Each file's cryptographic meta-data is stored inside the file itself, along
8855with the encrypted contents. This allows individual encrypted files to be
8856copied between hosts and still be decrypted with the proper key. eCryptfs is a
8857native Linux file system, and has been part of the Linux kernel since version
88582.6.19. This package contains the userland utilities to manage it.")
8859 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
8860 ;; grant additional permission to link with OpenSSL.
8861 (license license:gpl2+)))
8862
8863(define-public module-init-tools
8864 (package
8865 (name "module-init-tools")
8866 (version "3.16")
8867 (source (origin
8868 (method url-fetch)
8869 (uri (string-append
8870 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
8871 "module-init-tools-" version ".tar.bz2"))
8872 (sha256
8873 (base32
8874 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
8875 (patches (search-patches "module-init-tools-moduledir.patch"))))
8876 (build-system gnu-build-system)
8877 (arguments
8878 ;; FIXME: The upstream tarball lacks man pages, and building them would
8879 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
8880 ;; but they vanished. In the meantime, fake it.
8881 '(#:phases
8882 (modify-phases %standard-phases
8883 (add-before 'configure 'fake-docbook
8884 (lambda _
8885 (substitute* "Makefile.in"
8886 (("^DOCBOOKTOMAN.*$")
8887 "DOCBOOKTOMAN = true\n"))
8888 #t)))))
8889 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
8890 (synopsis "Tools for loading and managing Linux kernel modules")
8891 (description
8892 "Tools for loading and managing Linux kernel modules, such as
8893@code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
8894 (license license:gpl2+)))
8895
8896(define-public mce-inject
8897 (let ((revision "0") ; no git tags :-/
8898 (commit "4cbe46321b4a81365ff3aafafe63967264dbfec5"))
8899 (package
8900 (name "mce-inject")
8901 (version (git-version "0.0.0" revision commit))
8902 (source
8903 (origin
8904 (method git-fetch)
8905 (uri (git-reference
8906 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git")
8907 (commit commit)))
8908 (file-name (git-file-name name version))
8909 (sha256
8910 (base32 "0gjapg2hrlxp8ssrnhvc19i3r1xpcnql7xv0zjgbv09zyha08g6z"))))
8911 (build-system gnu-build-system)
8912 (arguments
8913 ;; There is no test suite. There's a test/ directory, but it just holds
8914 ;; example text files you could feed to the programme to crash something.
8915 (list #:tests? #f
8916 #:make-flags
8917 #~(list (string-append "prefix=" #$output)
8918 (string-append "CC=" #$(cc-for-target)))
8919 #:phases
8920 #~(modify-phases %standard-phases
8921 (delete 'configure) ; no configure script
8922 (add-after 'install 'install-examples
8923 (lambda* (#:key outputs #:allow-other-keys)
8924 (let* ((out (assoc-ref outputs "out"))
8925 (doc (string-append out "/share/doc/" #$name))
8926 (dir (string-append doc "/examples")))
8927 (copy-recursively "test" dir )))))))
8928 (native-inputs
8929 (list bison flex))
8930 (supported-systems (list "i686-linux" "x86_64-linux"))
8931 (home-page
8932 "https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git/about/")
8933 (synopsis
8934 "Inject x86 @acronym{MCEs, machine-check exceptions} into Linux")
8935 (description
8936 "This simple tool injects fake @acronym{MCEs, machine-check exceptions}
8937into a running Linux kernel, to debug or test the kernel's @acronym{EDAC, error
8938detection and correction}-handling code specific to x86 and x86_64 platforms.
8939
8940Real MCEs are internal CPU errors. Handling them correctly can be important to
8941system stability and even prevent physical damage. In contrast, simulated MCEs
8942produced by @command{mce-inject} are purely synthetic: injection happens only at
8943the software level, inside the kernel, and is not visible to the platform
8944hardware or firmware.
8945
8946A convenient feature of @command{mce-inject} is that the input language used to
8947describe MCEs is similar to the format used in Linux panic messages, with a few
8948extensions. In general, you should be able to pipe in any logged MCE panic to
8949simulate that same MCE.
8950
8951The target kernel must have the @code{CONFIG_X86_MCE_INJECT} option enabled and
8952the @code{mce-inject} module loaded if it exists.")
8953 (license license:gpl2))))
8954
8955(define-public mcelog
8956 (package
8957 (name "mcelog")
8958 (version "195")
8959 (source
8960 (origin
8961 (method git-fetch)
8962 (uri (git-reference
8963 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git")
8964 (commit (string-append "v" version))))
8965 (file-name (git-file-name name version))
8966 (sha256
8967 (base32 "1bg2bj8flybd8kzmmaaslisc6lc1fs9nbv09im6r32dq48skx5aj"))
8968 (modules '((guix build utils)))
8969 (snippet
8970 `(begin
8971 ;; The checkout lacks a .git directory, breaking ‘git describe’.
8972 (substitute* "Makefile"
8973 (("\"unknown\"") (string-append "\"v" ,version "\"")))))))
8974 (build-system gnu-build-system)
8975 (arguments
8976 (list
8977 ;; The tests will only run as root on certain supported CPU models.
8978 #:tests? #f
8979 #:make-flags
8980 #~(list (string-append "CC=" #$(cc-for-target))
8981 (string-append "prefix=" #$output)
8982 (string-append "DOCDIR=" #$output "/share/doc/"
8983 #$name "-" #$version)
8984 "etcprefix=$(DOCDIR)/examples")
8985 #:phases
8986 #~(modify-phases %standard-phases
8987 (delete 'configure)))) ; no configure script
8988 (native-inputs
8989 (list python-wrapper)) ; to generate example mcelog.conf
8990 (supported-systems (list "i686-linux" "x86_64-linux"))
8991 (home-page "https://mcelog.org/")
8992 (synopsis "Machine check monitor for x86 Linux systems")
8993 (description
8994 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
8995systems running the kernel Linux. It can also perform user-defined tasks, such
8996as bringing bad pages off-line, when configurable error thresholds are
8997exceeded.")
8998 (license license:gpl2)))
8999
9000(define-public mtd-utils
9001 (package
9002 (name "mtd-utils")
9003 (version "2.1.5")
9004 (source (origin
9005 (method url-fetch)
9006 (uri (string-append
9007 "ftp://ftp.infradead.org/pub/mtd-utils/"
9008 "mtd-utils-" version ".tar.bz2"))
9009 (sha256
9010 (base32
9011 "0ilz8hkcyvfcnqpy25kbr8fb71x9vl28wbmw56vvd68n2byjfviq"))))
9012 (arguments
9013 (list #:configure-flags
9014 (if (%current-target-system) ; When cross-compiling.
9015 #~(list)
9016 #~(list "--enable-unit-tests"))
9017
9018 #:parallel-tests? #f)) ;tests may fail when running in parallel
9019 (native-inputs
9020 (list cmocka pkg-config))
9021 (inputs
9022 (list acl ; extended attributes (xattr)
9023 lzo
9024 openssl ; optional crypto support
9025 `(,util-linux "lib")
9026 zlib
9027 `(,zstd "lib")))
9028 (build-system gnu-build-system)
9029 (synopsis "MTD Flash Storage Utilities")
9030 (description "This package provides utilities for testing, partitioning, etc
9031of flash storage.")
9032 (home-page "http://www.linux-mtd.infradead.org/")
9033 (license
9034 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
9035 license:mpl1.1 ; All ftl* files
9036 license:expat)))) ; libiniparser
9037
9038(define-public libseccomp
9039 (package
9040 (name "libseccomp")
9041 (version "2.6.0")
9042 (source (origin
9043 (method git-fetch)
9044 (uri (git-reference
9045 (url "https://github.com/seccomp/libseccomp")
9046 (commit (string-append "v" version))))
9047 (file-name (git-file-name name version))
9048 (sha256
9049 (base32
9050 "189yh66aj3z3jvns739qbj504f3mcl3w44pxxizw877pbj3kal11"))))
9051 (build-system gnu-build-system)
9052 (arguments
9053 (list
9054 #:configure-flags #~(list "--disable-static")
9055 #:phases #~(modify-phases %standard-phases
9056 #$@(if (target-ppc32?)
9057 ;; This test is removed upstream. See upstream commit
9058 ;; 7db46d72f13c172b290818f624c2966bd0db5677
9059 #~((add-after 'unpack 'skip-62-sim-arch-tests
9060 (lambda _
9061 (substitute*
9062 "tests/62-sim-arch_transactions.tests"
9063 (("test type: bpf-sim-fuzz") "")
9064 (("62-sim-arch_transactions 5") "")))))
9065 #~())
9066 (add-before 'check 'skip-load-test
9067 (lambda _
9068 ;; This test does a native system call and fails when
9069 ;; run under QEMU user-mode emulation. Just skip it.
9070 (delete-file "tests/52-basic-load.tests"))))))
9071 (native-inputs
9072 (list autoconf automake gperf libtool which))
9073 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
9074 (description "The libseccomp library provides an easy to use, platform
9075independent, interface to the Linux Kernel's syscall filtering mechanism. The
9076libseccomp API is designed to abstract away the underlying BPF based syscall
9077filter language and present a more conventional function-call based filtering
9078interface that should be familiar to, and easily adopted by, application
9079developers.")
9080 (home-page "https://github.com/seccomp/libseccomp")
9081 (license license:lgpl2.1)))
9082
9083(define-public radeontop
9084 (package
9085 (name "radeontop")
9086 (version "1.4")
9087 (source
9088 (origin
9089 (method git-fetch)
9090 (uri (git-reference
9091 (url "https://github.com/clbr/radeontop")
9092 (commit (string-append "v" version))))
9093 (file-name (git-file-name name version))
9094 (sha256
9095 (base32 "0kwqddidr45s1blp0h8r8h1dd1p50l516yb6mb4s6zsc827xzgg3"))))
9096 (build-system gnu-build-system)
9097 (arguments
9098 `(#:phases (modify-phases %standard-phases
9099 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
9100 ;; dependency, and doesn't even work on release(!) tarballs.
9101 (add-after 'unpack 'report-correct-version
9102 (lambda _
9103 (substitute* "getver.sh"
9104 (("ver=unknown")
9105 (string-append "ver=" ,version)))))
9106 (delete 'configure)) ; no configure script
9107 #:make-flags (list (string-append "CC=" ,(cc-for-target))
9108 (string-append "PREFIX=" %output))
9109 #:tests? #f)) ; no tests
9110 (native-inputs
9111 (list gettext-minimal pkg-config))
9112 (inputs
9113 (list libdrm libpciaccess libxcb ncurses))
9114 (home-page "https://github.com/clbr/radeontop/")
9115 (synopsis "Usage monitor for AMD Radeon graphics")
9116 (description "RadeonTop monitors resource consumption on supported AMD
9117Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
9118a terminal or saved to a file for further processing. It measures both the
9119activity of the GPU as a whole, which is also accurate during OpenCL
9120computations, as well as separate component statistics that are only meaningful
9121under OpenGL graphics workloads.")
9122 (license license:gpl3)))
9123
9124(define-public efivar
9125 (package
9126 (name "efivar")
9127 (version "39")
9128 (source (origin
9129 (method git-fetch)
9130 (uri (git-reference
9131 (url "https://github.com/rhboot/efivar")
9132 (commit version)))
9133 (file-name (git-file-name name version))
9134 (sha256
9135 (base32
9136 "1zd9dghg1z2rrsazv3d9rj7nik6kdqz42jiak65pipz7mpjn9zdk"))
9137 (patches (search-patches "efivar-fix-fprint-format.patch"))))
9138 (build-system gnu-build-system)
9139 (arguments
9140 (list
9141 ;; Tests require a UEFI system and is not detected in the chroot.
9142 #:tests? #f
9143 #:make-flags #~(list (string-append "prefix="
9144 #$output)
9145 (string-append "libdir="
9146 #$output "/lib")
9147 (string-append "CC="
9148 #$(cc-for-target))
9149 "HOSTCC=gcc"
9150 (string-append "LDFLAGS=-Wl,-rpath="
9151 #$output "/lib")
9152 ;; Strictly only needed for i686-linux/32bit
9153 "CFLAGS=-g -O2 -Wno-error=format")
9154 #:phases #~(modify-phases %standard-phases
9155 (add-after 'unpack 'build-deterministically
9156 (lambda _
9157 (substitute* "src/include/defaults.mk"
9158 ;; Don't use -march=native.
9159 (("-march=native")
9160 ""))))
9161 (delete 'configure))))
9162 (native-inputs (list mandoc pkg-config))
9163 (inputs (list popt))
9164 (home-page "https://github.com/rhboot/efivar")
9165 (synopsis "Tool and library to manipulate EFI variables")
9166 (description "This package provides a library and a command line
9167interface to the variable facility of UEFI boot firmware.")
9168 (license license:lgpl2.1+)))
9169
9170(define-public efibootmgr
9171 (package
9172 (name "efibootmgr")
9173 (version "18")
9174 (source
9175 (origin
9176 (method git-fetch)
9177 (uri (git-reference
9178 (url "https://github.com/rhboot/efibootmgr")
9179 (commit version)))
9180 (file-name (git-file-name name version))
9181 (sha256
9182 (base32 "1j19m3dngcb7jl88ib32phbh5r7c02dhhakq8jk6z7y408c111hd"))))
9183 (build-system gnu-build-system)
9184 (arguments
9185 (list
9186 #:tests? #f ;no tests
9187 #:make-flags
9188 #~(append (list (string-append "prefix=" #$output)
9189 (string-append "libdir=" #$output "/lib")
9190 ;; EFIDIR denotes a subdirectory relative to the
9191 ;; EFI System Partition where the loader will be
9192 ;; installed (known as OS_VENDOR in the code).
9193 ;; GRUB overrides this, as such it's only used if
9194 ;; nothing else is specified on the command line.
9195 "EFIDIR=gnu")
9196 #$(if (%current-target-system)
9197 #~(list
9198 (string-append "CC=" #$(cc-for-target))
9199 (string-append "PKG_CONFIG=" #$(pkg-config-for-target))
9200 (string-append "EXTRAINCDIRS="
9201 #$(this-package-input "efivar") "/include"))
9202 #~'()))
9203 #:phases #~(modify-phases %standard-phases (delete 'configure))))
9204 (native-inputs
9205 (list pkg-config))
9206 (inputs
9207 (list efivar popt))
9208 (home-page "https://github.com/rhboot/efibootmgr")
9209 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
9210 (description
9211 "@code{efibootmgr} is a user-space application to modify the Intel
9212Extensible Firmware Interface (EFI) Boot Manager. This application can
9213create and destroy boot entries, change the boot order, change the next
9214running boot option, and more.")
9215 (license license:gpl2+)))
9216
9217(define-public sysstat
9218 (package
9219 (name "sysstat")
9220 (version "12.7.5")
9221 (source
9222 (origin
9223 (method url-fetch)
9224 (uri (string-append "https://sysstat.github.io/sysstat-packages/"
9225 "sysstat-" version ".tar.xz"))
9226 (sha256
9227 (base32 "0ssdrm3k0fclq5b5i0aznfwdkbac9l9cf88idaq3pls9lm040rjp"))))
9228 (build-system gnu-build-system)
9229 (native-inputs (list gettext-minimal))
9230 (arguments
9231 `(#:tests? #f ; no test suite.
9232 ;; Without this flag, it tries to install the man pages with group 'root'
9233 ;; and fails because /etc/passwd lacks an entry for the root user.
9234 #:configure-flags
9235 (list "--disable-file-attr"
9236 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
9237 #:phases
9238 (modify-phases %standard-phases
9239 ;; The build process tries to create '/var/lib/sa', so we skip that
9240 ;; instruction.
9241 (add-after 'build 'skip-touching-var
9242 (lambda _
9243 (substitute* "Makefile"
9244 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
9245 "")))))))
9246 (home-page "https://sysstat.github.io")
9247 (synopsis "Performance monitoring tools for Linux")
9248 (description "The sysstat utilities are a collection of performance
9249monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
9250@code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
9251@code{sadf} and @code{sa}.")
9252 (license license:gpl2+)))
9253
9254(define-public acpilight
9255 (package
9256 (name "acpilight")
9257 (version "1.2")
9258 (source (origin
9259 (method git-fetch)
9260 (uri (git-reference
9261 (url "https://gitlab.com/wavexx/acpilight.git")
9262 (commit (string-append "v" version))))
9263 (file-name (git-file-name name version))
9264 (sha256
9265 (base32
9266 "1r0r3nx6x6vkpal6vci0zaa1n9dfacypldf6k8fxg7919vzxdn1w"))))
9267 (build-system gnu-build-system)
9268 (arguments
9269 (list #:tests? #f ; no tests
9270 #:make-flags
9271 #~(list (string-append "prefix=" #$output)
9272 (string-append "sysconfdir=" #$output "/lib")) ;udev rule
9273 #:phases
9274 #~(modify-phases %standard-phases
9275 (delete 'configure)
9276 (add-after 'unpack 'patch
9277 (lambda* (#:key inputs #:allow-other-keys)
9278 ;; Prevent reloading udev at build time
9279 (substitute* "Makefile"
9280 (("udevadm") "true"))
9281 (substitute* "90-backlight.rules"
9282 (("/bin")
9283 (string-append #$(this-package-input "coreutils")
9284 "/bin"))))))))
9285 (inputs (list coreutils python))
9286 (home-page "https://gitlab.com/wavexx/acpilight")
9287 (synopsis "Backward-compatibile xbacklight replacement")
9288 (description "acpilight is a backward-compatibile replacement for
9289xbacklight that uses the ACPI interface to set the display brightness. On
9290modern laptops acpilight can control both display and keyboard backlight
9291uniformly on either X11, the console or Wayland.")
9292 (license license:gpl3+)))
9293
9294(define-public light
9295 (package
9296 (name "light")
9297 (version "1.2.2")
9298 (source
9299 (origin
9300 (method git-fetch)
9301 (uri (git-reference
9302 (url "https://github.com/haikarainen/light")
9303 (commit (string-append "v" version))))
9304 (sha256
9305 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
9306 (file-name (git-file-name name version))))
9307 (build-system gnu-build-system)
9308 (arguments
9309 `(#:configure-flags '("CFLAGS=-fcommon")
9310 #:phases
9311 (modify-phases %standard-phases
9312 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
9313 (lambda* (#:key inputs #:allow-other-keys)
9314 (substitute* "90-backlight.rules"
9315 (("/bin/chgrp") (which "chgrp"))
9316 (("/bin/chmod") (which "chmod")))
9317 #t))
9318 (add-after 'install 'install-udev-rules
9319 (lambda* (#:key outputs #:allow-other-keys)
9320 (let ((out (assoc-ref outputs "out")))
9321 (install-file
9322 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
9323 #t))))))
9324 (native-inputs
9325 (list autoconf automake))
9326 (home-page "https://haikarainen.github.io/light/")
9327 (synopsis "GNU/Linux application to control backlights")
9328 (description
9329 "Light is a program to send commands to screen backlight controllers
9330under GNU/Linux. Features include:
9331
9332@itemize
9333@item It does not rely on X.
9334@item Light can automatically figure out the best controller to use, making
9335full use of underlying hardware.
9336@item It is possible to set a minimum brightness value, as some controllers
9337set the screen to be pitch black at a value of 0 (or higher).
9338@end itemize\n")
9339 (license license:gpl3+)))
9340
9341(define-public brightnessctl
9342 (package
9343 (name "brightnessctl")
9344 (version "0.5.1")
9345 (home-page "https://github.com/Hummer12007/brightnessctl")
9346 (source (origin
9347 (method git-fetch)
9348 (uri (git-reference (url home-page) (commit version)))
9349 (file-name (git-file-name name version))
9350 (sha256
9351 (base32
9352 "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq"))
9353 (patches (search-patches "brightnessctl-elogind-support.patch"))))
9354 (build-system gnu-build-system)
9355 (arguments
9356 `(#:tests? #f ; no tests
9357 #:make-flags (list (string-append "CC=" ,(cc-for-target))
9358 (string-append "PREFIX=" %output)
9359 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/")
9360 "ENABLE_SYSTEMD=1")
9361 #:phases
9362 (modify-phases %standard-phases
9363 (delete 'configure)
9364 (add-after 'unpack 'adjust-udev-rules
9365 (lambda _
9366 (substitute* "Makefile"
9367 (("INSTALL_UDEV_RULES=0") "INSTALL_UDEV_RULES=1"))
9368 (substitute* "90-brightnessctl.rules"
9369 (("/bin/") "/run/current-system/profile/bin/"))
9370 #t)))))
9371 (native-inputs
9372 (list pkg-config))
9373 (inputs
9374 (list elogind))
9375 (synopsis "Backlight and LED brightness control")
9376 (description
9377 "This program allows you read and control device brightness. Devices
9378include backlight and LEDs. It can also preserve current brightness before
9379applying the operation, such as on lid close.
9380
9381The appropriate permissions must be set on the backlight or LED control
9382interface in sysfs, which can be accomplished with the included udev rules.")
9383 (license license:expat)))
9384
9385(define-public tlp
9386 (package
9387 (name "tlp")
9388 (version "1.9.0")
9389 (source
9390 (origin
9391 (method git-fetch)
9392 (uri (git-reference
9393 (url "https://github.com/linrunner/TLP")
9394 (commit version)))
9395 (file-name (git-file-name name version))
9396 (sha256
9397 (base32 "0msskz42yy0ddq6gqak0dsl77wsym24ly3bkpymfwl9dr3wzikv8"))))
9398 (native-inputs
9399 (list shellcheck))
9400 (inputs
9401 `(("dbus" ,dbus)
9402 ("ethtool" ,ethtool)
9403 ("eudev" ,eudev)
9404 ("grep" ,grep)
9405 ("guile" ,guile-3.0) ;for wrap-script
9406 ("hdparm" ,hdparm)
9407 ("inetutils" ,inetutils)
9408 ("iw" ,iw)
9409 ("kmod" ,kmod)
9410 ("pciutils" ,pciutils)
9411 ("perl" ,perl)
9412 ("sed" ,sed)
9413 ("usbutils" ,usbutils)
9414 ("util-linux" ,util-linux)
9415 ("wireless-tools" ,wireless-tools)
9416 ,@(if (let ((system (or (%current-target-system)
9417 (%current-system))))
9418 (or (string-prefix? "i686-" system)
9419 (string-prefix? "x86_64-" system)))
9420 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
9421 '())))
9422 (build-system gnu-build-system)
9423 (arguments
9424 ;; XXX: The full test suite is run with "checkall" but it requires
9425 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
9426 (list
9427 #:make-flags
9428 #~(list "TLP_CONFUSR=/etc/tlp.conf" "TLP_CONFDIR=/etc/tlp.d")
9429 #:test-target "shellcheck"
9430 #:modules '((guix build gnu-build-system)
9431 (guix build utils)
9432 (srfi srfi-1))
9433 #:phases
9434 #~(modify-phases %standard-phases
9435 (delete 'configure) ; no configure script
9436 (add-before 'build 'setenv
9437 (lambda _
9438 (setenv "TLP_WITH_SYSTEMD" "0")
9439 (setenv "TLP_NO_INIT" "1")))
9440 (add-before 'build 'fix-installation
9441 (lambda _
9442 ;; Stop the Makefile from trying to create system directories.
9443 (substitute* "Makefile"
9444 (("= /usr") (string-append "= " #$output))
9445 (("= /etc") (string-append "= " #$output "/etc"))
9446 (("install -d -m 755 \\$\\(_VAR\\)") "#"))))
9447 (add-before 'build 'fix-perl-calls
9448 ;; Shell scripts in "bat.d" and "func.d" call "perl". Fix
9449 ;; invocation without wrapping every one of them.
9450 (lambda* (#:key inputs #:allow-other-keys)
9451 (substitute* (append (find-files "bat.d" ".")
9452 (find-files "func.d" "."))
9453 (("(^|[^/])perl" _ prefix)
9454 (string-append prefix
9455 (search-input-file inputs "bin/perl"))))))
9456 (replace 'install
9457 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
9458 (add-after 'install 'wrap
9459 (lambda* (#:key inputs outputs #:allow-other-keys)
9460 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
9461 (sbin (string-append (assoc-ref outputs "out") "/sbin"))
9462 ;; Used to ignore symlinks which don't need wrapping
9463 (regular-file-predicate
9464 (lambda (file stat) (eq? 'regular (stat:type stat))))
9465 (bin-files (find-files bin regular-file-predicate))
9466 (sbin-files (find-files sbin regular-file-predicate)))
9467 (define (bin-directory input-name)
9468 (let ((p (assoc-ref inputs input-name)))
9469 (and p (string-append p "/bin"))))
9470 (define (sbin-directory input-name)
9471 (string-append (assoc-ref inputs input-name) "/sbin"))
9472 (for-each (lambda (program)
9473 ;; Programs rely on $0 so we use wrap-script
9474 ;; instead of wrap-program
9475 (wrap-script program
9476 `("PATH" ":" prefix
9477 ,(append
9478 (filter-map bin-directory
9479 '("bash"
9480 "coreutils"
9481 "dbus"
9482 "eudev"
9483 "grep"
9484 "inetutils"
9485 "kmod"
9486 "perl"
9487 "sed"
9488 "usbutils"
9489 "util-linux"
9490 "x86-energy-perf-policy"))
9491 (filter-map sbin-directory
9492 '("ethtool"
9493 "hdparm"
9494 "iw"
9495 "pciutils"
9496 "util-linux"
9497 "wireless-tools"))))))
9498 (append bin-files sbin-files))))))))
9499 (home-page "https://linrunner.de/en/tlp/tlp.html")
9500 (synopsis "Power management tool for Linux")
9501 (description "TLP is a power management tool for Linux. It comes with
9502a default configuration already optimized for battery life. Nevertheless,
9503TLP is customizable to fulfil system requirements. TLP settings are applied
9504every time the power supply source is changed.")
9505 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
9506 ;; rest is GPLv2+.
9507 (license (list license:gpl2+ license:gpl3+))))
9508
9509(define-public tlpui
9510 (package
9511 (name "tlpui")
9512 (version "1.9.0")
9513 (source
9514 (origin
9515 (method git-fetch)
9516 (uri (git-reference
9517 (url "https://github.com/d4nj1/TLPUI")
9518 (commit (string-append "tlpui-" version))))
9519 (file-name (git-file-name name version))
9520 (sha256
9521 (base32 "00rkq389zs525s7ckjj6cm34s25rsrgz47p28pp43ld35i538g9w"))))
9522 (build-system pyproject-build-system)
9523 (arguments
9524 (list
9525 #:phases
9526 #~(modify-phases %standard-phases
9527 (add-after 'unpack 'set-absolute-locations
9528 (lambda* (#:key inputs #:allow-other-keys)
9529 (let ((defaults.conf
9530 (search-input-file inputs "/share/tlp/defaults.conf"))
9531 (lspci (search-input-file inputs "/bin/lspci"))
9532 (lsusb (search-input-file inputs "/bin/lsusb"))
9533 (tlp-stat (search-input-file inputs "/bin/tlp-stat")))
9534 (with-directory-excursion "tlpui"
9535 (substitute* '("file.py" "settingshelper.py" "statui.py")
9536 (("\"tlp-stat\"")
9537 (string-append "'" tlp-stat "'"))
9538 (("/usr/share/tlp/defaults.conf")
9539 defaults.conf))
9540 (substitute* "ui_config_objects/gtkusblist.py"
9541 (("\"lsusb\"")
9542 (string-append "'" lsusb "'")))
9543 (substitute* "ui_config_objects/gtkpcilist.py"
9544 (("\"lspci\"")
9545 (string-append "'" lspci "'")))
9546 ;; Settings check if various tlp executables, lspci and
9547 ;; usbutils are available. Skip this phase since we know
9548 ;; for sure they are (and it avoids patching each location).
9549 (substitute* "settingshelper.py"
9550 (("(command_exists = ).*" _ lead)
9551 (string-append lead "True\n")))))))
9552 (add-after 'install 'install-desktop-file
9553 (lambda _
9554 (let ((dir (string-append #$output "/share/applications")))
9555 (install-file "tlpui.desktop" dir))))
9556 (add-after 'wrap 'wrap-gi-python
9557 (lambda _
9558 (let ((gi-typelib-path (getenv "GI_TYPELIB_PATH")))
9559 (wrap-program (string-append #$output "/bin/tlpui")
9560 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))))))))
9561 (native-inputs
9562 (list `(,glib "bin")
9563 gobject-introspection
9564 python-poetry-core
9565 python-pytest
9566 python-pyyaml))
9567 (inputs
9568 (list gtk+
9569 pciutils
9570 python-pygobject
9571 tlp
9572 usbutils))
9573 (propagated-inputs (list (librsvg-for-system)))
9574 (home-page "https://github.com/d4nj1/TLPUI")
9575 (synopsis "User interface for TLP written in Python")
9576 (description
9577 "The Python scripts in this project generate a GTK-UI to change
9578TLP configuration files easily. It aims to protect users from setting
9579bad configuration and to deliver a basic overview of all the valid
9580configuration values.")
9581 (license license:gpl2+)))
9582
9583(define-public lshw
9584 (package
9585 (name "lshw")
9586 (version "B.02.19.2")
9587 (source (origin
9588 (method url-fetch)
9589 (uri (string-append "https://www.ezix.org/software/"
9590 "files/lshw-" version
9591 ".tar.gz"))
9592 (sha256
9593 (base32
9594 "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
9595 (build-system gnu-build-system)
9596 (arguments
9597 `(#:phases (modify-phases %standard-phases (delete 'configure))
9598 #:tests? #f ; no tests
9599 #:make-flags
9600 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
9601 (synopsis "List hardware information")
9602 (description
9603 "@command{lshw} (Hardware Lister) is a small tool to provide
9604detailed information on the hardware configuration of the machine.
9605It can report exact memory configuration, firmware version, mainboard
9606configuration, CPU version and speed, cache configuration, bus speed,
9607and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
9608machines (PowerMac G4 is known to work).")
9609 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
9610 (license license:gpl2+)))
9611
9612(define-public libmnl
9613 (package
9614 (name "libmnl")
9615 (version "1.0.5")
9616 (source
9617 (origin
9618 (method url-fetch)
9619 (uri (string-append "mirror://netfilter.org/libmnl/"
9620 "libmnl-" version ".tar.bz2"))
9621 (sha256
9622 (base32
9623 "09851ns07399rbz0y8slrlmnw3fn1nakr8d37pxjn5gkks8rnjr7"))))
9624 (build-system gnu-build-system)
9625 (home-page "https://www.netfilter.org/projects/libmnl/")
9626 (synopsis "Netlink utility library")
9627 (description "Libmnl is a minimalistic user-space library oriented to
9628Netlink developers. There are a lot of common tasks in parsing, validating,
9629constructing of both the Netlink header and TLVs that are repetitive and easy to
9630get wrong. This library aims to provide simple helpers that allows you to
9631re-use code and to avoid re-inventing the wheel.")
9632 (properties
9633 '((release-monitoring-url . "https://www.netfilter.org/pub/libmnl/")))
9634 (license license:lgpl2.1+)))
9635
9636(define-public libnftnl
9637 (package
9638 (name "libnftnl")
9639 (version "1.2.8")
9640 (source
9641 (origin
9642 (method url-fetch)
9643 (uri (string-append "mirror://netfilter.org/libnftnl/"
9644 "libnftnl-" version ".tar.xz"))
9645 (sha256
9646 (base32 "15ddcyp91lxjh2wfi8xicjpffhn9rpiqsa8djbkqvc69npbabzip"))))
9647 (build-system gnu-build-system)
9648 (native-inputs
9649 (list pkg-config))
9650 (inputs
9651 (list libmnl))
9652 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
9653 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
9654 (description "Libnftnl is a userspace library providing a low-level netlink
9655programming interface to the in-kernel nf_tables subsystem. The library
9656libnftnl has been previously known as libnftables. This library is currently
9657used by nftables.")
9658 (license license:gpl2+)))
9659
9660;;; The symbol libnftl/fixed should be used when libnftnl needs fixes
9661;;; (security or else) and this deprecation could be removed.
9662(define-deprecated/public-alias libnftnl/fixed libnftnl/pinned)
9663
9664;; This is used in iptables, which contributes to rust. We're pinning this
9665;; variant to avoid accidental rebuilds of rust.
9666(define-public libnftnl/pinned
9667 (package
9668 (inherit libnftnl)
9669 (version "1.2.8")
9670 (source
9671 (origin
9672 (method url-fetch)
9673 (uri (string-append "mirror://netfilter.org/libnftnl/"
9674 "libnftnl-" version ".tar.xz"))
9675 (sha256
9676 (base32 "15ddcyp91lxjh2wfi8xicjpffhn9rpiqsa8djbkqvc69npbabzip"))))
9677 (build-system gnu-build-system)
9678 (native-inputs
9679 (list pkg-config))
9680 (inputs
9681 (list libmnl))))
9682
9683(define-public nftables
9684 (package
9685 (name "nftables")
9686 (version "1.0.8")
9687 (source
9688 (origin
9689 (method url-fetch)
9690 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
9691 version ".tar.xz")
9692 (string-append "https://www.nftables.org/projects/nftables"
9693 "/files/nftables-" version ".tar.xz")))
9694 (sha256
9695 (base32 "0l1xpwr9qfbl3bxa97v8s2lbibiz0xma9q0qi34xp0hswh6p8wwk"))))
9696 (build-system gnu-build-system)
9697 (arguments `(#:configure-flags
9698 '("--disable-static"
9699 "--with-cli=readline"
9700 "--with-json")
9701 #:phases
9702 (modify-phases %standard-phases
9703 (add-before 'configure 'autoreconf
9704 (lambda _
9705 (invoke "autoreconf" "-fi"))))))
9706 (inputs (list gmp libmnl libnftnl readline jansson))
9707 (native-inputs (list pkg-config
9708 bison
9709 flex
9710 docbook2x
9711 autoconf
9712 automake
9713 libtool))
9714 (home-page "https://www.nftables.org")
9715 (synopsis "Userspace utility for Linux packet filtering")
9716 (description "nftables is the project that aims to replace the existing
9717{ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
9718filtering framework, a new userspace utility and also a compatibility layer for
9719{ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
9720infrastructure such as the existing hooks, the connection tracking system, the
9721userspace queueing component and the logging subsystem.")
9722 (license license:gpl2)))
9723
9724(define-public libnetfilter-conntrack
9725 (package
9726 (name "libnetfilter-conntrack")
9727 (version "1.0.9")
9728 (source
9729 (origin
9730 (method url-fetch)
9731 (uri (string-append "https://netfilter.org/projects/"
9732 "libnetfilter_conntrack/files/"
9733 "libnetfilter_conntrack-"
9734 version ".tar.bz2"))
9735 (sha256
9736 (base32 "1a3rnpsba64dzy97wwjrxal89wr0nf9znvag2j18nkp3kzs9vgb7"))))
9737 (build-system gnu-build-system)
9738 (native-inputs (list pkg-config))
9739 (inputs (list libnfnetlink libmnl))
9740 (synopsis "Library for kernel connection tracking state table")
9741 (description "libnetfilter_conntrack is a userspace library providing a
9742programming interface (API) to the in-kernel connection tracking state table.
9743The library libnetfilter_conntrack has been previously known as
9744libnfnetlink_conntrack and libctnetlink. This library is currently used by
9745conntrack-tools among many other applications.")
9746 (home-page "https://netfilter.org/projects/libnetfilter_conntrack/index.html")
9747 (supported-systems (filter target-linux? %supported-systems))
9748 (properties '((upstream-name . "libnetfilter_conntrack")))
9749 (license license:gpl2+)))
9750
9751(define-public libnetfilter-cttimeout
9752 (package
9753 (name "libnetfilter-cttimeout")
9754 (version "1.0.1")
9755 (source
9756 (origin
9757 (method url-fetch)
9758 (uri (string-append "https://netfilter.org/projects/"
9759 "libnetfilter_cttimeout/files/"
9760 "libnetfilter_cttimeout-" version ".tar.bz2"))
9761 (sha256
9762 (base32 "0983cpyvxyycbnzqlrzml80pph2z51r6s7sxp06ciq8468pxln8b"))))
9763 (build-system gnu-build-system)
9764 (native-inputs (list pkg-config))
9765 (inputs (list libmnl))
9766 (synopsis "Library for kernel connection tracking timeout infrastructure")
9767 (description "libnetfilter_cttimeout is the userspace library that
9768provides the programming interface to the fine-grain connection tracking
9769timeout infrastructure. With this library, you can create, update and delete
9770timeout policies that can be attached to traffic flows. This library is used
9771by conntrack-tools.")
9772 (home-page "https://netfilter.org/projects/libnetfilter_cttimeout/index.html")
9773 (supported-systems (filter target-linux? %supported-systems))
9774 (properties '((upstream-name . "libnetfilter_cttimeout")))
9775 (license license:gpl2)))
9776
9777(define-public libnetfilter-cthelper
9778 (package
9779 (name "libnetfilter-cthelper")
9780 (version "1.0.1")
9781 (source
9782 (origin
9783 (method url-fetch)
9784 (uri (string-append "https://netfilter.org/projects/"
9785 "libnetfilter_cthelper/files/"
9786 "libnetfilter_cthelper-" version ".tar.bz2"))
9787 (sha256
9788 (base32 "04n95ngil5l8m8v64dfjm1dwq0wd3kf4vw1zblsrff13hxa3s1ql"))))
9789 (build-system gnu-build-system)
9790 (native-inputs (list pkg-config))
9791 (inputs (list libmnl))
9792 (synopsis "Library for user-space connection tracking helpers")
9793 (description "libnetfilter_cthelper is a userspace library that provides a
9794programming interface to user-space connection tracking helpers.
9795@enumerate
9796@item
9797register new user-space connection tracking helpers
9798@item
9799unregister user-space connection tracking helpers
9800@item
9801list existing registered user-space connection tracking helpers
9802@end enumerate")
9803 (home-page "https://netfilter.org/projects/libnetfilter_cthelper/index.html")
9804 (supported-systems (filter target-linux? %supported-systems))
9805 (properties '((upstream-name . "libnetfilter_cthelper")))
9806 (license license:gpl2+)))
9807
9808(define-public libnetfilter-queue
9809 (package
9810 (name "libnetfilter-queue")
9811 (version "1.0.5")
9812 (source
9813 (origin
9814 (method url-fetch)
9815 (uri (string-append "https://netfilter.org/projects/"
9816 "libnetfilter_queue/files/"
9817 "libnetfilter_queue-" version ".tar.bz2"))
9818 (sha256
9819 (base32
9820 "1xdra6i4p8jkv943ygjw646qx8df27f7p5852kc06vjx608krzzr"))))
9821 (build-system gnu-build-system)
9822 (native-inputs (list pkg-config))
9823 (inputs (list libmnl libnfnetlink))
9824 (synopsis "Library for kernel netfilter infrastructure and state")
9825 (description "libnetfilter_queue is a userspace library providing an API
9826to packets that have been queued by the kernel packet filter. It is is part
9827of a system that deprecates the old ip_queue/libipq mechanism.")
9828 (home-page "https://netfilter.org/projects/libnetfilter_queue/index.html")
9829 (supported-systems (filter target-linux? %supported-systems))
9830 (properties '((upstream-name . "libnetfilter_queue")))
9831 (license license:gpl2+)))
9832
9833(define-public conntrack-tools
9834 (package
9835 (name "conntrack-tools")
9836 (version "1.4.8")
9837 (source
9838 (origin
9839 (method url-fetch)
9840 (uri (string-append "https://netfilter.org/projects/"
9841 "conntrack-tools/files/"
9842 "conntrack-tools-" version ".tar.xz"))
9843 (sha256
9844 (base32 "1mnynl5a63j25arapwvkjbm3a2cqm3aaklwfwwclhmpnqps7fxh6"))))
9845 (build-system gnu-build-system)
9846 (native-inputs (list bison flex pkg-config))
9847 (inputs (list libtirpc
9848 libnetfilter-conntrack
9849 libnetfilter-cttimeout
9850 libnetfilter-cthelper
9851 libnetfilter-queue
9852 libnfnetlink
9853 libmnl))
9854 (synopsis "Set of tools targeting the conntrack kernel subsystem")
9855 (description "The tool conntrack provides a full featured interface that
9856is intended to replace the old @file{/proc/net/ip_conntrack} interface. Using
9857conntrack, you can view and manage the in-kernel connection tracking state
9858table from userspace. On the other hand, conntrackd covers the specific
9859aspects of stateful firewalls to enable highly available scenarios, and can be
9860used as statistics collector as well.
9861
9862Since 1.2.0, the conntrack-tools includes the @command{nfct} command line
9863utility. This utility only supports the nfnetlink_cttimeout by now. In the
9864long run, we expect that it will replace conntrack by providing a syntax
9865similar to nftables.")
9866 (home-page "https://netfilter.org/projects/conntrack-tools/index.html")
9867 (supported-systems (filter target-linux? %supported-systems))
9868 (license license:gpl2+)))
9869
9870(define-public libnetfilter-acct
9871 (package
9872 (name "libnetfilter-acct")
9873 (version "1.0.3")
9874 (source
9875 (origin
9876 (method url-fetch)
9877 (uri (string-append "https://netfilter.org/projects/"
9878 "libnetfilter_acct/files/"
9879 "libnetfilter_acct-" version ".tar.bz2"))
9880 (sha256
9881 (base32
9882 "06lsjndgfjsgfjr43px2n2wk3nr7whz6r405mks3887y7vpwwl22"))))
9883 (build-system gnu-build-system)
9884 (native-inputs (list pkg-config))
9885 (inputs (list libmnl))
9886 (synopsis "Library providing interface to extended accounting infrastructure")
9887 (description "libnetfilter_acct is the userspace library providing interface
9888to extended accounting infrastructure.
9889
9890@enumerate
9891@item
9892creating accounting objects
9893@item
9894retrieving accounting objects (and atomically set to zero)
9895@item
9896deleting accounting objects
9897@end enumerate
9898For the nfnetlink_acct subsystem.")
9899 (home-page "https://netfilter.org/projects/libnetfilter_acct/index.html")
9900 (supported-systems (filter target-linux? %supported-systems))
9901 (properties '((upstream-name . "libnetfilter_acct")))
9902 (license license:lgpl2.1+)))
9903
9904(define-public nfacct
9905 (package
9906 (name "nfacct")
9907 (version "1.0.2")
9908 (source
9909 (origin
9910 (method url-fetch)
9911 (uri (string-append "https://netfilter.org/projects/" name
9912 "/files/nfacct-" version ".tar.bz2"))
9913 (sha256
9914 (base32
9915 "0sdxbxjyapbqcp2ami5jd10vz4xbbdvx39f3wfy1iqsbflc25zzc"))))
9916 (build-system gnu-build-system)
9917 (native-inputs (list pkg-config))
9918 (inputs (list libmnl libnetfilter-acct))
9919 (synopsis "Command line tool to create/retrieve/delete accounting objects")
9920 (description "nfacct is the command line tool to create/retrieve/delete
9921accounting objects
9922@enumerate
9923@item
9924listing the objects of the nfacct table in plain text/XML
9925@item
9926atomically get and reset objects of the nfacct table
9927@item
9928adding new objects to the nfacct table
9929@item
9930deleting objects from the nfacct table
9931@end enumerate")
9932 (home-page "https://netfilter.org/projects/nfacct/index.html")
9933 (supported-systems (filter target-linux? %supported-systems))
9934 (license license:gpl2+)))
9935
9936(define-public libnetfilter-log
9937 (package
9938 (name "libnetfilter-log")
9939 (version "1.0.2")
9940 (source
9941 (origin
9942 (method url-fetch)
9943 (uri (string-append "https://netfilter.org/projects/"
9944 "libnetfilter_log/files/"
9945 "libnetfilter_log-" version ".tar.bz2"))
9946 (sha256
9947 (base32
9948 "1spy9xs41v76kid5ana8n126f3mvgq6fjibbfbj4kn0larbhix73"))))
9949 (build-system gnu-build-system)
9950 (native-inputs (list pkg-config))
9951 (inputs (list libnfnetlink libmnl))
9952 (synopsis "Library providing interface to packets logged by netfilter")
9953 (description "libnetfilter_log is a userspace library providing interface to
9954packets that have been logged by the kernel packet filter. It is is part of a
9955system that deprecates the old syslog/dmesg based packet logging. This library
9956has been previously known as libnfnetlink_log.
9957
9958@enumerate
9959@item
9960receiving to-be-logged packets from the kernel nfnetlink_log subsystem
9961@end enumerate")
9962 (home-page "https://netfilter.org/projects/libnetfilter_log/index.html")
9963 (supported-systems (filter target-linux? %supported-systems))
9964 (properties '((upstream-name . "libnetfilter_log")))
9965 (license license:gpl2+)))
9966
9967(define-public ulogd
9968 (package
9969 (name "ulogd")
9970 (version "2.0.7")
9971 (source
9972 (origin
9973 (method url-fetch)
9974 (uri (string-append "https://netfilter.org/projects/" name
9975 "/files/ulogd-" version ".tar.bz2"))
9976 (sha256
9977 (base32
9978 "0ax9959c4bapq78n13bbaibcf1gwjir3ngx8l2dh45lw9m4ha2lr"))))
9979 (build-system gnu-build-system)
9980 (outputs '("out"
9981 ;; additional non-default output plugins
9982 "json" "pcap" "sqlite3" "pgsql" "mysql"))
9983 (native-inputs (list pkg-config))
9984 (inputs (list libnfnetlink
9985 libmnl
9986 libnetfilter-log
9987 libnetfilter-conntrack
9988 libnetfilter-acct
9989 sqlite
9990 libpcap
9991 jansson
9992 postgresql
9993 (list mariadb "dev")
9994 zlib
9995 openssl))
9996 (arguments
9997 (list #:configure-flags
9998 #~(list (string-append "--with-pgsql="
9999 (assoc-ref %build-inputs "postgresql"))
10000 (string-append "--with-mysql="
10001 (assoc-ref %build-inputs "mariadb")))
10002 #:phases
10003 #~(modify-phases %standard-phases
10004 (add-after 'install 'install-doc
10005 (lambda _
10006 (let ((out-etc (string-append #$output "/etc"))
10007 (ulogd.conf "ulogd.conf"))
10008 (mkdir-p out-etc)
10009 (copy-file ulogd.conf (string-append out-etc "/"
10010 ulogd.conf)))))
10011 (add-after 'install 'setup-plugin-outputs
10012 (lambda* (#:key outputs #:allow-other-keys)
10013 (with-directory-excursion
10014 (string-append #$output "/lib/ulogd/")
10015 (for-each
10016 (lambda (output-name)
10017 (let ((output-dir (string-append
10018 (assoc-ref outputs output-name)
10019 "/lib/ulogd/")))
10020 (mkdir-p output-dir)
10021 (for-each
10022 (lambda (plugin)
10023 (copy-file plugin (string-append output-dir plugin))
10024 (delete-file plugin))
10025 (find-files "."
10026 (string-append "ulogd_output_"
10027 (string-upcase output-name)
10028 ".*$")))))
10029 (list "json" "pcap" "sqlite3" "pgsql" "mysql"))))))))
10030 (synopsis "Logging daemon for netfilter and iptables")
10031 (description "ulogd is a userspace logging daemon for netfilter/iptables
10032related logging. This includes per-packet logging of security violations,
10033per-packet logging for accounting, per-flow logging and flexible user-defined
10034accounting.
10035
10036@enumerate
10037@item
10038Packet and flow-based traffic accounting
10039@item
10040Flexible user-defined traffic accounting via nfacct infrastructure
10041@item
10042SQL database back-end support: SQLite3, PostgreSQL, MySQL
10043@item
10044Text-based output formats: CSV, XML, Netfilter's LOG, Netfilter's conntrack
10045@end enumerate")
10046 (home-page "https://netfilter.org/projects/nfacct/index.html")
10047 (supported-systems (filter target-linux? %supported-systems))
10048 (license license:gpl2)))
10049
10050(define-public proot
10051 (package
10052 (name "proot")
10053 (version "5.4.0")
10054 (source
10055 (origin
10056 (method git-fetch)
10057 (uri (git-reference
10058 (url "https://github.com/proot-me/PRoot")
10059 (commit (string-append "v" version))))
10060 (file-name (git-file-name name version))
10061 (sha256
10062 (base32 "186qsg4yvisqjgf8w5jxhnlig7x341vpqwcgp8as3r59qmqkpmk7"))
10063 ;; Waiting for upstream inclusion at
10064 ;; https://github.com/proot-me/proot/pull/355
10065 (patches (search-patches "proot-add-clone3.patch"
10066 "proot-add-missing-include.patch"))))
10067 (build-system gnu-build-system)
10068 ;; Many architectures are not supported (see:
10069 ;; https://github.com/proot-me/proot/blob/master/src/arch.h#L51).
10070 (supported-systems '("x86_64-linux" "i686-linux"
10071 "armhf-linux" "aarch64-linux" "i586-gnu" "x86_64-gnu"))
10072 (arguments
10073 ;; Disable the test suite on armhf-linux, as there are too many
10074 ;; failures to keep track of (see for example:
10075 ;; https://github.com/proot-me/proot/issues/286).
10076 (list
10077 #:tests? (not (or (%current-target-system)
10078 (string-prefix? "armhf"
10079 (or (%current-system)))))
10080 #:make-flags
10081 #~'("-C" "src")
10082 #:phases
10083 #~(modify-phases %standard-phases
10084 (add-after 'unpack 'patch-sources
10085 (lambda* (#:key inputs #:allow-other-keys)
10086 (substitute* (find-files "src" "\\.[ch]$")
10087 (("\"/bin/sh\"")
10088 (format #f "~s" (search-input-file inputs "/bin/sh"))))
10089
10090 (substitute* "src/GNUmakefile"
10091 (("/bin/echo") (which "echo"))
10092 (("^VERSION = .*")
10093 (string-append "VERSION := " #$version "\n")))
10094
10095 (substitute* (find-files "test" "\\.sh$")
10096 ;; Some of the tests try to "bind-mount" /bin/true.
10097 (("-b /bin/true:")
10098 (string-append "-b " (which "true") ":"))
10099 ;; Likewise for /bin.
10100 (("-b /bin:") "-b /gnu:")
10101 ;; Others try to run /bin/sh.
10102 (("/bin/sh") (which "sh"))
10103 ;; Others assume /etc/fstab exists.
10104 (("/etc/fstab") "/etc/passwd"))
10105 (substitute* "test/GNUmakefile"
10106 (("-b /bin:") "-b /gnu:"))
10107 (substitute* "test/test-c6b77b77.mk"
10108 (("/bin/bash") (which "bash"))
10109 (("/usr/bin/test") (which "test")))
10110 (substitute* "test/test-16573e73.c"
10111 (("/bin/([a-z-]+)" _ program)
10112 (which program)))
10113 (substitute* "test/test-5467b986.sh"
10114 (("-w /usr") "-w /gnu")
10115 (("-w usr") "-w gnu")
10116 (("/usr/share") "/gnu/store")
10117 (("share") "store"))
10118 (substitute* "test/test-092c5e26.sh"
10119 (("-q echo ")
10120 "-q $(which echo) "))
10121
10122 ;; The socket tests requires networking.
10123 (for-each delete-file
10124 (find-files "test" "test-socket.*\\.sh$"))))
10125 (delete 'configure)
10126 (add-after 'build 'build-manpage
10127 (lambda _
10128 (with-directory-excursion "doc"
10129 (invoke "make" "proot/man.1" "SUFFIX=.py"))))
10130 (replace 'check
10131 (lambda* (#:key tests? #:allow-other-keys)
10132 (when tests?
10133 ;; Most of the tests expect "/bin" to be in $PATH so
10134 ;; they can run things that live in $ROOTFS/bin.
10135 (setenv "PATH" (string-append (getenv "PATH") ":/bin"))
10136 (invoke "make" "check" "-C" "test"
10137 "-j" (number->string (parallel-job-count))))))
10138 (replace 'install
10139 (lambda _
10140 ;; The 'install' rule does nearly nothing.
10141 (let ((man1 (string-append #$output "/share/man/man1")))
10142 ;; TODO: 'make install-care' (does not even
10143 ;; build currently.)
10144 (invoke "make" "-C" "src" "install"
10145 (string-append "PREFIX=" #$output))
10146 (mkdir-p man1)
10147 (copy-file "doc/proot/man.1"
10148 (string-append man1 "/proot.1"))))))))
10149 (native-inputs (list which
10150 ;; For 'mcookie', used by some of the tests.
10151 util-linux
10152 coreutils
10153 pkg-config
10154 ;; For rst2man, used to generate the manual page.
10155 python-docutils-0.19))
10156 (inputs (list libarchive talloc))
10157 (home-page "https://github.com/proot-me/PRoot")
10158 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
10159 (description
10160 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
10161and @code{binfmt_misc}. This means that users don't need any privileges or
10162setup to do things like using an arbitrary directory as the new root
10163file system, making files accessible somewhere else in the file system
10164hierarchy, or executing programs built for another CPU architecture
10165transparently through QEMU user-mode. Also, developers can use PRoot as a
10166generic process instrumentation engine thanks to its extension mechanism.
10167Technically PRoot relies on @code{ptrace}, an unprivileged system-call
10168available in the kernel Linux.")
10169 (license license:gpl2+)))
10170
10171(define-public proot-static
10172 (package
10173 (inherit proot)
10174 (name "proot-static")
10175 (synopsis
10176 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
10177 (inputs (list talloc/static))
10178 (arguments
10179 (substitute-keyword-arguments arguments
10180 ((#:make-flags flags)
10181 #~(cons* "LDFLAGS = -ltalloc -static -static-libgcc" #$flags))
10182 ((#:phases phases)
10183 #~(modify-phases #$phases
10184 (add-after 'strip 'remove-store-references
10185 (lambda _
10186 (with-directory-excursion #$output
10187 (remove-store-references "bin/proot"))))))
10188 ((#:allowed-references _ '("out"))
10189 '("out"))))))
10190
10191(define-public cpuid
10192 (package
10193 (name "cpuid")
10194 (version "20260220")
10195 (source (origin
10196 (method url-fetch)
10197 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
10198 version ".src.tar.gz"))
10199 (sha256
10200 (base32
10201 "1ywg1fzbk153sil3n0mdrah3728j76dbjj8c24gig4g5bbbhyqp7"))))
10202 (build-system gnu-build-system)
10203 (arguments
10204 (list #:make-flags
10205 #~(list (string-append "CC=" #$(cc-for-target)))
10206 #:tests? #f ; no tests
10207 #:phases
10208 #~(modify-phases %standard-phases
10209 (delete 'configure) ; no configure script
10210 (add-before 'install 'fix-makefile
10211 (lambda* (#:key outputs #:allow-other-keys)
10212 (substitute* "Makefile"
10213 (("\\$\\(BUILDROOT\\)/usr")
10214 (assoc-ref outputs "out"))))))))
10215 (inputs (list perl))
10216 (supported-systems '("i686-linux" "x86_64-linux"))
10217 (home-page "https://www.etallen.com/cpuid.html")
10218 (synopsis "Dump x86 CPUID processor information")
10219 (description "cpuid dumps detailed information about the CPU(s) gathered
10220from the CPUID instruction, and also determines the exact model of CPU(s). It
10221supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
10222NexGen, Rise, and SiS CPUs.")
10223 (license license:gpl2+)))
10224
10225(define-public jmtpfs
10226 (package
10227 (name "jmtpfs")
10228 (version "0.5")
10229 (source
10230 (origin
10231 (method git-fetch)
10232 (uri (git-reference
10233 (url "https://github.com/JasonFerrara/jmtpfs")
10234 (commit (string-append "v" version))))
10235 (file-name (git-file-name name version))
10236 (sha256
10237 (base32
10238 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
10239 (build-system gnu-build-system)
10240 (inputs
10241 (list file fuse-2 libmtp))
10242 (native-inputs
10243 (list pkg-config))
10244 (home-page "https://github.com/JasonFerrara/jmtpfs")
10245 (synopsis "Use a FUSE file system to access data over MTP")
10246 (description "jmtpfs uses @acronym{FUSE, File system in USEr space} to
10247provide access to data over @acronym{MTP, the Media Transfer Protocol}.
10248Unprivileged users can mount the MTP device as a file system.")
10249 (license license:gpl3)))
10250
10251(define-public procenv
10252 (package
10253 (name "procenv")
10254 (version "0.60")
10255 (source
10256 (origin
10257 (method git-fetch)
10258 (uri (git-reference
10259 (url "https://github.com/jamesodhunt/procenv")
10260 (commit version)))
10261 (file-name (git-file-name name version))
10262 (sha256
10263 (base32 "00d7q0h4qjc8lg435lq77lp2fx6ikm5piq90m81mr1dqqna1g6pz"))))
10264 (build-system gnu-build-system)
10265 (native-inputs
10266 (list pkg-config
10267 ;; For tests.
10268 check groff))
10269 (inputs
10270 (list expat libcap libselinux))
10271 (synopsis "Utility to show process environment")
10272 (description
10273 "Procenv is a command-line tool that displays as much detail about
10274itself and its environment as possible. It can be used as a test
10275tool, to understand the type of environment a process runs in, and for
10276comparing system environments.")
10277 (home-page "https://github.com/jamesodhunt/procenv/")
10278 (license license:gpl3+)))
10279
10280(define-public cassini-headers
10281 (package
10282 (name "cassini-headers")
10283 (version "14.0.0")
10284 (home-page "https://github.com/HewlettPackard/shs-cassini-headers")
10285 (source (origin
10286 (method git-fetch)
10287 (uri (git-reference
10288 (url home-page)
10289 (commit (string-append "release/shs-" version))))
10290 (file-name (git-file-name name version))
10291 (sha256
10292 (base32
10293 "074r1snc682f1b6vgswyz55n8zjf5rhqnsl31xsswih7q9q38jda"))
10294 (patches (search-patches "cassini-headers-memset.patch"))))
10295 (build-system copy-build-system)
10296 (arguments
10297 (list #:install-plan
10298 #~'(("include" "include")
10299 ("share/cassini-headers" "share/cassini-headers"))))
10300 (synopsis "Cassini network hardware definitions and headers")
10301 (description
10302 "This package provides hardware definitions and C headers for use by
10303the Linux driver and by user-space applications for the Cassini/Slingshot
10304high-speed network interconnect made by HPE (formerly Cray). User-land
10305software uses @file{cxi_prov_hw.h} from this package.")
10306 ;; As per include/cxi_prov_hw.h it is __aarch64__ or __x86_64__ only.
10307 (supported-systems '("x86_64-linux" "aarch64-linux"))
10308 (license (list license:gpl2 license:bsd-2)))) ;dual-licensed
10309
10310(define-public cxi-driver
10311 (package
10312 (name "cxi-driver")
10313 (version "14.0.0")
10314 (home-page "https://github.com/HewlettPackard/shs-cxi-driver")
10315 (source
10316 (origin
10317 (method git-fetch)
10318 (uri (git-reference
10319 (url home-page)
10320 (commit (string-append "release/shs-" version))))
10321 (file-name (git-file-name name version))
10322 (sha256
10323 (base32
10324 "07dhdm1az9hvy48iq8bn0wypwyml59yr5aqqyf1yhwrf1basry9g"))))
10325 ;; TODO: Actually build the Linux driver.
10326 (build-system copy-build-system)
10327 (arguments
10328 (list #:install-plan #~'(("include" "include"))))
10329 (propagated-inputs (list cassini-headers))
10330 (synopsis "Linux driver for the Cassini/Slingshot interconnect")
10331 (description
10332 "This is the Linux driver for the Cray/HPE Cassini 1 and 2 high-speed
10333network interconnect (aka. Slingshot), and its Ethernet driver. It includes
10334the @file{uapi/misc/cxi.h} C header file for use by user-land software.
10335
10336Currently the Linux driver itself is missing from this package.")
10337 (license license:gpl2+)))
10338
10339(define-public cxi-driver-for-libfabric-1
10340 ;; This old version defines constants such as 'CXI_MAP_IOVA_ALLOC' that
10341 ;; libfabric 1.22.0 relies on.
10342 (let ((commit "5f0ec0ead6ef3f98542a2ef5e76b89d14dd22150")
10343 (revision "0"))
10344 (package
10345 (inherit cxi-driver)
10346 (name "cxi-driver")
10347 (version (git-version "1.0.0" ;per .spec file
10348 revision commit))
10349 (home-page "https://github.com/HewlettPackard/shs-cxi-driver")
10350 (source
10351 (origin
10352 (method git-fetch)
10353 (uri (git-reference (url home-page) (commit commit)))
10354 (file-name (git-file-name name version))
10355 (sha256
10356 (base32
10357 "19cly014ihgdidrc1aki2xsbfhpc0g73v0vxcky8r27xza7rz5bg")))))))
10358
10359(define-public libcxi
10360 (package
10361 (name "libcxi")
10362 ;; Note: Do not upgrade until
10363 ;; <https://github.com/HewlettPackard/shs-libcxi/issues/18> is resolved.
10364 (version "13.0.0")
10365 (home-page "https://github.com/HewlettPackard/shs-libcxi")
10366 (source
10367 (origin
10368 (method git-fetch)
10369 (uri (git-reference (url home-page)
10370 (commit (string-append "release/shs-" version))))
10371 (file-name (git-file-name name version))
10372 (sha256
10373 (base32 "1m8mds1h8plhfn2ja9br31xaiy82ky69685cp1rznanl18inaiff"))))
10374 (build-system gnu-build-system)
10375 (arguments
10376 (list #:configure-flags
10377 #~(list "--disable-static"
10378 (string-append "--with-udevrulesdir="
10379 #$output "/lib/udev/rules.d"))
10380
10381 #:phases
10382 #~(modify-phases %standard-phases
10383 (add-before 'configure 'set-cassini-file-names
10384 (lambda* (#:key inputs #:allow-other-keys)
10385 (substitute* "utils/cxi_dump_csrs.py"
10386 (("/usr/share/cassini-headers/csr_defs.json")
10387 (search-input-file
10388 inputs
10389 "/share/cassini-headers/csr_defs.json"))))))))
10390 (native-inputs (list autoconf
10391 automake
10392 libtool
10393 pkg-config
10394 python-wrapper))
10395 (inputs (list libconfig
10396 libuv
10397 fuse-2
10398 libyaml
10399 libnl
10400 numactl
10401 eudev
10402 (list lm-sensors "lib")))
10403 (propagated-inputs (list cassini-headers cxi-driver))
10404 (synopsis "Interface to the Cassini/Slingshot high-speed interconnect")
10405 (description
10406 "Libcxi provides applications with a low-level interface to the
10407Cray/HPE Cassini high-speed @acronym{NIC, network interface controller}, also
10408known as Slingshot.")
10409
10410 ;; License is spelled out in 'cray-libcxi.spec' and in source file
10411 ;; headers.
10412 (license (list license:lgpl2.1+ license:bsd-3)))) ;dual-licensed
10413
10414(define-public libfabric
10415 (package
10416 (name "libfabric")
10417 (version "2.5.1")
10418 (source
10419 (origin
10420 (method git-fetch)
10421 (uri (git-reference
10422 (url "https://github.com/ofiwg/libfabric")
10423 (commit (string-append "v" version))))
10424 (file-name (git-file-name name version))
10425 (sha256 (base32 "15z0g1z62hv6kkiksvpxl6xv07wdmnvqhm5vnh0vq4ipr8f5vikp"))))
10426 (build-system gnu-build-system)
10427 (native-inputs
10428 (list autoconf
10429 automake
10430 libtool))
10431 (inputs
10432 (let ((if-supported ;XXX: modified from openmpi
10433 (lambda (package . extra)
10434 (if (and (not (%current-target-system))
10435 (member (%current-system)
10436 (package-transitive-supported-systems package)))
10437 (cons package extra)
10438 '()))))
10439 (append (list rdma-core libnl)
10440 (if-supported psm)
10441 (if-supported psm2)
10442 (if-supported libcxi curl json-c))))
10443 (arguments
10444 (list #:configure-flags
10445 #~(append (if #$(target-64bit?)
10446 (list "--enable-efa")
10447 '())
10448 (list #$@(if (this-package-input "libcxi")
10449 #~("--enable-cxi")
10450 #~())
10451 #$@(if (this-package-input "rocr-runtime")
10452 #~((string-append "--with-rocr="
10453 #$(this-package-input "rocr-runtime")))
10454 #~())
10455 "--enable-verbs"))
10456 #:phases
10457 #~(modify-phases %standard-phases
10458 (add-after 'install 'remove-libtool-archive
10459 (lambda _
10460 ;; 'libfabric.la' has '-ljson-c' without a corresponding
10461 ;; '-L' in 'dependency_libs', which in turn causes users
10462 ;; such as Open MPI to fail at link time due to '-ljson-c'
10463 ;; not being found, even when building a shared library.
10464 ;; So, remove the .la file.
10465 (delete-file
10466 (string-append #$output
10467 "/lib/libfabric.la")))))))
10468 (home-page "https://ofiwg.github.io/libfabric/")
10469 (synopsis "Open Fabric Interfaces")
10470 (description
10471 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
10472communication services to applications. OFI is best described as a collection
10473of libraries and applications used to export fabric services. The key
10474components of OFI are: application interfaces, provider libraries, kernel
10475services, daemons, and test applications.
10476
10477Libfabric is a core component of OFI. It is the library that defines and
10478exports the user-space API of OFI, and is typically the only software that
10479applications deal with directly. It works in conjunction with provider
10480libraries, which are often integrated directly into libfabric.")
10481 (license (list license:bsd-2 license:gpl2)))) ;dual
10482
10483;; Note: ROCm support is kept separate to avoid a significant increase in
10484;; closure size: <https://codeberg.org/guix/guix/issues/7225>.
10485(define-public libfabric-rocm
10486 (package/inherit libfabric
10487 (name "libfabric-rocm")
10488 (inputs (modify-inputs inputs
10489 (append rocr-runtime)))
10490 (synopsis "Open Fabric Interfaces (with ROCm support)")))
10491
10492(define-public libfabric-1 ;needed by Open MPI 4.x
10493 (package
10494 (inherit libfabric)
10495 (name "libfabric")
10496 (version "1.22.0")
10497 (source
10498 (origin
10499 (method git-fetch)
10500 (uri (git-reference
10501 (url "https://github.com/ofiwg/libfabric")
10502 (commit (string-append "v" version))))
10503 (file-name (git-file-name name version))
10504 (sha256 (base32 "1scwkfdnlg20hld03pdq83jq1q3nmvj1gravpn02pacqq18bv9xk"))))
10505 (inputs
10506 (modify-inputs inputs
10507 (append cxi-driver-for-libfabric-1)))))
10508
10509(define-public psm
10510 (package
10511 (name "psm")
10512 (version "3.3.20170428")
10513 (home-page "https://github.com/intel/psm")
10514 (source
10515 (origin
10516 (method git-fetch)
10517 (uri (git-reference (url home-page)
10518 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
10519 (file-name (string-append "psm-" version ".tar.gz"))
10520 (sha256
10521 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
10522 (patches (search-patches
10523 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
10524 "psm-ldflags.patch" ; build shared lib with LDFLAGS
10525 "psm-repro.patch" ; reproducibility
10526 "psm-disable-memory-stats.patch"))
10527 (modules '((guix build utils)))
10528 (snippet
10529 ;; That file declares its own 'strlcat' as static. To avoid a
10530 ;; conflict with the function now in glibc 2.39, give it a
10531 ;; different name.
10532 #~(substitute* "ptl_ips/ips_proto_dump.c"
10533 (("strlcat")
10534 "psm_custom_strlcat")))))
10535 (build-system gnu-build-system)
10536 (outputs '("out" "debug"))
10537 (inputs `(("libuuid" ,util-linux "lib")))
10538 (arguments
10539 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
10540 ,(string-append "INSTALL_PREFIX=" %output)
10541 ,(string-append "CFLAGS=-Wall -fpic -fPIC -D_GNU_SOURCE"
10542 " -funwind-tables -O3 -g3"
10543 " -DPSM_USE_SYS_UUID"
10544 " -Wno-strict-aliasing -DNVALGRIND"
10545 " -fcommon")
10546 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
10547 #:tests? #f
10548 #:phases (modify-phases %standard-phases
10549 (delete 'configure)
10550 (add-after 'unpack 'patch-/usr/include
10551 (lambda _
10552 (substitute* "Makefile"
10553 (("\\$\\{DESTDIR}/usr/include")
10554 (string-append %output "/include")))
10555 (substitute* "Makefile"
10556 (("/lib64") "/lib"))
10557 #t))
10558 (add-after 'unpack 'patch-sysmacros
10559 (lambda _
10560 (substitute* "ipath/ipath_proto.c"
10561 (("#include <sys/poll.h>" m)
10562 (string-append m "\n"
10563 "#include <sys/sysmacros.h>")))
10564 #t)))))
10565 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
10566 (description
10567 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
10568communications interface for the True Scale family of products. PSM users are
10569enabled with mechanisms necessary to implement higher level communications
10570interfaces in parallel environments.")
10571 ;; Only Intel-compatible processors are supported.
10572 (supported-systems '("i686-linux" "x86_64-linux"))
10573 (license (list license:bsd-2 license:gpl2)))) ;dual
10574
10575(define-public snapscreenshot
10576 (package
10577 (name "snapscreenshot")
10578 (version "1.0.14.3")
10579 (source
10580 (origin
10581 (method url-fetch)
10582 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
10583 name "-" version ".tar.bz2"))
10584 (sha256
10585 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
10586 (build-system gnu-build-system)
10587 (arguments
10588 `(#:make-flags
10589 (let ((out (assoc-ref %outputs "out")))
10590 (list (string-append "BINDIR=" out "/bin")
10591 (string-append "MANDIR=" out "/share/man")))
10592 #:tests? #f ; no test suite
10593 #:phases
10594 (modify-phases %standard-phases
10595 (delete 'configure) ; ./configure is a snarky no-op
10596 (add-before 'install 'fix-ownership
10597 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
10598 (lambda _
10599 (substitute* "depfun.mak"
10600 ((" -o bin -g bin ") " "))
10601 #t))
10602 (add-before 'install 'create-output-directories
10603 (lambda* (#:key outputs #:allow-other-keys)
10604 (let ((out (assoc-ref outputs "out")))
10605 (mkdir-p (string-append out "/share/man/man1"))
10606 #t))))))
10607 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
10608 (synopsis "Take screenshots of one or more Linux text consoles")
10609 (description
10610 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
10611Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
10612relevant @file{/dev/vcs*} file(s).")
10613 (license license:gpl2)))
10614
10615(define-public fbcat
10616 (package
10617 (name "fbcat")
10618 (version "0.5.2")
10619 (source
10620 (origin
10621 (method url-fetch)
10622 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
10623 version "/" name "-" version ".tar.gz"))
10624 (sha256
10625 (base32 "07q6f0xj7b4gjvn69qfn0g04yd0ch8ndzyigcz8nnrhli0cvsbh6"))))
10626 (build-system gnu-build-system)
10627 (outputs (list "out" "fbgrab"))
10628 (arguments
10629 (list
10630 #:make-flags
10631 #~(list "CC=gcc" (string-append "PREFIX=" #$output))
10632 #:tests? #f ;no tests
10633 #:phases
10634 #~(modify-phases %standard-phases
10635 (delete 'configure) ;no configure script
10636 (add-after 'build 'qualify-references
10637 (lambda* (#:key inputs #:allow-other-keys)
10638 (let ((pnmtopng (assoc-ref inputs "pnmtopng")))
10639 (substitute* "fbgrab"
10640 (("fbcat" all)
10641 (string-append #$output "/bin/" all))
10642 (("pnmtopng")
10643 (search-input-file inputs "/bin/pnmtopng"))))))
10644 (add-after 'install 'split-fbgrab-output
10645 (lambda _
10646 (for-each (lambda (file)
10647 (let ((old (string-append #$output "/" file))
10648 (new (string-append #$output:fbgrab "/" file)))
10649 (mkdir-p (dirname new))
10650 (rename-file old new)))
10651 (list "bin/fbgrab" "share/man/man1/fbgrab.1")))))))
10652 (inputs
10653 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
10654 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
10655 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
10656 (list netpbm))
10657 (home-page "https://jwilk.net/software/fbcat")
10658 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
10659 (description
10660 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
10661a dump thereof. It supports a wide range of drivers and pixel formats.
10662
10663@command{fbcat} can take screenshots of virtually any application that can be
10664made to write its output to the framebuffer, including (but not limited to)
10665text-mode or graphical applications that don't use a display server.
10666
10667Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
10668emulates the behaviour of Gunnar Monell's older fbgrab utility.")
10669 (license license:gpl2)))
10670
10671(define-public fbgrab
10672 (package
10673 (name "fbgrab")
10674 (version "1.5")
10675 (source (origin
10676 (method git-fetch)
10677 (uri (git-reference
10678 (url "https://github.com/GunnarMonell/fbgrab")
10679 (commit version)))
10680 (file-name (git-file-name name version))
10681 (sha256
10682 (base32
10683 "1npn7l8jg0nhjraybjl38v8635zawzmn06ql3hs3vhci1vi1r90r"))))
10684 (build-system gnu-build-system)
10685 (arguments
10686 (list #:tests? #f ;no test suite
10687 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
10688 (string-append "DESTDIR=" #$output))
10689 #:phases #~(modify-phases %standard-phases
10690 (add-after 'unpack 'strip-/usr-prefix
10691 (lambda _
10692 (substitute* "Makefile"
10693 (("/usr") ""))))
10694 (delete 'configure))))
10695 (inputs (list libpng zlib))
10696 (home-page "https://github.com/GunnarMonell/fbgrab")
10697 (synopsis "Linux framebuffer screenshot/conversion utility")
10698 (description "FBGrab is a framebuffer screenshot program that captures the
10699Linux framebuffer and converts it to a PNG image. It can also convert a
10700framebuffer dump file (copy) to a PNG image.")
10701 (license license:gpl2))) ;GPL 2.0 only (per SPDX identifier in fbgrab.c)
10702
10703(define-public libcgroup
10704 (package
10705 (name "libcgroup")
10706 (version "3.2.0")
10707 (home-page "https://github.com/libcgroup/libcgroup")
10708 (source
10709 (origin
10710 (method url-fetch)
10711 (uri (string-append
10712 "https://github.com/libcgroup/libcgroup/releases/download/v"
10713 version "/" name "-" version ".tar.gz"))
10714 (sha256
10715 (base32 "1zmxhqp8kj2n7yvj82nsy5sx07yrxj4r37w41lz5q8bpqgbc43ws"))))
10716 (build-system gnu-build-system)
10717 (arguments
10718 ;; Tests are virtualized with lxc, it is not very feasible
10719 ;; to make them executable under guix build. Also, note that
10720 ;; origin is using source tarball release which is prepared
10721 ;; after testing.
10722 (list #:tests? #f
10723 #:configure-flags
10724 #~'("--disable-systemd")))
10725 (native-inputs
10726 (list bison flex))
10727 (inputs
10728 (list linux-pam))
10729 (synopsis "Control groups management tools")
10730 (description "Control groups is Linux kernel method for process resource
10731restriction, permission handling and more. This package provides userspace
10732interface to this kernel feature.")
10733 (license license:lgpl2.1)))
10734
10735(define-public mbpfan
10736 (package
10737 (name "mbpfan")
10738 (version "2.4.0")
10739 (source
10740 (origin
10741 (method git-fetch)
10742 (uri (git-reference
10743 (url "https://github.com/dgraziotin/mbpfan")
10744 (commit (string-append "v" version))))
10745 (file-name (git-file-name name version))
10746 (sha256
10747 (base32 "146sshsjafi26n741jvi9mdbazwf74jlacxfwkky4fhbq98idlhp"))))
10748 (build-system gnu-build-system)
10749 (arguments
10750 (list #:tests? #f ; tests ask to be run as root
10751 #:make-flags
10752 #~(list (string-append "DESTDIR=" #$output)
10753 (string-append "CC=" #$(cc-for-target)))
10754 #:phases
10755 #~(modify-phases %standard-phases
10756 (add-after 'unpack 'patch-paths
10757 (lambda _
10758 (substitute* "Makefile"
10759 (("/usr") ""))))
10760 (delete 'configure)))) ; there's no configure phase
10761 (home-page "https://github.com/dgraziotin/mbpfan")
10762 (synopsis "Control fan speed on Macbooks")
10763 (description
10764 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
10765the @code{coretemp} module and sets the fan speed using the @code{applesmc}
10766module. It can be executed as a daemon or in the foreground with root
10767privileges.")
10768 (license license:gpl3+)))
10769
10770(define-public psm2
10771 (package
10772 (name "psm2")
10773 (version "12.0")
10774 (source (origin
10775 (method git-fetch)
10776 (uri (git-reference
10777 (url "https://github.com/intel/opa-psm2")
10778 ;; tag 'psm-v12.0' = commit ad5dd1b
10779 (commit (string-append "psm-v" version))))
10780 (file-name (git-file-name name version))
10781 (sha256
10782 (base32
10783 "04nar65ac11qqx41vkfs7iip8kfiah0zms7l4rmsxncpiz2iqfik"))
10784 (patches
10785 (search-patches
10786 "psm2-compile-ctor-without-avx.patch"))
10787 (modules '((guix build utils)))
10788 (snippet
10789 ;; That file declares its own 'strlcat' as static. To avoid a
10790 ;; conflict with the function now in glibc 2.39, give it a
10791 ;; different name.
10792 #~(substitute* "ptl_ips/ips_proto_dump.c"
10793 (("strlcat")
10794 "psm2_custom_strlcat")))))
10795 (build-system gnu-build-system)
10796 (arguments
10797 (list #:make-flags
10798 #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
10799 #:tests? #f
10800 #:phases #~(modify-phases %standard-phases
10801 (delete 'configure)
10802 (add-after 'unpack 'patch-Makefiles
10803 (lambda _
10804 (substitute* "Makefile"
10805 (("/lib64") "/lib")
10806 (("/usr") ""))
10807 (substitute* "compat/Makefile"
10808 (("/lib64") "/lib")
10809 (("/usr") ""))))
10810 (replace 'install
10811 (lambda _
10812 (setenv "DESTDIR" #$output)
10813 (invoke "make" "install"))))))
10814 (inputs
10815 (list rdma-core numactl))
10816 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
10817 (description
10818 "This package is low-level user-level Intel's communications interface.
10819The PSM2 API is a high-performance vendor-specific protocol that provides a
10820low-level communications interface for the Intel Omni-Path family of
10821high-speed networking devices.")
10822 (home-page "https://github.com/intel/opa-psm2")
10823 ;; Only the x86_64 architecture is supported.
10824 (supported-systems '("x86_64-linux"))
10825 (license (list license:bsd-3 license:gpl2)))) ; dual
10826
10827(define-public libpfm4
10828 (package
10829 (name "libpfm4")
10830 (version "4.9.0")
10831 (source (origin
10832 (method url-fetch)
10833 (uri (string-append "mirror://sourceforge/perfmon2/"
10834 name "/libpfm-" version ".tar.gz"))
10835 (sha256
10836 (base32
10837 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
10838 (build-system gnu-build-system)
10839 (arguments
10840 '(#:modules ((guix build utils)
10841 (guix build gnu-build-system))
10842 #:phases (modify-phases %standard-phases
10843 (delete 'configure)
10844 (delete 'check)
10845 (replace 'build
10846 (lambda* (#:key inputs outputs #:allow-other-keys)
10847 (let* ((out (assoc-ref outputs "out")))
10848 (setenv "CC" "gcc")
10849 (setenv "CFLAGS" "-Wno-format-truncation")
10850 (invoke "make")
10851 #t)))
10852 (replace 'install
10853 (lambda* (#:key outputs #:allow-other-keys)
10854 (let* ((out (assoc-ref outputs "out")))
10855 (invoke "make"
10856 (string-append "PREFIX=" out)
10857 "install")
10858 #t))))))
10859 (synopsis "Performance event monitoring library")
10860 (description
10861 "This package provides a library called libpfm4, which is used to develop
10862monitoring tools exploiting the performance monitoring events such as those
10863provided by the Performance Monitoring Unit (PMU) of modern processors.
10864
10865Libpfm4 helps convert from an event name, expressed as a string, to the event
10866encoding that is either the raw event as documented by the hardware vendor or
10867the OS-specific encoding. In the latter case, the library is able to prepare
10868the OS-specific data structures needed by the kernel to setup the event.
10869
10870libpfm4 provides support for the @code{perf_events} interface, which was
10871introduced in Linux 2.6.31.")
10872 (home-page "https://perfmon2.sourceforge.net/")
10873 (license license:expat)))
10874
10875(define-public libnfnetlink
10876 (package
10877 (name "libnfnetlink")
10878 (version "1.0.2")
10879 (source (origin
10880 (method url-fetch)
10881 (uri (string-append
10882 "https://www.netfilter.org/projects/libnfnetlink/files/"
10883 "libnfnetlink-" version ".tar.bz2"))
10884 (sha256
10885 (base32
10886 "0xn3rcrzxr6g82kfxzs9bqn2zvl2kf2yda30drwb9vr6sk1wfr5h"))))
10887 (build-system gnu-build-system)
10888 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
10889 (synopsis "Low-level netfilter netlink communication library")
10890 (description
10891 "@code{libnfnetlink} is the low-level library for netfilter related
10892kernel/userspace communication. It provides a generic messaging
10893infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
10894nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
10895management tools in userspace.")
10896 (license license:gpl2)))
10897
10898(define-public libinih
10899 (package
10900 (name "libinih")
10901 (version "62")
10902 (source (origin
10903 (method git-fetch)
10904 (uri (git-reference
10905 (url "https://github.com/benhoyt/inih")
10906 (commit (string-append "r" version))))
10907 (file-name (git-file-name name version))
10908 (sha256
10909 (base32
10910 "0yl5057682gvk1iszjkz4hy73yv45l7wr3fwhbgyf7r7fwx0cwwf"))))
10911 (build-system meson-build-system)
10912 ;; Install static libraries for use by the initrd's xfsprogs/static.
10913 (outputs (list "out" "static"))
10914 (arguments
10915 `(#:configure-flags
10916 (list "-Ddistro_install=true"
10917 "-Ddefault_library=both")
10918 #:phases
10919 (modify-phases %standard-phases
10920 (add-after 'install 'separate-static
10921 (lambda* (#:key outputs #:allow-other-keys)
10922 (let ((out (assoc-ref outputs "out"))
10923 (static (assoc-ref outputs "static")))
10924 (with-directory-excursion out
10925 (for-each (lambda (source)
10926 (let ((target (string-append static "/" source)))
10927 (mkdir-p (dirname target))
10928 (rename-file source target)))
10929 (find-files "lib" "\\.a$")))))))))
10930 (home-page "https://github.com/benhoyt/inih")
10931 (synopsis "Simple .INI parser library for C")
10932 (description "The inih (INI Not Invented Here) library is a simple .INI file
10933parser written in C. It's only a couple of pages of code, and it was designed to
10934be small and simple, so it's good for embedded systems. It's also more or less
10935compatible with Python's ConfigParser style of .INI files, including RFC
10936822-style multi-line syntax and name: value entries.")
10937 (license license:bsd-3)))
10938
10939(define-public simpleini
10940 (package
10941 (name "simpleini")
10942 (version "4.25")
10943 (source (origin
10944 (method git-fetch)
10945 (uri (git-reference
10946 (url "https://github.com/brofield/simpleini")
10947 (commit (string-append "v" version))))
10948 (file-name (git-file-name name version))
10949 (sha256
10950 (base32
10951 "1v9s0kr5ca1gdbnlkdz7chzypy0wz95f09l0r6jnmff4qy6db56l"))))
10952 (build-system cmake-build-system)
10953 (arguments
10954 (list #:configure-flags #~(list "-DSIMPLEINI_USE_SYSTEM_GTEST=ON")))
10955 (native-inputs (list googletest))
10956 (home-page "https://github.com/brofield/simpleini")
10957 (synopsis "Simple API to read and write INI-style files")
10958 (description
10959 "SimpleIni provides a simple API to read and write INI-style
10960configuration files. It supports data files in ASCII, MBCS and Unicode.")
10961 (license license:expat)))
10962
10963(define-public xfsprogs
10964 (package
10965 (name "xfsprogs")
10966 (version "6.12.0")
10967 (source
10968 (origin
10969 (method url-fetch)
10970 (uri (string-append "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
10971 "xfsprogs-" version ".tar.gz"))
10972 (sha256
10973 (base32 "1n46n27fxx1137kni3drrhzhp1l8ksxabcsmi8yzxbhpbnl4q293"))))
10974 (build-system gnu-build-system)
10975 (outputs (list "out" "python"))
10976 (arguments
10977 (list
10978 #:tests? #f ;kernel/user integration tests are in package "xfstests"
10979 #:configure-flags
10980 #~(list "--disable-static")
10981 #:make-flags
10982 #~(list "V=1")
10983 #:phases
10984 #~(modify-phases %standard-phases
10985 (add-after 'install 'separate-python-output
10986 (lambda _
10987 (for-each
10988 (lambda (script)
10989 (mkdir-p (string-append #$output:python (dirname script)))
10990 (rename-file (string-append #$output script)
10991 (string-append #$output:python script)))
10992 (list "/sbin/xfs_scrub_all"))))
10993 (add-after 'install 'install-headers
10994 (lambda* (#:key make-flags #:allow-other-keys)
10995 (apply invoke "make" "install-dev" make-flags))))))
10996 (native-inputs (list gettext-minimal))
10997 (inputs (list libinih
10998 liburcu
10999 (list util-linux "lib")
11000 python-wrapper))
11001 (home-page "https://xfs.wiki.kernel.org/")
11002 (synopsis "XFS file system tools")
11003 (description "This package provides commands to create and check XFS
11004file systems.")
11005 ;; The library "libhandle" and the headers in "xfslibs-dev" are
11006 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
11007 (license (list license:gpl2 license:lgpl2.1))))
11008
11009(define-public xfsprogs-5.9
11010 (package
11011 (inherit xfsprogs)
11012 (name "xfsprogs")
11013 (version "5.9.0")
11014 (source (origin
11015 (method url-fetch)
11016 (uri (string-append
11017 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
11018 "xfsprogs-" version ".tar.gz"))
11019 (sha256
11020 (base32
11021 "13xkn9jpmwp4fm9r68vhgznkmxhnv83n2b39mhy2qdaph90w2a1l"))))
11022 (arguments
11023 (substitute-keyword-arguments arguments
11024 ((#:configure-flags configure-flags #~(list))
11025 #~(cons* "--enable-gettext=no" #$configure-flags))))
11026 (native-inputs
11027 (modify-inputs native-inputs
11028 (delete "gettext-minimal")))))
11029
11030(define-public xfsprogs/static
11031 (package
11032 (inherit xfsprogs)
11033 (name "xfsprogs-static")
11034 (outputs (list "out"))
11035 (arguments
11036 (substitute-keyword-arguments arguments
11037 ((#:configure-flags configure-flags #~(list))
11038 #~(append #$configure-flags
11039 (list "--enable-static")))
11040 ((#:make-flags make-flags #~(list))
11041 #~(cons* "LLDFLAGS=-all-static" #$make-flags))
11042 ((#:phases _ #~%standard-phases)
11043 #~(modify-phases %standard-phases
11044 (add-after 'install 'delete-useless-files
11045 (lambda _
11046 (with-directory-excursion #$output
11047 (for-each delete-file-recursively
11048 (list "include" "lib")))))))))
11049 (inputs
11050 (modify-inputs inputs
11051 (delete "python-wrapper")
11052 (prepend (list libinih "static")
11053 (list util-linux "static"))))
11054 (synopsis "Statically linked XFS file system tools")))
11055
11056(define-public xfs-repair/static
11057 (package
11058 (name "xfs-repair-static")
11059 (version (package-version xfsprogs/static))
11060 (source #f)
11061 (build-system trivial-build-system)
11062 (arguments
11063 (list
11064 #:modules `((guix build utils))
11065 #:builder
11066 #~(begin
11067 (use-modules (guix build utils))
11068 (let ((sbin (string-append #$output "/sbin")))
11069 (install-file (search-input-file %build-inputs "/sbin/xfs_repair")
11070 sbin)
11071 (with-directory-excursion sbin
11072 (remove-store-references "xfs_repair"))))))
11073 (inputs (list xfsprogs/static))
11074 (home-page (package-home-page xfsprogs/static))
11075 (synopsis "Statically linked @command{xfs_repair} from xfsprogs")
11076 (description
11077 "This package provides a statically linked @command{xfs_repair} taken
11078from the xfsprogs package. It is meant to be used in initrds.")
11079 (license (package-license xfsprogs/static))))
11080
11081(define-deprecated-package xfs_repair/static
11082 "xfs_repair-static" xfs-repair/static)
11083
11084(define-public genext2fs
11085 (package
11086 (name "genext2fs")
11087 (version "1.5.0")
11088 (source (origin
11089 (method git-fetch)
11090 (uri (git-reference
11091 (url "https://github.com/bestouff/genext2fs")
11092 (commit "474111097321f03de9e009aa9f7d4a8948e310b2")))
11093 (file-name (git-file-name name version))
11094 (sha256
11095 (base32 "14lgvml5zz99845ja47jpf4iirjzfqv36ffzachh3hw2ggji9c7l"))))
11096 (build-system gnu-build-system)
11097 (native-inputs
11098 (list autoconf automake))
11099 (home-page "https://github.com/bestouff/genext2fs")
11100 (synopsis "Generate ext2 file system as a normal user")
11101 (description "This package provides a program to generate an ext2
11102file system as a normal (non-root) user. It does not require you to mount
11103the image file to copy files on it, nor does it require that you become
11104the superuser to make device nodes.")
11105 (license license:gpl2)))
11106
11107(define-public fakeroot
11108 (package
11109 (name "fakeroot")
11110 (version "1.38")
11111 (source
11112 (origin
11113 ;; There are no tags in the repository, so take this snapshot.
11114 (method url-fetch)
11115 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
11116 "fakeroot/fakeroot_" version ".orig.tar.gz"))
11117 (file-name (string-append name "-" version ".tar.gz"))
11118 (sha256
11119 (base32 "00p07xi1j61i4bbxymydihff8frw9bs0g0fr6rpm88q94wclcl1p"))
11120 (modules '((guix build utils)
11121 (ice-9 ftw)))
11122 (snippet
11123 `(begin
11124 ;; Delete pregenerated man page translations, but not the originals.
11125 (with-directory-excursion "doc"
11126 (for-each (lambda (language)
11127 (for-each delete-file
11128 (find-files language "\\.[0-9]$")))
11129 (scandir "."
11130 (lambda (file)
11131 (and (not (string-prefix? "." file))
11132 (eq? 'directory
11133 (stat:type (lstat file))))))))))))
11134 (build-system gnu-build-system)
11135 (arguments
11136 `(#:configure-flags
11137 (list "--disable-static")
11138 #:phases
11139 (modify-phases %standard-phases
11140 (add-after 'unpack 'patch-Makefile.am
11141 (lambda _
11142 (substitute* "Makefile.am"
11143 (("/bin/sh") (which "sh")))))
11144 (add-after 'unpack 'patch-script
11145 (lambda* (#:key inputs #:allow-other-keys)
11146 (substitute* "scripts/fakeroot.in"
11147 (("getopt")
11148 (string-append (assoc-ref inputs "util-linux")
11149 "/bin/getopt"))
11150 (("sed")
11151 (string-append (assoc-ref inputs "sed")
11152 "/bin/sed"))
11153 (("cat|cut" command)
11154 (string-append (assoc-ref inputs "coreutils")
11155 "/bin/" command)) )))
11156 (replace 'bootstrap
11157 (lambda _
11158 ;; The "preroll" script takes care of Autoconf and also
11159 ;; prepares the translated manuals.
11160 (invoke "sh" "./preroll")))
11161 (add-before 'configure 'setenv
11162 (lambda _
11163 (setenv "LIBS" "-lacl")))
11164 (add-before 'check 'prepare-check
11165 (lambda _
11166 (setenv "SHELL" (which "bash"))
11167 (setenv "VERBOSE" "1")
11168 (substitute* "test/t.touchinstall"
11169 ;; We don't have the name of the root user, so use ID=0.
11170 (("grep root") "grep \"\\<0\\>\""))
11171 (substitute* "test/tartest"
11172 ;; We don't have the name of the root group, so use ID=0.
11173 (("ROOTGROUP=root") "ROOTGROUP=0")
11174 ;; We don't have the name of the daemon user, so use IDs.
11175 (("daemon:sys") "1:3")
11176 (("daemon:") "1:"))
11177 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
11178 (substitute* "test/compare-tar"
11179 (("tar -tvf") "tar --numeric-owner -tvf")))))))
11180 (native-inputs
11181 (list autoconf-2.71 automake gettext-minimal libtool po4a-minimal
11182 perl sharutils xz)) ; for tests
11183 (inputs
11184 (list acl libcap util-linux sed coreutils))
11185 (synopsis "Run commands in an environment with fake root privileges")
11186 (description
11187 "@command{fakeroot} runs a command in an environment where it appears to
11188have root privileges for file manipulation. This is useful for allowing users
11189to create archives (@file{tar}, @file{ar}, @file{deb}, etc.) with files in
11190them with root permissions and/or ownership.
11191
11192Without fakeroot, one would have to have root privileges to create the
11193constituent files of the archives with the correct permissions and ownership,
11194and then pack them up, or one would have to construct the archives directly,
11195without using the archiver.")
11196 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
11197 (license license:gpl3+)))
11198
11199(define-public fakechroot
11200 ;; XXX: Build from the change submitted at
11201 ;; <https://github.com/dex4er/fakechroot/pull/85> to allow compilation
11202 ;; against glibc 2.33. Switch back to the official repository on the next
11203 ;; release.
11204 (let ((commit "e7c1f3a446e594a4d0cce5f5d499c9439ce1d5c5")
11205 (revision "0"))
11206 (package
11207 (name "fakechroot")
11208 (version (git-version "2.20.1" revision commit))
11209 (source (origin
11210 (method git-fetch)
11211 (uri (git-reference
11212 (url "https://github.com/lipnitsk/fakechroot")
11213 (commit commit)))
11214 (file-name (git-file-name name version))
11215 (sha256
11216 (base32
11217 "0gac6a6djx3nf343vd33sr5qqngz8ss3aij54zl8x9wb47pc11kb"))))
11218 (build-system gnu-build-system)
11219 (arguments
11220 ;; XXX: The tests heavily assume they run on an FHS system so for now
11221 ;; skip them.
11222 '(#:tests? #f
11223 #:configure-flags '("--disable-static")))
11224 (native-inputs (list autoconf automake libtool perl))
11225 (synopsis "Emulate @code{chroot} by overriding file system calls")
11226 (description
11227 "@command{fakechroot} runs a command in an environment were is additional
11228possibility to use @code{chroot} command without root privileges. This is
11229useful for allowing users to create own chrooted environment with possibility
11230to install another packages without need for root privileges.
11231
11232It works by providing @file{libfakechroot.so}, a shared library meant to be
11233set as @code{LD_PRELOAD} to override the C library file system functions.")
11234 (home-page "https://github.com/dex4er/fakechroot/")
11235 (license license:lgpl2.1+))))
11236
11237(define-public falcosecurity-libs
11238 (package
11239 (name "falcosecurity-libs")
11240 (version "0.20.0")
11241 (source (origin
11242 (method git-fetch)
11243 (uri (git-reference
11244 (url "https://github.com/falcosecurity/libs/")
11245 (commit version)))
11246 (file-name (git-file-name name version))
11247 (sha256
11248 (base32
11249 "041ir9wk44v7isidwl7fzxrjvs85j637wcr7xirasd8ysxa0r4qv"))
11250 (patches
11251 (search-patches
11252 "falcosecurity-libs-bpf-probes-fix.patch"
11253 "falcosecurity-libs-shared-build.patch"))))
11254 (build-system cmake-build-system)
11255 (arguments
11256 (list
11257 #:configure-flags
11258 #~(list "-DUSE_BUNDLED_DEPS=OFF"
11259 "-DBUILD_DRIVER=OFF"
11260 "-DENABLE_DKMS=OFF"
11261 "-DBUILD_LIBSCAP_MODERN_BPF=ON"
11262 "-DSCAP_FILES_SUITE_ENABLE=OFF" ;attempts to download scap files
11263 "-DBUILD_SHARED_LIBS=ON"
11264 #$(string-append "-DFALCOSECURITY_LIBS_VERSION=" version))
11265 ;; Only the libsinsp test suite is run, as the one for libscap requires
11266 ;; elevated privileges.
11267 #:modules '((guix build cmake-build-system)
11268 ((guix build gnu-build-system) #:prefix gnu:)
11269 (guix build utils))
11270 #:phases
11271 #~(modify-phases %standard-phases
11272 (add-after 'unpack 'disable-problematic-tests
11273 (lambda _
11274 (substitute* "userspace/libsinsp/test/user.ut.cpp"
11275 ;; The 'system_lookup' test assumes a root user
11276 ;; exists in the build environment.
11277 (("TEST_F\\(usergroup_manager_test, system_lookup)")
11278 "TEST_F(usergroup_manager_test, DISABLED_system_lookup)"))))
11279 (replace 'check
11280 (lambda* (#:rest args)
11281 (apply (assoc-ref gnu:%standard-phases 'check)
11282 #:test-target "run-unit-test-libsinsp" args)))
11283 (add-after 'install 'delete-src
11284 (lambda _
11285 (delete-file-recursively
11286 (string-append #$output "/src")))))))
11287 (native-inputs
11288 (list bpftool
11289 clang-18 ;avoid stack limit exceeded build error
11290 googletest
11291 pkg-config
11292 valijson)) ;header-only library
11293 (inputs
11294 (list elfutils))
11295 (propagated-inputs
11296 ;; The following inputs are in the 'Requires' field of libscap.pc,
11297 ;; libsinp.pc or libpman.pc.
11298 (list c-ares
11299 grpc
11300 jsoncpp
11301 libbpf
11302 libelf
11303 openssl
11304 protobuf
11305 uthash ;included in libscap headers
11306 zlib
11307 ;; These are in the 'Requires.private' field of libscap.pc and
11308 ;; libsinp.pc. They are required because the headers are installed
11309 ;; to a non-standard directory, and thus need to be found via the
11310 ;; 'Cflags' field, which in turn mandates that both the pkg-config
11311 ;; modules listed in the 'Requires' and 'Requires.private' be
11312 ;; available.
11313 curl
11314 re2
11315 onetbb))
11316 (home-page "https://github.com/falcosecurity/libs/")
11317 (synopsis "Falco security libraries")
11318 (description "The Falco security libraries include @code{libsinsp} and
11319@code{libscap}. @code{libscap} manages the data capture process, while
11320@code{libsinsp} is a system inspection library that enriches events from
11321@code{libscap} with machine state. @code{libsinsp} also performs events
11322filtering with rule evaluation through its internal rule engine. These
11323libraries are used by the @command{sysdig} command-line utility.")
11324 (license license:asl2.0)))
11325
11326(define-public inputattach
11327 (package
11328 (name "inputattach")
11329 (version "0.42.0")
11330 (source (origin
11331 (method git-fetch)
11332 (uri (git-reference
11333 (url "https://github.com/linuxwacom/input-wacom")
11334 (commit (string-append "input-wacom-" version))))
11335 (file-name (git-file-name name version))
11336 (sha256
11337 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
11338 (build-system gnu-build-system)
11339 (arguments
11340 `(#:phases
11341 (modify-phases %standard-phases
11342 (delete 'bootstrap)
11343 (delete 'configure)
11344 (replace 'build
11345 (lambda* (#:key inputs #:allow-other-keys)
11346 (with-directory-excursion "inputattach"
11347 (invoke "gcc" "-O2" "-o" "inputattach"
11348 "inputattach.c"))))
11349 (delete 'check)
11350 (replace 'install
11351 (lambda* (#:key outputs #:allow-other-keys)
11352 (let ((target-dir (string-append
11353 (assoc-ref outputs "out")
11354 "/bin/")))
11355 (mkdir-p target-dir)
11356 (copy-file "inputattach/inputattach"
11357 (string-append target-dir
11358 "inputattach"))
11359 #t))))))
11360 (home-page "https://linuxwacom.github.io/")
11361 (synopsis "Dispatch input peripherals events to a device file")
11362 (description "inputattach dispatches input events from several device
11363types and interfaces and translates so that the X server can use them.")
11364 (license license:gpl2+)))
11365
11366(define-public keyd
11367 (package
11368 (name "keyd")
11369 (version "2.6.0")
11370 (source
11371 (origin
11372 (method git-fetch)
11373 (uri (git-reference
11374 (url "https://github.com/rvaiya/keyd")
11375 (commit (string-append "v" version))))
11376 (sha256
11377 (base32
11378 "14rgrg8d1ys1cqq46mgi34yqg9jd1q3yw1acw5r5jpwwk0da7g4p"))))
11379 (arguments
11380 (list #:tests? #f ; tests require root
11381 #:make-flags
11382 #~(list (string-append "CC=" #$(cc-for-target))
11383 "PREFIX="
11384 (string-append "DESTDIR=" #$output))
11385 #:phases
11386 '(modify-phases
11387 %standard-phases
11388 (delete 'configure)))) ; no autoconf
11389 (build-system gnu-build-system)
11390 (inputs (list linux-libre-headers))
11391 (synopsis "Key remapping daemon for Linux")
11392 (description
11393 "Keyd is a keyboard remapping utility with intuitive ini configuration
11394file format. Keyd has several features, many of which are traditionally only
11395found in custom keyboard firmware like QMK.")
11396 (home-page "https://github.com/rvaiya/keyd")
11397 (license license:expat)))
11398
11399(define-public pipewire
11400 (package
11401 (name "pipewire")
11402 (version "1.6.8")
11403 (source (origin
11404 (method git-fetch)
11405 (uri (git-reference
11406 (url "https://gitlab.freedesktop.org/pipewire/pipewire")
11407 (commit version)))
11408 (file-name (git-file-name name version))
11409 (sha256
11410 (base32
11411 "1yc70gi4a98q7kbghp08nyp3wvlik120v2w25a14b93gpgwbl55k"))))
11412 (build-system meson-build-system)
11413 (arguments
11414 (list
11415 #:configure-flags
11416 #~(list (string-append "-Dudevrulesdir=" #$output "/lib/udev/rules.d")
11417 "-Dman=enabled"
11418 "-Drlimits-install=false"
11419 "-Dsession-managers=[]"
11420 "-Dsysconfdir=/etc"
11421 "-Dlibsystemd=disabled"
11422
11423 ;; XXX: link with -Wl,--no-as-needed so that libgcc_s.so.1 does not get dropped
11424 ;; Otherwise test_loop will fail with:
11425 ;; libgcc_s.so.1 must be installed for pthread_cancel to work
11426 "-Db_asneeded=false")))
11427 (native-inputs
11428 (list `(,glib "bin")
11429 pkg-config
11430 doxygen
11431 python
11432 python-docutils))
11433 (inputs (list alsa-lib
11434 avahi
11435 bluez
11436 dbus
11437 eudev
11438 ffmpeg
11439 gst-plugins-base
11440 gstreamer
11441 jack-2
11442 ldacbt
11443 libcamera-minimal
11444 libdrm
11445 libfdk
11446 libfreeaptx
11447 libsndfile
11448 libusb
11449 openssl ; raop sink
11450 libva
11451 pulseaudio
11452 readline ; for pw-cli
11453 sbc
11454 vulkan-headers
11455 vulkan-loader
11456 webrtc-audio-processing))
11457 (home-page "https://pipewire.org/")
11458 (synopsis "Server and user space API to deal with multimedia pipelines")
11459 (description
11460 "PipeWire is a project that aims to greatly improve handling of audio and
11461video under Linux. It aims to support the usecases currently handled by both
11462PulseAudio and Jack and at the same time provide same level of powerful handling
11463of Video input and output. It also introduces a security model that makes
11464interacting with audio and video devices from containerized applications easy,
11465with supporting Flatpak applications being the primary goal. Alongside Wayland
11466and Flatpak we expect PipeWire to provide a core building block for the future
11467of Linux application development.")
11468 (license license:lgpl2.0+)))
11469
11470(define-public pipewire-minimal
11471 ;; Used as libpipewire to reduce closure size and avoid dependency cycles.
11472 (hidden-package
11473 (package
11474 (inherit pipewire)
11475 (name "pipewire-minimal")
11476 (arguments
11477 (list
11478 #:configure-flags
11479 #~(list "-Dsession-managers=[]"
11480 "-Ddbus=disabled"
11481 "-Dflatpak=disabled"
11482 ;; XXX: Otherwise test_loop will fail with:
11483 ;; libgcc_s.so.1 must be installed for pthread_cancel to work
11484 "-Db_asneeded=false")))
11485 (native-inputs '())
11486 (inputs '()))))
11487
11488(define-public pipewire-minimal-1.4
11489 (package
11490 (inherit pipewire-minimal)
11491 (name "pipewire")
11492 (version "1.4.10")
11493 (source (origin
11494 (method git-fetch)
11495 (uri (git-reference
11496 (url "https://gitlab.freedesktop.org/pipewire/pipewire")
11497 (commit version)))
11498 (file-name (git-file-name name version))
11499 (sha256
11500 (base32
11501 "14rsdbcsyyhjh7hvbq3d84f6s0fllvq6vpg39cxcd7l8fn4zc2zw"))))))
11502
11503(define-public wireplumber
11504 (package
11505 (name "wireplumber")
11506 (version "0.5.17")
11507 (source
11508 (origin
11509 (method git-fetch)
11510 (uri (git-reference
11511 (url
11512 "https://gitlab.freedesktop.org/pipewire/wireplumber.git")
11513 (commit version)))
11514 (file-name (git-file-name name version))
11515 (sha256
11516 (base32 "108m9wkxldvacv2y543pjk3nzlc55shlfd0zhihms1ksmq3hfl06"))))
11517 (build-system meson-build-system)
11518 (arguments
11519 `(#:configure-flags '("-Dsystemd=disabled"
11520 "-Dsystem-lua=true")))
11521 (native-inputs
11522 (list `(,glib "bin")
11523 pkg-config python-minimal))
11524 (inputs (list dbus elogind glib lua pipewire))
11525 (home-page "https://gitlab.freedesktop.org/pipewire/wireplumber")
11526 (synopsis "Session / policy manager implementation for PipeWire")
11527 (description "WirePlumber is a modular session / policy manager for
11528PipeWire and a GObject-based high-level library that wraps PipeWire's API,
11529providing convenience for writing the daemon's modules as well as external
11530tools for managing PipeWire.")
11531 (license license:expat)))
11532
11533(define-public wireplumber-minimal
11534 (let ((base wireplumber))
11535 (package
11536 (inherit base)
11537 (name "wireplumber-minimal")
11538 (arguments
11539 (substitute-keyword-arguments arguments
11540 ((#:configure-flags flags ''())
11541 #~(cons "-Delogind=disabled" #$flags))))
11542 (inputs
11543 (modify-inputs inputs
11544 (delete "elogind"))))))
11545
11546(define-public ell
11547 (package
11548 (name "ell")
11549 (version "0.83")
11550 (source (origin
11551 (method git-fetch)
11552 (uri (git-reference
11553 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
11554 (commit version)))
11555 (file-name (git-file-name name version))
11556 (sha256
11557 (base32
11558 "1ywq84jgvf7f86srqwpq31w2kzdp875fx039x5g4lx486plgf526"))
11559 (modules '((guix build utils)))
11560 (snippet
11561 #~(begin
11562 (substitute* "Makefile.am"
11563 ;; requires hwdb.bin
11564 (("unit/test-hwdb.*") ""))))))
11565 (build-system gnu-build-system)
11566 (arguments
11567 ;; Tests launch dbus-daemon instances that all try to bind to
11568 ;; "/tmp/ell-test-bus". Thus, we need to run them sequentially.
11569 '(#:parallel-tests? #f))
11570 (inputs
11571 (list dbus))
11572 (native-inputs
11573 (list autoconf automake libtool pkg-config procps))
11574 (home-page "https://01.org/ell")
11575 (synopsis "Embedded Linux Library")
11576 (description "The Embedded Linux* Library (ELL) provides core, low-level
11577functionality for system daemons. It typically has no dependencies other than
11578the Linux kernel, C standard library, and libdl (for dynamic linking). While
11579ELL is designed to be efficient and compact enough for use on embedded Linux
11580platforms, it is not limited to resource-constrained systems.")
11581 (license license:lgpl2.1+)))
11582
11583(define-public kexec-tools
11584 (package
11585 (name "kexec-tools")
11586 (version "2.0.31")
11587 (source (origin
11588 (method url-fetch)
11589 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
11590 "/kexec/kexec-tools-" version ".tar.xz"))
11591 (sha256
11592 (base32
11593 "0c9cj9xvcm81gcwnkvvh9vh82v59kdz5llmblc2wkqb6vh6kb3wa"))))
11594 (build-system gnu-build-system)
11595 (arguments
11596 ;; There are no automated tests.
11597 '(#:tests? #f))
11598 ;; This variant of binutils is used for the 64 bit support needed to
11599 ;; assemble the `purgatory/arch/i386/compat_x86_64.S' program on i686-linux.
11600 (native-inputs (list (make-ld-wrapper "ld-wrapper"
11601 #:binutils binutils)
11602 binutils))
11603 (home-page "https://projects.horms.net/projects/kexec/")
11604 (synopsis "Tools for booting directly into different kernels")
11605 (description "This package provides the @code{kexec} program and ancillary
11606utilities. Using @code{kexec}, it is possible to boot directly into a new
11607kernel from the context of an already-running kernel, bypassing the normal
11608system boot process.")
11609 (supported-systems (delete "riscv64-linux" %supported-systems))
11610 (license license:gpl2)))
11611
11612(define-public cachefilesd
11613 (package
11614 (name "cachefilesd")
11615 (version "0.10.10")
11616 (source (origin
11617 (method url-fetch)
11618 (uri (string-append
11619 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
11620 "/cachefilesd.git/snapshot/cachefilesd-"
11621 version ".tar.gz"))
11622 (sha256
11623 (base32
11624 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
11625 (build-system gnu-build-system)
11626 (outputs '("out"))
11627 (arguments
11628 `(#:tests? #f ; there are no tests
11629 #:make-flags
11630 (let ((prefix-dir (lambda (var dir)
11631 (string-append var "=" %output "/" dir))))
11632 (list (string-append "CC=" ,(cc-for-target))
11633 (prefix-dir "SBINDIR" "sbin/")
11634 (prefix-dir "ETCDIR" "etc/")
11635 (prefix-dir "MANDIR" "share/man/")))
11636 #:phases (modify-phases %standard-phases (delete 'configure))))
11637 (home-page "https://people.redhat.com/~dhowells/cachefs/")
11638 (synopsis "CacheFiles userspace management daemon")
11639 (description "@code{cachefilesd} is a userspace daemon that manages the
11640cache data store that is used by network file systems such as @code{AFS} and
11641@code{NFS} to cache data locally on disk. The content of the cache is
11642persistent over reboots.")
11643 (license license:gpl2+)))
11644
11645(define-public libbpf
11646 (package
11647 (name "libbpf")
11648 (version "1.7.0")
11649 (source
11650 (origin
11651 (method git-fetch)
11652 (uri (git-reference
11653 (url "https://github.com/libbpf/libbpf")
11654 (commit (string-append "v" version))))
11655 (file-name (git-file-name name version))
11656 (sha256
11657 (base32
11658 "1r1ysy8xpdz2nqs0svk4772fbykqh414mqivwylbj5r9v1nf8r02"))))
11659 (build-system gnu-build-system)
11660 (arguments
11661 (list
11662 #:tests? #f ;self-tests run in QEMU
11663 #:make-flags
11664 #~(list (string-append "PREFIX=" #$output)
11665 (string-append "LIBDIR=$(PREFIX)/lib")
11666 (string-append "CC=" #$(cc-for-target)))
11667 #:phases
11668 #~(modify-phases %standard-phases
11669 (delete 'configure)
11670 (add-before 'build 'pre-build
11671 (lambda _
11672 (chdir "src")))
11673 (replace 'install
11674 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
11675 (apply (assoc-ref %standard-phases 'install)
11676 (append args
11677 (list #:make-flags
11678 (append (list "install"
11679 ;; Also install the kernel
11680 ;; user API (uAPI) headers.
11681 "install_uapi_headers")
11682 make-flags)))))))))
11683 (native-inputs (list pkg-config))
11684 (propagated-inputs (list elfutils zlib)) ;in Requires.private of libbpf.pc
11685 (home-page "https://github.com/libbpf/libbpf")
11686 (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
11687 (description
11688 "Libbpf supports building BPF CO-RE-enabled applications, which, in
11689contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
11690headers.")
11691 (license (list license:lgpl2.1 license:bsd-2))))
11692
11693(define-public libbpf-0.8
11694 (package
11695 (inherit libbpf)
11696 (name "libbpf")
11697 (version "0.8.1")
11698 (source
11699 (origin
11700 (method git-fetch)
11701 (uri (git-reference
11702 (url "https://github.com/libbpf/libbpf")
11703 (commit (string-append "v" version))))
11704 (file-name (git-file-name name version))
11705 (sha256
11706 (base32
11707 "1zzpkk4x3f20483dzw43b3ml03d63vvkmqf4j8y3b61b67wm59bm"))))
11708 (arguments
11709 (list
11710 #:tests? #f ;self-tests run in QEMU
11711 #:make-flags
11712 #~(list (string-append "PREFIX=" #$output)
11713 (string-append "LIBDIR=$(PREFIX)/lib")
11714 (string-append "CC=" #$(cc-for-target)))
11715 #:phases #~(modify-phases %standard-phases
11716 (delete 'configure)
11717 (add-before 'build 'pre-build
11718 (lambda _
11719 (chdir "src"))))))
11720 (native-inputs (list pkg-config))
11721 (propagated-inputs (list elfutils zlib)))) ;in Requires.private of libbpf.pc
11722
11723(define-public bcc
11724 (package
11725 (name "bcc")
11726 (version "0.30.0")
11727 (source
11728 (origin
11729 (method git-fetch)
11730 (uri (git-reference
11731 (url "https://github.com/iovisor/bcc")
11732 (commit (string-append "v" version))))
11733 (file-name (git-file-name name version))
11734 (sha256
11735 (base32
11736 "0b5la0yn6x6ll73drnrm5v5yibbrzkvl86hqivkrmnpgy8cqn0cy"))))
11737 (build-system cmake-build-system)
11738 (native-inputs
11739 (list bison
11740 flex
11741 (@ (gnu packages compression) zip)))
11742 (inputs
11743 (list bash-minimal ;for wrap-program
11744 clang-15
11745 elfutils
11746 luajit
11747 libbpf
11748 python-setuptools
11749 python-wrapper))
11750 (arguments
11751 (list
11752 ;; Tests all require root permissions and a "standard" file hierarchy.
11753 #:tests? #f
11754 #:configure-flags #~(list (string-append "-DREVISION=" #$version)
11755 "-DCMAKE_USE_LIBBPF_PACKAGE=ON")
11756 #:phases
11757 #~(modify-phases %standard-phases
11758 (add-after 'unpack 'substitute-libbc
11759 (lambda _
11760 (substitute* "src/python/bcc/libbcc.py"
11761 (("(libbcc\\.so.*)\\b" _ libbcc)
11762 (string-append #$output "/lib/" libbcc)))))
11763 (add-after 'install 'wrap-tools
11764 (lambda _
11765 (use-modules (ice-9 textual-ports))
11766 (let* ((out #$output)
11767 (lib (string-append out "/lib"))
11768 (tools (string-append out "/share/bcc/tools"))
11769 (python-executable?
11770 (lambda (filename _)
11771 (call-with-input-file filename
11772 (lambda (port)
11773 (string-contains (get-line port)
11774 "/bin/python"))))))
11775 (for-each (lambda (python-executable)
11776 (format #t "Wrapping: ~A.~%" python-executable)
11777 (wrap-program python-executable
11778 `("GUIX_PYTHONPATH" ":" prefix
11779 (,(string-append lib
11780 "/python"
11781 #$(version-major+minor
11782 (package-version python))
11783 "/site-packages")))))
11784 (find-files tools python-executable?))))))))
11785 (home-page "https://github.com/iovisor/bcc")
11786 (synopsis "Tools for BPF on Linux")
11787 (description
11788 "BCC is a toolkit for creating efficient kernel tracing and manipulation
11789programs, and includes several useful tools and examples. It makes use of
11790extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
11791that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
11792and above.")
11793 (license license:asl2.0)))
11794
11795(define-public bpftool
11796 (package
11797 (name "bpftool")
11798 (version (package-version linux-libre))
11799 (source (package-source linux-libre))
11800 (build-system gnu-build-system)
11801 (arguments
11802 `(#:tests? #f ;This package has no tests.
11803 #:phases (modify-phases %standard-phases
11804 (delete 'configure)
11805 (replace 'build
11806 (lambda* (#:key inputs #:allow-other-keys)
11807 (invoke "make" "-C" "tools/bpf/bpftool"
11808 ,(string-append "CC=" (cc-for-target)))))
11809 (replace 'install
11810 (lambda* (#:key outputs #:allow-other-keys)
11811 (let* ((out (assoc-ref outputs "out")))
11812 (mkdir-p (string-append out "/sbin"))
11813 (mkdir-p (string-append out
11814 "/share/bash-completion/completions"))
11815 (invoke "make"
11816 (string-append "prefix=" out)
11817 (string-append
11818 "bash_compdir=" out
11819 "/share/bash-completion/completions")
11820 "-C" "tools/bpf/bpftool"
11821 "install")))))))
11822 (inputs (list elfutils ;provides libelf
11823 libcap openssl readline zlib))
11824 (native-inputs (list bison python))
11825 ;; This tool does not have a proper web page.
11826 (home-page
11827 "https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/bpf/bpftool")
11828 (synopsis "Tool for inspection and manipulation of eBPF programs and maps")
11829 (description "@command{bpftool} allows for inspection and simple
11830modification of BPF objects on the system.")
11831 (license (package-license linux-libre))))
11832
11833(define-public bpftrace
11834 (package
11835 (name "bpftrace")
11836 (version "0.21.2")
11837 (source
11838 (origin
11839 (method git-fetch)
11840 (uri (git-reference
11841 (url "https://github.com/bpftrace/bpftrace")
11842 (commit (string-append "v" version))))
11843 (file-name (git-file-name name version))
11844 (sha256
11845 (base32 "0icbhf1wk523a7lcmwqa67zc6hl6h02p5mfg26cizva447kbwsgz"))))
11846 (build-system cmake-build-system)
11847 (arguments
11848 (list
11849 #:test-exclude "(runtime_tests|tools-parsing-test)"
11850 #:phases
11851 #~(modify-phases %standard-phases
11852 ;; This patch also fixes broken compilation due to improper detection
11853 ;; of bfd features. This is taken from following upstream PR:
11854 ;; https://github.com/bpftrace/bpftrace/pull/3332
11855 (add-after 'unpack 'patch-paths-and-bfd-defs
11856 (lambda _
11857 (substitute* '("cmake/FindLibBfd.cmake"
11858 "src/CMakeLists.txt")
11859 (("LIBSFRAME_FOUND")
11860 "LIBSFRAME_LIBRARIES")
11861 (("LIBZSTD_FOUND")
11862 "LIBZSTD_LIBRARIES"))
11863 (with-directory-excursion "tests"
11864 (substitute* (find-files ".")
11865 (("/bin/sh")
11866 (which "sh")))
11867 (substitute* '("child.cpp"
11868 "runtime/call"
11869 "procmon.cpp")
11870 (("/bin/ls")
11871 (which "ls"))))))
11872 (add-after 'unpack 'fix-paths
11873 (lambda* (#:key inputs outputs #:allow-other-keys)
11874 (substitute* '("tests/child.cpp")
11875 (("/bin/sleep")
11876 (search-input-file inputs "bin/sleep")))))
11877 (add-before 'check 'set-test-filter
11878 (lambda _
11879 (setenv "GTEST_FILTER"
11880 (string-join
11881 (list ; "-" disables all following tests
11882 "-ast.probe_name_uprobe"
11883 "bpftrace.add_probes_uprobe_wildcard_file"
11884 "bpftrace.add_probes_uprobe_wildcard_file_uprobe_multi"
11885 "bpftrace.add_probes_usdt_wildcard"
11886 "Parser.multiple_attach_points_kprobe"
11887 "Parser.uretprobe_offset"
11888 "semantic_analyser.builtin_functions"
11889 "semantic_analyser.call_func"
11890 "semantic_analyser.call_uaddr")
11891 ":")))))))
11892 (native-inputs (list bison coreutils dwarves flex googletest xxd))
11893 (inputs (list bcc clang-15 elfutils libbpf libiberty cereal))
11894 (home-page "https://github.com/bpftrace/bpftrace")
11895 (synopsis "High-level tracing language for Linux eBPF")
11896 (description
11897 "bpftrace is a high-level tracing language for Linux enhanced Berkeley
11898Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses
11899LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for
11900interacting with the Linux BPF system, as well as existing Linux tracing
11901capabilities: kernel dynamic tracing (kprobes), user-level dynamic
11902tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk
11903and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was
11904created by Alastair Robertson.")
11905 (license license:asl2.0)))
11906
11907(define-public ttyebus-linux-module
11908 (let ((revision "0")
11909 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))
11910 (package
11911 (name "ttyebus-linux-module")
11912 (version (git-version "1.5" revision commit))
11913 (source
11914 (origin
11915 (method git-fetch)
11916 (uri (git-reference
11917 (url "https://github.com/eBUS/ttyebus")
11918 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")))
11919 (file-name (git-file-name name version))
11920 (sha256
11921 (base32
11922 "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani"))))
11923 (supported-systems '("armhf-linux" "aarch64-linux"))
11924 (build-system linux-module-build-system)
11925 (arguments
11926 `(#:tests? #f))
11927 (home-page "https://github.com/eBUS/ttyebus")
11928 (synopsis "Low-latency Raspberry Pi UART driver")
11929 (description "This package provides a Linux kernel module that will
11930provide a serial device @code{/dev/ttyebus} with almost no latency upon
11931receiving. It is dedicated to the PL011 UART of the Raspberry Pi.")
11932 (license license:gpl3+))))
11933
11934(define-public ipset
11935 (package
11936 (name "ipset")
11937 (version "7.17")
11938 (source
11939 (origin
11940 (method url-fetch)
11941 (uri (string-append "https://ipset.netfilter.org/"
11942 "ipset-" version ".tar.bz2"))
11943 (sha256
11944 (base32 "1n34mkrdha9rggd0fizjx6baqkiqqd1yfhb5ml663mlx93zwjjdy"))))
11945 (build-system gnu-build-system)
11946 (inputs
11947 (list libmnl))
11948 (native-inputs
11949 (list pkg-config))
11950 (arguments
11951 `(#:configure-flags '("--disable-static"
11952 "--with-kmod=no")))
11953 (home-page "https://ipset.netfilter.org/")
11954 (synopsis "Administration tool for IP sets")
11955 (description "IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel which
11956can be administered by the ipset utility. Depending on the type,
11957currently an IP set may store IP addresses, (TCP/UDP) port numbers or
11958IP addresses with MAC addresses in a way which ensures lightning speed
11959when matching an entry against a set.
11960
11961If you want to
11962@itemize @bullet
11963@item store multiple IP addresses or port numbers and match against the entire
11964collection using a single iptables rule.
11965@item dynamically update iptables rules against IP addresses or ports without
11966performance penalty.
11967@item express complex IP address and ports based rulesets with a single
11968iptables rule and benefit from the speed of IP sets.
11969@end itemize\n
11970then IP sets may be the proper tool for you.")
11971 (license license:gpl2+)))
11972
11973(define-public liburing
11974 (package
11975 (name "liburing")
11976 (version "2.15")
11977 (source (origin
11978 (method git-fetch)
11979 (uri (git-reference
11980 (url "https://github.com/axboe/liburing")
11981 (commit (string-append "liburing-" version))))
11982 (file-name (git-file-name name version))
11983 (sha256
11984 (base32
11985 "1vq47c15fv60992qla7y9s3b52v958zkbfpr0hscji1n6bj6w4x0"))))
11986 (build-system gnu-build-system)
11987 (arguments
11988 `(;; Tests are dependent on kernel version and features
11989 #:tests? #f
11990 #:phases
11991 (modify-phases %standard-phases
11992 (replace 'configure
11993 ;; configure fails if it is followed by SHELL, CONFIG_SHELL,
11994 ;; --enable-fast-install, and --build
11995 (lambda* (#:key outputs #:allow-other-keys)
11996 (let ((out (assoc-ref outputs "out")))
11997 (setenv "SHELL" (which "sh"))
11998 (setenv "CONFIG_SHELL" (which "sh"))
11999 (invoke "./configure" (string-append "--prefix=" out))))))))
12000 (home-page "https://github.com/axboe/liburing")
12001 (synopsis "Interface to the Linux kernel @code{io_uring} interface")
12002 (description "This is the io_uring library, liburing. liburing provides
12003helpers to setup and teardown io_uring instances, and also a simplified
12004interface for applications that don't need (or want) to deal with the full
12005kernel side implementation.")
12006 (license license:expat)))
12007
12008(define-public erofs-utils
12009 (package
12010 (name "erofs-utils")
12011 (version "1.8.10")
12012 (source
12013 (origin
12014 (method git-fetch)
12015 (uri (git-reference
12016 (url "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git")
12017 (commit (string-append "v" version))))
12018 (file-name (git-file-name name version))
12019 (sha256
12020 (base32 "1qlig9q1fdjl0zn7206dbv7w5ssjg4az4hg7y3vk69ly0zbmwkil"))))
12021 (build-system gnu-build-system)
12022 (inputs
12023 (list lz4
12024 `(,util-linux "lib")
12025 zlib))
12026 (native-inputs
12027 (list autoconf automake libtool pkg-config))
12028 (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/")
12029 (synopsis "User-space tools for the EROFS file system")
12030 (description
12031 "@acronym{EROFS, The Enhanced Read-Only File System} is a compressed,
12032read-only file system optimized for resource-scarce devices. This package
12033provides user-space tools for creating EROFS file systems.")
12034 (license license:gpl2+)))
12035
12036(define-public erofs-utils/static
12037 (static-package
12038 (package
12039 (inherit erofs-utils)
12040 (name "erofs-utils-static")
12041 (arguments
12042 (substitute-keyword-arguments (package-arguments erofs-utils)
12043 ((#:configure-flags flags #~'())
12044 #~(append #$flags (list "--without-uuid" "--without-zlib"))))))))
12045
12046(define-public rasdaemon
12047 (package
12048 (name "rasdaemon")
12049 (version "0.8.4")
12050 (source
12051 (origin
12052 (method git-fetch)
12053 (uri (git-reference
12054 (url "https://github.com/mchehab/rasdaemon")
12055 (commit (string-append "v" version))))
12056 (file-name (git-file-name name version))
12057 (sha256
12058 (base32 "1930g35igfdw5bzcd6diy59rm1q4yirpjgqznfqfsichnmk04kmf"))))
12059 (native-inputs (list autoconf automake libtool pkg-config))
12060 (inputs
12061 (list bash-minimal
12062 dmidecode
12063 kmod
12064 libtraceevent
12065 pciutils
12066 perl
12067 perl-dbd-sqlite
12068 sqlite))
12069 (arguments
12070 (list
12071 #:configure-flags
12072 #~(list "--enable-all"
12073 ;; Don't install unused /etc/sysconfig/rasdaemon environment file.
12074 "--with-sysconfdefdir=."
12075 "--localstatedir=/var")
12076 #:phases
12077 #~(modify-phases %standard-phases
12078 (add-after 'unpack 'rename-README
12079 (lambda _
12080 ;; Required by autoreconf
12081 (rename-file "README.md" "README")))
12082 (add-before 'configure 'munge-autotools
12083 (lambda _
12084 ;; For some reason upstream forces sysconfdir=/etc. This results
12085 ;; in EPERM during the install phase. Removing the offending
12086 ;; line lets sysconfdir correctly pick up DESTDIR.
12087 (substitute* "configure.ac"
12088 (("^test .* sysconfdir=/etc\n$") ""))))
12089 (add-after 'install 'wrap-rasdaemon
12090 (lambda* (#:key inputs #:allow-other-keys)
12091 (let ((path (map dirname
12092 (list (search-input-file inputs "/sbin/dmidecode")
12093 (search-input-file inputs "/bin/modprobe")))))
12094 (wrap-program (string-append #$output "/sbin/ras-mc-ctl")
12095 `("PATH" ":" prefix ,path)
12096 `("PERL5LIB" ":" prefix ,(string-split (getenv "PERL5LIB") #\:)))))))))
12097 (build-system gnu-build-system)
12098 (home-page "https://github.com/mchehab/rasdaemon")
12099 (synopsis "Platform Reliability, Availability, and Serviceability tools")
12100 (description
12101 "The @code{rasdaemon} daemon monitors platform @acronym{RAS, Reliability
12102Availability and Serviceability} reports from Linux kernel trace events.
12103These trace events are logged in @file{/sys/kernel/debug/tracing} and reported
12104through standard log mechanisms like syslog.")
12105 (license license:gpl2)))
12106
12107(define-public renameat2
12108 ;; This is a Gist, with no release or tags.
12109 (let ((revision "0")
12110 (commit "5c5193f20142511a5fc7069a539f4e5aba0ea470"))
12111 (package
12112 (name "renameat2")
12113 (version (git-version "0.0.0" revision commit))
12114 (source (origin
12115 (method url-fetch)
12116 (uri (string-append "https://gist.githubusercontent.com/"
12117 "eatnumber1/f97ac7dad7b1f5a9721f/raw/"
12118 commit "/renameat2.c"))
12119 (sha256
12120 (base32
12121 "07b4hsxqjm610sdkm4nxhp0gnl2s7gzlh4zdnja5ay40v4x24bb9"))))
12122 (build-system gnu-build-system)
12123 (arguments
12124 (list
12125 #:tests? #f ;no test suite
12126 #:phases #~(modify-phases %standard-phases
12127 (delete 'configure)
12128 (replace 'build
12129 (lambda _
12130 (invoke #$(cc-for-target) "renameat2.c"
12131 "-o" "renameat2")))
12132 (replace 'install
12133 (lambda _
12134 (install-file "renameat2"
12135 (string-append #$output "/bin")))))))
12136 (home-page "https://gist.github.com/eatnumber1/f97ac7dad7b1f5a9721f")
12137 (synopsis "Command to call the renameat2 Linux system call")
12138 (description "This package provides a @command{renameat2} command that
12139calls the Linux-specific @code{renameat2} system call.")
12140 (license license:expat))))
12141
12142(define-public libgpiod
12143 (package
12144 (name "libgpiod")
12145 (version "2.2.2")
12146 (source
12147 (origin
12148 (method git-fetch)
12149 (uri
12150 (git-reference
12151 (url "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
12152 (commit (string-append "v" version))))
12153 (file-name (git-file-name name version))
12154 (sha256 (base32 "10yiwrw80x0057w825zxmdbd54w9lbyf49bgqk1cryqapglfzqri"))))
12155 (build-system gnu-build-system)
12156 (arguments
12157 (list #:configure-flags
12158 #~(list "--enable-tools=yes"
12159 "--enable-bindings-cxx")))
12160 (native-inputs
12161 (list automake
12162 autoconf-2.71
12163 libtool
12164 autoconf-archive
12165 pkg-config))
12166 (synopsis "Interact with the Linux GPIO character device")
12167 (description
12168 "This package provides a C library with C++ bindings and
12169command-line tools for interacting with GPIO devices that avoids the usage of
12170older system-wide @file{/sys} interface.")
12171 (home-page "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/")
12172 (license (list license:lgpl2.1+ ;; libgpiod
12173 license:gpl2+ ;; gpio-tools
12174 license:lgpl3+)))) ;; C++ bindings
12175
12176(define-public python-libgpiod
12177 (package
12178 (name "python-libgpiod")
12179 (version "2.3.0")
12180 (source
12181 (origin
12182 (method git-fetch)
12183 (uri
12184 (git-reference
12185 (url "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
12186 (commit (string-append "python-v" version))))
12187 (file-name (git-file-name name version))
12188 (sha256 (base32 "1lkd7lgpb28pqf7p6lrwl0ss7r5ryiddmdcisnz6ixy796qhr8kr"))))
12189 (build-system pyproject-build-system)
12190 (arguments
12191 (list
12192 #:tests? #f ; tests require root, see README.md
12193 #:phases
12194 #~(modify-phases %standard-phases
12195 (add-after 'unpack 'cd-to-python-bindings
12196 (lambda _
12197 (chdir "bindings/python"))))))
12198 (native-inputs
12199 (list python-setuptools
12200 python-wheel
12201 libgpiod))
12202 (synopsis "Interact with the Linux GPIO character device")
12203 (description
12204 "This package provides Python bindings for interacting with GPIO devices
12205that avoids the usage of older system-wide @file{/sys} interface.")
12206 (home-page "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/")
12207 (license (list license:lgpl2.1+ ;; libgpiod
12208 license:gpl2+ ;; gpio-tools
12209 license:lgpl3+)))) ;; C++ bindings
12210
12211(define-public libtraceevent
12212 (package
12213 (name "libtraceevent")
12214 (version "1.9.0")
12215 (source
12216 (origin
12217 (method git-fetch)
12218 (uri (git-reference
12219 (url "https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git")
12220 (commit (string-append name "-" version))))
12221 (file-name (git-file-name name version))
12222 (sha256
12223 (base32 "10fklw4znjhm8mlg6hwlipdyk7v3053lnrc5bpqifnsc8gwqbaz0"))))
12224 (build-system meson-build-system)
12225 (arguments
12226 (list
12227 #:configure-flags
12228 #~(list "-Ddoc=false")))
12229 (home-page "https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/")
12230 (synopsis "Linux kernel trace event library")
12231 (description
12232 "This library parses raw Linux kernel trace event formats.")
12233 (license (list license:gpl2
12234 license:lgpl2.1))))
12235
12236(define-public libtracefs
12237 (package
12238 (name "libtracefs")
12239 (version "1.8.3")
12240 (source
12241 (origin
12242 (method git-fetch)
12243 (uri (git-reference
12244 (url "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git")
12245 (commit (string-append name "-" version))))
12246 (file-name (git-file-name name version))
12247 (sha256
12248 (base32 "1bc4mwf488nlja64zawjznvb6640vchjb25xa02v53x6qfb1mpmq"))))
12249 (build-system meson-build-system)
12250 (arguments
12251 (list
12252 #:configure-flags
12253 #~(list "-Ddoc=false")))
12254 (native-inputs
12255 (list bison
12256 flex
12257 pkg-config))
12258 (inputs (list libtraceevent))
12259 (home-page "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/")
12260 (synopsis "Linux kernel trace file system library")
12261 (description
12262 "This library provides APIs to access the Linux kernel's trace file
12263system.")
12264 (license (list license:gpl2
12265 license:lgpl2.1))))
12266
12267(define-public libtree
12268 (package
12269 (name "libtree")
12270 (version "3.1.1")
12271 (source
12272 (origin
12273 (method git-fetch)
12274 (uri (git-reference
12275 (url "https://github.com/haampie/libtree")
12276 (commit (string-append "v" version))))
12277 (file-name (git-file-name name version))
12278 (patches (search-patches "libtree-fix-check-non-x86.patch"))
12279 (sha256
12280 (base32 "1jbc60cslzcfxk9jwva51ncr1zl1nz0fkgfjdckgv81is11nswmb"))))
12281 (arguments
12282 (list #:make-flags
12283 ;; NOTE: Official documentation recommends to build libtree with
12284 ;; "-static" flag.
12285 #~(list (string-append "CC=" #$(cc-for-target))
12286 (string-append "PREFIX=" #$output))
12287 #:phases
12288 #~(modify-phases %standard-phases
12289 (add-after 'unpack 'fix-tests
12290 ;; XXX: '08_nodeflib' fails as 'libtree' returns a non-zero
12291 ;; code in one of the tests.
12292 ;;
12293 ;; See <https://github.com/haampie/libtree/issues/80>).
12294 (lambda _
12295 (substitute* "tests/08_nodeflib/Makefile"
12296 (("! ../../libtree -vvv exe_b")
12297 "../../libtree -vvv exe_b"))))
12298 (delete 'configure))))
12299 (build-system gnu-build-system)
12300 (home-page "https://github.com/haampie/libtree")
12301 (synopsis "Show output of @command{ldd} as a tree")
12302 (description
12303 "This tool turns @command{ldd} into a tree and explains how shared
12304libraries are found or why they cannot be located.")
12305 (license license:expat)))
12306
12307(define-public touchegg
12308 (package
12309 (name "touchegg")
12310 (version "2.0.18")
12311 (source
12312 (origin
12313 (method git-fetch)
12314 (uri (git-reference
12315 (url "https://github.com/JoseExposito/touchegg")
12316 (commit version)))
12317 (file-name (git-file-name name version))
12318 (sha256
12319 (base32 "0m8zgihij14b8dxrxxvpl8sdsx49mjlnxnm0fhgfxscy7n07kcpc"))))
12320 (build-system cmake-build-system)
12321 (arguments
12322 `(#:tests? #f ; No tests exist
12323 #:configure-flags
12324 (list "-DUSE_SYSTEMD=OFF"))) ; No systemd
12325 (native-inputs
12326 (list
12327 pkg-config))
12328 (inputs
12329 (list
12330 cairo
12331 gtk+
12332 libgudev
12333 libinput
12334 libxrandr
12335 libxtst
12336 pugixml))
12337 (home-page "https://github.com/JoseExposito/touchegg")
12338 (synopsis "Multitouch gesture recognizer")
12339 (description
12340 "Touchégg is an application that runs in the background and transform the
12341gestures you make on your touchpad or touchscreen into visible actions in your
12342desktop.")
12343 (license license:gpl3+)))
12344
12345(define-public evtest
12346 (package
12347 (name "evtest")
12348 (version "1.36")
12349 (source (origin
12350 (method git-fetch)
12351 (uri (git-reference
12352 (url "https://gitlab.freedesktop.org/libevdev/evtest")
12353 (commit (string-append "evtest-" version))))
12354 (file-name (git-file-name name version))
12355 (sha256
12356 (base32
12357 "0mwjvz0fwwcwm4fpw0m4x8bcxpnzjkiy7fpb438vf4i5g5q0dc1k"))))
12358 (build-system gnu-build-system)
12359 (arguments
12360 (list #:tests? #f ;No tests exist
12361 #:make-flags #~(list (string-append "CC="
12362 #$(cc-for-target))
12363 (string-append "PREFIX="
12364 #$output))
12365 #:phases #~(modify-phases %standard-phases
12366 (add-after 'unpack 'generate-doc
12367 (lambda _
12368 (invoke "asciidoc" "-d" "manpage"
12369 "-b" "docbook"
12370 "-o" "evtest.1.xml"
12371 "evtest.txt")
12372 (invoke "xsltproc" "--nonet"
12373 (string-append
12374 #$(this-package-native-input "docbook-xsl")
12375 "/xml/xsl/docbook-xsl-"
12376 #$(package-version
12377 (this-package-native-input "docbook-xsl"))
12378 "/manpages/docbook.xsl")
12379 "evtest.1.xml")))
12380 (replace 'bootstrap
12381 (lambda _
12382 (setenv "CONFIG_SHELL" (which "sh"))
12383 (invoke "autoreconf" "-fi"))))))
12384 (native-inputs (list autoconf
12385 automake
12386 bash-minimal
12387 xmlto
12388 docbook-xsl
12389 libxslt
12390 asciidoc))
12391 (home-page "https://gitlab.freedesktop.org/libevdev/evtest")
12392 (synopsis "Kernel evdev device information and monitor")
12393 (description
12394 "@code{evtest} is a tool to print @code{evdev} kernel events. It reads
12395directly from the kernel device and prints a device description and the events
12396with the value and the symbolic name.")
12397 (license license:gpl2+)))
12398
12399(define-public tp-smapi-module
12400 (package
12401 (name "tp-smapi-module")
12402 (version "0.44")
12403 (source (origin
12404 (method git-fetch)
12405 (uri (git-reference
12406 (url "https://github.com/linux-thinkpad/tp_smapi")
12407 (commit (string-append "tp-smapi/" version))))
12408 (file-name (git-file-name name version))
12409 (sha256
12410 (base32
12411 "0kzbks07bh5jbi1n311zp9cbp1xxyzi7nys8wq1k0k5ig81h9w6k"))))
12412 (build-system linux-module-build-system)
12413 (arguments
12414 `(#:tests? #f)) ;there are none.
12415 (home-page "https://github.com/linux-thinkpad/tp_smapi")
12416 (synopsis
12417 "Linux Kernel module exposing features of ThinkPad hardware")
12418 (description
12419 "This package provides a Linux Kernel module that controls
12420battery charging of specific ThinkPad laptops. It also includes an improved
12421version of the HDAPS driver. The underlying hardware interfaces are
12422@acronym{SMAPI, System Management Application Program Interface} and direct
12423access to the embedded controller.")
12424 (license license:gpl2+)))
12425
12426(define-public modprobed-db
12427 (package
12428 (name "modprobed-db")
12429 (version "2.48")
12430 (source (origin
12431 (method git-fetch)
12432 (uri (git-reference
12433 (url "https://github.com/graysky2/modprobed-db")
12434 (commit (string-append "v" version))))
12435 (file-name (git-file-name name version))
12436 (sha256
12437 (base32
12438 "0jscinga32jjvy3vwl4s1pyd5fjgqhmmk010k665nhil302hzjdc"))))
12439 (build-system gnu-build-system)
12440 (arguments
12441 (list #:tests? #f ;no tests
12442 #:make-flags
12443 #~(list (string-append "PREFIX=" #$output)
12444 "INITDIR_SYSTEMD=no-thanks")
12445 #:phases
12446 #~(modify-phases %standard-phases
12447 (delete 'configure)
12448 (add-after 'install 'fix-path
12449 (lambda* (#:key inputs #:allow-other-keys)
12450 (substitute* (string-append #$output "/bin/modprobed-db")
12451 (("/usr") #$output)
12452 (((string-append "(" (string-join (list "awk"
12453 "cp"
12454 "cut"
12455 "getent"
12456 "grep"
12457 "logname"
12458 "md5sum"
12459 "mkdir"
12460 "mv"
12461 "sed"
12462 "sort"
12463 "uniq"
12464 "wc")
12465 "|") ")") m)
12466 (search-input-file inputs (string-append "/bin/" m)))
12467 (("modprobe ")
12468 (string-append
12469 (search-input-file inputs "/bin/modprobe") " "))))))))
12470 (inputs (list coreutils kmod gawk glibc grep sed))
12471 (home-page "https://wiki.archlinux.org/title/Modprobed-db")
12472 (synopsis "Keep track of Linux modules that have been probed")
12473 (description
12474 "Modprobed-db is a useful utility for users wishing to build a minimal
12475kernel via a @code{make localmodconfig}. In a nutshell, this @command{make}
12476target creates a config based on the current config and a list of modules you
12477define (that @command{modprobed-db} keeps for you). It then disables any
12478module option that is not needed thus not building extraneous modules. This
12479results in a system-specific, streamlined kernel package and footprint as well
12480as reduced compilation times.
12481
12482Modprobed-db simply logs every module ever probed on the target system to a
12483text-based database (@file{$XDG_CONFIG_HOME/modprobed-db}), which can be read
12484directly by @code{make localmodconfig} as described above.")
12485 (license license:expat)))
12486
12487(define-public kernel-hardening-checker
12488 (package
12489 (name "kernel-hardening-checker")
12490 (version "0.6.17.1")
12491 (source (origin
12492 (method git-fetch)
12493 (uri (git-reference
12494 (url "https://github.com/a13xp0p0v/kernel-hardening-checker")
12495 (commit (string-append "v" version))))
12496 (file-name (git-file-name name version))
12497 (sha256
12498 (base32
12499 "04r9bbayhs1ik84908q148k9djawy69zarxw0vc31dfbf64mni62"))))
12500 (build-system pyproject-build-system)
12501 (arguments
12502 (list #:tests? #f)) ;no active tests, runtime only, see GitHub Actions
12503 (native-inputs
12504 (list python-setuptools))
12505 (home-page "https://github.com/a13xp0p0v/kernel-hardening-checker")
12506 (synopsis
12507 "Tool for checking the security hardening options of the Linux kernel")
12508 (description
12509 "@code{kernel-hardening-checker} is a tool for checking the security
12510hardening options of the Linux kernel. Provided preferences are based on
12511suggestions from various sources, including:
12512
12513@itemize
12514@item KSPP recommended settings
12515@item CLIP OS kernel configuration
12516@item Last public grsecurity patch (options which they disable)
12517@item SECURITY_LOCKDOWN_LSM patchset
12518@item Direct feedback from the Linux kernel maintainers
12519@end itemize\n
12520This tool supports checking Kconfig options and kernel cmdline parameters.")
12521 (license license:gpl3)))
12522
12523(define-public firejail
12524 (package
12525 (name "firejail")
12526 (version "0.9.78")
12527 (source (origin
12528 (method git-fetch)
12529 (uri (git-reference
12530 (url "https://github.com/netblue30/firejail")
12531 (commit version)))
12532 (file-name (git-file-name name version))
12533 (sha256
12534 (base32
12535 "18bsnwyg7aidm74qckrp437gr0zy9bpq1b1wr6mfnj61v74fwwxs"))))
12536 (arguments
12537 (list #:phases
12538 #~(modify-phases %standard-phases
12539 (replace 'check
12540 (lambda* (#:key tests? #:allow-other-keys)
12541 (when tests?
12542 (with-directory-excursion "test"
12543 (invoke "make"))))))))
12544 (build-system gnu-build-system)
12545 (inputs
12546 (list apparmor xdg-dbus-proxy))
12547 (synopsis "Linux namespaces sandbox program")
12548 (description
12549 "Firejail is a SUID sandbox program that reduces the risk of security
12550breaches by restricting the running environment of untrusted applications
12551using Linux namespaces, seccomp-bpf and Linux capabilities. The software
12552includes sandbox profiles for a number of common Linux programs. Firejail
12553should be added to the list of setuid programs in the system configuration to
12554work properly.")
12555 (home-page "https://github.com/netblue30/firejail")
12556 (supported-systems
12557 (filter (cut string-suffix? "-linux" <>) %supported-systems))
12558 (license license:gpl2+)))
12559
12560(define-public firejail-disable-sandbox-check
12561 (package/inherit
12562 firejail
12563 (name "firejail-disable-sandbox-check")
12564 (arguments
12565 (substitute-keyword-arguments arguments
12566 ((#:configure-flags flags #~'())
12567 #~(append #$flags
12568 (list "--disable-sandbox-check")))))
12569 (description
12570 (string-append (package-description firejail)
12571 " Builded with @code{--disable-sandbox-check}, which is
12572 only intended for development."))))
12573
12574(define-public edac-utils
12575 (package
12576 (name "edac-utils")
12577 (version "0.18")
12578 (source (origin
12579 (method git-fetch)
12580 (uri (git-reference
12581 (url "https://github.com/grondo/edac-utils.git")
12582 (commit version)))
12583 (file-name (string-append name "-" version "-checkout"))
12584 (sha256
12585 (base32
12586 "04j686m58wsnyy5di7rz0sw9jahlm4ziwxjmgs31pjb87vzw3xgp"))))
12587 (build-system gnu-build-system)
12588 (native-inputs
12589 (list perl))
12590 (inputs
12591 (list sysfsutils))
12592 (synopsis "Memory error detection and correction userspace helpers")
12593 (description "This package provides userspace helpers for memory
12594error detection and correction (EDAC).")
12595 (home-page "https://github.com/grondo/edac-utils")
12596 (license license:gpl2+)))
12597
12598(define-public spectre-meltdown-checker
12599 (package
12600 (name "spectre-meltdown-checker")
12601 (version "0.46")
12602 (source (origin
12603 (method git-fetch)
12604 (uri (git-reference
12605 (url "https://github.com/speed47/spectre-meltdown-checker")
12606 (commit (string-append "v" version))))
12607 (file-name (git-file-name name version))
12608 (patches
12609 (search-patches
12610 "spectre-meltdown-checker-externalize-fwdb.patch"))
12611 ;; Remove builtin firmware database.
12612 (modules '((guix build utils)))
12613 (snippet '(substitute* "spectre-meltdown-checker.sh"
12614 (("^# [AI],.*") "")))
12615 (sha256
12616 (base32
12617 "0j42p6dayb7k87kf8sqimxlaswis3qh0569a15zccyknv9vf129k"))))
12618 (build-system copy-build-system)
12619 (arguments
12620 (list
12621 #:install-plan
12622 #~'(("spectre-meltdown-checker.sh" "bin/spectre-meltdown-checker"))
12623 #:phases
12624 #~(modify-phases %standard-phases
12625 (add-after 'unpack 'fixpath
12626 (lambda* (#:key inputs #:allow-other-keys)
12627 (define* (find-command inputs cmd #:optional (bin "bin"))
12628 (search-input-file inputs (string-append bin "/" cmd)))
12629 (substitute* "spectre-meltdown-checker.sh"
12630 ;; ${opt_arch_prefix}CMD
12631 (("\\$\\{opt_arch_prefix\\}\\<(nm|objdump|readelf|strings)\\>"
12632 all cmd)
12633 (find-command inputs cmd))
12634
12635 ;; Commands safe to substitute directly.
12636 (("\\<(awk|(base|dir)name|bunzip2|g(un)?zip|lz4)\\>" all cmd)
12637 (find-command inputs cmd))
12638 (("\\<(lzop|mktemp|modprobe|pgrep|rmmod|umount)\\>" all cmd)
12639 (find-command inputs cmd))
12640 (("\\<(unlzma|unxz|unzstd|uuencode)\\>" all cmd)
12641 (find-command inputs cmd))
12642
12643 ;; Commands which should only be substituted based on their
12644 ;; surroundings: First up, dd.
12645 (("\\<(dd)\\> if=" all cmd)
12646 (string-append
12647 (find-command inputs cmd)
12648 " if="))
12649
12650 ;; Another special case: sysctl is in sbin.
12651 (("(if |\\$\\( *)\\<(sysctl)\\>" all pre cmd)
12652 (string-append pre (find-command inputs cmd "sbin")))
12653
12654 ;; Meow
12655 (("cat (<<EOF|\"\\$)" all what)
12656 (string-append (find-command inputs "cat") " " what))
12657 (("'cat'")
12658 (string-append "'" (find-command inputs "cat") "'"))
12659 (("\"cat\"")
12660 (string-append "\"" (find-command inputs "cat") "\""))
12661
12662 ;; ${COMMAND} -
12663 ;; ${COMMAND} ^
12664 (("\\<(base64|cut|grep|head|id|mount)\\> ([-^])" all cmd suffix)
12665 (string-append (find-command inputs cmd) " " suffix))
12666 (("\\<(od|perl|rm|uname|xargs)\\> ([-^])" all cmd suffix)
12667 (string-append (find-command inputs cmd) " " suffix))
12668
12669 ;; ${COMMAND} |
12670 (("\\<(dmesg)\\> \\|" all cmd)
12671 (string-append (find-command inputs cmd) " |"))
12672 ;; | ${COMMAND}
12673 (("\\| \\<(grep|sed|sort|stat|tr)\\>" all cmd)
12674 (string-append "| " (find-command inputs cmd)))
12675
12676 ;; Command in sub-shell, i.e. $($COMMAND ...)
12677 (("\\$\\( *(\\<cat|find|grep|mount|nproc|stat|tr\\>)"
12678 all cmd)
12679 (string-append "$(" (find-command inputs cmd)))
12680
12681 ;; command -v
12682 (("command -v \"*\\<(base64|nproc|perl|printf)\\>\"*" all cmd)
12683 (string-append "command -v " (find-command inputs cmd)))))))))
12684 (inputs (list kmod lz4 lzop perl procps sharutils util-linux zstd))
12685 (home-page "https://github.com/speed47/spectre-meltdown-checker")
12686 (synopsis "CPU vulnerability / mitigation checker")
12687 (description
12688 "This package provides a shell script to assess your system's resilience
12689against the several transient execution CVEs that were published since early
126902018, and gives guidance as to how to mitigate them.")
12691 (license license:gpl3)))
12692
12693(define-public csmith
12694 (package
12695 (name "csmith")
12696 (version "2.3.0")
12697 (source (origin
12698 (method git-fetch)
12699 (uri (git-reference
12700 (url "https://github.com/csmith-project/csmith")
12701 (commit (string-append "csmith-" version))))
12702 (file-name (git-file-name name version))
12703 (sha256
12704 (base32
12705 "0nhrsnv6cny14xz68qb1h30fbwc05adkisk51p3x63mydm60ddl3"))))
12706 (build-system gnu-build-system)
12707 (native-inputs
12708 (list autoconf automake libtool m4 perl))
12709 (arguments
12710 (list
12711 #:tests? #f ;no test suite
12712 ;; Do not install headers under 'include/csmith-VERSION' but in
12713 ;; 'include/csmith'.
12714 #:phases
12715 `(modify-phases %standard-phases
12716 (add-after 'unpack 'patch-includedir
12717 (lambda _
12718 (substitute* "runtime/Makefile.am"
12719 (("\\$\\(includedir\\)/\\$\\(PACKAGE\\)-\\$\\(VERSION\\)")
12720 "$(includedir)/$(PACKAGE)"))))
12721 (add-before 'bootstrap 'force-bootstrap
12722 (lambda _
12723 (delete-file "configure"))))))
12724 (home-page "https://github.com/csmith-project/csmith")
12725 (synopsis "Random generator of C programs")
12726 (description "The primary purpose of Csmith is to find compiler bugs with
12727random programs using differential testing.")
12728 (license license:bsd-4)))
12729
12730(define-public ipvsadm
12731 (package
12732 (name "ipvsadm")
12733 (version "1.31")
12734 (source
12735 (origin
12736 (method url-fetch)
12737 (uri (string-append "https://kernel.org/pub/linux/utils/kernel"
12738 "/ipvsadm/ipvsadm-" version ".tar.xz"))
12739 (sha256
12740 (base32 "1nyzpv1hx75k9lh0vfxfhc0p2fpqaqb38xpvs8sn88m1nljmw2hs"))))
12741 (build-system gnu-build-system)
12742 (native-inputs (list linux-libre-headers pkg-config which))
12743 (inputs (list libnl popt))
12744 (arguments
12745 (list #:tests? #f
12746 #:parallel-build? #f ;build fails randomly with '-j'
12747 #:make-flags
12748 #~(list (string-join
12749 (list "CFLAGS="
12750 (string-append "-I"
12751 #$(this-package-input "libnl")
12752 "/include/libnl3")
12753 (string-append "-L" #$(this-package-input "libnl")
12754 "/lib")
12755 "-fPIC")
12756 " ")
12757 (string-append "CC=" #$(cc-for-target))
12758 (string-append "SBIN=" #$output "/sbin")
12759 (string-append "INIT=" #$output "/etc/init.d")
12760 (string-append "MANDIR=" #$output "/share/man"))
12761 #:phases #~(modify-phases %standard-phases
12762 (delete 'configure))))
12763 (home-page "http://www.linuxvirtualserver.org/software/ipvs.html")
12764 (synopsis "IP virtual server administration utility")
12765 (description "@code{ipvsadm(8)} is used to set up, maintain or inspect the
12766virtual server table in the Linux kernel. The Linux Virtual Server can be used
12767to build scalable network services based on a cluster of two or more nodes.")
12768 (license license:gpl2+)))
12769
12770(define-public ryzenadj
12771 (package
12772 (name "ryzenadj")
12773 (version "0.17.0")
12774 (source
12775 (origin
12776 (method git-fetch)
12777 (uri (git-reference
12778 (url "https://github.com/flygoat/ryzenadj")
12779 (commit (string-append "v" version))))
12780 (file-name (git-file-name name version))
12781 (sha256
12782 (base32 "0dpznl4h1f5syq5464a0h9grqlvlp0qmjxr59nq3gp363gr5vjfv"))
12783 (modules '((guix build utils)))
12784 (snippet
12785 '(begin
12786 (delete-file-recursively "win32")))))
12787 (build-system cmake-build-system)
12788 (inputs (list pciutils))
12789 (arguments
12790 (list
12791 #:tests? #f ;No test suite
12792 #:build-type "Release"))
12793 (home-page "https://github.com/flygoat/ryzenadj")
12794 (synopsis "Power management tool for AMD Ryzen APUs")
12795 (description
12796 "@command{ryzenadj} is an utility to adjust power management settings for
12797AMD Ryzen mobile processors. You will need to ensure it can access /dev/mem,
12798for instance by using the \"iomem=relaxed\" kernel argument.")
12799 (license license:lgpl3)))
12800
12801(define-public ryzen-smu
12802 (package
12803 (name "ryzen-smu")
12804 (version "0.1.5")
12805 (source (origin
12806 (method git-fetch)
12807 (uri (git-reference
12808 (url "https://gitlab.com/leogx9r/ryzen_smu.git")
12809 (commit (string-append "v" version))))
12810 (file-name (git-file-name name version))
12811 (sha256
12812 (base32
12813 "010la2a8zp7rljlg5ssc9ragzva4ca05gvzlicjagl508659d2wz"))))
12814 (build-system linux-module-build-system)
12815 (arguments
12816 `(#:tests? #f)) ; no tests
12817 (synopsis "System Management Unit driver for AMD Ryzen processors")
12818 (description "This package provides a way to access the
12819System Management Unit for certain AMD Ryzen processors.
12820This includes access to the System Management Network.")
12821 (home-page "https://gitlab.com/leogx9r/ryzen_smu")
12822 (license license:gpl2)))
12823
12824(define-public hid-wiimote-plus
12825 (package
12826 (name "hid-wiimote-plus")
12827 (version "1.0.0")
12828 (source
12829 (origin
12830 (method git-fetch)
12831 (uri (git-reference
12832 (url "https://github.com/dkosmari/hid-wiimote-plus")
12833 (commit (string-append "v" version))))
12834 (file-name (git-file-name name version))
12835 (sha256
12836 (base32 "0vly8z9876yiaxx77ca9lbf9hfv5xichkkxxczjhbs2qwr819k1k"))))
12837 (build-system linux-module-build-system)
12838 (arguments
12839 (list #:tests? #f)) ; No tests.
12840 (synopsis "WiiMote HID kernel module")
12841 (description "This package provides a WiiMote driver that follows the
12842Linux input convention. Specifically, that allows you to use the D-pad
12843as a gamepad.")
12844 (home-page "https://github.com/dkosmari/hid-wiimote-plus")
12845 (license license:gpl2+)))
12846
12847(define-public python-evemu
12848 (package
12849 (name "python-evemu")
12850 (version "2.7.0")
12851 (source (origin
12852 (method git-fetch)
12853 (uri (git-reference
12854 (url "https://gitlab.freedesktop.org/libevdev/evemu")
12855 (commit (string-append "v" version))))
12856 (file-name (git-file-name name version))
12857 (sha256
12858 (base32
12859 "1sxf6v2wnajj9srlkfjfymjmmp4dlq73gzjcjmaw015a3c0xl029"))))
12860 (build-system gnu-build-system)
12861 (arguments
12862 (list #:tests? #f ; would open device files
12863 #:phases
12864 #~(modify-phases %standard-phases
12865 (add-after 'unpack 'patch
12866 (lambda* (#:key inputs #:allow-other-keys)
12867 (substitute* "python/evemu/base.py"
12868 (("\"libevdev.so\"")
12869 (string-append "\"" (assoc-ref inputs "libevdev")
12870 "/lib/libevdev.so\""))))))))
12871 (native-inputs
12872 (list asciidoc autoconf automake libtool docbook-xsl pkg-config
12873 python-wrapper xmlto))
12874 (inputs
12875 (list libevdev))
12876 (synopsis "Record and replay input device events")
12877 (description "This package provides a way to record and replay device
12878descriptions and events, making it possible to emulate input devices
12879through the Linux kernel's input system. Emulated devices are for most
12880practical purposes indistinguishable from real devices.
12881
12882It provides a command line program and also a Python library.")
12883 (home-page "https://www.freedesktop.org/wiki/Evemu/")
12884 (license license:gpl3)))
12885
12886(define-public dualsensectl
12887 (package
12888 (name "dualsensectl")
12889 (version "0.7")
12890 (source (origin
12891 (method git-fetch)
12892 (uri (git-reference
12893 (url "https://github.com/nowrep/dualsensectl.git")
12894 (commit (string-append "v" version))))
12895 (file-name (git-file-name name version))
12896 (sha256
12897 (base32
12898 "05snsp5r3hc2yc1nf0w4aam1my4h0lkxnmy7k4glxvasd9jwahzw"))))
12899 (build-system meson-build-system)
12900 (native-inputs
12901 (list pkg-config))
12902 (inputs
12903 (list eudev dbus hidapi))
12904 (synopsis "Linux tool for controlling PS5 DualSense controller")
12905 (description "This package provides a Linux tool for controlling a PS5
12906DualSense controller. It has to be already connected via USB or connected
12907via Bluetooth.")
12908 (home-page "https://github.com/nowrep/dualsensectl")
12909 (license license:gpl2)))