projects/guix·blob dexed · refs

12996 lines · 577.1 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012-2021, 2021-2025 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-2025 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, 2024, 2025 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-2025 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, 2025 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;;;
90;;; This file is part of GNU Guix.
91;;;
92;;; GNU Guix is free software; you can redistribute it and/or modify it
93;;; under the terms of the GNU General Public License as published by
94;;; the Free Software Foundation; either version 3 of the License, or (at
95;;; your option) any later version.
96;;;
97;;; GNU Guix is distributed in the hope that it will be useful, but
98;;; WITHOUT ANY WARRANTY; without even the implied warranty of
99;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
100;;; GNU General Public License for more details.
101;;;
102;;; You should have received a copy of the GNU General Public License
103;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
104
105(define-module (gnu packages linux)
106 #:use-module (gnu packages)
107 #:use-module (gnu packages acl)
108 #:use-module (gnu packages adns)
109 #:use-module (gnu packages admin)
110 #:use-module (gnu packages algebra)
111 #:use-module (gnu packages apparmor)
112 #:use-module (gnu packages audio)
113 #:use-module (gnu packages autotools)
114 #:use-module (gnu packages avahi)
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 cpio)
123 #:use-module (gnu packages cpp)
124 #:use-module (gnu packages crypto)
125 #:use-module (gnu packages cryptsetup)
126 #:use-module (gnu packages compression)
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 docbook)
133 #:use-module (gnu packages documentation)
134 #:use-module (gnu packages dlang)
135 #:use-module (gnu packages elf)
136 #:use-module (gnu packages file)
137 #:use-module (gnu packages flex)
138 #:use-module (gnu packages fontutils)
139 #:use-module (gnu packages freedesktop)
140 #:use-module (gnu packages gawk)
141 #:use-module (gnu packages gcc)
142 #:use-module (gnu packages gettext)
143 #:use-module (gnu packages glib)
144 #:use-module (gnu packages gnome)
145 #:use-module (gnu packages gnupg)
146 #:use-module (gnu packages golang)
147 #:use-module (gnu packages gperf)
148 #:use-module (gnu packages graphviz)
149 #:use-module (gnu packages gstreamer)
150 #:use-module (gnu packages gtk)
151 #:use-module (gnu packages guile)
152 #:use-module (gnu packages haskell-apps)
153 #:use-module (gnu packages haskell-xyz)
154 #:use-module (gnu packages image)
155 #:use-module (gnu packages kde-frameworks)
156 #:use-module (gnu packages libedit)
157 #:use-module (gnu packages kde-graphics)
158 #:use-module (gnu packages libevent)
159 #:use-module (gnu packages libunwind)
160 #:use-module (gnu packages libusb)
161 #:use-module (gnu packages llvm)
162 #:use-module (gnu packages lsof)
163 #:use-module (gnu packages lua)
164 #:use-module (gnu packages m4)
165 #:use-module (gnu packages man)
166 #:use-module (gnu packages maths)
167 #:use-module (gnu packages multiprecision)
168 #:use-module (gnu packages ncurses)
169 #:use-module (gnu packages netpbm)
170 #:use-module (gnu packages networking)
171 #:use-module (gnu packages nss)
172 #:use-module (gnu packages onc-rpc)
173 #:use-module (gnu packages oneapi)
174 #:use-module (gnu packages perl)
175 #:use-module (gnu packages pciutils)
176 #:use-module (gnu packages pkg-config)
177 #:use-module (gnu packages polkit)
178 #:use-module (gnu packages popt)
179 #:use-module (gnu packages protobuf)
180 #:use-module (gnu packages pulseaudio)
181 #:use-module (gnu packages python)
182 #:use-module (gnu packages python-build)
183 #:use-module (gnu packages python-xyz)
184 #:use-module (gnu packages qt)
185 #:use-module (gnu packages readline)
186 #:use-module (gnu packages regex)
187 #:use-module (gnu packages rpc)
188 #:use-module (gnu packages rrdtool)
189 #:use-module (gnu packages rsync)
190 #:use-module (gnu packages rust-sources)
191 #:use-module (gnu packages samba)
192 #:use-module (gnu packages sdl)
193 #:use-module (gnu packages serialization)
194 #:use-module (gnu packages slang)
195 #:use-module (gnu packages sqlite)
196 #:use-module (gnu packages texinfo)
197 #:use-module (gnu packages textutils)
198 #:use-module (gnu packages tls)
199 #:use-module (gnu packages valgrind)
200 #:use-module (gnu packages video)
201 #:use-module (gnu packages vim)
202 #:use-module (gnu packages vulkan)
203 #:use-module (gnu packages web)
204 #:use-module (gnu packages xiph)
205 #:use-module (gnu packages xml)
206 #:use-module (gnu packages xdisorg)
207 #:use-module (gnu packages xorg)
208 #:use-module (gnu packages groff)
209 #:use-module (gnu packages selinux)
210 #:use-module (gnu packages sphinx)
211 #:use-module (gnu packages swig)
212 #:use-module (guix platform)
213 #:use-module (guix build-system cmake)
214 #:use-module (guix build-system copy)
215 #:use-module (guix build-system gnu)
216 #:use-module (guix build-system go)
217 #:use-module (guix build-system meson)
218 #:use-module (guix build-system pyproject)
219 #:use-module (guix build-system python)
220 #:use-module (guix build-system qt)
221 #:use-module (guix build-system trivial)
222 #:use-module (guix build-system linux-module)
223 #:use-module (guix download)
224 #:use-module (guix git-download)
225 #:use-module ((guix licenses) #:prefix license:)
226 #:use-module (guix packages)
227 #:use-module (guix gexp)
228 #:use-module (guix store)
229 #:use-module (guix monads)
230 #:use-module (guix utils)
231 #:use-module (guix deprecation) ;for libcap/next
232 #:use-module (srfi srfi-1)
233 #:use-module (srfi srfi-2)
234 #:use-module (srfi srfi-26)
235 #:use-module (ice-9 match)
236 #:use-module (ice-9 regex)
237 #:export (customize-linux
238 make-defconfig))
239
240
241
242;;;
243;;; Linux kernel customization functions.
244;;;
245
246(define* (customize-linux #:key name
247 (linux linux-libre)
248 source
249 defconfig
250 modconfig
251 (configs "")
252 extra-version)
253 "Make a customized Linux package NAME derived from the LINUX package.
254
255If NAME is not given, then it defaults to the same name as the LINUX package.
256
257Unless SOURCE is given the source of LINUX is used.
258
259A DEFCONFIG file to be used can be given as an origin, as a file-like object
260(file-append, local-file etc.), or as a string with the name of a defconfig file
261available in the Linux sources. If DEFCONFIG is not given, then a defconfig
262file will be saved from the LINUX package configuration.
263
264MODCONFIG is an origin or file-like object used for make localmodconfig to
265disable unlisted modules. For instance, this can come from using modprobed-db
266periodically on a running machine to find all loaded modules.
267
268Additional CONFIGS will be used to modify the given or saved defconfig, which
269will finally be used to build Linux.
270
271CONFIGS can be a list of strings, with one configuration per line. The usual
272defconfig syntax has to be used, but there is a special extension to ease the
273removal of configurations. Comment lines are supported as well.
274
275Here is an example:
276
277 '(;; This string defines the version tail in 'uname -r'.
278 \"CONFIG_LOCALVERSION=\\\"-handcrafted\\\"
279 ;; This '# CONFIG_... is not set' syntax has to match exactly!
280 \"# CONFIG_BOOT_CONFIG is not set\"
281 \"CONFIG_NFS_SWAP=y\"
282 ;; This is a multiline configuration:
283 \"CONFIG_E1000=y
284# This is a comment, below follows an extension to unset a configuration:
285CONFIG_CMDLINE_EXTEND\")
286
287A string of configurations instead of a list of configuration strings is also
288possible.
289
290EXTRA-VERSION can be a string overwriting the EXTRAVERSION setting of the LINUX
291package, after being prepended by a hyphen. It will be visible in the output
292of 'uname -r' behind the Linux version numbers."
293 (package
294 (inherit linux)
295 (name (or name (package-name linux)))
296 (source (or source (package-source linux)))
297 (arguments
298 (substitute-keyword-arguments
299 (package-arguments linux)
300 ((#:imported-modules imported-modules %default-gnu-imported-modules)
301 `((guix build kconfig) ,@imported-modules))
302 ((#:modules modules)
303 `((guix build kconfig) ,@modules))
304 ((#:phases phases)
305 #~(modify-phases #$phases
306 (replace 'configure
307 (lambda* (#:key inputs #:allow-other-keys #:rest arguments)
308 (setenv "EXTRAVERSION"
309 #$(and extra-version
310 (not (string-null? extra-version))
311 (string-append "-" extra-version)))
312 (let* ((configs (string-append "arch/" #$(linux-srcarch)
313 "/configs/"))
314 (guix_defconfig (string-append configs
315 "guix_defconfig")))
316 #$(cond
317 ((not defconfig)
318 #~(begin
319 ;; Call the original 'configure phase.
320 (apply (assoc-ref #$phases 'configure) arguments)
321 ;; Save a defconfig file.
322 (invoke "make" "savedefconfig")
323 ;; Move the saved defconfig to the proper location.
324 (rename-file "defconfig"
325 guix_defconfig)))
326 ((string? defconfig)
327 ;; Use another existing defconfig from the Linux sources.
328 #~(rename-file (string-append configs #$defconfig)
329 guix_defconfig))
330 (else
331 ;; Copy the defconfig input to the proper location.
332 #~(copy-file #$defconfig guix_defconfig)))
333 (chmod guix_defconfig #o644)
334 (modify-defconfig guix_defconfig '#$configs)
335 (invoke "make" "guix_defconfig")
336 (verify-config ".config" guix_defconfig)
337 ;; Minimize module building if provided e.g. a modprobed-db
338 ;; database.
339 (if #$modconfig
340 (invoke "make" (string-append "LSMOD=" #$modconfig)
341 "localmodconfig")))))))))))
342
343(define (make-defconfig uri sha256-as-base32)
344 (origin (method url-fetch)
345 (uri uri)
346 (sha256 (base32 sha256-as-base32))))
347
348(define (linux-srcarch)
349 "Return the linux SRCARCH name, which is set in the toplevel Makefile of
350Linux and denotes the architecture-specific directory name below arch/ in its
351source code. Some few architectures share a common folder. It resembles the
352definition of SRCARCH based on ARCH in the Makefile and may be used to place a
353defconfig file in the proper path."
354 (let ((linux-arch (platform-linux-architecture
355 (lookup-platform-by-target-or-system
356 (or (%current-target-system)
357 (%current-system))))))
358 (match linux-arch
359 ("i386" "x86")
360 ("x86_64" "x86")
361 ("sparc32" "sparc")
362 ("sparc64" "sparc")
363 ("sh64" "sh")
364 (_ linux-arch))))
365
366(define-public (system->defconfig system)
367 "Some systems (notably powerpc-linux) require a special target for kernel
368defconfig. Return the appropriate Make target if applicable, otherwise return
369\"defconfig\"."
370 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
371 ((string-prefix? "powerpc64-" system) "ppc64_defconfig")
372 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
373 (else "defconfig")))
374
375
376;;;
377;;; Kernel source code deblobbing.
378;;;
379
380(define (linux-libre-deblob-scripts version gnu-revision
381 deblob-hash
382 deblob-check-hash)
383 (list (version-major+minor version)
384 (origin
385 (method url-fetch)
386 (uri (string-append "https://linux-libre.fsfla.org"
387 "/pub/linux-libre/releases/" version "-" gnu-revision "/"
388 "deblob-" (version-major+minor version)))
389 (file-name (string-append "linux-libre-deblob-"
390 version "-" gnu-revision))
391 (sha256 deblob-hash))
392 (origin
393 (method url-fetch)
394 (uri (string-append "https://linux-libre.fsfla.org"
395 "/pub/linux-libre/releases/" version "-" gnu-revision "/"
396 "deblob-check"))
397 (file-name (string-append "linux-libre-deblob-check-" version "-" gnu-revision))
398 (sha256 deblob-check-hash))))
399
400;; XXXX: Workaround 'snippet' limitations
401(define computed-origin-method (@@ (guix packages) computed-origin-method))
402
403(define (make-linux-libre-source version
404 upstream-source
405 deblob-scripts)
406 "Return a 'computed' origin that generates a Linux-libre tarball from the
407corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
408 (match deblob-scripts
409 ((deblob-version (? origin? deblob) (? origin? deblob-check))
410 (unless (string=? deblob-version (version-major+minor version))
411 ;; The deblob script cannot be expected to work properly on a
412 ;; different version (major+minor) of Linux, even if no errors
413 ;; are signaled during execution.
414 (error "deblob major+minor version mismatch"))
415 (origin
416 (method computed-origin-method)
417 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
418 (sha256 #f)
419 (uri
420 (delay
421 (with-imported-modules '((guix build utils))
422 #~(begin
423 (use-modules (guix build utils)
424 (srfi srfi-1)
425 (ice-9 match)
426 (ice-9 ftw))
427
428 (setvbuf (current-output-port) 'line)
429
430 (let ((dir (string-append "linux-" #$version)))
431
432 (mkdir "/tmp/bin")
433 (set-path-environment-variable
434 "PATH" '("bin")
435 (list "/tmp"
436 #+(canonical-package bash)
437 #+(canonical-package coreutils)
438 #+(canonical-package diffutils)
439 #+(canonical-package findutils)
440 #+(canonical-package patch)
441 #+(canonical-package xz)
442 #+(canonical-package sed)
443 #+(canonical-package grep)
444 #+(canonical-package bzip2)
445 #+(canonical-package gzip)
446 #+(canonical-package tar)
447 #+(canonical-package gawk)
448 #+python-wrapper))
449
450 (with-directory-excursion "/tmp/bin"
451
452 (copy-file #+deblob "deblob")
453 (chmod "deblob" #o755)
454 (substitute* "deblob"
455 (("/bin/sh") (which "sh")))
456
457 (copy-file #+deblob-check "deblob-check")
458 (chmod "deblob-check" #o755)
459 (substitute* "deblob-check"
460 (("/bin/sh") (which "sh"))
461 (("/bin/sed") (which "sed"))
462 (("/usr/bin/python") (which "python"))))
463
464 (if (file-is-directory? #+upstream-source)
465 (begin
466 (format #t "Copying upstream linux source...~%")
467 (invoke "cp" "--archive" #+upstream-source dir)
468 (invoke "chmod" "--recursive" "u+w" dir))
469 (begin
470 (format #t "Unpacking upstream linux tarball...~%")
471 (invoke "tar" "xf" #$upstream-source)
472 (match (scandir "."
473 (lambda (name)
474 (and (not (member name '("." "..")))
475 (file-is-directory? name))))
476 ((unpacked-dir)
477 (unless (string=? dir unpacked-dir)
478 (rename-file unpacked-dir dir)))
479 (dirs
480 (error "multiple directories found" dirs)))))
481
482 (with-directory-excursion dir
483 (format #t "Running deblob script...~%")
484 (invoke "/tmp/bin/deblob"))
485
486 (format #t "~%Packing new Linux-libre tarball...~%")
487 (invoke "tar" "cvfa" #$output
488 ;; Avoid non-determinism in the archive.
489 "--mtime=@0"
490 "--owner=root:0"
491 "--group=root:0"
492 "--sort=name"
493 "--hard-dereference"
494 dir)
495
496 (format #t "~%Scanning the generated tarball for blobs...~%")
497 (invoke "/tmp/bin/deblob-check" "--use-awk" "--list-blobs"
498 #$output))))))))))
499
500
501;;;
502;;; Kernel sources.
503;;;
504
505(define (linux-libre-urls version gnu-revision)
506 "Return a list of URLs for Linux-Libre VERSION."
507 (list (string-append
508 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
509 version "-" gnu-revision "/linux-libre-" version "-" gnu-revision ".tar.xz")
510
511 ;; XXX: Work around <http://bugs.gnu.org/14851>.
512 (string-append
513 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
514 version "-" gnu-revision ".tar.xz")
515
516 ;; Maybe this URL will become valid eventually.
517 (string-append
518 "mirror://gnu/linux-libre/" version "-" gnu-revision "/linux-libre-"
519 version "-" gnu-revision ".tar.xz")))
520
521(define (%upstream-linux-source version hash)
522 (origin
523 (method url-fetch)
524 (uri (string-append "mirror://kernel.org"
525 "/linux/kernel/v" (version-major version) ".x/"
526 "linux-" version ".tar.xz"))
527 (sha256 hash)))
528
529;; The current "stable" kernels. That is, the most recently released major
530;; versions that are still supported upstream.
531
532(define-public linux-libre-6.18-version "6.18.7")
533(define-public linux-libre-6.18-gnu-revision "gnu")
534(define deblob-scripts-6.18
535 (linux-libre-deblob-scripts
536 linux-libre-6.18-version
537 linux-libre-6.18-gnu-revision
538 (base32 "1piyq7183bdf169w66k62yr1vbs0ls7pqx3cyyk7hisw8vhy643j")
539 (base32 "1xdz33lshw1xs6a5qiwhvxzdh2a0acll1zdyk2mnn9d4579a4gn1")))
540(define-public linux-libre-6.18-pristine-source
541 (let ((version linux-libre-6.18-version)
542 (hash (base32 "07lgbc0w7fd9akxmazhkpjgxhd3ffwh7in2nkchhdbprbk8s89mp")))
543 (make-linux-libre-source version
544 (%upstream-linux-source version hash)
545 deblob-scripts-6.18)))
546
547(define-public linux-libre-6.17-version "6.17.13")
548(define-public linux-libre-6.17-gnu-revision "gnu")
549(define deblob-scripts-6.17
550 (linux-libre-deblob-scripts
551 linux-libre-6.17-version
552 linux-libre-6.17-gnu-revision
553 (base32 "15qc7p6axs5l9syizbcbnksw8lxm8nnlcrl3q4k8cbs3lrxacpjv")
554 (base32 "14fypjidk49l0799dbi1pacy37ks94k0bs38cck2y4glxfpbfqr6")))
555(define-public linux-libre-6.17-pristine-source
556 (let ((version linux-libre-6.17-version)
557 (hash (base32 "1fgdy9j90yfd4c2yqdciasdhda14pbfrpzkgriin2r6i7bf04s0i")))
558 (make-linux-libre-source version
559 (%upstream-linux-source version hash)
560 deblob-scripts-6.17)))
561
562;; The "longterm" kernels — the older releases with long-term upstream support.
563;; Here are the support timelines:
564;; <https://www.kernel.org/category/releases.html>
565
566(define-public linux-libre-6.12-version "6.12.67")
567(define-public linux-libre-6.12-gnu-revision "gnu")
568(define deblob-scripts-6.12
569 (linux-libre-deblob-scripts
570 linux-libre-6.12-version
571 linux-libre-6.12-gnu-revision
572 (base32 "168aykyvyyp34549hqhlprl0n052q8wdb2y3vyxqw40wpf2vw3ln")
573 (base32 "1wyfggr9q0f10yr3nxsvx3nd3wscp5145fgxw0ps0b09ckcyr2mi")))
574(define-public linux-libre-6.12-pristine-source
575 (let ((version linux-libre-6.12-version)
576 (hash (base32 "0cn42b7pam5ssk740s3d42sp3cggl923yvs67y5fz98z5v35v00n")))
577 (make-linux-libre-source version
578 (%upstream-linux-source version hash)
579 deblob-scripts-6.12)))
580
581(define-public linux-libre-6.6-version "6.6.121")
582(define-public linux-libre-6.6-gnu-revision "gnu")
583(define deblob-scripts-6.6
584 (linux-libre-deblob-scripts
585 linux-libre-6.6-version
586 linux-libre-6.6-gnu-revision
587 (base32 "0y3lawljby2rl0mb0yjdyaasci4pl935y8xa0dnmbzff23knkxlw")
588 (base32 "0z47f6mkllk1fgpq04x73djl5gh3mj50bxj2rpg4jlzm0rcirrag")))
589(define-public linux-libre-6.6-pristine-source
590 (let ((version linux-libre-6.6-version)
591 (hash (base32 "1fhl9pr02s10j4b5nli0isy7ps644cpbmjqzkwf5mk14rr7rvbvn")))
592 (make-linux-libre-source version
593 (%upstream-linux-source version hash)
594 deblob-scripts-6.6)))
595
596(define-public linux-libre-6.1-version "6.1.161")
597(define-public linux-libre-6.1-gnu-revision "gnu")
598(define deblob-scripts-6.1
599 (linux-libre-deblob-scripts
600 linux-libre-6.1-version
601 linux-libre-6.1-gnu-revision
602 (base32 "10gcbkd5jxfspa712kvb3qmsjgsapd9cz47pmpfk03bbfzf8ydlv")
603 (base32 "1jiwwl5sgpc16x0v6phbknv94mc46gvwgc2z8s4pdgn4j54yrd8v")))
604(define-public linux-libre-6.1-pristine-source
605 (let ((version linux-libre-6.1-version)
606 (hash (base32 "0aasgrq6mv5nj7b8ashzx0pxlaah5y0f3sq7d8w00di2lyync5ml")))
607 (make-linux-libre-source version
608 (%upstream-linux-source version hash)
609 deblob-scripts-6.1)))
610
611(define-public linux-libre-5.15-version "5.15.198")
612(define-public linux-libre-5.15-gnu-revision "gnu")
613(define deblob-scripts-5.15
614 (linux-libre-deblob-scripts
615 linux-libre-5.15-version
616 linux-libre-5.15-gnu-revision
617 (base32 "0b2gd83ihxlq490gpgq930misc6jrckw4rzl7fvwd0qzczqjvff5")
618 (base32 "1s6km2r2mad0wpf7nqn4rqsykw1lm386l1yskmil24239fbva1f1")))
619(define-public linux-libre-5.15-pristine-source
620 (let ((version linux-libre-5.15-version)
621 (hash (base32 "0hwpwbvjh6y4dhbpp34x9j25nc6x48fbiz65zzavplqdb2a0jk2x")))
622 (make-linux-libre-source version
623 (%upstream-linux-source version hash)
624 deblob-scripts-5.15)))
625
626(define-public linux-libre-5.10-version "5.10.248")
627(define-public linux-libre-5.10-gnu-revision "gnu1")
628(define deblob-scripts-5.10
629 (linux-libre-deblob-scripts
630 linux-libre-5.10-version
631 linux-libre-5.10-gnu-revision
632 (base32 "1wn9k4lbxcc9rzl1rqidlnb472wyayillrh57gyxnghi7j9ghqna")
633 (base32 "1hgza8fsps7bkjf4i0f2xgvrh1r183z3i6lxrr2nr8qbi5d13qs7")))
634(define-public linux-libre-5.10-pristine-source
635 (let ((version linux-libre-5.10-version)
636 (hash (base32 "01g05n856c9q7m46dmn48pq7hfph4b1kpvrjvrykg8q4z7qy9rmm")))
637 (make-linux-libre-source version
638 (%upstream-linux-source version hash)
639 deblob-scripts-5.10)))
640
641(define-public linux-libre-5.4-version "5.4.302")
642(define-public linux-libre-5.4-gnu-revision "gnu1")
643(define deblob-scripts-5.4
644 (linux-libre-deblob-scripts
645 linux-libre-5.4-version
646 linux-libre-5.4-gnu-revision
647 (base32 "168ysrpcbfhm6s71l9w8ibjq2frjmiaixc2wbsq86gx2zw6zyb5p")
648 (base32 "0l7pwhgw9laxfypcpqlz411x3hybcw2269abh3lpcw96bgv5m1k2")))
649(define-public linux-libre-5.4-pristine-source
650 (let ((version linux-libre-5.4-version)
651 (hash (base32 "0ga2q6lf6xvb7pb6kn2prgywsvsavb4kwygsn37xd91ay43k4smf")))
652 (make-linux-libre-source version
653 (%upstream-linux-source version hash)
654 deblob-scripts-5.4)))
655
656(define %boot-logo-patch
657 ;; Linux-Libre boot logo featuring Freedo and a gnu.
658 (origin
659 (method url-fetch)
660 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
661 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
662 (sha256
663 (base32
664 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
665
666(define %linux-libre-arm-export-__sync_icache_dcache-patch
667 (origin
668 (method url-fetch)
669 (uri (string-append
670 "https://salsa.debian.org/kernel-team/linux"
671 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
672 "/debian/patches/bugfix/arm/"
673 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
674 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
675 (sha256
676 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
677
678(define (source-with-patches source patches)
679 (origin
680 (inherit source)
681 (patches (append (origin-patches source)
682 patches))))
683
684(define-public linux-libre-6.18-source
685 (source-with-patches linux-libre-6.18-pristine-source
686 (list %boot-logo-patch
687 %linux-libre-arm-export-__sync_icache_dcache-patch)))
688
689(define-public linux-libre-6.17-source
690 (source-with-patches linux-libre-6.17-pristine-source
691 (list %boot-logo-patch
692 %linux-libre-arm-export-__sync_icache_dcache-patch)))
693
694(define-public linux-libre-6.12-source
695 (source-with-patches linux-libre-6.12-pristine-source
696 (list %boot-logo-patch
697 %linux-libre-arm-export-__sync_icache_dcache-patch)))
698
699(define-public linux-libre-6.6-source
700 (source-with-patches linux-libre-6.6-pristine-source
701 (list %boot-logo-patch
702 %linux-libre-arm-export-__sync_icache_dcache-patch)))
703
704(define-public linux-libre-6.1-source
705 (source-with-patches linux-libre-6.1-pristine-source
706 (append
707 (list %boot-logo-patch
708 %linux-libre-arm-export-__sync_icache_dcache-patch)
709 (search-patches
710 "linux-libre-infodocs-target.patch"))))
711
712(define-public linux-libre-5.15-source
713 (source-with-patches linux-libre-5.15-pristine-source
714 (list %boot-logo-patch
715 %linux-libre-arm-export-__sync_icache_dcache-patch)))
716
717(define-public linux-libre-5.10-source
718 (source-with-patches linux-libre-5.10-pristine-source
719 (list %boot-logo-patch
720 %linux-libre-arm-export-__sync_icache_dcache-patch)))
721
722(define-public linux-libre-5.4-source
723 (source-with-patches linux-libre-5.4-pristine-source
724 (list %boot-logo-patch
725 %linux-libre-arm-export-__sync_icache_dcache-patch
726 ;; Pinebook Pro patch from linux-next,
727 ;; can be dropped for linux-libre 5.7
728 (search-patch
729 "linux-libre-support-for-Pinebook-Pro.patch"))))
730
731
732;;;
733;;; Kernel headers.
734;;;
735
736(define %linux-libre-timeout-properties
737 ;; Package properties for 'linux-libre' and 'linux-libre-headers' packages.
738 `((timeout . ,(* 8 3600)) ;deblob takes >5h on AArch64
739 (max-silent-time . ,(* 3 3600)))) ;don't time out on blob scan
740
741(define (make-linux-libre-headers version gnu-revision hash-string)
742 (make-linux-libre-headers* version gnu-revision
743 (origin
744 (method url-fetch)
745 (uri (linux-libre-urls version gnu-revision))
746 (sha256 (base32 hash-string)))))
747
748(define (make-linux-libre-headers* version gnu-revision source)
749 (package
750 (name "linux-libre-headers")
751 (version version)
752 (source source)
753 (build-system gnu-build-system)
754 (native-inputs `(("perl" ,perl)
755 ,@(if (version>=? version "4.16")
756 `(("flex" ,flex)
757 ("bison" ,bison))
758 '())))
759 (arguments
760 `(#:modules ((guix build gnu-build-system)
761 (guix build utils)
762 (srfi srfi-1)
763 (ice-9 match))
764 #:phases
765 (modify-phases %standard-phases
766 (delete 'configure)
767 (replace 'build
768 (lambda _
769 (let ((arch ,(platform-linux-architecture
770 (lookup-platform-by-target-or-system
771 (or (%current-target-system)
772 (%current-system)))))
773 (defconfig ,(system->defconfig
774 (or (%current-target-system)
775 (%current-system))))
776 (make-target ,(if (version>=? version "5.3")
777 "headers"
778 "headers_check")))
779 (setenv "ARCH" arch)
780 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
781 (invoke "make" defconfig)
782 (invoke "make" "mrproper" make-target))))
783 (replace 'install
784 (lambda* (#:key outputs #:allow-other-keys)
785 (let ((out (assoc-ref outputs "out")))
786
787 ;; Mimic the quiet_cmd_headers_install target to avoid a
788 ;; dependency on rsync.
789 (for-each (lambda (file)
790 (let ((destination (string-append
791 out "/include/"
792 ;; Drop the 'usr/include' prefix.
793 (match (string-split file #\/)
794 ((_ _ path ...)
795 (string-join path "/"))))))
796 (format #t "`~a' -> `~a'~%" file destination)
797 (install-file file (dirname destination))))
798 (find-files "usr/include" "\\.h$"))
799
800 (mkdir (string-append out "/include/config"))
801 (call-with-output-file
802 (string-append out
803 "/include/config/kernel.release")
804 (lambda (p)
805 (format p "~a-default~%" ,version)))))))
806 #:allowed-references ()
807 #:tests? #f))
808 (supported-systems (remove target-hurd? %supported-systems))
809 (properties %linux-libre-timeout-properties)
810 (home-page "https://www.gnu.org/software/linux-libre/")
811 (synopsis "GNU Linux-Libre kernel headers")
812 (description "Headers of the Linux-Libre kernel.")
813 (license license:gpl2)))
814
815(define-public linux-libre-headers-6.18
816 (make-linux-libre-headers* linux-libre-6.18-version
817 linux-libre-6.18-gnu-revision
818 linux-libre-6.18-source))
819
820(define-public linux-libre-headers-6.17
821 (make-linux-libre-headers* linux-libre-6.17-version
822 linux-libre-6.17-gnu-revision
823 linux-libre-6.17-source))
824
825(define-public linux-libre-headers-6.12
826 (make-linux-libre-headers* linux-libre-6.12-version
827 linux-libre-6.12-gnu-revision
828 linux-libre-6.12-source))
829
830(define-public linux-libre-headers-6.6
831 (make-linux-libre-headers* linux-libre-6.6-version
832 linux-libre-6.6-gnu-revision
833 linux-libre-6.6-source))
834
835(define-public linux-libre-headers-6.1
836 (make-linux-libre-headers* linux-libre-6.1-version
837 linux-libre-6.1-gnu-revision
838 linux-libre-6.1-source))
839
840(define-public linux-libre-headers-5.15
841 (make-linux-libre-headers* linux-libre-5.15-version
842 linux-libre-5.15-gnu-revision
843 linux-libre-5.15-source))
844
845(define-public linux-libre-headers-5.10
846 (make-linux-libre-headers* linux-libre-5.10-version
847 linux-libre-5.10-gnu-revision
848 linux-libre-5.10-source))
849
850(define-public linux-libre-headers-5.4
851 (make-linux-libre-headers* linux-libre-5.4-version
852 linux-libre-5.4-gnu-revision
853 linux-libre-5.4-source))
854
855;; The following package is used in the early bootstrap, and thus must be kept
856;; stable and with minimal build requirements.
857(define-public linux-libre-headers-6.12.17
858 (make-linux-libre-headers "6.12.17" "gnu"
859 "1j3iyivh8h9abryjqksf4k51wgwnwqy2l3zsc019bm84xmka38xm"))
860
861(define-public linux-libre-headers linux-libre-headers-6.12.17)
862;; linux-libre-headers-latest points to the latest headers package
863;; and should be used as a dependency for packages that depend on
864;; the headers.
865(define-public linux-libre-headers-latest linux-libre-headers-6.17)
866
867
868;;;
869;;; Kernel configurations.
870;;;
871
872(define* (kernel-config arch #:key variant)
873 "Return a file-like object of the Linux-Libre build configuration file for
874ARCH and optionally VARIANT, or #f if there is no such configuration."
875 (let* ((name (string-append (if variant (string-append variant "-") "")
876 (if (string=? "i386" arch) "i686" arch) ".conf"))
877 (file (string-append "linux-libre/" name))
878 (config (search-auxiliary-file file)))
879 (and config (local-file config))))
880
881(define (default-extra-linux-options version)
882 `(;; Make the kernel config available at /proc/config.gz
883 ("CONFIG_IKCONFIG" . #t)
884 ("CONFIG_IKCONFIG_PROC" . #t)
885 ;; Debugging options.
886 ("CONFIG_DEBUG_INFO" . #t) ;required by BTF
887 ,@(if (version>=? version "5.1")
888 '(("CONFIG_DEBUG_INFO_BTF" . #t))
889 '())
890 ,@(if (version>=? version "5.12")
891 '(("CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT" . #t))
892 '())
893 ("CONFIG_DEBUG_INFO_REDUCED" . #f) ;incompatible with BTF
894 ;; Tracing and related options.
895 ,@(if (version>=? version "5.1")
896 '(("CONFIG_BPF_JIT" . #t)
897 ("CONFIG_BPF_JIT_ALWAYS_ON" . #t)
898 ("CONFIG_BPF_SYSCALL" . #t))
899 '())
900 ,@(if (version>=? version "5.13")
901 '(("CONFIG_BPF_UNPRIV_DEFAULT_OFF" . #t))
902 '())
903 ("CONFIG_NET_CLS_BPF" . m) ;classify packets based on BPF filters
904 ("CONFIG_NET_ACT_BPF" . m) ;to execute BPF code on packets
905 ;; Compress kernel modules via Zstd.
906 ,(if (version>=? version "5.13")
907 '("CONFIG_MODULE_COMPRESS_ZSTD" . #t)
908 '("CONFIG_MODULE_COMPRESS_GZIP" . #t))
909 ;; Some very mild hardening.
910 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
911 ;; All kernels should have NAMESPACES options enabled
912 ("CONFIG_NAMESPACES" . #t)
913 ("CONFIG_UTS_NS" . #t)
914 ("CONFIG_IPC_NS" . #t)
915 ("CONFIG_USER_NS" . #t)
916 ("CONFIG_PID_NS" . #t)
917 ("CONFIG_NET_NS" . #t)
918 ;; Various options needed for elogind service:
919 ;; https://issues.guix.gnu.org/43078
920 ("CONFIG_CGROUP_FREEZER" . #t)
921 ("CONFIG_BLK_CGROUP" . #t)
922 ("CONFIG_CGROUP_WRITEBACK" . #t)
923 ("CONFIG_CGROUP_SCHED" . #t)
924 ("CONFIG_CGROUP_PIDS" . #t)
925 ("CONFIG_CGROUP_FREEZER" . #t)
926 ("CONFIG_CGROUP_DEVICE" . #t)
927 ("CONFIG_CGROUP_CPUACCT" . #t)
928 ("CONFIG_CGROUP_PERF" . #t)
929 ("CONFIG_SOCK_CGROUP_DATA" . #t)
930 ("CONFIG_BLK_CGROUP_IOCOST" . #t)
931 ("CONFIG_CGROUP_NET_PRIO" . #t)
932 ("CONFIG_CGROUP_NET_CLASSID" . #t)
933 ("CONFIG_MEMCG" . #t)
934 ("CONFIG_MEMCG_SWAP" . #t)
935 ("CONFIG_MEMCG_KMEM" . #t)
936 ("CONFIG_CPUSETS" . #t)
937 ("CONFIG_PROC_PID_CPUSET" . #t)
938 ;; Allow disk encryption by default
939 ("CONFIG_DM_CRYPT" . m)
940 ;; Allow fscrypt filesystem encryption by default
941 ("CONFIG_FS_ENCRYPTION" . #t)
942 ;; Support zram on all kernel configs
943 ("CONFIG_ZSWAP" . #t)
944 ("CONFIG_ZSMALLOC" . #t)
945 ("CONFIG_ZRAM" . m)
946 ;; Accessibility support.
947 ("CONFIG_ACCESSIBILITY" . #t)
948 ("CONFIG_A11Y_BRAILLE_CONSOLE" . #t)
949 ("CONFIG_SPEAKUP" . m)
950 ("CONFIG_SPEAKUP_SYNTH_SOFT" . m)
951 ;; Modules required for initrd:
952 ("CONFIG_NET_9P" . m)
953 ("CONFIG_NET_9P_VIRTIO" . m)
954 ("CONFIG_VIRTIO_BLK" . m)
955 ("CONFIG_VIRTIO_NET" . m)
956 ("CONFIG_VIRTIO_PCI" . m)
957 ("CONFIG_VIRTIO_BALLOON" . m)
958 ("CONFIG_VIRTIO_MMIO" . m)
959 ("CONFIG_FUSE_FS" . m)
960 ("CONFIG_CIFS" . m)
961 ("CONFIG_9P_FS" . m)
962 ;; Disable the EFI pstore storage backend to avoid causing
963 ;; unrecoverable failures on some EFI systems:
964 ;; https://lists.gnu.org/archive/html/help-guix/2025-01/msg00173.html
965 ("CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE" . #t)))
966
967(define (config->string options)
968 (string-join (map (match-lambda
969 ((option . 'm)
970 (string-append option "=m"))
971 ((option . #t)
972 (string-append option "=y"))
973 ((option . #f)
974 (string-append option "=n"))
975 ((option . string)
976 (string-append option "=\"" string "\"")))
977 options)
978 "\n"))
979
980
981;;;
982;;; Kernel package utilities.
983;;;
984
985(define (apply-infodoc-patch? version)
986 ;; Versions older than 5.10 have different enough build scripts that the
987 ;; infodocs patch doesn't apply.
988 (and (version>=? version "5.10")
989 (not (version>=? version "6.2")))) ;patch applied upstream
990
991
992(define* (make-linux-libre version gnu-revision hash-string supported-systems
993 #:key
994 (extra-version #f)
995 ;; A function that takes an arch and a variant, and
996 ;; return a file-like object. See kernel-config
997 ;; for an example.
998 (configuration-file #f)
999 (defconfig "defconfig")
1000 (extra-options (default-extra-linux-options version))
1001 (patches
1002 `(,%boot-logo-patch
1003 ,@(if (apply-infodoc-patch? version)
1004 (list (search-patch
1005 "linux-libre-infodocs-target.patch"))
1006 '()))))
1007 (make-linux-libre* version gnu-revision
1008 (origin
1009 (method url-fetch)
1010 (uri (linux-libre-urls version gnu-revision))
1011 (sha256 (base32 hash-string))
1012 (patches patches))
1013 supported-systems
1014 #:extra-version extra-version
1015 #:configuration-file configuration-file
1016 #:defconfig defconfig
1017 #:extra-options extra-options))
1018
1019(define* (make-linux-libre* version gnu-revision source supported-systems
1020 #:key
1021 (extra-version #f)
1022 ;; A function that takes an arch and a variant.
1023 ;; See kernel-config for an example.
1024 (configuration-file #f)
1025 (defconfig "defconfig")
1026 (extra-options (default-extra-linux-options version)))
1027 (package
1028 (name (if extra-version
1029 (string-append "linux-libre-" extra-version)
1030 "linux-libre"))
1031 (version version)
1032 (source source)
1033 (supported-systems supported-systems)
1034 (build-system gnu-build-system)
1035 (arguments
1036 (list
1037 #:modules '((guix build gnu-build-system)
1038 (guix build utils)
1039 (srfi srfi-1)
1040 (srfi srfi-26)
1041 (ice-9 ftw)
1042 (ice-9 match))
1043 #:tests? #f
1044 #:phases
1045 #~(modify-phases %standard-phases
1046 (add-after 'unpack 'patch-/bin/pwd
1047 (lambda _
1048 (substitute* (find-files
1049 "." "^Makefile(\\.include)?$")
1050 (("/bin/pwd") "pwd"))))
1051 (add-before 'configure 'set-environment
1052 (lambda* (#:key target #:allow-other-keys)
1053 ;; Avoid introducing timestamps.
1054 (setenv "KCONFIG_NOTIMESTAMP" "1")
1055 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
1056
1057 ;; Other variables useful for reproducibility.
1058 (setenv "KBUILD_BUILD_VERSION" "1")
1059 (setenv "KBUILD_BUILD_USER" "guix")
1060 (setenv "KBUILD_BUILD_HOST" "guix")
1061
1062 ;; Set ARCH and CROSS_COMPILE.
1063 (let ((arch #$(platform-linux-architecture
1064 (lookup-platform-by-target-or-system
1065 (or (%current-target-system)
1066 (%current-system))))))
1067 (setenv "ARCH" arch)
1068 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
1069 (when target
1070 (setenv "CROSS_COMPILE" (string-append target "-"))
1071 (format #t "`CROSS_COMPILE' set to `~a'~%"
1072 (getenv "CROSS_COMPILE"))))
1073
1074 ;; Allow EXTRAVERSION to be set via the environment.
1075 (substitute* "Makefile"
1076 (("^ *EXTRAVERSION[[:blank:]]*=")
1077 "EXTRAVERSION ?="))
1078 (setenv "EXTRAVERSION"
1079 #$(and extra-version
1080 (string-append "-" extra-version)))
1081 ;; Use the maximum compression available for Zstd-compressed
1082 ;; modules.
1083 (setenv "ZSTD_CLEVEL" "19")))
1084 (replace 'configure
1085 (lambda _
1086 (let ((config
1087 #$(match (let ((arch (platform-linux-architecture
1088 (lookup-platform-by-target-or-system
1089 (or (%current-target-system)
1090 (%current-system))))))
1091 (and configuration-file arch
1092 (configuration-file
1093 arch
1094 #:variant (version-major+minor version))))
1095 (#f ;no config for this platform
1096 #f)
1097 ((? file-like? config)
1098 config))))
1099 ;; Use a custom kernel configuration file or a default
1100 ;; configuration file.
1101 (if config
1102 (begin
1103 (copy-file config ".config")
1104 (chmod ".config" #o666))
1105 (invoke "make" #$defconfig))
1106 ;; Appending works even when the option wasn't in the file.
1107 ;; The last one prevails if duplicated.
1108 (let ((port (open-file ".config" "a"))
1109 (extra-configuration #$(config->string extra-options)))
1110 (display extra-configuration port)
1111 (close-port port))
1112 (invoke "make" "oldconfig"))))
1113 (replace 'install
1114 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
1115 (let ((moddir (string-append #$output "/lib/modules"))
1116 (dtbdir (string-append #$output "/lib/dtbs"))
1117 (make-flags
1118 (append make-flags
1119 (list "-j"
1120 (if parallel-build?
1121 (number->string (parallel-job-count))
1122 "1")))))
1123 ;; Install kernel image, kernel configuration and link map.
1124 (for-each (lambda (file) (install-file file #$output))
1125 (find-files "." "^(\\.config|bzImage|zImage|Image\
1126|vmlinuz|System\\.map|Module\\.symvers)$"))
1127 ;; Install device tree files
1128 (unless (null? (find-files "." "\\.dtb$"))
1129 (mkdir-p dtbdir)
1130 (apply invoke "make"
1131 (string-append "INSTALL_DTBS_PATH=" dtbdir)
1132 "dtbs_install" make-flags))
1133 ;; Install kernel modules
1134 (mkdir-p moddir)
1135 (apply invoke "make"
1136 ;; Disable depmod because the Guix system's module
1137 ;; directory is an union of potentially multiple
1138 ;; packages. It is not possible to use depmod to
1139 ;; usefully calculate a dependency graph while building
1140 ;; only one of them.
1141 "DEPMOD=true"
1142 (string-append "MODULE_DIR=" moddir)
1143 (string-append "INSTALL_PATH=" #$output)
1144 (string-append "INSTALL_MOD_PATH=" #$output)
1145 "INSTALL_MOD_STRIP=1"
1146 "modules_install" make-flags)
1147 (let* ((versions (filter (lambda (name)
1148 (not (string-prefix? "." name)))
1149 (scandir moddir)))
1150 (version (match versions
1151 ((x) x))))
1152 ;; There are symlinks to the build and source directory.
1153 ;; Both will point to target /tmp/guix-build* and thus not
1154 ;; be useful in a profile. Delete the symlinks.
1155 (false-if-file-not-found
1156 (delete-file
1157 (string-append moddir "/" version "/build")))
1158 (false-if-file-not-found
1159 (delete-file
1160 (string-append moddir "/" version "/source"))))))))))
1161 (native-inputs
1162 (list perl
1163 bc
1164 openssl
1165 elfutils ;needed to enable CONFIG_STACK_VALIDATION
1166 flex
1167 bison
1168 util-linux ;needed for hexdump
1169 ;; These are needed to compile the GCC plugins.
1170 gmp
1171 mpfr
1172 mpc
1173 ;; These are needed when building with the CONFIG_DEBUG_INFO_BTF
1174 ;; support.
1175 dwarves ;for pahole
1176 python-wrapper
1177 zlib
1178 ;; For Zstd compression of kernel modules.
1179 zstd))
1180 (home-page "https://www.gnu.org/software/linux-libre/")
1181 (synopsis "100% free redistribution of a cleaned Linux kernel")
1182 (description "GNU Linux-Libre is a free (as in freedom) variant of the
1183Linux kernel. It has been modified to remove all non-free binary blobs.")
1184 (license license:gpl2)
1185 (properties %linux-libre-timeout-properties)))
1186
1187
1188;;;
1189;;; Generic kernel packages.
1190;;;
1191
1192(define-public linux-libre-6.18
1193 (make-linux-libre* linux-libre-6.18-version
1194 linux-libre-6.18-gnu-revision
1195 linux-libre-6.18-source
1196 '("x86_64-linux" "i686-linux" "armhf-linux"
1197 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1198 #:configuration-file kernel-config))
1199
1200(define-public linux-libre-6.17
1201 (make-linux-libre* linux-libre-6.17-version
1202 linux-libre-6.17-gnu-revision
1203 linux-libre-6.17-source
1204 '("x86_64-linux" "i686-linux" "armhf-linux"
1205 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1206 #:configuration-file kernel-config))
1207
1208(define-public linux-libre-version linux-libre-6.17-version)
1209(define-public linux-libre-gnu-revision linux-libre-6.17-gnu-revision)
1210(define-public linux-libre-pristine-source linux-libre-6.17-pristine-source)
1211(define-public linux-libre-source linux-libre-6.17-source)
1212(define-public linux-libre linux-libre-6.17)
1213
1214(define-public linux-libre-6.12
1215 (make-linux-libre* linux-libre-6.12-version
1216 linux-libre-6.12-gnu-revision
1217 linux-libre-6.12-source
1218 '("x86_64-linux" "i686-linux" "armhf-linux"
1219 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1220 #:configuration-file kernel-config))
1221
1222(define-public linux-libre-6.6
1223 (make-linux-libre* linux-libre-6.6-version
1224 linux-libre-6.6-gnu-revision
1225 linux-libre-6.6-source
1226 '("x86_64-linux" "i686-linux" "armhf-linux"
1227 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1228 #:configuration-file kernel-config))
1229
1230(define-public linux-libre-6.1
1231 (make-linux-libre* linux-libre-6.1-version
1232 linux-libre-6.1-gnu-revision
1233 linux-libre-6.1-source
1234 '("x86_64-linux" "i686-linux" "armhf-linux"
1235 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1236 #:configuration-file kernel-config))
1237
1238(define-public linux-libre-5.15
1239 (make-linux-libre* linux-libre-5.15-version
1240 linux-libre-5.15-gnu-revision
1241 linux-libre-5.15-source
1242 '("x86_64-linux" "i686-linux" "armhf-linux"
1243 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1244 #:configuration-file kernel-config))
1245
1246(define-public linux-libre-5.10
1247 (make-linux-libre* linux-libre-5.10-version
1248 linux-libre-5.10-gnu-revision
1249 linux-libre-5.10-source
1250 '("x86_64-linux" "i686-linux" "armhf-linux"
1251 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1252 #:configuration-file kernel-config))
1253
1254(define-public linux-libre-5.4
1255 (make-linux-libre* linux-libre-5.4-version
1256 linux-libre-5.4-gnu-revision
1257 linux-libre-5.4-source
1258 '("x86_64-linux" "i686-linux" "armhf-linux"
1259 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1260 #:configuration-file kernel-config))
1261
1262;; Linux-Libre-LTS points to the *newest* released long-term support version of
1263;; Linux-Libre.
1264;; Reference: <https://www.kernel.org/category/releases.html>
1265
1266(define-public linux-libre-lts-version linux-libre-6.12-version)
1267(define-public linux-libre-lts-gnu-revision linux-libre-6.12-gnu-revision)
1268(define-public linux-libre-lts-pristine-source linux-libre-6.12-pristine-source)
1269(define-public linux-libre-lts-source linux-libre-6.12-source)
1270(define-public linux-libre-lts linux-libre-6.12)
1271
1272
1273;;;
1274;;; Specialized kernel variants.
1275;;;
1276
1277(define-public %dummy-linux-kernel-for-container
1278 (hidden-package
1279 (package
1280 (name "linux-dummy")
1281 (version "0.0.0")
1282 (source #f)
1283 (build-system copy-build-system)
1284 (arguments
1285 (list #:phases
1286 #~(modify-phases %standard-phases
1287 (delete 'unpack)
1288 (replace 'install
1289 (lambda _
1290 (mkdir-p #$output))))))
1291 (home-page "")
1292 (synopsis "Dummy Linux kernel for @command{guix system container}")
1293 (description "")
1294 (license #f))))
1295
1296(define-public linux-libre-arm-generic
1297 (make-linux-libre* linux-libre-version
1298 linux-libre-gnu-revision
1299 linux-libre-source
1300 '("armhf-linux")
1301 #:defconfig "multi_v7_defconfig"
1302 #:extra-version "arm-generic"
1303 #:extra-options
1304 (append
1305 `(;; needed to fix the RTC on rockchip platforms
1306 ("CONFIG_RTC_DRV_RK808" . #t))
1307 (default-extra-linux-options linux-libre-version))))
1308
1309(define-public linux-libre-arm-generic-5.10
1310 (make-linux-libre* linux-libre-5.10-version
1311 linux-libre-5.10-gnu-revision
1312 linux-libre-5.10-source
1313 '("armhf-linux")
1314 #:defconfig "multi_v7_defconfig"
1315 #:extra-version "arm-generic"
1316 #:extra-options
1317 (append
1318 `(;; needed to fix the RTC on rockchip platforms
1319 ("CONFIG_RTC_DRV_RK808" . #t))
1320 (default-extra-linux-options linux-libre-5.10-version))))
1321
1322(define-public linux-libre-arm-generic-5.4
1323 (make-linux-libre* linux-libre-5.4-version
1324 linux-libre-5.4-gnu-revision
1325 linux-libre-5.4-source
1326 '("armhf-linux")
1327 #:defconfig "multi_v7_defconfig"
1328 #:extra-version "arm-generic"
1329 #:extra-options
1330 (append
1331 `(;; needed to fix the RTC on rockchip platforms
1332 ("CONFIG_RTC_DRV_RK808" . #t))
1333 (default-extra-linux-options linux-libre-5.4-version))))
1334
1335(define-public linux-libre-arm-omap2plus
1336 (make-linux-libre* linux-libre-version
1337 linux-libre-gnu-revision
1338 linux-libre-source
1339 '("armhf-linux")
1340 #:defconfig "omap2plus_defconfig"
1341 #:extra-version "arm-omap2plus"))
1342
1343(define-public linux-libre-arm64-generic
1344 (make-linux-libre* linux-libre-version
1345 linux-libre-gnu-revision
1346 linux-libre-source
1347 '("aarch64-linux")
1348 #:defconfig "defconfig"
1349 #:extra-version "arm64-generic"
1350 #:extra-options
1351 (append
1352 `(;; Provide support for ath9k wireless
1353 ("CONFIG_ATH9K_HTC" . m)
1354 ;; Support Orange Pi R1 Plus LTS ethernet PHY.
1355 ("CONFIG_MOTORCOMM_PHY" . m)
1356 ;; needed to fix the RTC on rockchip platforms
1357 ("CONFIG_RTC_DRV_RK808" . #t)
1358 ;; Pinebook display, battery, charger and usb
1359 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1360 ("CONFIG_CHARGER_AXP20X" . m)
1361 ("CONFIG_INPUT_AXP20X_PEK" . m)
1362 ("CONFIG_CHARGER_AXP20X" . m)
1363 ("CONFIG_BATTERY_AXP20X" . m)
1364 ("CONFIG_PINCTRL_AXP209" . m)
1365 ("CONFIG_AXP20X_POWER" . m)
1366 ("CONFIG_AXP20X_ADC" . m)
1367 ;; Pinebook PRO battery and sound support
1368 ("CONFIG_BATTERY_CW2015" . m)
1369 ("CONFIG_CHARGER_GPIO" . m)
1370 ("CONFIG_SND_SOC_ES8316" . m))
1371 (default-extra-linux-options linux-libre-version))))
1372
1373(define-public linux-libre-lts-arm64-generic
1374 (if (string=? linux-libre-lts-version linux-libre-version)
1375
1376 ;; Make it a strict alias so that the user interface does not see two
1377 ;; packages with the exact same name and version.
1378 linux-libre-arm64-generic
1379
1380 (make-linux-libre* linux-libre-lts-version
1381 linux-libre-lts-gnu-revision
1382 linux-libre-lts-source
1383 '("aarch64-linux")
1384 #:defconfig "defconfig"
1385 #:extra-version "arm64-generic"
1386 #:extra-options
1387 (append
1388 `( ;; Provide support for ath9k wireless
1389 ("CONFIG_ATH9K_HTC" . m)
1390 ;; Support Orange Pi R1 Plus LTS ethernet PHY.
1391 ("CONFIG_MOTORCOMM_PHY" . m)
1392 ;; needed to fix the RTC on rockchip platforms
1393 ("CONFIG_RTC_DRV_RK808" . #t)
1394 ;; Pinebook display, battery, charger and usb
1395 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1396 ("CONFIG_CHARGER_AXP20X" . m)
1397 ("CONFIG_INPUT_AXP20X_PEK" . m)
1398 ("CONFIG_CHARGER_AXP20X" . m)
1399 ("CONFIG_BATTERY_AXP20X" . m)
1400 ("CONFIG_PINCTRL_AXP209" . m)
1401 ("CONFIG_AXP20X_POWER" . m)
1402 ("CONFIG_AXP20X_ADC" . m)
1403 ;; Pinebook PRO battery and sound support
1404 ("CONFIG_BATTERY_CW2015" . m)
1405 ("CONFIG_CHARGER_GPIO" . m)
1406 ("CONFIG_SND_SOC_ES8316" . m))
1407 (default-extra-linux-options linux-libre-lts-version)))))
1408
1409(define-public linux-libre-arm64-generic-5.10
1410 (make-linux-libre* linux-libre-5.10-version
1411 linux-libre-5.10-gnu-revision
1412 linux-libre-5.10-source
1413 '("aarch64-linux")
1414 #:defconfig "defconfig"
1415 #:extra-version "arm64-generic"
1416 #:extra-options
1417 (append
1418 `(;; needed to fix the RTC on rockchip platforms
1419 ("CONFIG_RTC_DRV_RK808" . #t)
1420 ;; Pinebook display, battery, charger and usb
1421 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1422 ("CONFIG_CHARGER_AXP20X" . m)
1423 ("CONFIG_INPUT_AXP20X_PEK" . m)
1424 ("CONFIG_CHARGER_AXP20X" . m)
1425 ("CONFIG_BATTERY_AXP20X" . m)
1426 ("CONFIG_PINCTRL_AXP209" . m)
1427 ("CONFIG_AXP20X_POWER" . m)
1428 ("CONFIG_AXP20X_ADC" . m)
1429 ;; Pinebook PRO battery and sound support
1430 ("CONFIG_BATTERY_CW2015" . m)
1431 ("CONFIG_CHARGER_GPIO" . m)
1432 ("CONFIG_SND_SOC_ES8316" . m))
1433 (default-extra-linux-options linux-libre-5.10-version))))
1434
1435(define-public linux-libre-arm64-generic-5.4
1436 (make-linux-libre* linux-libre-5.4-version
1437 linux-libre-5.4-gnu-revision
1438 linux-libre-5.4-source
1439 '("aarch64-linux")
1440 #:defconfig "defconfig"
1441 #:extra-version "arm64-generic"
1442 #:extra-options
1443 (append
1444 `(;; needed to fix the RTC on rockchip platforms
1445 ("CONFIG_RTC_DRV_RK808" . #t))
1446 (default-extra-linux-options linux-libre-5.4-version))))
1447
1448(define-public linux-libre-arm64-honeycomb
1449 ;; Kernel for use on the HoneyComb LX2 boards:
1450 ;; <https://shop.solid-run.com/product/SRCFTXE000IV13/>.
1451 (make-linux-libre* linux-libre-lts-version
1452 linux-libre-lts-gnu-revision
1453 linux-libre-lts-source
1454 '("aarch64-linux")
1455 #:extra-version "arm64-honeycomb"
1456 #:extra-options
1457 ;; See
1458 ;; https://github.com/SolidRun/lx2160a_build/blob/master/configs/linux/lx2k_additions.config
1459 (append
1460 `(("CONFIG_GPIO_SYSFS" . #true)
1461 ("CONFIG_GPIO_MPC8XXX" . #true)
1462 ("CONFIG_NET_PKTGEN" . #true)
1463 ("CONFIG_USB_SERIAL" . #true)
1464 ("CONFIG_USB_SERIAL_CONSOLE" . #true)
1465 ("CONFIG_USB_SERIAL_GENERIC" . #true)
1466 ("CONFIG_USB_SERIAL_SIMPLE" . #true)
1467 ("CONFIG_USB_SERIAL_FTDI_SIO" . #true)
1468 ("CONFIG_USB_ACM" . #true)
1469 ("CONFIG_USB_NET_DRIVERS" . #true)
1470 ("CONFIG_USB_USBNET" . #true)
1471 ("CONFIG_USB_NET_CDCETHER" . #true)
1472 ("CONFIG_USB_NET_CDC_NCM" . #true)
1473 ("CONFIG_USB_NET_NET1080" . #true)
1474 ("CONFIG_USB_NET_CDC_SUBSET_ENABLE" . #true)
1475 ("CONFIG_USB_NET_CDC_SUBSET" . #true)
1476 ("CONFIG_USB_ARMLINUX" . #true)
1477 ("CONFIG_BLK_DEV_NVME" . #true)
1478 ("CONFIG_NVMEM_BCM_OCOTP" . #true)
1479 ("CONFIG_DRM_AMDGPU" . #true)
1480 ("CONFIG_DRM_AMDGPU_SI" . #true)
1481 ("CONFIG_DRM_AMDGPU_CIK" . #true)
1482 ("CONFIG_DRM_AMDGPU_USERPTR" . #true)
1483 ("CONFIG_DRM_AMD_DC" . #true)
1484 ("CONFIG_CHASH" . #true)
1485 ("CONFIG_PMBUS" . #true)
1486 ("CONFIG_SENSORS_PMBUS" . #true)
1487 ("CONFIG_REGULATOR" . #true)
1488 ("CONFIG_REGULATOR_FIXED_VOLTAGE" . #true)
1489 ("CONFIG_REGULATOR_PWM" . #true)
1490 ("CONFIG_SENSORS_AMC6821" . #true)
1491 ("CONFIG_SENSORS_LM90" . #true)
1492 ("CONFIG_SENSORS_LTC2978" . #true)
1493 ("CONFIG_SENSORS_LTC2978_REGULATOR" . #true)
1494 ("CONFIG_TMPFS" . #true)
1495 ("CONFIG_TMPFS_POSIX_ACL" . #true)
1496 ("CONFIG_TMPFS_XATTR" . #true)
1497 ;;("CONFIG_BLK_DEV_RAM_SIZE" . 524288)
1498 ("CONFIG_POWER_RESET_GPIO" . #true)
1499 ("CONFIG_CRYPTO_USER_API_HASH" . #true)
1500 ("CONFIG_CRYPTO_USER_API_SKCIPHER" . #true)
1501 ("CONFIG_CRYPTO_USER_API_RNG" . #true)
1502 ("CONFIG_CRYPTO_USER_API_AEAD" . #true)
1503
1504 ;; Fixes https://codeberg.org/guix/guix/issues/101
1505 ("CONFIG_KEY_DH_OPERATIONS" . #true)
1506
1507 ;; For connecting to ci.guix.gnu.org over VPN.
1508 ("CONFIG_WIREGUARD" . m)
1509
1510 ;; restool support
1511 ("CONFIG_FSL_MC_UAPI_SUPPORT" . #t)
1512 ("CONFIG_FSL_MC_BUS" . #t)
1513 ("CONFIG_VFIO_FSL_MC" . #t)
1514 ("CONFIG_FSL_MC_DPIO" . #t)
1515 ("CONFIG_ARM_GIC_V3_ITS_FSL_MC" . #t)
1516
1517 ;; vsockets support
1518 ;; TODO This seems to be enabled by default on other
1519 ;; architectures?
1520 ("CONFIG_VSOCKETS" . m)
1521 ("CONFIG_VSOCKETS_DIAG" . m)
1522 ("CONFIG_VSOCKETS_LOOPBACK" . m)
1523 ("CONFIG_VMWARE_VMCI_VSOCKETS" . m)
1524 ("CONFIG_VIRTIO_VSOCKETS" . m)
1525 ("CONFIG_VIRTIO_VSOCKETS_COMMON" . m)
1526 ("CONFIG_HYPERV_VSOCKETS" . m)
1527 ("CONFIG_VHOST_IOTLB" . m)
1528 ("CONFIG_VHOST_RING" . m)
1529 ("CONFIG_VHOST_TASK" . #true)
1530 ("CONFIG_VHOST" . m)
1531 ("CONFIG_VHOST_MENU" . #true)
1532 ("CONFIG_VHOST_NET" . m)
1533 ("CONFIG_VHOST_SCSI" . m)
1534 ("CONFIG_VHOST_VSOCK" . m)
1535 ("CONFIG_VHOST_VDPA" . m))
1536 (default-extra-linux-options linux-libre-lts-version))))
1537
1538(define-public reform-debian-packages-for-6.18
1539 (package
1540 (name "reform-debian-packages")
1541 (version "2023-07-10-515-gc527a1d") ;from git describe
1542 (source
1543 (origin
1544 (method git-fetch)
1545 (uri (git-reference
1546 (url "https://source.mnt.re/reform/reform-debian-packages.git")
1547 (commit "c527a1d0e548dfb9d7c28bb2c78907230efa4314")))
1548 (file-name (git-file-name name version))
1549 (sha256
1550 (base32 "1vfq46s4mxc94sdm5i15kj51s6cwjgg5xijag5g5hcqzi29hpclm"))))
1551 (build-system copy-build-system)
1552 (arguments
1553 (list
1554 #:install-plan
1555 #~'(("linux/patches6.18/" "/patches6.18")
1556 ("linux/" "/dts/amlogic"
1557 #:include-regexp ("meson.*\\.dts$"))
1558 ("linux/" "/dts/freescale"
1559 #:include-regexp ("imx8.*\\.dts$"))
1560 ("linux/" "/dts/freescale"
1561 #:include-regexp ("fsl.*\\.dts$"))
1562 ("linux/" "/dts/rockchip"
1563 #:include-regexp ("rk3588.*\\.dts$"))
1564 ("linux/config" "config"))))
1565 (home-page "https://source.mnt.re/reform/reform-debian-packages")
1566 (synopsis
1567 "Linux kernel patches and device-trees used for MNT Reform systems")
1568 (description
1569 "Linux kernel patches and device-trees used for the MNT Reform systems")
1570 (license (list
1571 (license:fsf-free "file://filter-output"
1572 "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html")
1573 license:bsd-2
1574 license:expat
1575 license:gpl2
1576 license:gpl2+
1577 license:gpl3
1578 license:x11))))
1579
1580(define-public reform-debian-packages-for-6.12
1581 (package
1582 (name "reform-debian-packages")
1583 (version "2023-07-10-320-gaf0a461") ;from git describe
1584 (source
1585 (origin
1586 (method git-fetch)
1587 (uri (git-reference
1588 (url "https://source.mnt.re/reform/reform-debian-packages.git")
1589 (commit "af0a461d38e13481323f061d9ff6827d1d13873b")))
1590 (file-name (git-file-name name version))
1591 (sha256
1592 (base32 "1cylprld2ri3mprj5cgwla1l8qv9iqqvcra7h64yarzs49zaa16m"))))
1593 (build-system copy-build-system)
1594 (arguments
1595 (list
1596 #:install-plan
1597 #~'(("linux/patches6.12/" "/patches6.12")
1598 ("linux/" "/dts/amlogic"
1599 #:include-regexp ("meson.*\\.dts$"))
1600 ("linux/" "/dts/freescale"
1601 #:include-regexp ("imx8.*\\.dts$"))
1602 ("linux/" "/dts/freescale"
1603 #:include-regexp ("fsl.*\\.dts$"))
1604 ("linux/" "/dts/rockchip"
1605 #:include-regexp ("rk3588.*\\.dts$"))
1606 ("linux/config" "config"))))
1607 (home-page "https://source.mnt.re/reform/reform-debian-packages")
1608 (synopsis
1609 "Linux kernel patches and device-trees used for MNT Reform systems")
1610 (description
1611 "Linux kernel patches and device-trees used for the MNT Reform systems")
1612 (license (list
1613 (license:fsf-free "file://filter-output"
1614 "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html")
1615 license:bsd-2
1616 license:expat
1617 license:gpl2
1618 license:gpl2+
1619 license:gpl3
1620 license:x11))))
1621
1622(define-public reform-debian-packages-for-6.17
1623 (package
1624 (name "reform-debian-packages")
1625 (version "2023-07-10-496-gd25e032") ;from git describe
1626 (source
1627 (origin
1628 (method git-fetch)
1629 (uri (git-reference
1630 (url "https://source.mnt.re/reform/reform-debian-packages.git")
1631 (commit "d25e032b53d231c43d23248518e9bba681858739")))
1632 (file-name (git-file-name name version))
1633 (sha256
1634 (base32 "1pyf7lfkjwa244bq7kqbg0ri4bn6n5l0siy9g4igw3nhrll57d5a"))))
1635 (build-system copy-build-system)
1636 (arguments
1637 (list
1638 #:install-plan
1639 #~'(("linux/patches6.17/" "/patches6.17")
1640 ("linux/" "/dts/amlogic"
1641 #:include-regexp ("meson.*\\.dts$"))
1642 ("linux/" "/dts/freescale"
1643 #:include-regexp ("imx8.*\\.dts$"))
1644 ("linux/" "/dts/freescale"
1645 #:include-regexp ("fsl.*\\.dts$"))
1646 ("linux/" "/dts/rockchip"
1647 #:include-regexp ("rk3588.*\\.dts$"))
1648 ("linux/config" "config"))))
1649 (home-page "https://source.mnt.re/reform/reform-debian-packages")
1650 (synopsis
1651 "Linux kernel patches and device-trees used for MNT Reform systems")
1652 (description
1653 "Linux kernel patches and device-trees used for the MNT Reform systems")
1654 (license (list
1655 (license:fsf-free "file://filter-output"
1656 "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html")
1657 license:bsd-2
1658 license:expat
1659 license:gpl2
1660 license:gpl2+
1661 license:gpl3
1662 license:x11))))
1663
1664(define-public linux-libre-arm64-mnt-reform-6.18
1665 ;; Kernel for use on the MNT/Reform systems
1666 ;; https://mntre.com/reform.html
1667 (let ((base (make-linux-libre* linux-libre-6.18-version
1668 linux-libre-6.18-gnu-revision
1669 linux-libre-6.18-source
1670 '("aarch64-linux")
1671 #:extra-version "arm64-mnt-reform"
1672 #:extra-options
1673 ;; https://source.mnt.re/reform/reform-debian-packages/-/blob/main/linux/config
1674 (append `(("CONFIG_DRM_LVDS_CODEC" . m)
1675 ("CONFIG_DRM_CDNS_MHDP8546" . m)
1676 ("CONFIG_DRM_CDNS_HDMI_CEC" . m)
1677 ("CONFIG_DRM_IMX_CDNS_MHDP" . m)
1678 ("CONFIG_DRM_IMX_DCSS" . m)
1679 ("CONFIG_PHY_FSL_IMX8MQ_HDPTX" . m)
1680 ("CONFIG_DRM_PANEL_LVDS" . m)
1681 ("CONFIG_I2C_IMX_LPI2C" . m)
1682 ("CONFIG_I2C_MUX_REG" . m)
1683 ("CONFIG_INTERCONNECT_IMX" . #true)
1684 ("CONFIG_INTERCONNECT_IMX8MQ" . #true)
1685 ("CONFIG_MFD_WM8994" . m)
1686 ("CONFIG_MUX_GPIO" . m)
1687 ("CONFIG_MUX_MMIO" . m)
1688 ("CONFIG_RTC_DRV_PCF8523" . m)
1689 ("CONFIG_USB_EHCI_FSL" . m)
1690 ("CONFIG_NO_HZ_IDLE" . #true)
1691 ("CONFIG_SND_SOC_FSL_MICFIL" . m)
1692 ("CONFIG_SND_IMX_SOC" . m)
1693 ("CONFIG_SND_SOC_FSL_ASOC_CARD" . m)
1694 ("CONFIG_SND_SOC_IMX_AUDMIX" . m)
1695 ("CONFIG_SND_SOC_IMX_HDMI" . m)
1696 ("CONFIG_INPUT_JOYSTICK" . #true)
1697 ("CONFIG_JOYSTICK_XPAD" . m)
1698 ("CONFIG_JOYSTICK_XPAD_FF" . #true)
1699 ("CONFIG_JOYSTICK_XPAD_LEDS" . #true)
1700 ("CONFIG_INTERCONNECT_IMX8MP" . #true)
1701 ("CONFIG_SND_SOC_FSL_ASRC" . #true)
1702 ("CONFIG_DRM_IMX_LCDIF" . #true)
1703 ("CONFIG_DRM_IMX8MP_DW_HDMI_BRIDGE" . #true)
1704 ("CONFIG_DRM_IMX8MP_HDMI_PVI" . #true)
1705 ("CONFIG_IMX8MM_THERMAL" . #true)
1706 ("CONFIG_IMX2_WDT" . #true)
1707 ("CONFIG_DRM_SAMSUNG_DSIM" . #true)
1708 ("CONFIG_PHY_FSL_SAMSUNG_HDMI_PHY" . #true)
1709 ("CONFIG_DRM" . #true)
1710 ("CONFIG_DRM_PANEL_MNT_POCKET_REFORM" . #true)
1711 ("CONFIG_IMX8M_BLK_CTRL" . #true)
1712 ("CONFIG_IMX_GPCV2_PM_DOMAINS" . #true)
1713 ("CONFIG_DRM_DISPLAY_CONNECTOR" . #true)
1714 ("CONFIG_DRM_FSL_LDB" . #true)
1715 ("CONFIG_BACKLIGHT_CLASS_DEVICE" . #true)
1716 ("CONFIG_BACKLIGHT_PWM" . #true)
1717 ("CONFIG_BACKLIGHT_GPIO" . #true)
1718 ("CONFIG_BACKLIGHT_LED" . #true)
1719 ("CONFIG_CPU_FREQ_GOV_PERFORMANCE" . #true)
1720 ("CONFIG_CPU_FREQ_GOV_POWERSAVE" . #true)
1721 ("CONFIG_CPU_FREQ_GOV_USERSPACE" . #true)
1722 ("CONFIG_CPU_FREQ_GOV_ONDEMAND" . #true)
1723 ("CONFIG_CPU_FREQ_GOV_CONSERVATIVE" . #true)
1724 ("CONFIG_CPU_FREQ_GOV_SCHEDUTIL" . #true)
1725 ("CONFIG_ARM_IMX_CPUFREQ_DT" . #true)
1726 ("CONFIG_ARM_IMX_BUS_DEVFREQ" . #true)
1727 ("CONFIG_IMX_IRQSTEER" . #true)
1728 ("CONFIG_PCI_MESON" . #true)
1729 ("CONFIG_DWMAC_MESON" . #true)
1730 ("CONFIG_MDIO_BUS_MUX_MESON_G12A" . #true)
1731 ("CONFIG_GPIO_ROCKCHIP" . #true)
1732 ("CONFIG_PL330_DMA" . #true)
1733 ("CONFIG_I2C_MESON" . #true)
1734 ("CONFIG_PWM_MESON" . #true)
1735 ("CONFIG_USB_DWC3_MESON_G12A" . #true)
1736 ("CONFIG_MMC_MESON_GX" . #true)
1737 ("CONFIG_MMC_MESON_MX_SDIO" . #true)
1738 ("CONFIG_MESON_DDR_PMU" . #true)
1739 ("CONFIG_RTW88_8822CS" . m)
1740 ("CONFIG_PWM_FSL_FTM" . #true)
1741 ("CONFIG_FSL_RCPM" . #true)
1742 ("CONFIG_ARM_ROCKCHIP_CPUFREQ" . m)
1743 ("CONFIG_DRM_PANTHOR" . m)
1744 ("CONFIG_NVMEM_ROCKCHIP_OTP" . #true)
1745 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX" . m)
1746 ("CONFIG_PHY_ROCKCHIP_USBDP" . m)
1747 ("CONFIG_ROCKCHIP_REGULATOR_COUPLER" . #true)
1748 ("CONFIG_SPI_ROCKCHIP" . #true)
1749 ("CONFIG_SPI_ROCKCHIP_SFC" . m)
1750 ("CONFIG_ARM_SCMI_CPUFREQ" . m)
1751 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_DCPHY" . #true)
1752 ("CONFIG_VIDEO_ROCKCHIP_VDEC2" . m)
1753 ("CONFIG_ROCKCHIP_DW_HDMI_QP" . #true)
1754 ("CONFIG_ROCKCHIP_DW_MIPI_DSI2" . #true)
1755 ;; Fixes https://codeberg.org/guix/guix/issues/101
1756 ("CONFIG_CRYPTO_USER_API_HASH" . #true)
1757 ("CONFIG_CRYPTO_USER_API_SKCIPHER" . #true)
1758 ("CONFIG_CRYPTO_USER_API_RNG" . #true)
1759 ("CONFIG_CRYPTO_USER_API_AEAD" . #true)
1760 ("CONFIG_KEY_DH_OPERATIONS" . #true)
1761 ;; nftables support
1762 ("CONFIG_NF_TABLES" . m)
1763 ("CONFIG_NF_TABLES_INET" . #true)
1764 ("CONFIG_NF_TABLES_NETDEV" . #true)
1765 ("CONFIG_NF_TABLES_IPV4" . #true)
1766 ("CONFIG_NF_TABLES_ARP" . #true)
1767 ("CONFIG_NF_TABLES_IPV6" . #true)
1768 ("CONFIG_NF_TABLES_BRIDGE" . m)
1769 ("CONFIG_NFT_NUMGEN" . m)
1770 ("CONFIG_NFT_CT" . m)
1771 ("CONFIG_NFT_FLOW_OFFLOAD" . m)
1772 ("CONFIG_NFT_CONNLIMIT" . m)
1773 ("CONFIG_NFT_LOG" . m)
1774 ("CONFIG_NFT_LIMIT" . m)
1775 ("CONFIG_NFT_MASQ" . m)
1776 ("CONFIG_NFT_REDIR" . m)
1777 ("CONFIG_NFT_NAT" . m)
1778 ("CONFIG_NFT_TUNNEL" . m)
1779 ("CONFIG_NFT_QUEUE" . m)
1780 ("CONFIG_NFT_QUOTA" . m)
1781 ("CONFIG_NFT_REJECT" . m)
1782 ("CONFIG_NFT_REJECT_INET" . m)
1783 ("CONFIG_NFT_COMPAT" . m)
1784 ("CONFIG_NFT_HASH" . m)
1785 ("CONFIG_NFT_FIB" . m)
1786 ("CONFIG_NFT_FIB_INET" . m)
1787 ("CONFIG_NFT_XFRM" . m)
1788 ("CONFIG_NFT_SOCKET" . m)
1789 ("CONFIG_NFT_OSF" . m)
1790 ("CONFIG_NFT_TPROXY" . m)
1791 ("CONFIG_NFT_SYNPROXY" . m)
1792 ("CONFIG_NFT_DUP_NETDEV" . m)
1793 ("CONFIG_NFT_FWD_NETDEV" . m)
1794 ("CONFIG_NFT_FIB_NETDEV" . m)
1795 ("CONFIG_NFT_REJECT_NETDEV" . m)
1796 ("CONFIG_NFT_REJECT_IPV4" . m)
1797 ("CONFIG_NFT_DUP_IPV4" . m)
1798 ("CONFIG_NFT_FIB_IPV4" . m)
1799 ("CONFIG_NFT_COMPAT_ARP" . m)
1800 ("CONFIG_NFT_REJECT_IPV6" . m)
1801 ("CONFIG_NFT_DUP_IPV6" . m)
1802 ("CONFIG_NFT_FIB_IPV6" . m)
1803 ("CONFIG_NFT_BRIDGE_META" . m)
1804 ("CONFIG_NFT_BRIDGE_REJECT" . m)
1805 ;; Provide support for USB tethering
1806 ("CONFIG_USB_NET_CDC_EEM" . m)
1807 ("CONFIG_USB_NET_RNDIS_HOST" . m)
1808 ("CONFIG_USB_WDM" . m)
1809 ("CONFIG_USB_GADGET" . m)
1810 ("CONFIG_USB_ETH" . m)
1811 ("CONFIG_USB_ETH_RNDIS" . m)
1812 ("CONFIG_USB_ETH_EEM" . m)
1813 ("CONFIG_USB_G_NCM" . m)
1814 ;; Provide support for wireguard
1815 ("CONFIG_WIREGUARD" . m)
1816 ;; Provide support for ath9k wireless
1817 ("CONFIG_ATH9K" . m)
1818 ("CONFIG_ATH9K_HTC" . m))
1819 (default-extra-linux-options
1820 linux-libre-6.18-version)))))
1821 (package
1822 (inherit base)
1823 (inputs (list reform-debian-packages-for-6.18))
1824 (synopsis (string-append (package-synopsis base)
1825 " for MNT/Reform systems"))
1826 (description (string-append (package-description base)
1827 " Configuration options and patches have been applied for use with MNT/Reform systems."))
1828 (arguments
1829 (substitute-keyword-arguments (package-arguments base)
1830 ((#:phases phases)
1831 #~(modify-phases #$phases
1832 (add-after 'unpack 'apply-reform-patches
1833 (lambda* (#:key inputs #:allow-other-keys)
1834 (for-each (lambda (patch)
1835 (invoke "patch" "-p1" "-i"
1836 (search-input-file inputs
1837 (string-append
1838 "patches6.18/" patch))))
1839 (list
1840 "imx8mp-mnt-pocket-reform/2ghz/0001-imx8mp-2ghz-clk.patch"
1841 "imx8mp-mnt-pocket-reform/2ghz/0002-imx8mp-2ghz-opp.patch"
1842 "imx8mp-mnt-pocket-reform/audio/0000-revert-crashy-audiomix-pm-support.patch"
1843 "imx8mp-mnt-pocket-reform/mmc-sdio/0001-sdhci-add-no-sd-uhs-sdr104-devicetree-property.patch"
1844 "imx8mp-mnt-pocket-reform/mmc-sdio/0002-During-the-card-init-the-host-side-sometimes-may-nee.patch"
1845 "imx8mp-mnt-pocket-reform/mmc-sdio/0003-USDHC-IP-has-one-limitation-the-tuning-circuit-can-t.patch"
1846 "imx8mp-mnt-pocket-reform/pocket-panel/0001-v5-add-multi-display-panel-driver.patch"
1847 "imx8mp-mnt-pocket-reform/pocket-panel/0002-pocket-panel-fix-sleep-add-orientation.patch"
1848 "imx8mp-mnt-reform2/0001-sn65dsi86-use-hs-clock-of-samsung-dsim-host-directly.patch"
1849 "imx8mp-mnt-reform2/0002-lcdif-dont-exceed-desired-pixel-clock.patch"
1850 "imx8mq-mnt-reform2/0001-imx8mq-mnt-reform2.dts-multiple-fixes-for-display-wi.patch"
1851 "imx8mq-mnt-reform2/0001-nwl-dsi-fixup-mode-only-for-LCDIF-input-not-DCSS.patch"
1852 "imx8mq-mnt-reform2/0002-Revert-drm-bridge-nwl-dsi-Use-vsync-hsync-polarity-f.patch"
1853 "imx8mq-mnt-reform2/0003-lcdif-fix-pcie-interference.patch"
1854 "imx8mq-mnt-reform2/0004-mnt4002-imx-gpcv2-wake-smccc.patch.patch"
1855 "imx8mq-mnt-reform2/0005-pci-imx6-add-support-for-internal-refclk-imx8mq.patch"
1856 "imx8mq-mnt-reform2/0006-imx8mq-import-HDMI-driver-and-make-DCSS-compatible-w.patch"
1857 "ls1028a-mnt-reform2/0000-dtsi-add-hdptx.patch"
1858 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0001-a311d-viu-fifo-lines-config.patch"
1859 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0002-a311d-viu-fifo-lines-config-header.patch"
1860 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0003-tlv320aic31xx-add-1228800hz-support.patch"
1861 "meson-g12b-bananapi-cm4-mnt-reform2/0001-meson-g12b-bananapi-cm4-mnt-reform2.dts-fix-audio-an.patch"
1862 "meson-g12b-bananapi-cm4-mnt-reform2/0001-Revert-drm-bridge-synopsys-dw-mipi-dsi-enable-EoTp-b.patch"
1863 "meson-g12b-bananapi-cm4-mnt-reform2/0011-dw-mipi-dsi-phy-stop-wait-time.patch"
1864 "meson-g12b-bananapi-cm4-mnt-reform2/0012-innolux-n125hce-gn1-timing-tweaks.patch"
1865 "meson-g12b-bananapi-cm4-mnt-reform2/0013-meson-viu-hold-fifo-lines.patch"
1866 "meson-g12b-bananapi-cm4-mnt-reform2/0014-meson-venc-sync.patch.patch"
1867 "meson-g12b-bananapi-cm4-mnt-reform2/0015-meson-dw-mipi-dsi-sync-invert.patch"
1868 "meson-g12b-bananapi-cm4-mnt-reform2/0016-sn65dsi86-burst-mode-support.patch"
1869 "meson-g12b-bananapi-cm4-mnt-reform2/0018-sn65dsi86-never-turn-off.patch"
1870 "meson-g12b-bananapi-cm4-mnt-reform2/0020-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch"
1871 "meson-g12b-bananapi-cm4-mnt-reform2/0021-HACK-of-partial-revert-of-fdt.c-changes.patch"
1872 "meson-g12b-bananapi-cm4-mnt-reform2/0022-add-bt-and-eth-resets.patch"
1873 "meson-g12b-bananapi-cm4-mnt-reform2/0023-sdio-pullups.patch"
1874 "meson-g12b-bananapi-cm4-mnt-reform2/0024-sdio-improve-wifi-speed.patch"
1875 "meson-g12b-bananapi-cm4-mnt-reform2/0030-WORKAROUND-meson-plane-disable-afbc-32x8.patch"
1876 "rk3588-mnt-reform2/0001-MERGED-drm-bridge-Pass-down-connector-to-drm-bridge-.patch"
1877 "rk3588-mnt-reform2/0024-math.h-add-DIV_ROUND_UP_NO_OVERFLOW.patch"
1878 "rk3588-mnt-reform2/0025-clk-divider-Fix-divisor-masking-on-64-bit-platforms.patch"
1879 "rk3588-mnt-reform2/0026-clk-composite-replace-open-coded-abs_diff.patch"
1880 "rk3588-mnt-reform2/0030-mfd-rk8xx-Fix-shutdown-handler.patch"
1881 "rk3588-mnt-reform2/0031-dt-bindings-display-vop2-Add-VP-clock-resets.patch"
1882 "rk3588-mnt-reform2/0032-drm-rockchip-vop2-Add-clock-resets-support.patch"
1883 "rk3588-mnt-reform2/0033-arm64-dts-rockchip-Add-VOP-clock-resets-for-rk3588s.patch"
1884 "rk3588-mnt-reform2/0035-drm-rockchip-vop2-Add-core-reset-support.patch"
1885 "rk3588-mnt-reform2/0046-arm64-defconfig-Enable-Rockchip-RK3588-DisplayPort-C.patch"
1886 "rk3588-mnt-reform2/0055-phy-rockchip-usbdp-move-orientation-handling-further.patch"
1887 "rk3588-mnt-reform2/0056-phy-rockchip-usbdp-reset-USB3-and-reinit-on-orientat.patch"
1888 "rk3588-mnt-reform2/0060-PCI-dw-rockchip-Rename-rockchip_pcie_get_ltssm-funct.patch"
1889 "rk3588-mnt-reform2/0061-PCI-dw-rockchip-Support-get_ltssm-operation.patch"
1890 "rk3588-mnt-reform2/0062-PCI-dw-rockchip-Move-devm_phy_get-out-of-phy_init.patch"
1891 "rk3588-mnt-reform2/0063-PCI-dw-rockchip-Add-helper-function-for-enhanced-LTS.patch"
1892 "rk3588-mnt-reform2/0064-PCI-dw-rockchip-Add-helper-function-for-controller-m.patch"
1893 "rk3588-mnt-reform2/0065-PCI-dw-rockchip-Add-helper-function-for-DDL-indicato.patch"
1894 "rk3588-mnt-reform2/0066-PCI-dw-rockchip-Add-pme_turn_off-support.patch"
1895 "rk3588-mnt-reform2/0067-PCI-dw-rockchip-Add-system-PM-support.patch"
1896 "rk3588-mnt-reform2/0068-drm-bridge-dw-hdmi-qp-Add-CEC-support.patch"
1897 "rk3588-mnt-reform2/0069-drm-bridge-dw-hdmi-qp-Fixup-timer-base-setup.patch"
1898 "rk3588-mnt-reform2/0070-drm-rockchip-dw_hdmi_qp-Improve-error-handling-with-.patch"
1899 "rk3588-mnt-reform2/0071-drm-rockchip-dw_hdmi_qp-Provide-CEC-IRQ-in-dw_hdmi_q.patch"
1900 "rk3588-mnt-reform2/0072-drm-rockchip-dw_hdmi_qp-Provide-ref-clock-rate-in-dw.patch"
1901 "rk3588-mnt-reform2/0073-arm64-defconfig-Enable-DW-HDMI-QP-CEC-support.patch"
1902 "rk3588-mnt-reform2/0075-phy-hdmi-Add-HDMI-2.1-FRL-configuration-options.patch"
1903 "rk3588-mnt-reform2/0079-phy-rockchip-samsung-hdptx-Use-usleep_range-instead-.patch"
1904 "rk3588-mnt-reform2/0080-phy-rockchip-samsung-hdptx-Fix-coding-style-alignmen.patch"
1905 "rk3588-mnt-reform2/0081-phy-rockchip-samsung-hdptx-Consistently-use-rk_-hdpt.patch"
1906 "rk3588-mnt-reform2/0082-phy-rockchip-samsung-hdptx-Enable-lane-output-in-com.patch"
1907 "rk3588-mnt-reform2/0083-phy-rockchip-samsung-hdptx-Cleanup-_cmn_init_seq-lis.patch"
1908 "rk3588-mnt-reform2/0084-phy-rockchip-samsung-hdptx-Compute-clk-rate-from-PLL.patch"
1909 "rk3588-mnt-reform2/0085-phy-rockchip-samsung-hdptx-Drop-hw_rate-driver-data.patch"
1910 "rk3588-mnt-reform2/0086-phy-rockchip-samsung-hdptx-Switch-to-driver-specific.patch"
1911 "rk3588-mnt-reform2/0087-phy-rockchip-samsung-hdptx-Extend-rk_hdptx_phy_verif.patch"
1912 "rk3588-mnt-reform2/0088-phy-rockchip-samsung-hdptx-Add-HDMI-2.1-FRL-support.patch"
1913 "rk3588-mnt-reform2/0089-drm-rockchip-vop2-Check-bpc-before-switching-DCLK-so.patch"
1914 "rk3588-mnt-reform2/0090-drm-bridge-dw-hdmi-qp-Handle-platform-supported-form.patch"
1915 "rk3588-mnt-reform2/0091-drm-rockchip-dw_hdmi_qp-Switch-to-phy_configure.patch"
1916 "rk3588-mnt-reform2/0092-drm-rockchip-dw_hdmi_qp-Use-bit-macros-for-RK3576-re.patch"
1917 "rk3588-mnt-reform2/0093-drm-rockchip-dw_hdmi_qp-Add-high-color-depth-support.patch"
1918 "rk3588-mnt-reform2/0094-DEBUG-phy-rockchip-samsung-hdptx-Add-verbose-logging.patch"
1919 "rk3588-mnt-reform2/0095-WIP-SCRAMB-drm-bridge-Add-detect_ctx-hook.patch"
1920 "rk3588-mnt-reform2/0096-WIP-SCRAMB-drm-bridge-connector-Switch-from-detect-t.patch"
1921 "rk3588-mnt-reform2/0097-WIP-SCRAMB-drm-bridge-dw-hdmi-qp-Add-high-TMDS-clock.patch"
1922 "rk3588-mnt-reform2/0098-WIP-YUV420-drm-rockchip-vop2-Add-YUV420-output-forma.patch"
1923 "rk3588-mnt-reform2/0099-WIP-YUV420-drm-rockchip-dw_hdmi_qp-Add-YUV420-output.patch"
1924 "rk3588-mnt-reform2/0100-WIP-FRL-dt-bindings-display-rockchip-Add-tmds-enable.patch"
1925 "rk3588-mnt-reform2/0101-WIP-FRL-drm-rockchip-dw_hdmi_qp-Fixup-usage-of-enabl.patch"
1926 "rk3588-mnt-reform2/0103-WIP-FRL-arm64-dts-rockchip-Assign-ACLK_VOP-to-750-MH.patch"
1927 "rk3588-mnt-reform2/0104-WIP-FRL-drm-connector-hdmi-Handle-FRL-in-hdmi_clock_.patch"
1928 "rk3588-mnt-reform2/0105-WIP-FRL-drm-bridge-dw-hdmi-qp-Add-HDMI-2.1-FRL-suppo.patch"
1929 "rk3588-mnt-reform2/0106-WIP-FRL-drm-rockchip-dw_hdmi_qp-Add-HDMI-2.1-FRL-sup.patch"
1930 "rk3588-mnt-reform2/0107-WIP-FRL-drm-rockchip-vop2-Add-HDMI-2.1-FRL-support.patch"
1931 "rk3588-mnt-reform2/0108-dt-bindings-phy-rockchip-usbdp-add-improved-ports-sc.patch"
1932 "rk3588-mnt-reform2/0114-media-dt-bindings-video-interfaces-add-defines-for-s.patch"
1933 "rk3588-mnt-reform2/2001-drm-bridge-dw-hdmi-qp-Return-0-in-audio-prepare-when.patch"
1934 "rk3588-mnt-reform2/2003-drm-bridge-synopsys-Do-not-warn-about-audio-params-c.patch"
1935 "rk3588-mnt-reform2/5200-drm-rockchip-Set-dma-mask-to-64-bit.patch"))))
1936 (add-after 'apply-reform-patches 'copy-reform-dts-files
1937 (lambda* (#:key inputs #:allow-other-keys)
1938 (for-each (lambda (dts)
1939 (copy-file (search-input-file inputs
1940 (string-append
1941 "/dts/" dts))
1942 (string-append "arch/arm64/boot/dts/"
1943 dts)))
1944 (list
1945 "amlogic/meson-g12b-bananapi-cm4-mnt-pocket-reform.dts"
1946 "freescale/fsl-ls1028a-mnt-reform2.dts"
1947 "freescale/imx8mp-mnt-pocket-reform.dts"
1948 "freescale/imx8mp-mnt-reform2.dts"
1949 "freescale/imx8mq-mnt-reform2-hdmi.dts"
1950 "rockchip/rk3588-mnt-pocket-reform.dts"
1951 "rockchip/rk3588-mnt-reform-next.dts"
1952 "rockchip/rk3588-mnt-reform2.dts"
1953 "rockchip/rk3588-mnt-reform2-dsi.dts"
1954 ))))
1955 (add-after 'apply-reform-patches 'adjust-makefiles-with-new-dtb
1956 (lambda _
1957 (substitute* "arch/arm64/boot/dts/amlogic/Makefile"
1958 (("meson-g12b-bananapi-cm4-mnt-reform2.dtb")
1959 "meson-g12b-bananapi-cm4-mnt-reform2.dtb
1960dtb-$(CONFIG_ARCH_MESON) += meson-g12b-bananapi-cm4-mnt-pocket-reform.dtb"))
1961 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
1962 (("fsl-ls1028a-rdb.dtb")
1963 "fsl-ls1028a-rdb.dtb
1964dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-mnt-reform2.dtb"))
1965 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
1966 (("imx8mq-mnt-reform2.dtb")
1967 "imx8mq-mnt-reform2.dtb
1968dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-reform2.dtb
1969dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-pocket-reform.dtb
1970dtb-$(CONFIG_ARCH_MXC) += imx8mq-mnt-reform2-hdmi.dtb"))
1971 (substitute* "arch/arm64/boot/dts/rockchip/Makefile"
1972 (("rk3588-mnt-reform2.dtb")
1973 "rk3588-mnt-reform2.dtb
1974dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform2-dsi.dtb
1975dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform-next.dtb
1976dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-pocket-reform.dtb")))))))))))
1977
1978(define-public linux-libre-arm64-mnt-reform-6.17
1979 ;; Kernel for use on the MNT/Reform systems
1980 ;; https://mntre.com/reform.html
1981 (let ((base (make-linux-libre* linux-libre-6.17-version
1982 linux-libre-6.17-gnu-revision
1983 linux-libre-6.17-source
1984 '("aarch64-linux")
1985 #:extra-version "arm64-mnt-reform"
1986 #:extra-options
1987 ;; https://source.mnt.re/reform/reform-debian-packages/-/blob/main/linux/config
1988 (append `(("CONFIG_DRM_LVDS_CODEC" . m)
1989 ("CONFIG_DRM_CDNS_MHDP8546" . m)
1990 ("CONFIG_DRM_CDNS_HDMI_CEC" . m)
1991 ("CONFIG_DRM_IMX_CDNS_MHDP" . m)
1992 ("CONFIG_DRM_IMX_DCSS" . m)
1993 ("CONFIG_PHY_FSL_IMX8MQ_HDPTX" . m)
1994 ("CONFIG_DRM_PANEL_LVDS" . m)
1995 ("CONFIG_I2C_IMX_LPI2C" . m)
1996 ("CONFIG_I2C_MUX_REG" . m)
1997 ("CONFIG_INTERCONNECT_IMX" . #true)
1998 ("CONFIG_INTERCONNECT_IMX8MQ" . #true)
1999 ("CONFIG_MFD_WM8994" . m)
2000 ("CONFIG_MUX_GPIO" . m)
2001 ("CONFIG_MUX_MMIO" . m)
2002 ("CONFIG_RTC_DRV_PCF8523" . m)
2003 ("CONFIG_USB_EHCI_FSL" . m)
2004 ("CONFIG_NO_HZ_IDLE" . #true)
2005 ("CONFIG_SND_SOC_FSL_MICFIL" . m)
2006 ("CONFIG_SND_IMX_SOC" . m)
2007 ("CONFIG_SND_SOC_FSL_ASOC_CARD" . m)
2008 ("CONFIG_SND_SOC_IMX_AUDMIX" . m)
2009 ("CONFIG_SND_SOC_IMX_HDMI" . m)
2010 ("CONFIG_INPUT_JOYSTICK" . #true)
2011 ("CONFIG_JOYSTICK_XPAD" . m)
2012 ("CONFIG_JOYSTICK_XPAD_FF" . #true)
2013 ("CONFIG_JOYSTICK_XPAD_LEDS" . #true)
2014 ("CONFIG_INTERCONNECT_IMX8MP" . #true)
2015 ("CONFIG_SND_SOC_FSL_ASRC" . #true)
2016 ("CONFIG_DRM_IMX_LCDIF" . #true)
2017 ("CONFIG_DRM_IMX8MP_DW_HDMI_BRIDGE" . #true)
2018 ("CONFIG_DRM_IMX8MP_HDMI_PVI" . #true)
2019 ("CONFIG_IMX8MM_THERMAL" . #true)
2020 ("CONFIG_IMX2_WDT" . #true)
2021 ("CONFIG_DRM_SAMSUNG_DSIM" . #true)
2022 ("CONFIG_PHY_FSL_SAMSUNG_HDMI_PHY" . #true)
2023 ("CONFIG_DRM" . #true)
2024 ("CONFIG_DRM_PANEL_MNT_POCKET_REFORM" . #true)
2025 ("CONFIG_IMX8M_BLK_CTRL" . #true)
2026 ("CONFIG_IMX_GPCV2_PM_DOMAINS" . #true)
2027 ("CONFIG_DRM_DISPLAY_CONNECTOR" . #true)
2028 ("CONFIG_DRM_FSL_LDB" . #true)
2029 ("CONFIG_BACKLIGHT_CLASS_DEVICE" . #true)
2030 ("CONFIG_BACKLIGHT_PWM" . #true)
2031 ("CONFIG_BACKLIGHT_GPIO" . #true)
2032 ("CONFIG_BACKLIGHT_LED" . #true)
2033 ("CONFIG_CPU_FREQ_GOV_PERFORMANCE" . #true)
2034 ("CONFIG_CPU_FREQ_GOV_POWERSAVE" . #true)
2035 ("CONFIG_CPU_FREQ_GOV_USERSPACE" . #true)
2036 ("CONFIG_CPU_FREQ_GOV_ONDEMAND" . #true)
2037 ("CONFIG_CPU_FREQ_GOV_CONSERVATIVE" . #true)
2038 ("CONFIG_CPU_FREQ_GOV_SCHEDUTIL" . #true)
2039 ("CONFIG_ARM_IMX_CPUFREQ_DT" . #true)
2040 ("CONFIG_ARM_IMX_BUS_DEVFREQ" . #true)
2041 ("CONFIG_IMX_IRQSTEER" . #true)
2042 ("CONFIG_PCI_MESON" . #true)
2043 ("CONFIG_DWMAC_MESON" . #true)
2044 ("CONFIG_MDIO_BUS_MUX_MESON_G12A" . #true)
2045 ("CONFIG_GPIO_ROCKCHIP" . #true)
2046 ("CONFIG_PL330_DMA" . #true)
2047 ("CONFIG_I2C_MESON" . #true)
2048 ("CONFIG_PWM_MESON" . #true)
2049 ("CONFIG_USB_DWC3_MESON_G12A" . #true)
2050 ("CONFIG_MMC_MESON_GX" . #true)
2051 ("CONFIG_MMC_MESON_MX_SDIO" . #true)
2052 ("CONFIG_MESON_DDR_PMU" . #true)
2053 ("CONFIG_RTW88_8822CS" . m)
2054 ("CONFIG_PWM_FSL_FTM" . #true)
2055 ("CONFIG_FSL_RCPM" . #true)
2056 ("CONFIG_ARM_ROCKCHIP_CPUFREQ" . m)
2057 ("CONFIG_DRM_PANTHOR" . m)
2058 ("CONFIG_NVMEM_ROCKCHIP_OTP" . #true)
2059 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX" . m)
2060 ("CONFIG_PHY_ROCKCHIP_USBDP" . m)
2061 ("CONFIG_ROCKCHIP_REGULATOR_COUPLER" . #true)
2062 ("CONFIG_SPI_ROCKCHIP" . #true)
2063 ("CONFIG_SPI_ROCKCHIP_SFC" . m)
2064 ("CONFIG_ARM_SCMI_CPUFREQ" . m)
2065 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_DCPHY" . #true)
2066 ("CONFIG_VIDEO_ROCKCHIP_VDEC2" . m)
2067 ("CONFIG_ROCKCHIP_DW_HDMI_QP" . #true)
2068 ("CONFIG_ROCKCHIP_DW_MIPI_DSI2" . #true)
2069 ;; Fixes https://codeberg.org/guix/guix/issues/101
2070 ("CONFIG_CRYPTO_USER_API_HASH" . #true)
2071 ("CONFIG_CRYPTO_USER_API_SKCIPHER" . #true)
2072 ("CONFIG_CRYPTO_USER_API_RNG" . #true)
2073 ("CONFIG_CRYPTO_USER_API_AEAD" . #true)
2074 ("CONFIG_KEY_DH_OPERATIONS" . #true)
2075 ;; nftables support
2076 ("CONFIG_NF_TABLES" . m)
2077 ("CONFIG_NF_TABLES_INET" . #true)
2078 ("CONFIG_NF_TABLES_NETDEV" . #true)
2079 ("CONFIG_NF_TABLES_IPV4" . #true)
2080 ("CONFIG_NF_TABLES_ARP" . #true)
2081 ("CONFIG_NF_TABLES_IPV6" . #true)
2082 ("CONFIG_NF_TABLES_BRIDGE" . m)
2083 ("CONFIG_NFT_NUMGEN" . m)
2084 ("CONFIG_NFT_CT" . m)
2085 ("CONFIG_NFT_FLOW_OFFLOAD" . m)
2086 ("CONFIG_NFT_CONNLIMIT" . m)
2087 ("CONFIG_NFT_LOG" . m)
2088 ("CONFIG_NFT_LIMIT" . m)
2089 ("CONFIG_NFT_MASQ" . m)
2090 ("CONFIG_NFT_REDIR" . m)
2091 ("CONFIG_NFT_NAT" . m)
2092 ("CONFIG_NFT_TUNNEL" . m)
2093 ("CONFIG_NFT_QUEUE" . m)
2094 ("CONFIG_NFT_QUOTA" . m)
2095 ("CONFIG_NFT_REJECT" . m)
2096 ("CONFIG_NFT_REJECT_INET" . m)
2097 ("CONFIG_NFT_COMPAT" . m)
2098 ("CONFIG_NFT_HASH" . m)
2099 ("CONFIG_NFT_FIB" . m)
2100 ("CONFIG_NFT_FIB_INET" . m)
2101 ("CONFIG_NFT_XFRM" . m)
2102 ("CONFIG_NFT_SOCKET" . m)
2103 ("CONFIG_NFT_OSF" . m)
2104 ("CONFIG_NFT_TPROXY" . m)
2105 ("CONFIG_NFT_SYNPROXY" . m)
2106 ("CONFIG_NFT_DUP_NETDEV" . m)
2107 ("CONFIG_NFT_FWD_NETDEV" . m)
2108 ("CONFIG_NFT_FIB_NETDEV" . m)
2109 ("CONFIG_NFT_REJECT_NETDEV" . m)
2110 ("CONFIG_NFT_REJECT_IPV4" . m)
2111 ("CONFIG_NFT_DUP_IPV4" . m)
2112 ("CONFIG_NFT_FIB_IPV4" . m)
2113 ("CONFIG_NFT_COMPAT_ARP" . m)
2114 ("CONFIG_NFT_REJECT_IPV6" . m)
2115 ("CONFIG_NFT_DUP_IPV6" . m)
2116 ("CONFIG_NFT_FIB_IPV6" . m)
2117 ("CONFIG_NFT_BRIDGE_META" . m)
2118 ("CONFIG_NFT_BRIDGE_REJECT" . m)
2119 ;; Provide support for USB tethering
2120 ("CONFIG_USB_NET_CDC_EEM" . m)
2121 ("CONFIG_USB_NET_RNDIS_HOST" . m)
2122 ("CONFIG_USB_WDM" . m)
2123 ("CONFIG_USB_GADGET" . m)
2124 ("CONFIG_USB_ETH" . m)
2125 ("CONFIG_USB_ETH_RNDIS" . m)
2126 ("CONFIG_USB_ETH_EEM" . m)
2127 ("CONFIG_USB_G_NCM" . m)
2128 ;; Provide support for wireguard
2129 ("CONFIG_WIREGUARD" . m)
2130 ;; Provide support for ath9k wireless
2131 ("CONFIG_ATH9K" . m)
2132 ("CONFIG_ATH9K_HTC" . m))
2133 (default-extra-linux-options
2134 linux-libre-6.17-version)))))
2135 (package
2136 (inherit base)
2137 (inputs (list reform-debian-packages-for-6.17))
2138 (synopsis (string-append (package-synopsis base)
2139 " for MNT/Reform systems"))
2140 (description (string-append (package-description base)
2141 " Configuration options and patches have been applied for use with MNT/Reform systems."))
2142 (arguments
2143 (substitute-keyword-arguments (package-arguments base)
2144 ((#:phases phases)
2145 #~(modify-phases #$phases
2146 (add-after 'unpack 'apply-reform-patches
2147 (lambda* (#:key inputs #:allow-other-keys)
2148 (for-each (lambda (patch)
2149 (invoke "patch" "-p1" "-i"
2150 (search-input-file inputs
2151 (string-append
2152 "patches6.17/" patch))))
2153 (list
2154 "imx8mp-mnt-pocket-reform/2ghz/0001-imx8mp-2ghz-clk.patch"
2155 "imx8mp-mnt-pocket-reform/2ghz/0002-imx8mp-2ghz-opp.patch"
2156 "imx8mp-mnt-pocket-reform/audio/0000-revert-crashy-audiomix-pm-support.patch"
2157 "imx8mp-mnt-pocket-reform/mmc-sdio/0001-sdhci-add-no-sd-uhs-sdr104-devicetree-property.patch"
2158 "imx8mp-mnt-pocket-reform/mmc-sdio/0002-During-the-card-init-the-host-side-sometimes-may-nee.patch"
2159 "imx8mp-mnt-pocket-reform/mmc-sdio/0003-USDHC-IP-has-one-limitation-the-tuning-circuit-can-t.patch"
2160 "imx8mp-mnt-pocket-reform/pocket-panel/0001-v5-add-multi-display-panel-driver.patch"
2161 "imx8mp-mnt-pocket-reform/pocket-panel/0002-pocket-panel-fix-sleep-add-orientation.patch"
2162 "imx8mp-mnt-reform2/0001-sn65dsi86-use-hs-clock-of-samsung-dsim-host-directly.patch"
2163 "imx8mp-mnt-reform2/0002-lcdif-dont-exceed-desired-pixel-clock.patch"
2164 "imx8mq-mnt-reform2/0001-imx8mq-mnt-reform2.dts-multiple-fixes-for-display-wi.patch"
2165 "imx8mq-mnt-reform2/0001-nwl-dsi-fixup-mode-only-for-LCDIF-input-not-DCSS.patch"
2166 "imx8mq-mnt-reform2/0002-Revert-drm-bridge-nwl-dsi-Use-vsync-hsync-polarity-f.patch"
2167 "imx8mq-mnt-reform2/0003-lcdif-fix-pcie-interference.patch"
2168 "imx8mq-mnt-reform2/0004-mnt4002-imx-gpcv2-wake-smccc.patch.patch"
2169 "imx8mq-mnt-reform2/0005-pci-imx6-add-support-for-internal-refclk-imx8mq.patch"
2170 "imx8mq-mnt-reform2/0006-imx8mq-import-HDMI-driver-and-make-DCSS-compatible-w.patch"
2171 "ls1028a-mnt-reform2/0000-dtsi-add-hdptx.patch"
2172 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0001-a311d-viu-fifo-lines-config.patch"
2173 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0002-a311d-viu-fifo-lines-config-header.patch"
2174 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0003-tlv320aic31xx-add-1228800hz-support.patch"
2175 "meson-g12b-bananapi-cm4-mnt-reform2/0001-meson-g12b-bananapi-cm4-mnt-reform2.dts-fix-audio-an.patch"
2176 "meson-g12b-bananapi-cm4-mnt-reform2/0001-Revert-drm-bridge-synopsys-dw-mipi-dsi-enable-EoTp-b.patch"
2177 "meson-g12b-bananapi-cm4-mnt-reform2/0011-dw-mipi-dsi-phy-stop-wait-time.patch"
2178 "meson-g12b-bananapi-cm4-mnt-reform2/0012-innolux-n125hce-gn1-timing-tweaks.patch"
2179 "meson-g12b-bananapi-cm4-mnt-reform2/0013-meson-viu-hold-fifo-lines.patch"
2180 "meson-g12b-bananapi-cm4-mnt-reform2/0014-meson-venc-sync.patch.patch"
2181 "meson-g12b-bananapi-cm4-mnt-reform2/0015-meson-dw-mipi-dsi-sync-invert.patch"
2182 "meson-g12b-bananapi-cm4-mnt-reform2/0016-sn65dsi86-burst-mode-support.patch"
2183 "meson-g12b-bananapi-cm4-mnt-reform2/0018-sn65dsi86-never-turn-off.patch"
2184 "meson-g12b-bananapi-cm4-mnt-reform2/0020-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch"
2185 "meson-g12b-bananapi-cm4-mnt-reform2/0021-HACK-of-partial-revert-of-fdt.c-changes.patch"
2186 "meson-g12b-bananapi-cm4-mnt-reform2/0022-add-bt-and-eth-resets.patch"
2187 "meson-g12b-bananapi-cm4-mnt-reform2/0023-sdio-pullups.patch"
2188 "meson-g12b-bananapi-cm4-mnt-reform2/0024-sdio-improve-wifi-speed.patch"
2189 "meson-g12b-bananapi-cm4-mnt-reform2/0030-WORKAROUND-meson-plane-disable-afbc-32x8.patch"
2190 "rk3588-mnt-reform2/0001-MERGED-drm-bridge-Pass-down-connector-to-drm-bridge-.patch"
2191 "rk3588-mnt-reform2/0024-math.h-add-DIV_ROUND_UP_NO_OVERFLOW.patch"
2192 "rk3588-mnt-reform2/0025-clk-divider-Fix-divisor-masking-on-64-bit-platforms.patch"
2193 "rk3588-mnt-reform2/0026-clk-composite-replace-open-coded-abs_diff.patch"
2194 "rk3588-mnt-reform2/0030-mfd-rk8xx-Fix-shutdown-handler.patch"
2195 "rk3588-mnt-reform2/0031-dt-bindings-display-vop2-Add-VP-clock-resets.patch"
2196 "rk3588-mnt-reform2/0032-drm-rockchip-vop2-Add-clock-resets-support.patch"
2197 "rk3588-mnt-reform2/0033-arm64-dts-rockchip-Add-VOP-clock-resets-for-rk3588s.patch"
2198 "rk3588-mnt-reform2/0035-drm-rockchip-vop2-Add-core-reset-support.patch"
2199 "rk3588-mnt-reform2/0036-dt-bindings-display-rockchip-Add-schema-for-RK3588-D.patch"
2200 "rk3588-mnt-reform2/0037-drm-bridge-synopsys-Add-DW-DPTX-Controller-support-l.patch"
2201 "rk3588-mnt-reform2/0038-drm-rockchip-Add-RK3588-DPTX-output-support.patch"
2202 "rk3588-mnt-reform2/0042-arm64-dts-rockchip-Add-DP0-for-rk3588.patch"
2203 "rk3588-mnt-reform2/0043-arm64-dts-rockchip-Add-DP1-for-rk3588.patch"
2204 "rk3588-mnt-reform2/0046-arm64-defconfig-Enable-Rockchip-RK3588-DisplayPort-C.patch"
2205 "rk3588-mnt-reform2/0055-phy-rockchip-usbdp-move-orientation-handling-further.patch"
2206 "rk3588-mnt-reform2/0056-phy-rockchip-usbdp-reset-USB3-and-reinit-on-orientat.patch"
2207 "rk3588-mnt-reform2/0063-thermal-rockchip-unify-struct-rockchip_tsadc_chip-fo.patch"
2208 "rk3588-mnt-reform2/0064-thermal-rockchip-shut-up-GRF-warning.patch"
2209 "rk3588-mnt-reform2/0065-thermal-rockchip-simplify-GRF-logic.patch"
2210 "rk3588-mnt-reform2/0067-PCI-dw-rockchip-Add-system-PM-support.patch"
2211 "rk3588-mnt-reform2/0068-drm-bridge-dw-hdmi-qp-Add-CEC-support.patch"
2212 "rk3588-mnt-reform2/0069-drm-bridge-dw-hdmi-qp-Fixup-timer-base-setup.patch"
2213 "rk3588-mnt-reform2/0070-drm-rockchip-dw_hdmi_qp-Improve-error-handling-with-.patch"
2214 "rk3588-mnt-reform2/0071-drm-rockchip-dw_hdmi_qp-Provide-CEC-IRQ-in-dw_hdmi_q.patch"
2215 "rk3588-mnt-reform2/0072-drm-rockchip-dw_hdmi_qp-Provide-ref-clock-rate-in-dw.patch"
2216 "rk3588-mnt-reform2/0073-arm64-defconfig-Enable-DW-HDMI-QP-CEC-support.patch"
2217 "rk3588-mnt-reform2/0075-phy-hdmi-Add-HDMI-2.1-FRL-configuration-options.patch"
2218 "rk3588-mnt-reform2/0079-phy-rockchip-samsung-hdptx-Use-usleep_range-instead-.patch"
2219 "rk3588-mnt-reform2/0080-phy-rockchip-samsung-hdptx-Fix-coding-style-alignmen.patch"
2220 "rk3588-mnt-reform2/0081-phy-rockchip-samsung-hdptx-Consistently-use-rk_-hdpt.patch"
2221 "rk3588-mnt-reform2/0082-phy-rockchip-samsung-hdptx-Enable-lane-output-in-com.patch"
2222 "rk3588-mnt-reform2/0083-phy-rockchip-samsung-hdptx-Cleanup-_cmn_init_seq-lis.patch"
2223 "rk3588-mnt-reform2/0084-phy-rockchip-samsung-hdptx-Compute-clk-rate-from-PLL.patch"
2224 "rk3588-mnt-reform2/0085-phy-rockchip-samsung-hdptx-Drop-hw_rate-driver-data.patch"
2225 "rk3588-mnt-reform2/0086-phy-rockchip-samsung-hdptx-Switch-to-driver-specific.patch"
2226 "rk3588-mnt-reform2/0087-phy-rockchip-samsung-hdptx-Extend-rk_hdptx_phy_verif.patch"
2227 "rk3588-mnt-reform2/0088-phy-rockchip-samsung-hdptx-Add-HDMI-2.1-FRL-support.patch"
2228 "rk3588-mnt-reform2/0089-drm-rockchip-vop2-Check-bpc-before-switching-DCLK-so.patch"
2229 "rk3588-mnt-reform2/0090-drm-bridge-dw-hdmi-qp-Handle-platform-supported-form.patch"
2230 "rk3588-mnt-reform2/0091-drm-rockchip-dw_hdmi_qp-Switch-to-phy_configure.patch"
2231 "rk3588-mnt-reform2/0092-drm-rockchip-dw_hdmi_qp-Use-bit-macros-for-RK3576-re.patch"
2232 "rk3588-mnt-reform2/0093-drm-rockchip-dw_hdmi_qp-Add-high-color-depth-support.patch"
2233 "rk3588-mnt-reform2/0094-DEBUG-phy-rockchip-samsung-hdptx-Add-verbose-logging.patch"
2234 "rk3588-mnt-reform2/0095-WIP-SCRAMB-drm-bridge-Add-detect_ctx-hook.patch"
2235 "rk3588-mnt-reform2/0096-WIP-SCRAMB-drm-bridge-connector-Switch-from-detect-t.patch"
2236 "rk3588-mnt-reform2/0097-WIP-SCRAMB-drm-bridge-dw-hdmi-qp-Add-high-TMDS-clock.patch"
2237 "rk3588-mnt-reform2/0098-WIP-YUV420-drm-rockchip-vop2-Add-YUV420-output-forma.patch"
2238 "rk3588-mnt-reform2/0099-WIP-YUV420-drm-rockchip-dw_hdmi_qp-Add-YUV420-output.patch"
2239 "rk3588-mnt-reform2/0100-WIP-FRL-dt-bindings-display-rockchip-Add-tmds-enable.patch"
2240 "rk3588-mnt-reform2/0101-WIP-FRL-drm-rockchip-dw_hdmi_qp-Fixup-usage-of-enabl.patch"
2241 "rk3588-mnt-reform2/0103-WIP-FRL-arm64-dts-rockchip-Assign-ACLK_VOP-to-750-MH.patch"
2242 "rk3588-mnt-reform2/0104-WIP-FRL-drm-connector-hdmi-Handle-FRL-in-hdmi_clock_.patch"
2243 "rk3588-mnt-reform2/0105-WIP-FRL-drm-bridge-dw-hdmi-qp-Add-HDMI-2.1-FRL-suppo.patch"
2244 "rk3588-mnt-reform2/0106-WIP-FRL-drm-rockchip-dw_hdmi_qp-Add-HDMI-2.1-FRL-sup.patch"
2245 "rk3588-mnt-reform2/0107-WIP-FRL-drm-rockchip-vop2-Add-HDMI-2.1-FRL-support.patch"
2246 "rk3588-mnt-reform2/0108-dt-bindings-phy-rockchip-usbdp-add-improved-ports-sc.patch"
2247 "rk3588-mnt-reform2/0114-media-dt-bindings-video-interfaces-add-defines-for-s.patch"
2248 "rk3588-mnt-reform2/0142-drm-bridge-dw-hdmi-qp-Fix-spurious-IRQ-on-resume.patch"
2249 "rk3588-mnt-reform2/2001-drm-bridge-dw-hdmi-qp-Return-0-in-audio-prepare-when.patch"
2250 "rk3588-mnt-reform2/2003-drm-bridge-synopsys-Do-not-warn-about-audio-params-c.patch"
2251 "rk3588-mnt-reform2/5200-drm-rockchip-Set-dma-mask-to-64-bit.patch"))))
2252 (add-after 'apply-reform-patches 'copy-reform-dts-files
2253 (lambda* (#:key inputs #:allow-other-keys)
2254 (for-each (lambda (dts)
2255 (copy-file (search-input-file inputs
2256 (string-append
2257 "/dts/" dts))
2258 (string-append "arch/arm64/boot/dts/"
2259 dts)))
2260 (list
2261 "amlogic/meson-g12b-bananapi-cm4-mnt-pocket-reform.dts"
2262 "freescale/fsl-ls1028a-mnt-reform2.dts"
2263 "freescale/imx8mp-mnt-pocket-reform.dts"
2264 "freescale/imx8mp-mnt-reform2.dts"
2265 "freescale/imx8mq-mnt-reform2-hdmi.dts"
2266 "rockchip/rk3588-mnt-pocket-reform.dts"
2267 "rockchip/rk3588-mnt-reform-next.dts"
2268 "rockchip/rk3588-mnt-reform2.dts"
2269 "rockchip/rk3588-mnt-reform2-dsi.dts"
2270 ))))
2271 (add-after 'apply-reform-patches 'adjust-makefiles-with-new-dtb
2272 (lambda _
2273 (substitute* "arch/arm64/boot/dts/amlogic/Makefile"
2274 (("meson-g12b-bananapi-cm4-mnt-reform2.dtb")
2275 "meson-g12b-bananapi-cm4-mnt-reform2.dtb
2276dtb-$(CONFIG_ARCH_MESON) += meson-g12b-bananapi-cm4-mnt-pocket-reform.dtb"))
2277 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2278 (("fsl-ls1028a-rdb.dtb")
2279 "fsl-ls1028a-rdb.dtb
2280dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-mnt-reform2.dtb"))
2281 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2282 (("imx8mq-mnt-reform2.dtb")
2283 "imx8mq-mnt-reform2.dtb
2284dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-reform2.dtb
2285dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-pocket-reform.dtb
2286dtb-$(CONFIG_ARCH_MXC) += imx8mq-mnt-reform2-hdmi.dtb"))
2287 (substitute* "arch/arm64/boot/dts/rockchip/Makefile"
2288 (("rk3588-mnt-reform2.dtb")
2289 "rk3588-mnt-reform2.dtb
2290dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform2-dsi.dtb
2291dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform-next.dtb
2292dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-pocket-reform.dtb")))))))))))
2293
2294(define-public linux-libre-arm64-mnt-reform linux-libre-arm64-mnt-reform-6.17)
2295
2296(define-public linux-libre-arm64-mnt-reform-6.12
2297 ;; Kernel for use on the MNT/Reform systems
2298 ;; https://mntre.com/reform.html
2299 (let ((base (make-linux-libre* linux-libre-6.12-version
2300 linux-libre-6.12-gnu-revision
2301 (source-with-patches linux-libre-6.12-source
2302 ;; Revert upstream patches
2303 ;; that conflict with
2304 ;; MNT/Reform patches
2305 (search-patches
2306 "linux-libre-arm64-mnt-reform-revert-vop2-display-modes.patch"
2307 "linux-libre-arm64-mnt-reform-revert-phy-rockchip-samsung.patch"
2308 "linux-libre-arm64-mnt-reform-revert-rk-samsung-hdptx.patch"))
2309 '("aarch64-linux")
2310 #:extra-version "arm64-mnt-reform"
2311 #:extra-options
2312 ;; https://source.mnt.re/reform/reform-debian-packages/-/blob/main/linux/config
2313 (append `(("CONFIG_DRM_LVDS_CODEC" . m)
2314 ("CONFIG_DRM_CDNS_MHDP8546" . m)
2315 ("CONFIG_DRM_CDNS_HDMI_CEC" . m)
2316 ("CONFIG_DRM_IMX_CDNS_MHDP" . m)
2317 ("CONFIG_DRM_IMX_DCSS" . m)
2318 ("CONFIG_PHY_FSL_IMX8MQ_HDPTX" . m)
2319 ("CONFIG_DRM_PANEL_LVDS" . m)
2320 ("CONFIG_I2C_IMX_LPI2C" . m)
2321 ("CONFIG_I2C_MUX_REG" . m)
2322 ("CONFIG_INTERCONNECT_IMX" . #true)
2323 ("CONFIG_INTERCONNECT_IMX8MQ" . #true)
2324 ("CONFIG_MFD_WM8994" . m)
2325 ("CONFIG_MUX_GPIO" . m)
2326 ("CONFIG_MUX_MMIO" . m)
2327 ("CONFIG_RTC_DRV_PCF8523" . m)
2328 ("CONFIG_USB_EHCI_FSL" . m)
2329 ("CONFIG_NO_HZ_IDLE" . #true)
2330 ("CONFIG_SND_SOC_FSL_MICFIL" . m)
2331 ("CONFIG_SND_IMX_SOC" . m)
2332 ("CONFIG_SND_SOC_FSL_ASOC_CARD" . m)
2333 ("CONFIG_SND_SOC_IMX_AUDMIX" . m)
2334 ("CONFIG_SND_SOC_IMX_HDMI" . m)
2335 ("CONFIG_INPUT_JOYSTICK" . #true)
2336 ("CONFIG_JOYSTICK_XPAD" . m)
2337 ("CONFIG_JOYSTICK_XPAD_FF" . #true)
2338 ("CONFIG_JOYSTICK_XPAD_LEDS" . #true)
2339 ("CONFIG_INTERCONNECT_IMX8MP" . #true)
2340 ("CONFIG_SND_SOC_FSL_ASRC" . #true)
2341 ("CONFIG_DRM_IMX_LCDIF" . #true)
2342 ("CONFIG_DRM_IMX8MP_DW_HDMI_BRIDGE" . #true)
2343 ("CONFIG_DRM_IMX8MP_HDMI_PVI" . #true)
2344 ("CONFIG_IMX8MM_THERMAL" . #true)
2345 ("CONFIG_IMX2_WDT" . #true)
2346 ("CONFIG_DRM_SAMSUNG_DSIM" . #true)
2347 ("CONFIG_PHY_FSL_SAMSUNG_HDMI_PHY" . #true)
2348 ("CONFIG_DRM" . #true)
2349 ("CONFIG_DRM_PANEL_MNT_POCKET_REFORM" . #true)
2350 ("CONFIG_IMX8M_BLK_CTRL" . #true)
2351 ("CONFIG_IMX_GPCV2_PM_DOMAINS" . #true)
2352 ("CONFIG_DRM_DISPLAY_CONNECTOR" . #true)
2353 ("CONFIG_DRM_FSL_LDB" . #true)
2354 ("CONFIG_BACKLIGHT_CLASS_DEVICE" . #true)
2355 ("CONFIG_BACKLIGHT_PWM" . #true)
2356 ("CONFIG_BACKLIGHT_GPIO" . #true)
2357 ("CONFIG_BACKLIGHT_LED" . #true)
2358 ("CONFIG_CPU_FREQ_GOV_PERFORMANCE" . #true)
2359 ("CONFIG_CPU_FREQ_GOV_POWERSAVE" . #true)
2360 ("CONFIG_CPU_FREQ_GOV_USERSPACE" . #true)
2361 ("CONFIG_CPU_FREQ_GOV_ONDEMAND" . #true)
2362 ("CONFIG_CPU_FREQ_GOV_CONSERVATIVE" . #true)
2363 ("CONFIG_CPU_FREQ_GOV_SCHEDUTIL" . #true)
2364 ("CONFIG_ARM_IMX_CPUFREQ_DT" . #true)
2365 ("CONFIG_ARM_IMX_BUS_DEVFREQ" . #true)
2366 ("CONFIG_IMX_IRQSTEER" . #true)
2367 ("CONFIG_PCI_MESON" . #true)
2368 ("CONFIG_DWMAC_MESON" . #true)
2369 ("CONFIG_MDIO_BUS_MUX_MESON_G12A" . #true)
2370 ("CONFIG_I2C_MESON" . #true)
2371 ("CONFIG_PWM_MESON" . #true)
2372 ("CONFIG_USB_DWC3_MESON_G12A" . #true)
2373 ("CONFIG_MMC_MESON_GX" . #true)
2374 ("CONFIG_MMC_MESON_MX_SDIO" . #true)
2375 ("CONFIG_MESON_DDR_PMU" . #true)
2376 ("CONFIG_RTW88_8822CS" . m)
2377 ("CONFIG_PWM_FSL_FTM" . #true)
2378 ("CONFIG_FSL_RCPM" . #true)
2379 ("CONFIG_ARM_ROCKCHIP_CPUFREQ" . m)
2380 ("CONFIG_DRM_PANTHOR" . m)
2381 ("CONFIG_NVMEM_ROCKCHIP_OTP" . #true)
2382 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX" . m)
2383 ("CONFIG_PHY_ROCKCHIP_USBDP" . m)
2384 ("CONFIG_ROCKCHIP_INNO_HDMI" . #true)
2385 ("CONFIG_ROCKCHIP_LVDS" . #true)
2386 ("CONFIG_ROCKCHIP_REGULATOR_COUPLER" . #true)
2387 ("CONFIG_SPI_ROCKCHIP" . #true)
2388 ("CONFIG_SPI_ROCKCHIP_SFC" . m)
2389 ("CONFIG_ARM_SCMI_CPUFREQ" . m)
2390 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_DCPHY" . m)
2391 ("CONFIG_VIDEO_ROCKCHIP_VDEC2" . m)
2392 ("CONFIG_ROCKCHIP_DW_HDMI_QP" . #true)
2393 ("CONFIG_ROCKCHIP_DW_MIPI_DSI" . #true)
2394 ;; Fixes https://codeberg.org/guix/guix/issues/101
2395 ("CONFIG_CRYPTO_USER_API_HASH" . #true)
2396 ("CONFIG_CRYPTO_USER_API_SKCIPHER" . #true)
2397 ("CONFIG_CRYPTO_USER_API_RNG" . #true)
2398 ("CONFIG_CRYPTO_USER_API_AEAD" . #true)
2399 ("CONFIG_KEY_DH_OPERATIONS" . #true)
2400 ;; nftables support
2401 ("CONFIG_NF_TABLES" . m)
2402 ("CONFIG_NF_TABLES_INET" . #true)
2403 ("CONFIG_NF_TABLES_NETDEV" . #true)
2404 ("CONFIG_NF_TABLES_IPV4" . #true)
2405 ("CONFIG_NF_TABLES_ARP" . #true)
2406 ("CONFIG_NF_TABLES_IPV6" . #true)
2407 ("CONFIG_NF_TABLES_BRIDGE" . m)
2408 ("CONFIG_NFT_NUMGEN" . m)
2409 ("CONFIG_NFT_CT" . m)
2410 ("CONFIG_NFT_FLOW_OFFLOAD" . m)
2411 ("CONFIG_NFT_CONNLIMIT" . m)
2412 ("CONFIG_NFT_LOG" . m)
2413 ("CONFIG_NFT_LIMIT" . m)
2414 ("CONFIG_NFT_MASQ" . m)
2415 ("CONFIG_NFT_REDIR" . m)
2416 ("CONFIG_NFT_NAT" . m)
2417 ("CONFIG_NFT_TUNNEL" . m)
2418 ("CONFIG_NFT_QUEUE" . m)
2419 ("CONFIG_NFT_QUOTA" . m)
2420 ("CONFIG_NFT_REJECT" . m)
2421 ("CONFIG_NFT_REJECT_INET" . m)
2422 ("CONFIG_NFT_COMPAT" . m)
2423 ("CONFIG_NFT_HASH" . m)
2424 ("CONFIG_NFT_FIB" . m)
2425 ("CONFIG_NFT_FIB_INET" . m)
2426 ("CONFIG_NFT_XFRM" . m)
2427 ("CONFIG_NFT_SOCKET" . m)
2428 ("CONFIG_NFT_OSF" . m)
2429 ("CONFIG_NFT_TPROXY" . m)
2430 ("CONFIG_NFT_SYNPROXY" . m)
2431 ("CONFIG_NFT_DUP_NETDEV" . m)
2432 ("CONFIG_NFT_FWD_NETDEV" . m)
2433 ("CONFIG_NFT_FIB_NETDEV" . m)
2434 ("CONFIG_NFT_REJECT_NETDEV" . m)
2435 ("CONFIG_NFT_REJECT_IPV4" . m)
2436 ("CONFIG_NFT_DUP_IPV4" . m)
2437 ("CONFIG_NFT_FIB_IPV4" . m)
2438 ("CONFIG_NFT_COMPAT_ARP" . m)
2439 ("CONFIG_NFT_REJECT_IPV6" . m)
2440 ("CONFIG_NFT_DUP_IPV6" . m)
2441 ("CONFIG_NFT_FIB_IPV6" . m)
2442 ("CONFIG_NFT_BRIDGE_META" . m)
2443 ("CONFIG_NFT_BRIDGE_REJECT" . m)
2444 ;; Provide support for USB tethering
2445 ("CONFIG_USB_NET_CDC_EEM" . m)
2446 ("CONFIG_USB_NET_RNDIS_HOST" . m)
2447 ("CONFIG_USB_WDM" . m)
2448 ("CONFIG_USB_GADGET" . m)
2449 ("CONFIG_USB_ETH" . m)
2450 ("CONFIG_USB_ETH_RNDIS" . m)
2451 ("CONFIG_USB_ETH_EEM" . m)
2452 ("CONFIG_USB_G_NCM" . m)
2453 ;; Provide support for wireguard
2454 ("CONFIG_WIREGUARD" . m)
2455 ;; Provide support for ath9k wireless
2456 ("CONFIG_ATH9K" . m)
2457 ("CONFIG_ATH9K_HTC" . m))
2458 (default-extra-linux-options
2459 linux-libre-6.12-version)))))
2460 (package
2461 (inherit base)
2462 (inputs (list reform-debian-packages-for-6.12))
2463 (synopsis (string-append (package-synopsis base)
2464 " for MNT/Reform systems"))
2465 (description (string-append (package-description base)
2466 " Configuration options and patches have been applied for use with MNT/Reform systems."))
2467 (arguments
2468 (substitute-keyword-arguments (package-arguments base)
2469 ((#:phases phases)
2470 #~(modify-phases #$phases
2471 (add-after 'unpack 'apply-reform-patches
2472 (lambda* (#:key inputs #:allow-other-keys)
2473 (for-each (lambda (patch)
2474 (invoke "patch" "-p1" "-i"
2475 (search-input-file inputs
2476 (string-append
2477 "patches6.12/" patch))))
2478 (list
2479 "imx8mp-mnt-pocket-reform/2ghz/0001-imx8mp-2ghz-clk.patch"
2480 "imx8mp-mnt-pocket-reform/2ghz/0002-imx8mp-2ghz-opp.patch"
2481 "imx8mp-mnt-pocket-reform/audio/0000-revert-crashy-audiomix-pm-support.patch"
2482 "imx8mp-mnt-pocket-reform/mmc-sdio/0001-sdhci-add-no-sd-uhs-sdr104-devicetree-property.patch"
2483 "imx8mp-mnt-pocket-reform/mmc-sdio/0002-During-the-card-init-the-host-side-sometimes-may-nee.patch"
2484 "imx8mp-mnt-pocket-reform/mmc-sdio/0003-USDHC-IP-has-one-limitation-the-tuning-circuit-can-t.patch"
2485 "imx8mp-mnt-pocket-reform/pocket-panel/0001-v5-add-multi-display-panel-driver.patch"
2486 "imx8mp-mnt-reform2/0001-sn65dsi86-use-hs-clock-of-samsung-dsim-host-directly.patch"
2487 "imx8mp-mnt-reform2/0002-lcdif-dont-exceed-desired-pixel-clock.patch"
2488 "imx8mq-mnt-reform2/0001-nwl-dsi-fixup-mode-only-for-LCDIF-input-not-DCSS.patch"
2489 "imx8mq-mnt-reform2/0002-pci-imx6-add-support-for-internal-refclk-imx8mq.patch"
2490 "imx8mq-mnt-reform2/0003-lcdif-fix-pcie-interference.patch"
2491 "imx8mq-mnt-reform2/0004-mnt4002-imx-gpcv2-wake-smccc.patch.patch"
2492 ;; Does not apply, needs further investigation
2493 ;; "imx8mq-mnt-reform2/v19_20241126_sandor_yu_initial_support_cadence_mhdp8501_hdmi_dp_for_i_mx8mq.mbx"
2494 "ls1028a-mnt-reform2/0000-dtsi-add-hdptx.patch"
2495 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0001-a311d-viu-fifo-lines-config.patch"
2496 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0002-a311d-viu-fifo-lines-config-header.patch"
2497 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0003-tlv320aic31xx-add-1228800hz-support.patch"
2498 "meson-g12b-bananapi-cm4-mnt-reform2/0001-Revert-drm-bridge-synopsys-dw-mipi-dsi-enable-EoTp-b.patch"
2499 "meson-g12b-bananapi-cm4-mnt-reform2/0011-dw-mipi-dsi-phy-stop-wait-time.patch"
2500 "meson-g12b-bananapi-cm4-mnt-reform2/0012-innolux-n125hce-gn1-timing-tweaks.patch"
2501 "meson-g12b-bananapi-cm4-mnt-reform2/0013-meson-viu-hold-fifo-lines.patch"
2502 "meson-g12b-bananapi-cm4-mnt-reform2/0014-meson-venc-sync.patch.patch"
2503 "meson-g12b-bananapi-cm4-mnt-reform2/0015-meson-dw-mipi-dsi-sync-invert.patch"
2504 "meson-g12b-bananapi-cm4-mnt-reform2/0016-sn65dsi86-burst-mode-support.patch"
2505 "meson-g12b-bananapi-cm4-mnt-reform2/0018-sn65dsi86-never-turn-off.patch"
2506 "meson-g12b-bananapi-cm4-mnt-reform2/0020-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch"
2507 "meson-g12b-bananapi-cm4-mnt-reform2/0021-HACK-of-partial-revert-of-fdt.c-changes.patch"
2508 "meson-g12b-bananapi-cm4-mnt-reform2/0022-add-bt-and-eth-resets.patch"
2509 "meson-g12b-bananapi-cm4-mnt-reform2/0023-sdio-pullups.patch"
2510 "meson-g12b-bananapi-cm4-mnt-reform2/0024-sdio-improve-wifi-speed.patch"
2511 "rk3588-mnt-reform2/0001-regulator-Add-of_regulator_get_optional-for-pure-DT-.patch"
2512 "rk3588-mnt-reform2/0001-scripts-package-builddeb-allow-hooks-also-in-usr-sha.patch"
2513 "rk3588-mnt-reform2/0002-regulator-Add-devres-version-of-of_regulator_get_opt.patch"
2514 "rk3588-mnt-reform2/0004-arm64-dts-rockchip-rk3588-rock5b-add-USB-C-support.patch"
2515 "rk3588-mnt-reform2/0005-math.h-add-DIV_ROUND_UP_NO_OVERFLOW.patch"
2516 "rk3588-mnt-reform2/0006-clk-divider-Fix-divisor-masking-on-64-bit-platforms.patch"
2517 "rk3588-mnt-reform2/0007-clk-composite-replace-open-coded-abs_diff.patch"
2518 "rk3588-mnt-reform2/0008-clk-rockchip-support-clocks-registered-late.patch"
2519 "rk3588-mnt-reform2/0009-clk-rockchip-rk3588-register-GATE_LINK-later.patch"
2520 "rk3588-mnt-reform2/0010-clk-rockchip-expose-rockchip_clk_set_lookup.patch"
2521 "rk3588-mnt-reform2/0011-clk-rockchip-implement-linked-gate-clock-support.patch"
2522 "rk3588-mnt-reform2/0012-clk-rockchip-rk3588-drop-RK3588_LINKED_CLK.patch"
2523 "rk3588-mnt-reform2/0013-arm64-dts-rockchip-rk3588-evb1-add-bluetooth-rfkill.patch"
2524 "rk3588-mnt-reform2/0014-arm64-dts-rockchip-rk3588-evb1-improve-PCIe-ethernet.patch"
2525 "rk3588-mnt-reform2/0015-arm64-dts-rockchip-Slow-down-EMMC-a-bit-to-keep-IO-s.patch"
2526 "rk3588-mnt-reform2/0016-vop2-Add-clock-resets-support.patch"
2527 "rk3588-mnt-reform2/0017-arm64-dts-rockchip-Add-VOP-clock-resets-for-rk3588s.patch"
2528 "rk3588-mnt-reform2/0018-dt-bindings-display-vop2-Add-VP-clock-resets.patch"
2529 "rk3588-mnt-reform2/0019-media-v4l2-ctrls-core-Set-frame_mbs_only_flag-by-def.patch"
2530 "rk3588-mnt-reform2/0020-media-rockchip-Move-H264-CABAC-table-to-header-file.patch"
2531 "rk3588-mnt-reform2/0021-media-rockchip-Introduce-the-rkvdec2-driver.patch"
2532 "rk3588-mnt-reform2/0022-media-dt-bindings-rockchip-Document-RK3588-Video-Dec.patch"
2533 "rk3588-mnt-reform2/0023-arm64-dts-rockchip-Add-rkvdec2-Video-Decoder-on-rk35.patch"
2534 "rk3588-mnt-reform2/0024-arm64-defconfig-enable-Rockchip-RK3588-video-decoder.patch"
2535 "rk3588-mnt-reform2/0025-mfd-rk8xx-Fix-shutdown-handler.patch"
2536 "rk3588-mnt-reform2/0026-WIP-phy-phy-rockchip-samsung-hdptx-Add-FRL-EARC-supp.patch"
2537 "rk3588-mnt-reform2/0027-TESTING-phy-phy-rockchip-samsung-hdptx-Add-verbose-l.patch"
2538 "rk3588-mnt-reform2/0028-WIP-dt-bindings-display-rockchip-drm-Add-optional-cl.patch"
2539 "rk3588-mnt-reform2/0029-WIP-drm-rockchip-vop2-Improve-display-modes-handling.patch"
2540 "rk3588-mnt-reform2/0030-arm64-dts-rockchip-Add-HDMI0-bridge-to-rk3588.patch"
2541 "rk3588-mnt-reform2/0031-arm64-dts-rockchip-Enable-HDMI0-on-rock-5b.patch"
2542 "rk3588-mnt-reform2/0032-arm64-dts-rockchip-Enable-HDMI0-on-rk3588-evb1.patch"
2543 "rk3588-mnt-reform2/0033-WIP-arm64-dts-rockchip-Enable-HDMI0-PHY-clk-provider.patch"
2544 "rk3588-mnt-reform2/0034-WIP-arm64-dts-rockchip-Make-use-of-HDMI0-PHY-PLL-on-.patch"
2545 "rk3588-mnt-reform2/0035-WIP-arm64-dts-rockchip-Make-use-of-HDMI0-PHY-PLL-on-.patch"
2546 "rk3588-mnt-reform2/0036-dt-bindings-display-bridge-Add-schema-for-Synopsys-D.patch"
2547 "rk3588-mnt-reform2/0037-dt-bindings-display-rockchip-Add-schema-for-RK3588-H.patch"
2548 "rk3588-mnt-reform2/0038-drm-bridge-synopsys-Add-DW-HDMI-QP-TX-controller-dri.patch"
2549 "rk3588-mnt-reform2/0039-drm-rockchip-Add-basic-RK3588-HDMI-output-support.patch"
2550 "rk3588-mnt-reform2/0040-arm64-defconfig-Enable-Rockchip-extensions-for-Synop.patch"
2551 "rk3588-mnt-reform2/0041-MAINTAINERS-Add-entry-for-Synopsys-DesignWare-HDMI-R.patch"
2552 "rk3588-mnt-reform2/0042-dt-bindings-media-Document-bindings-for-HDMI-RX-Cont.patch"
2553 "rk3588-mnt-reform2/0043-arm64-dts-rockchip-Add-device-tree-support-for-HDMI-.patch"
2554 "rk3588-mnt-reform2/0044-media-platform-synopsys-Add-support-for-HDMI-input-d.patch"
2555 "rk3588-mnt-reform2/0045-arm64-defconfig-Enable-Synopsys-HDMI-receiver.patch"
2556 "rk3588-mnt-reform2/0046-arm64-dts-rockchip-Enable-HDMI-receiver-on-rock-5b.patch"
2557 "rk3588-mnt-reform2/0047-arm64-dts-rockchip-Enable-HDMI-receiver-on-RK3588-EV.patch"
2558 "rk3588-mnt-reform2/0048-arm64-defconfig-Enable-default-EDID-for-Synopsys-HDM.patch"
2559 "rk3588-mnt-reform2/0049-regulator-Add-devm_-of_regulator_get.patch"
2560 "rk3588-mnt-reform2/0050-pmdomain-rockchip-cleanup-mutex-handling-in-rockchip.patch"
2561 "rk3588-mnt-reform2/0051-pmdomain-rockchip-forward-rockchip_do_pmu_set_power_.patch"
2562 "rk3588-mnt-reform2/0052-pmdomain-rockchip-reduce-indentation-in-rockchip_pd_.patch"
2563 "rk3588-mnt-reform2/0053-dt-bindings-power-rockchip-add-regulator-support.patch"
2564 "rk3588-mnt-reform2/0054-pmdomain-rockchip-add-regulator-support.patch"
2565 "rk3588-mnt-reform2/0055-arm64-dts-rockchip-Add-GPU-power-domain-regulator-de.patch"
2566 "rk3588-mnt-reform2/0056-dt-bindings-net-wireless-brcm4329-fmac-add-pci14e4-4.patch"
2567 "rk3588-mnt-reform2/0057-dt-bindings-net-wireless-brcm4329-fmac-add-clock-des.patch"
2568 "rk3588-mnt-reform2/0058-wifi-brcmfmac-Add-optional-lpo-clock-enable-support.patch"
2569 ;; does not apply cleanly due to DEBLOBBING
2570 ;; "rk3588-mnt-reform2/0059-wifi-brcmfmac-add-flag-for-random-seed-during-firmwa.patch"
2571 "rk3588-mnt-reform2/0060-arm64-dts-rockchip-rk3588-evb1-add-WLAN-controller.patch"
2572 "rk3588-mnt-reform2/0061-arm64-dts-rockchip-add-and-enable-gpu-node-for-Radxa.patch"
2573 "rk3588-mnt-reform2/0062-arm64-dts-rockchip-Enable-HDMI0-on-rock-5a.patch"
2574 "rk3588-mnt-reform2/0100-rk3588-dtsi-add-hdmi1-controller.patch"
2575 "rk3588-mnt-reform2/0102-drm-panthor-Actually-suspend-IRQs-in-the-unplug-path.patch"
2576 "rk3588-mnt-reform2/3001-display-rockchip-add-schema-for-rk3588-hdmi-tx.patch"
2577 "rk3588-mnt-reform2/4000-mnt-rk3588-dual-hdmi-qp-rockchip.patch"
2578 "rk3588-mnt-reform2/4001-mnt-rk3588-dual-hdmi-vop2-pll.patch"
2579 "rk3588-mnt-reform2/5001-rk3588-dsi2-driver.patch"
2580 "rk3588-mnt-reform2/5002-rk3588-dsi-dts-nodes.patch"
2581 "rk3588-mnt-reform2/5100-modernize-hdmi1-in-dtsi.patch"
2582 "rk3588-mnt-reform2/5110-hdptx-crash-workaround.patch"
2583 "rk3588-mnt-reform2/5200-drm-rockchip-Set-dma-mask-to-64-bit.patch"))))
2584 (add-after 'apply-reform-patches 'copy-reform-dts-files
2585 (lambda* (#:key inputs #:allow-other-keys)
2586 (for-each (lambda (dts)
2587 (copy-file (search-input-file inputs
2588 (string-append
2589 "/dts/" dts))
2590 (string-append "arch/arm64/boot/dts/"
2591 dts)))
2592 (list
2593 "amlogic/meson-g12b-bananapi-cm4-mnt-pocket-reform.dts"
2594 "amlogic/meson-g12b-bananapi-cm4-mnt-reform2.dts"
2595 "freescale/fsl-ls1028a-mnt-reform2.dts"
2596 "freescale/imx8mp-mnt-pocket-reform.dts"
2597 "freescale/imx8mp-mnt-reform2.dts"
2598 "freescale/imx8mq-mnt-reform2-hdmi.dts"
2599 "freescale/imx8mq-mnt-reform2.dts"
2600 "rockchip/rk3588-mnt-pocket-reform.dts"
2601 "rockchip/rk3588-mnt-reform-next.dts"
2602 "rockchip/rk3588-mnt-reform2.dts"))))
2603 (add-after 'apply-reform-patches 'adjust-makefiles-with-new-dtb
2604 (lambda _
2605 (substitute* "arch/arm64/boot/dts/amlogic/Makefile"
2606 (("meson-g12b-bananapi-cm4-mnt-reform2.dtb")
2607 "meson-g12b-bananapi-cm4-mnt-reform2.dtb
2608dtb-$(CONFIG_ARCH_MESON) += meson-g12b-bananapi-cm4-mnt-pocket-reform.dtb"))
2609 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2610 (("fsl-ls1028a-rdb.dtb")
2611 "fsl-ls1028a-rdb.dtb
2612dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-mnt-reform2.dtb"))
2613 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2614 (("imx8mq-mnt-reform2.dtb")
2615 "imx8mq-mnt-reform2.dtb
2616dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-reform2.dtb
2617dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-pocket-reform.dtb
2618dtb-$(CONFIG_ARCH_MXC) += imx8mq-mnt-reform2-hdmi.dtb"))
2619 (substitute* "arch/arm64/boot/dts/rockchip/Makefile"
2620 (("rk3588-rock-5b.dtb")
2621 "rk3588-rock-5b.dtb
2622dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform2.dtb
2623dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform-next.dtb
2624dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-pocket-reform.dtb")))))))))))
2625
2626(define-public linux-libre-riscv64-generic
2627 (make-linux-libre* linux-libre-version
2628 linux-libre-gnu-revision
2629 linux-libre-source
2630 '("riscv64-linux")
2631 #:extra-version "riscv64-generic"
2632 #:extra-options
2633 (append
2634 ;; required `guix system vm'
2635 `(("CONFIG_USB_HID" . m)
2636 ("CONFIG_HID_GEMBIRD" . m)
2637 ("CONFIG_AHCI_DWC" . m)
2638 ("CONFIG_SATA_AHCI" . m)
2639 ("CONFIG_CRYPTO_SERPENT" . m)
2640 ("CONFIG_CRYPTO_WP512" . m)
2641 ("CONFIG_USB_UAS" . m)
2642 ("CONFIG_USB_STORAGE" . m)
2643 ("CONFIG_HID_GENERIC" . m)
2644 ("CONFIG_DRM_CIRRUS_QEMU" . m)
2645 ("CONFIG_HW_RANDOM_VIRTIO" . m)
2646 ("CONFIG_VIRTIO_CONSOLE" . m)
2647 ("CONFIG_CRYPTO_XTS" . m))
2648 (default-extra-linux-options linux-libre-version))))
2649
2650(define-public linux-libre-mips64el-fuloong2e
2651 (make-linux-libre* linux-libre-version
2652 linux-libre-gnu-revision
2653 linux-libre-source
2654 '("mips64el-linux")
2655 #:defconfig "fuloong2e_defconfig"
2656 #:extra-version "mips64el-fuloong2e"
2657 #:extra-options
2658 (append
2659 `(("CONFIG_OVERLAY_FS" . m))
2660 (default-extra-linux-options linux-libre-version))))
2661
2662(define-deprecated-package linux-libre-with-bpf
2663 linux-libre)
2664
2665
2666;;;
2667;;; Linux kernel modules.
2668;;;
2669
2670(define-public acpi-call-linux-module
2671 (package
2672 (name "acpi-call-linux-module")
2673 (version "1.2.2")
2674 (source
2675 (origin
2676 (method git-fetch)
2677 (uri (git-reference
2678 (url "https://github.com/nix-community/acpi_call")
2679 (commit (string-append "v" version))))
2680 (file-name (git-file-name name version))
2681 (sha256
2682 (base32 "09ljx0jl987753r2kjqj5kxms95bijw0xn14kf82ryn38ck5c8cf"))))
2683 (build-system linux-module-build-system)
2684 (arguments
2685 (list #:tests? #f ; no tests
2686 #:phases
2687 #~(modify-phases %standard-phases
2688 (add-before 'install 'patch-shebangs-harder
2689 ;; The (only) shebangs in examples/ don't justify a reference.
2690 ;; However, do substitute a slightly more portable one.
2691 (lambda _
2692 (substitute* (find-files "examples" ".")
2693 (("^(#! *)/[^ ]*/" _ shebang)
2694 (string-append shebang "/usr/bin/env ")))))
2695 (add-after 'install 'install-documentation
2696 (lambda _
2697 (let* ((doc (string-append #$output "/share/doc/"
2698 #$name "-" #$version)))
2699 (for-each (lambda (file)
2700 (let ((target (string-append doc "/" file)))
2701 (mkdir-p (dirname target))
2702 (copy-recursively file target)))
2703 (list "README.md" "examples"))))))))
2704 (home-page "https://github.com/nix-community/acpi_call")
2705 (synopsis "Linux kernel module to perform ACPI method calls")
2706 (description
2707 "This simple Linux kernel module allows calls from user space to any
2708@acronym{ACPI, Advanced Configuration and Power Interface} method provided by
2709your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
2710any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
2711and @code{ACPI_BUFFER}.
2712
2713It grants direct and undocumented access to your hardware that may cause damage
2714and should be used with caution, especially on untested models.")
2715 (license license:gpl3+))) ; see README.md (no licence headers)
2716
2717(define-public corefreq
2718 (package
2719 (name "corefreq")
2720 (version "1.98.4")
2721 (source
2722 (origin
2723 (method git-fetch)
2724 (uri (git-reference
2725 (url "https://github.com/cyring/CoreFreq")
2726 (commit version)))
2727 (file-name (git-file-name name version))
2728 (sha256
2729 (base32 "0mxp5h23y09674syaj5gpdifr53zvgjv7g7hargwg6897883qfln"))))
2730 ;; The upstream Makefile is now such a proprietary mess that standard builds
2731 ;; as performed by our linux-module-build-system are more or less impossible
2732 ;; without heavy patching. However, we still keep it as the main build
2733 ;; system because lifting out LINUX-MODULE-BUILDER would be even messier.
2734 (build-system linux-module-build-system)
2735 (outputs (list "out" "linux-module"))
2736 (arguments
2737 (list #:imported-modules `((guix build gnu-build-system)
2738 ,@%linux-module-build-system-modules)
2739 #:modules `((guix build linux-module-build-system)
2740 ((guix build gnu-build-system) #:prefix gnu:)
2741 (guix build utils))
2742 #:make-flags
2743 #~(list (string-append "CC=" #$(cc-for-target))
2744 "OPTIM_LVL=3"
2745 (string-append "PREFIX=" #$output))
2746 #:tests? #f ;no test suite
2747 #:source-directory "../build" ;must contain modules.order
2748 #:phases
2749 #~(modify-phases %standard-phases
2750 (add-after 'unpack 'patch-Makefile
2751 (lambda* (#:key inputs #:allow-other-keys)
2752 (let ((dir (search-input-directory
2753 inputs "lib/modules/build")))
2754 (substitute* "Makefile"
2755 (("^(KERNELREL \\?= ).*" _ =)
2756 (string-append = (dirname dir) "\n"))
2757 (("^(KERNELDIR \\?= ).*" _ =)
2758 (string-append = dir "\n"))
2759 (("^([[:space:]]+)(.* modules_install.*)"
2760 _ indent command)
2761 (string-append indent "@echo skipping " command))))))
2762 (add-before 'build 'prepare
2763 (lambda* (#:key source-directory make-flags #:allow-other-keys)
2764 ;; Lazily fix another mismatch between what the kernel module
2765 ;; build system expects and what this package provides.
2766 (symlink "source/build" source-directory) ;$(BUILD)
2767 ;; Set up symbolic links inside $(BUILD), for some reason.
2768 (apply invoke "make" "prepare" make-flags)))
2769 (replace 'build (assoc-ref gnu:%standard-phases 'build))
2770 (add-before 'install 'resolve-symlink
2771 ;; The build system silently fails to install from a symlink.
2772 (lambda _
2773 (delete-file "../build")
2774 (copy-recursively "build" "../build")))
2775 (add-before 'install 'create-output
2776 (lambda _
2777 ;; Avoid installing the corefreq binary as …/bin.
2778 (mkdir-p (string-append #$output "/bin"))))
2779 (add-after 'install 'gnu:install
2780 (assoc-ref gnu:%standard-phases 'install))
2781 (add-after 'install 'separate-module
2782 (lambda* (#:key outputs #:allow-other-keys)
2783 ;; Adding INSTALL_MOD_PATH= to #:make-flags would still create an
2784 ;; empty <out>/lib/modules directory, so just do it all by hand.
2785 (let* ((output (assoc-ref outputs "out"))
2786 (module (assoc-ref outputs "linux-module")))
2787 (mkdir-p module)
2788 (rename-file (string-append output "/lib")
2789 (string-append module "/lib")))))
2790 (add-after 'install 'install-README
2791 ;; There is no proper documentation. Provide something.
2792 (lambda* (#:key outputs #:allow-other-keys)
2793 (let* ((out (assoc-ref outputs "out"))
2794 (doc (string-append out "/share/doc/"
2795 #$name "-" #$version)))
2796 (install-file "README.md" doc)))))))
2797 (home-page "https://github.com/cyring/CoreFreq")
2798 (synopsis
2799 "Measure performance data & tweak low-level settings on x86-64 CPUs")
2800 (description
2801 "CoreFreq is a CPU monitor that reports low-level processor settings and
2802performance data with notably high precision by using a loadable Linux kernel
2803module. Unlike most similar tools, it can be used to modify some settings if
2804supported by the hardware and at your own risk. It's designed for 64-bit x86
2805Intel processors (Atom, Core2, Nehalem, SandyBridge, and newer) and compatible
2806architectures like AMD@tie{}Zen and Hygon@tie{}Dhyana.
2807
2808Supported processor features include:
2809@enumerate
2810@item time spent in C-states, including C1/C3 Auto- and UnDemotion;
2811@item core temperatures, voltage, and tweaking thermal limits;
2812@item core frequencies, ratios, and base clock rate;
2813@item enabling, disabling, and testing SpeedStep (EIST), Turbo Boost, and
2814Hyper-Threading or SMT;
2815@item enabling or disabling data cache prefetching;
2816@item kernel assembly code to keep as near as possible readings of performance
2817counters such as the @acronym{TSC, Time Stamp Counter}, @acronym{UCC, Unhalted
2818Core Cycles}, and @acronym{URC, Unhalted Reference Cycles};
2819@item the number of instructions per cycle or second (IPS, IPC, and CPI);
2820@item memory controller geometry and RAM timings;
2821@item running processes' CPU affinity.
2822@end enumerate
2823
2824This package provides the @command{corefreqd} data collection daemon, the
2825@command{corefreq-cli} client to visualise and control it in real time, and the
2826@code{corefreqk} kernel module in its own separate output. Read the included
2827@file{README.md} before loading it.")
2828 (supported-systems (list "x86_64-linux"))
2829 (license license:gpl2)))
2830
2831(define-public librem-ec-acpi-linux-module
2832 (package
2833 (name "librem-ec-acpi-linux-module")
2834 (version "0.9.2")
2835 (source
2836 (origin
2837 (method git-fetch)
2838 (uri (git-reference
2839 (url "https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms")
2840 (commit (string-append "v" version))))
2841 (file-name (git-file-name name version))
2842 (sha256
2843 (base32 "0m8hamf0550083jnk5q4hv20l8lfiardnkxbib4hhvqghpzzbxl0"))))
2844 (build-system linux-module-build-system)
2845 (arguments
2846 (list #:tests? #f)) ; no test suite
2847 (home-page "https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms")
2848 (synopsis "Linux kernel module to control the Librem Embedded Controller")
2849 (description
2850 "This is the Linux kernel @acronym{ACPI, Advanced Configuration and Power
2851Interface} platform driver for the @acronym{EC, Embedded Controller} firmware
2852on Purism Librem laptop computers. It allows user-space control over the
2853battery charging thresholds, keyboard backlight, fans and thermal monitors,
2854and the notification, WiFi, and Bluetooth LED.")
2855 (license license:gpl2)))
2856
2857(define-public tuxedo-keyboard
2858 (package
2859 (name "tuxedo-keyboard")
2860 (version "4.15.4")
2861 (source
2862 (origin
2863 (method git-fetch)
2864 (uri (git-reference
2865 (url "https://gitlab.com/tuxedocomputers/development/packages/tuxedo-drivers.git")
2866 (commit (string-append "v" version))))
2867 (file-name (git-file-name name version))
2868 (sha256
2869 (base32 "0mimgcbp57gp3smd439g8040sl80qqnfzmh2vhs2qv1kwyxs75sq"))))
2870 (build-system linux-module-build-system)
2871 (arguments
2872 (list #:tests? #f)) ; no test suite
2873 ;; This package fails to build on aarch64, and the manufacturer only sells
2874 ;; machines based on Intel-compatible processors. For more information, see
2875 ;; <https://codeberg.org/guix/guix/pulls/1795>.
2876 (supported-systems '("i686-linux" "x86_64-linux"))
2877 (home-page "https://gitlab.com/tuxedocomputers/development/packages/tuxedo-drivers")
2878 (synopsis "Linux kernel modules to control keyboard on most Tuxedo computers")
2879 (description
2880 "This package provides the @code{tuxedo_keyboard}, @code{tuxedo_io},
2881@code{clevo_wmi} @acronym{WMI, Windows Management Engine} and the
2882@code{clevo_acpi} @acronym{ACPI, Advanced Configuration and Power Interface}
2883kernel modules to control the keyboard on most Tuxedo computers. The @code{tuxedo_io}
2884module is also needed for the @code{tuxedo-control-center} (short tcc) package.")
2885 (license license:gpl2+)))
2886
2887(define-public evdi
2888 (package
2889 (name "evdi")
2890 (version "1.14.8") ;inherited by libevdi
2891 (source
2892 (origin
2893 (method git-fetch)
2894 (uri (git-reference
2895 (url "https://github.com/DisplayLink/evdi")
2896 (commit (string-append "v" version))))
2897 (file-name (git-file-name name version))
2898 (sha256
2899 (base32 "18n8kk4gbbj252a2dqb7mbpscfb437x42flh1fsl4g5c8brczc77"))))
2900 (build-system linux-module-build-system)
2901 (arguments
2902 (list #:tests? #f ;no test suite
2903 #:phases #~(modify-phases %standard-phases
2904 (add-after 'unpack 'chdir
2905 (lambda _
2906 (chdir "module"))))))
2907 (home-page "https://github.com/DisplayLink/evdi")
2908 (synopsis
2909 "@acronym{EVDI, Extensible Virtual Display Interface} Linux kernel module")
2910 (description
2911 "The @acronym{EVDI, Extensible Virtual Display Interface} is a Linux kernel
2912module that enables management of multiple screens, allowing user-space programs
2913to take control over what happens with the image. It is essentially a virtual
2914display for which applications using the @code{libevdi} library can add, remove,
2915and receive screen updates.
2916
2917The EVDI driver uses the standard Linux @acronym{DRM, Direct Rendering Manager}.
2918Its displays can be controlled by standard tools such as @command{xrandr} and
2919display settings applets in graphical environments")
2920 (license license:gpl2)))
2921
2922(define-public libevdi
2923 (package
2924 (inherit evdi)
2925 (name "libevdi")
2926 (build-system gnu-build-system)
2927 (arguments
2928 (list #:tests? #f ;no test suite
2929 #:make-flags
2930 #~(list (string-append "CC=" #$(cc-for-target)))
2931 #:phases #~(modify-phases %standard-phases
2932 (delete 'configure)
2933 (add-after 'unpack 'chdir
2934 (lambda _
2935 (chdir "library")))
2936 (replace 'install
2937 (lambda* _
2938 (let* ((lib (string-append #$output "/lib")))
2939 (mkdir-p lib)
2940 (install-file "libevdi.so" lib)))))))
2941 (inputs (list libdrm))
2942 (native-inputs (list pkg-config))
2943 (synopsis
2944 "@acronym{EVDI, Extensible Virtual Display Interface} user-space library")
2945 (description
2946 "Libevdi is a library that gives applications easy access to
2947@acronym{EVDI, Extensible Virtual Display Interface} devices provided by the
2948@code{evdi} driver package.")
2949 (license license:lgpl2.1)))
2950
2951(define-public ec
2952 (package
2953 (name "ec")
2954 (version (package-version linux-libre))
2955 (source (package-source linux-libre))
2956 (build-system gnu-build-system)
2957 (arguments
2958 (list #:make-flags #~(list (string-append "sbindir="
2959 #$output "/sbin")
2960 "INSTALL=install" "STRIPCMD=true")
2961 #:phases #~(modify-phases %standard-phases
2962 (add-after 'unpack 'enter-subdirectory
2963 (lambda _
2964 (chdir "tools/power/acpi/tools/ec")))
2965 (delete 'configure)) ;no configure script
2966 #:tests? #f)) ;no tests
2967 (home-page (package-home-page linux-libre))
2968 (synopsis
2969 "Utility for reading or writing @acronym{EC, Embedded Controller} registers")
2970 (description
2971 "This utility can read or write specific registers or all the available
2972registers of the @acronym{EC, Embedded Controller} supported by the
2973@code{ec_sys} Linux driver.")
2974 (license license:gpl2)))
2975
2976(define-public lkrg
2977 (package
2978 (name "lkrg")
2979 (version "0.9.7")
2980 (source (origin
2981 (method git-fetch)
2982 (uri (git-reference
2983 (url "https://github.com/lkrg-org/lkrg")
2984 (commit (string-append "v" version))))
2985 (file-name (git-file-name name version))
2986 (sha256
2987 (base32
2988 "0k0z9caj48nqjwk3bapgfcdzi1lkizxcjj4r1dvkvwsk38mbk1c4"))))
2989 (build-system linux-module-build-system)
2990 (arguments
2991 (list #:linux linux-libre
2992 #:tests? #f
2993 #:make-flags #~(list (string-append "CC="
2994 #$(cc-for-target))
2995 (string-append "SYSSRC="
2996 (assoc-ref %build-inputs
2997 "linux-module-builder")
2998 "/lib/modules/build"))))
2999 (inputs (list bash-minimal))
3000 (home-page "https://lkrg.org/")
3001 (synopsis "Linux Kernel Runtime Guard")
3002 (description
3003 "This package performs runtime integrity checking of the Linux kernel and
3004detection of security vulnerability exploits against the kernel.")
3005 (license license:gpl2)))
3006
3007(define-public vhba-module
3008 (package
3009 (name "vhba-module")
3010 (version "20211218")
3011 (source
3012 (origin
3013 (method url-fetch)
3014 (uri (string-append
3015 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
3016 version ".tar.xz"))
3017 (sha256
3018 (base32 "1dkprnnya0i8121p7ip4g8cww99drk7fzbwcxx65x02jqk0siibj"))))
3019 (build-system linux-module-build-system)
3020 (arguments
3021 (list #:tests? #f)) ; no test suite
3022 (home-page "https://cdemu.sourceforge.io/")
3023 (synopsis "Linux kernel module that emulates SCSI devices")
3024 (description
3025 "The @acronym{VHBA, Virtual SCSI Host Bus Adapter} module is the link
3026between the CDemu user-space daemon and the kernel Linux. It acts as a
3027low-level SCSI driver that emulates a virtual SCSI adapter which can have
3028multiple virtual devices attached to it. Its typical use with CDEmu is to
3029emulate optical devices such as DVD and CD-ROM drives.")
3030 (license license:gpl2+)))
3031
3032(define-public bbswitch-module
3033 ;; Use "develop" branch since stable release does not build on Linux >= 5.6.
3034 ;; See https://github.com/Bumblebee-Project/bbswitch/issues/205.
3035 (let ((commit "19f60204596a6463b162fc7ca11f4946f5c20cea"))
3036 (package
3037 (name "bbswitch-module")
3038 (version (git-version "0.8" "2" commit))
3039 (source (origin
3040 (method git-fetch)
3041 (uri (git-reference
3042 ;; Use fork until
3043 ;; https://github.com/Bumblebee-Project/bbswitch/pull/219
3044 ;; is merged.
3045 (url "https://github.com/madchic/bbswitch")
3046 (commit commit)))
3047 (file-name (git-file-name name version))
3048 (sha256
3049 (base32
3050 "1pv41y02c9xg9k1bg4i4ll3w7hxxzdr651i08f092b9q5hr57mqn"))))
3051 (build-system linux-module-build-system)
3052 (arguments
3053 (list #:tests? #f)) ; no test suite
3054 (home-page "https://github.com/Bumblebee-Project/bbswitch")
3055 (synopsis "Kernel module that disables discrete Nvidia graphics cards")
3056 (description "The bbswitch module provides a way to toggle the Nvidia
3057graphics card on Optimus laptops.")
3058 (license license:gpl2))))
3059
3060(define-public bin-graph
3061 (package
3062 (name "bin-graph")
3063 (version "1.2.0")
3064 (source
3065 (origin
3066 (method git-fetch)
3067 (uri (git-reference
3068 (url "https://github.com/8dcc/bin-graph")
3069 (commit (string-append "v" version))))
3070 (file-name (git-file-name name version))
3071 (sha256
3072 (base32 "1msr4fj1nh6hf5h6j5pimfrgd37xy4xbik3iml9gd3b1fdkxsdv7"))))
3073 (arguments
3074 (list #:tests? #f ; no tests
3075 #:make-flags
3076 #~(list (string-append "CC=" #$(cc-for-target))
3077 (string-append "PREFIX=" #$output)
3078 (string-append "INSTALL_DIR=" #$output "/bin"))
3079 #:phases
3080 #~(modify-phases %standard-phases
3081 (delete 'configure)))) ; no configure script
3082 (build-system gnu-build-system)
3083 (inputs (list libpng))
3084 (home-page "https://github.com/8dcc/bin-graph")
3085 (synopsis "Visualize binary files")
3086 (description
3087 "@code{bin-graph} provides a simple way of visualizing the different regions
3088of a binary file.")
3089 (license license:gpl3)))
3090
3091(define-public ddcci-driver-linux
3092 (let ((revision "0")
3093 (commit "7f8f8e6c221a286d57a643c2909109a54e084eed"))
3094 (package
3095 (name "ddcci-driver-linux")
3096 (version (git-version "0.4.5" revision commit))
3097 (source
3098 (origin
3099 (method git-fetch)
3100 (uri
3101 (git-reference
3102 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
3103 (commit commit)))
3104 (file-name (git-file-name name version))
3105 (sha256
3106 (base32 "0sgldghd8n4qjm5nv9dgxjibj1hg4kkk1811wndf3vx3dacsmkl9"))))
3107 (build-system linux-module-build-system)
3108 (arguments
3109 (list #:tests? #f ; no tests
3110 #:phases
3111 #~(modify-phases %standard-phases
3112 (replace 'build
3113 (lambda args
3114 (for-each
3115 (lambda (module)
3116 (with-directory-excursion module
3117 (apply (assoc-ref %standard-phases 'build) args)))
3118 '("ddcci" "ddcci-backlight"))))
3119 (replace 'install
3120 (lambda args
3121 (for-each
3122 (lambda (module)
3123 (with-directory-excursion module
3124 (apply (assoc-ref %standard-phases 'install) args)))
3125 '("ddcci" "ddcci-backlight")))))))
3126 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
3127 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
3128 (description "This package provides two Linux kernel drivers, ddcci and
3129ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
3130interface. The ddcci module creates a character device for each DDC/CI
3131monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
3132module allows the control of the backlight level or luminance property when
3133supported under @file{/sys/class/backlight/}.")
3134 (license license:gpl2+))))
3135
3136(define-public reform2-lpc-module
3137 (package
3138 (name "reform2-lpc-module")
3139 (version "1.79")
3140 (source
3141 (origin
3142 (method git-fetch)
3143 (uri (git-reference
3144 (url "https://source.mnt.re/reform/reform-tools.git")
3145 (commit version)))
3146 (file-name (git-file-name name version))
3147 (sha256
3148 (base32 "16xzdygf14zksvqjbp5gwiqsn0mb7kphvzrmqbl9db4kvyj4ajqa"))))
3149 (build-system linux-module-build-system)
3150 (arguments
3151 '(#:tests? #f ;no tests
3152 #:source-directory "lpc"))
3153 (synopsis "Linux kernel module for the Reform 2 system controller")
3154 (description
3155 "The reform2_lpc module allows for interaction with the NXP LPC11U24
3156Cortex-M0 MCU system controller in the Reform 2 open hardware laptop. It
3157provides battery status information and is necessary to completely shut down
3158the system when powering it off via userspace.")
3159 (home-page "https://source.mnt.re/reform/reform-tools/")
3160 (license license:gpl3+)))
3161
3162(define-public v4l2loopback-linux-module
3163 (package
3164 (name "v4l2loopback-linux-module")
3165 (version "0.15.3")
3166 (source (origin
3167 (method git-fetch)
3168 (uri (git-reference
3169 (url "https://github.com/v4l2loopback/v4l2loopback")
3170 (commit (string-append "v" version))))
3171 (file-name (git-file-name name version))
3172 (sha256
3173 (base32
3174 "1fpzsymsas4d2maj81k1al02m62d81ll4q15xwc4n0rhh88hkdv7"))))
3175 (build-system linux-module-build-system)
3176 (arguments
3177 (list #:tests? #f)) ; no test suite
3178 (home-page "https://github.com/v4l2loopback/v4l2loopback")
3179 (synopsis "Linux kernel module to create virtual V4L2 video devices")
3180 (description
3181 "This Linux module creates virtual video devices. @acronym{V4L2, Video
3182for Linux 2} applications will treat these as ordinary video devices but read
3183video data generated by another application, instead of a hardware device such
3184as a capture card.
3185
3186This lets you apply nifty effects to your Jitsi video, for example, but also
3187allows some more serious things like adding streaming capabilities to an
3188application by hooking GStreamer into the loopback device.")
3189 (license license:gpl2+)))
3190
3191(define-public xpadneo
3192 (package
3193 (name "xpadneo")
3194 (version "0.9.7")
3195 (source (origin
3196 (method git-fetch)
3197 (uri (git-reference
3198 (url "https://github.com/atar-axis/xpadneo")
3199 (commit (string-append "v" version))))
3200 (file-name (git-file-name name version))
3201 (sha256
3202 (base32
3203 "1v5akvz14izxk3fav6x4l50gi8xzsjwxjddczc2yy78gni1a7ybs"))))
3204 (build-system linux-module-build-system)
3205 (arguments
3206 (list #:tests? #f ; no `check' target
3207 #:source-directory "hid-xpadneo/src"
3208 #:phases
3209 #~(modify-phases %standard-phases
3210 (add-after 'install 'post-install
3211 (lambda _
3212 (copy-recursively "hid-xpadneo/etc-modprobe.d"
3213 (string-append #$output "/etc/modprobe.d"))
3214 ;; udev-service-type takes its rules from /lib rather than
3215 ;; /etc, so copy it there instead
3216 (copy-recursively "hid-xpadneo/etc-udev-rules.d"
3217 (string-append #$output
3218 "/lib/udev/rules.d")))))))
3219 (home-page "https://atar-axis.github.io/xpadneo/")
3220 (synopsis "Xbox One Wireless Controller driver for the kernel Linux")
3221 (description
3222 "This package provides a driver for the XBox One S Wireless controller
3223and some newer models when connected via Bluetooth. In addition to the included
3224Linux kernel module, it also contains a modprobe configuration and udev rules,
3225which need to be installed separately.")
3226 (license license:gpl3+)))
3227
3228(define-public vendor-reset-linux-module
3229 (let ((commit "4b466e92a2d9f76ce1082cde982c7be0be91e248")
3230 (revision "0"))
3231 (package
3232 (name "vendor-reset-linux-module")
3233 (version (git-version "0.1.0" revision commit))
3234 (source (origin
3235 (method git-fetch)
3236 (uri (git-reference
3237 (url "https://github.com/gnif/vendor-reset")
3238 (commit commit)))
3239 (file-name (git-file-name name version))
3240 (sha256
3241 (base32
3242 "1gaf4j20grng689c9fylcqri3j9ycnhr2bsva2z6qcdqvzl6yxbi"))))
3243 (build-system linux-module-build-system)
3244 (arguments
3245 (list #:tests? #f)) ;no test suite
3246 (home-page "https://github.com/gnif/vendor-reset")
3247 (synopsis
3248 "Kernel module that resets GPUs that are affected by the reset bug")
3249 (description
3250 "This package provides a kernel module that is capable of
3251resetting hardware devices into a state where they can be
3252re-initialized or passed through into a virtual machine (VFIO).
3253While it would be great to have these in the kernel as PCI quirks,
3254some of the reset procedures are very complex and would never be
3255accepted as a quirk (ie AMD Vega 10).")
3256 (license license:gpl2))))
3257
3258
3259;;;
3260;;; Pluggable authentication modules (PAM).
3261;;;
3262
3263(define-public linux-pam
3264 (package
3265 (name "linux-pam")
3266 (version "1.5.2")
3267 (source
3268 (origin
3269 (method url-fetch)
3270 (uri (string-append
3271 "https://github.com/linux-pam/linux-pam/releases/download/v"
3272 version "/Linux-PAM-" version ".tar.xz"))
3273 (sha256
3274 (base32
3275 "0kgrsj2scv5mx6w925h9hxf11jnqqs9z8s22aw94b90xm4qp3v74"))
3276 (patches (search-patches "linux-pam-unix_chkpwd.patch"
3277 "linux-pam-no-setfsuid.patch"))))
3278
3279 (build-system gnu-build-system)
3280 (inputs (list libxcrypt))
3281 (native-inputs
3282 (list flex
3283 ;; TODO: optional dependencies
3284 ;; ("cracklib" ,cracklib)
3285 ))
3286 (arguments
3287 (list
3288 ;; Most users, such as `shadow', expect the headers to be under
3289 ;; `security'.
3290 #:configure-flags #~(list (string-append "--includedir="
3291 (assoc-ref %outputs "out")
3292 "/include/security")
3293 ;; explicit libdir for pkgconfig files
3294 ;; drop with 1.5.3, which fixes
3295 ;; https://github.com/linux-pam/linux-pam/issues/466
3296 (string-append "--libdir="
3297 (assoc-ref %outputs "out")
3298 "/lib")
3299
3300 ;; XXX: <rpc/rpc.h> is missing from glibc when
3301 ;; cross-compiling, so we have to disable NIS
3302 ;; support altogether.
3303 #$@(if (%current-target-system)
3304 #~("--disable-nis")
3305 #~()))
3306
3307 #:phases (if (target-hurd?)
3308 #~(modify-phases %standard-phases
3309 (add-after 'unpack 'skip-pam-limits
3310 (lambda _
3311 ;; 'pam_limits.c' uses <sys/prctl.h>, which is
3312 ;; Linux-specific. Skip it on GNU/Hurd.
3313 (substitute* "modules/Makefile.in"
3314 (("pam_limits") "")))))
3315 #~%standard-phases)
3316
3317 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
3318 ;; isn't available.
3319 #:tests? #f))
3320 (home-page "http://www.linux-pam.org/")
3321 (synopsis "Pluggable authentication modules for Linux")
3322 (description
3323 "A *Free* project to implement OSF's RFC 86.0.
3324Pluggable authentication modules are small shared object files that can
3325be used through the PAM API to perform tasks, like authenticating a user
3326at login. Local and dynamic reconfiguration are its key features.")
3327 (license license:bsd-3)))
3328
3329(define-public python-pamela
3330 (package
3331 (name "python-pamela")
3332 (version "1.0.0")
3333 (source
3334 (origin
3335 (method git-fetch)
3336 (uri (git-reference
3337 (url "https://github.com/minrk/pamela")
3338 (commit version)))
3339 (file-name (git-file-name name version))
3340 (sha256
3341 (base32 "0cg3w6np1fbjpvzhv54xg567hpf38szwp2d4gvzb9r736nxbv0vr"))))
3342 (build-system pyproject-build-system)
3343 (arguments
3344 (list
3345 #:tests? #f ;Test suite isn't designed to be run inside a container.
3346 #:phases
3347 #~(modify-phases %standard-phases
3348 (add-after 'unpack 'hardcode-pam.so
3349 (lambda* (#:key inputs #:allow-other-keys)
3350 (substitute* "pamela.py"
3351 (("find_library\\(\"pam\")")
3352 (format #f "~s"
3353 (search-input-file inputs "lib/libpam.so"))))))
3354 (replace 'check
3355 (lambda* (#:key tests? #:allow-other-keys)
3356 (when (and tests? (file-exists? "test_pamela.py"))
3357 (invoke "pytest" "--assert=plain" "test_pamela.py")
3358 (invoke "python" "-m" "pamela" "-a" "`whoami`")))))))
3359 (inputs (list linux-pam))
3360 (native-inputs (list python-pytest python-setuptools))
3361 (home-page "https://github.com/minrk/pamela")
3362 (synopsis "PAM interface using ctypes")
3363 (description "This package provides a PAM interface using @code{ctypes}.")
3364 (license license:expat)))
3365
3366(define-public pam-gnupg
3367 (package
3368 (name "pam-gnupg")
3369 (version "0.3")
3370 (source (origin
3371 (method git-fetch)
3372 (uri (git-reference
3373 (url "https://github.com/cruegge/pam-gnupg")
3374 (commit (string-append "v" version))))
3375 (file-name (git-file-name name version))
3376 (sha256
3377 (base32
3378 "1bf91gi6zmfzzmczxm7pajxdlgnikasvg5xsd3j0a368rcr7lf9l"))))
3379 (build-system gnu-build-system)
3380 (inputs
3381 (list gnupg linux-pam))
3382 (native-inputs
3383 (list autoconf automake libtool))
3384 (arguments
3385 `(#:tests? #f ;no tests suite
3386 #:configure-flags
3387 (list (string-append "--with-moduledir="
3388 (assoc-ref %outputs "out") "/lib/security"))))
3389
3390 (home-page "https://github.com/cruegge/pam-gnupg")
3391 (synopsis "Unlock GnuPG keys on login")
3392 (description "This package provides a PAM module that hands over your
3393login password to @code{gpg-agent}. This can be useful if you are using a
3394GnuPG-based password manager like @code{pass}.")
3395 (license license:gpl3+)))
3396
3397
3398;;;
3399;;; Kernel documentation
3400;;;
3401
3402(define-public linux-libre-documentation
3403 (package
3404 (inherit linux-libre)
3405 (name "linux-libre-documentation")
3406 (arguments
3407 (list
3408 #:tests? #f
3409 #:phases #~(modify-phases %standard-phases
3410 (delete 'configure)
3411 (replace 'build
3412 (lambda* (#:key parallel-build? #:allow-other-keys)
3413 (substitute* "Documentation/Makefile"
3414 ;; Remove problematic environment check script.
3415 ((".*scripts/sphinx-pre-install.*") ""))
3416 (invoke "make" "infodocs"
3417 "-j" (if parallel-build?
3418 (number->string (parallel-job-count))
3419 "1"))))
3420 (replace 'install
3421 (lambda _
3422 (let* ((info-dir (string-append #$output "/share/info"))
3423 (info (string-append info-dir
3424 "/TheLinuxKernel.info.gz")))
3425 (with-directory-excursion "Documentation/output"
3426 (invoke "make" "-C" "texinfo" "install-info"
3427 (string-append "infodir=" info-dir)))
3428 ;; Create a symlink, for convenience.
3429 (symlink info (string-append info-dir
3430 "/linux.info.gz"))))))))
3431 (native-inputs
3432 (list graphviz
3433 perl
3434 python
3435 python-sphinx
3436 python-pyyaml
3437 texinfo
3438 which))
3439 (synopsis "Documentation for the kernel Linux-Libre")
3440 (description "This package provides the documentation for the kernel
3441Linux-Libre, as an Info manual. To consult it, run @samp{info linux}.")))
3442
3443;;;
3444;;; Miscellaneous.
3445;;;
3446
3447(define-public powercap
3448 (package
3449 (name "powercap")
3450 (version "0.6.0")
3451 (source
3452 (origin
3453 (method git-fetch)
3454 (uri (git-reference
3455 (url "https://github.com/powercap/powercap")
3456 (commit (string-append "v" version))))
3457 (file-name (git-file-name name version))
3458 (sha256
3459 (base32 "087almlx34nzjbv8a40kxlmgy8691z2zlzkfyca8a2b7l0b2kqlp"))))
3460 (build-system cmake-build-system)
3461 (arguments
3462 (list #:configure-flags
3463 #~(list "-DBUILD_SHARED_LIBS=ON")))
3464 (home-page "https://github.com/powercap/powercap")
3465 (synopsis "Utilities for accessing the powercap Linux kernel feature")
3466 (description "This package contains utilities for accessing the powercap
3467Linux kernel feature through sysfs. It includes an implementation for working
3468with Intel @acronym{RAPL, Running Average Power Limit}.
3469It provides the commands @code{powercap-info} and @code{powercap-set}.")
3470 (license license:bsd-3)))
3471
3472(define-public powerstat
3473 (package
3474 (name "powerstat")
3475 (version "0.04.03")
3476 (source
3477 (origin
3478 (method git-fetch)
3479 (uri (git-reference
3480 (url "https://github.com/ColinIanKing/powerstat")
3481 (commit (string-append "V" version))))
3482 (file-name (git-file-name name version))
3483 (sha256
3484 (base32 "1a1fnw4rb8fx4wrcl0yc6dbjj49k6vagnq7diyw4fs4i5nin7mv3"))))
3485 (build-system gnu-build-system)
3486 (arguments
3487 `(#:make-flags
3488 (list (string-append "CC=" ,(cc-for-target))
3489 (string-append "prefix=" (assoc-ref %outputs "out")))
3490 #:tests? #f ; no test suite
3491 #:phases
3492 (modify-phases %standard-phases
3493 (delete 'configure)))) ; no configure script
3494 (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
3495 (synopsis "Measure system power consumption")
3496 (description
3497 "Powerstat measures and reports your computer's power consumption in real
3498time. On mobile PCs, it uses ACPI battery information to measure the power
3499drain of the entire system.
3500
3501Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
3502domain measurements. These are available only on some hardware such as Intel
3503Sandybridge and newer, and cover only part of the machine's components such as
3504CPU, DRAM, and graphics. However, they provide accurate and immediate readings
3505and don't require a battery at all.
3506
3507The output is like @command{vmstat} but also shows power consumption statistics:
3508at the end of a run, @command{powerstat} will calculate the average, standard
3509deviation, and minimum and maximum values. It can show a nice histogram too.")
3510 (license license:gpl2)))
3511
3512(define-public psmisc
3513 (package
3514 (name "psmisc")
3515 (version "23.7")
3516 (source
3517 (origin
3518 (method url-fetch)
3519 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
3520 version ".tar.xz"))
3521 (sha256
3522 (base32 "09y30ywh1d4s4f0wgvki115kgpliq48rarmfmmjl0iq22jf5viaq"))))
3523 (build-system gnu-build-system)
3524 (arguments
3525 (list
3526 #:configure-flags
3527 (if (%current-target-system)
3528 #~(list "ac_cv_func_malloc_0_nonnull=yes"
3529 "ac_cv_func_realloc_0_nonnull=yes")
3530 #~'())))
3531 (inputs (list ncurses))
3532 (home-page "https://gitlab.com/psmisc/psmisc")
3533 (synopsis "Small utilities that use the proc file system")
3534 (description
3535 "psmisc is a set of small utilities that use the proc file system.
3536@itemize @bullet
3537@item @command{fuser} identifies processes using files or sockets;
3538@item @command{killall} kills processes by name;
3539@item @command{prtstat} prints statistics of a process;
3540@item @command{pslog} prints the log file(s) of a process;
3541@item @command{pstree} shows the currently running processes as a tree;
3542@item @command{peekfd} shows the data travelling over a file descriptor.
3543@end itemize")
3544 (license license:gpl2+)))
3545
3546(define-public util-linux
3547 (package
3548 (name "util-linux")
3549 (version "2.40.4")
3550 (source (origin
3551 (method url-fetch)
3552 (uri (string-append "mirror://kernel.org/linux/utils/"
3553 "util-linux/v" (version-major+minor version) "/"
3554 "util-linux-" version ".tar.xz"))
3555 (sha256
3556 (base32
3557 "0ygvflcr7v7x2rmr9h5mi07yx00i9368ggf3znd8bs847drsy7aw"))
3558 (patches (search-patches "util-linux-tests.patch"))
3559 (modules '((guix build utils)))
3560 (snippet
3561 ;; We take 'nologin' from Shadow, the 'logger' program from
3562 ;; GNU Inetutils and 'kill' from GNU Coreutils.
3563 '(begin
3564 (substitute* "configure"
3565 (("build_nologin=yes") "build_nologin=no")
3566 (("build_logger=yes") "build_logger=no")
3567 (("build_kill=yes") "build_kill=no"))))))
3568 (build-system gnu-build-system)
3569 (outputs '("out" ;6.4 MiB executables and documentation
3570 "lib" ;8.8 MiB shared libraries, headers and locales
3571 "static")) ;2.9 MiB static .a libraries
3572 (arguments
3573 (list #:configure-flags
3574 #~(list "--disable-use-tty-group"
3575 (string-append
3576 "--enable-fs-paths-default="
3577 "/run/setuid-programs"
3578 ":/run/current-system/profile/sbin")
3579 ;; Don't try to chown root:root mount and umount
3580 "--disable-makeinstall-chown"
3581 "--localstatedir=/var"
3582 (string-append "--localedir=" #$output:lib
3583 "/share/locale")
3584 ;; Install completions where our bash-completion package
3585 ;; expects them.
3586 (string-append "--with-bashcompletiondir=" #$output
3587 "/etc/bash_completion.d")
3588 ;; XXX: 32-bit Hurd platforms don't support 64bit time_t
3589 #$@(if (target-hurd32?)
3590 '("--disable-year2038")
3591 '()))
3592
3593 ;; FIXME: For now we cannot reliably run tests on GNU/Hurd:
3594 ;; <https://bugs.gnu.org/47791>.
3595 #:tests? (and (not (%current-target-system))
3596 (not (system-hurd?)))
3597
3598 #:phases
3599 #~(modify-phases %standard-phases
3600 (add-before 'configure 'patch-build-scripts
3601 (lambda _
3602 (substitute* "configure"
3603 ;; The build system assumes that we want to install
3604 ;; libraries below $exec_prefix when $libdir does not
3605 ;; match any of the "usual" locations. Fix that.
3606 (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
3607 "usrlib_execdir=$libdir"))))
3608 (add-before 'build 'set-umount-file-name
3609 (lambda _
3610 ;; Tell 'eject' the right file name of 'umount'.
3611 (substitute* "sys-utils/eject.c"
3612 (("\"/bin/umount\"")
3613 (string-append "\"" #$output "/bin/umount\"")))))
3614 (add-before 'check 'pre-check
3615 (lambda* (#:key native-inputs inputs #:allow-other-keys)
3616 (let ((services (search-input-file (or native-inputs inputs)
3617 "etc/services")))
3618 ;; Change the test to refer to the right file.
3619 (substitute* "tests/ts/misc/mcookie"
3620 (("/etc/services")
3621 services))
3622 (substitute* "tests/helpers/test_mkfds.c"
3623 (("/etc/fstab")
3624 (which "sh")))
3625 (substitute* "tests/helpers/test_enosys.c"
3626 (("/bin/false")
3627 (which "false"))))))
3628 (add-before 'check 'disable-setarch-test
3629 (lambda _
3630 ;; The setarch tests are unreliable in QEMU's user-mode
3631 ;; emulation, which is our primary method of building
3632 ;; ARMv7 packages. See
3633 ;; <https://github.com/karelzak/util-linux/issues/601>.
3634 (substitute* "tests/ts/misc/setarch"
3635 (("ts_init_subtest.*" all)
3636 (string-append
3637 all "\n"
3638 "ts_skip \"setarch tests are unreliable under QEMU\"")))))
3639 (add-before 'check 'disable-lsns-test
3640 (lambda _
3641 ;; The lsns tests can fail due to ioctl(_, NS_GET_USERNS)
3642 ;; returning ENOTTY, indicating this kernel does not
3643 ;; support user namespaces. Curiously, this test can fail
3644 ;; on i686 even if the same test passes on x86_64 on the
3645 ;; same machine. See <https://issues.guix.gnu.org/49933>.
3646 (delete-file "tests/ts/lsns/ioctl_ns")))
3647 #$@(if (target-ppc32?)
3648 #~((add-before 'check 'disable-enosys-ioctl
3649 ;; It is unclear why this test specifically
3650 ;; fails in Guix's port of powerpc-linux.
3651 (lambda _
3652 (substitute* "tests/ts/misc/enosys"
3653 (("ts_init_subtest ioctl")
3654 (string-append
3655 "ts_init_subtest ioctl\n\n"
3656 "ts_skip \"unexplained failure on powerpc\"\n"))))))
3657 #~())
3658 (add-after 'install 'move-static-libraries
3659 (lambda _
3660 (let ((lib #$output:lib)
3661 (static #$output:static))
3662
3663 ;; Move static libraries to the "static" output.
3664 (mkdir-p (string-append static "/lib"))
3665 (with-directory-excursion lib
3666 (for-each (lambda (file)
3667 (rename-file file
3668 (string-append static "/"
3669 file)))
3670 (find-files "lib" "\\.a$"))
3671
3672 ;; Remove references to the static library from the '.la'
3673 ;; files so that Libtool does the right thing when both
3674 ;; the shared and static library is available.
3675 (substitute* (find-files "lib" "\\.la$")
3676 (("old_library=.*") "old_library=''\n"))))))
3677 (add-after 'install 'adjust-pkg-config-files
3678 (lambda _
3679 ;; Drop the unused "prefix=" and "exec_prefix=" variables from
3680 ;; the pkg-config files to avoid a cyclic reference on "out".
3681 (substitute* (find-files (string-append #$output:lib
3682 "/lib/pkgconfig")
3683 "\\.pc$")
3684 (("^(exec_)?prefix=.*") "")))))))
3685 (inputs
3686 (list file ;for libmagic
3687 ncurses
3688 sqlite
3689 zlib))
3690 (native-inputs
3691 (list net-base ;for tests
3692 perl
3693 pkg-config))
3694 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
3695 (synopsis "Collection of utilities for the Linux kernel")
3696 (description "Util-linux is a diverse collection of Linux kernel
3697utilities. It provides dmesg and includes tools for working with file systems,
3698block devices, UUIDs, TTYs, and many other tools.")
3699
3700 (properties '((upstream-name . "util-linux")))
3701 ;; Note that util-linux doesn't use the same license for all the
3702 ;; code. GPLv2+ is the default license for a code without an
3703 ;; explicitly defined license.
3704 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
3705 license:bsd-4 license:public-domain))))
3706
3707;; util-linux optionally supports udev, which allows lsblk to read file system
3708;; metadata without special privileges. Add it as a separate package to avoid
3709;; a circular dependency, and to keep the size small.
3710(define-public util-linux+udev
3711 (package/inherit
3712 util-linux
3713 (name "util-linux-with-udev")
3714 (inputs
3715 (modify-inputs (package-inputs util-linux)
3716 (prepend eudev)))))
3717
3718(define-public chimerautils
3719 (package
3720 (name "chimerautils")
3721 (version "14.3.1")
3722 (source
3723 (origin
3724 (method git-fetch)
3725 (uri (git-reference
3726 (url "https://github.com/chimera-linux/chimerautils")
3727 (commit (string-append "v" version))))
3728 (file-name (git-file-name name version))
3729 (sha256
3730 (base32 "10xs9i9w9an9jjq7vgkyfqfyzdisbb57c8c1rryjpfiz8dmi8g41"))))
3731 (build-system meson-build-system)
3732 (arguments
3733 (list
3734 #:tests? #f)) ;no test suite
3735 (inputs (list acl
3736 libedit
3737 libxo
3738 ncurses
3739 openssl
3740 zlib
3741 (list zstd "lib")))
3742 (native-inputs (list flex bison pkg-config))
3743 (home-page "https://github.com/chimera-linux/chimerautils")
3744 (synopsis "The FreeBSD-based core Linux userland from Chimera Linux")
3745 (description
3746 "This is a port of the FreeBSD userland for Linux provided by
3747the Chimera Linux distribution. Essentially, it is a collection of UNIX tools
3748such as @command{grep}, @command{cp}, @command{vi}, etc. and can be used as an
3749alternative to the corresponding implementations from the GNU project.")
3750 (license license:bsd-2)))
3751
3752(define-public ddate
3753 (package
3754 (name "ddate")
3755 (version "0.2.2")
3756 (source (origin
3757 (method git-fetch)
3758 (uri (git-reference
3759 (url "https://github.com/bo0ts/ddate")
3760 (commit (string-append "v" version))))
3761 (file-name (git-file-name name version))
3762 (sha256
3763 (base32 "1qchxnxvghbma6gp1g78wnjxsri0b72ha9axyk31cplssl7yn73f"))))
3764 (build-system cmake-build-system)
3765 (arguments '(#:tests? #f))
3766 (home-page "https://github.com/bo0ts/ddate")
3767 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
3768 (description
3769 "ddate displays the Discordian date and holidays of a given date.
3770The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
3771by Robert Shea and Robert Anton Wilson.")
3772 (license license:public-domain)))
3773
3774(define-public dislocker
3775 (package
3776 (name "dislocker")
3777 (version "0.7.3")
3778 (home-page "https://github.com/Aorimn/dislocker")
3779 (source (origin
3780 (method git-fetch)
3781 (uri (git-reference
3782 (url home-page)
3783 (commit (string-append "v" version))))
3784 (file-name (git-file-name name version))
3785 (sha256
3786 (base32
3787 "1ak68s1v5dwh8y2dy5zjybmrh0pnqralmyqzis67y21m87g47h2k"))))
3788 (build-system cmake-build-system)
3789 (arguments
3790 '(#:tests? #f)) ;no test suite
3791 (inputs (list fuse-2 mbedtls-lts))
3792 (synopsis "FUSE driver to read/write Windows BitLocker drives")
3793 (description
3794 "This package provides means to to read BitLocker encrypted
3795partitions. Write functionality is also provided but check the README.")
3796 (license license:gpl2+)))
3797
3798(define-public dwarves
3799 (package
3800 (name "dwarves")
3801 (version "1.29")
3802 (source (origin
3803 (method git-fetch)
3804 (uri (git-reference
3805 (url "https://github.com/acmel/dwarves")
3806 (commit (string-append "v" version))))
3807 (file-name (git-file-name name version))
3808 (sha256
3809 (base32
3810 "1ia3r77zyw7r8mydy1zrrdnqzm9ginsvf9pqviq48rglihhddvli"))
3811 (patches
3812 (search-patches "dwarves-threading-reproducibility.patch"))))
3813 (build-system cmake-build-system)
3814 (arguments (list #:configure-flags #~(list "-D__LIB=lib"
3815 "-DLIBBPF_EMBEDDED=OFF")
3816 #:tests? #f)) ;no test suite
3817 (native-inputs (list pkg-config))
3818 (inputs (list libbpf))
3819 (home-page "https://github.com/acmel/dwarves")
3820 (synopsis "Debugging information processing library and utilities")
3821 (description "Dwarves is a set of tools that use the debugging information
3822inserted in ELF binaries by compilers such as GCC, used by well known
3823debuggers such as GDB.
3824
3825Utilities in the Dwarves suite include @command{pahole}, that can be used to
3826find alignment holes in structures and classes in languages such as C, C++,
3827but not limited to these. These tools can also be used to encode and read the
3828BTF type information format used with the kernel Linux @code{bpf} syscall.
3829
3830The @command{codiff} command can be used to compare the effects changes in
3831source code generate on the resulting binaries.
3832
3833The @command{pfunct} command can be used to find all sorts of information
3834about functions, inlines, decisions made by the compiler about inlining, etc.
3835
3836The @command{pahole} command can be used to use all this type information to
3837pretty print raw data according to command line directions.
3838
3839Headers can have its data format described from debugging info and offsets from
3840it can be used to further format a number of records.
3841
3842Finally, the @command{btfdiff} command can be used to compare the output of
3843pahole from BTF and DWARF, to make sure they produce the same results.")
3844 (license license:gpl2+)))
3845
3846(define-public fbset
3847 (package
3848 (name "fbset")
3849 (version "2.1")
3850 (source
3851 (origin
3852 (method url-fetch)
3853 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
3854 version ".tar.gz"))
3855 (sha256
3856 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
3857 (build-system gnu-build-system)
3858 (arguments
3859 '(#:modules ((guix build gnu-build-system)
3860 (guix build utils)
3861 (srfi srfi-26))
3862 #:phases
3863 (modify-phases %standard-phases
3864 (delete 'configure) ; no configure script
3865 (add-before 'install 'pre-install
3866 (lambda* (#:key outputs #:allow-other-keys)
3867 (let ((out (assoc-ref outputs "out")))
3868 (substitute* "Makefile"
3869 (("mknod ") "true ")
3870 ;; The Makefile doesn't honour PREFIX or similar.
3871 (("/usr") out))
3872 (mkdir out)
3873 (with-directory-excursion out
3874 (for-each mkdir-p (list "sbin"
3875 "man/man5"
3876 "man/man8")))
3877 #t)))
3878 (add-after 'install 'install-fb.modes
3879 (lambda* (#:key outputs #:allow-other-keys)
3880 (let* ((out (assoc-ref outputs "out"))
3881 (etc (string-append out "/etc")))
3882 (for-each (cut install-file <> etc)
3883 (find-files "etc" "^fb\\.modes"))
3884 (symlink "fb.modes.ATI"
3885 (string-append etc "/fb.modes"))
3886 #t))))
3887 ;; Parallel building races to create modes.tab.c.
3888 #:parallel-build? #f
3889 #:tests? #f)) ; no test suite
3890 (native-inputs
3891 (list bison flex))
3892 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
3893 (synopsis "Show and modify Linux frame buffer settings")
3894 (description
3895 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
3896different kinds of graphic displays. The @command{fbset} utility can query and
3897change various device settings such as depth, virtual resolution, and timing
3898parameters.")
3899 (license license:gpl2)))
3900
3901(define-public procps
3902 (package
3903 (name "procps")
3904 (version "4.0.3")
3905 (source (origin
3906 (method url-fetch)
3907 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
3908 "procps-ng-" version ".tar.xz"))
3909 (sha256
3910 (base32
3911 "14ms9mkqr1mgl3h5yl6w8m57cf39k382nv7qms78vqbaz728wg1h"))
3912 (patches (search-patches "procps-strtod-test.patch"))))
3913 (build-system gnu-build-system)
3914 (arguments
3915 (list #:modules '((guix build utils)
3916 (guix build gnu-build-system)
3917 (srfi srfi-1)
3918 (srfi srfi-26))
3919 #:configure-flags
3920 (if (%current-target-system)
3921 #~'("ac_cv_func_malloc_0_nonnull=yes"
3922 "ac_cv_func_realloc_0_nonnull=yes")
3923 #~'())
3924 #:phases
3925 #~(modify-phases %standard-phases
3926 (add-after 'install 'post-install
3927 ;; Remove commands and man pages redudant with
3928 ;; Coreutils.
3929 (lambda* (#:key outputs #:allow-other-keys)
3930 (let* ((out #$output)
3931 (dup (append-map (cut find-files out <>)
3932 '("^kill" "^uptime"))))
3933 (for-each delete-file dup))))
3934 #$@(if (system-hurd?)
3935 #~((add-after 'unpack 'skip-tests
3936 (lambda _
3937 (substitute* "library/tests/test_version.c"
3938 (("^int main\\(.*" all)
3939 (string-append all "{\n exit (77);//"))))))
3940 #~()))))
3941 (inputs (list ncurses))
3942 (native-inputs (list pkg-config))
3943 (home-page "https://gitlab.com/procps-ng/procps/")
3944 (synopsis "Utilities that give information about processes")
3945 (description
3946 "Procps is the package that has a bunch of small useful utilities
3947that give information about processes using the Linux /proc file system.
3948The package includes the programs free, pgrep, pidof, pkill, pmap, ps, pwdx,
3949slabtop, tload, top, vmstat, w, watch and sysctl.")
3950 (properties '((upstream-name . "procps-ng")))
3951 (license license:gpl2)))
3952
3953(define-public usbutils
3954 (package
3955 (name "usbutils")
3956 (version "018")
3957 (source
3958 (origin
3959 (method url-fetch)
3960 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
3961 "usbutils-" version ".tar.xz"))
3962 (sha256
3963 (base32 "14xd7j9fl3pm0z4dhqj3mf9paqk431kq4vi602f5hiw5nmcqpxl3"))))
3964 (build-system meson-build-system)
3965 (outputs (list "out" "python"))
3966 (arguments
3967 (list
3968 #:phases
3969 #~(modify-phases %standard-phases
3970 (add-after 'install 'separate-python-output
3971 ;; Separating one Python script shaves more than 106 MiB from :out.
3972 (lambda _
3973 (for-each (lambda (file)
3974 (let ((old (string-append #$output "/" file))
3975 (new (string-append #$output:python "/" file)))
3976 (mkdir-p (dirname new))
3977 (rename-file old new)))
3978 (list "bin/lsusb.py"))))
3979 (add-after 'install 'install-usbreset
3980 (lambda _
3981 (install-file "usbreset"
3982 (string-append #$output "/bin")))))))
3983 (native-inputs (list pkg-config))
3984 (inputs (list eudev libusb python))
3985 (home-page "http://www.linux-usb.org/")
3986 (synopsis
3987 "Tools for working with USB devices")
3988 (description
3989 "Collection of tools to query what type of USB devices are connected to
3990the system, including @command{lsusb}. The experimental @command{usbreset}
3991command included in the package, but be aware that it may not work for all
3992devices.")
3993 (license license:gpl2+)))
3994
3995(define-public usbip-utils
3996 (package
3997 (name "usbip-utils")
3998 (version (package-version linux-libre))
3999 (source (package-source linux-libre))
4000 (build-system gnu-build-system)
4001 (arguments
4002 '(#:configure-flags '("--disable-static")
4003 #:phases (modify-phases %standard-phases
4004 (add-after 'unpack 'enter-subdirectory
4005 (lambda _
4006 (chdir "tools/usb/usbip")
4007 #t)))))
4008 (native-inputs
4009 `(("automake" ,automake)
4010 ("autoreconf" ,autoconf)
4011 ("libtool" ,libtool)))
4012 (inputs (list eudev))
4013 (home-page (package-home-page linux-libre))
4014 (synopsis "Utilities for sharing USB devices over IP networks")
4015 (description
4016 "The USB/IP protocol enables to pass USB device from a server to
4017a client over the network. The server is a machine which shares an
4018USB device and the client is a machine which uses USB device provided by
4019a server over the network. The USB device may be either physical device
4020connected to a server or software entity created on a server using USB
4021gadget subsystem. The usbip-utils are userspace tools to used to handle
4022connection and management on both side. The client needs the @file{vhci-hcd}
4023Linux kernel module and the server needs the @file{usbip_host} Linux kernel
4024module.")
4025 (license license:gpl2)))
4026
4027(define-public e2fsprogs
4028 (package
4029 (name "e2fsprogs")
4030 (version "1.47.2")
4031 (source (origin
4032 (method url-fetch)
4033 (uri (string-append
4034 "mirror://kernel.org/linux/kernel/people/tytso/"
4035 "e2fsprogs/v" version "/"
4036 "e2fsprogs-" version ".tar.xz"))
4037 (sha256
4038 (base32
4039 "0g76fhnyzr2awwybd6c16439l80r5dv4kbfaq7cr908fr9j2w908"))))
4040 (build-system gnu-build-system)
4041 (inputs (list `(,util-linux "lib")))
4042 (native-inputs (list pkg-config
4043 texinfo ;for the libext2fs Info manual
4044 ;; For tests.
4045 perl
4046 procps))
4047 (arguments
4048 `(;; util-linux is the preferred source for some of the libraries and
4049 ;; commands, so disable them (see, e.g.,
4050 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
4051 #:configure-flags (list "--disable-libblkid"
4052 "--disable-libuuid" "--disable-uuidd"
4053 "--disable-fsck"
4054
4055 ;; Use symlinks instead of hard links for
4056 ;; 'fsck.extN' etc. This makes the resulting nar
4057 ;; smaller and is preserved across copies.
4058 "--enable-symlink-install"
4059
4060 (string-append "LDFLAGS=-Wl,-rpath="
4061 (assoc-ref %outputs "out")
4062 "/lib")
4063
4064 ;; Install libext2fs et al.
4065 "--enable-elf-shlibs")
4066
4067 #:phases
4068 (modify-phases %standard-phases
4069 (add-before 'configure 'patch-shells
4070 (lambda _
4071 (substitute* "configure"
4072 (("/bin/sh (.*)parse-types.sh" _ dir)
4073 (string-append (which "sh") " " dir
4074 "parse-types.sh")))
4075 (substitute* "MCONFIG.in"
4076 (("INSTALL_SYMLINK = /bin/sh")
4077 "INSTALL_SYMLINK = sh"))
4078 (substitute* (find-files "." "^Makefile.in$")
4079 (("#!/bin/sh")
4080 (string-append "#!" (which "sh"))))))
4081 (add-after 'install 'install-libs
4082 (lambda* (#:key outputs #:allow-other-keys)
4083 (let* ((out (assoc-ref outputs "out"))
4084 (lib (string-append out "/lib")))
4085 (invoke "make" "install-libs")
4086
4087 ;; Make the .a writable so that 'strip' works.
4088 ;; Failing to do that, due to debug symbols, we
4089 ;; retain a reference to the final
4090 ;; linux-libre-headers, which refer to the
4091 ;; bootstrap binaries.
4092 (let ((archives (find-files lib "\\.a$")))
4093 (for-each (lambda (file)
4094 (chmod file #o666))
4095 archives)))))
4096 ,@(if (system-hurd?)
4097 '((add-after 'unpack 'skip-tests
4098 (lambda _
4099 (with-directory-excursion "tests"
4100 (for-each
4101 (lambda (directory)
4102 (delete-file-recursively directory))
4103 '("d_bad_ostype"
4104 "f_detect_junk"
4105 "f_extent_oobounds"
4106 "j_ext_long_revoke_trans"
4107 "j_ext_long_trans"
4108 "j_long_revoke_trans"
4109 "j_long_revoke_trans_mcsum_32bit"
4110 "j_long_revoke_trans_mcsum_64bit"
4111 "j_long_trans"
4112 "j_long_trans_mcsum_32bit"
4113 "j_long_trans_mcsum_64bit"
4114 "j_short_revoke_trans"
4115 "j_short_revoke_trans_mcsum_64bit"
4116 "j_short_trans_64bit"
4117 "j_short_trans"
4118 "j_short_trans_mcsum_64bit"
4119 "j_short_trans_old_csum"
4120 "j_short_trans_open_recover"
4121 "j_short_trans_recover"
4122 "j_short_trans_recover_mcsum_64bit"
4123 "j_short_uncommitted_trans"
4124 "j_short_uncommitted_trans_mcsum_64bit"
4125 "m_error_behavior"
4126 "m_minrootdir"
4127 "m_rootdir"
4128 "r_32to64bit_expand_full"
4129 "r_expand_full"
4130 "r_fixup_lastbg_big"
4131 "t_change_uuid"
4132 "t_change_uuid_mcsum"
4133 "t_change_uuid_mcsum_mounted"
4134 "t_change_uuid_mcsum_seed_mounted"
4135 "t_change_uuid_mounted"
4136 "t_disable_changed_csum_seed"
4137 "t_disable_changed_csum_seed_mounted"
4138 "t_disable_csum_seed"
4139 "t_disable_meta_csum_and_seed"
4140 "t_enable_csum_seed"
4141 "t_format_csum_seed"
4142 "t_replay_and_set"
4143 "u_compound_rollback"
4144 "u_corrupt_blk_csum"
4145 "u_corrupt_blk_csum_force"
4146 "u_corrupt_key_csum"
4147 "u_debugfs_opt"
4148 "u_dryrun"
4149 "u_e2fsck_opt"
4150 "u_errorout"
4151 "u_force"
4152 "u_force_dryrun"
4153 "u_incomplete"
4154 "u_mke2fs_opt"
4155 "u_mke2fs_opt_oddsize"
4156 "u_offset"
4157 "u_onefile_bad"
4158 "u_resize2fs_opt"
4159 "u_revert_64bitmcsum_onefile"
4160 "u_revert_all_onefile"
4161 "u_revert_upgrade_to_64bitmcsum"
4162 "u_tune2fs_opt"
4163 "u_undo_undo"
4164 "u_wrong_fs"))))))
4165 '()))))
4166 (home-page "https://e2fsprogs.sourceforge.net/")
4167 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
4168 (description
4169 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
4170 (license (list license:gpl2 ;programs
4171 license:lgpl2.0 ;libext2fs
4172 license:x11)))) ;libuuid
4173
4174(define e2fsprogs/static
4175 (static-package
4176 (package (inherit e2fsprogs)
4177 (arguments
4178 ;; Do not build shared libraries.
4179 (substitute-keyword-arguments (package-arguments e2fsprogs)
4180 ((#:configure-flags _)
4181 '(list "--disable-blkid"))
4182 ((#:make-flags _)
4183 '(list)))))))
4184
4185(define-public e2fsck/static
4186 (package
4187 (name "e2fsck-static")
4188 (version (package-version e2fsprogs))
4189 (build-system trivial-build-system)
4190 (source #f)
4191 (inputs
4192 (list e2fsprogs/static))
4193 (arguments
4194 `(#:modules ((guix build utils))
4195 #:builder
4196 (begin
4197 (use-modules (guix build utils)
4198 (ice-9 ftw)
4199 (srfi srfi-26))
4200
4201 (let ((e2fsck (search-input-file %build-inputs "/sbin/e2fsck"))
4202 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
4203 (mkdir-p bin)
4204 (with-directory-excursion bin
4205 (copy-file e2fsck "e2fsck")
4206 (remove-store-references "e2fsck")
4207 (chmod "e2fsck" #o555))
4208 #t))))
4209 (home-page (package-home-page e2fsprogs))
4210 (synopsis "Statically-linked e2fsck command from e2fsprogs")
4211 (description "This package provides statically-linked e2fsck command taken
4212from the e2fsprogs package. It is meant to be used in initrds.")
4213 (license (package-license e2fsprogs))))
4214
4215(define-public extundelete
4216 (package
4217 (name "extundelete")
4218 (version "0.2.4")
4219 (source
4220 (origin
4221 (method url-fetch)
4222 (uri (string-append "mirror://sourceforge/extundelete/"
4223 "extundelete/" version "/extundelete-"
4224 version ".tar.bz2"))
4225 (sha256
4226 (base32
4227 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
4228 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
4229 (build-system gnu-build-system)
4230 (inputs (list e2fsprogs))
4231 (home-page "https://extundelete.sourceforge.net/")
4232 (synopsis "Recover deleted files from ext2/3/4 partitions")
4233 (description
4234 "Extundelete is a set of tools that can recover deleted files from an
4235ext3 or ext4 partition.")
4236 (license license:gpl2)))
4237
4238(define-public zerofree
4239 (package
4240 (name "zerofree")
4241 (version "1.1.1")
4242 (home-page "https://frippery.org/uml/")
4243 (source (origin
4244 (method url-fetch)
4245 (uri (string-append home-page name "-" version
4246 ".tgz"))
4247 (sha256
4248 (base32
4249 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
4250 (build-system gnu-build-system)
4251 (arguments
4252 '(#:phases
4253 (modify-phases %standard-phases
4254 (delete 'configure) ; no configure script
4255 (replace 'install
4256 ;; The Makefile lacks an ‘install’ target.
4257 (lambda* (#:key outputs #:allow-other-keys)
4258 (let* ((out (assoc-ref outputs "out"))
4259 (bin (string-append out "/bin")))
4260 (chmod "zerofree" #o555)
4261 (install-file "zerofree" bin)
4262 #t))))
4263 #:tests? #f)) ; no tests
4264 (inputs `(("libext2fs" ,e2fsprogs)))
4265 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
4266 (description
4267 "Zerofree finds the unallocated blocks with non-zero value content in an
4268ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
4269This is a simple way to make disk images more compressible.
4270Zerofree requires the file system to be unmounted or mounted read-only.")
4271 (license license:gpl2)))
4272
4273(define-public strace
4274 (package
4275 (name "strace")
4276 (version "6.16")
4277 (source
4278 (origin
4279 (method git-fetch)
4280 (uri (git-reference
4281 (url "https://github.com/strace/strace")
4282 (commit (string-append "v" version))))
4283 (file-name (git-file-name name version))
4284 (sha256
4285 (base32 "0p405lf76vksa3ldlq8fjjz5760q2rgr0dvms6bdp3dvc72kr82i"))
4286 (patches (search-patches "strace-readlink-tests.patch"))))
4287 (build-system gnu-build-system)
4288 (arguments
4289 (list
4290 #:phases
4291 #~(modify-phases %standard-phases
4292 ;; Needed for the 'bootstrap phase.
4293 (add-after 'unpack 'patch-source-shebangs-initial
4294 (assoc-ref %standard-phases 'patch-source-shebangs))
4295 (add-after 'unpack 'patch-test-shebangs
4296 (lambda _
4297 (substitute* '("tests/detach-vfork.test"
4298 "tests/gen_tests.sh"
4299 "tests/kill-on-exit.sh")
4300 (("#!/bin/sh")
4301 (string-append "#!" (which "sh")))))))
4302 #:configure-flags
4303 ''("--with-libunwind"
4304 ;; Don't fail if the architecture doesn't support different
4305 ;; personalities.
4306 "--enable-mpers=check")
4307 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
4308 #:parallel-tests? #f)) ; undeterministic failures
4309 (inputs (list libunwind))
4310 (native-inputs
4311 (list autoconf
4312 automake
4313 perl
4314 m4
4315 ;; For some tests
4316 util-linux))
4317 (home-page "https://strace.io")
4318 (synopsis "System call tracer for Linux")
4319 (description
4320 "strace is a system call tracer, i.e. a debugging tool which prints out a
4321trace of all the system calls made by a another process/program.")
4322 (license license:lgpl2.1+)))
4323
4324(define-public ltrace
4325 (package
4326 (name "ltrace")
4327 (version "0.7.3")
4328 (source (origin
4329 (method url-fetch)
4330 (uri (string-append "http://www.ltrace.org/ltrace_" version
4331 ".orig.tar.bz2"))
4332 (sha256
4333 (base32
4334 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
4335 (build-system gnu-build-system)
4336 (inputs `(("libelf" ,elfutils)))
4337 (arguments
4338 ;; Compilation uses -Werror by default, but it fails.
4339 '(#:configure-flags '("--disable-werror")))
4340 (home-page "https://www.ltrace.org/")
4341 (synopsis "Library call tracer for Linux")
4342 (description
4343 "ltrace intercepts and records dynamic library calls which are called by
4344an executed process and the signals received by that process. It can also
4345intercept and print the system calls executed by the program.")
4346 (license license:gpl2+)))
4347
4348(define-public alsa-ucm-conf
4349 (package
4350 (name "alsa-ucm-conf")
4351 (version "1.2.11")
4352 (source (origin
4353 (method url-fetch)
4354 (uri (string-append
4355 "ftp://ftp.alsa-project.org/pub/lib/" name "-"
4356 version ".tar.bz2"))
4357 (sha256
4358 (base32
4359 "10dfzvrmpp9swflw47nxf35an6gj3ilb4wlggdnng8g2637h2z1q"))))
4360 (build-system copy-build-system)
4361 (arguments
4362 '(#:install-plan
4363 '(("ucm" "share/alsa/ucm")
4364 ("ucm2" "share/alsa/ucm2"))))
4365 (home-page "https://www.alsa-project.org/wiki/Main_Page")
4366 (synopsis "The Advanced Linux Sound Architecture Use Case Manager")
4367 (description
4368 "This package contains Advanced Linux Sound Architecture Use Case Manager
4369configuration of audio input/output names and routing for specific audio
4370hardware.")
4371 (license license:bsd-3)))
4372
4373(define-public alsa-topology-conf
4374 (package
4375 (name "alsa-topology-conf")
4376 (version "1.2.4")
4377 (source (origin
4378 (method url-fetch)
4379 (uri (string-append
4380 "ftp://ftp.alsa-project.org/pub/lib/" name "-"
4381 version ".tar.bz2"))
4382 (sha256
4383 (base32
4384 "01zdg6q4s6d01k39z96wi4vbhrfw1i2g4yi5dijwfk6a5vjfdq2m"))))
4385 (build-system copy-build-system)
4386 (arguments
4387 '(#:install-plan
4388 '(("topology" "share/alsa/topology"))))
4389 (home-page "https://www.alsa-project.org/wiki/Main_Page")
4390 (synopsis "The Advanced Linux Sound Architecture libraries")
4391 (description
4392 "This package contains Advanced Linux Sound Architecture topology
4393configuration files that can be used for specific audio hardware.")
4394 (license license:bsd-3)))
4395
4396(define-public alsa-lib
4397 (package
4398 (name "alsa-lib")
4399 (version "1.2.11")
4400 (source (origin
4401 (method url-fetch)
4402 (uri (string-append
4403 "https://www.alsa-project.org/files/pub/lib/"
4404 name "-" version ".tar.bz2"))
4405 (sha256
4406 (base32
4407 "0kdvjlknc50fwfdkxj0z12xbz21skb3gnwlh6lvsvycmp5ljygwz"))))
4408 (build-system gnu-build-system)
4409 (arguments
4410 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4411 (assoc-ref %outputs "out")
4412 "/lib"))
4413 #:phases
4414 (modify-phases %standard-phases
4415 (add-before 'install 'pre-install
4416 (lambda* (#:key inputs outputs #:allow-other-keys)
4417 (let* ((ucm
4418 (string-append (assoc-ref inputs "alsa-ucm-conf")))
4419 (topology
4420 (string-append (assoc-ref inputs "alsa-topology-conf")))
4421 (alsa
4422 (string-append (assoc-ref outputs "out") "/share/alsa"))
4423 (ucm-share
4424 (string-append ucm "/share/alsa/ucm"))
4425 (ucm2-share
4426 (string-append ucm "/share/alsa/ucm2"))
4427 (topology-share
4428 (string-append topology "/share/alsa/topology")))
4429 (mkdir-p alsa)
4430 (symlink ucm-share (string-append alsa "/ucm"))
4431 (symlink ucm2-share (string-append alsa "/ucm2"))
4432 (symlink topology-share (string-append alsa "/topology")))
4433 #t)))))
4434 (inputs
4435 (list alsa-ucm-conf alsa-topology-conf))
4436 (home-page "https://www.alsa-project.org/wiki/Main_Page")
4437 (synopsis "The Advanced Linux Sound Architecture libraries")
4438 (description
4439 "The Advanced Linux Sound Architecture (ALSA) provides audio and
4440MIDI functionality to the Linux-based operating system.")
4441 (license license:lgpl2.1+)))
4442
4443(define-public alsa-utils
4444 (package
4445 (name "alsa-utils")
4446 (version "1.2.11")
4447 (source (origin
4448 (method url-fetch)
4449 (uri (string-append
4450 "https://www.alsa-project.org/files/pub/utils/"
4451 name "-" version ".tar.bz2"))
4452 (sha256
4453 (base32
4454 "19r8qi6b7sd2p1mhxfqrp18wrgjw5s6rp5ygimb1w59zi0xcmils"))))
4455 (build-system gnu-build-system)
4456 (arguments
4457 (list
4458 #:configure-flags
4459 #~(list
4460 ;; The udev rule is responsible for restoring the volume.
4461 (string-append "--with-udev-rules-dir=" #$output "/lib/udev/rules.d"))
4462 #:phases
4463 #~(modify-phases %standard-phases
4464 (add-before 'install 'pre-install
4465 (lambda _
4466 ;; Don't try to mkdir /var/lib/alsa.
4467 (substitute* "Makefile"
4468 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
4469 "true\n")))))))
4470 (native-inputs
4471 (list docbook-xml-4.2 docbook-xsl xmlto
4472 gettext-minimal))
4473 (inputs
4474 (list libsamplerate ncurses alsa-lib))
4475 (home-page "http://www.alsa-project.org/")
4476 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
4477 (description
4478 "The Advanced Linux Sound Architecture (ALSA) provides audio and
4479MIDI functionality to the Linux-based operating system.")
4480
4481 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
4482 ;; GPLv2-only.
4483 (license license:gpl2)))
4484
4485(define-public alsa-plugins
4486 (package
4487 (name "alsa-plugins")
4488 (version "1.2.2")
4489 (source (origin
4490 (method url-fetch)
4491 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
4492 name "-" version ".tar.bz2"))
4493 (sha256
4494 (base32
4495 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
4496 (build-system gnu-build-system)
4497 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
4498 ;; be split, there are references to both in files.
4499 ;; TODO: Remove OSS related plugins, they add support to run native
4500 ;; ALSA applications on OSS however we do not offer OSS and OSS is
4501 ;; obsolete.
4502 (outputs '("out" "pulseaudio" "jack"))
4503 (native-search-paths
4504 (list (search-path-specification
4505 (variable "ALSA_PLUGIN_DIR")
4506 (files '("lib/alsa-lib"))
4507 (separator #f))))
4508 (arguments
4509 `(#:configure-flags '(;; Do not install a "local" configuration targeted
4510 ;; for /etc/alsa. On Guix System plugins are loaded from
4511 ;; the ALSA service, and other distributions likely
4512 ;; won't use these files.
4513 "--with-alsalconfdir=/tmp/noop")
4514 #:phases
4515 (modify-phases %standard-phases
4516 (add-after 'install 'split
4517 (lambda* (#:key inputs outputs #:allow-other-keys)
4518 ;; Distribute the binaries to the various outputs.
4519 (let* ((out (assoc-ref outputs "out"))
4520 (jack (assoc-ref outputs "jack"))
4521 (jacklib (string-append jack "/lib/alsa-lib"))
4522 (pua (assoc-ref outputs "pulseaudio"))
4523 (pualib (string-append pua "/lib/alsa-lib")))
4524 ;; For jack.
4525 (mkdir-p jacklib)
4526 (for-each (lambda (file)
4527 (rename-file file (string-append jacklib "/" (basename file))))
4528 (find-files out ".*jack\\.(la|so)"))
4529 ;; For pulseaudio.
4530 (mkdir-p pualib)
4531 (for-each (lambda (file)
4532 (rename-file file (string-append pualib "/" (basename file))))
4533 (find-files out ".*pulse\\.(la|so)"))
4534 #t))))))
4535 (inputs
4536 (list alsa-lib
4537 jack-1
4538 speex ; libspeexdsp resampling plugin
4539 libsamplerate ; libsamplerate resampling plugin
4540 ffmpeg ; libavcodec resampling plugin, a52 plugin
4541 pulseaudio)) ; PulseAudio plugin
4542 (native-inputs
4543 (list pkg-config))
4544 (home-page "http://www.alsa-project.org/")
4545 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
4546 (description
4547 "The Advanced Linux Sound Architecture (ALSA) provides audio and
4548MIDI functionality to the Linux-based operating system. This package enhances ALSA
4549by providing additional plugins which include: upmixing, downmixing, jackd and
4550pulseaudio support for native alsa applications, format conversion (s16 to a52), and
4551external rate conversion.")
4552 (license (list license:gpl2+
4553 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
4554 license:lgpl2.1+))))
4555
4556(define-public iptables
4557 (package
4558 (name "iptables")
4559 (version "1.8.11")
4560 (source
4561 (origin
4562 (method url-fetch)
4563 (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
4564 version ".tar.xz")))
4565 (sha256
4566 (base32 "1cp7kw0d3fpmfmbl4adh88v02wnj4s5rfgyxsk52pjgqbvah6wyq"))))
4567 (build-system gnu-build-system)
4568 (native-inputs
4569 (list pkg-config flex bison))
4570 (inputs
4571 (list libmnl libnftnl/pinned))
4572 (arguments
4573 (list #:tests? #f ; no test suite
4574 #:configure-flags ; add $libdir to the RUNPATH of executables
4575 #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))))
4576 (home-page "https://www.netfilter.org/projects/iptables/index.html")
4577 (synopsis "Programs to configure Linux IP packet filtering rules")
4578 (description
4579 "@command{iptables} is the user-space command line program used to
4580configure the Linux 2.4.x and later IPv4 packet filtering ruleset
4581(@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
4582
4583This package also includes @command{ip6tables}, which is used to configure the
4584IPv6 packet filter.
4585
4586Both commands are targeted at system administrators.")
4587 (properties
4588 '((release-monitoring-url . "https://www.netfilter.org/pub/iptables/")))
4589 (license license:gpl2+)))
4590
4591(define-public iptables-nft
4592 (package
4593 (inherit iptables)
4594 (name "iptables-nft")
4595 (source #f)
4596 (build-system copy-build-system)
4597 (arguments
4598 (list
4599 #:phases
4600 #~(modify-phases %standard-phases
4601 (delete 'unpack)
4602 (replace 'install
4603 (lambda* (#:key inputs #:allow-other-keys)
4604 (for-each
4605 (lambda (command-path)
4606 (let ((link-path (string-append #$output command-path)))
4607 (mkdir-p (dirname link-path))
4608 (symlink (search-input-file inputs "sbin/xtables-nft-multi")
4609 link-path)))
4610 (apply append
4611 '("/bin/iptables-xml")
4612 (map (lambda (xtables)
4613 (list (string-append "/sbin/" xtables)
4614 (string-append "/sbin/" xtables "-restore")
4615 (string-append "/sbin/" xtables "-save")))
4616 '("arptables"
4617 "ebtables"
4618 "iptables"
4619 "ip6tables")))))))))
4620 (inputs (list iptables))
4621 (native-inputs '())
4622 (synopsis
4623 "Programs to configure Linux IP packet filtering rules (nftables API)")))
4624
4625(define-public irqbalance
4626 (package
4627 (name "irqbalance")
4628 (version "1.9.4")
4629 (source
4630 (origin
4631 (method git-fetch)
4632 (uri (git-reference
4633 (url "https://github.com/irqbalance/irqbalance")
4634 (commit (string-append "v" version))))
4635 (file-name (git-file-name name version))
4636 (sha256
4637 (base32 "1jswxr0jcxz83j1nanl6xaxpw001l0hfb2xvvy2k970g1g1kpszd"))))
4638 (build-system gnu-build-system)
4639 (inputs (list glib ncurses libnl libcap-ng))
4640 (native-inputs (list autoconf automake libtool pkg-config))
4641 (home-page "https://irqbalance.github.io/irqbalance/")
4642 (synopsis "Daemon used to load balance CPU interrupts")
4643 (description
4644 "Irqbalance is a daemon to help balance the CPU load generated by
4645interrupts across all of a systems CPUs. Irqbalance identifies the highest
4646volume interrupt sources, and isolates each of them to a single unique CPU, so
4647that load is spread as much as possible over an entire processor set, while
4648minimizing cache miss rates for irq handlers.")
4649 (license license:gpl2)))
4650
4651(define-public bolt
4652 (package
4653 (name "bolt")
4654 (version "0.9.10")
4655 (source (origin
4656 (method git-fetch)
4657 (uri (git-reference
4658 (url "https://gitlab.freedesktop.org/bolt/bolt")
4659 (commit version)))
4660 (file-name (git-file-name name version))
4661 (sha256
4662 (base32
4663 "1vw4vzyhkpm73snnfciy7x88ja72cv5isc27k91jvmy2350b29yx"))))
4664 (build-system meson-build-system)
4665 (arguments
4666 (list #:configure-flags '(list "--localstatedir=/var")
4667 #:glib-or-gtk? #t ;To wrap binaries and/or compile schemas
4668 #:phases #~(modify-phases %standard-phases
4669 (add-after 'unpack 'replace-directories
4670 (lambda* (#:key outputs #:allow-other-keys)
4671 (substitute* "meson.build"
4672 (("udev.get_variable\\(pkgconfig: 'udevdir'\\)")
4673 (string-append "'" #$output "/lib/udev'"))
4674 ;; Don't install in /var
4675 (("not systemd\\.found\\(\\)")
4676 "false"))))
4677 (add-before 'install 'no-polkit-magic
4678 (lambda* (#:key outputs #:allow-other-keys)
4679 (setenv "PKEXEC_UID" "something"))))))
4680 (native-inputs (list pkg-config
4681 `(,glib "bin") python asciidoc umockdev))
4682 (inputs (list eudev dbus polkit))
4683 (synopsis "Thunderbolt 3 device manager")
4684 (description
4685 "This package provides @command{boltd}, a userspace daemon
4686for Thunderbolt devices, and @command{boltctl}, a command-line utility for
4687managing those devices.
4688
4689The daemon @command{boltd} exposes devices via D-Bus to clients. It also
4690stores a database of previously authorized devices and will, depending on the
4691policy set for the individual devices, automatically authorize newly connected
4692devices without user interaction.
4693
4694The command-line utility @command{boltctl} manages Thunderbolt devices via
4695@command{boltd}. It can list devices, monitor changes, and initiate
4696authorization of devices.")
4697 (home-page "https://gitlab.freedesktop.org/bolt/bolt")
4698 (properties `((lint-hidden-cpe-vendors . ("boltcms" "puppet"))))
4699 (license license:gpl2+)))
4700
4701(define-public jitterentropy-rngd
4702 (package
4703 (name "jitterentropy-rngd")
4704 (version "1.2.8")
4705 (source
4706 (origin
4707 (method git-fetch)
4708 (uri (git-reference
4709 (url "https://github.com/smuellerDD/jitterentropy-rngd")
4710 (commit (string-append "v" version))))
4711 (file-name (git-file-name name version))
4712 (sha256
4713 (base32 "13br8s6gqnfc844ps38ya5nny3pndsmskszv3dsp1cxcgvmscg1c"))))
4714 (build-system gnu-build-system)
4715 (arguments
4716 (list
4717 #:tests? #f ; no test suite
4718 #:make-flags
4719 #~(list (string-append "CC=" #$(cc-for-target))
4720 (string-append "PREFIX=" #$output)
4721 "UNITDIR=$(PREFIX)/lib/systemd/system")
4722 #:phases
4723 #~(modify-phases %standard-phases
4724 (delete 'configure)))) ; no ./configure script
4725 (home-page "https://www.chronox.de/jent.html")
4726 (synopsis "CPU jitter random number generator daemon")
4727 (description
4728 "This simple daemon feeds entropy from the CPU Jitter @acronym{RNG, random
4729number generator} core to the kernel Linux's entropy estimator. This prevents
4730the @file{/dev/random} device from blocking and should benefit users of the
4731preferred @file{/dev/urandom} and @code{getrandom()} interfaces too.
4732
4733The CPU Jitter RNG itself is part of the kernel and claims to provide good
4734entropy by collecting and magnifying differences in CPU execution time as
4735measured by the high-resolution timer built into modern CPUs. It requires no
4736additional hardware or external entropy source.
4737
4738The random bit stream generated by @command{jitterentropy-rngd} is not processed
4739by a cryptographically secure whitening function. Nonetheless, its authors
4740believe it to be a suitable source of cryptographically secure key material or
4741other cryptographically sensitive data.
4742
4743If you agree with them, start this daemon as early as possible to provide
4744properly seeded random numbers to services like SSH or those using TLS during
4745early boot when entropy may be low, especially in virtualised environments.")
4746 (license (list license:bsd-3 ; or
4747 license:gpl2+))))
4748
4749(define-public ebtables
4750 (package
4751 (name "ebtables")
4752 (version "2.0.11")
4753 (source (origin
4754 (method url-fetch)
4755 (uri (string-append
4756 "mirror://netfilter.org/ebtables/ebtables-"
4757 version ".tar.gz"))
4758 (sha256
4759 (base32
4760 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
4761 (build-system gnu-build-system)
4762 (inputs
4763 (list perl iptables))
4764 (synopsis "Ethernet bridge frame table administration")
4765 (home-page "https://ebtables.netfilter.org/")
4766 (description
4767 "ebtables is an application program used to set up and maintain the
4768tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
4769analogous to the iptables application, but less complicated, due to the fact
4770that the Ethernet protocol is much simpler than the IP protocol.")
4771 (license license:gpl2+)))
4772
4773(define-public iproute
4774 (package
4775 (name "iproute2")
4776 (version "6.4.0")
4777 (source (origin
4778 (method url-fetch)
4779 (uri (string-append
4780 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
4781 version ".tar.xz"))
4782 (sha256
4783 (base32
4784 "0wm2g70vfhnf8wb6py3zmzwxp4zv1icny1pvkwaxmr67rggbhlac"))))
4785 (build-system gnu-build-system)
4786 (arguments
4787 (list
4788 ;; There is a test suite, but it wants network namespaces and sudo.
4789 #:tests? #f
4790 #:make-flags
4791 #~(let ((out #$output))
4792 (list (string-append "CC=" #$(cc-for-target))
4793 "HOSTCC=gcc"
4794 (string-append "BASH_COMPDIR=" out
4795 "/etc/bash_completion.d")
4796 (string-append "LIBDIR=" out "/lib")
4797 (string-append "HDRDIR=" out "/include")
4798 (string-append "SBINDIR=" out "/sbin")
4799 (string-append "CONFDIR=" out "/etc")
4800 (string-append "MANDIR=" out "/share/man")
4801 #$@(if (target-ppc64le?)
4802 '("CCOPTS=-O2 -pipe -Wno-incompatible-pointer-types")
4803 '())))
4804 #:phases
4805 #~(modify-phases %standard-phases
4806 (replace 'configure
4807 (lambda* (#:key (configure-flags #~'()) #:allow-other-keys)
4808 ;; The configure script does not understand some of the
4809 ;; default options of gnu-build-system.
4810 (setenv "PKG_CONFIG" #$(pkg-config-for-target))
4811 (apply invoke "./configure"
4812 "--prefix" #$output
4813 configure-flags)))
4814 (add-before 'install 'pre-install
4815 (lambda _
4816 ;; Don't attempt to create /var/lib/arpd.
4817 (substitute* "Makefile"
4818 (("^.*ARPDDIR.*$") "")))))))
4819 (inputs
4820 (list bdb iptables libmnl))
4821 (native-inputs
4822 (list bison flex pkg-config))
4823 ;; For tests.
4824 ;; ("libmnl" ,libmnl)
4825 ;; ("util-linux" ,util-linux)
4826 (home-page
4827 "https://wiki.linuxfoundation.org/networking/iproute2")
4828 (synopsis
4829 "Utilities for controlling TCP/IP networking and traffic in Linux")
4830 (description
4831 "Iproute2 is a collection of utilities for controlling TCP/IP networking
4832and traffic with the Linux kernel. The most important of these are
4833@command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
4834control.
4835
4836Most network configuration manuals still refer to ifconfig and route as the
4837primary network configuration tools, but ifconfig is known to behave
4838inadequately in modern network environments, and both should be deprecated.")
4839 (license license:gpl2+)))
4840
4841(define-public net-tools
4842 ;; XXX: This package is basically unmaintained, but it provides a few
4843 ;; commands not yet provided by Inetutils, such as 'route', so we have to
4844 ;; live with it.
4845 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
4846 (revision "0"))
4847 (package
4848 (name "net-tools")
4849 (version (string-append "1.60-" revision "." (string-take commit 7)))
4850 (source (origin
4851 (method url-fetch)
4852 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
4853 "n/ne/net-tools/code.git/net-tools-code-"
4854 commit ".zip"))
4855 (file-name (string-append name "-" version ".zip"))
4856 (sha256
4857 (base32
4858 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
4859 (home-page "https://net-tools.sourceforge.net/")
4860 (build-system gnu-build-system)
4861 (arguments
4862 `(#:modules ((guix build gnu-build-system)
4863 (guix build utils)
4864 (srfi srfi-1)
4865 (srfi srfi-26))
4866 #:phases
4867 (modify-phases %standard-phases
4868 (replace 'configure
4869 (lambda* (#:key outputs #:allow-other-keys)
4870 (let ((out (assoc-ref outputs "out")))
4871 (mkdir-p (string-append out "/bin"))
4872 (mkdir-p (string-append out "/sbin"))
4873
4874 ;; Pretend we have everything...
4875 (system "yes | make config")
4876
4877 ;; ... except for the things we don't have.
4878 ;; HAVE_AFDECnet requires libdnet, which we don't have.
4879 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
4880 ;; that have been removed.
4881 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
4882 ;; think about adding them later.
4883 (substitute* '("config.make" "config.h")
4884 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
4885 ""))
4886 #t)))
4887 (add-after 'install 'remove-redundant-commands
4888 (lambda* (#:key outputs #:allow-other-keys)
4889 ;; Remove commands and man pages redundant with Inetutils.
4890 (let* ((out (assoc-ref outputs "out"))
4891 (dup (append-map (cut find-files out <>)
4892 '("^hostname"
4893 "^(yp|nis|dns)?domainname"))))
4894 (for-each delete-file dup)
4895 #t))))
4896 ;; Binaries that depend on libnet-tools.a don't declare that
4897 ;; dependency, making it parallel-unsafe.
4898 #:parallel-build? #f
4899
4900 #:tests? #f ; no test suite
4901 #:make-flags (let ((out (assoc-ref %outputs "out")))
4902 (list ,(string-append "CC=" (cc-for-target))
4903 (string-append "BASEDIR=" out)
4904 (string-append "INSTALLNLSDIR=" out "/share/locale")
4905 (string-append "mandir=/share/man")))))
4906 (native-inputs `(("gettext" ,gettext-minimal)
4907 ("unzip" ,unzip)))
4908 (supported-systems (remove target-hurd? %supported-systems))
4909 (synopsis "Tools for controlling the network subsystem in Linux")
4910 (description
4911 "This package includes the important tools for controlling the network
4912subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
4913route. Additionally, this package contains utilities relating to particular
4914network hardware types (plipconfig, slattach) and advanced aspects of IP
4915configuration (iptunnel, ipmaddr).")
4916 (license license:gpl2+))))
4917
4918(define-public libcap
4919 (package
4920 (name "libcap")
4921 (version "2.64")
4922 (source (origin
4923 (method url-fetch)
4924 (uri (string-append
4925 "mirror://kernel.org/linux/libs/security/linux-privs/"
4926 "libcap2/libcap-" version ".tar.xz"))
4927 (sha256
4928 (base32
4929 "04qy0z6yhlljb29xxcb2srbdnymcrhsi28wrc705z3861cgmwin8"))))
4930 (build-system gnu-build-system)
4931 (arguments
4932 (list #:phases
4933 #~(modify-phases %standard-phases
4934 (delete 'configure)
4935 #$@(if (target-ppc32?)
4936 #~((add-after 'unpack 'apply-patch
4937 (lambda _
4938 (let ((patch
4939 #$(local-file
4940 (search-patch
4941 "libcap-magic-glibc-constant.patch"))))
4942 (invoke "patch" "--force" "-p1" "-i" patch)))))
4943 #~()))
4944 #:test-target "test"
4945 #:make-flags
4946 #~(list "lib=lib"
4947 (string-append "prefix=" #$output)
4948 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
4949 "RAISE_SETFCAP=no"
4950 ;; Tell the makefile to use TARGET-gcc and friends
4951 ;; when cross-compiling.
4952 #$@(if (%current-target-system)
4953 `((string-append "CROSS_COMPILE="
4954 ,(%current-target-system) "-")
4955 "BUILD_CC=gcc")
4956 '()))))
4957 (native-inputs (list perl))
4958 (supported-systems (remove target-hurd? %supported-systems))
4959 (home-page "https://sites.google.com/site/fullycapable/")
4960 (synopsis "Library for working with POSIX capabilities")
4961 (description
4962 "Libcap2 provides a programming interface to POSIX capabilities on
4963Linux-based operating systems.")
4964
4965 ;; License is BSD-3 or GPLv2, at the user's choice.
4966 (license (list license:bsd-3 license:gpl2))))
4967
4968(define-public bridge-utils
4969 (package
4970 (name "bridge-utils")
4971 (version "1.7.1")
4972 (source
4973 (origin
4974 (method url-fetch)
4975 (uri (string-append "mirror://kernel.org/linux/utils/net/"
4976 "bridge-utils/bridge-utils-" version ".tar.xz"))
4977 (sha256
4978 (base32 "03p6cmhm6cqhnfsfa1wv7frhb361y12daf7gr1h5qh51y7j8n7d6"))))
4979 (build-system gnu-build-system)
4980
4981 ;; The tarball lacks all the generated files.
4982 (native-inputs (list autoconf automake))
4983 (arguments
4984 '(#:tests? #f)) ; no 'check' target
4985
4986 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
4987 (synopsis "Manipulate Ethernet bridges")
4988 (description
4989 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
4990to connect two Ethernet segments together in a protocol independent way.
4991Packets are forwarded based on Ethernet address, rather than IP address (like
4992a router). Since forwarding is done at Layer 2, all protocols can go
4993transparently through a bridge.")
4994 (license license:gpl2+)))
4995
4996(define-public libnl
4997 (package
4998 (name "libnl")
4999 (version "3.5.0")
5000 (source (origin
5001 (method url-fetch)
5002 (uri (string-append
5003 "https://github.com/thom311/libnl/releases/download/"
5004 "libnl" (string-join (string-split version #\.) "_")
5005 "/libnl-" version ".tar.gz"))
5006 (sha256
5007 (base32
5008 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
5009 (build-system gnu-build-system)
5010 (native-inputs
5011 `(("bison" ,bison)
5012 ("flex" ,flex)
5013 ("pkg-config" ,pkg-config)
5014 ("swig" ,swig)
5015 ("libnl3-doc"
5016 ,(origin
5017 (method url-fetch)
5018 (uri (string-append
5019 "https://github.com/thom311/libnl/releases/download/libnl"
5020 (string-join (string-split version #\.) "_")
5021 "/libnl-doc-" version ".tar.gz"))
5022 (sha256
5023 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
5024 (outputs `("out" "doc"))
5025 (arguments
5026 `(#:phases
5027 (modify-phases %standard-phases
5028 (add-after 'install 'install-doc
5029 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
5030 (let ((dest (string-append (assoc-ref outputs "doc")
5031 "/share/doc/libnl")))
5032 (mkdir-p dest)
5033 (invoke "tar" "xf" (assoc-ref
5034 (or native-inputs inputs)
5035 "libnl3-doc")
5036 "--strip-components=1" "-C" dest)))))))
5037 (home-page "https://www.infradead.org/~tgr/libnl/")
5038 (synopsis "NetLink protocol library suite")
5039 (description
5040 "The libnl suite is a collection of libraries providing APIs to netlink
5041protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
5042between the kernel and user space processes. It was designed to be a more
5043flexible successor to ioctl to provide mainly networking related kernel
5044configuration and monitoring interfaces.")
5045
5046 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
5047 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
5048 (license license:gpl2)))
5049
5050;; libnl python extensions used to be outputs of libnl. However, as
5051;; cross-compiling python extensions is currently broken, create separate
5052;; packages for libnl python extensions.
5053(define (libnl-python-package python)
5054 (let ((name (string-append "libnl-" python)))
5055 (package
5056 (inherit libnl)
5057 (name name)
5058 (inputs `(,@(cond
5059 ((string=? python "python2")
5060 `(("python-2" ,python-2)))
5061 ((string=? python "python3")
5062 `(("python-3" ,python-3))))
5063 ("libxcrypt" ,libxcrypt))) ;required by Python.h
5064 (propagated-inputs (list libnl))
5065 (outputs '("out"))
5066 (arguments
5067 `(#:modules ((guix build gnu-build-system)
5068 (guix build utils)
5069 (srfi srfi-1))
5070 #:phases
5071 (modify-phases %standard-phases
5072 (replace 'install
5073 (lambda* (#:key inputs outputs #:allow-other-keys)
5074 (define (python-inst python)
5075 (invoke python "setup.py" "build")
5076 (invoke python "setup.py" "install"
5077 (string-append "--prefix="
5078 (assoc-ref %outputs "out")))
5079 (invoke python "setup.py" "clean"))
5080 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
5081 (assoc-ref inputs "libnl")))
5082 (with-directory-excursion "./python" (python-inst ,python))
5083 #t))))))))
5084
5085(define-public libnl-python2 (libnl-python-package "python2"))
5086(define-public libnl-python3 (libnl-python-package "python3"))
5087
5088(define-public iw
5089 (package
5090 (name "iw")
5091 (version "5.19")
5092 (source (origin
5093 (method url-fetch)
5094 (uri (string-append
5095 "mirror://kernel.org/software/network/iw/iw-"
5096 version ".tar.xz"))
5097 (sha256
5098 (base32
5099 "0kjdrihc7ibnjdpjqkq8sv0kmmvavgsww78cpjgbnlyx8zlvnrzi"))))
5100 (build-system gnu-build-system)
5101 (native-inputs (list pkg-config))
5102 (inputs (list libnl))
5103 (arguments
5104 (list #:make-flags
5105 #~(list
5106 (string-append "CC=" #$(cc-for-target))
5107 (string-append "PKG_CONFIG=" #$(pkg-config-for-target))
5108 (string-append "PREFIX=" (assoc-ref %outputs "out")))
5109 #:phases
5110 #~(modify-phases %standard-phases
5111 (delete 'configure)))) ; no configure script
5112 (home-page "https://wireless.wiki.kernel.org/")
5113 (synopsis "Tool for configuring wireless devices")
5114 (description
5115 "iw is a new nl80211 based CLI configuration utility for wireless
5116devices. It replaces @code{iwconfig}, which is deprecated.")
5117 (license license:isc)))
5118
5119(define-public powertop
5120 (package
5121 (name "powertop")
5122 (version "2.15")
5123 (source
5124 (origin
5125 (method git-fetch)
5126 (uri (git-reference
5127 (url "https://github.com/fenrus75/powertop")
5128 (commit (string-append "v" version))))
5129 (file-name (git-file-name name version))
5130 (sha256
5131 (base32 "10vbk4vplmzp3p1mhwnhj81g6i5xvam9pdvmiy6cmd0xvnmdyy77"))))
5132 (build-system gnu-build-system)
5133 (arguments
5134 (list
5135 #:configure-flags #~(list "LDFLAGS=-pthread")
5136 #:phases
5137 #~(modify-phases %standard-phases
5138 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
5139 ;; allow calibrating the network interface in Guix System.
5140 (add-after 'unpack 'patch-absolute-file-names
5141 (lambda* (#:key inputs #:allow-other-keys)
5142 (let ((kmod (assoc-ref inputs "kmod")))
5143 ;; Fix for using a more modern gettext.
5144 (substitute* "autogen.sh"
5145 (("autoreconf")
5146 "autoreconf --force"))
5147 (substitute* "configure.ac"
5148 (("^AM_GNU_GETTEXT_VERSION.*$")
5149 (string-append "AM_GNU_GETTEXT_VERSION(["
5150 #$(package-version (this-package-native-input "gettext-minimal"))
5151 "])\n")))
5152 ;; Give the right 'modprobe' file name so that essential
5153 ;; modules such as msr.ko can be loaded.
5154 (substitute* (find-files "src" "\\.cpp$")
5155 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
5156 ;; These programs are only needed to calibrate, so using
5157 ;; relative file names avoids adding extra inputs. When they
5158 ;; are missing powertop gracefully handles it.
5159 (("/usr/s?bin/(hciconfig|hcitool|xset)" _ command)
5160 command
5161 command))))))))
5162 (native-inputs
5163 (list autoconf
5164 autoconf-archive
5165 automake
5166 gettext-minimal
5167 libtool
5168 pkg-config))
5169 (inputs
5170 (list kmod libnl ncurses pciutils zlib))
5171 (home-page "https://01.org/powertop/")
5172 (synopsis "Analyze power consumption on x86-based laptops")
5173 (description
5174 "PowerTOP is a Linux tool to diagnose issues with power consumption and
5175power management. In addition to being a diagnostic tool, PowerTOP also has
5176an interactive mode where the user can experiment various power management
5177settings for cases where the operating system has not enabled these
5178settings.")
5179 (license license:gpl2)))
5180
5181(define-public aumix
5182 (package
5183 (name "aumix")
5184 (version "2.9.1")
5185 (source (origin
5186 (method url-fetch)
5187 (uri (string-append
5188 "https://web.archive.org/web/20211201184543/"
5189 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
5190 version ".tar.bz2"))
5191 (sha256
5192 (base32
5193 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
5194 (build-system gnu-build-system)
5195 (arguments
5196 ;; Allow compilation with GCC 10.
5197 '(#:configure-flags '("CFLAGS=-O2 -g -fcommon")))
5198 (inputs (list ncurses))
5199 (home-page (string-append "https://web.archive.org/web/20211201184543/"
5200 "http://jpj.net/~trevor/aumix.html"))
5201 (synopsis "Audio mixer for X and the console")
5202 (description
5203 "Aumix adjusts an audio mixer from X, the console, a terminal,
5204the command line or a script.")
5205 (license license:gpl2+)))
5206
5207(define-public iotop-python
5208 ;; The last release is from 2013 and gives a misleading CONFIG_TASK_DELAY_ACCT
5209 ;; error on ‘newer’ kernels.
5210 (let ((revision "0")
5211 (commit "a14256a3ff74eeee59493ac088561f1bafab85a7"))
5212 (package
5213 (name "iotop-python")
5214 (version (git-version "0.6" revision commit))
5215 (source
5216 (origin
5217 (method git-fetch)
5218 (uri (git-reference
5219 (url "https://repo.or.cz/iotop.git")
5220 (commit commit)))
5221 (file-name (git-file-name name version))
5222 (sha256
5223 (base32 "00h5p8fk1zi237q8mqds8apqbis9iw0yih1hl0pr63dsnyzmmrpw"))))
5224 (build-system pyproject-build-system)
5225 (arguments
5226 (list
5227 #:tests? #f ; No tests.
5228 #:phases
5229 #~(modify-phases %standard-phases
5230 (add-after 'unpack 'fix-build-with-python3
5231 (lambda _
5232 (substitute* "setup.py"
5233 (("itervalues")
5234 "values")))))))
5235 (native-inputs (list python python-setuptools))
5236 (home-page "http://guichaz.free.fr/iotop/")
5237 (synopsis "Displays the IO activity of running processes")
5238 (description
5239 "Iotop is a Python program with a top like user interface to show the
5240processes currently causing I/O.")
5241 (license license:gpl2+))))
5242
5243(define-public iotop
5244 (package
5245 (name "iotop")
5246 (version "1.31")
5247 (source
5248 (origin
5249 (method git-fetch)
5250 (uri (git-reference
5251 (url "https://github.com/Tomas-M/iotop")
5252 (commit (string-append "v" version))))
5253 (file-name (git-file-name name version))
5254 (sha256
5255 (base32 "19ccdiw3flzk7gki90rc1nifmma79g2l87vhls4d2xr4z763m4nc"))))
5256 (build-system gnu-build-system)
5257 (arguments
5258 (list #:make-flags
5259 #~(list (string-append "CC=" #$(cc-for-target))
5260 (string-append "PREFIX=" #$output))
5261 #:tests? #f ; no tests
5262 #:phases
5263 #~(modify-phases %standard-phases
5264 (delete 'configure)))) ; no configure script
5265 (native-inputs (list pkg-config))
5266 (inputs (list ncurses))
5267 (home-page "https://github.com/Tomas-M/iotop")
5268 (synopsis "Interactive @command{top}-like input/output activity monitor")
5269 (description
5270 "iotop identifies which processes and threads are most responsible for
5271@acronym{I/O, input/output} activity such as disc reads and writes. It sorts
5272them in a live, interactive table overview similar to that of the well-known
5273@command{top}.
5274
5275This information makes it much easier for an administrator to see which tasks
5276are blocking others and adjust their priority (using @command{ionice}) or stop
5277or kill them altogether.")
5278 (license license:gpl2+)))
5279
5280(define-public fuse
5281 (package
5282 (name "fuse")
5283 (version "3.10.5")
5284 (source (origin
5285 (method url-fetch)
5286 (uri
5287 (string-append "https://github.com/libfuse/libfuse/releases/"
5288 "download/fuse-" version
5289 "/fuse-" version ".tar.xz"))
5290 (sha256
5291 (base32
5292 "0rlnnsiw614qcmgy8xz67044gqc1pbvvf2yxjv44lh27bm487qmj"))))
5293 (build-system meson-build-system)
5294 (inputs
5295 (list bash-minimal util-linux))
5296 (arguments
5297 `(#:configure-flags
5298 ,#~(list
5299 (string-append "-Dudevrulesdir=" #$output "/udev/rules.d")
5300 "-Duseroot=false")
5301 #:tests? #f
5302 #:phases
5303 ,#~(modify-phases %standard-phases
5304 (add-after 'unpack 'set-file-names
5305 (lambda* (#:key inputs #:allow-other-keys)
5306 ;; libfuse calls out to mount(8) and umount(8). Make sure
5307 ;; it refers to the right ones.
5308 (substitute* '("lib/mount_util.c")
5309 (("/bin/(u?)mount" _ maybe-u)
5310 (search-input-file inputs
5311 (string-append "bin/"
5312 maybe-u "mount"))))
5313 (substitute* '("util/mount.fuse.c")
5314 (("/bin/sh")
5315 (search-input-file inputs "/bin/sh")))
5316
5317 ;; This hack leads libfuse to search for 'fusermount' in
5318 ;; $PATH, where it may find a setuid-root binary, instead of
5319 ;; trying solely $out/sbin/fusermount and failing because
5320 ;; it's not setuid.
5321 (substitute* "lib/meson.build"
5322 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
5323 "-DFUSERMOUNT_DIR=\"/var/empty\"'"))))
5324 (add-after 'unpack 'fix-install
5325 (lambda* (#:key inputs #:allow-other-keys)
5326 (substitute* '("util/meson.build")
5327 (("install_helper.sh") "true"))
5328 (substitute* '("util/meson.build")
5329 (("fuseconf_path = .*")
5330 "fuseconf_path = '/etc/fuse.conf'"))))
5331 (add-before 'configure 'set-paths
5332 (lambda* (#:key inputs outputs #:allow-other-keys)
5333 (let ((dummy-init.d
5334 (string-append (getcwd) "/etc/init.d")))
5335 (setenv "MOUNT_FUSE_PATH"
5336 (string-append #$output "/sbin"))
5337 (setenv "UDEV_RULES_PATH"
5338 (string-append #$output
5339 "/lib/udev/rules.d"))))))))
5340 (supported-systems (remove target-hurd? %supported-systems))
5341 (home-page "https://github.com/libfuse/libfuse")
5342 (synopsis "Support file systems implemented in user space")
5343 (description
5344 "As a consequence of its monolithic design, file system code for Linux
5345normally goes into the kernel itself---which is not only a robustness issue,
5346but also an impediment to system extensibility. FUSE, for \"file systems in
5347user space\", is a kernel module and user-space library that tries to address
5348part of this problem by allowing users to run file system implementations as
5349user-space processes.")
5350 (license (list license:lgpl2.1 ; library
5351 license:gpl2+)))) ; command-line utilities
5352
5353(define-public fuse-3.18
5354 (package
5355 (inherit fuse)
5356 (name "fuse")
5357 (version "3.18.1")
5358 (source (origin
5359 (method url-fetch)
5360 (uri
5361 (string-append "https://github.com/libfuse/libfuse/releases/"
5362 "download/fuse-" version
5363 "/fuse-" version ".tar.gz"))
5364 (sha256
5365 (base32
5366 "0b1jp5gp2gv40gv6cvmv86rcr4l0mdh050qbvnxl0xcwya45qffx"))))))
5367
5368(define-public fuse-2
5369 (package
5370 (inherit fuse)
5371 (name "fuse")
5372 (version "2.9.9")
5373 (source
5374 (origin
5375 (method url-fetch)
5376 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
5377 "download/fuse-" version
5378 "/fuse-" version ".tar.gz"))
5379 (sha256
5380 (base32 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
5381 (patches (search-patches "fuse-overlapping-headers.patch"
5382 "fuse-glibc-2.34.patch"))))
5383 (build-system gnu-build-system)
5384 (native-inputs
5385 (list autoconf automake gettext-minimal libtool))
5386 (arguments
5387 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
5388 (assoc-ref %outputs "out")
5389 "/sbin")
5390 (string-append "INIT_D_PATH="
5391 (assoc-ref %outputs "out")
5392 "/etc/init.d")
5393
5394 ;; The rule makes /dev/fuse 666.
5395 (string-append "UDEV_RULES_PATH="
5396 (assoc-ref %outputs "out")
5397 "/lib/udev/rules.d"))
5398 #:phases
5399 (modify-phases %standard-phases
5400 (add-before 'bootstrap 'force-bootstrap
5401 (lambda _
5402 ;; Force a bootstrap to make the patch changes effective.
5403 (delete-file "configure")))
5404 (add-before 'build 'set-file-names
5405 (lambda* (#:key inputs #:allow-other-keys)
5406 ;; libfuse calls out to mount(8) and umount(8). Make sure
5407 ;; it refers to the right ones.
5408 (substitute* '("lib/mount_util.c" "util/mount_util.c")
5409 (("/bin/(u?)mount" _ maybe-u)
5410 (search-input-file inputs
5411 (string-append "bin/"
5412 maybe-u "mount"))))
5413 (substitute* '("util/mount.fuse.c")
5414 (("/bin/sh")
5415 (search-input-file inputs "/bin/sh")))
5416
5417 ;; This hack leads libfuse to search for 'fusermount' in
5418 ;; $PATH, where it may find a setuid-root binary, instead of
5419 ;; trying solely $out/sbin/fusermount and failing because
5420 ;; it's not setuid.
5421 (substitute* "lib/Makefile"
5422 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
5423 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))))))))
5424
5425(define-public fuse-for-appimage
5426 (package
5427 (inherit fuse)
5428 (name "fuse")
5429 (version "3.16.2")
5430 (source
5431 (origin
5432 (method url-fetch)
5433 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
5434 "download/fuse-" version "/fuse-" version ".tar.gz"))
5435 (sha256
5436 (base32 "11yfl2w2a445hllyzlakq97n32g06972vxpmh7lpbclnj9fhb5zp"))))
5437 (arguments
5438 (substitute-keyword-arguments (package-arguments fuse)
5439 ((#:configure-flags original-flags #~(list))
5440 #~(append #$original-flags '("--default-library=static")))))))
5441
5442(define-public unionfs-fuse
5443 (package
5444 (name "unionfs-fuse")
5445 (version "3.3")
5446 (source (origin
5447 (method git-fetch)
5448 (uri (git-reference
5449 (url "https://github.com/rpodgorny/unionfs-fuse")
5450 (commit (string-append "v" version))))
5451 (file-name (git-file-name name version))
5452 (sha256
5453 (base32
5454 "1wl5m5qnwf3s1792xphr35pb80sx8ybaqi3n3ddi5vvk3qjc4iws"))))
5455 (build-system cmake-build-system)
5456 (arguments
5457 (list
5458 #:phases
5459 #~(modify-phases %standard-phases
5460 (replace 'check
5461 ;; The epitome of ‘I tried’: run the 2 trivial tests that don't rely
5462 ;; on the fuse kernel module being loaded. All others would fail.
5463 (lambda* (#:key tests? #:allow-other-keys)
5464 (when tests?
5465 (invoke "pytest" "../source/test_all.py" "-k" "test_help")))))))
5466 (native-inputs
5467 (list pkg-config
5468
5469 ;; Only for the test ‘suite’.
5470 python
5471 python-pytest))
5472 (inputs
5473 (list fuse))
5474 (home-page "https://github.com/rpodgorny/unionfs-fuse")
5475 (synopsis "User-space union file system")
5476 (description
5477 "UnionFS-FUSE is a flexible union file system implementation in user
5478space, using the FUSE library. Mounting a union file system allows you to
5479\"aggregate\" the contents of several directories into a single mount point.
5480UnionFS-FUSE additionally supports copy-on-write.")
5481 (license license:bsd-3)))
5482
5483(define fuse-static
5484 (package (inherit fuse)
5485 (name "fuse-static")
5486 (source
5487 (origin
5488 (inherit (package-source fuse))
5489 (modules '((guix build utils)))
5490 (snippet
5491 #~(begin
5492 ;; Normally libfuse invokes mount(8) so that /etc/mtab is updated.
5493 ;; Change calls to 'mtab_needs_update' to 0 so that it doesn't do
5494 ;; that, allowing us to remove the dependency on util-linux
5495 ;; (something that is useful in initrds.)
5496 (substitute* "lib/mount_util.c"
5497 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)") "0")
5498 (("/bin/") ""))))))
5499 (arguments
5500 (substitute-keyword-arguments (package-arguments fuse)
5501 ((#:configure-flags flags '())
5502 #~(cons "-Ddefault_library=static"
5503 #$flags))))))
5504
5505(define-public unionfs-fuse/static
5506 (package (inherit unionfs-fuse)
5507 (synopsis "User-space union file system (statically linked)")
5508 (name (string-append (package-name unionfs-fuse) "-static"))
5509 (source
5510 (origin
5511 (inherit (package-source unionfs-fuse))
5512 (modules '((guix build utils)))
5513 (snippet
5514 #~(begin
5515 ;; Add -ldl to the libraries, because libfuse.a needs that.
5516 (substitute* "src/CMakeLists.txt"
5517 (("target_link_libraries(.*)\\)" _ libs)
5518 (string-append "target_link_libraries"
5519 libs " dl)")))))))
5520 (arguments
5521 (substitute-keyword-arguments (package-arguments unionfs-fuse)
5522 ((#:configure-flags flags #~'())
5523 #~(cons "-DCMAKE_EXE_LINKER_FLAGS=-static" #$flags))
5524 ((#:phases phases #~%standard-phases)
5525 #~(modify-phases #$phases
5526 (add-after 'install 'post-install
5527 (lambda _
5528 ;; By default, 'unionfs' keeps references to
5529 ;; $glibc/share/locale and similar stuff. Remove them.
5530 (remove-store-references (string-append #$output "/bin/unionfs"))
5531 ;; 'unionfsctl' has references to glibc as well. Since
5532 ;; we don't need it, remove it.
5533 (delete-file (string-append #$output "/bin/unionfsctl"))))))))
5534 (inputs (list fuse-static))))
5535
5536(define-public sshfs
5537 (package
5538 (name "sshfs")
5539 (version "3.7.5")
5540 (source (origin
5541 (method url-fetch)
5542 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
5543 "download/sshfs-" version "/sshfs-" version
5544 ".tar.xz"))
5545 (sha256
5546 (base32
5547 "1fx8c4fkvmfi29iw8wz5dwnniq666ji4y4vl67dij2fhq9ixni8f"))))
5548 (build-system meson-build-system)
5549 (arguments
5550 ;; XXX: tests are skipped: FUSE kernel module does not seem to be loaded
5551 '(#:tests? #f))
5552 (inputs
5553 (list fuse glib))
5554 (native-inputs
5555 (list pkg-config
5556 ;; man page
5557 python-docutils))
5558 (home-page "https://github.com/libfuse/sshfs")
5559 (synopsis "Mount remote file systems over SSH")
5560 (description
5561 "This is a file system client based on the SSH File Transfer Protocol.
5562Since most SSH servers already support this protocol it is very easy to set
5563up: on the server side there's nothing to do; on the client side mounting the
5564file system is as easy as logging into the server with an SSH client.")
5565 (license license:gpl2+)))
5566
5567(define-public sshfs-fuse
5568 (package (inherit sshfs)
5569 (name "sshfs-fuse")
5570 (properties `((superseded . ,sshfs)))))
5571
5572(define-public archivemount
5573 (package
5574 (name "archivemount")
5575 (version "0.9.1")
5576 (source
5577 (origin
5578 (method url-fetch)
5579 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
5580 "archivemount-" version ".tar.gz"))
5581 (sha256
5582 (base32 "1cy5b6qril9c3ry6fv7ir87s8iyy5vxxmbyx90dm86fbra0vjaf5"))))
5583 (build-system gnu-build-system)
5584 (inputs (list fuse-2 libarchive))
5585 (native-inputs (list pkg-config))
5586 (home-page "https://www.cybernoia.de/software/archivemount.html")
5587 (synopsis "Tool for mounting archive files with FUSE")
5588 (description "archivemount is a FUSE-based file system for Unix variants,
5589including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
5590mount point where it can be read from or written to as with any other file
5591system. This makes accessing the contents of the archive, which may be
5592compressed, transparent to other programs, without decompressing them.")
5593 (license license:lgpl2.0+)))
5594
5595(define-public numactl
5596 (package
5597 (name "numactl")
5598 (version "2.0.16")
5599 (source (origin
5600 (method url-fetch)
5601 (uri (string-append
5602 "https://github.com/numactl/numactl/releases/download/v"
5603 version "/numactl-" version ".tar.gz"))
5604 (sha256
5605 (base32
5606 "1j67wx3383fwqbvhg4nwqf72vpdgimmrvkpn3b9s2xzr7a4jy90v"))))
5607 (build-system gnu-build-system)
5608 (arguments
5609 `(,@(if (target-riscv64?)
5610 `(#:make-flags (list "LDFLAGS=-latomic"))
5611 '())
5612 ;; There's a 'test' target, but it requires NUMA support in the kernel
5613 ;; to run, which we can't assume to have.
5614 #:tests? #f))
5615 (home-page "https://github.com/numactl/numactl")
5616 (synopsis "Tools for non-uniform memory access (NUMA) machines")
5617 (description
5618 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
5619memory is not all in one place. The @command{numactl} program allows you to
5620run your application program on specific CPUs and memory nodes. It does this
5621by supplying a NUMA memory policy to the operating system before running your
5622program.
5623
5624The package contains other commands, such as @command{numastat},
5625@command{memhog}, and @command{numademo} which provides a quick overview of
5626NUMA performance on your system.")
5627 (license (list license:gpl2 ;programs
5628 license:lgpl2.1)))) ;library
5629
5630(define-public kbd-neo
5631 (package
5632 (name "kbd-neo")
5633 (version "2486")
5634 (source
5635 (origin
5636 (method url-fetch)
5637 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
5638 version "/linux/console/neo.map"))
5639 (file-name (string-append name "-" version ".map"))
5640 (sha256
5641 (base32
5642 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
5643 (build-system trivial-build-system)
5644 (arguments
5645 `(#:modules ((guix build utils))
5646 #:builder (begin
5647 (use-modules (guix build utils))
5648 (let ((out (string-append %output "/share/keymaps"))
5649 (source (assoc-ref %build-inputs "source")))
5650 (mkdir-p out)
5651 (copy-file source (string-append out "/neo.map"))
5652 #t))))
5653 (home-page "https://neo-layout.org")
5654 (synopsis "Neo2 console layout")
5655 (description
5656 "Kbd-neo provides the Neo2 keyboard layout for use with
5657@command{loadkeys(1)} from @code{kbd(4)}.")
5658 ;; The file is located in an svn directory, the entire content of
5659 ;; the directory is licensed as GPL3.
5660 (license license:gpl3+)))
5661
5662(define-public kbd
5663 (package
5664 (name "kbd")
5665 (version "2.5.1")
5666 (source (origin
5667 (method url-fetch)
5668 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
5669 version ".tar.xz"))
5670 (sha256
5671 (base32
5672 "10s608i4blprgy9nynlid0hglfdrrgln6wwjs9rhjf56hwilbpyc"))
5673 (modules '((guix build utils)))
5674 (snippet
5675 '(begin
5676 (substitute* '("src/unicode_start" "src/unicode_stop")
5677 ;; Assume the Coreutils are in $PATH.
5678 (("/usr/bin/tty")
5679 "tty"))))))
5680 (build-system gnu-build-system)
5681 (arguments
5682 '(#:phases
5683 (modify-phases %standard-phases
5684 (add-before 'build 'pre-build
5685 (lambda* (#:key inputs #:allow-other-keys)
5686 (let ((bzip2 (assoc-ref inputs "bzip2"))
5687 (gzip (assoc-ref inputs "gzip"))
5688 (xz (assoc-ref inputs "xz"))
5689 (zstd (assoc-ref inputs "zstd")))
5690 (substitute* "src/libkbdfile/kbdfile.c"
5691 (("bzip2") (string-append bzip2 "/bin/bzip2"))
5692 (("gzip") (string-append gzip "/bin/gzip"))
5693 (("xz -d") (string-append xz "/bin/xz -d"))
5694 (("zstd") (string-append zstd "/bin/zstd"))))))
5695 (add-after 'install 'post-install
5696 (lambda* (#:key outputs #:allow-other-keys)
5697 ;; Make sure these programs find their comrades.
5698 (let* ((out (assoc-ref outputs "out"))
5699 (bin (string-append out "/bin")))
5700 (for-each (lambda (prog)
5701 (wrap-program (string-append bin "/" prog)
5702 `("PATH" ":" prefix (,bin))))
5703 '("unicode_start" "unicode_stop"))))))))
5704 (native-inputs
5705 (list autoconf pkg-config))
5706 (inputs
5707 `(("bash" ,bash-minimal) ; for wrap-program
5708 ("bzip2" ,bzip2)
5709 ("gzip" ,gzip)
5710 ("pam" ,linux-pam)
5711 ("xz" ,xz)
5712 ("zstd" ,zstd)))
5713 (native-search-paths
5714 (list (search-path-specification
5715 (variable "LOADKEYS_KEYMAP_PATH")
5716 ;; Append ‘/**’ to recursively search all directories. One can then
5717 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
5718 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
5719 (files (list "share/keymaps/**")))))
5720 (home-page "https://kbd-project.org/")
5721 (synopsis "Linux keyboard utilities and keyboard maps")
5722 (description
5723 "This package contains keytable files and keyboard utilities compatible
5724for systems using the Linux kernel. This includes commands such as
5725@code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
5726 (license license:gpl2+)))
5727
5728(define-public loadkeys-static
5729 (package
5730 (inherit kbd)
5731 (name "loadkeys-static")
5732 (arguments
5733 (substitute-keyword-arguments (package-arguments kbd)
5734 ((#:configure-flags flags ''())
5735 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
5736 "--disable-vlock" ;so we don't need libpam
5737 "--disable-libkeymap")
5738 ,flags))
5739 ((#:make-flags flags ''())
5740 `(cons "LDFLAGS=-all-static -lrt -lpthread" ,flags))
5741 ((#:phases phases '%standard-phases)
5742 `(modify-phases ,phases
5743 (replace 'install
5744 (lambda* (#:key outputs #:allow-other-keys)
5745 (let ((out (assoc-ref outputs "out")))
5746 ;; The binary keeps references to gzip, among other things,
5747 ;; which we don't need in the initrd, so strip references.
5748 (remove-store-references "src/loadkeys")
5749
5750 (install-file "src/loadkeys"
5751 (string-append out "/bin")))))
5752 (delete 'post-install)))
5753 ((#:strip-flags _ '())
5754 ''("--strip-all"))
5755 ((#:allowed-references _ '())
5756 '())))
5757
5758 (synopsis "Statically-linked @command{loadkeys} program")
5759
5760 ;; This package is meant to be used internally in the initrd so don't
5761 ;; expose it.
5762 (properties '((hidden? . #t)))))
5763
5764(define-public inotify-tools
5765 (package
5766 (name "inotify-tools")
5767 (version "3.22.6.0")
5768 (source (origin
5769 (method git-fetch)
5770 (uri (git-reference
5771 (url "https://github.com/rvoicilas/inotify-tools")
5772 (commit version)))
5773 (file-name (git-file-name name version))
5774 (sha256
5775 (base32
5776 "1j9j8k5zjp8m4cl53zjncnll9z4dnvzr4ygmfcjk0ci81i59b18i"))))
5777 (build-system gnu-build-system)
5778 (native-inputs
5779 (list autoconf automake libtool))
5780 (arguments
5781 `(#:configure-flags
5782 (list "--disable-static")))
5783 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
5784 (synopsis "Monitor file accesses")
5785 (description
5786 "The inotify-tools packages provides a C library and command-line tools
5787to use Linux' inotify mechanism, which allows file accesses to be monitored.")
5788 (license license:gpl2+)))
5789
5790(define-public kmod
5791 (package
5792 (name "kmod")
5793 (version "29")
5794 (source (origin
5795 (method url-fetch)
5796 (uri
5797 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
5798 "kmod-" version ".tar.xz"))
5799 (sha256
5800 (base32
5801 "0am54mi5rk72g5q7k6l6f36gw3r9vwgjmyna43ywcjhqmakyx00b"))
5802 (patches (search-patches "kmod-module-directory.patch"))))
5803 (build-system gnu-build-system)
5804 (arguments
5805 (list #:configure-flags #~(list "--with-xz" "--with-zlib" "--with-zstd"
5806 "--disable-test-modules")
5807 #:phases
5808 #~(modify-phases %standard-phases
5809 (add-after 'unpack 'disable-tests
5810 (lambda _
5811 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
5812 (substitute* "Makefile.in"
5813 (("testsuite/test-modprobe") "")
5814 (("testsuite/test-depmod") "")
5815 (("testsuite/test-blacklist") ""))))
5816 (add-after 'install 'install-modprobe&co
5817 (lambda _
5818 (for-each (lambda (tool)
5819 (symlink "kmod"
5820 (string-append #$output "/bin/" tool)))
5821 '("insmod" "rmmod" "lsmod" "modprobe"
5822 "modinfo" "depmod")))))))
5823 (native-inputs (list pkg-config zstd)) ;zstd needed for tests
5824 (inputs (list xz zlib `(,zstd "lib")))
5825 (supported-systems (remove target-hurd? %supported-systems))
5826 (home-page "https://www.kernel.org/")
5827 (synopsis "Kernel module tools")
5828 (description "Kmod is a set of tools to handle common tasks with Linux
5829kernel modules like insert, remove, list, check properties, resolve
5830dependencies and aliases.
5831
5832These tools are designed on top of libkmod, a library that is shipped with
5833kmod. The aim is to be compatible with tools, configurations and indices
5834from the module-init-tools project.")
5835 (license license:gpl2+))) ; library under lgpl2.1+
5836
5837(define-public earlyoom
5838 (package
5839 (name "earlyoom")
5840 (version "1.7")
5841 (source (origin
5842 (method git-fetch)
5843 (uri (git-reference
5844 (url "https://github.com/rfjakob/earlyoom")
5845 (commit (string-append "v" version))))
5846 (file-name (git-file-name name version))
5847 (sha256
5848 (base32
5849 "1xqrs6wz59ks76hdgfd4vaj010kbvllilgam2xxyn0g56kai71zi"))))
5850 (build-system gnu-build-system)
5851 (arguments
5852 (list
5853 #:phases
5854 #~(modify-phases %standard-phases
5855 (delete 'configure) ; no configure script
5856 (add-before 'check 'set-go-HOME
5857 (lambda _
5858 (setenv "HOME" (getcwd))))
5859 (add-before 'check 'disable-failing-test
5860 (lambda _
5861 ;; This test relies on writing to /proc/%d/oom_score_adj.
5862 (substitute* "testsuite_cli_test.go"
5863 (("TestI" match)
5864 (string-append "skipped" match))))))
5865 #:make-flags
5866 #~(list (string-append "CC=" #$(cc-for-target))
5867 (string-append "VERSION=v" #$version)
5868 (string-append "PREFIX=" #$output)
5869 (string-append "SYSCONFDIR=" #$output "/etc")
5870 "GO111MODULE=off")
5871 #:test-target "test"))
5872 (native-inputs
5873 (append
5874 ;; To generate the manpage.
5875 (if (or (target-x86-64?) (target-x86-32?))
5876 (list pandoc)
5877 '())
5878 (list
5879 ;; For the test suite.
5880 cppcheck
5881 go-1.23)))
5882 (home-page "https://github.com/rfjakob/earlyoom")
5883 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
5884 (description "Early OOM is a minimalist out of memory (OOM) daemon that
5885runs in user space and provides a more responsive and configurable alternative
5886to the in-kernel OOM killer.")
5887 (license license:expat)))
5888
5889(define-public eudev
5890 (package
5891 (name "eudev")
5892 (version "3.2.14")
5893 (source (origin
5894 (method git-fetch)
5895 (uri (git-reference (url "https://github.com/eudev-project/eudev")
5896 (commit (string-append "v" version))))
5897 (file-name (git-file-name name version))
5898 (sha256
5899 (base32
5900 "1f6lz57igi7iw2ls3fpzgw42bfznam4nf9368h7x8yf1mb737yxz"))))
5901 (build-system gnu-build-system)
5902 (arguments
5903 (list
5904 ;; The binary should be built to look for its rules under
5905 ;; /etc/udev/rules.d, which is where the udev-shepherd-service keeps
5906 ;; them.
5907 #:make-flags #~(list "udevrulesdir=/etc/udev/rules.d")
5908 #:phases
5909 #~(modify-phases %standard-phases
5910 (add-before 'bootstrap 'patch-file-names
5911 (lambda* (#:key inputs native-inputs #:allow-other-keys)
5912 (substitute* "man/make.sh"
5913 (("/usr/bin/xsltproc")
5914 (search-input-file (or native-inputs inputs) "/bin/xsltproc")))))
5915 (add-before 'bootstrap 'install-in-lib
5916 (lambda _
5917 ;; When the udev-service-type instantiates /etc, it collects
5918 ;; hardware files from the <package>/lib/udev/hwdb.d directories
5919 ;; of different packages. Since we set sysconfdir to /etc, the
5920 ;; only package-dependent location we can install hwdb files is
5921 ;; in <package>/lib/udev/hwdb.d. Eudev is configured to install
5922 ;; these files in sysconfdir, but they should be placed into
5923 ;; udevlibexecdir.
5924 (copy-file "hwdb/Makefile.am" "hwdb/files.am")
5925 (call-with-output-file "hwdb/Makefile.am"
5926 (lambda (port)
5927 (format port "hardwarelibdir = $(udevlibexecdir)/hwdb.d\n")
5928 (format port "include ./files.am")))
5929 (substitute* "hwdb/files.am"
5930 (("dist_udevhwdb_DATA =")
5931 "dist_hardwarelib_DATA ="))
5932 ;; Do not install the empty udev.conf template.
5933 (substitute* "src/udev/Makefile.am"
5934 (("dist_udevconf_DATA =")
5935 "dist_noinst_DATA ="))
5936 ;; Do not ensure that /etc/udev/rules.d exists.
5937 (substitute* "rules/Makefile.am"
5938 (("\\$\\(MKDIR_P\\) \\$\\(DESTDIR\\)\\$\\(udevconfdir\\)/rules\\.d")
5939 "true"))))
5940 (add-after 'install 'move-static-library
5941 (lambda _
5942 (let ((source (string-append #$output "/lib/libudev.a"))
5943 (target (string-append #$output:static "/lib/libudev.a")))
5944 (mkdir-p (dirname target))
5945 (link source target)
5946 (delete-file source)
5947 ;; Remove reference to the static library from the .la file
5948 ;; such that Libtool looks for it in the usual places.
5949 (substitute* (string-append #$output "/lib/libudev.la")
5950 (("old_library=.*")
5951 "old_library=''\n")))))
5952 (replace 'install
5953 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
5954 ;; Although the runtime udevrulesdir is set to
5955 ;; /etc/udev/rules.d, the package should provide its default
5956 ;; rules under $libdir/udev/rules.d.
5957 (let* ((default-udev-rules.d (string-append #$output
5958 "/lib/udev/rules.d"))
5959 (make-flags (cons (string-append "udevrulesdir="
5960 default-udev-rules.d)
5961 (delete "udevrulesdir=/etc/udev/rules.d"
5962 make-flags))))
5963 (apply (assoc-ref %standard-phases 'install)
5964 `(,@args #:make-flags ,make-flags))))))
5965 #:configure-flags
5966 #~(list "--enable-manpages"
5967 ;; By default, autoconf uses $prefix/etc. The udev-service-type
5968 ;; makes sure /etc is set up with rules and hardware file
5969 ;; descriptions.
5970 "--sysconfdir=/etc")))
5971 (native-search-paths
5972 (list (search-path-specification
5973 (variable "UDEV_HWDB_PATH")
5974 (files '("lib/udev/hwdb.d")))))
5975 (native-inputs
5976 (list autoconf
5977 automake
5978 gperf
5979 libtool
5980 pkg-config
5981 ;; For tests.
5982 perl
5983 python-wrapper
5984 ;; For documentation.
5985 docbook-xml-4.2
5986 docbook-xsl
5987 libxslt))
5988 (inputs
5989 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
5990 ;; and similar; it also installs the '60-persistent-storage.rules' file,
5991 ;; which contains the rules to do that.
5992 (list `(,util-linux "lib") ;for blkid
5993 kmod))
5994 (outputs '("out" "static"))
5995 (home-page "https://github.com/eudev-project/eudev")
5996 (synopsis "Userspace device management")
5997 (description "Udev is a daemon which dynamically creates and removes
5998device nodes from /dev/, handles hotplug events and loads drivers at boot
5999time.")
6000 (license license:gpl2+)))
6001
6002(define-public python-evdev
6003 (package
6004 (name "python-evdev")
6005 (version "1.9.1")
6006 (source
6007 (origin
6008 (method git-fetch) ; no tests data in PyPi package
6009 (uri (git-reference
6010 (url "https://github.com/gvalkov/python-evdev")
6011 (commit (string-append "v" version))))
6012 (file-name (git-file-name name version))
6013 (sha256
6014 (base32 "09p7pj0xhv23hqlpx865klrxrf7x6sw1bdsgs6pq900jvz92pl16"))))
6015 (build-system pyproject-build-system)
6016 (arguments
6017 (list
6018 #:test-flags
6019 ;; Silent tests requiring access to /dev/uinput.
6020 #~(list "-k" (string-append "not test_open"
6021 " and not test_open_context"
6022 " and not test_enable_events"
6023 " and not test_abs_values"
6024 " and not test_write"))
6025 #:phases
6026 #~(modify-phases %standard-phases
6027 (add-before 'build 'fix-hard-coded-directory
6028 (lambda* (#:key inputs #:allow-other-keys)
6029 (substitute* "setup.py"
6030 (("/usr/include/linux")
6031 (string-append
6032 (assoc-ref inputs "kernel-headers") "/include/linux"))))))))
6033 (native-inputs
6034 (list python-pytest python-setuptools python-wheel))
6035 (home-page "https://github.com/gvalkov/python-evdev")
6036 (synopsis "Bindings to the Linux input handling subsystem")
6037 (description
6038 "Python-evdev provides bindings to the generic input event interface in
6039Linux. The @code{evdev} interface serves the purpose of passing events
6040generated in the kernel directly to userspace through character devices that
6041are typically located in @file{/dev/input/}.
6042
6043This package also comes with bindings to @code{uinput}, the userspace input
6044subsystem. @code{uinput} allows userspace programs to create and handle input
6045devices that can inject events directly into the input subsystem.")
6046 (license license:bsd-3)))
6047
6048(define-public interception-tools
6049 (package
6050 (name "interception-tools")
6051 (version "0.6.8")
6052 (home-page "https://gitlab.com/interception/linux/tools")
6053 (source (origin
6054 (method git-fetch)
6055 (uri (git-reference
6056 (url home-page)
6057 (commit (string-append "v" version))))
6058 (file-name (git-file-name name version))
6059 (sha256
6060 (base32
6061 "1sbidym6ld4c8cx2ww5i54zsv8v0kygv15zq1yimz44v4my605wf"))))
6062 (build-system cmake-build-system)
6063 (native-inputs
6064 (list pkg-config))
6065 (inputs
6066 (list boost libevdev eudev yaml-cpp))
6067 (arguments
6068 `(#:tests? #f)) ; no test suite
6069 (synopsis "Utilities for operating on input events of evdev devices")
6070 (description
6071 "Interception Tools provides a composable infrastructure on top of
6072@code{libudev} and @code{libevdev}. The following utilities are provided:
6073
6074@itemize
6075@item @command{udevmon} --- monitor input devices for launching tasks
6076@item @command{intercept} --- redirect device input events to stdout
6077@item @command{uinput} --- redirect device input events from stding to virtual device
6078@item @command{mux} --- mux streams of input events
6079@end itemize")
6080 ;; Dual-licensed under GPLv3+ or "something else" on request, per
6081 ;; 'README.md'.
6082 (license license:gpl3+)))
6083
6084(define-public interception-dual-function-keys
6085 (package
6086 (name "interception-dual-function-keys")
6087 (version "1.4.0")
6088 (home-page "https://gitlab.com/interception/linux/plugins/dual-function-keys")
6089 (source (origin
6090 (method git-fetch)
6091 (uri (git-reference
6092 (url home-page)
6093 (commit version)))
6094 (file-name (git-file-name name version))
6095 (sha256
6096 (base32
6097 "0s49vbg3j4rwh78i8rx8qr7myql09p7b3lhrjl0p7dd98xp6ann6"))))
6098 (build-system gnu-build-system)
6099 (inputs
6100 (list libevdev yaml-cpp))
6101 (arguments
6102 `(#:make-flags (list ,(string-append "CC=" (cc-for-target))
6103 ,(string-append "CXX=" (cxx-for-target))
6104 (string-append "PREFIX=" %output))
6105 #:phases
6106 (modify-phases %standard-phases
6107 (add-after 'unpack 'fix-libevdev-path
6108 (lambda* (#:key inputs #:allow-other-keys)
6109 (let ((libevdev (assoc-ref inputs "libevdev")))
6110 (substitute* "config.mk"
6111 (("/usr/include/libevdev-1.0")
6112 (string-append libevdev "/include/libevdev-1.0")))
6113 #t)))
6114 ;; No configure script
6115 (delete 'configure))
6116 ;; No tests are included.
6117 #:tests? #f))
6118 (synopsis "Tap for one key, hold for another")
6119 (description
6120 "Dual Function Keys is a plugin for @code{interception-tools} that allows
6121one to send arbitrary keycodes when a given key is tapped or held.")
6122 (license license:expat)))
6123
6124(define-public lvm2
6125 (package
6126 (name "lvm2")
6127 (version "2.03.22")
6128 (source (origin
6129 (method url-fetch)
6130 (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2."
6131 version ".tgz")
6132 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
6133 version ".tgz")))
6134 (sha256
6135 (base32
6136 "0z6w6bknhwh1n3qfkb5ij6x57q3wjf28lq3l8kh7rkhsplinjnjc"))
6137 (patches (search-patches "lvm2-no-systemd.patch"))
6138 (modules '((guix build utils)))
6139 (snippet
6140 '(begin
6141 (use-modules (guix build utils))
6142
6143 ;; Honor sysconfdir.
6144 (substitute* "make.tmpl.in"
6145 (("^confdir = .*$")
6146 "confdir = @sysconfdir@\n")
6147 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
6148 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
6149 (build-system gnu-build-system)
6150 (native-inputs
6151 (list config
6152 pkg-config procps)) ;tests use 'pgrep'
6153 (inputs
6154 `(("libaio" ,libaio)
6155 ("udev" ,eudev)))
6156 (arguments
6157 `(#:phases
6158 (modify-phases %standard-phases
6159 (add-after 'unpack 'update-config
6160 (lambda* (#:key inputs native-inputs #:allow-other-keys)
6161 (install-file (search-input-file
6162 (or native-inputs inputs) "/bin/config.sub")
6163 "autoconf")
6164 (install-file (search-input-file
6165 (or native-inputs inputs) "/bin/config.guess")
6166 "autoconf")))
6167 (add-after 'configure 'set-makefile-shell
6168 (lambda _
6169 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
6170 ;; expected.
6171 (setenv "SHELL" (which "sh"))
6172
6173 ;; Replace /bin/sh with the right file name.
6174 (patch-makefile-SHELL "make.tmpl"))))
6175
6176 #:configure-flags (list (string-append "--sysconfdir="
6177 (assoc-ref %outputs "out")
6178 "/etc/lvm")
6179 "--enable-udev_sync"
6180 "--enable-udev_rules"
6181 "--enable-pkgconfig"
6182 "--enable-cmdlib"
6183 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
6184
6185 ;; Make sure programs such as 'dmsetup' can
6186 ;; find libdevmapper.so.
6187 (string-append "LDFLAGS=-Wl,-rpath="
6188 (assoc-ref %outputs "out")
6189 "/lib,-rpath="
6190 (assoc-ref %outputs "out")
6191 "/lib/device-mapper")
6192 ;; This is needed when cross-compiling.
6193 ,@(if (%current-target-system)
6194 '("ac_cv_func_malloc_0_nonnull=yes"
6195 "ac_cv_func_realloc_0_nonnull=yes")
6196 '()))
6197
6198 ;; The tests use 'mknod', which requires root access.
6199 #:tests? #f))
6200 (supported-systems (remove target-hurd? %supported-systems))
6201 (home-page "https://sourceware.org/lvm2/")
6202 (synopsis "Logical volume management for Linux")
6203 (description
6204 "LVM2 is the logical volume management tool set for Linux-based systems.
6205This package includes the user-space libraries and tools, including the device
6206mapper. Kernel components are part of Linux-libre.")
6207
6208 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
6209 ;; Command-line tools are GPLv2.
6210 (license (list license:gpl2 license:lgpl2.1))))
6211
6212(define-public (libdevmapper-propagated-inputs)
6213 (list eudev))
6214
6215(define-public lvm2-static
6216 (package
6217 (inherit lvm2)
6218 (name "lvm2-static")
6219
6220 (inputs `(,@(package-inputs lvm2)
6221 ("udev:static" ,eudev "static")))
6222
6223 (arguments
6224 (substitute-keyword-arguments (package-arguments lvm2)
6225 ((#:configure-flags flags '())
6226 ;; LVM2 doesn't use Libtool, hence the custom option.
6227 `(append '("--enable-static_link")
6228 ;; Building dmeventd statically is complicated due to a
6229 ;; requirement on libdevmapper.a, which is being phased out
6230 ;; in favor of libdevice-mapper.a, which in turn is is not
6231 ;; easily made available at dmeventd build time. Just ignore
6232 ;; it until the situation improves.
6233 (delete "--enable-dmeventd" ,flags)))
6234 ((#:phases phases)
6235 #~(modify-phases #$phases
6236 (add-before 'configure 'adjust-Makefile
6237 (lambda _
6238 ;; These fixes are related to the upstream libdm->device_mapper
6239 ;; migration and will hopefully be fixed upstream in due time.
6240 (substitute* "tools/Makefile.in"
6241 ;; This variable is empty in a static configuration and causes
6242 ;; an erroneous GCC command line.
6243 (("-L\\$\\(interfacebuilddir\\)") "")
6244 ;; Remove obsolete reference to libdevmapper.a.
6245 (("-ldevmapper") ""))
6246 #t))
6247 (add-after 'install 'adjust-pkgconfig
6248 ;; The static eudev is missing its pkg config file, and I am not
6249 ;; rebuilding it at this point.
6250 (lambda* (#:key inputs #:allow-other-keys)
6251 (substitute* (string-append #$output "/lib/pkgconfig/devmapper.pc")
6252 (("Requires.private: .*") "")
6253 (("Libs.private:")
6254 (format #f "Libs.private: -L~a -ludev"
6255 (dirname (search-input-file inputs "lib/libudev.a")))))))))))
6256 (synopsis "Logical volume management for Linux (statically linked)")))
6257
6258(define-public thin-provisioning-tools
6259 (package
6260 (name "thin-provisioning-tools")
6261 (version "0.8.5")
6262 (source
6263 (origin
6264 (method git-fetch)
6265 (uri (git-reference
6266 (url "https://github.com/jthornber/thin-provisioning-tools")
6267 (commit (string-append "v" version))))
6268 (file-name (git-file-name name version))
6269 (sha256
6270 (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19"))))
6271 (build-system gnu-build-system)
6272 (arguments
6273 ;; Doesn't build with --enable-testing due to a function name collision
6274 ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released.
6275 `(#:tests? #f))
6276 (native-inputs
6277 `(("automake" ,automake)
6278 ("autoreconf" ,autoconf)))
6279 (inputs
6280 (list boost expat libaio))
6281 (synopsis "Tools for manipulating the metadata of device-mapper targets")
6282 (description "A suite of tools for manipulating the metadata of the
6283dm-thin, dm-cache and dm-era device-mapper targets.")
6284 (home-page "https://github.com/jthornber/thin-provisioning-tools")
6285 (license license:gpl3+)))
6286
6287(define-public watchdogd
6288 (package
6289 (name "watchdogd")
6290 (version "4.0")
6291 (source (origin
6292 (method git-fetch)
6293 (uri (git-reference
6294 (url "https://github.com/troglobit/watchdogd")
6295 (commit version)))
6296 (file-name (git-file-name name version))
6297 (sha256
6298 (base32
6299 "112mdhqykl78qk8l7nx7h19nnd58v0axj6ws8s47n9a64b867li4"))))
6300 (build-system gnu-build-system)
6301 (native-inputs (list autoconf automake libtool pkg-config))
6302 (inputs (list libconfuse libite libuev))
6303 (synopsis "Advanced system & process supervisor for Linux")
6304 (description "This package provides an advanced monitor of critical system
6305resources, supervises the heartbeat of processes, records deadline
6306transgressions, and initiates a controlled reset if needed.")
6307 (home-page "https://troglobit.com/projects/watchdogd/")
6308 (license license:isc)))
6309
6310(define-public wireless-tools
6311 (package
6312 (name "wireless-tools")
6313 (version "30.pre9")
6314 (source
6315 (origin
6316 (method url-fetch)
6317 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/"
6318 "Linux/wireless_tools." version ".tar.gz"))
6319 (sha256
6320 (base32 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
6321 (snippet
6322 #~(begin
6323 ;; Remove the older header files that are not free software.
6324 (for-each (lambda (n)
6325 (delete-file (format #f "wireless.~a.h" n)))
6326 '(10 11 12 13 14 15 16 17 18 19 20))))))
6327 (build-system gnu-build-system)
6328 (arguments
6329 (list #:make-flags
6330 #~(list (string-append "PREFIX=" #$output)
6331 (string-append "INSTALL_MAN=" #$output "/share/man")
6332 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
6333 "BUILD_STATIC=")
6334 #:phases
6335 #~(modify-phases %standard-phases
6336 (replace 'configure
6337 (lambda* (#:key target #:allow-other-keys)
6338 (when target
6339 ;; Cross-compilation: use the cross tools.
6340 (substitute* (find-files "." "Makefile")
6341 (("CC = .*$")
6342 (string-append "CC = " target "-gcc\n"))
6343 (("AR = .*$")
6344 (string-append "AR = " target "-ar\n"))
6345 (("RANLIB = .*$")
6346 (string-append "RANLIB = " target "-ranlib\n")))))))
6347 #:tests? #f))
6348 (synopsis "Tools for manipulating Linux Wireless Extensions")
6349 (description "Wireless Tools are used to manipulate the now-deprecated
6350Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
6351Extension was an interface allowing you to set Wireless LAN specific
6352parameters and get the specific stats. It is deprecated in favor the nl80211
6353interface.")
6354 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
6355 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
6356 ;; other files are distributed under gpl2.
6357 (license (list license:gpl2 license:lgpl2.1+))))
6358
6359(define-public crda
6360 (package
6361 (name "crda")
6362 (version "4.15")
6363 (source
6364 (origin
6365 (method git-fetch)
6366 (uri (git-reference
6367 (url "https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/crda.git")
6368 (commit (string-append "v" version))))
6369 (file-name (git-file-name name version))
6370 (sha256
6371 (base32 "1ajh8zx84p15y9wawh764zawniwn059iw9m32v56ajvkz9xbnkp2"))
6372 (patches (search-patches "crda-optional-gcrypt.patch"))))
6373 (build-system gnu-build-system)
6374 (arguments
6375 (list #:phases
6376 #~(modify-phases %standard-phases
6377 (delete 'configure)
6378 (add-after 'unpack 'gzip-deterministically
6379 (lambda _
6380 (substitute* "Makefile"
6381 (("gzip" command)
6382 (string-append command " --no-name")))))
6383 #$@(if (%current-target-system)
6384 #~((add-after 'unpack 'fix-pkg-config
6385 (lambda* (#:key target #:allow-other-keys)
6386 (substitute* "Makefile"
6387 (("pkg-config" command)
6388 (string-append target "-" command))))))
6389 #~())
6390 (add-before 'build 'patch-Makefile
6391 (lambda _
6392 (substitute* "Makefile"
6393 (("ldconfig") "true"))))
6394 (add-before 'build 'set-regulatory-db-file-name
6395 (lambda* (#:key native-inputs inputs #:allow-other-keys)
6396 ;; Tell CRDA where to find our database.
6397 (let ((regdb (assoc-ref (or native-inputs inputs)
6398 "wireless-regdb")))
6399 (substitute* "crda.c"
6400 (("\"/lib/crda/regulatory.bin\"")
6401 (string-append "\"" regdb
6402 "/lib/crda/regulatory.bin\"")))))))
6403 #:test-target "verify"
6404 #:make-flags
6405 #~(list
6406 (string-append "CC=" #$(cc-for-target))
6407 "V=1"
6408
6409 ;; Disable signature-checking on 'regulatory.bin'.
6410 ;; The reason is that this simplifies maintenance
6411 ;; on our side (no need to manage a distro key
6412 ;; pair), and we can guarantee integrity of
6413 ;; 'regulatory.bin' by other means anyway, such as
6414 ;; 'guix gc --verify'. See
6415 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
6416 ;; for a discssion.
6417 "USE_OPENSSL=0"
6418
6419 (string-append "PREFIX=" #$output)
6420 (string-append "SBINDIR=" #$output "/sbin/")
6421 (string-append "UDEV_RULE_DIR="
6422 #$output "/lib/udev/rules.d")
6423 (string-append "LDFLAGS=-Wl,-rpath="
6424 #$output "/lib -L.")
6425 (string-append "REG_BIN="
6426 #$(this-package-native-input "wireless-regdb")
6427 "/lib/crda/regulatory.bin")
6428 "all_noverify")))
6429 (native-inputs (list pkg-config wireless-regdb))
6430 (inputs (list libnl))
6431 (home-page
6432 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
6433 (synopsis "@acronym{CRDA, Central Regulatory Domain Agent} for WiFi")
6434 (description
6435 "The @acronym{CRDA, Central Regulatory Domain Agent} acts as the udev
6436helper for communication between the kernel Linux and user space for regulatory
6437compliance.")
6438 (license license:copyleft-next)))
6439
6440(define-public wireless-regdb
6441 (package
6442 (name "wireless-regdb")
6443 (version "2023.05.03")
6444 (source (origin
6445 (method url-fetch)
6446 (uri (string-append
6447 "mirror://kernel.org/software/network/wireless-regdb/"
6448 "wireless-regdb-" version ".tar.xz"))
6449 (sha256
6450 (base32 "04lc9jp8zxhyqxvkhrm637sswi2xm48jw8jnp3iflnknnf5d0m7j"))
6451
6452 ;; We're building 'regulatory.bin' by ourselves.
6453 (snippet '(begin
6454 (delete-file "regulatory.bin")))))
6455 (build-system gnu-build-system)
6456 (arguments
6457 (list
6458 #:phases
6459 #~(modify-phases %standard-phases
6460 (add-after 'unpack 'gzip-determinism
6461 (lambda _
6462 (substitute* "Makefile"
6463 (("gzip") "gzip --no-name"))))
6464 (add-after 'unpack 'omit-signature
6465 (lambda _
6466 (substitute* "Makefile"
6467 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
6468 ;; don't provide (see below). Disable it.
6469 ((" regulatory\\.db\\.p7s") "")
6470 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
6471 ;; but ‘make install’ depends only on the latter while
6472 ;; installing both (and failing). Depend on it explicitly.
6473 (("^install: " all) (string-append all "regulatory.db ")))))
6474 (delete 'configure)) ; no configure script
6475
6476 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
6477 ;; is computed and can be equal to 'maintainer-clean'; when that
6478 ;; happens, we can end up deleting the 'regulatory.bin' file that we
6479 ;; just built. Thus, build things sequentially.
6480 #:parallel-build? #f
6481
6482 #:tests? #f ; no tests
6483 #:make-flags
6484 #~(list (string-append "PREFIX=" #$output)
6485 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
6486
6487 ;; Leave this empty so that db2bin.py doesn't try to sign
6488 ;; ‘regulatory.bin’. This allows us to avoid managing a key
6489 ;; pair for the whole distribution.
6490 (string-append "REGDB_PRIVKEY=")
6491 ;; Don't generate a public key for the same reason. These are
6492 ;; used as Makefile targets and can't be the empty string.
6493 (string-append "REGDB_PUBCERT=/dev/null")
6494 (string-append "REGDB_PUBKEY=/dev/null"))))
6495 (native-inputs
6496 (list python-wrapper))
6497 (home-page
6498 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
6499 (synopsis "Wireless regulatory database")
6500 (description
6501 "This package contains the wireless regulatory database for the
6502@acronym{CRDA, Central Regulatory Database Agent}. The database contains
6503information on country-specific regulations for the wireless spectrum.")
6504 (license license:isc)))
6505
6506(define-public lm-sensors
6507 (package
6508 (name "lm-sensors")
6509 (version "3.6.2")
6510 (source
6511 (origin
6512 (method git-fetch)
6513 (uri (git-reference
6514 (url "https://github.com/hramrach/lm-sensors")
6515 (commit (string-append "V" (string-join
6516 (string-split version #\.) "-")))))
6517 (file-name (git-file-name name version))
6518 (sha256
6519 (base32 "0p2ck8p9zb1w53l37pvm6c10vi6r8bfz51nd3sdwwsfhfhgvsr0j"))
6520 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
6521 (build-system gnu-build-system)
6522 (outputs '("lib" ; avoid perl in closure
6523 "out"))
6524 (arguments
6525 (list
6526 #:tests? #f ; no 'check' target
6527 #:make-flags
6528 #~(list (string-append "PREFIX=" #$output)
6529 (string-append "ETCDIR=" #$output:lib "/etc")
6530 (string-append "INCLUDEDIR=" #$output:lib "/include")
6531 (string-append "MANDIR=" #$output "/share/man")
6532 (string-append "LIBDIR=" #$output:lib "/lib"))
6533 #:phases
6534 #~(modify-phases %standard-phases
6535 (delete 'configure)
6536 (add-before 'build 'patch-exec-paths
6537 (lambda* (#:key inputs #:allow-other-keys)
6538 (substitute* "prog/detect/sensors-detect"
6539 (("`uname")
6540 (string-append
6541 "`" (assoc-ref inputs "coreutils") "/bin/uname"))
6542 (("(`|\")modprobe" all open-quote)
6543 (string-append
6544 open-quote #$(this-package-input "kmod") "/bin/modprobe")))
6545 (substitute* '("prog/pwm/pwmconfig" "prog/pwm/fancontrol")
6546 (("gnuplot")
6547 (search-input-file inputs "/bin/gnuplot"))
6548 (("cat ")
6549 (string-append (search-input-file inputs "/bin/cat") " "))
6550 (("e?grep " match)
6551 (string-append
6552 (search-input-file
6553 inputs (string-append "/bin/" (string-trim-right match)))
6554 " "))
6555 (("sed -e")
6556 (string-append (search-input-file inputs "/bin/sed") " -e"))
6557 (("cut -d")
6558 (string-append (search-input-file inputs "/bin/cut") " -d"))
6559 (("sleep ")
6560 (string-append (search-input-file inputs "/bin/sleep") " "))
6561 (("readlink -f")
6562 (string-append
6563 (search-input-file inputs "/bin/readlink") " -f"))))))))
6564 (inputs
6565 (list gnuplot kmod perl rrdtool))
6566 (native-inputs
6567 (list bison flex pkg-config which))
6568 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
6569 (synopsis "Utilities to read temperature/voltage/fan sensors")
6570 (description
6571 "Lm-sensors is a hardware health monitoring package for Linux. It allows
6572you to access information from temperature, voltage, and fan speed sensors.
6573It works with most newer systems.")
6574 (license license:gpl2+)))
6575
6576(define-public iucode-tool
6577 (package
6578 (name "iucode-tool")
6579 (version "2.3.1")
6580 (source (origin
6581 (method url-fetch)
6582 (uri (string-append "https://gitlab.com/iucode-tool/releases"
6583 "/raw/latest/iucode-tool_" version ".tar.xz"))
6584 (sha256
6585 (base32
6586 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
6587 (build-system gnu-build-system)
6588 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
6589 (synopsis "Manipulate Intel microcode bundles")
6590 (description
6591 "@command{iucode_tool} is a utility to work with microcode packages for
6592Intel processors. It can convert between formats, extract specific versions,
6593create a firmware image suitable for the Linux kernel, and more.")
6594 ;; cpuid.h is available for i686, x86_64, and ia64.
6595 (supported-systems '("i686-linux" "x86_64-linux"))
6596 (license license:gpl2+)))
6597
6598(define-public i2c-tools
6599 (package
6600 (name "i2c-tools")
6601 (version "4.3")
6602 (source (origin
6603 (method url-fetch)
6604 (uri (string-append
6605 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
6606 version ".tar.xz"))
6607 (sha256
6608 (base32
6609 "1y0fphjd5ah2j886x8i175r7viq0hmx666hyca0wi4dzrm290qxk"))))
6610 (build-system gnu-build-system)
6611 (arguments
6612 `(#:tests? #f ; no 'check' target
6613 #:make-flags
6614 ,#~(list (string-append "PREFIX=" #$output)
6615 (string-append "LDFLAGS+=-Wl,-rpath=" #$output "/lib")
6616 (string-append "CC=" #$(cc-for-target)))
6617 ;; No configure script.
6618 #:phases (modify-phases %standard-phases (delete 'configure))))
6619 (inputs
6620 (list perl))
6621 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
6622 (synopsis "I2C tools for Linux")
6623 (description
6624 "The i2c-tools package contains a heterogeneous set of I2C tools for
6625Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
6626EEPROM decoding scripts, EEPROM programming tools, and a python module for
6627SMBus access.")
6628 (license license:gpl2+)))
6629
6630(define-public i2c-tools-3
6631 (package
6632 (inherit i2c-tools)
6633 (name "i2c-tools")
6634 (version "3.1.2")
6635 (source (origin
6636 (method url-fetch)
6637 (uri (string-append
6638 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
6639 version ".tar.bz2"))
6640 (sha256
6641 (base32 "0hd4c1w8lnwc3j95h3vpd125170l1d4myspyrlpamqx6wbr6jpnv"))))
6642 (arguments
6643 (substitute-keyword-arguments (package-arguments i2c-tools)
6644 ((#:make-flags _)
6645 #~(list (string-append "prefix=" #$output)
6646 (string-append "CC=" #$(cc-for-target))))))))
6647
6648(define-public python-smbus
6649 (package
6650 (inherit i2c-tools)
6651 (name "python-smbus")
6652 (build-system pyproject-build-system)
6653 (arguments
6654 (list #:tests? #f ;; No test suite.
6655 #:phases
6656 #~(modify-phases %standard-phases
6657 (add-after 'unpack 'change-directory
6658 (lambda _ (chdir "py-smbus")))
6659 (add-after 'change-directory 'set-library-path
6660 (lambda _
6661 (substitute* "setup.py"
6662 (("-L\\.\\./lib")
6663 (string-append "-L" #$(this-package-input "i2c-tools")
6664 "/lib"))))))))
6665 (inputs (list i2c-tools))
6666 (native-inputs (list python-setuptools python-wheel))
6667 (synopsis "I2C/SMBus access for Python")
6668 (description "This package provides a Python library to access
6669@acronym{I2C, Inter-Integrated Circuit} and @acronym{SMBus, System
6670Management Bus} devices on Linux.")))
6671
6672(define-public xsensors
6673 (package
6674 (name "xsensors")
6675 (version "0.70")
6676 (source (origin
6677 (method url-fetch)
6678 (uri (string-append
6679 "http://www.linuxhardware.org/xsensors/xsensors-"
6680 version ".tar.gz"))
6681 (sha256
6682 (base32
6683 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
6684 (build-system gnu-build-system)
6685 (inputs `(("lm-sensors" ,lm-sensors "lib")
6686 ("gtk" ,gtk+-2)))
6687 (native-inputs (list pkg-config))
6688 (arguments
6689 `(#:phases
6690 (modify-phases %standard-phases
6691 (add-before 'configure 'enable-deprecated
6692 (lambda _
6693 (substitute* "src/Makefile.in"
6694 (("-DGDK_DISABLE_DEPRECATED") "")
6695 (("-DGTK_DISABLE_DEPRECATED") ""))
6696 #t))
6697 (add-before 'configure 'remove-Werror
6698 (lambda _
6699 (substitute* '("configure" "src/Makefile.in")
6700 (("-Werror") ""))
6701 #t)))))
6702 (home-page "http://www.linuxhardware.org/xsensors/")
6703 (synopsis "Hardware health information viewer")
6704 (description
6705 "Xsensors reads data from the libsensors library regarding hardware
6706health such as temperature, voltage and fan speed and displays the information
6707in a digital read-out.")
6708 (license license:gpl2+)))
6709
6710(define-public perf
6711 (package
6712 (name "perf")
6713 (version (package-version linux-libre))
6714 (source (package-source linux-libre))
6715 (build-system gnu-build-system)
6716 (arguments
6717 '(#:phases
6718 (modify-phases %standard-phases
6719 (replace 'configure
6720 (lambda* (#:key inputs #:allow-other-keys)
6721 (setenv "SHELL_PATH" (which "bash"))
6722 (chdir "tools/perf")
6723
6724 ;; In Linux 6.10.6, 'Makefile.config' overrides PKG_CONFIG_PATH
6725 ;; when looking for libtraceevent and thus fails to find it.
6726 ;; Remove that.
6727 (substitute* "Makefile.config"
6728 (("PKG_CONFIG_PATH=[[:graph:]]+")
6729 ""))
6730
6731 ;; This file hard-codes file system layouts for specific distros
6732 ;; but not for ours; address that. With this change, one can run
6733 ;; "perf report --symfs=$HOME/.guix-profile" (without
6734 ;; "/lib/debug") and 'perf' should be able to find separate debug
6735 ;; info files.
6736 (substitute* "util/dso.c"
6737 (("/usr/lib/debug")
6738 "/lib/debug")))))
6739 #:make-flags (list (string-append "prefix="
6740 (assoc-ref %outputs "out"))
6741 "CC=gcc"
6742 "WERROR=0"
6743
6744 ;; By default, 'config/Makefile' uses lib64 on
6745 ;; x86_64. Work around that.
6746 "lib=lib")
6747 #:tests? #f)) ;no tests
6748 (native-inputs
6749 (list pkg-config
6750 bison
6751 flex
6752 ;; There are build scripts written in these languages.
6753 perl
6754 python-2
6755 python-3
6756 ;; Documentation
6757 docbook-xsl
6758 xmlto
6759 asciidoc))
6760 (inputs
6761 (list slang ;for the interactive TUI
6762 zlib
6763 ;; newt
6764 python-2 ;'perf' links against libpython
6765 elfutils
6766 libiberty ;used alongside BDF for symbol demangling
6767 libunwind ;better stack walking
6768 libtraceevent
6769 numactl)) ;for 'perf bench numa mem'
6770 (home-page "https://perf.wiki.kernel.org/")
6771 (synopsis "Linux profiling with performance counters")
6772 (description
6773 "perf is a tool suite for profiling using hardware performance counters,
6774with support in the Linux kernel. perf can instrument CPU performance
6775counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
6776of lightweight profiling. This package contains the user-land tools and in
6777particular the @code{perf} command.")
6778 (license (package-license linux-libre))))
6779
6780(define-public pflask
6781 (package
6782 (name "pflask")
6783 (version "0.2")
6784 (source (origin
6785 (method git-fetch)
6786 (uri (git-reference
6787 (url "https://github.com/ghedo/pflask")
6788 (commit (string-append "v" version))))
6789 (file-name (git-file-name name version))
6790 (sha256
6791 (base32
6792 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
6793 (build-system cmake-build-system)
6794 (arguments
6795 '(#:tests? #f)) ; no tests
6796 (home-page "https://ghedo.github.io/pflask/")
6797 (synopsis "Simple tool for creating Linux namespace containers")
6798 (description "pflask is a simple tool for creating Linux namespace
6799containers. It can be used for running a command or even booting an OS inside
6800an isolated container, created with the help of Linux namespaces. It is
6801similar in functionality to chroot, although pflask provides better isolation
6802thanks to the use of namespaces.")
6803 (license license:bsd-2)))
6804
6805(define-public singularity
6806 (package
6807 (name "singularity")
6808 (version "2.6.1")
6809 (source (origin
6810 (method url-fetch)
6811 (uri (string-append "https://github.com/singularityware/singularity/"
6812 "releases/download/" version
6813 "/singularity-" version ".tar.gz"))
6814 (sha256
6815 (base32
6816 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
6817 (modules '((guix build utils)))
6818 (snippet
6819 '(begin
6820 ;; Do not create directories in /var.
6821 (substitute* "Makefile.in"
6822 (("\\$\\(MAKE\\) .*install-data-hook") ""))
6823
6824 ;; The original source overrides PATH so that it points to
6825 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
6826 ;; on Guix System. Leave PATH unchanged so we refer to the
6827 ;; installed Coreutils, grep, etc.
6828 (substitute* "bin/singularity.in"
6829 (("^PATH=.*" all)
6830 (string-append "#" all "\n")))
6831
6832 (substitute* (find-files "libexec/cli" "\\.exec$")
6833 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
6834 _ program)
6835 (string-append "/run/privileged/bin/singularity-"
6836 program "-helper")))
6837
6838 ;; These squashfs mount options are apparently no longer
6839 ;; supported since Linux-libre 5.4.5.
6840 (substitute* "src/lib/image/squashfs/mount.c"
6841 (("\"errors=remount-ro\"")
6842 "NULL"))))))
6843 (build-system gnu-build-system)
6844 (arguments
6845 (list
6846 #:configure-flags #~(list "--localstatedir=/var")
6847 #:phases
6848 #~(modify-phases %standard-phases
6849 (add-after 'unpack 'patch-references
6850 (lambda _
6851 (substitute* "libexec/cli/build.exec.in"
6852 (("-mksquashfs") (string-append "-" (which "mksquashfs"))))
6853 (substitute* (append
6854 (find-files "libexec" "functions")
6855 (find-files "libexec/bootstrap-scripts" ".*sh$")
6856 (find-files "libexec/cli" ".*exec$"))
6857 (("\\| grep ")
6858 (string-append "| " (which "grep") " "))
6859 (("egrep ")
6860 (string-append (which "egrep") " "))
6861 ((" sed ")
6862 (string-append " " (which "sed") " ")))))
6863 (add-after 'install 'set-PATH
6864 (lambda _
6865 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
6866 ;; But don't override PATH, so that other tools like zcat and
6867 ;; tar can still be found if they are available.
6868 (let ((coreutils #$(this-package-input "coreutils")))
6869 (wrap-program (string-append #$output "/bin/singularity")
6870 `("PATH" prefix (,(string-append coreutils "/bin"))))
6871 (substitute* (string-append #$output "/bin/run-singularity")
6872 (("/usr/bin/env singularity")
6873 (string-append (which "env") " "
6874 #$output "/bin/singularity")))))))))
6875 (inputs
6876 (list bash-minimal
6877 coreutils
6878 libarchive
6879 python-wrapper
6880 squashfs-tools
6881 zlib))
6882 (home-page "https://singularity.lbl.gov/")
6883 (synopsis "Container platform")
6884 (description "Singularity is a container platform supporting a number of
6885container image formats. It can build SquashFS container images or import
6886existing Docker images. Singularity requires kernel support for container
6887isolation or root privileges.")
6888 (license license:bsd-3)))
6889
6890(define-public python-spython
6891 (package
6892 (name "python-spython")
6893 (version "0.3.13")
6894 (source
6895 (origin
6896 (method url-fetch)
6897 (uri (pypi-uri "spython" version))
6898 (sha256
6899 (base32 "0kly851k6mj7xzcybciav5d0pq5q04pzg7c5a1g712bqbxkha4ck"))))
6900 (build-system pyproject-build-system)
6901 (arguments
6902 (list
6903 #:phases
6904 #~(modify-phases %standard-phases
6905 ;; Configure absolute path to singularity.
6906 (add-after 'unpack 'configure
6907 (lambda* (#:key inputs #:allow-other-keys)
6908 (let ((singularity (search-input-file inputs "bin/singularity")))
6909 (substitute* "spython/utils/terminal.py"
6910 (("software=\"singularity\"")
6911 (string-append "software=\"" singularity "\"")))
6912 (substitute* (list "spython/utils/terminal.py"
6913 "spython/main/help.py"
6914 "spython/main/base/command.py")
6915 (("\\[\"singularity\"")
6916 (string-append "[\"" singularity "\"")))
6917 (substitute* "spython/main/execute.py"
6918 (("shutil.which\\(\"singularity\"\\)")
6919 (string-append "shutil.which(\"" singularity "\")"))))))
6920 ;; Skip tests that require network access.
6921 (add-before 'check 'skip-tests
6922 (lambda _
6923 (delete-file "spython/tests/test_client.py"))))))
6924 (inputs
6925 (list singularity))
6926 (native-inputs
6927 (list python-pytest
6928 python-pytest-runner
6929 python-setuptools
6930 python-wheel))
6931 (home-page "https://github.com/singularityhub/singularity-cli")
6932 (synopsis "Singularity Python client")
6933 (description "@code{python-spython} is a Python library to interact with
6934Singularity containers.")
6935 (license license:mpl2.0)))
6936
6937(define-public libnvme
6938 (package
6939 (name "libnvme")
6940 (version "1.5")
6941 (source (origin
6942 (method git-fetch)
6943 (uri (git-reference
6944 (url "https://github.com/linux-nvme/libnvme.git")
6945 (commit (string-append "v" version))))
6946 (sha256
6947 (base32 "1wq8bw60l090z2kb717wyzk5wz1jrcn31ykdaa7k9pz9w79v0v67"))
6948 (file-name (git-file-name name version))))
6949 (build-system meson-build-system)
6950 (outputs (list "out" "doc")) ; docs are 80% of all output
6951 (arguments
6952 (list
6953 #:configure-flags
6954 #~(let ((doc (string-append #$output:doc "/share/doc/" #$name)))
6955 (list (string-append "-Dhtmldir=" doc "/html")
6956 (string-append "-Drstdir=" doc "/rst")
6957 "-Ddocs-build=true" "-Ddocs=all"))))
6958 (native-inputs (list pkg-config perl python python-sphinx))
6959 ;; libnvme.pc, libnvme-mi.pc lists these in Requires.private.
6960 (propagated-inputs (list dbus json-c openssl))
6961 (home-page "https://github.com/linux-nvme/libnvme")
6962 (synopsis "C Library for NVM Express on Linux")
6963 (description "libnvme provides type definitions for NVMe specification
6964structures, enumerations, and bit fields, helper functions to construct,
6965dispatch, and decode commands and payloads, and utilities to connect, scan,
6966and manage nvme devices on a Linux system.")
6967 (license license:lgpl2.1+)))
6968
6969(define-public nvme-cli
6970 (package
6971 (name "nvme-cli")
6972 (version "2.5")
6973 (home-page "https://github.com/linux-nvme/nvme-cli")
6974 (source (origin
6975 (method git-fetch)
6976 (uri (git-reference
6977 (url home-page)
6978 (commit (string-append "v" version))))
6979 (sha256
6980 (base32 "1jv1xir6gm86yyk5846qqkcjhc1bq103zyxf794fznyinh4nhlbg"))
6981 (file-name (git-file-name name version))))
6982 (build-system meson-build-system)
6983 (outputs (list "out" "doc")) ; docs make up ~70% of total size
6984 (arguments
6985 (list
6986 #:configure-flags #~(list (format #f "-Dhtmldir=~a/share/doc/~a/html"
6987 #$output:doc #$name)
6988 "-Ddocs=all")))
6989 (native-inputs (list pkg-config))
6990 (inputs (list libnvme json-c zlib))
6991 (synopsis "NVM-Express user space tooling for Linux")
6992 (description "Nvme-cli is a utility to provide standards compliant tooling
6993for NVM-Express drives. It was made specifically for Linux as it relies on the
6994IOCTLs defined by the mainline kernel driver.")
6995 (license license:gpl2+)))
6996
6997(define-public rfkill
6998 (package
6999 (name "rfkill")
7000 (version "0.5")
7001 (source (origin
7002 (method url-fetch)
7003 (uri (string-append "mirror://kernel.org/software/network/"
7004 name "/" name "-" version ".tar.xz"))
7005 (sha256
7006 (base32
7007 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
7008 (build-system gnu-build-system)
7009 (arguments
7010 `(#:make-flags (list "CC=gcc"
7011 (string-append "PREFIX=" %output))
7012 #:phases (modify-phases %standard-phases
7013 (delete 'configure))
7014 #:tests? #f))
7015 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
7016 (synopsis "Tool for enabling and disabling wireless devices")
7017 (description
7018 "rfkill is a simple tool for accessing the rfkill device interface,
7019which is used to enable and disable wireless networking devices, typically
7020WLAN, Bluetooth and mobile broadband.")
7021 (license (license:non-copyleft "file://COPYING"
7022 "See COPYING in the distribution."))
7023 ;; rfkill is part of util-linux as of 2.31.
7024 (properties `((superseded . ,util-linux)))))
7025
7026(define-public acpi
7027 (package
7028 (name "acpi")
7029 (version "1.7")
7030 (source (origin
7031 (method url-fetch)
7032 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
7033 version "/" name "-" version ".tar.gz"))
7034 (sha256
7035 (base32
7036 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
7037 (build-system gnu-build-system)
7038 (home-page "http://acpiclient.sourceforge.net")
7039 (synopsis "Display information on ACPI devices")
7040 (description "@code{acpi} attempts to replicate the functionality of the
7041\"old\" @code{apm} command on ACPI systems, including battery and thermal
7042information. It does not support ACPI suspending, only displays information
7043about ACPI devices.")
7044 (license license:gpl2+)))
7045
7046(define-public acpid
7047 (package
7048 (name "acpid")
7049 (version "2.0.34")
7050 (source (origin
7051 (method url-fetch)
7052 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
7053 version ".tar.xz"))
7054 (sha256
7055 (base32
7056 "0cxkdbd087kj9ikprvvjpk0ixzqbipf2rmj6qyp7r15wzj65q29d"))))
7057 (build-system gnu-build-system)
7058 (home-page "https://sourceforge.net/projects/acpid2/")
7059 (synopsis "Daemon for delivering ACPI events to user-space programs")
7060 (description
7061 "acpid is designed to notify user-space programs of Advanced
7062Configuration and Power Interface (ACPI) events. acpid should be started
7063during the system boot, and will run as a background process. When an ACPI
7064event is received from the kernel, acpid will examine the list of rules
7065specified in /etc/acpi/events and execute the rules that match the event.")
7066 (license license:gpl2+)))
7067
7068(define-public sysfsutils
7069 (package
7070 (name "sysfsutils")
7071 (version "2.1.0")
7072 (source
7073 (origin
7074 (method url-fetch)
7075 (uri
7076 (string-append
7077 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
7078 version ".tar.gz"))
7079 (sha256
7080 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
7081 (build-system gnu-build-system)
7082 (home-page "https://linux-diag.sourceforge.net/Sysfsutils.html")
7083 (synopsis "System utilities based on Linux sysfs")
7084 (description
7085 "These are a set of utilities built upon sysfs, a virtual file system in
7086Linux kernel versions 2.5+ that exposes a system's device tree. The package
7087also contains the libsysfs library.")
7088 ;; The library is under lgpl2.1+ (all files say "or any later version").
7089 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
7090 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
7091
7092(define-public cpufrequtils
7093 (let ((commit "a2f0c39d5f21596bb9f5223e895c0ff210b265d0")
7094 (revision "1"))
7095 (package
7096 (name "cpufrequtils")
7097 (version (git-version "008" revision commit ))
7098 (source
7099 (origin
7100 (method git-fetch)
7101 (uri
7102 (git-reference
7103 (url "https://git.kernel.org/pub/scm/linux/kernel/git/brodo/cpufrequtils.git")
7104 (commit commit)))
7105 (file-name (git-file-name name version))
7106 (sha256
7107 (base32 "01n2hp6v89cilqqvqvlcprphyhnljsjclh4h1zf3b1l7ypz29lbp"))))
7108 (build-system gnu-build-system)
7109 (arguments
7110 `(#:tests? #f ; no test suite
7111 #:make-flags
7112 (let ((out (assoc-ref %outputs "out")))
7113 (list "PROC=false" ; obsoleted by sysfs in Linux 2.6(!)
7114 (string-append "CC=" ,(cc-for-target))
7115 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
7116 "INSTALL=install"
7117 (string-append "bindir=" out "/bin")
7118 (string-append "sbindir=" out "/sbin")
7119 (string-append "mandir=" out "/share/man")
7120 (string-append "includedir=" out "/include")
7121 (string-append "libdir=" out "/lib")
7122 (string-append "localedir=" out "/share/locale")
7123 (string-append "docdir=" out "/share/doc/" ,name)))
7124 #:phases
7125 (modify-phases %standard-phases
7126 (delete 'configure)))) ; no configure script
7127 (native-inputs
7128 `(("gettext" ,gettext-minimal)))
7129 (home-page
7130 "http://ftp.be.debian.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html")
7131 (synopsis "Utilities to get and set CPU frequency on Linux")
7132 (description
7133 "The cpufrequtils suite contains utilities to retrieve CPU frequency
7134information, and set the CPU frequency if supported, using the cpufreq
7135capabilities of the Linux kernel.")
7136 (license license:gpl2))))
7137
7138(define-public libite
7139 (package
7140 (name "libite")
7141 (version "2.5.2")
7142 (source
7143 (origin
7144 (method git-fetch)
7145 (uri (git-reference
7146 (url "https://github.com/troglobit/libite")
7147 (commit (string-append "v" version))))
7148 (file-name (git-file-name name version))
7149 (sha256
7150 (base32 "0i27ppb557kdc1hm7nf0f5r7sxvqma31pr57h79whl6qcp28gy4a"))))
7151 (build-system gnu-build-system)
7152 (arguments
7153 `(#:configure-flags
7154 (list "--disable-static")
7155 #:phases
7156 (modify-phases %standard-phases
7157 (add-after 'unpack 'fix-tests
7158 (lambda* (#:key inputs #:allow-other-keys)
7159 ;; replace paths to the executables
7160 (substitute* "test/which.c"
7161 (("/usr/bin/which")
7162 (search-input-file inputs "/bin/which"))
7163 (("ls\"")
7164 (string-append
7165 (search-input-file inputs "/bin/ls") "\"")))
7166 ;; create pidfile in /tmp instead of /var
7167 (substitute* "test/pidfile.c" (("/var/tmp") "/tmp")))))))
7168 (native-inputs (list autoconf automake libtool which))
7169 (synopsis "Library providing missing pieces in GNU libc")
7170 (description "This package provides many of the missing pieces in GNU
7171libc. Most notably the string functions: strlcpy(3), strlcat(3) and the *BSD
7172sys/queue.h and sys/tree.h API's.")
7173 (home-page "https://troglobit.com/projects/libite/")
7174 (license license:expat)))
7175
7176(define-public libuev
7177 (package
7178 (name "libuev")
7179 (version "2.4.0")
7180 (source
7181 (origin
7182 (method git-fetch)
7183 (uri (git-reference
7184 (url "https://github.com/troglobit/libuev")
7185 (commit (string-append "v" version))))
7186 (file-name (git-file-name name version))
7187 (sha256
7188 (base32
7189 "0ih82lxfdcq179kknzdl5c8vi1l0n5j7yh68y8f6kwsrm457paf7"))))
7190 (build-system gnu-build-system)
7191 (native-inputs (list autoconf automake libtool))
7192 (synopsis "Lightweight event loop library for epoll family APIs")
7193 (description "This package provides small event loop that wraps the
7194epoll family of APIs.")
7195 (home-page "https://troglobit.com/projects/libuev/")
7196 (license license:expat)))
7197
7198(define-public libraw1394
7199 (package
7200 (name "libraw1394")
7201 (version "2.1.2")
7202 (source (origin
7203 (method url-fetch)
7204 (uri (string-append
7205 "mirror://kernel.org/linux/libs/ieee1394/"
7206 name "-" version ".tar.xz"))
7207 (sha256
7208 (base32
7209 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
7210 (build-system gnu-build-system)
7211 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
7212 (synopsis "Interface library for the Linux IEEE1394 drivers")
7213 (description
7214 "Libraw1394 is the only supported interface to the kernel side raw1394 of
7215the Linux IEEE-1394 subsystem, which provides direct access to the connected
72161394 buses to user space. Through libraw1394/raw1394, applications can directly
7217send to and receive from other nodes without requiring a kernel driver for the
7218protocol in question.")
7219 (license license:lgpl2.1+)))
7220
7221(define-public libavc1394
7222 (package
7223 (name "libavc1394")
7224 (version "0.5.4")
7225 (source (origin
7226 (method url-fetch)
7227 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
7228 name "-" version ".tar.gz"))
7229 (sha256
7230 (base32
7231 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
7232 (build-system gnu-build-system)
7233 (native-inputs
7234 (list pkg-config))
7235 (propagated-inputs
7236 (list libraw1394)) ; required by libavc1394.pc
7237 (home-page "https://sourceforge.net/projects/libavc1394/")
7238 (synopsis "AV/C protocol library for IEEE 1394")
7239 (description
7240 "Libavc1394 is a programming interface to the AV/C specification from
7241the 1394 Trade Association. AV/C stands for Audio/Video Control.")
7242 (license license:lgpl2.1+)))
7243
7244(define-public libiec61883
7245 (package
7246 (name "libiec61883")
7247 (version "1.2.0")
7248 (source (origin
7249 (method url-fetch)
7250 (uri (string-append
7251 "mirror://kernel.org/linux/libs/ieee1394/"
7252 name "-" version ".tar.xz"))
7253 (sha256
7254 (base32
7255 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
7256 (build-system gnu-build-system)
7257 (native-inputs
7258 (list pkg-config))
7259 (propagated-inputs
7260 (list libraw1394)) ; required by libiec61883.pc
7261 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
7262 (synopsis "Isochronous streaming media library for IEEE 1394")
7263 (description
7264 "The libiec61883 library provides a higher level API for streaming DV,
7265MPEG-2 and audio over Linux IEEE 1394.")
7266 (license license:lgpl2.1+)))
7267
7268(define-public mdadm
7269 (package
7270 (name "mdadm")
7271 (version "4.2")
7272 (source (origin
7273 (method url-fetch)
7274 (uri (string-append
7275 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
7276 version ".tar.xz"))
7277 (sha256
7278 (base32
7279 "07ghmibmbnkdy91ng87zdllzicm299l20dhs9m5bfjw6f1b22726"))))
7280 (build-system gnu-build-system)
7281 (arguments
7282 (list #:make-flags
7283 #~(list (string-append "CC=" #$(cc-for-target))
7284 "INSTALL=install"
7285 "CHECK_RUN_DIR=0"
7286 ;; TODO: tell it where to find 'sendmail'
7287 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
7288 (string-append "BINDIR=" #$output "/sbin")
7289 (string-append "MANDIR=" #$output "/share/man")
7290 (string-append "UDEVDIR=" #$output "/lib/udev"))
7291 #:phases
7292 #~(modify-phases %standard-phases
7293 (add-before 'build 'patch-program-paths
7294 (lambda* (#:key native-inputs inputs #:allow-other-keys)
7295 (let ((coreutils (assoc-ref (or native-inputs inputs)
7296 "coreutils")))
7297 (substitute* "udev-md-raid-arrays.rules"
7298 (("/usr/bin/(readlink|basename)" all program)
7299 (string-append coreutils "/bin/" program))))))
7300 (add-before 'build 'remove-W-error
7301 (lambda _
7302 ;; We cannot build with -Werror on i686 due to a
7303 ;; 'sign-compare' warning in util.c.
7304 (substitute* "Makefile"
7305 (("-Werror") ""))))
7306 (delete 'configure))
7307 ;; Tests must be run as root.
7308 #:tests? #f))
7309 (inputs
7310 (list eudev))
7311 (supported-systems (remove target-hurd? %supported-systems))
7312 (home-page "http://neil.brown.name/blog/mdadm")
7313 (synopsis "Tool for managing Linux Software RAID arrays")
7314 (description
7315 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
7316assemble, report on, and monitor arrays. It can also move spares between raid
7317arrays when needed.")
7318 (license license:gpl2+)))
7319
7320(define-public mdadm-static
7321 (package
7322 (inherit mdadm)
7323 (name "mdadm-static")
7324 (arguments
7325 (substitute-keyword-arguments (package-arguments mdadm)
7326 ((#:make-flags flags)
7327 #~(cons* "LDFLAGS = -static"
7328 "CXFLAGS = -DNO_LIBUDEV"
7329 #$flags))
7330 ((#:phases phases)
7331 #~(modify-phases #$phases
7332 (add-after 'install 'remove-cruft
7333 (lambda* (#:key outputs #:allow-other-keys)
7334 (let* ((out (assoc-ref outputs "out"))
7335 (precious? (lambda (file)
7336 (member file '("." ".." "sbin"))))
7337 (directories (scandir out (negate precious?))))
7338 (with-directory-excursion out
7339 (for-each delete-file-recursively directories)
7340 (remove-store-references "sbin/mdadm")
7341 (delete-file "sbin/mdmon")))))))
7342 ((#:modules modules %default-gnu-modules)
7343 `((ice-9 ftw) ,@modules))
7344 ((#:strip-flags _ '())
7345 ''("--strip-all")) ;strip a few extra KiB
7346 ((#:allowed-references _ '("out"))
7347 '("out")))) ;refer only self
7348 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
7349
7350(define-public multipath-tools
7351 (package
7352 (name "multipath-tools")
7353 (version "0.11.0")
7354 (home-page "https://github.com/opensvc/multipath-tools")
7355 (source (origin
7356 (method git-fetch)
7357 (uri (git-reference (url home-page) (commit version)))
7358 (file-name (git-file-name name version))
7359 (sha256
7360 (base32
7361 "1yl2cd4xgw2l5xzx5dbdf7awhrvfbjsrspli9i6bmxc5j4jkvazr"))
7362 (modules '((guix build utils)))
7363 (snippet
7364 '(begin
7365 ;; Drop bundled valgrind headers.
7366 (delete-file-recursively "third-party")
7367 (substitute* '("multipathd/main.c"
7368 "libmpathutil/debug.c")
7369 (("#include \"../third-party/")
7370 "#include \""))))))
7371 (build-system gnu-build-system)
7372 (arguments
7373 (list
7374 #:test-target "test"
7375 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
7376 (string-append "prefix=" #$output)
7377 ;; Install Udev rules below this directory, relative
7378 ;; to the prefix.
7379 (string-append "systemd_prefix=" #$output))
7380 #:phases
7381 #~(modify-phases %standard-phases
7382 (add-after 'unpack 'patch-source
7383 (lambda* (#:key inputs #:allow-other-keys)
7384 (let ((libdevmapper.h
7385 (search-input-file inputs "include/libdevmapper.h"))
7386 (libudev.h
7387 (search-input-file inputs "include/libudev.h")))
7388 (substitute* "Makefile.inc"
7389 (("/bin/echo") "echo")
7390 (("\\$\\(prefix\\)/usr") "$(prefix)")
7391 (("configdir.*:= \\$\\(prefix\\)/etc/multipath/conf.d")
7392 "configdir := /etc/multipath/conf.d")
7393 ;; Do not save timestamp to avoid gzip "timestamp
7394 ;; out-of-range" warnings.
7395 (("gzip -9") "gzip -9n"))
7396 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
7397 (("/usr/include/libdevmapper.h") libdevmapper.h)
7398 (("/usr/include/libudev.h") libudev.h)))))
7399 (add-after 'unpack 'skip-failing-tests
7400 (lambda _
7401 ;; This test and the module's setup() test an arbitrary block
7402 ;; device node name, but the build environment has none.
7403 (substitute* "tests/devt.c"
7404 (("return get_one_devt.*") "return 0;\n")
7405 (("cmocka_unit_test\\(test_devt2devname_devt_good\\),") ""))
7406 ;; The above triggers -Werror=unused-function. Ignore it.
7407 (substitute* "tests/Makefile"
7408 (("CFLAGS \\+= " match)
7409 (string-append match "-Wno-error=unused-function ")))))
7410 (delete 'configure) ;no configure script
7411 (add-before 'build 'no-fortify-3
7412 (lambda _
7413 ;; NOTE: The check made seems to wrongly assume the
7414 ;; FORTIFY_SOURCE=3 is valid. However, when compiling, warnings
7415 ;; are emitted from glibc, resulting in failed build. Fix this
7416 ;; by forcing the usage of FORTIFY_SOURCE=2.
7417 (substitute* "create-config.mk"
7418 (("FORTIFY_SOURCE=3")
7419 "FORTIFY_SOURCE=2"))))
7420 (add-before 'build 'set-LDFLAGS
7421 (lambda _
7422 ;; Note: this cannot be passed as a make flag because that will
7423 ;; override the build system LDFLAGS.
7424 (setenv "LDFLAGS"
7425 (string-append "-Wl,-rpath=" #$output "/lib")))))))
7426
7427 (native-inputs
7428 (list perl pkg-config valgrind/pinned
7429 ;; For tests.
7430 cmocka))
7431 (inputs
7432 (list json-c
7433 libaio
7434 liburcu
7435 lvm2
7436 readline
7437 eudev
7438 ;; For libmount.
7439 `(,util-linux "lib")))
7440 (synopsis "Access block devices through multiple paths")
7441 (description
7442 "This package provides the following binaries to drive the
7443Linux Device Mapper multipathing driver:
7444@enumerate
7445@item @command{multipath} - Device mapper target autoconfig.
7446@item @command{multipathd} - Multipath daemon.
7447@item @command{mpathpersist} - Manages SCSI persistent reservations on
7448@code{dm} multipath devices.
7449@item @command{kpartx} - Create device maps from partition tables.
7450@end enumerate")
7451 (license (list license:gpl2+ ;main distribution
7452 license:lgpl2.0+)))) ;libmpathcmd/mpath_cmd.h
7453
7454(define-public libaio
7455 (package
7456 (name "libaio")
7457 (version "0.3.113")
7458 (source (origin
7459 (method url-fetch)
7460 (uri (list
7461 (string-append "https://releases.pagure.org/libaio/"
7462 name "-" version ".tar.gz")))
7463 (sha256
7464 (base32
7465 "02r0g2vfv6kfljplm3ga93w4xw13q2wixbn9hwi7ahqdzp2x2i1c"))
7466 (patches (search-patches "libaio-32bit-test.patch"))))
7467 (build-system gnu-build-system)
7468 (arguments
7469 (list #:make-flags
7470 #~(list (string-append "prefix=" #$output)
7471 (string-append "CC=" #$(cc-for-target)))
7472 #:test-target "partcheck" ; need root for a full 'check'
7473 #:phases
7474 #~(modify-phases %standard-phases
7475 (add-after 'unpack 'disable-problematic-tests
7476 (lambda _
7477 (with-directory-excursion "harness/cases"
7478 ;; The 21.t test fails with "Expected 4096, got
7479 ;; 18446744073709551605" (see:
7480 ;; https://pagure.io/libaio/issue/26).
7481 (rename-file "21.t" "21.t.disabled"))))
7482 (delete 'configure) ; no configure script
7483 #$@(if (target-riscv64?)
7484 #~((add-after 'unpack 'patch-test
7485 (lambda* (#:key build-inputs #:allow-other-keys)
7486 (invoke "patch" "-p1" "-i"
7487 #$(local-file
7488 (search-patch
7489 "libaio-riscv-test5.patch"))))))
7490 #~()))))
7491 (native-inputs
7492 (if (target-riscv64?)
7493 (list (search-patch "libaio-riscv-test5.patch")
7494 patch)
7495 '()))
7496 (home-page "https://pagure.io/libaio")
7497 (synopsis "Linux-native asynchronous I/O access library")
7498 (description
7499 "This library enables userspace to use Linux kernel asynchronous I/O
7500system calls, important for the performance of databases and other advanced
7501applications.")
7502 (license license:lgpl2.1+)))
7503
7504(define-public blktrace
7505 ;; Take a newer commit to get the latest patches.
7506 (let ((commit "b9ea6e507e8849f01d06aa48c0c59c5cee4820be")
7507 (revision "1"))
7508 (package
7509 (name "blktrace")
7510 (version (git-version "1.3.0" revision commit))
7511 (home-page
7512 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
7513 (source (origin
7514 (method git-fetch)
7515 (uri (git-reference
7516 (url home-page)
7517 (commit commit)))
7518 (sha256
7519 (base32 "0a4830mlqckbhchar1xcn2w4f24bzb75bigdig5wpm2axl0zc8cq"))
7520 (file-name (git-file-name name version))))
7521 (build-system gnu-build-system)
7522 (arguments
7523 (list #:make-flags
7524 #~(list (string-append "CC=" #$(cc-for-target))
7525 (string-append "prefix=" #$output))
7526 #:tests? #f ; no tests
7527 #:phases
7528 #~(modify-phases %standard-phases
7529 (delete 'configure) ; no configure script
7530 (add-after 'unpack 'fix-gnuplot-path
7531 (lambda* (#:key inputs #:allow-other-keys)
7532 (let ((gnuplot (assoc-ref inputs "gnuplot")))
7533 (substitute* "btt/bno_plot.py"
7534 (("gnuplot %s")
7535 (string-append gnuplot "/bin/gnuplot %s")))))))))
7536 (inputs
7537 `(("libaio" ,libaio)
7538 ("gnuplot" ,gnuplot)
7539 ("python" ,python-wrapper))) ;for 'bno_plot.py'
7540 (synopsis "Block layer IO tracing mechanism")
7541 (description "Blktrace is a block layer IO tracing mechanism which provides
7542detailed information about request queue operations to user space. It extracts
7543event traces from the kernel (via the relaying through the debug file system).")
7544 (license license:gpl2))))
7545
7546(define-public sbc
7547 (package
7548 (name "sbc")
7549 (version "1.5")
7550 (source (origin
7551 (method url-fetch)
7552 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
7553 version ".tar.xz"))
7554 (patches (search-patches "sbc-fix-build-non-x86.patch"))
7555 (sha256
7556 (base32
7557 "1liig5856crb331dps18mp0s13zbkv7yh007zqhq97m94fcddfhc"))))
7558 (build-system gnu-build-system)
7559 (inputs
7560 (list libsndfile))
7561 (native-inputs
7562 (list pkg-config))
7563 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
7564 (synopsis "Bluetooth subband audio codec")
7565 (description
7566 "The SBC is a digital audio encoder and decoder used to transfer data to
7567Bluetooth audio output devices like headphones or loudspeakers.")
7568 (license license:gpl2+)))
7569
7570(define-public bluez
7571 (package
7572 (name "bluez")
7573 (version "5.79")
7574 (source (origin
7575 (method url-fetch)
7576 (uri (string-append
7577 "mirror://kernel.org/linux/bluetooth/bluez-"
7578 version ".tar.xz"))
7579 (sha256
7580 (base32
7581 "12pal1m4xlr8k7kxb6isv5lbaca2wc5zcgy0907wfwcz78qaar21"))))
7582 (build-system gnu-build-system)
7583 (arguments
7584 (list
7585 #:configure-flags
7586 #~(list "--sysconfdir=/etc"
7587 "--localstatedir=/var"
7588 "--enable-library"
7589 "--enable-wiimote"
7590 "--disable-systemd"
7591 ;; TODO: is this needed? Not installed by default since 5.55.
7592 "--enable-hid2hci"
7593 ;; Install dbus/udev files to the correct location.
7594 (string-append "--with-dbusconfdir=" #$output "/etc")
7595 (string-append "--with-udevdir=" #$output "/lib/udev"))
7596 #:phases
7597 #~(modify-phases %standard-phases
7598 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
7599 ;; issue (discussion on upstream mailing list:
7600 ;; https://marc.info/?t=149578476300002&r=1&w=2)
7601 (add-before 'check 'skip-wonky-test
7602 (lambda _
7603 (substitute* "unit/test-gatt.c"
7604 (("tester_init\\(&argc, &argv\\);") "return 77;"))))
7605 (replace 'install
7606 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
7607 ;; Override the sysconfdir and localstatedir locations only for
7608 ;; the installation phase. Otherwise, the installation fails when
7609 ;; it tries to write to /etc/bluetooth and /var.
7610 (define make-flags*
7611 (append make-flags (list (string-append "sysconfdir="
7612 #$output "/etc")
7613 (string-append "localstatedir="
7614 #$output "/var"))))
7615 (apply (assoc-ref %standard-phases 'install)
7616 (append args (list #:make-flags make-flags*)))))
7617 (add-after 'install 'post-install
7618 (lambda* (#:key inputs outputs #:allow-other-keys)
7619 (let* ((servicedir (string-append #$output
7620 "/share/dbus-1/services"))
7621 (service "obexd/src/org.bluez.obex.service")
7622 (rule (string-append
7623 #$output "/lib/udev/rules.d/97-hid2hci.rules")))
7624 ;; Install the obex dbus service file.
7625 (substitute* service
7626 (("/bin/false")
7627 (string-append #$output "/libexec/bluetooth/obexd")))
7628 (install-file service servicedir)
7629 ;; Fix paths in the udev rule.
7630 (substitute* rule
7631 (("hid2hci --method")
7632 (string-append #$output "/lib/udev/hid2hci --method"))
7633 (("/sbin/udevadm")
7634 (search-input-file inputs "/bin/udevadm")))))))))
7635 (native-inputs
7636 (list gettext-minimal
7637 pkg-config
7638 python
7639 python-docutils
7640 python-pygments))
7641 (inputs
7642 (list glib dbus eudev libical readline))
7643 (home-page "https://www.bluez.org/")
7644 (synopsis "Linux Bluetooth protocol stack")
7645 (description
7646 "BlueZ provides support for the core Bluetooth layers and protocols. It
7647is flexible, efficient and uses a modular implementation.")
7648 (license license:gpl2+)))
7649
7650(define-public fuse-exfat
7651 (package
7652 (name "fuse-exfat")
7653 (version "1.4.0")
7654 (source (origin
7655 (method url-fetch)
7656 (uri (string-append
7657 "https://github.com/relan/exfat/releases/download/v"
7658 version "/" name "-" version ".tar.gz"))
7659 (sha256
7660 (base32
7661 "07h0ngnydfy8n8h9ni3jn8zlmcj4pzqa0nk0hk0i4yhfbv2yvkx1"))))
7662 (build-system gnu-build-system)
7663 (native-inputs
7664 (list pkg-config))
7665 (inputs
7666 (list fuse-2))
7667 (home-page "https://github.com/relan/exfat")
7668 (synopsis "Mount exFAT file systems")
7669 (description
7670 "This package provides a FUSE-based file system that provides read and
7671write access to exFAT devices.")
7672 (license license:gpl2+)))
7673
7674(define-public fuseiso
7675 (package
7676 (name "fuseiso")
7677 (version "20070708")
7678 (source (origin
7679 (method url-fetch)
7680 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
7681 version "/fuseiso-" version ".tar.bz2"))
7682 (sha256
7683 (base32
7684 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
7685 (build-system gnu-build-system)
7686 (native-inputs
7687 (list pkg-config))
7688 (inputs
7689 (list fuse-2 glib zlib))
7690 (home-page "https://sourceforge.net/projects/fuseiso/")
7691 (synopsis "Mount ISO file system images")
7692 (description
7693 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
7694.bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
7695Ridge, Joliet, and zisofs.")
7696 (license license:gpl2)))
7697
7698(define-public gpm
7699 (package
7700 (name "gpm")
7701 (version "1.20.7")
7702 (source (origin
7703 (method url-fetch)
7704 (uri (string-append
7705 "https://www.nico.schottelius.org/software/gpm/archives/"
7706 "gpm-" version ".tar.bz2"))
7707 (patches (search-patches "gpm-glibc-2.26.patch"))
7708 (sha256
7709 (base32
7710 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))
7711 (modules '((guix build utils)))
7712 (snippet
7713 '(begin
7714 ;; Take a patch from upstream to fix building with -fno-common,
7715 ;; which is default in GCC 10:
7716 ;; https://github.com/telmich/gpm/pull/37
7717 (substitute* "src/headers/daemon.h"
7718 (("^time_t[[:blank:]]+last_selection_time;")
7719 "extern time_t last_selection_time;"))))))
7720 (build-system gnu-build-system)
7721 (arguments
7722 '(#:phases (modify-phases %standard-phases
7723 (replace 'bootstrap
7724 (lambda _
7725 ;; The tarball was not generated with 'make dist' so we
7726 ;; need to bootstrap things ourselves.
7727 (substitute* "autogen.sh"
7728 (("/bin/sh") (which "sh")))
7729 (invoke "./autogen.sh")
7730 (patch-makefile-SHELL "Makefile.include.in")
7731 #t)))
7732
7733 ;; Make sure programs find libgpm.so.
7734 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
7735 (assoc-ref %outputs "out")
7736 "/lib"))))
7737 (native-inputs
7738 (list texinfo
7739 bison
7740 flex
7741 autoconf
7742 automake
7743 libtool))
7744 (home-page "https://www.nico.schottelius.org/software/gpm/")
7745 (synopsis "Mouse support for the Linux console")
7746 (description
7747 "The GPM (general-purpose mouse) daemon is a mouse server for
7748applications running on the Linux console. It allows users to select items
7749and copy/paste text in the console and in xterm.")
7750 (license license:gpl2+)))
7751
7752(define-public btrfs-progs
7753 (package
7754 (name "btrfs-progs")
7755 (version "6.16")
7756 (source (origin
7757 (method url-fetch)
7758 (uri (string-append "mirror://kernel.org/linux/kernel/"
7759 "people/kdave/btrfs-progs/" "btrfs-progs-v"
7760 version ".tar.xz"))
7761 (sha256
7762 (base32
7763 "1ibg8qrsxzw4qjnsl5da1qz10m1zv3yx2jxd4jl1h9kwfgw31a9i"))))
7764 (build-system gnu-build-system)
7765 (outputs '("out" "static")) ;static versions of the binaries in "out"
7766 (arguments
7767 (list
7768 #:configure-flags
7769 #~(list
7770 ;; Without --disable-documentation, it complains about missing
7771 ;; python-sphinx on systems where this package isn't available
7772 ;; (because it requires Rust).
7773 #$@(if (member (%current-system)
7774 (package-transitive-supported-systems
7775 python-sphinx))
7776 '()
7777 '("--disable-documentation"))
7778 ;; The ‘Python support’ was never actually installed by previous
7779 ;; versions of this package, but did prevent cross-compilation.
7780 "--disable-python")
7781 #:phases #~(modify-phases %standard-phases
7782 (add-after 'unpack 'patch-makefile
7783 (lambda* (#:key outputs #:allow-other-keys)
7784 (substitute* "Makefile"
7785 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
7786 (string-append (assoc-ref outputs "out")
7787 "/lib/udev/rules.d")))))
7788 (add-after 'build 'build-static
7789 (lambda _
7790 (invoke "make" "static")))
7791 (add-after 'install 'install-bash-completion
7792 (lambda* (#:key outputs #:allow-other-keys)
7793 (let* ((out (assoc-ref outputs "out"))
7794 (bashcomp (string-append out
7795 "/etc/bash_completion.d")))
7796 (mkdir-p bashcomp)
7797 (copy-file "btrfs-completion"
7798 (string-append bashcomp "/btrfs")))))
7799 (add-after 'install 'install-static
7800 (let ((staticbin (string-append (assoc-ref %outputs
7801 "static")
7802 "/bin")))
7803 (lambda _
7804 (invoke "make"
7805 (string-append "bindir=" staticbin)
7806 "install-static")))))
7807 #:tests? #f ;XXX: require the 'btrfs' kernel module.
7808 #:test-target "test"
7809 #:parallel-tests? #f)) ;tests fail when run in parallel
7810 (inputs (list e2fsprogs ;for btrfs-convert
7811 eudev
7812 lzo
7813 `(,util-linux "lib") ;for libblkid and libuuid
7814 `(,util-linux "static") ;ditto
7815 zlib
7816 `(,zlib "static")
7817 `(,zstd "lib")
7818 `(,zstd "static")))
7819 (native-inputs
7820 (append
7821 ;; For building documentation. Since python-sphinx requires Rust, add
7822 ;; it conditionally depending on such support.
7823 (if (supported-package? python-sphinx)
7824 (list python-wrapper python-sphinx python-sphinx-rtd-theme)
7825 '())
7826 (list pkg-config
7827 acl ;for tests
7828 lvm2 ;for dmsetup
7829 grep ;need Perl regexp support
7830 libaio
7831 liburing
7832 util-linux ;for fallocate
7833 which)))
7834 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
7835 (synopsis "Create and manage btrfs copy-on-write file systems")
7836 (description
7837 "Btrfs is a @acronym{CoW, copy-on-write} file system for Linux
7838aimed at implementing advanced features while focusing on fault tolerance,
7839repair and easy administration.")
7840 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
7841 ;; GPL2: Everything else.
7842 (license (list license:gpl2 license:gpl2+))))
7843
7844(define-public btrfs-progs/static
7845 (package
7846 (name "btrfs-progs-static")
7847 (version (package-version btrfs-progs))
7848 (source #f)
7849 (build-system trivial-build-system)
7850 (inputs
7851 `(("btrfs-progs:static" ,btrfs-progs "static")))
7852 (arguments
7853 `(#:modules ((guix build utils))
7854 #:builder
7855 (begin
7856 (use-modules (guix build utils)
7857 (ice-9 ftw)
7858 (srfi srfi-26))
7859
7860 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
7861 (out (assoc-ref %outputs "out"))
7862 (source (string-append btrfs "/bin/btrfs.static"))
7863 (target (string-append out "/bin/btrfs")))
7864 (mkdir-p (dirname target))
7865 (copy-file source target)
7866 (remove-store-references target)
7867 (chmod target #o555)
7868 #t))))
7869 (home-page (package-home-page btrfs-progs))
7870 (synopsis "Statically-linked btrfs command from btrfs-progs")
7871 (description "This package provides the statically-linked @command{btrfs}
7872from the btrfs-progs package. It is meant to be used in initrds.")
7873 (license (package-license btrfs-progs))))
7874
7875(define-public cramfs-tools
7876 (package
7877 (name "cramfs-tools")
7878 (home-page "https://github.com/npitre/cramfs-tools")
7879 (version "2.1")
7880 (source (origin
7881 (method git-fetch)
7882 (uri (git-reference
7883 (url home-page)
7884 (commit (string-append "v" version))))
7885 (sha256
7886 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
7887 (file-name (git-file-name name version))))
7888 (build-system gnu-build-system)
7889 (arguments
7890 '(#:tests? #f ; No tests.
7891 #:phases
7892 (modify-phases %standard-phases
7893 (delete 'configure)
7894 (replace 'install
7895 (lambda* (#:key outputs #:allow-other-keys)
7896 (let ((out (assoc-ref outputs "out")))
7897 (install-file "mkcramfs" (string-append out "/sbin"))
7898 (install-file "cramfsck" (string-append out "/sbin")))
7899 #t)))))
7900 (inputs
7901 (list zlib))
7902 (synopsis "Tools to manage Cramfs file systems")
7903 (description "Cramfs is a Linux file system designed to be simple, small,
7904and to compress things well. It is used on a number of embedded systems and
7905small devices. This version has additional features such as uncompressed
7906blocks and random block placement.")
7907 (license license:gpl2+)))
7908
7909(define-public compsize
7910 (let ((commit "d79eacf77abe3b799387bb8a4e07a18f1f1031e8")
7911 (revision "0"))
7912 (package
7913 (name "compsize")
7914 (version (git-version "1.5" revision commit))
7915 (home-page "https://github.com/kilobyte/compsize")
7916 (source (origin
7917 (method git-fetch)
7918 (uri (git-reference
7919 (url home-page)
7920 (commit commit)))
7921 (sha256
7922 (base32 "02fvgy12m50rg1snp555a1kc3cm01g2imb81cih7ikhkbjbca0d7"))
7923 (file-name (git-file-name name version))
7924 (patches
7925 (search-patches "compsize-fix-btrfs-progs-compatibility.patch"))))
7926 (build-system gnu-build-system)
7927 (inputs
7928 (list btrfs-progs))
7929 (arguments
7930 `(#:tests? #f ; No tests.
7931 #:make-flags
7932 (list (string-append "CC=" ,(cc-for-target)))
7933 #:phases
7934 (modify-phases %standard-phases
7935 (delete 'configure)
7936 (replace 'install
7937 (lambda* (#:key outputs #:allow-other-keys)
7938 (let ((out (assoc-ref outputs "out")))
7939 (install-file "compsize" (string-append out "/bin"))
7940 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
7941 (synopsis "Find compression type/ratio on Btrfs files")
7942 (description "@command{compsize} takes a list of files (given as
7943arguments) on a Btrfs file system and measures used compression types and
7944effective compression ratio, producing a report.
7945
7946A directory has no extents but has a (recursive) list of files. A non-regular
7947file is silently ignored.
7948
7949As it makes no sense to talk about compression ratio of a partial extent,
7950every referenced extent is counted whole, exactly once -- no matter if you use
7951only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
7952uncompressed size will not match the number given by @command{tar} or
7953@command{du}. On the other hand, the space used should be accurate (although
7954obviously it can be shared with files outside our set).")
7955 (license license:gpl2+))))
7956
7957(define-public f2fs-tools
7958 (package
7959 (name "f2fs-tools")
7960 (version "1.16.0")
7961 (source (origin
7962 (method git-fetch)
7963 (uri (git-reference
7964 (url "https://git.kernel.org/pub/scm/linux/kernel\
7965/git/jaegeuk/f2fs-tools.git")
7966 (commit (string-append "v" version))))
7967 (file-name (git-file-name name version))
7968 (sha256
7969 (base32
7970 "0832ix3jnmfagx53wr6clc3q4ay7cbashfj7jirk01gyzwbvblfc"))))
7971 (build-system gnu-build-system)
7972 (native-inputs
7973 (list autoconf automake libtool pkg-config))
7974 (inputs
7975 (list `(,util-linux "lib"))) ;for libuuid
7976 (home-page "https://f2fs.wiki.kernel.org/")
7977 (synopsis "Userland tools for f2fs")
7978 (description
7979 "F2FS, the Flash-Friendly File System, is a modern file system
7980designed to be fast and durable on flash devices such as solid-state
7981disks and SD cards. This package provides the userland utilities.")
7982 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
7983 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
7984 (license (list license:gpl2 license:lgpl2.1))))
7985
7986(define-public f2fs-tools-1.7
7987 (package
7988 (inherit f2fs-tools)
7989 (name "f2fs-tools")
7990 (version "1.7.0")
7991 (source (origin
7992 (method git-fetch)
7993 (uri (git-reference
7994 (url (git-reference-url
7995 (origin-uri (package-source f2fs-tools))))
7996 (commit (string-append "v" version))))
7997 (file-name (git-file-name name version))
7998 (sha256
7999 (base32
8000 "0wpzklw8smnngng0dm25jdmi7v5zfhpz02dksyxpz0a7kzzvnqqm"))))
8001 (inputs
8002 (list `(,util-linux "lib") libselinux))
8003 (arguments
8004 '(#:configure-flags '("CFLAGS=-fcommon")
8005 #:phases
8006 (modify-phases %standard-phases
8007 (add-after 'install 'install-headers
8008 (lambda* (#:key outputs #:allow-other-keys)
8009 (let* ((out (assoc-ref outputs "out"))
8010 (out-include (string-append out "/include")))
8011 (install-file "include/f2fs_fs.h" out-include)
8012 (install-file "mkfs/f2fs_format_utils.h" out-include)))))))))
8013
8014(define-public f2fs-tools/static
8015 (static-package
8016 (package
8017 (inherit f2fs-tools)
8018 (name "f2fs-tools-static")
8019 (arguments
8020 `(#:configure-flags
8021 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
8022 (libuuid (assoc-ref %build-inputs "libuuid")))
8023 (list
8024 (string-append "libuuid_CFLAGS=-I" libuuid "/include/uuid")
8025 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
8026 (string-append "libblkid_CFLAGS=-I" libuuid "/include/uuid "
8027 "-I" libuuid "/include/blkid")
8028 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
8029 #:disallowed-references (,(this-package-input "libuuid"))
8030 #:make-flags '("LDFLAGS=-all-static")
8031 #:phases
8032 (modify-phases %standard-phases ; TODO: f2fs phases.
8033 (add-after 'install 'remove-store-references
8034 (lambda* (#:key outputs #:allow-other-keys)
8035 ;; Work around bug in our util-linux.
8036 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
8037 (remove-store-references (string-append (assoc-ref outputs "out")
8038 "/sbin/mkfs.f2fs"))
8039 #t)))))
8040 (inputs
8041 `(("libuuid:static" ,util-linux "static")
8042 ("libuuid" ,util-linux "lib")))))) ; for include files
8043
8044(define-public f2fs-fsck/static
8045 (package
8046 (name "f2fs-fsck-static")
8047 (version (package-version f2fs-tools/static))
8048 (source #f)
8049 (build-system trivial-build-system)
8050 (arguments
8051 `(#:modules ((guix build utils))
8052 #:builder
8053 (begin
8054 (use-modules (guix build utils)
8055 (ice-9 ftw)
8056 (srfi srfi-26))
8057 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
8058 (fsck "fsck.f2fs")
8059 (out (assoc-ref %outputs "out"))
8060 (sbin (string-append out "/sbin")))
8061 (mkdir-p sbin)
8062 (with-directory-excursion sbin
8063 (install-file (string-append f2fs-tools "/sbin/" fsck)
8064 ".")
8065 (remove-store-references fsck)
8066 (chmod fsck #o555))
8067 #t))))
8068 (inputs
8069 (list f2fs-tools/static))
8070 (home-page (package-home-page f2fs-tools/static))
8071 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
8072 (description "This package provides statically-linked fsck.f2fs command taken
8073from the f2fs-tools package. It is meant to be used in initrds.")
8074 (license (package-license f2fs-tools/static))))
8075
8076(define-public freefall
8077 (package
8078 (name "freefall")
8079 (version (package-version linux-libre))
8080 (source (package-source linux-libre))
8081 (build-system gnu-build-system)
8082 (arguments
8083 '(#:phases (modify-phases %standard-phases
8084 (add-after 'unpack 'enter-subdirectory
8085 (lambda _
8086 (chdir "tools/laptop/freefall")
8087 #t))
8088 (delete 'configure)
8089 (add-before 'build 'increase-timeout
8090 (lambda _
8091 ;; The default of 2 seconds is too low: it assumes an
8092 ;; open lid and AC power without actually checking.
8093 (substitute* "freefall.c"
8094 (("alarm\\(2\\)") "alarm(5)"))
8095 #t)))
8096 #:make-flags (list (string-append "PREFIX="
8097 (assoc-ref %outputs "out"))
8098 "CC=gcc")
8099 #:tests? #f)) ;no tests
8100 (home-page (package-home-page linux-libre))
8101 (synopsis "Free-fall protection for spinning laptop hard drives")
8102 (description
8103 "Prevents shock damage to the internal spinning hard drive(s) of some
8104HP and Dell laptops. When sudden movement is detected, all input/output
8105operations on the drive are suspended and its heads are parked on the ramp,
8106where they are less likely to cause damage to the spinning disc. Requires a
8107drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
8108feature, and a laptop with an accelerometer. It has no effect on SSDs.")
8109 (license license:gpl2)))
8110
8111
8112(define-public nbfc-linux
8113 (let ((version "0.1.7")
8114 (commit "4c2b75e4a875459e86a9892319889ff945e9cadf")
8115 (revision "0"))
8116 (package
8117 (name "nbfc-linux")
8118 (version (git-version version revision commit))
8119 (source (origin
8120 (method git-fetch)
8121 (uri (git-reference
8122 (url "https://github.com/nbfc-linux/nbfc-linux")
8123 (commit commit)))
8124 (file-name (git-file-name name version))
8125 (sha256
8126 (base32
8127 "0mmyfaigrh3fd5v11a8p38km4m02qzsfx8yh72g0z405bzhqn5jk"))))
8128 (build-system gnu-build-system)
8129 (arguments
8130 `(#:make-flags (list (string-append "CC="
8131 ,(cc-for-target))
8132 (string-append "PREFIX="
8133 (assoc-ref %outputs "out")))
8134 #:tests? #f
8135 #:phases (modify-phases %standard-phases
8136 (delete 'configure))))
8137 (native-inputs (list pkg-config))
8138 (propagated-inputs (list python dmidecode))
8139 (synopsis "NoteBook FanControl ported to Linux")
8140 (description
8141 "This package provides a C port of NoteBook FanControl (NBFC), a fan
8142control service for notebooks. It provides the same utilities with the same
8143interfaces as the original NBFC, although the implementation differs.")
8144 (home-page "https://github.com/nbfc-linux/nbfc-linux")
8145 (license license:gpl3+))))
8146
8147(define-public thinkfan
8148 (package
8149 (name "thinkfan")
8150 (version "2.0.0")
8151 (source
8152 (origin
8153 (method git-fetch)
8154 (uri (git-reference
8155 (url "https://github.com/vmatare/thinkfan")
8156 (commit version)))
8157 (file-name (git-file-name name version))
8158 (sha256
8159 (base32 "1jdjqdbv0m7yf9g4rxs7nq1ldh2b81a7qx4vcf9lzw7jwlydd822"))))
8160 (build-system cmake-build-system)
8161 (arguments
8162 (list
8163 #:modules '((guix build cmake-build-system)
8164 (guix build utils)
8165 (srfi srfi-26))
8166 #:tests? #f ; no test target
8167 #:configure-flags
8168 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
8169 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
8170 ;; inefficient’.
8171 #~(list "-DUSE_ATASMART:BOOL=ON")
8172 #:phases
8173 #~(modify-phases %standard-phases
8174 (add-after 'unpack 'create-init-scripts
8175 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
8176 ;; systemd to patch and install their service files. Fake their
8177 ;; presence rather than duplicating the build system below. Leave
8178 ;; things like ‘/bin/kill’ because they're not worth a dependency.
8179 ;; The sysvinit needs manual patching, but since upstream doesn't
8180 ;; even provide the option to install it: don't.
8181 (lambda _
8182 (substitute* "CMakeLists.txt"
8183 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
8184 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
8185 ;; That was easy! Now we just need to fix the destinations.
8186 (("/etc" directory)
8187 (string-append #$output directory))))))))
8188 (native-inputs
8189 (list pkg-config))
8190 (inputs
8191 `(("libatasmart" ,libatasmart)
8192 ("lm-sensors" ,lm-sensors "lib")
8193 ("yaml-cpp" ,yaml-cpp)))
8194 (home-page "https://github.com/vmatare/thinkfan")
8195 (synopsis "Simple fan control program")
8196 (description
8197 "Thinkfan is a simple fan control program. It reads temperatures,
8198checks them against configured limits and switches to appropriate (also
8199pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
8200other @code{hwmon} driver that enables temperature reading and fan control
8201from userspace.")
8202 (license license:gpl3+)))
8203
8204(define-public tpacpi-bat
8205 (package
8206 (name "tpacpi-bat")
8207 (version "3.2")
8208 (source
8209 (origin
8210 (method git-fetch)
8211 (uri (git-reference
8212 (url "https://github.com/teleshoes/tpacpi-bat")
8213 (commit (string-append "v" version))))
8214 (file-name (git-file-name name version))
8215 (sha256
8216 (base32 "0nd8s2bqbhl0sjpflphb4l9ix71p7kvnbvkq4dg9a1v0sxafyygm"))))
8217 (build-system gnu-build-system)
8218 (arguments
8219 `(#:tests? #f ; no test target
8220 #:phases
8221 (modify-phases %standard-phases
8222 (add-after 'unpack 'refer-to-inputs
8223 (lambda* (#:key inputs #:allow-other-keys)
8224 (substitute* "tpacpi-bat"
8225 (("cat ")
8226 (string-append (search-input-file inputs "bin/cat") " "))
8227 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
8228 ;; loaded. That's the administrator's prerogative; disable it.
8229 (("system \"(modprobe .*)\"" _ match)
8230 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))))
8231 (delete 'configure) ; nothing to configure
8232 (delete 'build) ; nothing to build
8233 (replace 'install
8234 (lambda* (#:key outputs #:allow-other-keys)
8235 (let* ((out (assoc-ref outputs "out"))
8236 (bin (string-append out "/bin"))
8237 (doc (string-append out "/share/doc/" ,name "-" ,version)))
8238 (install-file "tpacpi-bat" bin)
8239
8240 ;; There's no man page. Install other forms of documentation.
8241 (for-each (lambda (file)
8242 (let ((target (string-append doc "/" file)))
8243 (mkdir-p (dirname target))
8244 (copy-recursively file target)))
8245 (list "battery_asl" "examples" "README.md"))))))))
8246 (inputs
8247 (list coreutils-minimal
8248 perl))
8249 (home-page "https://github.com/teleshoes/tpacpi-bat")
8250 (synopsis "ThinkPad battery charge controller")
8251 (description
8252 "Tpacpi-bat is a command-line interface to control battery charging on
8253@uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
8254ThinkPad models released after 2011}, starting with the xx20 series. It can
8255query and set the thresholds at which one or both batteries will start and stop
8256charging, inhibit charging batteries for a set period of time, or force them to
8257discharge when they otherwise would not.
8258
8259This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
8260kernel module provided by the @code{acpi-call-linux-module} package, which must
8261be installed and loaded separately. Only the original vendor firmware is
8262supported.")
8263 (license license:gpl3+)))
8264
8265(define-public tmon
8266 (package
8267 (name "tmon")
8268 ;; Tmon's ‘VERSION = 1.0’ hasn't been touched since 2013; the code has.
8269 (version (package-version linux-libre))
8270 (source (package-source linux-libre))
8271 (build-system gnu-build-system)
8272 (arguments
8273 (list
8274 #:tests? #f ; no test suite
8275 #:make-flags
8276 #~(list (string-append "CC=" #$(cc-for-target))
8277 (string-append "INSTALL_ROOT=" #$output)
8278 "BINDIR=bin")
8279 #:phases
8280 #~(modify-phases %standard-phases
8281 (add-after 'unpack 'enter-subdirectory
8282 (lambda _
8283 (chdir "tools/thermal/tmon")))
8284 (add-after 'install 'install-man-page
8285 (lambda _
8286 (let ((man8 (string-append #$output "/share/man/man8")))
8287 (install-file "tmon.8" man8))))
8288 (delete 'configure)))) ; no configure script
8289 (inputs
8290 (list ncurses))
8291 (home-page (package-home-page linux-libre))
8292 (synopsis "Monitor and test the Linux thermal subsystem in real time")
8293 (description
8294 "Tmon is a tool to interact with the complex thermal subsystem of the
8295kernel Linux. It helps visualize thermal relationships and real-time thermal
8296data, tune and test cooling devices and sensors, and collect thermal data for
8297further analysis.
8298
8299As computers become smaller and more thermally constrained, more sensors are
8300added and new cooling capabilities introduced. Thermal relationships can change
8301dynamically. Their complexity grows exponentially among cooling devices, zones,
8302sensors, and trip points.
8303
8304Linux exposes this relationship through @file{/sys/class/thermal} with a matrix
8305of symbolic links, trip point bindings, and device instances. To traverse it
8306by hand is no trivial task: @command{tmon} aims to make it understandable.")
8307 (license (list license:gpl2 ; the man page
8308 license:gpl2+)))) ; the actual rest
8309
8310(define-public turbostat
8311 (package
8312 (name "turbostat")
8313 ;; XXX turbostat reports a version like ‘20.09.30’ but using it here would
8314 ;; make it harder to benefit from ‘free’ linux-libre package updates.
8315 (version (package-version linux-libre))
8316 (source (package-source linux-libre))
8317 (build-system gnu-build-system)
8318 (arguments
8319 (list
8320 #:tests? #f ;no test suite
8321 #:make-flags
8322 #~(list (string-append "CC=" #$(cc-for-target))
8323 (string-append "PREFIX=" #$output))
8324 #:phases
8325 #~(modify-phases %standard-phases
8326 (add-after 'unpack 'enter-subdirectory
8327 (lambda _
8328 (chdir "tools/power/x86/turbostat")))
8329 (delete 'configure)))) ;no configure script
8330 (inputs
8331 (list libcap))
8332 (supported-systems '("i686-linux" "x86_64-linux"))
8333 (home-page (package-home-page linux-libre))
8334 (synopsis "Report x86 processor frequency and idle statistics")
8335 (description
8336 "Turbostat reports x86 processor topology, frequency, idle power state
8337statistics, temperature, and power consumption. Some information is unavailable
8338on older processors.
8339
8340It can be used to identify machines that are inefficient in terms of power usage
8341or idle time, report the rate of @acronym{SMI, system management interrupt}s
8342occurring on the system, or verify the effects of power management tuning.
8343
8344@command{turbostat} reads hardware counters but doesn't write to them, so it
8345won't interfere with the OS or other running processes---including multiple
8346invocations of itself.")
8347 (license license:gpl2)))
8348
8349(define-public ntfs-3g
8350 (package
8351 (name "ntfs-3g")
8352 (version "2022.10.3")
8353 (source (origin
8354 (method url-fetch)
8355 (uri (string-append "https://tuxera.com/opensource/"
8356 "ntfs-3g_ntfsprogs-" version ".tgz"))
8357 (sha256
8358 (base32
8359 "030pakw3h1z6p8phdbyb0hw0bb868znvrri96rg88jq7d3p3c3pj"))
8360 (modules '((guix build utils)))
8361 (snippet '(begin
8362 ;; Install under $prefix.
8363 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
8364 (("/sbin")
8365 "@sbindir@"))))))
8366 (build-system gnu-build-system)
8367 (inputs (list util-linux ; libuuid
8368 fuse-2))
8369 (native-inputs (list pkg-config))
8370 (arguments
8371 '(#:configure-flags (list "--disable-static"
8372 "--disable-ldconfig" ;not necessary
8373 "--exec-prefix=${prefix}"
8374 "--with-fuse=external" ;use our own FUSE
8375 "--enable-mount-helper"
8376 "--enable-posix-acls"
8377 "--enable-xattr-mappings")
8378 #:phases
8379 (modify-phases %standard-phases
8380 ;; If users install ntfs-3g, they probably want to make it the
8381 ;; default driver as well, so we opt for sensible defaults and link
8382 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
8383 ;; mount NTFS file systems.)
8384 (add-after 'install 'install-link
8385 (lambda* (#:key outputs #:allow-other-keys)
8386 (let* ((out (assoc-ref outputs "out"))
8387 (sbin (string-append out "/sbin")))
8388 (symlink "mount.ntfs-3g"
8389 (string-append sbin "/mount.ntfs"))))))))
8390 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
8391 (synopsis "Read-write access to NTFS file systems")
8392 (description
8393 "NTFS-3G provides read-write access to NTFS file systems, which are
8394commonly found on Microsoft Windows. It is implemented as a FUSE file system.
8395The package provides additional NTFS tools.")
8396 (properties
8397 '((release-monitoring-url . "https://github.com/tuxera/ntfs-3g/releases")
8398 (upstream-name . "ntfs-3g_ntfsprogs")))
8399 (license license:gpl2+)))
8400
8401(define-public ntfs-3g/static
8402 (static-package
8403 (package
8404 (inherit ntfs-3g)
8405 (name "ntfs-3g-static")
8406 (arguments
8407 (substitute-keyword-arguments (package-arguments ntfs-3g)
8408 ((#:configure-flags flags)
8409 `(append ,flags
8410 (list "--enable-really-static"
8411 ;; The FUSE driver isn't currently used by our initrd.
8412 "--disable-ntfs-3g")))
8413 ((#:phases phases)
8414 `(modify-phases ,phases
8415 (add-after 'unpack 'make-really-static-really-static
8416 (lambda _
8417 (substitute* "ntfsprogs/Makefile.in"
8418 ((" -static") " -all-static"))))
8419 (delete 'install-link))))))))
8420
8421(define-public ntfsfix/static
8422 (package
8423 (name "ntfsfix-static")
8424 (version (package-version ntfs-3g/static))
8425 (source #f)
8426 (build-system trivial-build-system)
8427 (arguments
8428 `(#:modules ((guix build utils))
8429 #:builder
8430 (begin
8431 (use-modules (guix build utils))
8432 (let* ((ntfs-3g (assoc-ref %build-inputs "ntfs-3g"))
8433 (out (assoc-ref %outputs "out"))
8434 (bin (string-append out "/bin")))
8435 (install-file (string-append ntfs-3g "/bin/ntfsfix") bin)
8436 (with-directory-excursion bin
8437 (remove-store-references "ntfsfix"))))))
8438 (inputs
8439 `(("ntfs-3g" ,ntfs-3g/static)))
8440 (home-page (package-home-page ntfs-3g/static))
8441 (synopsis "Statically linked @command{ntfsfix} from ntfs-3g")
8442 (description
8443 "This package provides a statically linked @command{ntfsfix} taken
8444from the ntfs-3g package. It is meant to be used in initrds.")
8445 (license (package-license ntfs-3g/static))))
8446
8447(define-public rdma-core
8448 (package
8449 (name "rdma-core")
8450 (version "60.0")
8451 (source (origin
8452 (method url-fetch)
8453 (uri (string-append "https://github.com/linux-rdma/rdma-core"
8454 "/releases/download/v" version "/rdma-core-"
8455 version ".tar.gz"))
8456 (sha256
8457 (base32
8458 "1pi8jf1pibfhh3ps2kvj2y8y6yahpw7jjyp0mpxmvama9qp8j6wv"))))
8459 (build-system cmake-build-system)
8460 (arguments
8461 `(#:tests? #f ;no tests
8462
8463 ;; Upstream uses the "ninja" build system and encourage distros
8464 ;; to do the same for consistency.
8465 #:generator "Ninja"
8466 #:configure-flags (list ,@(if (%current-target-system)
8467 `((string-append
8468 "-DPKG_CONFIG_EXECUTABLE="
8469 (search-input-file
8470 %build-inputs
8471 (string-append "/bin/"
8472 ,(pkg-config-for-target)))))
8473 '())
8474 (string-append "-DRST2MAN_EXECUTABLE="
8475 (search-input-file
8476 %build-inputs "/bin/rst2man.py")))))
8477 (native-inputs
8478 (list pkg-config python-wrapper python-docutils-0.19)) ;for 'rst2man'
8479 (inputs
8480 (list libnl eudev))
8481 (home-page "https://github.com/linux-rdma/rdma-core")
8482 (synopsis "Utilities and libraries for working with RDMA devices")
8483 (description
8484 "This package provides userspace components for the InfiniBand
8485subsystem of the Linux kernel. Specifically it contains userspace
8486libraries for the following device nodes:
8487
8488@enumerate
8489@item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
8490@item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
8491@item @file{/dev/infiniband/umadX} (@code{libibumad})
8492@end enumerate
8493
8494The following service daemons are also provided:
8495@enumerate
8496@item @code{srp_daemon} (for the @code{ib_srp} kernel module)
8497@item @code{iwpmd} (for iWARP kernel providers)
8498@item @code{ibacm} (for InfiniBand communication management assistant)
8499@end enumerate")
8500 ;; All library code is dual licensed under GPL2 and a custom MIT
8501 ;; variant. The package also includes some components covered by
8502 ;; other licenses. Consult COPYING.md for full details.
8503 (license
8504 (list license:gpl2
8505 (license:x11-style "See COPYING.BSD_MIT in the distribution")
8506 license:bsd-2 ; Files referring to COPYING.BSD_FB
8507 license:cc0 ; most files in ccan/
8508 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
8509
8510(define-public perftest
8511 (package
8512 (name "perftest")
8513 (version "4.5-0.20")
8514 (home-page "https://github.com/linux-rdma/perftest")
8515 (source (origin
8516 (method git-fetch)
8517 (uri (git-reference (url home-page)
8518 (commit (string-append "v" version))))
8519 (file-name (git-file-name name version))
8520 (sha256
8521 (base32
8522 "1hrpzmkz1kq4jwpy6b5fl8073iy7dllcq2hfzdw6waaf5920vd64"))))
8523 (build-system gnu-build-system)
8524 (native-inputs
8525 (list autoconf automake libtool))
8526 (inputs (list pciutils rdma-core))
8527 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
8528 (description "This is a collection of tests written over uverbs intended
8529for use as a performance micro-benchmark. The tests may be used for hardware
8530or software tuning as well as for functional testing.
8531
8532The collection contains a set of bandwidth and latency benchmark such as:
8533@enumerate
8534@item Send - @code{ib_send_bw} and @code{ib_send_lat}
8535@item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
8536@item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
8537@item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
8538@item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
8539@end enumerate")
8540 (license license:gpl2)))
8541
8542(define-public rng-tools
8543 (package
8544 (name "rng-tools")
8545 (home-page "https://github.com/nhorman/rng-tools")
8546 (version "6.17")
8547 (source (origin
8548 (method git-fetch)
8549 (uri (git-reference (url home-page)
8550 (commit (string-append "v" version))))
8551 (file-name (git-file-name name version))
8552 (sha256
8553 (base32
8554 "0vvqi9ha4jbk4086x2q98p4ip3z56sfdpyckdyknsd36zhp6z8n2"))
8555 (patches
8556 (search-patches "rng-tools-revert-build-randstat.patch"))
8557 (patch-flags '("-p0"))))
8558 (build-system gnu-build-system)
8559 (arguments
8560 (list
8561 ;; Disable support for various hardware entropy sources as they need
8562 ;; dependencies that are not yet in Guix, and would significantly
8563 ;; increase closure size.
8564 #:configure-flags #~(list "--without-nistbeacon"
8565 "--without-pkcs11"
8566 "--without-rtlsdr"
8567 "--without-qrypt")
8568 #:phases
8569 #~(modify-phases %standard-phases
8570 (add-before 'check 'disable-failing-test
8571 (lambda _
8572 (substitute* "tests/Makefile"
8573 ;; This test requires a hwrng, rdrand, or tpm device.
8574 ;; Worse, it appears to fail if that isn't sufficiently random.
8575 (("\\brngtestjitter\\.sh\\b") " ")))))))
8576 (native-inputs
8577 (list autoconf automake pkg-config))
8578 (inputs
8579 (list libcap sysfsutils openssl))
8580 (synopsis "Random number generator daemon")
8581 (description
8582 "Monitor a hardware random number generator, and supply entropy
8583from that to the system kernel's @file{/dev/random} machinery.")
8584 ;; The source package is offered under the GPL2+, but the files
8585 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
8586 (license (list license:gpl2 license:gpl2+))))
8587
8588(define-public cpupower
8589 (package
8590 (name "cpupower")
8591 (version (package-version linux-libre))
8592 (source (package-source linux-libre))
8593 (build-system gnu-build-system)
8594 (arguments
8595 (list #:make-flags
8596 #~(list "CC=gcc"
8597 (string-append "DESTDIR=" #$output)
8598 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
8599 "docdir=/share/doc/cpupower" ;drop default ‘packages/’
8600 "confdir=$(docdir)/examples"
8601 ;; The Makefile recommends the following changes.
8602 "DEBUG=false"
8603 "[email protected]")
8604 #:tests? #f ; no tests
8605 #:phases
8606 #~(modify-phases %standard-phases
8607 (add-after 'unpack 'enter-subdirectory
8608 (lambda _
8609 (chdir "tools/power/cpupower")))
8610 (delete 'configure) ; no configure script
8611 (add-before 'build 'fix-makefiles
8612 (lambda _
8613 (substitute* "Makefile"
8614 (("/usr/") "/")
8615 (("/bin/(install)" _ command) command))
8616 (substitute* "bench/Makefile"
8617 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))))
8618 (native-inputs (list gettext-minimal
8619 which)) ;to find gettext
8620 (inputs (list pciutils))
8621 (home-page (package-home-page linux-libre))
8622 (synopsis "CPU frequency and voltage scaling tools for Linux")
8623 (description
8624 "cpupower is a set of user-space tools that use the cpufreq feature of the
8625Linux kernel to retrieve and control processor features related to power saving,
8626such as frequency and voltage scaling.")
8627 (license license:gpl2)))
8628
8629(define-public x86-energy-perf-policy
8630 (package
8631 (name "x86-energy-perf-policy")
8632 (version (package-version linux-libre))
8633 (source (package-source linux-libre))
8634 (build-system gnu-build-system)
8635 (arguments
8636 '(#:tests? #f
8637 #:phases
8638 (modify-phases %standard-phases
8639 (add-after 'unpack 'enter-subdirectory
8640 (lambda _
8641 (chdir "tools/power/x86/x86_energy_perf_policy")
8642 #t))
8643 (delete 'configure)
8644 (add-before 'build 'fix-makefile
8645 (lambda _
8646 (substitute* "Makefile" (("/usr") ""))
8647 #t)))
8648 #:make-flags
8649 (let ((out (assoc-ref %outputs "out")))
8650 (list (string-append "DESTDIR=" out)
8651 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
8652 (supported-systems '("i686-linux" "x86_64-linux"))
8653 (home-page (package-home-page linux-libre))
8654 (synopsis "Display and update Intel-CPU energy-performance policy")
8655 (description
8656 "@command{x86_energy_perf_policy} displays and updates energy-performance
8657policy settings specific to Intel Architecture Processors. Settings are
8658accessed via Model Specific Register (MSR) updates, no matter if the Linux
8659cpufreq sub-system is enabled or not.")
8660 (license license:gpl2)))
8661
8662(define-public haveged
8663 (package
8664 (name "haveged")
8665 (version "1.9.19")
8666 (source
8667 (origin
8668 (method git-fetch)
8669 (uri (git-reference
8670 (url "https://github.com/jirka-h/haveged")
8671 (commit (string-append "v" version))))
8672 (file-name (git-file-name name version))
8673 (sha256
8674 (base32 "1qka68dlfz9z3gjfvfwvh60l2121c1yx0z264jqsf2vjp5f0xbmn"))))
8675 (build-system gnu-build-system)
8676 (arguments
8677 `(#:configure-flags
8678 (list "--disable-static")))
8679 (home-page "https://www.issihosts.com/haveged")
8680 (synopsis "Entropy source for the Linux random number generator")
8681 (description
8682 "haveged generates an unpredictable stream of random numbers for use by
8683Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
8684standard mechanisms for filling the entropy pool may not be sufficient for
8685systems with high needs or limited user interaction, such as headless servers.
8686
8687@command{haveged} runs as a privileged daemon, harvesting randomness from the
8688indirect effects of hardware events on hidden processor state using the
8689@acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
8690It tunes itself to its environment and provides the same built-in test suite
8691for the output stream as used on certified hardware security devices.
8692
8693The quality of the randomness produced by this algorithm has not been proven.
8694It is recommended to run it together with another entropy source like rngd, and
8695not as a replacement for it.")
8696 (license (list (license:non-copyleft "file://nist/mconf.h")
8697 (license:non-copyleft "file://nist/packtest.c")
8698 license:public-domain ; nist/dfft.c
8699 license:gpl3+)))) ; everything else
8700
8701(define-public hotspot
8702 ;; Use the latest git commit as it includes unreleased fixes for the test
8703 ;; suite.
8704 (let ((commit "5cec69301a3f34ada86ce9fe01a9538b04b3cf7c")
8705 (revision "0"))
8706 (package
8707 (name "hotspot")
8708 (version (git-version "1.5.1" revision commit))
8709 (source (origin
8710 (method git-fetch)
8711 (uri (git-reference
8712 (url "https://github.com/KDAB/hotspot")
8713 (commit commit)
8714 ;; Include the bundled perfparser and PrefixTickLabels
8715 ;; libraries, which are to be used in source form.
8716 (recursive? #t)))
8717 (file-name (git-file-name name version))
8718 (sha256
8719 (base32
8720 "115gskjdcb1q3mgrnv1qcdrhxabjzl1hhkpk1klk67ayicsk1ym6"))))
8721 (build-system qt-build-system)
8722 (arguments
8723 (list
8724 ;; As mentioned in the option help text, the KAuth helper cannot be
8725 ;; installed to a custom prefix and the build fails with "file cannot
8726 ;; create directory: /polkit-1/actions. Maybe need administrative"
8727 ;; (see: https://bugs.kde.org/show_bug.cgi?id=363678).
8728 #:configure-flags #~(list "-DINSTALL_KAUTH_HELPER=OFF"
8729 "-DQT6_BUILD=ON")
8730 #:qtbase qtbase
8731 ;; The 'tst_models' and 'tst_callgraphgenerator' fail, with
8732 ;; the later seemingly requiring sudo or access to the kernel
8733 ;; trace points.
8734 #:test-exclude
8735 (string-append
8736 "("
8737 (string-join
8738 ;; The 'tst_models' expected output doesn't exactly
8739 ;; match.
8740 '("tst_models"
8741 ;; The 'tst_callgraphgenerator' perf invocation
8742 ;; fails when run in the build container.
8743 "tst_callgraphgenerator"
8744 ;; The 'tst_perfparser' test requires sudo/access
8745 ;; to the kernel scheduler trace points.
8746 "tst_perfparser")
8747 "|")
8748 ")")
8749 #:phases
8750 #~(modify-phases %standard-phases
8751 (add-after 'unpack 'patch-perfparser
8752 ;; XXX: This phase is copied from qt-creator: keep them in sync!
8753 (lambda* (#:key inputs #:allow-other-keys)
8754 ;; perfparser attempts to dynamically load the demangle
8755 ;; libraries; use their absolute file name to avoid having to
8756 ;; set LD_LIBRARY_PATH.
8757 (let ((librustc_demangle.so
8758 (with-exception-handler (lambda (ex)
8759 (if (search-error? ex)
8760 #f
8761 (raise-exception ex)))
8762 (lambda ()
8763 (search-input-file inputs "lib/librustc_demangle.so"))
8764 #:unwind? #t)))
8765 (substitute* "3rdparty/perfparser/app/demangler.cpp"
8766 (("loadDemangleLib\\(QStringLiteral\\(\"rustc_demangle\")"
8767 all)
8768 (if librustc_demangle.so
8769 (format #f "loadDemangleLib(QStringLiteral(~s)"
8770 librustc_demangle.so)
8771 all)) ;no rustc_demangle; leave unchanged
8772 (("loadDemangleLib\\(QStringLiteral\\(\"d_demangle\")")
8773 (format #f "loadDemangleLib(QStringLiteral(~s)"
8774 (search-input-file inputs
8775 "lib/libd_demangle.so")))))))
8776 (add-after 'unpack 'path-paths
8777 (lambda* (#:key inputs #:allow-other-keys)
8778 (substitute* "src/perfoutputwidgetkonsole.cpp"
8779 (("\"tail\"")
8780 (format #f "~s" (search-input-file inputs "bin/tail"))))
8781 (substitute* "src/perfrecord.cpp"
8782 (("\"perf( )?\"" _ space)
8783 (string-append "\"" (search-input-file inputs "bin/perf")
8784 (or space "") "\""))))))))
8785 (native-inputs
8786 (list extra-cmake-modules
8787 vulkan-headers))
8788 (inputs
8789 (append
8790 (list coreutils-minimal
8791 d-demangler
8792 elfutils
8793 karchive
8794 kconfig
8795 kcoreaddons
8796 kddockwidgets
8797 kgraphviewer
8798 ki18n
8799 kio
8800 kiconthemes
8801 kitemmodels
8802 kitemviews
8803 knotifications
8804 kparts
8805 ksyntaxhighlighting
8806 kwindowsystem
8807 libxkbcommon
8808 perf
8809 qtdeclarative
8810 qtsvg
8811 solid
8812 threadweaver
8813 `(,zstd "lib"))
8814 (if (supported-package? rust-rustc-demangle-capi-0.1)
8815 (list rust-rustc-demangle-capi-0.1)
8816 '())))
8817 (home-page "https://github.com/KDAB/hotspot")
8818 (synopsis "Performance analysis GUI for Linux perf")
8819 (description "Hotspot is a standalone GUI for performance data analysis.
8820It aims to be similar to KCachegrind, but for data collected with
8821@command{perf}, a profiler for use with the kernel Linux. Its main feature is
8822graphically visualizing a @file{perf.data} file.")
8823 (license (list license:gpl2+ license:gpl3+))))) ;dual licensed
8824
8825(define-public ecryptfs-utils
8826 (package
8827 (name "ecryptfs-utils")
8828 (version "111")
8829 (source
8830 (origin
8831 (method url-fetch)
8832 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
8833 version "/+download/ecryptfs-utils_"
8834 version ".orig.tar.gz"))
8835 (sha256
8836 (base32
8837 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
8838 (build-system gnu-build-system)
8839 (arguments
8840 `(#:configure-flags (list "--disable-pywrap")
8841 #:modules (,@%default-gnu-modules
8842 (ice-9 binary-ports)
8843 (rnrs bytevectors)
8844 (srfi srfi-26))
8845 #:phases
8846 (modify-phases %standard-phases
8847 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
8848 (lambda* (#:key inputs outputs #:allow-other-keys)
8849 (let ((out (assoc-ref outputs "out"))
8850 (util-linux (assoc-ref inputs "util-linux"))
8851 (cryptsetup (assoc-ref inputs "cryptsetup-minimal"))
8852 (linux-pam (assoc-ref inputs "linux-pam"))
8853 (lvm2 (assoc-ref inputs "lvm2")))
8854 (substitute* '("src/utils/ecryptfs-mount-private"
8855 "src/utils/ecryptfs-umount-private"
8856 "src/utils/ecryptfs-setup-private"
8857 "src/utils/ecryptfs-setup-swap"
8858 "src/utils/mount.ecryptfs.c"
8859 "src/utils/umount.ecryptfs.c"
8860 "src/pam_ecryptfs/pam_ecryptfs.c"
8861 "src/desktop/ecryptfs-mount-private.desktop.in"
8862 "src/desktop/ecryptfs-setup-private.desktop.in")
8863 (("/bin/mount")
8864 (string-append util-linux "/bin/mount"))
8865 (("/bin/umount")
8866 (string-append util-linux "/bin/umount"))
8867 (("/sbin/mount.ecryptfs_private")
8868 (string-append out "/sbin/mount.ecryptfs_private"))
8869 (("/sbin/umount.ecryptfs_private")
8870 (string-append out "/sbin/umount.ecryptfs_private"))
8871 (("/usr/bin/ecryptfs-mount-private")
8872 (string-append out "/bin/ecryptfs-mount-private"))
8873 (("/usr/bin/ecryptfs-rewrite-file")
8874 (string-append out "/bin/ecryptfs-rewrite-file"))
8875 (("/usr/bin/ecryptfs-setup-private")
8876 (string-append out "/bin/ecryptfs-setup-private"))
8877 (("/sbin/cryptsetup")
8878 (string-append cryptsetup "/sbin/cryptsetup"))
8879 (("/sbin/unix_chkpwd")
8880 (string-append linux-pam "/sbin/unix_chkpwd"))
8881 (("/sbin/dmsetup")
8882 (string-append lvm2 "/sbin/dmsetup"))))))
8883 (add-after 'install 'wrap-scripts
8884 (lambda* (#:key inputs outputs #:allow-other-keys)
8885 (let* ((out (assoc-ref outputs "out"))
8886 (bin (string-append out "/bin"))
8887 (add (map (lambda (bin)
8888 (dirname (search-input-file
8889 inputs (string-append "bin/" bin))))
8890 ;; For simplicity, we wrap all scripts the same.
8891 (list "awk" "find" "gettext" "grep" "keyctl" "ls"
8892 "lsof" "mount" "rsync" "sed" "which")))
8893 (script? (lambda (file)
8894 (call-with-input-file file
8895 (lambda (port)
8896 (bytevector=? (string->utf8 "#!")
8897 (get-bytevector-n port 2)))))))
8898 (for-each (lambda (file)
8899 (when (script? file)
8900 (wrap-program file
8901 ;; '= would be better than 'suffix but break
8902 ;; setuid binaries.
8903 `("PATH" ":" suffix (,@add
8904 ,(string-append bin))))))
8905 (find-files bin "."))))))))
8906 (native-inputs
8907 (list intltool perl ; for pod2man
8908 pkg-config))
8909 (inputs
8910 (list coreutils
8911 cryptsetup-minimal
8912 findutils
8913 gawk
8914 grep
8915 keyutils
8916 linux-pam
8917 lsof
8918 lvm2
8919 nss
8920 rsync
8921 sed
8922 util-linux
8923 which))
8924 (home-page "https://ecryptfs.org/")
8925 (synopsis "Cryptographic file system utilities")
8926 (description
8927 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
8928Each file's cryptographic meta-data is stored inside the file itself, along
8929with the encrypted contents. This allows individual encrypted files to be
8930copied between hosts and still be decrypted with the proper key. eCryptfs is a
8931native Linux file system, and has been part of the Linux kernel since version
89322.6.19. This package contains the userland utilities to manage it.")
8933 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
8934 ;; grant additional permission to link with OpenSSL.
8935 (license license:gpl2+)))
8936
8937(define-public libnfsidmap
8938 (package
8939 (name "libnfsidmap")
8940 (version "0.27")
8941 (source
8942 (origin
8943 (method url-fetch)
8944 (uri (string-append "https://fedorapeople.org/~steved/"
8945 name "/" version "/" name "-" version ".tar.bz2"))
8946 (sha256
8947 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
8948 (build-system gnu-build-system)
8949 (arguments
8950 `(#:configure-flags (list
8951 (string-append "--with-pluginpath="
8952 (assoc-ref %outputs "out")
8953 "/lib/libnfsidmap"))))
8954 (native-inputs
8955 (list autoconf)) ; 0.27 still needs autoheader
8956 (home-page
8957 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
8958 (synopsis "NFSv4 support library for name/ID mapping")
8959 (description "Libnfsidmap is a library holding multiple methods of
8960mapping names to ids and visa versa, mainly for NFSv4. It provides an
8961extensible array of mapping functions, currently consisting of two choices:
8962the default @code{nsswitch} and the experimental @code{umich_ldap}.")
8963 (license (license:non-copyleft "file://COPYING"
8964 "See COPYING in the distribution."))))
8965
8966(define-public module-init-tools
8967 (package
8968 (name "module-init-tools")
8969 (version "3.16")
8970 (source (origin
8971 (method url-fetch)
8972 (uri (string-append
8973 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
8974 "module-init-tools-" version ".tar.bz2"))
8975 (sha256
8976 (base32
8977 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
8978 (patches (search-patches "module-init-tools-moduledir.patch"))))
8979 (build-system gnu-build-system)
8980 (arguments
8981 ;; FIXME: The upstream tarball lacks man pages, and building them would
8982 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
8983 ;; but they vanished. In the meantime, fake it.
8984 '(#:phases
8985 (modify-phases %standard-phases
8986 (add-before 'configure 'fake-docbook
8987 (lambda _
8988 (substitute* "Makefile.in"
8989 (("^DOCBOOKTOMAN.*$")
8990 "DOCBOOKTOMAN = true\n"))
8991 #t)))))
8992 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
8993 (synopsis "Tools for loading and managing Linux kernel modules")
8994 (description
8995 "Tools for loading and managing Linux kernel modules, such as
8996@code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
8997 (license license:gpl2+)))
8998
8999(define-public mce-inject
9000 (let ((revision "0") ; no git tags :-/
9001 (commit "4cbe46321b4a81365ff3aafafe63967264dbfec5"))
9002 (package
9003 (name "mce-inject")
9004 (version (git-version "0.0.0" revision commit))
9005 (source
9006 (origin
9007 (method git-fetch)
9008 (uri (git-reference
9009 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git")
9010 (commit commit)))
9011 (file-name (git-file-name name version))
9012 (sha256
9013 (base32 "0gjapg2hrlxp8ssrnhvc19i3r1xpcnql7xv0zjgbv09zyha08g6z"))))
9014 (build-system gnu-build-system)
9015 (arguments
9016 ;; There is no test suite. There's a test/ directory, but it just holds
9017 ;; example text files you could feed to the programme to crash something.
9018 (list #:tests? #f
9019 #:make-flags
9020 #~(list (string-append "prefix=" #$output)
9021 (string-append "CC=" #$(cc-for-target)))
9022 #:phases
9023 #~(modify-phases %standard-phases
9024 (delete 'configure) ; no configure script
9025 (add-after 'install 'install-examples
9026 (lambda* (#:key outputs #:allow-other-keys)
9027 (let* ((out (assoc-ref outputs "out"))
9028 (doc (string-append out "/share/doc/" #$name))
9029 (dir (string-append doc "/examples")))
9030 (copy-recursively "test" dir )))))))
9031 (native-inputs
9032 (list bison flex))
9033 (supported-systems (list "i686-linux" "x86_64-linux"))
9034 (home-page
9035 "https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git/about/")
9036 (synopsis
9037 "Inject x86 @acronym{MCEs, machine-check exceptions} into Linux")
9038 (description
9039 "This simple tool injects fake @acronym{MCEs, machine-check exceptions}
9040into a running Linux kernel, to debug or test the kernel's @acronym{EDAC, error
9041detection and correction}-handling code specific to x86 and x86_64 platforms.
9042
9043Real MCEs are internal CPU errors. Handling them correctly can be important to
9044system stability and even prevent physical damage. In contrast, simulated MCEs
9045produced by @command{mce-inject} are purely synthetic: injection happens only at
9046the software level, inside the kernel, and is not visible to the platform
9047hardware or firmware.
9048
9049A convenient feature of @command{mce-inject} is that the input language used to
9050describe MCEs is similar to the format used in Linux panic messages, with a few
9051extensions. In general, you should be able to pipe in any logged MCE panic to
9052simulate that same MCE.
9053
9054The target kernel must have the @code{CONFIG_X86_MCE_INJECT} option enabled and
9055the @code{mce-inject} module loaded if it exists.")
9056 (license license:gpl2))))
9057
9058(define-public mcelog
9059 (package
9060 (name "mcelog")
9061 (version "195")
9062 (source
9063 (origin
9064 (method git-fetch)
9065 (uri (git-reference
9066 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git")
9067 (commit (string-append "v" version))))
9068 (file-name (git-file-name name version))
9069 (sha256
9070 (base32 "1bg2bj8flybd8kzmmaaslisc6lc1fs9nbv09im6r32dq48skx5aj"))
9071 (modules '((guix build utils)))
9072 (snippet
9073 `(begin
9074 ;; The checkout lacks a .git directory, breaking ‘git describe’.
9075 (substitute* "Makefile"
9076 (("\"unknown\"") (string-append "\"v" ,version "\"")))))))
9077 (build-system gnu-build-system)
9078 (arguments
9079 (list
9080 ;; The tests will only run as root on certain supported CPU models.
9081 #:tests? #f
9082 #:make-flags
9083 #~(list (string-append "CC=" #$(cc-for-target))
9084 (string-append "prefix=" #$output)
9085 (string-append "DOCDIR=" #$output "/share/doc/"
9086 #$name "-" #$version)
9087 "etcprefix=$(DOCDIR)/examples")
9088 #:phases
9089 #~(modify-phases %standard-phases
9090 (delete 'configure)))) ; no configure script
9091 (native-inputs
9092 (list python-wrapper)) ; to generate example mcelog.conf
9093 (supported-systems (list "i686-linux" "x86_64-linux"))
9094 (home-page "https://mcelog.org/")
9095 (synopsis "Machine check monitor for x86 Linux systems")
9096 (description
9097 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
9098systems running the kernel Linux. It can also perform user-defined tasks, such
9099as bringing bad pages off-line, when configurable error thresholds are
9100exceeded.")
9101 (license license:gpl2)))
9102
9103(define-public mtd-utils
9104 (package
9105 (name "mtd-utils")
9106 (version "2.1.5")
9107 (source (origin
9108 (method url-fetch)
9109 (uri (string-append
9110 "ftp://ftp.infradead.org/pub/mtd-utils/"
9111 "mtd-utils-" version ".tar.bz2"))
9112 (sha256
9113 (base32
9114 "0ilz8hkcyvfcnqpy25kbr8fb71x9vl28wbmw56vvd68n2byjfviq"))))
9115 (arguments
9116 (list #:configure-flags
9117 (if (%current-target-system) ; When cross-compiling.
9118 #~(list)
9119 #~(list "--enable-unit-tests"))
9120
9121 #:parallel-tests? #f)) ;tests may fail when running in parallel
9122 (native-inputs
9123 (list cmocka pkg-config))
9124 (inputs
9125 (list acl ; extended attributes (xattr)
9126 lzo
9127 openssl ; optional crypto support
9128 `(,util-linux "lib")
9129 zlib
9130 `(,zstd "lib")))
9131 (build-system gnu-build-system)
9132 (synopsis "MTD Flash Storage Utilities")
9133 (description "This package provides utilities for testing, partitioning, etc
9134of flash storage.")
9135 (home-page "http://www.linux-mtd.infradead.org/")
9136 (license
9137 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
9138 license:mpl1.1 ; All ftl* files
9139 license:expat)))) ; libiniparser
9140
9141(define-public libseccomp
9142 (package
9143 (name "libseccomp")
9144 (version "2.6.0")
9145 (source (origin
9146 (method git-fetch)
9147 (uri (git-reference
9148 (url "https://github.com/seccomp/libseccomp")
9149 (commit (string-append "v" version))))
9150 (file-name (git-file-name name version))
9151 (sha256
9152 (base32
9153 "189yh66aj3z3jvns739qbj504f3mcl3w44pxxizw877pbj3kal11"))))
9154 (build-system gnu-build-system)
9155 (arguments
9156 (list
9157 #:configure-flags #~(list "--disable-static")
9158 #:phases #~(modify-phases %standard-phases
9159 #$@(if (target-ppc32?)
9160 ;; This test is removed upstream. See upstream commit
9161 ;; 7db46d72f13c172b290818f624c2966bd0db5677
9162 #~((add-after 'unpack 'skip-62-sim-arch-tests
9163 (lambda _
9164 (substitute*
9165 "tests/62-sim-arch_transactions.tests"
9166 (("test type: bpf-sim-fuzz") "")
9167 (("62-sim-arch_transactions 5") "")))))
9168 #~())
9169 (add-before 'check 'skip-load-test
9170 (lambda _
9171 ;; This test does a native system call and fails when
9172 ;; run under QEMU user-mode emulation. Just skip it.
9173 (delete-file "tests/52-basic-load.tests"))))))
9174 (native-inputs
9175 (list autoconf automake gperf libtool which))
9176 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
9177 (description "The libseccomp library provides an easy to use, platform
9178independent, interface to the Linux Kernel's syscall filtering mechanism. The
9179libseccomp API is designed to abstract away the underlying BPF based syscall
9180filter language and present a more conventional function-call based filtering
9181interface that should be familiar to, and easily adopted by, application
9182developers.")
9183 (home-page "https://github.com/seccomp/libseccomp")
9184 (license license:lgpl2.1)))
9185
9186(define-public radeontop
9187 (package
9188 (name "radeontop")
9189 (version "1.4")
9190 (source
9191 (origin
9192 (method git-fetch)
9193 (uri (git-reference
9194 (url "https://github.com/clbr/radeontop")
9195 (commit (string-append "v" version))))
9196 (file-name (git-file-name name version))
9197 (sha256
9198 (base32 "0kwqddidr45s1blp0h8r8h1dd1p50l516yb6mb4s6zsc827xzgg3"))))
9199 (build-system gnu-build-system)
9200 (arguments
9201 `(#:phases (modify-phases %standard-phases
9202 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
9203 ;; dependency, and doesn't even work on release(!) tarballs.
9204 (add-after 'unpack 'report-correct-version
9205 (lambda _
9206 (substitute* "getver.sh"
9207 (("ver=unknown")
9208 (string-append "ver=" ,version)))))
9209 (delete 'configure)) ; no configure script
9210 #:make-flags (list (string-append "CC=" ,(cc-for-target))
9211 (string-append "PREFIX=" %output))
9212 #:tests? #f)) ; no tests
9213 (native-inputs
9214 (list gettext-minimal pkg-config))
9215 (inputs
9216 (list libdrm libpciaccess libxcb ncurses))
9217 (home-page "https://github.com/clbr/radeontop/")
9218 (synopsis "Usage monitor for AMD Radeon graphics")
9219 (description "RadeonTop monitors resource consumption on supported AMD
9220Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
9221a terminal or saved to a file for further processing. It measures both the
9222activity of the GPU as a whole, which is also accurate during OpenCL
9223computations, as well as separate component statistics that are only meaningful
9224under OpenGL graphics workloads.")
9225 (license license:gpl3)))
9226
9227(define-public efivar
9228 (package
9229 (name "efivar")
9230 (version "39")
9231 (source (origin
9232 (method git-fetch)
9233 (uri (git-reference
9234 (url "https://github.com/rhboot/efivar")
9235 (commit version)))
9236 (file-name (git-file-name name version))
9237 (sha256
9238 (base32
9239 "1zd9dghg1z2rrsazv3d9rj7nik6kdqz42jiak65pipz7mpjn9zdk"))
9240 (patches (search-patches "efivar-fix-fprint-format.patch"))))
9241 (build-system gnu-build-system)
9242 (arguments
9243 (list
9244 ;; Tests require a UEFI system and is not detected in the chroot.
9245 #:tests? #f
9246 #:make-flags #~(list (string-append "prefix="
9247 #$output)
9248 (string-append "libdir="
9249 #$output "/lib")
9250 (string-append "CC="
9251 #$(cc-for-target))
9252 "HOSTCC=gcc"
9253 (string-append "LDFLAGS=-Wl,-rpath="
9254 #$output "/lib")
9255 ;; Strictly only needed for i686-linux/32bit
9256 "CFLAGS=-g -O2 -Wno-error=format")
9257 #:phases #~(modify-phases %standard-phases
9258 (add-after 'unpack 'build-deterministically
9259 (lambda _
9260 (substitute* "src/include/defaults.mk"
9261 ;; Don't use -march=native.
9262 (("-march=native")
9263 ""))))
9264 (delete 'configure))))
9265 (native-inputs (list mandoc pkg-config))
9266 (inputs (list popt))
9267 (home-page "https://github.com/rhboot/efivar")
9268 (synopsis "Tool and library to manipulate EFI variables")
9269 (description "This package provides a library and a command line
9270interface to the variable facility of UEFI boot firmware.")
9271 (license license:lgpl2.1+)))
9272
9273(define-public efibootmgr
9274 (package
9275 (name "efibootmgr")
9276 (version "18")
9277 (source
9278 (origin
9279 (method git-fetch)
9280 (uri (git-reference
9281 (url "https://github.com/rhboot/efibootmgr")
9282 (commit version)))
9283 (file-name (git-file-name name version))
9284 (sha256
9285 (base32 "1j19m3dngcb7jl88ib32phbh5r7c02dhhakq8jk6z7y408c111hd"))))
9286 (build-system gnu-build-system)
9287 (arguments
9288 (list
9289 #:tests? #f ;no tests
9290 #:make-flags
9291 #~(append (list (string-append "prefix=" #$output)
9292 (string-append "libdir=" #$output "/lib")
9293 ;; EFIDIR denotes a subdirectory relative to the
9294 ;; EFI System Partition where the loader will be
9295 ;; installed (known as OS_VENDOR in the code).
9296 ;; GRUB overrides this, as such it's only used if
9297 ;; nothing else is specified on the command line.
9298 "EFIDIR=gnu")
9299 #$(if (%current-target-system)
9300 #~(list
9301 (string-append "CC=" #$(cc-for-target))
9302 (string-append "PKG_CONFIG=" #$(pkg-config-for-target))
9303 (string-append "EXTRAINCDIRS="
9304 #$(this-package-input "efivar") "/include"))
9305 #~'()))
9306 #:phases #~(modify-phases %standard-phases (delete 'configure))))
9307 (native-inputs
9308 (list pkg-config))
9309 (inputs
9310 (list efivar popt))
9311 (home-page "https://github.com/rhboot/efibootmgr")
9312 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
9313 (description
9314 "@code{efibootmgr} is a user-space application to modify the Intel
9315Extensible Firmware Interface (EFI) Boot Manager. This application can
9316create and destroy boot entries, change the boot order, change the next
9317running boot option, and more.")
9318 (license license:gpl2+)))
9319
9320(define-public sysstat
9321 (package
9322 (name "sysstat")
9323 (version "12.7.5")
9324 (source
9325 (origin
9326 (method url-fetch)
9327 (uri (string-append "https://sysstat.github.io/sysstat-packages/"
9328 "sysstat-" version ".tar.xz"))
9329 (sha256
9330 (base32 "0ssdrm3k0fclq5b5i0aznfwdkbac9l9cf88idaq3pls9lm040rjp"))))
9331 (build-system gnu-build-system)
9332 (native-inputs (list gettext-minimal))
9333 (arguments
9334 `(#:tests? #f ; no test suite.
9335 ;; Without this flag, it tries to install the man pages with group 'root'
9336 ;; and fails because /etc/passwd lacks an entry for the root user.
9337 #:configure-flags
9338 (list "--disable-file-attr"
9339 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
9340 #:phases
9341 (modify-phases %standard-phases
9342 ;; The build process tries to create '/var/lib/sa', so we skip that
9343 ;; instruction.
9344 (add-after 'build 'skip-touching-var
9345 (lambda _
9346 (substitute* "Makefile"
9347 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
9348 "")))))))
9349 (home-page "https://sysstat.github.io")
9350 (synopsis "Performance monitoring tools for Linux")
9351 (description "The sysstat utilities are a collection of performance
9352monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
9353@code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
9354@code{sadf} and @code{sa}.")
9355 (license license:gpl2+)))
9356
9357(define-public acpilight
9358 (package
9359 (name "acpilight")
9360 (version "1.2")
9361 (source (origin
9362 (method git-fetch)
9363 (uri (git-reference
9364 (url "https://gitlab.com/wavexx/acpilight.git")
9365 (commit (string-append "v" version))))
9366 (file-name (git-file-name name version))
9367 (sha256
9368 (base32
9369 "1r0r3nx6x6vkpal6vci0zaa1n9dfacypldf6k8fxg7919vzxdn1w"))))
9370 (build-system gnu-build-system)
9371 (arguments
9372 (list #:tests? #f ; no tests
9373 #:make-flags
9374 #~(list (string-append "prefix=" #$output)
9375 (string-append "sysconfdir=" #$output "/lib")) ;udev rule
9376 #:phases
9377 #~(modify-phases %standard-phases
9378 (delete 'configure)
9379 (add-after 'unpack 'patch
9380 (lambda* (#:key inputs #:allow-other-keys)
9381 ;; Prevent reloading udev at build time
9382 (substitute* "Makefile"
9383 (("udevadm") "true"))
9384 (substitute* "90-backlight.rules"
9385 (("/bin")
9386 (string-append #$(this-package-input "coreutils")
9387 "/bin"))))))))
9388 (inputs (list coreutils python))
9389 (home-page "https://gitlab.com/wavexx/acpilight")
9390 (synopsis "Backward-compatibile xbacklight replacement")
9391 (description "acpilight is a backward-compatibile replacement for
9392xbacklight that uses the ACPI interface to set the display brightness. On
9393modern laptops acpilight can control both display and keyboard backlight
9394uniformly on either X11, the console or Wayland.")
9395 (license license:gpl3+)))
9396
9397(define-public light
9398 (package
9399 (name "light")
9400 (version "1.2.2")
9401 (source
9402 (origin
9403 (method git-fetch)
9404 (uri (git-reference
9405 (url "https://github.com/haikarainen/light")
9406 (commit (string-append "v" version))))
9407 (sha256
9408 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
9409 (file-name (git-file-name name version))))
9410 (build-system gnu-build-system)
9411 (arguments
9412 `(#:configure-flags '("CFLAGS=-fcommon")
9413 #:phases
9414 (modify-phases %standard-phases
9415 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
9416 (lambda* (#:key inputs #:allow-other-keys)
9417 (substitute* "90-backlight.rules"
9418 (("/bin/chgrp") (which "chgrp"))
9419 (("/bin/chmod") (which "chmod")))
9420 #t))
9421 (add-after 'install 'install-udev-rules
9422 (lambda* (#:key outputs #:allow-other-keys)
9423 (let ((out (assoc-ref outputs "out")))
9424 (install-file
9425 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
9426 #t))))))
9427 (native-inputs
9428 (list autoconf automake))
9429 (home-page "https://haikarainen.github.io/light/")
9430 (synopsis "GNU/Linux application to control backlights")
9431 (description
9432 "Light is a program to send commands to screen backlight controllers
9433under GNU/Linux. Features include:
9434
9435@itemize
9436@item It does not rely on X.
9437@item Light can automatically figure out the best controller to use, making
9438full use of underlying hardware.
9439@item It is possible to set a minimum brightness value, as some controllers
9440set the screen to be pitch black at a value of 0 (or higher).
9441@end itemize\n")
9442 (license license:gpl3+)))
9443
9444(define-public brightnessctl
9445 (package
9446 (name "brightnessctl")
9447 (version "0.5.1")
9448 (home-page "https://github.com/Hummer12007/brightnessctl")
9449 (source (origin
9450 (method git-fetch)
9451 (uri (git-reference (url home-page) (commit version)))
9452 (file-name (git-file-name name version))
9453 (sha256
9454 (base32
9455 "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq"))
9456 (patches (search-patches "brightnessctl-elogind-support.patch"))))
9457 (build-system gnu-build-system)
9458 (arguments
9459 `(#:tests? #f ; no tests
9460 #:make-flags (list (string-append "CC=" ,(cc-for-target))
9461 (string-append "PREFIX=" %output)
9462 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/")
9463 "ENABLE_SYSTEMD=1")
9464 #:phases
9465 (modify-phases %standard-phases
9466 (delete 'configure)
9467 (add-after 'unpack 'adjust-udev-rules
9468 (lambda _
9469 (substitute* "Makefile"
9470 (("INSTALL_UDEV_RULES=0") "INSTALL_UDEV_RULES=1"))
9471 (substitute* "90-brightnessctl.rules"
9472 (("/bin/") "/run/current-system/profile/bin/"))
9473 #t)))))
9474 (native-inputs
9475 (list pkg-config))
9476 (inputs
9477 (list elogind))
9478 (synopsis "Backlight and LED brightness control")
9479 (description
9480 "This program allows you read and control device brightness. Devices
9481include backlight and LEDs. It can also preserve current brightness before
9482applying the operation, such as on lid close.
9483
9484The appropriate permissions must be set on the backlight or LED control
9485interface in sysfs, which can be accomplished with the included udev rules.")
9486 (license license:expat)))
9487
9488(define-public tlp
9489 (package
9490 (name "tlp")
9491 (version "1.8.0")
9492 (source
9493 (origin
9494 (method git-fetch)
9495 (uri (git-reference
9496 (url "https://github.com/linrunner/TLP")
9497 (commit version)))
9498 (file-name (git-file-name name version))
9499 (sha256
9500 (base32 "0r8r95wjb1sl5v8mli7kba2py9hc0ps915fx4lap5pg108ik9a06"))))
9501 (native-inputs
9502 (list shellcheck))
9503 (inputs
9504 `(("dbus" ,dbus)
9505 ("ethtool" ,ethtool)
9506 ("eudev" ,eudev)
9507 ("grep" ,grep)
9508 ("guile" ,guile-3.0) ;for wrap-script
9509 ("hdparm" ,hdparm)
9510 ("inetutils" ,inetutils)
9511 ("iw" ,iw)
9512 ("kmod" ,kmod)
9513 ("pciutils" ,pciutils)
9514 ("perl" ,perl)
9515 ("rfkill" ,rfkill)
9516 ("sed" ,sed)
9517 ("usbutils" ,usbutils)
9518 ("util-linux" ,util-linux)
9519 ("wireless-tools" ,wireless-tools)
9520 ,@(if (let ((system (or (%current-target-system)
9521 (%current-system))))
9522 (or (string-prefix? "i686-" system)
9523 (string-prefix? "x86_64-" system)))
9524 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
9525 '())))
9526 (build-system gnu-build-system)
9527 (arguments
9528 ;; XXX: The full test suite is run with "checkall" but it requires
9529 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
9530 (list
9531 #:make-flags
9532 #~(list "TLP_CONFUSR=/etc/tlp.conf" "TLP_CONFDIR=/etc/tlp.d")
9533 #:test-target "shellcheck"
9534 #:modules '((guix build gnu-build-system)
9535 (guix build utils)
9536 (srfi srfi-1))
9537 #:phases
9538 #~(modify-phases %standard-phases
9539 (delete 'configure) ; no configure script
9540 (add-before 'build 'setenv
9541 (lambda _
9542 (setenv "TLP_WITH_SYSTEMD" "0")
9543 (setenv "TLP_NO_INIT" "1")))
9544 (add-before 'build 'fix-installation
9545 (lambda _
9546 ;; Stop the Makefile from trying to create system directories.
9547 (substitute* "Makefile"
9548 (("= /usr") (string-append "= " #$output))
9549 (("= /etc") (string-append "= " #$output "/etc"))
9550 (("install -d -m 755 \\$\\(_VAR\\)") "#"))))
9551 (add-before 'build 'fix-perl-calls
9552 ;; Shell scripts in "bat.d" and "func.d" call "perl". Fix
9553 ;; invocation without wrapping every one of them.
9554 (lambda* (#:key inputs #:allow-other-keys)
9555 (substitute* (append (find-files "bat.d" ".")
9556 (find-files "func.d" "."))
9557 (("(^|[^/])perl" _ prefix)
9558 (string-append prefix
9559 (search-input-file inputs "bin/perl"))))))
9560 (replace 'install
9561 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
9562 (add-after 'install 'wrap
9563 (lambda* (#:key inputs outputs #:allow-other-keys)
9564 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
9565 (sbin (string-append (assoc-ref outputs "out") "/sbin"))
9566 ;; Used to ignore symlinks which don't need wrapping
9567 (regular-file-predicate
9568 (lambda (file stat) (eq? 'regular (stat:type stat))))
9569 (bin-files (find-files bin regular-file-predicate))
9570 (sbin-files (find-files sbin regular-file-predicate)))
9571 (define (bin-directory input-name)
9572 (let ((p (assoc-ref inputs input-name)))
9573 (and p (string-append p "/bin"))))
9574 (define (sbin-directory input-name)
9575 (string-append (assoc-ref inputs input-name) "/sbin"))
9576 (for-each (lambda (program)
9577 ;; Programs rely on $0 so we use wrap-script
9578 ;; instead of wrap-program
9579 (wrap-script program
9580 `("PATH" ":" prefix
9581 ,(append
9582 (filter-map bin-directory
9583 '("bash"
9584 "coreutils"
9585 "dbus"
9586 "eudev"
9587 "grep"
9588 "inetutils"
9589 "kmod"
9590 "perl"
9591 "sed"
9592 "usbutils"
9593 "util-linux"
9594 "x86-energy-perf-policy"))
9595 (filter-map sbin-directory
9596 '("ethtool"
9597 "hdparm"
9598 "iw"
9599 "pciutils"
9600 "rfkill"
9601 "wireless-tools"))))))
9602 (append bin-files sbin-files))))))))
9603 (home-page "https://linrunner.de/en/tlp/tlp.html")
9604 (synopsis "Power management tool for Linux")
9605 (description "TLP is a power management tool for Linux. It comes with
9606a default configuration already optimized for battery life. Nevertheless,
9607TLP is customizable to fulfil system requirements. TLP settings are applied
9608every time the power supply source is changed.")
9609 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
9610 ;; rest is GPLv2+.
9611 (license (list license:gpl2+ license:gpl3+))))
9612
9613(define-public tlpui
9614 (package
9615 (name "tlpui")
9616 (version "1.8.0")
9617 (source
9618 (origin
9619 (method git-fetch)
9620 (uri (git-reference
9621 (url "https://github.com/d4nj1/TLPUI")
9622 (commit (string-append "tlpui-" version))))
9623 (file-name (git-file-name name version))
9624 (sha256
9625 (base32 "1q33p4gf5ii53wlgs61gghqxp3js5c45pn5nlibg2ygw069225r5"))))
9626 (build-system pyproject-build-system)
9627 (arguments
9628 (list
9629 #:phases
9630 #~(modify-phases %standard-phases
9631 (add-after 'unpack 'set-absolute-locations
9632 (lambda* (#:key inputs #:allow-other-keys)
9633 (let ((defaults.conf
9634 (search-input-file inputs "/share/tlp/defaults.conf"))
9635 (lspci (search-input-file inputs "/bin/lspci"))
9636 (lsusb (search-input-file inputs "/bin/lsusb"))
9637 (tlp-stat (search-input-file inputs "/bin/tlp-stat")))
9638 (with-directory-excursion "tlpui"
9639 (substitute* '("file.py" "settingshelper.py" "statui.py")
9640 (("\"tlp-stat\"")
9641 (string-append "'" tlp-stat "'"))
9642 (("/usr/share/tlp/defaults.conf")
9643 defaults.conf))
9644 (substitute* "ui_config_objects/gtkusblist.py"
9645 (("\"lsusb\"")
9646 (string-append "'" lsusb "'")))
9647 (substitute* "ui_config_objects/gtkpcilist.py"
9648 (("\"lspci\"")
9649 (string-append "'" lspci "'")))
9650 ;; Settings check if various tlp executables, lspci and
9651 ;; usbutils are available. Skip this phase since we know
9652 ;; for sure they are (and it avoids patching each location).
9653 (substitute* "settingshelper.py"
9654 (("(command_exists = ).*" _ lead)
9655 (string-append lead "True\n")))))))
9656 (add-after 'install 'install-desktop-file
9657 (lambda _
9658 (let ((dir (string-append #$output "/share/applications")))
9659 (install-file "tlpui.desktop" dir))))
9660 (add-after 'wrap 'wrap-gi-python
9661 (lambda _
9662 (let ((gi-typelib-path (getenv "GI_TYPELIB_PATH")))
9663 (wrap-program (string-append #$output "/bin/tlpui")
9664 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))))))))
9665 (native-inputs
9666 (list `(,glib "bin")
9667 gobject-introspection
9668 python-poetry-core
9669 python-pytest
9670 python-pyyaml))
9671 (inputs
9672 (list gtk+
9673 pciutils
9674 python-pygobject
9675 tlp
9676 usbutils))
9677 (propagated-inputs (list (librsvg-for-system)))
9678 (home-page "https://github.com/d4nj1/TLPUI")
9679 (synopsis "User interface for TLP written in Python")
9680 (description
9681 "The Python scripts in this project generate a GTK-UI to change
9682TLP configuration files easily. It aims to protect users from setting
9683bad configuration and to deliver a basic overview of all the valid
9684configuration values.")
9685 (license license:gpl2+)))
9686
9687(define-public lshw
9688 (package
9689 (name "lshw")
9690 (version "B.02.19.2")
9691 (source (origin
9692 (method url-fetch)
9693 (uri (string-append "https://www.ezix.org/software/"
9694 "files/lshw-" version
9695 ".tar.gz"))
9696 (sha256
9697 (base32
9698 "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
9699 (build-system gnu-build-system)
9700 (arguments
9701 `(#:phases (modify-phases %standard-phases (delete 'configure))
9702 #:tests? #f ; no tests
9703 #:make-flags
9704 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
9705 (synopsis "List hardware information")
9706 (description
9707 "@command{lshw} (Hardware Lister) is a small tool to provide
9708detailed information on the hardware configuration of the machine.
9709It can report exact memory configuration, firmware version, mainboard
9710configuration, CPU version and speed, cache configuration, bus speed,
9711and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
9712machines (PowerMac G4 is known to work).")
9713 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
9714 (license license:gpl2+)))
9715
9716(define-public libmnl
9717 (package
9718 (name "libmnl")
9719 (version "1.0.5")
9720 (source
9721 (origin
9722 (method url-fetch)
9723 (uri (string-append "mirror://netfilter.org/libmnl/"
9724 "libmnl-" version ".tar.bz2"))
9725 (sha256
9726 (base32
9727 "09851ns07399rbz0y8slrlmnw3fn1nakr8d37pxjn5gkks8rnjr7"))))
9728 (build-system gnu-build-system)
9729 (home-page "https://www.netfilter.org/projects/libmnl/")
9730 (synopsis "Netlink utility library")
9731 (description "Libmnl is a minimalistic user-space library oriented to
9732Netlink developers. There are a lot of common tasks in parsing, validating,
9733constructing of both the Netlink header and TLVs that are repetitive and easy to
9734get wrong. This library aims to provide simple helpers that allows you to
9735re-use code and to avoid re-inventing the wheel.")
9736 (properties
9737 '((release-monitoring-url . "https://www.netfilter.org/pub/libmnl/")))
9738 (license license:lgpl2.1+)))
9739
9740(define-public libnftnl
9741 (package
9742 (name "libnftnl")
9743 (version "1.2.8")
9744 (source
9745 (origin
9746 (method url-fetch)
9747 (uri (string-append "mirror://netfilter.org/libnftnl/"
9748 "libnftnl-" version ".tar.xz"))
9749 (sha256
9750 (base32 "15ddcyp91lxjh2wfi8xicjpffhn9rpiqsa8djbkqvc69npbabzip"))))
9751 (build-system gnu-build-system)
9752 (native-inputs
9753 (list pkg-config))
9754 (inputs
9755 (list libmnl))
9756 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
9757 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
9758 (description "Libnftnl is a userspace library providing a low-level netlink
9759programming interface to the in-kernel nf_tables subsystem. The library
9760libnftnl has been previously known as libnftables. This library is currently
9761used by nftables.")
9762 (license license:gpl2+)))
9763
9764;;; The symbol libnftl/fixed should be used when libnftnl needs fixes
9765;;; (security or else) and this deprecation could be removed.
9766(define-deprecated/public-alias libnftnl/fixed libnftnl/pinned)
9767
9768;; This is used in iptables, which contributes to rust. We're pinning this
9769;; variant to avoid accidental rebuilds of rust.
9770(define-public libnftnl/pinned
9771 (package
9772 (inherit libnftnl)
9773 (version "1.2.8")
9774 (source
9775 (origin
9776 (method url-fetch)
9777 (uri (string-append "mirror://netfilter.org/libnftnl/"
9778 "libnftnl-" version ".tar.xz"))
9779 (sha256
9780 (base32 "15ddcyp91lxjh2wfi8xicjpffhn9rpiqsa8djbkqvc69npbabzip"))))
9781 (build-system gnu-build-system)
9782 (native-inputs
9783 (list pkg-config))
9784 (inputs
9785 (list libmnl))))
9786
9787(define-public nftables
9788 (package
9789 (name "nftables")
9790 (version "1.0.8")
9791 (source
9792 (origin
9793 (method url-fetch)
9794 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
9795 version ".tar.xz")
9796 (string-append "https://www.nftables.org/projects/nftables"
9797 "/files/nftables-" version ".tar.xz")))
9798 (sha256
9799 (base32 "0l1xpwr9qfbl3bxa97v8s2lbibiz0xma9q0qi34xp0hswh6p8wwk"))))
9800 (build-system gnu-build-system)
9801 (arguments `(#:configure-flags
9802 '("--disable-static"
9803 "--with-cli=readline"
9804 "--with-json")
9805 #:phases
9806 (modify-phases %standard-phases
9807 (add-before 'configure 'autoreconf
9808 (lambda _
9809 (invoke "autoreconf" "-fi"))))))
9810 (inputs (list gmp libmnl libnftnl readline jansson))
9811 (native-inputs (list pkg-config
9812 bison
9813 flex
9814 docbook2x
9815 autoconf
9816 automake
9817 libtool))
9818 (home-page "https://www.nftables.org")
9819 (synopsis "Userspace utility for Linux packet filtering")
9820 (description "nftables is the project that aims to replace the existing
9821{ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
9822filtering framework, a new userspace utility and also a compatibility layer for
9823{ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
9824infrastructure such as the existing hooks, the connection tracking system, the
9825userspace queueing component and the logging subsystem.")
9826 (license license:gpl2)))
9827
9828(define-public libnetfilter-conntrack
9829 (package
9830 (name "libnetfilter-conntrack")
9831 (version "1.0.9")
9832 (source
9833 (origin
9834 (method url-fetch)
9835 (uri (string-append "https://netfilter.org/projects/"
9836 "libnetfilter_conntrack/files/"
9837 "libnetfilter_conntrack-"
9838 version ".tar.bz2"))
9839 (sha256
9840 (base32 "1a3rnpsba64dzy97wwjrxal89wr0nf9znvag2j18nkp3kzs9vgb7"))))
9841 (build-system gnu-build-system)
9842 (native-inputs (list pkg-config))
9843 (inputs (list libnfnetlink libmnl))
9844 (synopsis "Library for kernel connection tracking state table")
9845 (description "libnetfilter_conntrack is a userspace library providing a
9846programming interface (API) to the in-kernel connection tracking state table.
9847The library libnetfilter_conntrack has been previously known as
9848libnfnetlink_conntrack and libctnetlink. This library is currently used by
9849conntrack-tools among many other applications.")
9850 (home-page "https://netfilter.org/projects/libnetfilter_conntrack/index.html")
9851 (supported-systems (filter target-linux? %supported-systems))
9852 (properties '((upstream-name . "libnetfilter_conntrack")))
9853 (license license:gpl2+)))
9854
9855(define-public libnetfilter-cttimeout
9856 (package
9857 (name "libnetfilter-cttimeout")
9858 (version "1.0.1")
9859 (source
9860 (origin
9861 (method url-fetch)
9862 (uri (string-append "https://netfilter.org/projects/"
9863 "libnetfilter_cttimeout/files/"
9864 "libnetfilter_cttimeout-" version ".tar.bz2"))
9865 (sha256
9866 (base32 "0983cpyvxyycbnzqlrzml80pph2z51r6s7sxp06ciq8468pxln8b"))))
9867 (build-system gnu-build-system)
9868 (native-inputs (list pkg-config))
9869 (inputs (list libmnl))
9870 (synopsis "Library for kernel connection tracking timeout infrastructure")
9871 (description "libnetfilter_cttimeout is the userspace library that
9872provides the programming interface to the fine-grain connection tracking
9873timeout infrastructure. With this library, you can create, update and delete
9874timeout policies that can be attached to traffic flows. This library is used
9875by conntrack-tools.")
9876 (home-page "https://netfilter.org/projects/libnetfilter_cttimeout/index.html")
9877 (supported-systems (filter target-linux? %supported-systems))
9878 (properties '((upstream-name . "libnetfilter_cttimeout")))
9879 (license license:gpl2)))
9880
9881(define-public libnetfilter-cthelper
9882 (package
9883 (name "libnetfilter-cthelper")
9884 (version "1.0.1")
9885 (source
9886 (origin
9887 (method url-fetch)
9888 (uri (string-append "https://netfilter.org/projects/"
9889 "libnetfilter_cthelper/files/"
9890 "libnetfilter_cthelper-" version ".tar.bz2"))
9891 (sha256
9892 (base32 "04n95ngil5l8m8v64dfjm1dwq0wd3kf4vw1zblsrff13hxa3s1ql"))))
9893 (build-system gnu-build-system)
9894 (native-inputs (list pkg-config))
9895 (inputs (list libmnl))
9896 (synopsis "Library for user-space connection tracking helpers")
9897 (description "libnetfilter_cthelper is a userspace library that provides a
9898programming interface to user-space connection tracking helpers.
9899@enumerate
9900@item
9901register new user-space connection tracking helpers
9902@item
9903unregister user-space connection tracking helpers
9904@item
9905list existing registered user-space connection tracking helpers
9906@end enumerate")
9907 (home-page "https://netfilter.org/projects/libnetfilter_cthelper/index.html")
9908 (supported-systems (filter target-linux? %supported-systems))
9909 (properties '((upstream-name . "libnetfilter_cthelper")))
9910 (license license:gpl2+)))
9911
9912(define-public libnetfilter-queue
9913 (package
9914 (name "libnetfilter-queue")
9915 (version "1.0.5")
9916 (source
9917 (origin
9918 (method url-fetch)
9919 (uri (string-append "https://netfilter.org/projects/"
9920 "libnetfilter_queue/files/"
9921 "libnetfilter_queue-" version ".tar.bz2"))
9922 (sha256
9923 (base32
9924 "1xdra6i4p8jkv943ygjw646qx8df27f7p5852kc06vjx608krzzr"))))
9925 (build-system gnu-build-system)
9926 (native-inputs (list pkg-config))
9927 (inputs (list libmnl libnfnetlink))
9928 (synopsis "Library for kernel netfilter infrastructure and state")
9929 (description "libnetfilter_queue is a userspace library providing an API
9930to packets that have been queued by the kernel packet filter. It is is part
9931of a system that deprecates the old ip_queue/libipq mechanism.")
9932 (home-page "https://netfilter.org/projects/libnetfilter_queue/index.html")
9933 (supported-systems (filter target-linux? %supported-systems))
9934 (properties '((upstream-name . "libnetfilter_queue")))
9935 (license license:gpl2+)))
9936
9937(define-public conntrack-tools
9938 (package
9939 (name "conntrack-tools")
9940 (version "1.4.8")
9941 (source
9942 (origin
9943 (method url-fetch)
9944 (uri (string-append "https://netfilter.org/projects/"
9945 "conntrack-tools/files/"
9946 "conntrack-tools-" version ".tar.xz"))
9947 (sha256
9948 (base32 "1mnynl5a63j25arapwvkjbm3a2cqm3aaklwfwwclhmpnqps7fxh6"))))
9949 (build-system gnu-build-system)
9950 (native-inputs (list bison flex pkg-config))
9951 (inputs (list libtirpc
9952 libnetfilter-conntrack
9953 libnetfilter-cttimeout
9954 libnetfilter-cthelper
9955 libnetfilter-queue
9956 libnfnetlink
9957 libmnl))
9958 (synopsis "Set of tools targeting the conntrack kernel subsystem")
9959 (description "The tool conntrack provides a full featured interface that
9960is intended to replace the old @file{/proc/net/ip_conntrack} interface. Using
9961conntrack, you can view and manage the in-kernel connection tracking state
9962table from userspace. On the other hand, conntrackd covers the specific
9963aspects of stateful firewalls to enable highly available scenarios, and can be
9964used as statistics collector as well.
9965
9966Since 1.2.0, the conntrack-tools includes the @command{nfct} command line
9967utility. This utility only supports the nfnetlink_cttimeout by now. In the
9968long run, we expect that it will replace conntrack by providing a syntax
9969similar to nftables.")
9970 (home-page "https://netfilter.org/projects/conntrack-tools/index.html")
9971 (supported-systems (filter target-linux? %supported-systems))
9972 (license license:gpl2+)))
9973
9974(define-public libnetfilter-acct
9975 (package
9976 (name "libnetfilter-acct")
9977 (version "1.0.3")
9978 (source
9979 (origin
9980 (method url-fetch)
9981 (uri (string-append "https://netfilter.org/projects/"
9982 "libnetfilter_acct/files/"
9983 "libnetfilter_acct-" version ".tar.bz2"))
9984 (sha256
9985 (base32
9986 "06lsjndgfjsgfjr43px2n2wk3nr7whz6r405mks3887y7vpwwl22"))))
9987 (build-system gnu-build-system)
9988 (native-inputs (list pkg-config))
9989 (inputs (list libmnl))
9990 (synopsis "Library providing interface to extended accounting infrastructure")
9991 (description "libnetfilter_acct is the userspace library providing interface
9992to extended accounting infrastructure.
9993
9994@enumerate
9995@item
9996creating accounting objects
9997@item
9998retrieving accounting objects (and atomically set to zero)
9999@item
10000deleting accounting objects
10001@end enumerate
10002For the nfnetlink_acct subsystem.")
10003 (home-page "https://netfilter.org/projects/libnetfilter_acct/index.html")
10004 (supported-systems (filter target-linux? %supported-systems))
10005 (properties '((upstream-name . "libnetfilter_acct")))
10006 (license license:lgpl2.1+)))
10007
10008(define-public nfacct
10009 (package
10010 (name "nfacct")
10011 (version "1.0.2")
10012 (source
10013 (origin
10014 (method url-fetch)
10015 (uri (string-append "https://netfilter.org/projects/" name
10016 "/files/nfacct-" version ".tar.bz2"))
10017 (sha256
10018 (base32
10019 "0sdxbxjyapbqcp2ami5jd10vz4xbbdvx39f3wfy1iqsbflc25zzc"))))
10020 (build-system gnu-build-system)
10021 (native-inputs (list pkg-config))
10022 (inputs (list libmnl libnetfilter-acct))
10023 (synopsis "Command line tool to create/retrieve/delete accounting objects")
10024 (description "nfacct is the command line tool to create/retrieve/delete
10025accounting objects
10026@enumerate
10027@item
10028listing the objects of the nfacct table in plain text/XML
10029@item
10030atomically get and reset objects of the nfacct table
10031@item
10032adding new objects to the nfacct table
10033@item
10034deleting objects from the nfacct table
10035@end enumerate")
10036 (home-page "https://netfilter.org/projects/nfacct/index.html")
10037 (supported-systems (filter target-linux? %supported-systems))
10038 (license license:gpl2+)))
10039
10040(define-public libnetfilter-log
10041 (package
10042 (name "libnetfilter-log")
10043 (version "1.0.2")
10044 (source
10045 (origin
10046 (method url-fetch)
10047 (uri (string-append "https://netfilter.org/projects/"
10048 "libnetfilter_log/files/"
10049 "libnetfilter_log-" version ".tar.bz2"))
10050 (sha256
10051 (base32
10052 "1spy9xs41v76kid5ana8n126f3mvgq6fjibbfbj4kn0larbhix73"))))
10053 (build-system gnu-build-system)
10054 (native-inputs (list pkg-config))
10055 (inputs (list libnfnetlink libmnl))
10056 (synopsis "Library providing interface to packets logged by netfilter")
10057 (description "libnetfilter_log is a userspace library providing interface to
10058packets that have been logged by the kernel packet filter. It is is part of a
10059system that deprecates the old syslog/dmesg based packet logging. This library
10060has been previously known as libnfnetlink_log.
10061
10062@enumerate
10063@item
10064receiving to-be-logged packets from the kernel nfnetlink_log subsystem
10065@end enumerate")
10066 (home-page "https://netfilter.org/projects/libnetfilter_log/index.html")
10067 (supported-systems (filter target-linux? %supported-systems))
10068 (properties '((upstream-name . "libnetfilter_log")))
10069 (license license:gpl2+)))
10070
10071(define-public ulogd
10072 (package
10073 (name "ulogd")
10074 (version "2.0.7")
10075 (source
10076 (origin
10077 (method url-fetch)
10078 (uri (string-append "https://netfilter.org/projects/" name
10079 "/files/ulogd-" version ".tar.bz2"))
10080 (sha256
10081 (base32
10082 "0ax9959c4bapq78n13bbaibcf1gwjir3ngx8l2dh45lw9m4ha2lr"))))
10083 (build-system gnu-build-system)
10084 (outputs '("out"
10085 ;; additional non-default output plugins
10086 "json" "pcap" "sqlite3" "pgsql" "mysql"))
10087 (native-inputs (list pkg-config))
10088 (inputs (list libnfnetlink
10089 libmnl
10090 libnetfilter-log
10091 libnetfilter-conntrack
10092 libnetfilter-acct
10093 sqlite
10094 libpcap
10095 jansson
10096 postgresql
10097 (list mariadb "dev")
10098 zlib
10099 openssl))
10100 (arguments
10101 (list #:configure-flags
10102 #~(list (string-append "--with-pgsql="
10103 (assoc-ref %build-inputs "postgresql"))
10104 (string-append "--with-mysql="
10105 (assoc-ref %build-inputs "mariadb")))
10106 #:phases
10107 #~(modify-phases %standard-phases
10108 (add-after 'install 'install-doc
10109 (lambda _
10110 (let ((out-etc (string-append #$output "/etc"))
10111 (ulogd.conf "ulogd.conf"))
10112 (mkdir-p out-etc)
10113 (copy-file ulogd.conf (string-append out-etc "/"
10114 ulogd.conf)))))
10115 (add-after 'install 'setup-plugin-outputs
10116 (lambda* (#:key outputs #:allow-other-keys)
10117 (with-directory-excursion
10118 (string-append #$output "/lib/ulogd/")
10119 (for-each
10120 (lambda (output-name)
10121 (let ((output-dir (string-append
10122 (assoc-ref outputs output-name)
10123 "/lib/ulogd/")))
10124 (mkdir-p output-dir)
10125 (for-each
10126 (lambda (plugin)
10127 (copy-file plugin (string-append output-dir plugin))
10128 (delete-file plugin))
10129 (find-files "."
10130 (string-append "ulogd_output_"
10131 (string-upcase output-name)
10132 ".*$")))))
10133 (list "json" "pcap" "sqlite3" "pgsql" "mysql"))))))))
10134 (synopsis "Logging daemon for netfilter and iptables")
10135 (description "ulogd is a userspace logging daemon for netfilter/iptables
10136related logging. This includes per-packet logging of security violations,
10137per-packet logging for accounting, per-flow logging and flexible user-defined
10138accounting.
10139
10140@enumerate
10141@item
10142Packet and flow-based traffic accounting
10143@item
10144Flexible user-defined traffic accounting via nfacct infrastructure
10145@item
10146SQL database back-end support: SQLite3, PostgreSQL, MySQL
10147@item
10148Text-based output formats: CSV, XML, Netfilter's LOG, Netfilter's conntrack
10149@end enumerate")
10150 (home-page "https://netfilter.org/projects/nfacct/index.html")
10151 (supported-systems (filter target-linux? %supported-systems))
10152 (license license:gpl2)))
10153
10154(define-public proot
10155 (package
10156 (name "proot")
10157 (version "5.4.0")
10158 (source
10159 (origin
10160 (method git-fetch)
10161 (uri (git-reference
10162 (url "https://github.com/proot-me/PRoot")
10163 (commit (string-append "v" version))))
10164 (file-name (git-file-name name version))
10165 (sha256
10166 (base32 "186qsg4yvisqjgf8w5jxhnlig7x341vpqwcgp8as3r59qmqkpmk7"))
10167 ;; Waiting for upstream inclusion at
10168 ;; https://github.com/proot-me/proot/pull/355
10169 (patches (search-patches "proot-add-clone3.patch"
10170 "proot-add-missing-include.patch"))))
10171 (build-system gnu-build-system)
10172 ;; Many architectures are not supported (see:
10173 ;; https://github.com/proot-me/proot/blob/master/src/arch.h#L51).
10174 (supported-systems '("x86_64-linux" "i686-linux"
10175 "armhf-linux" "aarch64-linux" "i586-gnu" "x86_64-gnu"))
10176 (arguments
10177 ;; Disable the test suite on armhf-linux, as there are too many
10178 ;; failures to keep track of (see for example:
10179 ;; https://github.com/proot-me/proot/issues/286).
10180 `(#:tests? ,(not (or (%current-target-system)
10181 (string-prefix? "armhf"
10182 (or (%current-system)))))
10183 #:make-flags '("-C" "src")
10184 #:phases (modify-phases %standard-phases
10185 (add-after 'unpack 'patch-sources
10186 (lambda* (#:key inputs #:allow-other-keys)
10187 (substitute* (find-files "src" "\\.[ch]$")
10188 (("\"/bin/sh\"")
10189 (string-append "\"" (assoc-ref inputs "bash")
10190 "/bin/sh\"")))
10191
10192 (substitute* "src/GNUmakefile"
10193 (("/bin/echo") (which "echo"))
10194 (("^VERSION = .*")
10195 (string-append "VERSION := " ,version "\n")))
10196
10197 (substitute* (find-files "test" "\\.sh$")
10198 ;; Some of the tests try to "bind-mount" /bin/true.
10199 (("-b /bin/true:")
10200 (string-append "-b " (which "true") ":"))
10201 ;; Likewise for /bin.
10202 (("-b /bin:") "-b /gnu:")
10203 ;; Others try to run /bin/sh.
10204 (("/bin/sh") (which "sh"))
10205 ;; Others assume /etc/fstab exists.
10206 (("/etc/fstab") "/etc/passwd"))
10207 (substitute* "test/GNUmakefile"
10208 (("-b /bin:") "-b /gnu:"))
10209 (substitute* "test/test-c6b77b77.mk"
10210 (("/bin/bash") (which "bash"))
10211 (("/usr/bin/test") (which "test")))
10212 (substitute* "test/test-16573e73.c"
10213 (("/bin/([a-z-]+)" _ program)
10214 (which program)))
10215 (substitute* "test/test-5467b986.sh"
10216 (("-w /usr") "-w /gnu")
10217 (("-w usr") "-w gnu")
10218 (("/usr/share") "/gnu/store")
10219 (("share") "store"))
10220 (substitute* "test/test-092c5e26.sh"
10221 (("-q echo ")
10222 "-q $(which echo) "))
10223
10224 ;; The socket tests requires networking.
10225 (for-each delete-file
10226 (find-files "test" "test-socket.*\\.sh$"))))
10227 (delete 'configure)
10228 (add-after 'build 'build-manpage
10229 (lambda _
10230 (with-directory-excursion "doc"
10231 (invoke "make" "proot/man.1" "SUFFIX=.py"))))
10232 (replace 'check
10233 (lambda* (#:key tests? #:allow-other-keys)
10234 (when tests?
10235 (let ((n (parallel-job-count)))
10236 ;; Most of the tests expect "/bin" to be in $PATH so
10237 ;; they can run things that live in $ROOTFS/bin.
10238 (setenv "PATH"
10239 (string-append (getenv "PATH") ":/bin"))
10240 (invoke "make" "check" "-C" "test"
10241 ;;"V=1"
10242 "-j" (number->string n))))))
10243 (replace 'install
10244 (lambda* (#:key outputs #:allow-other-keys)
10245 ;; The 'install' rule does nearly nothing.
10246 (let* ((out (assoc-ref outputs "out"))
10247 (man1 (string-append out "/share/man/man1")))
10248 ;; TODO: 'make install-care' (does not even
10249 ;; build currently.)
10250 (invoke "make" "-C" "src" "install"
10251 (string-append "PREFIX=" out))
10252 (mkdir-p man1)
10253 (copy-file "doc/proot/man.1"
10254 (string-append man1 "/proot.1"))))))))
10255 (native-inputs (list which
10256 ;; For 'mcookie', used by some of the tests.
10257 util-linux
10258 coreutils
10259 pkg-config
10260 ;; For rst2man, used to generate the manual page.
10261 python-docutils-0.19))
10262 (inputs (list libarchive talloc))
10263 (home-page "https://github.com/proot-me/PRoot")
10264 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
10265 (description
10266 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
10267and @code{binfmt_misc}. This means that users don't need any privileges or
10268setup to do things like using an arbitrary directory as the new root
10269file system, making files accessible somewhere else in the file system
10270hierarchy, or executing programs built for another CPU architecture
10271transparently through QEMU user-mode. Also, developers can use PRoot as a
10272generic process instrumentation engine thanks to its extension mechanism.
10273Technically PRoot relies on @code{ptrace}, an unprivileged system-call
10274available in the kernel Linux.")
10275 (license license:gpl2+)))
10276
10277(define-public proot-static
10278 (package
10279 (inherit proot)
10280 (name "proot-static")
10281 (synopsis
10282 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
10283 (inputs `(("talloc" ,talloc/static)))
10284 (arguments
10285 (substitute-keyword-arguments (package-arguments proot)
10286 ((#:make-flags flags)
10287 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
10288 ((#:phases phases)
10289 `(modify-phases ,phases
10290 (add-after 'strip 'remove-store-references
10291 (lambda* (#:key outputs #:allow-other-keys)
10292 (let* ((out (assoc-ref outputs "out")))
10293 (with-directory-excursion out
10294 (remove-store-references "bin/proot")
10295 #t))))))
10296 ((#:allowed-references _ '("out"))
10297 '("out"))))))
10298
10299(define-public cpuid
10300 (package
10301 (name "cpuid")
10302 (version "20230614")
10303 (source (origin
10304 (method url-fetch)
10305 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
10306 version ".src.tar.gz"))
10307 (sha256
10308 (base32
10309 "1s54qc1j10d765r05kw9pzwzaxq2b0nndq2ifwq7cq62xx2k1j5i"))))
10310 (build-system gnu-build-system)
10311 (arguments
10312 (list #:make-flags
10313 #~(list (string-append "CC=" #$(cc-for-target)))
10314 #:tests? #f ; no tests
10315 #:phases
10316 #~(modify-phases %standard-phases
10317 (delete 'configure) ; no configure script
10318 (add-before 'install 'fix-makefile
10319 (lambda* (#:key outputs #:allow-other-keys)
10320 (substitute* "Makefile"
10321 (("\\$\\(BUILDROOT\\)/usr")
10322 (assoc-ref outputs "out"))))))))
10323 (inputs (list perl))
10324 (supported-systems '("i686-linux" "x86_64-linux"))
10325 (home-page "https://www.etallen.com/cpuid.html")
10326 (synopsis "Dump x86 CPUID processor information")
10327 (description "cpuid dumps detailed information about the CPU(s) gathered
10328from the CPUID instruction, and also determines the exact model of CPU(s). It
10329supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
10330NexGen, Rise, and SiS CPUs.")
10331 (license license:gpl2+)))
10332
10333(define-public jmtpfs
10334 (package
10335 (name "jmtpfs")
10336 (version "0.5")
10337 (source
10338 (origin
10339 (method git-fetch)
10340 (uri (git-reference
10341 (url "https://github.com/JasonFerrara/jmtpfs")
10342 (commit (string-append "v" version))))
10343 (file-name (git-file-name name version))
10344 (sha256
10345 (base32
10346 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
10347 (build-system gnu-build-system)
10348 (inputs
10349 (list file fuse-2 libmtp))
10350 (native-inputs
10351 (list pkg-config))
10352 (home-page "https://github.com/JasonFerrara/jmtpfs")
10353 (synopsis "Use a FUSE file system to access data over MTP")
10354 (description "jmtpfs uses @acronym{FUSE, File system in USEr space} to
10355provide access to data over @acronym{MTP, the Media Transfer Protocol}.
10356Unprivileged users can mount the MTP device as a file system.")
10357 (license license:gpl3)))
10358
10359(define-public procenv
10360 (package
10361 (name "procenv")
10362 (version "0.60")
10363 (source
10364 (origin
10365 (method git-fetch)
10366 (uri (git-reference
10367 (url "https://github.com/jamesodhunt/procenv")
10368 (commit version)))
10369 (file-name (git-file-name name version))
10370 (sha256
10371 (base32 "00d7q0h4qjc8lg435lq77lp2fx6ikm5piq90m81mr1dqqna1g6pz"))))
10372 (build-system gnu-build-system)
10373 (native-inputs
10374 (list pkg-config
10375 ;; For tests.
10376 check groff))
10377 (inputs
10378 (list expat libcap libselinux))
10379 (synopsis "Utility to show process environment")
10380 (description
10381 "Procenv is a command-line tool that displays as much detail about
10382itself and its environment as possible. It can be used as a test
10383tool, to understand the type of environment a process runs in, and for
10384comparing system environments.")
10385 (home-page "https://github.com/jamesodhunt/procenv/")
10386 (license license:gpl3+)))
10387
10388(define-public cassini-headers
10389 (package
10390 (name "cassini-headers")
10391 (version "12.0.1")
10392 (home-page "https://github.com/HewlettPackard/shs-cassini-headers")
10393 (source (origin
10394 (method git-fetch)
10395 (uri (git-reference
10396 (url home-page)
10397 (commit (string-append "release/shs-" version))))
10398 (file-name (git-file-name name version))
10399 (sha256
10400 (base32
10401 "0fvhk42pssw67zba4zq1b73d1m9ysc4g8sfibjmmhc0fwr92iamp"))))
10402 (build-system copy-build-system)
10403 (arguments
10404 (list #:install-plan
10405 #~'(("include" "include")
10406 ("share/cassini-headers" "share/cassini-headers"))))
10407 (synopsis "Cassini network hardware definitions and headers")
10408 (description
10409 "This package provides hardware definitions and C headers for use by
10410the Linux driver and by user-space applications for the Cassini/Slingshot
10411high-speed network interconnect made by HPE (formerly Cray). User-land
10412software uses @file{cxi_prov_hw.h} from this package.")
10413 ;; As per include/cxi_prov_hw.h it is __aarch64__ or __x86_64__ only.
10414 (supported-systems '("x86_64-linux" "aarch64-linux"))
10415 (license (list license:gpl2 license:bsd-2)))) ;dual-licensed
10416
10417(define-public cxi-driver
10418 (package
10419 (name "cxi-driver")
10420 (version "13.0.0")
10421 (home-page "https://github.com/HewlettPackard/shs-cxi-driver")
10422 (source
10423 (origin
10424 (method git-fetch)
10425 (uri (git-reference
10426 (url home-page)
10427 (commit (string-append "release/shs-" version))))
10428 (file-name (git-file-name name version))
10429 (sha256
10430 (base32
10431 "1md6ammah7ywk5k9gsxix945w5498hpdfwzr603aiirlz2x4m4wh"))))
10432 ;; TODO: Actually build the Linux driver.
10433 (build-system copy-build-system)
10434 (arguments
10435 (list #:install-plan #~'(("include" "include"))))
10436 (propagated-inputs (list cassini-headers))
10437 (synopsis "Linux driver for the Cassini/Slingshot interconnect")
10438 (description
10439 "This is the Linux driver for the Cray/HPE Cassini 1 and 2 high-speed
10440network interconnect (aka. Slingshot), and its Ethernet driver. It includes
10441the @file{uapi/misc/cxi.h} C header file for use by user-land software.
10442
10443Currently the Linux driver itself is missing from this package.")
10444 (license license:gpl2+)))
10445
10446(define-public cxi-driver-for-libfabric-1
10447 ;; This old version defines constants such as 'CXI_MAP_IOVA_ALLOC' that
10448 ;; libfabric 1.22.0 relies on.
10449 (let ((commit "5f0ec0ead6ef3f98542a2ef5e76b89d14dd22150")
10450 (revision "0"))
10451 (package
10452 (inherit cxi-driver)
10453 (name "cxi-driver")
10454 (version (git-version "1.0.0" ;per .spec file
10455 revision commit))
10456 (home-page "https://github.com/HewlettPackard/shs-cxi-driver")
10457 (source
10458 (origin
10459 (method git-fetch)
10460 (uri (git-reference (url home-page) (commit commit)))
10461 (file-name (git-file-name name version))
10462 (sha256
10463 (base32
10464 "19cly014ihgdidrc1aki2xsbfhpc0g73v0vxcky8r27xza7rz5bg")))))))
10465
10466(define-public libcxi
10467 (package
10468 (name "libcxi")
10469 (version "13.0.0")
10470 (home-page "https://github.com/HewlettPackard/shs-libcxi")
10471 (source
10472 (origin
10473 (method git-fetch)
10474 (uri (git-reference (url home-page)
10475 (commit (string-append "release/shs-" version))))
10476 (file-name (git-file-name name version))
10477 (sha256
10478 (base32 "1m8mds1h8plhfn2ja9br31xaiy82ky69685cp1rznanl18inaiff"))))
10479 (build-system gnu-build-system)
10480 (arguments
10481 (list #:configure-flags
10482 #~(list "--disable-static"
10483 (string-append "--with-udevrulesdir="
10484 #$output "/lib/udev/rules.d"))
10485
10486 #:phases
10487 #~(modify-phases %standard-phases
10488 (add-before 'configure 'set-cassini-file-names
10489 (lambda* (#:key inputs #:allow-other-keys)
10490 (substitute* "utils/cxi_dump_csrs.py"
10491 (("/usr/share/cassini-headers/csr_defs.json")
10492 (search-input-file
10493 inputs
10494 "/share/cassini-headers/csr_defs.json"))))))))
10495 (native-inputs (list autoconf
10496 automake
10497 libtool
10498 pkg-config
10499 python-wrapper))
10500 (inputs (list libconfig
10501 libuv
10502 fuse-2
10503 libyaml
10504 libnl
10505 numactl
10506 eudev
10507 (list lm-sensors "lib")))
10508 (propagated-inputs (list cassini-headers cxi-driver))
10509 (synopsis "Interface to the Cassini/Slingshot high-speed interconnect")
10510 (description
10511 "Libcxi provides applications with a low-level interface to the
10512Cray/HPE Cassini high-speed @acronym{NIC, network interface controller}, also
10513known as Slingshot.")
10514
10515 ;; License is spelled out in 'cray-libcxi.spec' and in source file
10516 ;; headers.
10517 (license (list license:lgpl2.1+ license:bsd-3)))) ;dual-licensed
10518
10519(define-public libfabric
10520 (package
10521 (name "libfabric")
10522 (version "2.3.1")
10523 (source
10524 (origin
10525 (method url-fetch)
10526 (uri
10527 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
10528 version "/libfabric-" version ".tar.bz2"))
10529 (sha256
10530 (base32 "0npkfkkhyir31r2p1zsfi7yrvcam60fp8ps4s2csjc2drqbrz4rf"))))
10531 (build-system gnu-build-system)
10532 (inputs
10533 (let ((if-supported ;XXX: modified from openmpi
10534 (lambda (package . extra)
10535 (if (and (not (%current-target-system))
10536 (member (%current-system)
10537 (package-transitive-supported-systems package)))
10538 (cons package extra)
10539 '()))))
10540 (append (list rdma-core libnl)
10541 (if-supported psm)
10542 (if-supported psm2)
10543 (if-supported libcxi curl json-c))))
10544 (arguments
10545 (list #:configure-flags
10546 #~(append (if #$(target-64bit?)
10547 (list "--enable-efa")
10548 '())
10549 (list #$@(if (this-package-input "libcxi")
10550 #~("--enable-cxi")
10551 #~())
10552 "--enable-verbs"))
10553 #:phases
10554 #~(modify-phases %standard-phases
10555 (add-after 'install 'remove-libtool-archive
10556 (lambda _
10557 ;; 'libfabric.la' has '-ljson-c' without a corresponding
10558 ;; '-L' in 'dependency_libs', which in turn causes users
10559 ;; such as Open MPI to fail at link time due to '-ljson-c'
10560 ;; not being found, even when building a shared library.
10561 ;; So, remove the .la file.
10562 (delete-file
10563 (string-append #$output
10564 "/lib/libfabric.la")))))))
10565 (home-page "https://ofiwg.github.io/libfabric/")
10566 (synopsis "Open Fabric Interfaces")
10567 (description
10568 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
10569communication services to applications. OFI is best described as a collection
10570of libraries and applications used to export fabric services. The key
10571components of OFI are: application interfaces, provider libraries, kernel
10572services, daemons, and test applications.
10573
10574Libfabric is a core component of OFI. It is the library that defines and
10575exports the user-space API of OFI, and is typically the only software that
10576applications deal with directly. It works in conjunction with provider
10577libraries, which are often integrated directly into libfabric.")
10578 (license (list license:bsd-2 license:gpl2)))) ;dual
10579
10580(define-public libfabric-1 ;needed by Open MPI 4.x
10581 (package
10582 (inherit libfabric)
10583 (version "1.22.0")
10584 (source
10585 (origin
10586 (method url-fetch)
10587 (uri
10588 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
10589 version "/libfabric-" version ".tar.bz2"))
10590 (sha256
10591 (base32 "1znmw83rmippv0fwz0x7lgylfk17dr9ckll8lrm4z7kclspnqpj8"))))
10592 (inputs
10593 (modify-inputs (package-inputs libfabric)
10594 (append cxi-driver-for-libfabric-1)))))
10595
10596(define-public psm
10597 (package
10598 (name "psm")
10599 (version "3.3.20170428")
10600 (home-page "https://github.com/intel/psm")
10601 (source
10602 (origin
10603 (method git-fetch)
10604 (uri (git-reference (url home-page)
10605 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
10606 (file-name (string-append "psm-" version ".tar.gz"))
10607 (sha256
10608 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
10609 (patches (search-patches
10610 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
10611 "psm-ldflags.patch" ; build shared lib with LDFLAGS
10612 "psm-repro.patch" ; reproducibility
10613 "psm-disable-memory-stats.patch"))
10614 (modules '((guix build utils)))
10615 (snippet
10616 ;; That file declares its own 'strlcat' as static. To avoid a
10617 ;; conflict with the function now in glibc 2.39, give it a
10618 ;; different name.
10619 #~(substitute* "ptl_ips/ips_proto_dump.c"
10620 (("strlcat")
10621 "psm_custom_strlcat")))))
10622 (build-system gnu-build-system)
10623 (outputs '("out" "debug"))
10624 (inputs `(("libuuid" ,util-linux "lib")))
10625 (arguments
10626 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
10627 ,(string-append "INSTALL_PREFIX=" %output)
10628 ,(string-append "CFLAGS=-Wall -fpic -fPIC -D_GNU_SOURCE"
10629 " -funwind-tables -O3 -g3"
10630 " -DPSM_USE_SYS_UUID"
10631 " -Wno-strict-aliasing -DNVALGRIND"
10632 " -fcommon")
10633 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
10634 #:tests? #f
10635 #:phases (modify-phases %standard-phases
10636 (delete 'configure)
10637 (add-after 'unpack 'patch-/usr/include
10638 (lambda _
10639 (substitute* "Makefile"
10640 (("\\$\\{DESTDIR}/usr/include")
10641 (string-append %output "/include")))
10642 (substitute* "Makefile"
10643 (("/lib64") "/lib"))
10644 #t))
10645 (add-after 'unpack 'patch-sysmacros
10646 (lambda _
10647 (substitute* "ipath/ipath_proto.c"
10648 (("#include <sys/poll.h>" m)
10649 (string-append m "\n"
10650 "#include <sys/sysmacros.h>")))
10651 #t)))))
10652 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
10653 (description
10654 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
10655communications interface for the True Scale family of products. PSM users are
10656enabled with mechanisms necessary to implement higher level communications
10657interfaces in parallel environments.")
10658 ;; Only Intel-compatible processors are supported.
10659 (supported-systems '("i686-linux" "x86_64-linux"))
10660 (license (list license:bsd-2 license:gpl2)))) ;dual
10661
10662(define-public snapscreenshot
10663 (package
10664 (name "snapscreenshot")
10665 (version "1.0.14.3")
10666 (source
10667 (origin
10668 (method url-fetch)
10669 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
10670 name "-" version ".tar.bz2"))
10671 (sha256
10672 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
10673 (build-system gnu-build-system)
10674 (arguments
10675 `(#:make-flags
10676 (let ((out (assoc-ref %outputs "out")))
10677 (list (string-append "BINDIR=" out "/bin")
10678 (string-append "MANDIR=" out "/share/man")))
10679 #:tests? #f ; no test suite
10680 #:phases
10681 (modify-phases %standard-phases
10682 (delete 'configure) ; ./configure is a snarky no-op
10683 (add-before 'install 'fix-ownership
10684 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
10685 (lambda _
10686 (substitute* "depfun.mak"
10687 ((" -o bin -g bin ") " "))
10688 #t))
10689 (add-before 'install 'create-output-directories
10690 (lambda* (#:key outputs #:allow-other-keys)
10691 (let ((out (assoc-ref outputs "out")))
10692 (mkdir-p (string-append out "/share/man/man1"))
10693 #t))))))
10694 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
10695 (synopsis "Take screenshots of one or more Linux text consoles")
10696 (description
10697 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
10698Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
10699relevant @file{/dev/vcs*} file(s).")
10700 (license license:gpl2)))
10701
10702(define-public fbcat
10703 (package
10704 (name "fbcat")
10705 (version "0.5.2")
10706 (source
10707 (origin
10708 (method url-fetch)
10709 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
10710 version "/" name "-" version ".tar.gz"))
10711 (sha256
10712 (base32 "07q6f0xj7b4gjvn69qfn0g04yd0ch8ndzyigcz8nnrhli0cvsbh6"))))
10713 (build-system gnu-build-system)
10714 (inputs
10715 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
10716 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
10717 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
10718 `(("pnmtopng" ,netpbm)))
10719 (outputs (list "out" "fbgrab"))
10720 (arguments
10721 `(#:make-flags
10722 (list "CC=gcc"
10723 (string-append "PREFIX=" (assoc-ref %outputs "out")))
10724 #:tests? #f ; no tests
10725 #:phases
10726 (modify-phases %standard-phases
10727 (delete 'configure) ; no configure script
10728 (add-after 'build 'qualify-references
10729 (lambda* (#:key inputs outputs #:allow-other-keys)
10730 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
10731 (out (assoc-ref outputs "out")))
10732 (substitute* "fbgrab"
10733 (("fbcat" all)
10734 (string-append out "/bin/" all))
10735 (("pnmtopng" all)
10736 (string-append pnmtopng "/bin/" all))))))
10737 (add-after 'install 'split-fbgrab-output
10738 (lambda* (#:key outputs #:allow-other-keys)
10739 (let* ((out (assoc-ref outputs "out"))
10740 (out:fbgrab (assoc-ref outputs "fbgrab")))
10741 (for-each (lambda (file)
10742 (let ((old (string-append out "/" file))
10743 (new (string-append out:fbgrab "/" file)))
10744 (mkdir-p (dirname new))
10745 (rename-file old new)))
10746 (list "bin/fbgrab"
10747 "share/man/man1/fbgrab.1"))))))))
10748 (home-page "https://jwilk.net/software/fbcat")
10749 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
10750 (description
10751 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
10752a dump thereof. It supports a wide range of drivers and pixel formats.
10753
10754@command{fbcat} can take screenshots of virtually any application that can be
10755made to write its output to the framebuffer, including (but not limited to)
10756text-mode or graphical applications that don't use a display server.
10757
10758Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
10759emulates the behaviour of Gunnar Monell's older fbgrab utility.")
10760 (license license:gpl2)))
10761
10762(define-public fbgrab
10763 (package
10764 (name "fbgrab")
10765 (version "1.5")
10766 (source (origin
10767 (method git-fetch)
10768 (uri (git-reference
10769 (url "https://github.com/GunnarMonell/fbgrab")
10770 (commit version)))
10771 (file-name (git-file-name name version))
10772 (sha256
10773 (base32
10774 "1npn7l8jg0nhjraybjl38v8635zawzmn06ql3hs3vhci1vi1r90r"))))
10775 (build-system gnu-build-system)
10776 (arguments
10777 (list #:tests? #f ;no test suite
10778 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
10779 (string-append "DESTDIR=" #$output))
10780 #:phases #~(modify-phases %standard-phases
10781 (add-after 'unpack 'strip-/usr-prefix
10782 (lambda _
10783 (substitute* "Makefile"
10784 (("/usr") ""))))
10785 (delete 'configure))))
10786 (inputs (list libpng zlib))
10787 (home-page "https://github.com/GunnarMonell/fbgrab")
10788 (synopsis "Linux framebuffer screenshot/conversion utility")
10789 (description "FBGrab is a framebuffer screenshot program that captures the
10790Linux framebuffer and converts it to a PNG image. It can also convert a
10791framebuffer dump file (copy) to a PNG image.")
10792 (license license:gpl2))) ;GPL 2.0 only (per SPDX identifier in fbgrab.c)
10793
10794(define-public libcgroup
10795 (package
10796 (name "libcgroup")
10797 (version "3.2.0")
10798 (home-page "https://github.com/libcgroup/libcgroup")
10799 (source
10800 (origin
10801 (method url-fetch)
10802 (uri (string-append
10803 "https://github.com/libcgroup/libcgroup/releases/download/v"
10804 version "/" name "-" version ".tar.gz"))
10805 (sha256
10806 (base32 "1zmxhqp8kj2n7yvj82nsy5sx07yrxj4r37w41lz5q8bpqgbc43ws"))))
10807 (build-system gnu-build-system)
10808 (arguments
10809 ;; Tests are virtualized with lxc, it is not very feasible
10810 ;; to make them executable under guix build. Also, note that
10811 ;; origin is using source tarball release which is prepared
10812 ;; after testing.
10813 (list #:tests? #f
10814 #:configure-flags
10815 #~'("--disable-systemd")))
10816 (native-inputs
10817 (list bison flex))
10818 (inputs
10819 (list linux-pam))
10820 (synopsis "Control groups management tools")
10821 (description "Control groups is Linux kernel method for process resource
10822restriction, permission handling and more. This package provides userspace
10823interface to this kernel feature.")
10824 (license license:lgpl2.1)))
10825
10826(define-public mbpfan
10827 (package
10828 (name "mbpfan")
10829 (version "2.4.0")
10830 (source
10831 (origin
10832 (method git-fetch)
10833 (uri (git-reference
10834 (url "https://github.com/dgraziotin/mbpfan")
10835 (commit (string-append "v" version))))
10836 (file-name (git-file-name name version))
10837 (sha256
10838 (base32 "146sshsjafi26n741jvi9mdbazwf74jlacxfwkky4fhbq98idlhp"))))
10839 (build-system gnu-build-system)
10840 (arguments
10841 (list #:tests? #f ; tests ask to be run as root
10842 #:make-flags
10843 #~(list (string-append "DESTDIR=" #$output)
10844 (string-append "CC=" #$(cc-for-target)))
10845 #:phases
10846 #~(modify-phases %standard-phases
10847 (add-after 'unpack 'patch-paths
10848 (lambda _
10849 (substitute* "Makefile"
10850 (("/usr") ""))))
10851 (delete 'configure)))) ; there's no configure phase
10852 (home-page "https://github.com/dgraziotin/mbpfan")
10853 (synopsis "Control fan speed on Macbooks")
10854 (description
10855 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
10856the @code{coretemp} module and sets the fan speed using the @code{applesmc}
10857module. It can be executed as a daemon or in the foreground with root
10858privileges.")
10859 (license license:gpl3+)))
10860
10861(define-public psm2
10862 (package
10863 (name "psm2")
10864 (version "12.0")
10865 (source (origin
10866 (method git-fetch)
10867 (uri (git-reference
10868 (url "https://github.com/intel/opa-psm2")
10869 ;; tag 'psm-v12.0' = commit ad5dd1b
10870 (commit (string-append "psm-v" version))))
10871 (file-name (git-file-name name version))
10872 (sha256
10873 (base32
10874 "04nar65ac11qqx41vkfs7iip8kfiah0zms7l4rmsxncpiz2iqfik"))
10875 (patches
10876 (search-patches
10877 "psm2-compile-ctor-without-avx.patch"))
10878 (modules '((guix build utils)))
10879 (snippet
10880 ;; That file declares its own 'strlcat' as static. To avoid a
10881 ;; conflict with the function now in glibc 2.39, give it a
10882 ;; different name.
10883 #~(substitute* "ptl_ips/ips_proto_dump.c"
10884 (("strlcat")
10885 "psm2_custom_strlcat")))))
10886 (build-system gnu-build-system)
10887 (arguments
10888 (list #:make-flags
10889 #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
10890 #:tests? #f
10891 #:phases #~(modify-phases %standard-phases
10892 (delete 'configure)
10893 (add-after 'unpack 'patch-Makefiles
10894 (lambda _
10895 (substitute* "Makefile"
10896 (("/lib64") "/lib")
10897 (("/usr") ""))
10898 (substitute* "compat/Makefile"
10899 (("/lib64") "/lib")
10900 (("/usr") ""))))
10901 (replace 'install
10902 (lambda _
10903 (setenv "DESTDIR" #$output)
10904 (invoke "make" "install"))))))
10905 (inputs
10906 (list rdma-core numactl))
10907 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
10908 (description
10909 "This package is low-level user-level Intel's communications interface.
10910The PSM2 API is a high-performance vendor-specific protocol that provides a
10911low-level communications interface for the Intel Omni-Path family of
10912high-speed networking devices.")
10913 (home-page "https://github.com/intel/opa-psm2")
10914 ;; Only the x86_64 architecture is supported.
10915 (supported-systems '("x86_64-linux"))
10916 (license (list license:bsd-3 license:gpl2)))) ; dual
10917
10918(define-public libpfm4
10919 (package
10920 (name "libpfm4")
10921 (version "4.9.0")
10922 (source (origin
10923 (method url-fetch)
10924 (uri (string-append "mirror://sourceforge/perfmon2/"
10925 name "/libpfm-" version ".tar.gz"))
10926 (sha256
10927 (base32
10928 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
10929 (build-system gnu-build-system)
10930 (arguments
10931 '(#:modules ((guix build utils)
10932 (guix build gnu-build-system))
10933 #:phases (modify-phases %standard-phases
10934 (delete 'configure)
10935 (delete 'check)
10936 (replace 'build
10937 (lambda* (#:key inputs outputs #:allow-other-keys)
10938 (let* ((out (assoc-ref outputs "out")))
10939 (setenv "CC" "gcc")
10940 (setenv "CFLAGS" "-Wno-format-truncation")
10941 (invoke "make")
10942 #t)))
10943 (replace 'install
10944 (lambda* (#:key outputs #:allow-other-keys)
10945 (let* ((out (assoc-ref outputs "out")))
10946 (invoke "make"
10947 (string-append "PREFIX=" out)
10948 "install")
10949 #t))))))
10950 (synopsis "Performance event monitoring library")
10951 (description
10952 "This package provides a library called libpfm4, which is used to develop
10953monitoring tools exploiting the performance monitoring events such as those
10954provided by the Performance Monitoring Unit (PMU) of modern processors.
10955
10956Libpfm4 helps convert from an event name, expressed as a string, to the event
10957encoding that is either the raw event as documented by the hardware vendor or
10958the OS-specific encoding. In the latter case, the library is able to prepare
10959the OS-specific data structures needed by the kernel to setup the event.
10960
10961libpfm4 provides support for the @code{perf_events} interface, which was
10962introduced in Linux 2.6.31.")
10963 (home-page "https://perfmon2.sourceforge.net/")
10964 (license license:expat)))
10965
10966(define-public libnfnetlink
10967 (package
10968 (name "libnfnetlink")
10969 (version "1.0.2")
10970 (source (origin
10971 (method url-fetch)
10972 (uri (string-append
10973 "https://www.netfilter.org/projects/libnfnetlink/files/"
10974 "libnfnetlink-" version ".tar.bz2"))
10975 (sha256
10976 (base32
10977 "0xn3rcrzxr6g82kfxzs9bqn2zvl2kf2yda30drwb9vr6sk1wfr5h"))))
10978 (build-system gnu-build-system)
10979 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
10980 (synopsis "Low-level netfilter netlink communication library")
10981 (description
10982 "@code{libnfnetlink} is the low-level library for netfilter related
10983kernel/userspace communication. It provides a generic messaging
10984infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
10985nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
10986management tools in userspace.")
10987 (license license:gpl2)))
10988
10989(define-public libinih
10990 (package
10991 (name "libinih")
10992 (version "57")
10993 (source (origin
10994 (method git-fetch)
10995 (uri (git-reference
10996 (url "https://github.com/benhoyt/inih")
10997 (commit (string-append "r" version))))
10998 (file-name (git-file-name name version))
10999 (sha256
11000 (base32
11001 "03hpyahdkipm5wfalj2xkz6y9ncd9zrlhnf7vap6lr56jj2fz2bb"))))
11002 (build-system meson-build-system)
11003 ;; Install static libraries for use by the initrd's xfsprogs/static.
11004 (outputs (list "out" "static"))
11005 (arguments
11006 `(#:configure-flags
11007 (list "-Ddistro_install=true"
11008 "-Ddefault_library=both")
11009 #:phases
11010 (modify-phases %standard-phases
11011 (add-after 'install 'separate-static
11012 (lambda* (#:key outputs #:allow-other-keys)
11013 (let ((out (assoc-ref outputs "out"))
11014 (static (assoc-ref outputs "static")))
11015 (with-directory-excursion out
11016 (for-each (lambda (source)
11017 (let ((target (string-append static "/" source)))
11018 (mkdir-p (dirname target))
11019 (rename-file source target)))
11020 (find-files "lib" "\\.a$")))))))))
11021 (home-page "https://github.com/benhoyt/inih")
11022 (synopsis "Simple .INI parser library for C")
11023 (description "The inih (INI Not Invented Here) library is a simple .INI file
11024parser written in C. It's only a couple of pages of code, and it was designed to
11025be small and simple, so it's good for embedded systems. It's also more or less
11026compatible with Python's ConfigParser style of .INI files, including RFC
11027822-style multi-line syntax and name: value entries.")
11028 (license license:bsd-3)))
11029
11030(define-public simpleini
11031 (let ((commit "6048871ea9ee0ec24be5bd099d161a10567d7dc2")
11032 (revision "1"))
11033 (package
11034 (name "simpleini")
11035 (version (git-version "4.22" revision commit))
11036 (source (origin
11037 (method git-fetch)
11038 (uri (git-reference
11039 (url "https://github.com/brofield/simpleini")
11040 (commit commit)))
11041 (file-name (git-file-name name version))
11042 (sha256
11043 (base32
11044 "1szaflnrzw1zx9v5g6mbbiaf9wfglp4n4jjq2793k9ryz3qxil9j"))))
11045 (build-system cmake-build-system)
11046 (arguments
11047 (list #:configure-flags #~(list "-DSIMPLEINI_USE_SYSTEM_GTEST=ON")))
11048 (native-inputs (list googletest))
11049 (home-page "https://github.com/brofield/simpleini")
11050 (synopsis "Simple API to read and write INI-style files")
11051 (description
11052 "SimpleIni provides a simple API to read and write INI-style
11053configuration files. It supports data files in ASCII, MBCS and Unicode.")
11054 (license license:expat))))
11055
11056(define-public xfsprogs
11057 (package
11058 (name "xfsprogs")
11059 (version "6.12.0")
11060 (source (origin
11061 (method url-fetch)
11062 (uri (string-append
11063 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
11064 "xfsprogs-" version ".tar.gz"))
11065 (sha256
11066 (base32
11067 "1n46n27fxx1137kni3drrhzhp1l8ksxabcsmi8yzxbhpbnl4q293"))))
11068 (build-system gnu-build-system)
11069 (outputs (list "out" "python"))
11070 (arguments
11071 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
11072 #:configure-flags
11073 (list "--disable-static")
11074 #:make-flags
11075 (list "V=1")
11076 #:phases
11077 (modify-phases %standard-phases
11078 (add-after 'install 'separate-python-output
11079 (lambda* (#:key outputs #:allow-other-keys)
11080 (let ((out (assoc-ref outputs "out"))
11081 (python (assoc-ref outputs "python")))
11082 (for-each
11083 (lambda (script)
11084 (mkdir-p (string-append python (dirname script)))
11085 (rename-file (string-append out script)
11086 (string-append python script)))
11087 (list "/sbin/xfs_scrub_all")))))
11088 (add-after 'install 'install-headers
11089 (lambda* (#:key make-flags #:allow-other-keys)
11090 (apply invoke "make" "install-dev" make-flags))))))
11091 (native-inputs
11092 ;; riscv64 needs >= gcc-13.3.0 for liburcu.
11093 (append
11094 (if (target-riscv64?)
11095 (list gcc-14)
11096 '())
11097 (list gettext-minimal)))
11098 (inputs
11099 `(("libinih" ,libinih)
11100 ("liburcu" ,liburcu)
11101 ("libuuid" ,util-linux "lib")
11102 ("python" ,python-wrapper)))
11103 (home-page "https://xfs.wiki.kernel.org/")
11104 (synopsis "XFS file system tools")
11105 (description "This package provides commands to create and check XFS
11106file systems.")
11107 ;; The library "libhandle" and the headers in "xfslibs-dev" are
11108 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
11109 (license (list license:gpl2 license:lgpl2.1))))
11110
11111(define-public xfsprogs-5.9
11112 (package
11113 (inherit xfsprogs)
11114 (name "xfsprogs")
11115 (version "5.9.0")
11116 (source (origin
11117 (method url-fetch)
11118 (uri (string-append
11119 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
11120 "xfsprogs-" version ".tar.gz"))
11121 (sha256
11122 (base32
11123 "13xkn9jpmwp4fm9r68vhgznkmxhnv83n2b39mhy2qdaph90w2a1l"))))
11124 (arguments
11125 (substitute-keyword-arguments (package-arguments xfsprogs)
11126 ((#:configure-flags configure-flags '())
11127 `(cons "--enable-gettext=no"
11128 ,configure-flags))))
11129 (native-inputs
11130 (modify-inputs (package-native-inputs xfsprogs)
11131 (delete "gettext-minimal")))))
11132
11133(define-public xfsprogs/static
11134 (package
11135 (inherit xfsprogs)
11136 (name "xfsprogs-static")
11137 (outputs (list "out"))
11138 (arguments
11139 (substitute-keyword-arguments (package-arguments xfsprogs)
11140 ((#:configure-flags configure-flags '())
11141 `(append ,configure-flags
11142 (list "--enable-static")))
11143 ((#:make-flags make-flags ''())
11144 `(cons* "LLDFLAGS=-all-static" ,make-flags))
11145 ((#:phases _ ''())
11146 `(modify-phases %standard-phases
11147 (add-after 'install 'delete-useless-files
11148 (lambda* (#:key outputs #:allow-other-keys)
11149 (with-directory-excursion (assoc-ref outputs "out")
11150 (for-each delete-file-recursively
11151 (list "include" "lib")))))))))
11152 (inputs
11153 `(("libinih:static" ,libinih "static")
11154 ("util-linux:static" ,util-linux "static")
11155 ,@(remove (match-lambda
11156 ((label . _)
11157 (member label '("python"))))
11158 (package-inputs xfsprogs))))
11159 (synopsis "Statically linked XFS file system tools")))
11160
11161(define-public xfs_repair/static
11162 (package
11163 (name "xfs_repair-static")
11164 (version (package-version xfsprogs/static))
11165 (source #f)
11166 (build-system trivial-build-system)
11167 (arguments
11168 `(#:modules ((guix build utils))
11169 #:builder
11170 (begin
11171 (use-modules (guix build utils))
11172 (let* ((xfsprogs (assoc-ref %build-inputs "xfsprogs"))
11173 (out (assoc-ref %outputs "out"))
11174 (sbin (string-append out "/sbin")))
11175 (install-file (string-append xfsprogs "/sbin/xfs_repair") sbin)
11176 (with-directory-excursion sbin
11177 (remove-store-references "xfs_repair"))))))
11178 (inputs
11179 `(("xfsprogs" ,xfsprogs/static)))
11180 (home-page (package-home-page xfsprogs/static))
11181 (synopsis "Statically linked @command{xfs_repair} from xfsprogs")
11182 (description
11183 "This package provides a statically linked @command{xfs_repair} taken
11184from the xfsprogs package. It is meant to be used in initrds.")
11185 (license (package-license xfsprogs/static))))
11186
11187(define-public genext2fs
11188 (package
11189 (name "genext2fs")
11190 (version "1.5.0")
11191 (source (origin
11192 (method git-fetch)
11193 (uri (git-reference
11194 (url "https://github.com/bestouff/genext2fs")
11195 (commit "474111097321f03de9e009aa9f7d4a8948e310b2")))
11196 (file-name (git-file-name name version))
11197 (sha256
11198 (base32 "14lgvml5zz99845ja47jpf4iirjzfqv36ffzachh3hw2ggji9c7l"))))
11199 (build-system gnu-build-system)
11200 (native-inputs
11201 (list autoconf automake))
11202 (home-page "https://github.com/bestouff/genext2fs")
11203 (synopsis "Generate ext2 file system as a normal user")
11204 (description "This package provides a program to generate an ext2
11205file system as a normal (non-root) user. It does not require you to mount
11206the image file to copy files on it, nor does it require that you become
11207the superuser to make device nodes.")
11208 (license license:gpl2)))
11209
11210(define-public fakeroot
11211 (package
11212 (name "fakeroot")
11213 (version "1.37.1.2")
11214 (source
11215 (origin
11216 ;; There are no tags in the repository, so take this snapshot.
11217 (method url-fetch)
11218 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
11219 "fakeroot/fakeroot_" version ".orig.tar.gz"))
11220 (file-name (string-append name "-" version ".tar.gz"))
11221 (sha256
11222 (base32 "091jym16c4m4qjf5yclksvx7nw4sl7v5yrkz6z46wrwaij99d54m"))
11223 (modules '((guix build utils)
11224 (ice-9 ftw)))
11225 (snippet
11226 `(begin
11227 ;; Delete pregenerated man page translations, but not the originals.
11228 (with-directory-excursion "doc"
11229 (for-each (lambda (language)
11230 (for-each delete-file
11231 (find-files language "\\.[0-9]$")))
11232 (scandir "."
11233 (lambda (file)
11234 (and (not (string-prefix? "." file))
11235 (eq? 'directory
11236 (stat:type (lstat file))))))))))))
11237 (build-system gnu-build-system)
11238 (arguments
11239 `(#:configure-flags
11240 (list "--disable-static")
11241 #:phases
11242 (modify-phases %standard-phases
11243 (add-after 'unpack 'patch-Makefile.am
11244 (lambda _
11245 (substitute* "Makefile.am"
11246 (("/bin/sh") (which "sh")))))
11247 (add-after 'unpack 'patch-script
11248 (lambda* (#:key inputs #:allow-other-keys)
11249 (substitute* "scripts/fakeroot.in"
11250 (("getopt")
11251 (string-append (assoc-ref inputs "util-linux")
11252 "/bin/getopt"))
11253 (("sed")
11254 (string-append (assoc-ref inputs "sed")
11255 "/bin/sed"))
11256 (("cat|cut" command)
11257 (string-append (assoc-ref inputs "coreutils")
11258 "/bin/" command)) )))
11259 (replace 'bootstrap
11260 (lambda _
11261 ;; The "preroll" script takes care of Autoconf and also
11262 ;; prepares the translated manuals.
11263 (invoke "sh" "./preroll")))
11264 (add-before 'configure 'setenv
11265 (lambda _
11266 (setenv "LIBS" "-lacl")))
11267 (add-before 'check 'prepare-check
11268 (lambda _
11269 (setenv "SHELL" (which "bash"))
11270 (setenv "VERBOSE" "1")
11271 (substitute* "test/t.touchinstall"
11272 ;; We don't have the name of the root user, so use ID=0.
11273 (("grep root") "grep \"\\<0\\>\""))
11274 (substitute* "test/tartest"
11275 ;; We don't have the name of the root group, so use ID=0.
11276 (("ROOTGROUP=root") "ROOTGROUP=0")
11277 ;; We don't have the name of the daemon user, so use IDs.
11278 (("daemon:sys") "1:3")
11279 (("daemon:") "1:"))
11280 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
11281 (substitute* "test/compare-tar"
11282 (("tar -tvf") "tar --numeric-owner -tvf")))))))
11283 (native-inputs
11284 (list autoconf-2.71 automake gettext-minimal libtool po4a
11285 perl sharutils xz)) ; for tests
11286 (inputs
11287 (list acl libcap util-linux sed coreutils))
11288 (synopsis "Run commands in an environment with fake root privileges")
11289 (description
11290 "@command{fakeroot} runs a command in an environment where it appears to
11291have root privileges for file manipulation. This is useful for allowing users
11292to create archives (@file{tar}, @file{ar}, @file{deb}, etc.) with files in
11293them with root permissions and/or ownership.
11294
11295Without fakeroot, one would have to have root privileges to create the
11296constituent files of the archives with the correct permissions and ownership,
11297and then pack them up, or one would have to construct the archives directly,
11298without using the archiver.")
11299 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
11300 (license license:gpl3+)))
11301
11302(define-public fakechroot
11303 ;; XXX: Build from the change submitted at
11304 ;; <https://github.com/dex4er/fakechroot/pull/85> to allow compilation
11305 ;; against glibc 2.33. Switch back to the official repository on the next
11306 ;; release.
11307 (let ((commit "e7c1f3a446e594a4d0cce5f5d499c9439ce1d5c5")
11308 (revision "0"))
11309 (package
11310 (name "fakechroot")
11311 (version (git-version "2.20.1" revision commit))
11312 (source (origin
11313 (method git-fetch)
11314 (uri (git-reference
11315 (url "https://github.com/lipnitsk/fakechroot")
11316 (commit commit)))
11317 (file-name (git-file-name name version))
11318 (sha256
11319 (base32
11320 "0gac6a6djx3nf343vd33sr5qqngz8ss3aij54zl8x9wb47pc11kb"))))
11321 (build-system gnu-build-system)
11322 (arguments
11323 ;; XXX: The tests heavily assume they run on an FHS system so for now
11324 ;; skip them.
11325 '(#:tests? #f
11326 #:configure-flags '("--disable-static")))
11327 (native-inputs (list autoconf automake libtool perl))
11328 (synopsis "Emulate @code{chroot} by overriding file system calls")
11329 (description
11330 "@command{fakechroot} runs a command in an environment were is additional
11331possibility to use @code{chroot} command without root privileges. This is
11332useful for allowing users to create own chrooted environment with possibility
11333to install another packages without need for root privileges.
11334
11335It works by providing @file{libfakechroot.so}, a shared library meant to be
11336set as @code{LD_PRELOAD} to override the C library file system functions.")
11337 (home-page "https://github.com/dex4er/fakechroot/")
11338 (license license:lgpl2.1+))))
11339
11340(define-public falcosecurity-libs
11341 (package
11342 (name "falcosecurity-libs")
11343 (version "0.20.0")
11344 (source (origin
11345 (method git-fetch)
11346 (uri (git-reference
11347 (url "https://github.com/falcosecurity/libs/")
11348 (commit version)))
11349 (file-name (git-file-name name version))
11350 (sha256
11351 (base32
11352 "041ir9wk44v7isidwl7fzxrjvs85j637wcr7xirasd8ysxa0r4qv"))
11353 (patches
11354 (search-patches
11355 "falcosecurity-libs-bpf-probes-fix.patch"
11356 "falcosecurity-libs-shared-build.patch"))))
11357 (build-system cmake-build-system)
11358 (arguments
11359 (list
11360 #:configure-flags
11361 #~(list "-DUSE_BUNDLED_DEPS=OFF"
11362 "-DBUILD_DRIVER=OFF"
11363 "-DENABLE_DKMS=OFF"
11364 "-DBUILD_LIBSCAP_MODERN_BPF=ON"
11365 "-DSCAP_FILES_SUITE_ENABLE=OFF" ;attempts to download scap files
11366 "-DBUILD_SHARED_LIBS=ON"
11367 #$(string-append "-DFALCOSECURITY_LIBS_VERSION=" version))
11368 ;; Only the libsinsp test suite is run, as the one for libscap requires
11369 ;; elevated privileges.
11370 #:modules '((guix build cmake-build-system)
11371 ((guix build gnu-build-system) #:prefix gnu:)
11372 (guix build utils))
11373 #:phases
11374 #~(modify-phases %standard-phases
11375 (add-after 'unpack 'disable-problematic-tests
11376 (lambda _
11377 (substitute* "userspace/libsinsp/test/user.ut.cpp"
11378 ;; The 'system_lookup' test assumes a root user
11379 ;; exists in the build environment.
11380 (("TEST_F\\(usergroup_manager_test, system_lookup)")
11381 "TEST_F(usergroup_manager_test, DISABLED_system_lookup)"))))
11382 (replace 'check
11383 (lambda* (#:rest args)
11384 (apply (assoc-ref gnu:%standard-phases 'check)
11385 #:test-target "run-unit-test-libsinsp" args)))
11386 (add-after 'install 'delete-src
11387 (lambda _
11388 (delete-file-recursively
11389 (string-append #$output "/src")))))))
11390 (native-inputs
11391 (list bpftool
11392 clang-18 ;avoid stack limit exceeded build error
11393 googletest
11394 pkg-config
11395 valijson)) ;header-only library
11396 (inputs
11397 (list elfutils))
11398 (propagated-inputs
11399 ;; The following inputs are in the 'Requires' field of libscap.pc,
11400 ;; libsinp.pc or libpman.pc.
11401 (list c-ares
11402 grpc
11403 jsoncpp
11404 libbpf
11405 libelf
11406 openssl
11407 protobuf
11408 uthash ;included in libscap headers
11409 zlib
11410 ;; These are in the 'Requires.private' field of libscap.pc and
11411 ;; libsinp.pc. They are required because the headers are installed
11412 ;; to a non-standard directory, and thus need to be found via the
11413 ;; 'Cflags' field, which in turn mandates that both the pkg-config
11414 ;; modules listed in the 'Requires' and 'Requires.private' be
11415 ;; available.
11416 curl
11417 re2
11418 onetbb))
11419 (home-page "https://github.com/falcosecurity/libs/")
11420 (synopsis "Falco security libraries")
11421 (description "The Falco security libraries include @code{libsinsp} and
11422@code{libscap}. @code{libscap} manages the data capture process, while
11423@code{libsinsp} is a system inspection library that enriches events from
11424@code{libscap} with machine state. @code{libsinsp} also performs events
11425filtering with rule evaluation through its internal rule engine. These
11426libraries are used by the @command{sysdig} command-line utility.")
11427 (license license:asl2.0)))
11428
11429(define-public inputattach
11430 (package
11431 (name "inputattach")
11432 (version "0.42.0")
11433 (source (origin
11434 (method git-fetch)
11435 (uri (git-reference
11436 (url "https://github.com/linuxwacom/input-wacom")
11437 (commit (string-append "input-wacom-" version))))
11438 (file-name (git-file-name name version))
11439 (sha256
11440 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
11441 (build-system gnu-build-system)
11442 (arguments
11443 `(#:phases
11444 (modify-phases %standard-phases
11445 (delete 'bootstrap)
11446 (delete 'configure)
11447 (replace 'build
11448 (lambda* (#:key inputs #:allow-other-keys)
11449 (with-directory-excursion "inputattach"
11450 (invoke "gcc" "-O2" "-o" "inputattach"
11451 "inputattach.c"))))
11452 (delete 'check)
11453 (replace 'install
11454 (lambda* (#:key outputs #:allow-other-keys)
11455 (let ((target-dir (string-append
11456 (assoc-ref outputs "out")
11457 "/bin/")))
11458 (mkdir-p target-dir)
11459 (copy-file "inputattach/inputattach"
11460 (string-append target-dir
11461 "inputattach"))
11462 #t))))))
11463 (home-page "https://linuxwacom.github.io/")
11464 (synopsis "Dispatch input peripherals events to a device file")
11465 (description "inputattach dispatches input events from several device
11466types and interfaces and translates so that the X server can use them.")
11467 (license license:gpl2+)))
11468
11469(define-public keyd
11470 (package
11471 (name "keyd")
11472 (version "2.6.0")
11473 (source
11474 (origin
11475 (method git-fetch)
11476 (uri (git-reference
11477 (url "https://github.com/rvaiya/keyd")
11478 (commit (string-append "v" version))))
11479 (sha256
11480 (base32
11481 "14rgrg8d1ys1cqq46mgi34yqg9jd1q3yw1acw5r5jpwwk0da7g4p"))))
11482 (arguments
11483 (list #:tests? #f ; tests require root
11484 #:make-flags
11485 #~(list (string-append "CC=" #$(cc-for-target))
11486 "PREFIX="
11487 (string-append "DESTDIR=" #$output))
11488 #:phases
11489 '(modify-phases
11490 %standard-phases
11491 (delete 'configure)))) ; no autoconf
11492 (build-system gnu-build-system)
11493 (inputs (list linux-libre-headers))
11494 (synopsis "Key remapping daemon for Linux")
11495 (description
11496 "Keyd is a keyboard remapping utility with intuitive ini configuration
11497file format. Keyd has several features, many of which are traditionally only
11498found in custom keyboard firmware like QMK.")
11499 (home-page "https://github.com/rvaiya/keyd")
11500 (license license:expat)))
11501
11502(define-public pipewire
11503 (package
11504 (name "pipewire")
11505 (version "1.4.5")
11506 (source (origin
11507 (method git-fetch)
11508 (uri (git-reference
11509 (url "https://gitlab.freedesktop.org/pipewire/pipewire")
11510 (commit version)))
11511 (file-name (git-file-name name version))
11512 (sha256
11513 (base32
11514 "1k3b412zspmx2v0finb5g8kns8xsynlnz48cmlcg7ch62av6kw75"))))
11515 (build-system meson-build-system)
11516 (arguments
11517 (list
11518 #:configure-flags
11519 #~(list (string-append "-Dudevrulesdir=" #$output "/lib/udev/rules.d")
11520 "-Dman=enabled"
11521 "-Drlimits-install=false"
11522 "-Dsession-managers=[]"
11523 "-Dsysconfdir=/etc"
11524 "-Dsystemd=disabled")))
11525 (native-inputs
11526 (list `(,glib "bin")
11527 pkg-config
11528 doxygen
11529 python
11530 python-docutils))
11531 (inputs (list alsa-lib
11532 avahi
11533 bluez
11534 dbus
11535 eudev
11536 ffmpeg
11537 gst-plugins-base
11538 gstreamer
11539 jack-2
11540 ldacbt
11541 libcamera
11542 libdrm
11543 libfdk
11544 libfreeaptx
11545 libsndfile
11546 libusb
11547 openssl ; raop sink
11548 libva
11549 pulseaudio
11550 readline ; for pw-cli
11551 sbc
11552 vulkan-headers
11553 vulkan-loader
11554 webrtc-audio-processing))
11555 (home-page "https://pipewire.org/")
11556 (synopsis "Server and user space API to deal with multimedia pipelines")
11557 (description
11558 "PipeWire is a project that aims to greatly improve handling of audio and
11559video under Linux. It aims to support the usecases currently handled by both
11560PulseAudio and Jack and at the same time provide same level of powerful handling
11561of Video input and output. It also introduces a security model that makes
11562interacting with audio and video devices from containerized applications easy,
11563with supporting Flatpak applications being the primary goal. Alongside Wayland
11564and Flatpak we expect PipeWire to provide a core building block for the future
11565of Linux application development.")
11566 (license license:lgpl2.0+)))
11567
11568(define-public pipewire-minimal
11569 ;; Used as libpipewire to reduce closure size and avoid dependency cycles.
11570 (hidden-package
11571 (package
11572 (inherit pipewire)
11573 (name "pipewire-minimal")
11574 (arguments
11575 (list
11576 #:configure-flags
11577 #~(list "-Dsession-managers=[]"
11578 "-Ddbus=disabled"
11579 "-Dflatpak=disabled"
11580 ;; XXX: Otherwise test_loop will fail with:
11581 ;; libgcc_s.so.1 must be installed for pthread_cancel to work
11582 (string-append "-Dc_link_args=-Wl,-rpath=" #$output "/lib"
11583 " -lgcc_s")
11584 "-Db_asneeded=false")))
11585 (native-inputs '())
11586 (inputs '()))))
11587
11588(define-public wireplumber
11589 (package
11590 (name "wireplumber")
11591 (version "0.5.12")
11592 (source
11593 (origin
11594 (method git-fetch)
11595 (uri (git-reference
11596 (url
11597 "https://gitlab.freedesktop.org/pipewire/wireplumber.git")
11598 (commit version)))
11599 (file-name (git-file-name name version))
11600 (sha256
11601 (base32 "1dljz669ywy1lvvn0jh14ymynmbii45q5vay71zajpcg31249dyw"))))
11602 (build-system meson-build-system)
11603 (arguments
11604 `(#:configure-flags '("-Dsystemd=disabled"
11605 "-Dsystem-lua=true")))
11606 (native-inputs
11607 (list `(,glib "bin")
11608 pkg-config python-minimal))
11609 (inputs (list dbus elogind glib lua pipewire))
11610 (home-page "https://gitlab.freedesktop.org/pipewire/wireplumber")
11611 (synopsis "Session / policy manager implementation for PipeWire")
11612 (description "WirePlumber is a modular session / policy manager for
11613PipeWire and a GObject-based high-level library that wraps PipeWire's API,
11614providing convenience for writing the daemon's modules as well as external
11615tools for managing PipeWire.")
11616 (license license:expat)))
11617
11618(define-public wireplumber-minimal
11619 (let ((base wireplumber))
11620 (package
11621 (inherit base)
11622 (name "wireplumber-minimal")
11623 (arguments
11624 (substitute-keyword-arguments (package-arguments base)
11625 ((#:configure-flags flags ''())
11626 #~(cons "-Delogind=disabled" #$flags))))
11627 (inputs
11628 (modify-inputs (package-inputs base)
11629 (delete "elogind"))))))
11630
11631(define-public ell
11632 (package
11633 (name "ell")
11634 (version "0.79")
11635 (source (origin
11636 (method git-fetch)
11637 (uri (git-reference
11638 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
11639 (commit version)))
11640 (file-name (git-file-name name version))
11641 (sha256
11642 (base32
11643 "0l8pbgnza58ivknzl3nd6y46mfminhnb3iwq82msi6g282wv7np4"))
11644 (modules '((guix build utils)))
11645 (snippet
11646 #~(begin
11647 (substitute* "Makefile.am"
11648 ;; requires hwdb.bin
11649 (("unit/test-hwdb.*") ""))))))
11650 (build-system gnu-build-system)
11651 (arguments
11652 ;; Tests launch dbus-daemon instances that all try to bind to
11653 ;; "/tmp/ell-test-bus". Thus, we need to run them sequentially.
11654 '(#:parallel-tests? #f))
11655 (inputs
11656 (list dbus))
11657 (native-inputs
11658 (list autoconf automake libtool pkg-config procps))
11659 (home-page "https://01.org/ell")
11660 (synopsis "Embedded Linux Library")
11661 (description "The Embedded Linux* Library (ELL) provides core, low-level
11662functionality for system daemons. It typically has no dependencies other than
11663the Linux kernel, C standard library, and libdl (for dynamic linking). While
11664ELL is designed to be efficient and compact enough for use on embedded Linux
11665platforms, it is not limited to resource-constrained systems.")
11666 (license license:lgpl2.1+)))
11667
11668(define-public kexec-tools
11669 (package
11670 (name "kexec-tools")
11671 (version "2.0.31")
11672 (source (origin
11673 (method url-fetch)
11674 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
11675 "/kexec/kexec-tools-" version ".tar.xz"))
11676 (sha256
11677 (base32
11678 "0c9cj9xvcm81gcwnkvvh9vh82v59kdz5llmblc2wkqb6vh6kb3wa"))))
11679 (build-system gnu-build-system)
11680 (arguments
11681 ;; There are no automated tests.
11682 '(#:tests? #f))
11683 ;; This variant of binutils is used for the 64 bit support needed to
11684 ;; assemble the `purgatory/arch/i386/compat_x86_64.S' program on i686-linux.
11685 (native-inputs (list (make-ld-wrapper "ld-wrapper"
11686 #:binutils binutils)
11687 binutils))
11688 (home-page "https://projects.horms.net/projects/kexec/")
11689 (synopsis "Tools for booting directly into different kernels")
11690 (description "This package provides the @code{kexec} program and ancillary
11691utilities. Using @code{kexec}, it is possible to boot directly into a new
11692kernel from the context of an already-running kernel, bypassing the normal
11693system boot process.")
11694 (supported-systems (delete "riscv64-linux" %supported-systems))
11695 (license license:gpl2)))
11696
11697(define-public cachefilesd
11698 (package
11699 (name "cachefilesd")
11700 (version "0.10.10")
11701 (source (origin
11702 (method url-fetch)
11703 (uri (string-append
11704 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
11705 "/cachefilesd.git/snapshot/cachefilesd-"
11706 version ".tar.gz"))
11707 (sha256
11708 (base32
11709 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
11710 (build-system gnu-build-system)
11711 (outputs '("out"))
11712 (arguments
11713 `(#:tests? #f ; there are no tests
11714 #:make-flags
11715 (let ((prefix-dir (lambda (var dir)
11716 (string-append var "=" %output "/" dir))))
11717 (list (string-append "CC=" ,(cc-for-target))
11718 (prefix-dir "SBINDIR" "sbin/")
11719 (prefix-dir "ETCDIR" "etc/")
11720 (prefix-dir "MANDIR" "share/man/")))
11721 #:phases (modify-phases %standard-phases (delete 'configure))))
11722 (home-page "https://people.redhat.com/~dhowells/cachefs/")
11723 (synopsis "CacheFiles userspace management daemon")
11724 (description "@code{cachefilesd} is a userspace daemon that manages the
11725cache data store that is used by network file systems such as @code{AFS} and
11726@code{NFS} to cache data locally on disk. The content of the cache is
11727persistent over reboots.")
11728 (license license:gpl2+)))
11729
11730(define-public libbpf
11731 (package
11732 (name "libbpf")
11733 (version "1.5.0")
11734 (source
11735 (origin
11736 (method git-fetch)
11737 (uri (git-reference
11738 (url "https://github.com/libbpf/libbpf")
11739 (commit (string-append "v" version))))
11740 (file-name (git-file-name name version))
11741 (sha256
11742 (base32
11743 "0j7rm76g2ss09vksm4nm2g5yq7df2z5qpjr4h6kd3959sc1rvxnh"))))
11744 (build-system gnu-build-system)
11745 (arguments
11746 (list
11747 #:tests? #f ;self-tests run in QEMU
11748 #:make-flags
11749 #~(list (string-append "PREFIX=" #$output)
11750 (string-append "LIBDIR=$(PREFIX)/lib")
11751 (string-append "CC=" #$(cc-for-target)))
11752 #:phases
11753 #~(modify-phases %standard-phases
11754 (delete 'configure)
11755 (add-before 'build 'pre-build
11756 (lambda _
11757 (chdir "src")))
11758 (replace 'install
11759 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
11760 (apply (assoc-ref %standard-phases 'install)
11761 (append args
11762 (list #:make-flags
11763 (append (list "install"
11764 ;; Also install the kernel
11765 ;; user API (uAPI) headers.
11766 "install_uapi_headers")
11767 make-flags)))))))))
11768 (native-inputs (list pkg-config))
11769 (propagated-inputs (list elfutils zlib)) ;in Requires.private of libbpf.pc
11770 (home-page "https://github.com/libbpf/libbpf")
11771 (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
11772 (description
11773 "Libbpf supports building BPF CO-RE-enabled applications, which, in
11774contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
11775headers.")
11776 (license (list license:lgpl2.1 license:bsd-2))))
11777
11778(define-public libbpf-0.8
11779 (package
11780 (inherit libbpf)
11781 (name "libbpf")
11782 (version "0.8.1")
11783 (source
11784 (origin
11785 (method git-fetch)
11786 (uri (git-reference
11787 (url "https://github.com/libbpf/libbpf")
11788 (commit (string-append "v" version))))
11789 (file-name (git-file-name name version))
11790 (sha256
11791 (base32
11792 "1zzpkk4x3f20483dzw43b3ml03d63vvkmqf4j8y3b61b67wm59bm"))))
11793 (arguments
11794 (list
11795 #:tests? #f ;self-tests run in QEMU
11796 #:make-flags
11797 #~(list (string-append "PREFIX=" #$output)
11798 (string-append "LIBDIR=$(PREFIX)/lib")
11799 (string-append "CC=" #$(cc-for-target)))
11800 #:phases #~(modify-phases %standard-phases
11801 (delete 'configure)
11802 (add-before 'build 'pre-build
11803 (lambda _
11804 (chdir "src"))))))
11805 (native-inputs (list pkg-config))
11806 (propagated-inputs (list elfutils zlib)))) ;in Requires.private of libbpf.pc
11807
11808(define-public bcc
11809 (package
11810 (name "bcc")
11811 (version "0.30.0")
11812 (source
11813 (origin
11814 (method git-fetch)
11815 (uri (git-reference
11816 (url "https://github.com/iovisor/bcc")
11817 (commit (string-append "v" version))))
11818 (file-name (git-file-name name version))
11819 (sha256
11820 (base32
11821 "0b5la0yn6x6ll73drnrm5v5yibbrzkvl86hqivkrmnpgy8cqn0cy"))))
11822 (build-system cmake-build-system)
11823 (native-inputs
11824 (list bison
11825 flex
11826 (@ (gnu packages compression) zip)))
11827 (inputs
11828 (list bash-minimal ;for wrap-program
11829 clang-15
11830 elfutils
11831 luajit
11832 libbpf
11833 python-wrapper))
11834 (arguments
11835 (list
11836 ;; Tests all require root permissions and a "standard" file hierarchy.
11837 #:tests? #f
11838 #:configure-flags #~(list (string-append "-DREVISION=" #$version)
11839 "-DCMAKE_USE_LIBBPF_PACKAGE=ON")
11840 #:phases
11841 #~(modify-phases %standard-phases
11842 (add-after 'unpack 'substitute-libbc
11843 (lambda _
11844 (substitute* "src/python/bcc/libbcc.py"
11845 (("(libbcc\\.so.*)\\b" _ libbcc)
11846 (string-append #$output "/lib/" libbcc)))))
11847 (add-after 'install 'wrap-tools
11848 (lambda _
11849 (use-modules (ice-9 textual-ports))
11850 (let* ((out #$output)
11851 (lib (string-append out "/lib"))
11852 (tools (string-append out "/share/bcc/tools"))
11853 (python-executable?
11854 (lambda (filename _)
11855 (call-with-input-file filename
11856 (lambda (port)
11857 (string-contains (get-line port)
11858 "/bin/python"))))))
11859 (for-each (lambda (python-executable)
11860 (format #t "Wrapping: ~A.~%" python-executable)
11861 (wrap-program python-executable
11862 `("GUIX_PYTHONPATH" ":" prefix
11863 (,(string-append lib
11864 "/python"
11865 #$(version-major+minor
11866 (package-version python))
11867 "/site-packages")))))
11868 (find-files tools python-executable?))))))))
11869 (home-page "https://github.com/iovisor/bcc")
11870 (synopsis "Tools for BPF on Linux")
11871 (description
11872 "BCC is a toolkit for creating efficient kernel tracing and manipulation
11873programs, and includes several useful tools and examples. It makes use of
11874extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
11875that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
11876and above.")
11877 (license license:asl2.0)))
11878
11879(define-public bpftool
11880 (package
11881 (name "bpftool")
11882 (version (package-version linux-libre))
11883 (source (package-source linux-libre))
11884 (build-system gnu-build-system)
11885 (arguments
11886 `(#:tests? #f ;This package has no tests.
11887 #:phases (modify-phases %standard-phases
11888 (delete 'configure)
11889 (replace 'build
11890 (lambda* (#:key inputs #:allow-other-keys)
11891 (invoke "make" "-C" "tools/bpf/bpftool"
11892 ,(string-append "CC=" (cc-for-target)))))
11893 (replace 'install
11894 (lambda* (#:key outputs #:allow-other-keys)
11895 (let* ((out (assoc-ref outputs "out")))
11896 (mkdir-p (string-append out "/sbin"))
11897 (mkdir-p (string-append out
11898 "/share/bash-completion/completions"))
11899 (invoke "make"
11900 (string-append "prefix=" out)
11901 (string-append
11902 "bash_compdir=" out
11903 "/share/bash-completion/completions")
11904 "-C" "tools/bpf/bpftool"
11905 "install")))))))
11906 (inputs (list elfutils ;provides libelf
11907 readline libcap zlib))
11908 (native-inputs (list bison python-3))
11909 ;; This tool does not have a proper web page.
11910 (home-page
11911 "https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/bpf/bpftool")
11912 (synopsis "Tool for inspection and manipulation of eBPF programs and maps")
11913 (description "@command{bpftool} allows for inspection and simple
11914modification of BPF objects on the system.")
11915 (license (package-license linux-libre))))
11916
11917(define-public bpftrace
11918 (package
11919 (name "bpftrace")
11920 (version "0.21.2")
11921 (source
11922 (origin
11923 (method git-fetch)
11924 (uri (git-reference
11925 (url "https://github.com/bpftrace/bpftrace")
11926 (commit (string-append "v" version))))
11927 (file-name (git-file-name name version))
11928 (sha256
11929 (base32 "0icbhf1wk523a7lcmwqa67zc6hl6h02p5mfg26cizva447kbwsgz"))))
11930 (build-system cmake-build-system)
11931 (arguments
11932 (list
11933 #:test-exclude "(runtime_tests|tools-parsing-test)"
11934 #:phases
11935 #~(modify-phases %standard-phases
11936 ;; This patch also fixes broken compilation due to improper detection
11937 ;; of bfd features. This is taken from following upstream PR:
11938 ;; https://github.com/bpftrace/bpftrace/pull/3332
11939 (add-after 'unpack 'patch-paths-and-bfd-defs
11940 (lambda _
11941 (substitute* '("cmake/FindLibBfd.cmake"
11942 "src/CMakeLists.txt")
11943 (("LIBSFRAME_FOUND")
11944 "LIBSFRAME_LIBRARIES")
11945 (("LIBZSTD_FOUND")
11946 "LIBZSTD_LIBRARIES"))
11947 (with-directory-excursion "tests"
11948 (substitute* (find-files ".")
11949 (("/bin/sh")
11950 (which "sh")))
11951 (substitute* '("child.cpp"
11952 "runtime/call"
11953 "procmon.cpp")
11954 (("/bin/ls")
11955 (which "ls"))))))
11956 (add-after 'unpack 'fix-paths
11957 (lambda* (#:key inputs outputs #:allow-other-keys)
11958 (substitute* '("tests/child.cpp")
11959 (("/bin/sleep")
11960 (search-input-file inputs "bin/sleep")))))
11961 (add-before 'check 'set-test-filter
11962 (lambda _
11963 (setenv "GTEST_FILTER"
11964 (string-join
11965 (list ; "-" disables all following tests
11966 "-ast.probe_name_uprobe"
11967 "bpftrace.add_probes_uprobe_wildcard_file"
11968 "bpftrace.add_probes_uprobe_wildcard_file_uprobe_multi"
11969 "bpftrace.add_probes_usdt_wildcard"
11970 "Parser.multiple_attach_points_kprobe"
11971 "Parser.uretprobe_offset"
11972 "semantic_analyser.builtin_functions"
11973 "semantic_analyser.call_func"
11974 "semantic_analyser.call_uaddr")
11975 ":")))))))
11976 (native-inputs (list bison coreutils dwarves flex googletest xxd))
11977 (inputs (list bcc clang-15 elfutils libbpf libiberty cereal))
11978 (home-page "https://github.com/bpftrace/bpftrace")
11979 (synopsis "High-level tracing language for Linux eBPF")
11980 (description
11981 "bpftrace is a high-level tracing language for Linux enhanced Berkeley
11982Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses
11983LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for
11984interacting with the Linux BPF system, as well as existing Linux tracing
11985capabilities: kernel dynamic tracing (kprobes), user-level dynamic
11986tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk
11987and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was
11988created by Alastair Robertson.")
11989 (license license:asl2.0)))
11990
11991(define-public ttyebus-linux-module
11992 (let ((revision "0")
11993 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))
11994 (package
11995 (name "ttyebus-linux-module")
11996 (version (git-version "1.5" revision commit))
11997 (source
11998 (origin
11999 (method git-fetch)
12000 (uri (git-reference
12001 (url "https://github.com/eBUS/ttyebus")
12002 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")))
12003 (file-name (git-file-name name version))
12004 (sha256
12005 (base32
12006 "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani"))))
12007 (supported-systems '("armhf-linux" "aarch64-linux"))
12008 (build-system linux-module-build-system)
12009 (arguments
12010 `(#:tests? #f))
12011 (home-page "https://github.com/eBUS/ttyebus")
12012 (synopsis "Low-latency Raspberry Pi UART driver")
12013 (description "This package provides a Linux kernel module that will
12014provide a serial device @code{/dev/ttyebus} with almost no latency upon
12015receiving. It is dedicated to the PL011 UART of the Raspberry Pi.")
12016 (license license:gpl3+))))
12017
12018(define-public ipset
12019 (package
12020 (name "ipset")
12021 (version "7.17")
12022 (source
12023 (origin
12024 (method url-fetch)
12025 (uri (string-append "https://ipset.netfilter.org/"
12026 "ipset-" version ".tar.bz2"))
12027 (sha256
12028 (base32 "1n34mkrdha9rggd0fizjx6baqkiqqd1yfhb5ml663mlx93zwjjdy"))))
12029 (build-system gnu-build-system)
12030 (inputs
12031 (list libmnl))
12032 (native-inputs
12033 (list pkg-config))
12034 (arguments
12035 `(#:configure-flags '("--disable-static"
12036 "--with-kmod=no")))
12037 (home-page "https://ipset.netfilter.org/")
12038 (synopsis "Administration tool for IP sets")
12039 (description "IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel which
12040can be administered by the ipset utility. Depending on the type,
12041currently an IP set may store IP addresses, (TCP/UDP) port numbers or
12042IP addresses with MAC addresses in a way which ensures lightning speed
12043when matching an entry against a set.
12044
12045If you want to
12046@itemize @bullet
12047@item store multiple IP addresses or port numbers and match against the entire
12048collection using a single iptables rule.
12049@item dynamically update iptables rules against IP addresses or ports without
12050performance penalty.
12051@item express complex IP address and ports based rulesets with a single
12052iptables rule and benefit from the speed of IP sets.
12053@end itemize\n
12054then IP sets may be the proper tool for you.")
12055 (license license:gpl2+)))
12056
12057(define-public liburing
12058 (package
12059 (name "liburing")
12060 (version "2.12")
12061 (source (origin
12062 (method git-fetch)
12063 (uri (git-reference
12064 (url "https://git.kernel.dk/liburing")
12065 (commit (string-append "liburing-" version))))
12066 (file-name (git-file-name name version))
12067 (sha256
12068 (base32
12069 "0vz3p7g0nzcg5bag7kqkdncigl9nc0vrzm07l8yww2gb529k6hxh"))))
12070 (build-system gnu-build-system)
12071 (arguments
12072 `(;; Tests are dependent on kernel version and features
12073 #:tests? #f
12074 #:phases
12075 (modify-phases %standard-phases
12076 (replace 'configure
12077 ;; configure fails if it is followed by SHELL, CONFIG_SHELL,
12078 ;; --enable-fast-install, and --build
12079 (lambda* (#:key outputs #:allow-other-keys)
12080 (let ((out (assoc-ref outputs "out")))
12081 (setenv "SHELL" (which "sh"))
12082 (setenv "CONFIG_SHELL" (which "sh"))
12083 (invoke "./configure" (string-append "--prefix=" out))))))))
12084 (home-page "https://github.com/axboe/liburing")
12085 (synopsis "Interface to the Linux kernel @code{io_uring} interface")
12086 (description "This is the io_uring library, liburing. liburing provides
12087helpers to setup and teardown io_uring instances, and also a simplified
12088interface for applications that don't need (or want) to deal with the full
12089kernel side implementation.")
12090 (license license:expat)))
12091
12092(define-public erofs-utils
12093 (package
12094 (name "erofs-utils")
12095 (version "1.8.10")
12096 (source
12097 (origin
12098 (method git-fetch)
12099 (uri (git-reference
12100 (url "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git")
12101 (commit (string-append "v" version))))
12102 (file-name (git-file-name name version))
12103 (sha256
12104 (base32 "1qlig9q1fdjl0zn7206dbv7w5ssjg4az4hg7y3vk69ly0zbmwkil"))))
12105 (build-system gnu-build-system)
12106 (inputs
12107 (list lz4
12108 `(,util-linux "lib")
12109 zlib))
12110 (native-inputs
12111 (list autoconf automake libtool pkg-config))
12112 (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/")
12113 (synopsis "User-space tools for the EROFS file system")
12114 (description
12115 "@acronym{EROFS, The Enhanced Read-Only File System} is a compressed,
12116read-only file system optimized for resource-scarce devices. This package
12117provides user-space tools for creating EROFS file systems.")
12118 (license license:gpl2+)))
12119
12120(define-public rasdaemon
12121 (package
12122 (name "rasdaemon")
12123 (version "0.8.3")
12124 (source
12125 (origin
12126 (method git-fetch)
12127 (uri (git-reference
12128 (url "https://github.com/mchehab/rasdaemon")
12129 (commit (string-append "v" version))))
12130 (file-name (git-file-name name version))
12131 (sha256
12132 (base32 "0vfw4vf75fnpbxnfsmpdwdzhplnccz24j23bg6nsb3b4wa8hv4sa"))))
12133 (native-inputs (list autoconf automake libtool pkg-config))
12134 (inputs (list bash-minimal libtraceevent perl perl-dbd-sqlite sqlite dmidecode kmod))
12135 (arguments
12136 (list
12137 #:configure-flags
12138 #~(list "--enable-all"
12139 ;; Don't install unused /etc/sysconfig/rasdaemon environment file.
12140 "--with-sysconfdefdir=."
12141 "--localstatedir=/var")
12142 #:phases
12143 #~(modify-phases %standard-phases
12144 (add-after 'unpack 'rename-README
12145 (lambda _
12146 ;; Required by autoreconf
12147 (rename-file "README.md" "README")))
12148 (add-before 'configure 'munge-autotools
12149 (lambda _
12150 ;; For some reason upstream forces sysconfdir=/etc. This results
12151 ;; in EPERM during the install phase. Removing the offending
12152 ;; line lets sysconfdir correctly pick up DESTDIR.
12153 (substitute* "configure.ac"
12154 (("^test .* sysconfdir=/etc\n$") ""))))
12155 (add-after 'install 'wrap-rasdaemon
12156 (lambda* (#:key inputs #:allow-other-keys)
12157 (let ((path (map dirname
12158 (list (search-input-file inputs "/sbin/dmidecode")
12159 (search-input-file inputs "/bin/modprobe")))))
12160 (wrap-program (string-append #$output "/sbin/ras-mc-ctl")
12161 `("PATH" ":" prefix ,path)
12162 `("PERL5LIB" ":" prefix ,(string-split (getenv "PERL5LIB") #\:)))))))))
12163 (build-system gnu-build-system)
12164 (home-page "https://github.com/mchehab/rasdaemon")
12165 (synopsis "Platform Reliability, Availability, and Serviceability tools")
12166 (description
12167 "The @code{rasdaemon} daemon monitors platform @acronym{RAS, Reliability
12168Availability and Serviceability} reports from Linux kernel trace events.
12169These trace events are logged in @file{/sys/kernel/debug/tracing} and reported
12170through standard log mechanisms like syslog.")
12171 (license license:gpl2)))
12172
12173(define-public renameat2
12174 ;; This is a Gist, with no release or tags.
12175 (let ((revision "0")
12176 (commit "5c5193f20142511a5fc7069a539f4e5aba0ea470"))
12177 (package
12178 (name "renameat2")
12179 (version (git-version "0.0.0" revision commit))
12180 (source (origin
12181 (method url-fetch)
12182 (uri (string-append "https://gist.githubusercontent.com/"
12183 "eatnumber1/f97ac7dad7b1f5a9721f/raw/"
12184 commit "/renameat2.c"))
12185 (sha256
12186 (base32
12187 "07b4hsxqjm610sdkm4nxhp0gnl2s7gzlh4zdnja5ay40v4x24bb9"))))
12188 (build-system gnu-build-system)
12189 (arguments
12190 (list
12191 #:tests? #f ;no test suite
12192 #:phases #~(modify-phases %standard-phases
12193 (delete 'configure)
12194 (replace 'build
12195 (lambda _
12196 (invoke #$(cc-for-target) "renameat2.c"
12197 "-o" "renameat2")))
12198 (replace 'install
12199 (lambda _
12200 (install-file "renameat2"
12201 (string-append #$output "/bin")))))))
12202 (home-page "https://gist.github.com/eatnumber1/f97ac7dad7b1f5a9721f")
12203 (synopsis "Command to call the renameat2 Linux system call")
12204 (description "This package provides a @command{renameat2} command that
12205calls the Linux-specific @code{renameat2} system call.")
12206 (license license:expat))))
12207
12208(define-public libgpiod
12209 (package
12210 (name "libgpiod")
12211 (version "2.2.2")
12212 (source
12213 (origin
12214 (method git-fetch)
12215 (uri
12216 (git-reference
12217 (url "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
12218 (commit (string-append "v" version))))
12219 (file-name (git-file-name name version))
12220 (sha256 (base32 "10yiwrw80x0057w825zxmdbd54w9lbyf49bgqk1cryqapglfzqri"))))
12221 (build-system gnu-build-system)
12222 (arguments
12223 (list #:configure-flags
12224 #~(list "--enable-tools=yes"
12225 "--enable-bindings-cxx")))
12226 (native-inputs
12227 (list automake
12228 autoconf-2.71
12229 libtool
12230 autoconf-archive
12231 pkg-config))
12232 (synopsis "Interact with the Linux GPIO character device")
12233 (description
12234 "This package provides a C library with C++ bindings and
12235command-line tools for interacting with GPIO devices that avoids the usage of
12236older system-wide @file{/sys} interface.")
12237 (home-page "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/")
12238 (license (list license:lgpl2.1+ ;; libgpiod
12239 license:gpl2+ ;; gpio-tools
12240 license:lgpl3+)))) ;; C++ bindings
12241
12242(define-public python-libgpiod
12243 (package
12244 (name "python-libgpiod")
12245 (version "2.3.0")
12246 (source
12247 (origin
12248 (method git-fetch)
12249 (uri
12250 (git-reference
12251 (url "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
12252 (commit (string-append "python-v" version))))
12253 (file-name (git-file-name name version))
12254 (sha256 (base32 "1lkd7lgpb28pqf7p6lrwl0ss7r5ryiddmdcisnz6ixy796qhr8kr"))))
12255 (build-system pyproject-build-system)
12256 (arguments
12257 (list
12258 #:tests? #f ; tests require root, see README.md
12259 #:phases
12260 #~(modify-phases %standard-phases
12261 (add-after 'unpack 'cd-to-python-bindings
12262 (lambda _
12263 (chdir "bindings/python"))))))
12264 (native-inputs
12265 (list python-setuptools
12266 python-wheel
12267 libgpiod))
12268 (synopsis "Interact with the Linux GPIO character device")
12269 (description
12270 "This package provides Python bindings for interacting with GPIO devices
12271that avoids the usage of older system-wide @file{/sys} interface.")
12272 (home-page "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/")
12273 (license (list license:lgpl2.1+ ;; libgpiod
12274 license:gpl2+ ;; gpio-tools
12275 license:lgpl3+)))) ;; C++ bindings
12276
12277(define-public libtraceevent
12278 (package
12279 (name "libtraceevent")
12280 (version "1.7.3")
12281 (source
12282 (origin
12283 (method git-fetch)
12284 (uri (git-reference
12285 (url "https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git")
12286 (commit (string-append name "-" version))))
12287 (file-name (git-file-name name version))
12288 (sha256
12289 (base32 "06mw2f0xnk6dy9w2z0n4dz7lnm02qfsmnmj2h24453qxlw57x0d6"))
12290 (modules '((guix build utils)))
12291 (snippet
12292 #~(begin
12293 (substitute* (list "Makefile" "scripts/utils.mk")
12294 (("/bin/(pwd)" _ command) command))))))
12295 (build-system gnu-build-system)
12296 (arguments
12297 (list
12298 #:tests? #f ; no test suite
12299 #:make-flags
12300 #~(list
12301 (string-append "pkgconfig_dir=" #$output "/lib/pkgconfig")
12302 (string-append "prefix=" #$output))
12303 #:phases
12304 #~(modify-phases %standard-phases
12305 (delete 'configure)))) ; no configure script
12306 (home-page "https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/")
12307 (synopsis "Linux kernel trace event library")
12308 (description
12309 "This library parses raw Linux kernel trace event formats.")
12310 (license (list license:gpl2
12311 license:lgpl2.1))))
12312
12313(define-public libtracefs
12314 (package
12315 (name "libtracefs")
12316 (version "1.7.0")
12317 (source
12318 (origin
12319 (method git-fetch)
12320 (uri (git-reference
12321 (url "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git")
12322 (commit (string-append name "-" version))))
12323 (file-name (git-file-name name version))
12324 (sha256
12325 (base32 "0v896n3q0df0nxx5drbwyaqhrqiyxl06rvrdw3gp2r37awa9g1zb"))
12326 (modules '((guix build utils)))
12327 (snippet
12328 #~(begin
12329 (substitute* (list "Makefile" "scripts/utils.mk")
12330 (("/bin/(pwd)" _ command) command))))))
12331 (build-system gnu-build-system)
12332 (arguments
12333 (list
12334 #:tests? #f ; no test suite
12335 #:make-flags
12336 #~(list
12337 (string-append "CC=" #$(cc-for-target))
12338 (string-append "pkgconfig_dir=" #$output "/lib/pkgconfig")
12339 (string-append "prefix=" #$output))
12340 #:phases
12341 #~(modify-phases %standard-phases
12342 (delete 'configure)))) ; no configure script
12343 (native-inputs (list pkg-config))
12344 (inputs (list libtraceevent))
12345 (home-page "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/")
12346 (synopsis "Linux kernel trace file system library")
12347 (description
12348 "This library provides APIs to access the Linux kernel's trace file
12349system.")
12350 (license (list license:gpl2
12351 license:lgpl2.1))))
12352
12353(define-public libtree
12354 (package
12355 (name "libtree")
12356 (version "3.1.1")
12357 (source
12358 (origin
12359 (method git-fetch)
12360 (uri (git-reference
12361 (url "https://github.com/haampie/libtree")
12362 (commit (string-append "v" version))))
12363 (file-name (git-file-name name version))
12364 (patches (search-patches "libtree-fix-check-non-x86.patch"))
12365 (sha256
12366 (base32 "1jbc60cslzcfxk9jwva51ncr1zl1nz0fkgfjdckgv81is11nswmb"))))
12367 (arguments
12368 (list #:make-flags
12369 ;; NOTE: Official documentation recommends to build libtree with
12370 ;; "-static" flag.
12371 #~(list (string-append "CC=" #$(cc-for-target))
12372 (string-append "PREFIX=" #$output))
12373 #:phases
12374 #~(modify-phases %standard-phases
12375 (add-after 'unpack 'fix-tests
12376 ;; XXX: '08_nodeflib' fails as 'libtree' returns a non-zero
12377 ;; code in one of the tests.
12378 ;;
12379 ;; See <https://github.com/haampie/libtree/issues/80>).
12380 (lambda _
12381 (substitute* "tests/08_nodeflib/Makefile"
12382 (("! ../../libtree -vvv exe_b")
12383 "../../libtree -vvv exe_b"))))
12384 (delete 'configure))))
12385 (build-system gnu-build-system)
12386 (home-page "https://github.com/haampie/libtree")
12387 (synopsis "Show output of @command{ldd} as a tree")
12388 (description
12389 "This tool turns @command{ldd} into a tree and explains how shared
12390libraries are found or why they cannot be located.")
12391 (license license:expat)))
12392
12393(define-public touchegg
12394 (package
12395 (name "touchegg")
12396 (version "2.0.18")
12397 (source
12398 (origin
12399 (method git-fetch)
12400 (uri (git-reference
12401 (url "https://github.com/JoseExposito/touchegg")
12402 (commit version)))
12403 (file-name (git-file-name name version))
12404 (sha256
12405 (base32 "0m8zgihij14b8dxrxxvpl8sdsx49mjlnxnm0fhgfxscy7n07kcpc"))))
12406 (build-system cmake-build-system)
12407 (arguments
12408 `(#:tests? #f ; No tests exist
12409 #:configure-flags
12410 (list "-DUSE_SYSTEMD=OFF"))) ; No systemd
12411 (native-inputs
12412 (list
12413 pkg-config))
12414 (inputs
12415 (list
12416 cairo
12417 gtk+
12418 libgudev
12419 libinput
12420 libxrandr
12421 libxtst
12422 pugixml))
12423 (home-page "https://github.com/JoseExposito/touchegg")
12424 (synopsis "Multitouch gesture recognizer")
12425 (description
12426 "Touchégg is an application that runs in the background and transform the
12427gestures you make on your touchpad or touchscreen into visible actions in your
12428desktop.")
12429 (license license:gpl3+)))
12430
12431(define-public evtest
12432 (package
12433 (name "evtest")
12434 (version "1.36")
12435 (source (origin
12436 (method git-fetch)
12437 (uri (git-reference
12438 (url "https://gitlab.freedesktop.org/libevdev/evtest")
12439 (commit (string-append "evtest-" version))))
12440 (file-name (git-file-name name version))
12441 (sha256
12442 (base32
12443 "0mwjvz0fwwcwm4fpw0m4x8bcxpnzjkiy7fpb438vf4i5g5q0dc1k"))))
12444 (build-system gnu-build-system)
12445 (arguments
12446 (list #:tests? #f ;No tests exist
12447 #:make-flags #~(list (string-append "CC="
12448 #$(cc-for-target))
12449 (string-append "PREFIX="
12450 #$output))
12451 #:phases #~(modify-phases %standard-phases
12452 (add-after 'unpack 'generate-doc
12453 (lambda _
12454 (invoke "asciidoc" "-d" "manpage"
12455 "-b" "docbook"
12456 "-o" "evtest.1.xml"
12457 "evtest.txt")
12458 (invoke "xsltproc" "--nonet"
12459 (string-append
12460 #$(this-package-native-input "docbook-xsl")
12461 "/xml/xsl/docbook-xsl-"
12462 #$(package-version
12463 (this-package-native-input "docbook-xsl"))
12464 "/manpages/docbook.xsl")
12465 "evtest.1.xml")))
12466 (replace 'bootstrap
12467 (lambda _
12468 (setenv "CONFIG_SHELL" (which "sh"))
12469 (invoke "autoreconf" "-fi"))))))
12470 (native-inputs (list autoconf
12471 automake
12472 bash-minimal
12473 xmlto
12474 docbook-xsl
12475 libxslt
12476 asciidoc))
12477 (home-page "https://gitlab.freedesktop.org/libevdev/evtest")
12478 (synopsis "Kernel evdev device information and monitor")
12479 (description
12480 "@code{evtest} is a tool to print @code{evdev} kernel events. It reads
12481directly from the kernel device and prints a device description and the events
12482with the value and the symbolic name.")
12483 (license license:gpl2+)))
12484
12485(define-public tp-smapi-module
12486 (package
12487 (name "tp-smapi-module")
12488 (version "0.44")
12489 (source (origin
12490 (method git-fetch)
12491 (uri (git-reference
12492 (url "https://github.com/linux-thinkpad/tp_smapi")
12493 (commit (string-append "tp-smapi/" version))))
12494 (file-name (git-file-name name version))
12495 (sha256
12496 (base32
12497 "0kzbks07bh5jbi1n311zp9cbp1xxyzi7nys8wq1k0k5ig81h9w6k"))))
12498 (build-system linux-module-build-system)
12499 (arguments
12500 `(#:tests? #f)) ;there are none.
12501 (home-page "https://github.com/linux-thinkpad/tp_smapi")
12502 (synopsis
12503 "Linux Kernel module exposing features of ThinkPad hardware")
12504 (description
12505 "This package provides a Linux Kernel module that controls
12506battery charging of specific ThinkPad laptops. It also includes an improved
12507version of the HDAPS driver. The underlying hardware interfaces are
12508@acronym{SMAPI, System Management Application Program Interface} and direct
12509access to the embedded controller.")
12510 (license license:gpl2+)))
12511
12512(define-public modprobed-db
12513 (package
12514 (name "modprobed-db")
12515 (version "2.48")
12516 (source (origin
12517 (method git-fetch)
12518 (uri (git-reference
12519 (url "https://github.com/graysky2/modprobed-db")
12520 (commit (string-append "v" version))))
12521 (file-name (git-file-name name version))
12522 (sha256
12523 (base32
12524 "0jscinga32jjvy3vwl4s1pyd5fjgqhmmk010k665nhil302hzjdc"))))
12525 (build-system gnu-build-system)
12526 (arguments
12527 (list #:tests? #f ;no tests
12528 #:make-flags
12529 #~(list (string-append "PREFIX=" #$output)
12530 "INITDIR_SYSTEMD=no-thanks")
12531 #:phases
12532 #~(modify-phases %standard-phases
12533 (delete 'configure)
12534 (add-after 'install 'fix-path
12535 (lambda* (#:key inputs #:allow-other-keys)
12536 (substitute* (string-append #$output "/bin/modprobed-db")
12537 (("/usr") #$output)
12538 (((string-append "(" (string-join (list "awk"
12539 "cp"
12540 "cut"
12541 "getent"
12542 "grep"
12543 "logname"
12544 "md5sum"
12545 "mkdir"
12546 "mv"
12547 "sed"
12548 "sort"
12549 "uniq"
12550 "wc")
12551 "|") ")") m)
12552 (search-input-file inputs (string-append "/bin/" m)))
12553 (("modprobe ")
12554 (string-append
12555 (search-input-file inputs "/bin/modprobe") " "))))))))
12556 (inputs (list coreutils kmod gawk glibc grep sed))
12557 (home-page "https://wiki.archlinux.org/title/Modprobed-db")
12558 (synopsis "Keep track of Linux modules that have been probed")
12559 (description
12560 "Modprobed-db is a useful utility for users wishing to build a minimal
12561kernel via a @code{make localmodconfig}. In a nutshell, this @command{make}
12562target creates a config based on the current config and a list of modules you
12563define (that @command{modprobed-db} keeps for you). It then disables any
12564module option that is not needed thus not building extraneous modules. This
12565results in a system-specific, streamlined kernel package and footprint as well
12566as reduced compilation times.
12567
12568Modprobed-db simply logs every module ever probed on the target system to a
12569text-based database (@file{$XDG_CONFIG_HOME/modprobed-db}), which can be read
12570directly by @code{make localmodconfig} as described above.")
12571 (license license:expat)))
12572
12573(define-public kernel-hardening-checker
12574 (package
12575 (name "kernel-hardening-checker")
12576 (version "0.6.17.1")
12577 (source (origin
12578 (method git-fetch)
12579 (uri (git-reference
12580 (url "https://github.com/a13xp0p0v/kernel-hardening-checker")
12581 (commit (string-append "v" version))))
12582 (file-name (git-file-name name version))
12583 (sha256
12584 (base32
12585 "04r9bbayhs1ik84908q148k9djawy69zarxw0vc31dfbf64mni62"))))
12586 (build-system pyproject-build-system)
12587 (arguments
12588 (list #:tests? #f)) ;no active tests, runtime only, see GitHub Actions
12589 (native-inputs
12590 (list python-setuptools))
12591 (home-page "https://github.com/a13xp0p0v/kernel-hardening-checker")
12592 (synopsis
12593 "Tool for checking the security hardening options of the Linux kernel")
12594 (description
12595 "@code{kernel-hardening-checker} is a tool for checking the security
12596hardening options of the Linux kernel. Provided preferences are based on
12597suggestions from various sources, including:
12598
12599@itemize
12600@item KSPP recommended settings
12601@item CLIP OS kernel configuration
12602@item Last public grsecurity patch (options which they disable)
12603@item SECURITY_LOCKDOWN_LSM patchset
12604@item Direct feedback from the Linux kernel maintainers
12605@end itemize\n
12606This tool supports checking Kconfig options and kernel cmdline parameters.")
12607 (license license:gpl3)))
12608
12609(define-deprecated-package kconfig-hardened-check
12610 kernel-hardening-checker)
12611
12612(define-public firejail
12613 (package
12614 (name "firejail")
12615 (version "0.9.74")
12616 (source (origin
12617 (method url-fetch)
12618 (uri (string-append
12619 "https://github.com/netblue30/firejail/releases/download/" version
12620 "/firejail-" version ".tar.xz" ))
12621 (sha256
12622 (base32
12623 "04w11jjh62ghs66ippw5xlg3l7l9mi3b5cpch1cg3fw7gxnbbn3h"))))
12624 (arguments
12625 (list #:phases
12626 #~(modify-phases %standard-phases
12627 (replace 'check
12628 (lambda* (#:key tests? #:allow-other-keys)
12629 (when tests?
12630 (with-directory-excursion "test"
12631 (invoke "make"))))))))
12632 (build-system gnu-build-system)
12633 (inputs
12634 (list apparmor xdg-dbus-proxy))
12635 (synopsis "Linux namespaces sandbox program")
12636 (description
12637 "Firejail is a SUID sandbox program that reduces the risk of security
12638breaches by restricting the running environment of untrusted applications
12639using Linux namespaces, seccomp-bpf and Linux capabilities. The software
12640includes sandbox profiles for a number of common Linux programs. Firejail
12641should be added to the list of setuid programs in the system configuration to
12642work properly.")
12643 (home-page "https://github.com/netblue30/firejail")
12644 (supported-systems
12645 (filter (cut string-suffix? "-linux" <>) %supported-systems))
12646 (license license:gpl2+)))
12647
12648(define-public firejail-disable-sandbox-check
12649 (package/inherit
12650 firejail
12651 (name "firejail-disable-sandbox-check")
12652 (arguments
12653 (substitute-keyword-arguments (package-arguments firejail)
12654 ((#:configure-flags flags #~'())
12655 #~(append #$flags
12656 (list "--disable-sandbox-check")))))
12657 (description
12658 (string-append (package-description firejail)
12659 " Builded with @code{--disable-sandbox-check}, which is
12660 only intended for development."))))
12661
12662(define-public edac-utils
12663 (package
12664 (name "edac-utils")
12665 (version "0.18")
12666 (source (origin
12667 (method git-fetch)
12668 (uri (git-reference
12669 (url "https://github.com/grondo/edac-utils.git")
12670 (commit version)))
12671 (file-name (string-append name "-" version "-checkout"))
12672 (sha256
12673 (base32
12674 "04j686m58wsnyy5di7rz0sw9jahlm4ziwxjmgs31pjb87vzw3xgp"))))
12675 (build-system gnu-build-system)
12676 (native-inputs
12677 (list perl))
12678 (inputs
12679 (list sysfsutils))
12680 (synopsis "Memory error detection and correction userspace helpers")
12681 (description "This package provides userspace helpers for memory
12682error detection and correction (EDAC).")
12683 (home-page "https://github.com/grondo/edac-utils")
12684 (license license:gpl2+)))
12685
12686(define-public spectre-meltdown-checker
12687 (package
12688 (name "spectre-meltdown-checker")
12689 (version "0.46")
12690 (source (origin
12691 (method git-fetch)
12692 (uri (git-reference
12693 (url "https://github.com/speed47/spectre-meltdown-checker")
12694 (commit (string-append "v" version))))
12695 (file-name (git-file-name name version))
12696 (patches
12697 (search-patches
12698 "spectre-meltdown-checker-externalize-fwdb.patch"))
12699 ;; Remove builtin firmware database.
12700 (modules '((guix build utils)))
12701 (snippet '(substitute* "spectre-meltdown-checker.sh"
12702 (("^# [AI],.*") "")))
12703 (sha256
12704 (base32
12705 "0j42p6dayb7k87kf8sqimxlaswis3qh0569a15zccyknv9vf129k"))))
12706 (build-system copy-build-system)
12707 (arguments
12708 (list
12709 #:install-plan
12710 #~'(("spectre-meltdown-checker.sh" "bin/spectre-meltdown-checker"))
12711 #:phases
12712 #~(modify-phases %standard-phases
12713 (add-after 'unpack 'fixpath
12714 (lambda* (#:key inputs #:allow-other-keys)
12715 (define* (find-command inputs cmd #:optional (bin "bin"))
12716 (search-input-file inputs (string-append bin "/" cmd)))
12717 (substitute* "spectre-meltdown-checker.sh"
12718 ;; ${opt_arch_prefix}CMD
12719 (("\\$\\{opt_arch_prefix\\}\\<(nm|objdump|readelf|strings)\\>"
12720 all cmd)
12721 (find-command inputs cmd))
12722
12723 ;; Commands safe to substitute directly.
12724 (("\\<(awk|(base|dir)name|bunzip2|g(un)?zip|lz4)\\>" all cmd)
12725 (find-command inputs cmd))
12726 (("\\<(lzop|mktemp|modprobe|pgrep|rmmod|umount)\\>" all cmd)
12727 (find-command inputs cmd))
12728 (("\\<(unlzma|unxz|unzstd|uuencode)\\>" all cmd)
12729 (find-command inputs cmd))
12730
12731 ;; Commands which should only be substituted based on their
12732 ;; surroundings: First up, dd.
12733 (("\\<(dd)\\> if=" all cmd)
12734 (string-append
12735 (find-command inputs cmd)
12736 " if="))
12737
12738 ;; Another special case: sysctl is in sbin.
12739 (("(if |\\$\\( *)\\<(sysctl)\\>" all pre cmd)
12740 (string-append pre (find-command inputs cmd "sbin")))
12741
12742 ;; Meow
12743 (("cat (<<EOF|\"\\$)" all what)
12744 (string-append (find-command inputs "cat") " " what))
12745 (("'cat'")
12746 (string-append "'" (find-command inputs "cat") "'"))
12747 (("\"cat\"")
12748 (string-append "\"" (find-command inputs "cat") "\""))
12749
12750 ;; ${COMMAND} -
12751 ;; ${COMMAND} ^
12752 (("\\<(base64|cut|grep|head|id|mount)\\> ([-^])" all cmd suffix)
12753 (string-append (find-command inputs cmd) " " suffix))
12754 (("\\<(od|perl|rm|uname|xargs)\\> ([-^])" all cmd suffix)
12755 (string-append (find-command inputs cmd) " " suffix))
12756
12757 ;; ${COMMAND} |
12758 (("\\<(dmesg)\\> \\|" all cmd)
12759 (string-append (find-command inputs cmd) " |"))
12760 ;; | ${COMMAND}
12761 (("\\| \\<(grep|sed|sort|stat|tr)\\>" all cmd)
12762 (string-append "| " (find-command inputs cmd)))
12763
12764 ;; Command in sub-shell, i.e. $($COMMAND ...)
12765 (("\\$\\( *(\\<cat|find|grep|mount|nproc|stat|tr\\>)"
12766 all cmd)
12767 (string-append "$(" (find-command inputs cmd)))
12768
12769 ;; command -v
12770 (("command -v \"*\\<(base64|nproc|perl|printf)\\>\"*" all cmd)
12771 (string-append "command -v " (find-command inputs cmd)))))))))
12772 (inputs (list kmod lz4 lzop perl procps sharutils util-linux zstd))
12773 (home-page "https://github.com/speed47/spectre-meltdown-checker")
12774 (synopsis "CPU vulnerability / mitigation checker")
12775 (description
12776 "This package provides a shell script to assess your system's resilience
12777against the several transient execution CVEs that were published since early
127782018, and gives guidance as to how to mitigate them.")
12779 (license license:gpl3)))
12780
12781(define-public csmith
12782 (package
12783 (name "csmith")
12784 (version "2.3.0")
12785 (source (origin
12786 (method git-fetch)
12787 (uri (git-reference
12788 (url "https://github.com/csmith-project/csmith")
12789 (commit (string-append "csmith-" version))))
12790 (file-name (git-file-name name version))
12791 (sha256
12792 (base32
12793 "0nhrsnv6cny14xz68qb1h30fbwc05adkisk51p3x63mydm60ddl3"))))
12794 (build-system gnu-build-system)
12795 (native-inputs
12796 (list autoconf automake libtool m4 perl))
12797 (arguments
12798 (list
12799 #:tests? #f ;no test suite
12800 ;; Do not install headers under 'include/csmith-VERSION' but in
12801 ;; 'include/csmith'.
12802 #:phases
12803 `(modify-phases %standard-phases
12804 (add-after 'unpack 'patch-includedir
12805 (lambda _
12806 (substitute* "runtime/Makefile.am"
12807 (("\\$\\(includedir\\)/\\$\\(PACKAGE\\)-\\$\\(VERSION\\)")
12808 "$(includedir)/$(PACKAGE)"))))
12809 (add-before 'bootstrap 'force-bootstrap
12810 (lambda _
12811 (delete-file "configure"))))))
12812 (home-page "https://github.com/csmith-project/csmith")
12813 (synopsis "Random generator of C programs")
12814 (description "The primary purpose of Csmith is to find compiler bugs with
12815random programs using differential testing.")
12816 (license license:bsd-4)))
12817
12818(define-public ipvsadm
12819 (package
12820 (name "ipvsadm")
12821 (version "1.31")
12822 (source
12823 (origin
12824 (method url-fetch)
12825 (uri (string-append "https://kernel.org/pub/linux/utils/kernel"
12826 "/ipvsadm/ipvsadm-" version ".tar.xz"))
12827 (sha256
12828 (base32 "1nyzpv1hx75k9lh0vfxfhc0p2fpqaqb38xpvs8sn88m1nljmw2hs"))))
12829 (build-system gnu-build-system)
12830 (native-inputs (list linux-libre-headers pkg-config which))
12831 (inputs (list libnl popt))
12832 (arguments
12833 (list #:tests? #f
12834 #:parallel-build? #f ;build fails randomly with '-j'
12835 #:make-flags
12836 #~(list (string-join
12837 (list "CFLAGS="
12838 (string-append "-I"
12839 #$(this-package-input "libnl")
12840 "/include/libnl3")
12841 (string-append "-L" #$(this-package-input "libnl")
12842 "/lib")
12843 "-fPIC")
12844 " ")
12845 (string-append "CC=" #$(cc-for-target))
12846 (string-append "SBIN=" #$output "/sbin")
12847 (string-append "INIT=" #$output "/etc/init.d")
12848 (string-append "MANDIR=" #$output "/share/man"))
12849 #:phases #~(modify-phases %standard-phases
12850 (delete 'configure))))
12851 (home-page "http://www.linuxvirtualserver.org/software/ipvs.html")
12852 (synopsis "IP virtual server administration utility")
12853 (description "@code{ipvsadm(8)} is used to set up, maintain or inspect the
12854virtual server table in the Linux kernel. The Linux Virtual Server can be used
12855to build scalable network services based on a cluster of two or more nodes.")
12856 (license license:gpl2+)))
12857
12858(define-public ryzenadj
12859 (package
12860 (name "ryzenadj")
12861 (version "0.17.0")
12862 (source (origin
12863 (method url-fetch)
12864 (uri (string-append "https://github.com/flygoat/ryzenadj/archive/refs/tags/"
12865 "v" version ".tar.gz"))
12866 (sha256
12867 (base32 "0i2x6kbn2ix52vjz1mmh0c0g3w0k4sn0lq68wbsk0pgndzcck2l4"))
12868 (modules '((guix build utils)))
12869 (snippet
12870 '(begin (delete-file-recursively "win32")
12871 #t))))
12872 (build-system cmake-build-system)
12873 (inputs (list pciutils))
12874 (arguments
12875 (list #:tests? #f ; No test suite
12876 #:phases #~(modify-phases %standard-phases
12877 (add-before 'install 'build
12878 (lambda _
12879 (invoke "cmake" "-DCMAKE_BUILD_TYPE=Release" "."))))))
12880 (home-page "https://github.com/flygoat/ryzenadj")
12881 (synopsis "Power management tool for AMD Ryzen APUs")
12882 (description
12883 "@command{ryzenadj} is an utility to adjust power management settings for
12884AMD Ryzen mobile processors. You will need to ensure it can access /dev/mem,
12885for instance by using the \"iomem=relaxed\" kernel argument.")
12886 (license license:lgpl3)))
12887
12888(define-public ryzen-smu
12889 (package
12890 (name "ryzen-smu")
12891 (version "0.1.5")
12892 (source (origin
12893 (method git-fetch)
12894 (uri (git-reference
12895 (url "https://gitlab.com/leogx9r/ryzen_smu.git")
12896 (commit (string-append "v" version))))
12897 (file-name (git-file-name name version))
12898 (sha256
12899 (base32
12900 "010la2a8zp7rljlg5ssc9ragzva4ca05gvzlicjagl508659d2wz"))))
12901 (build-system linux-module-build-system)
12902 (arguments
12903 `(#:tests? #f)) ; no tests
12904 (synopsis "System Management Unit driver for AMD Ryzen processors")
12905 (description "This package provides a way to access the
12906System Management Unit for certain AMD Ryzen processors.
12907This includes access to the System Management Network.")
12908 (home-page "https://gitlab.com/leogx9r/ryzen_smu")
12909 (license license:gpl2)))
12910
12911(define-public hid-wiimote-plus
12912 (package
12913 (name "hid-wiimote-plus")
12914 (version "0.9.2")
12915 (source (origin
12916 (method git-fetch)
12917 (uri (git-reference
12918 (url "https://github.com/dkosmari/hid-wiimote-plus.git")
12919 (commit (string-append "v" version))))
12920 (file-name (git-file-name name version))
12921 (sha256
12922 (base32
12923 "1rkp311x60jm73xlqypxsp375rx3fa55jyrspz1aqjga0q6cvswi"))))
12924 (build-system linux-module-build-system)
12925 (arguments
12926 (list #:tests? #f)) ; No tests.
12927 (synopsis "WiiMote HID kernel module")
12928 (description "This package provides a WiiMote driver that follows the
12929Linux input convention. Specifically, that allows you to use the D-pad
12930as a gamepad.")
12931 (home-page "https://github.com/dkosmari/hid-wiimote-plus")
12932 (license license:gpl2+)))
12933
12934(define-public python-evemu
12935 (package
12936 (name "python-evemu")
12937 (version "2.7.0")
12938 (source (origin
12939 (method git-fetch)
12940 (uri (git-reference
12941 (url "https://gitlab.freedesktop.org/libevdev/evemu")
12942 (commit (string-append "v" version))))
12943 (file-name (git-file-name name version))
12944 (sha256
12945 (base32
12946 "1sxf6v2wnajj9srlkfjfymjmmp4dlq73gzjcjmaw015a3c0xl029"))))
12947 (build-system gnu-build-system)
12948 (arguments
12949 (list #:tests? #f ; would open device files
12950 #:phases
12951 #~(modify-phases %standard-phases
12952 (add-after 'unpack 'patch
12953 (lambda* (#:key inputs #:allow-other-keys)
12954 (substitute* "python/evemu/base.py"
12955 (("\"libevdev.so\"")
12956 (string-append "\"" (assoc-ref inputs "libevdev")
12957 "/lib/libevdev.so\""))))))))
12958 (native-inputs
12959 (list asciidoc autoconf automake libtool docbook-xsl pkg-config
12960 python-wrapper xmlto))
12961 (inputs
12962 (list libevdev))
12963 (synopsis "Record and replay input device events")
12964 (description "This package provides a way to record and replay device
12965descriptions and events, making it possible to emulate input devices
12966through the Linux kernel's input system. Emulated devices are for most
12967practical purposes indistinguishable from real devices.
12968
12969It provides a command line program and also a Python library.")
12970 (home-page "https://www.freedesktop.org/wiki/Evemu/")
12971 (license license:gpl3)))
12972
12973(define-public dualsensectl
12974 (package
12975 (name "dualsensectl")
12976 (version "0.7")
12977 (source (origin
12978 (method git-fetch)
12979 (uri (git-reference
12980 (url "https://github.com/nowrep/dualsensectl.git")
12981 (commit (string-append "v" version))))
12982 (file-name (git-file-name name version))
12983 (sha256
12984 (base32
12985 "05snsp5r3hc2yc1nf0w4aam1my4h0lkxnmy7k4glxvasd9jwahzw"))))
12986 (build-system meson-build-system)
12987 (native-inputs
12988 (list pkg-config))
12989 (inputs
12990 (list eudev dbus hidapi))
12991 (synopsis "Linux tool for controlling PS5 DualSense controller")
12992 (description "This package provides a Linux tool for controlling a PS5
12993DualSense controller. It has to be already connected via USB or connected
12994via Bluetooth.")
12995 (home-page "https://github.com/nowrep/dualsensectl")
12996 (license license:gpl2)))