1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
5 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
7 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
8 ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
10 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com>
12 ;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org>
13 ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
14 ;;; Copyright © 2016, 2018, 2019, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
15 ;;; Copyright © 2016, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
16 ;;; Copyright © 2016 David Craven <david@craven.ch>
17 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
18 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
19 ;;; Copyright © 2016, 2018 Rene Saavedra <pacoon@protonmail.com>
20 ;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
21 ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
22 ;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
23 ;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
24 ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
25 ;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
26 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
27 ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
28 ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
29 ;;; Copyright © 2017 Dave Love <fx@gnu.org>
30 ;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
31 ;;; Copyright © 2018, 2020 Brendan Tildesley <mail@brendan.scot>
32 ;;; Copyright © 2018 Manuel Graf <graf@init.at>
33 ;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
34 ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
35 ;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
36 ;;; Copyright © 2019, 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
37 ;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com>
38 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
39 ;;; Copyright © 2019, 2020 Brice Waegeneire <brice@waegenei.re>
40 ;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
41 ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
42 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
43 ;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
44 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
45 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
46 ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
48 ;;; This file is part of GNU Guix.
50 ;;; GNU Guix is free software; you can redistribute it and/or modify it
51 ;;; under the terms of the GNU General Public License as published by
52 ;;; the Free Software Foundation; either version 3 of the License, or (at
53 ;;; your option) any later version.
55 ;;; GNU Guix is distributed in the hope that it will be useful, but
56 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
57 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
58 ;;; GNU General Public License for more details.
60 ;;; You should have received a copy of the GNU General Public License
61 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
63 (define-module (gnu packages linux)
64 #:use-module (gnu packages)
65 #:use-module (gnu packages acl)
66 #:use-module (gnu packages admin)
67 #:use-module (gnu packages algebra)
68 #:use-module (gnu packages audio)
69 #:use-module (gnu packages autotools)
70 #:use-module (gnu packages backup)
71 #:use-module (gnu packages base)
72 #:use-module (gnu packages bash)
73 #:use-module (gnu packages bison)
74 #:use-module (gnu packages calendar)
75 #:use-module (gnu packages check)
76 #:use-module (gnu packages crypto)
77 #:use-module (gnu packages cryptsetup)
78 #:use-module (gnu packages compression)
79 #:use-module (gnu packages dbm)
80 #:use-module (gnu packages datastructures)
81 #:use-module (gnu packages docbook)
82 #:use-module (gnu packages documentation)
83 #:use-module (gnu packages elf)
84 #:use-module (gnu packages flex)
85 #:use-module (gnu packages file)
86 #:use-module (gnu packages freedesktop)
87 #:use-module (gnu packages gcc)
88 #:use-module (gnu packages gettext)
89 #:use-module (gnu packages glib)
90 #:use-module (gnu packages golang)
91 #:use-module (gnu packages gperf)
92 #:use-module (gnu packages gstreamer)
93 #:use-module (gnu packages gtk)
94 #:use-module (gnu packages haskell-apps)
95 #:use-module (gnu packages haskell-xyz)
96 #:use-module (gnu packages libunwind)
97 #:use-module (gnu packages libusb)
98 #:use-module (gnu packages man)
99 #:use-module (gnu packages maths)
100 #:use-module (gnu packages multiprecision)
101 #:use-module (gnu packages ncurses)
102 #:use-module (gnu packages netpbm)
103 #:use-module (gnu packages networking)
104 #:use-module (gnu packages ninja)
105 #:use-module (gnu packages nss)
106 #:use-module (gnu packages perl)
107 #:use-module (gnu packages pciutils)
108 #:use-module (gnu packages pkg-config)
109 #:use-module (gnu packages popt)
110 #:use-module (gnu packages pulseaudio)
111 #:use-module (gnu packages python)
112 #:use-module (gnu packages python-xyz)
113 #:use-module (gnu packages readline)
114 #:use-module (gnu packages rrdtool)
115 #:use-module (gnu packages samba)
116 #:use-module (gnu packages sdl)
117 #:use-module (gnu packages serialization)
118 #:use-module (gnu packages slang)
119 #:use-module (gnu packages texinfo)
120 #:use-module (gnu packages tls)
121 #:use-module (gnu packages valgrind)
122 #:use-module (gnu packages video)
123 #:use-module (gnu packages web)
124 #:use-module (gnu packages xiph)
125 #:use-module (gnu packages xml)
126 #:use-module (gnu packages xdisorg)
127 #:use-module (gnu packages xorg)
128 #:use-module (gnu packages groff)
129 #:use-module (gnu packages rsync)
130 #:use-module (gnu packages selinux)
131 #:use-module (gnu packages swig)
132 #:use-module (guix build-system cmake)
133 #:use-module (guix build-system gnu)
134 #:use-module (guix build-system go)
135 #:use-module (guix build-system meson)
136 #:use-module (guix build-system python)
137 #:use-module (guix build-system trivial)
138 #:use-module (guix build-system linux-module)
139 #:use-module (guix download)
140 #:use-module (guix git-download)
141 #:use-module ((guix licenses) #:prefix license:)
142 #:use-module (guix packages)
143 #:use-module (guix gexp)
144 #:use-module (guix store)
145 #:use-module (guix monads)
146 #:use-module (guix utils)
147 #:use-module (srfi srfi-1)
148 #:use-module (srfi srfi-2)
149 #:use-module (srfi srfi-26)
150 #:use-module (ice-9 match))
152 (define-public (system->linux-architecture arch)
153 "Return the Linux architecture name for ARCH, a Guix system name such as
154 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
155 (let ((arch (car (string-split arch #\-))))
156 (cond ((string=? arch "i686") "i386")
157 ((string-prefix? "mips" arch) "mips")
158 ((string-prefix? "arm" arch) "arm")
159 ((string-prefix? "aarch64" arch) "arm64")
160 ((string-prefix? "alpha" arch) "alpha")
161 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
162 ((string-prefix? "s390" arch) "s390")
163 ((string-prefix? "riscv" arch) "riscv")
166 (define-public (system->defconfig system)
167 "Some systems (notably powerpc-linux) require a special target for kernel
168 defconfig. Return the appropriate make target if applicable, otherwise return
170 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
171 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
176 ;;; Kernel source code deblobbing.
179 (define (linux-libre-deblob-scripts version
182 (list (version-major+minor version)
185 (uri (string-append "https://linux-libre.fsfla.org"
186 "/pub/linux-libre/releases/" version "-gnu/"
187 "deblob-" (version-major+minor version)))
188 (sha256 deblob-hash))
191 (uri (string-append "https://linux-libre.fsfla.org"
192 "/pub/linux-libre/releases/" version "-gnu/"
194 (sha256 deblob-check-hash))))
196 (define deblob-scripts-5.6
197 (linux-libre-deblob-scripts
199 (base32 "196fdbfy1f8zbmnv0ik720snig2bacsh7hfyvgbmlsfk3cil2zgv")
200 (base32 "1g0bi3c8xzy1vz6w1xbpkb3a26bqn9d1yphcqz2ki4aikra81wid")))
202 (define deblob-scripts-5.4
203 (linux-libre-deblob-scripts
205 (base32 "0ckxn7k5zgcqk30dq943bnamr6a6zjbw2aqjl3x30f4kvh5f6k25")
206 (base32 "10qb890is4z58vr8czh3xx69q62l3b3j38y410kgiw8nii3zx5lr")))
208 (define deblob-scripts-4.19
209 (linux-libre-deblob-scripts
211 (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy")
212 (base32 "1w2wgxblpq09i33qmqgw5v3r5rm9vkkygr6m0sgv4zgczk9s29wr")))
214 (define deblob-scripts-4.14
215 (linux-libre-deblob-scripts
217 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
218 (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky")))
220 (define deblob-scripts-4.9
221 (linux-libre-deblob-scripts
223 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
224 (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2")))
226 (define deblob-scripts-4.4
227 (linux-libre-deblob-scripts
229 (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw")
230 (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf")))
232 (define* (computed-origin-method gexp-promise hash-algo hash
233 #:optional (name "source")
234 #:key (system (%current-system))
235 (guile (default-guile)))
236 "Return a derivation that executes the G-expression that results
237 from forcing GEXP-PROMISE."
238 (mlet %store-monad ((guile (package->derivation guile system)))
239 (gexp->derivation (or name "computed-origin")
241 #:graft? #f ;nothing to graft
243 #:guile-for-build guile)))
245 (define (make-linux-libre-source version
248 "Return a 'computed' origin that generates a Linux-libre tarball from the
249 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
250 (match deblob-scripts
251 ((deblob-version (? origin? deblob) (? origin? deblob-check))
252 (unless (string=? deblob-version (version-major+minor version))
253 ;; The deblob script cannot be expected to work properly on a
254 ;; different version (major+minor) of Linux, even if no errors
255 ;; are signaled during execution.
256 (error "deblob major+minor version mismatch"))
258 (method computed-origin-method)
259 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
263 (with-imported-modules '((guix build utils))
265 (use-modules (guix build utils)
269 (let ((dir (string-append "linux-" #$version)))
272 (set-path-environment-variable
275 #+(canonical-package bash)
276 #+(canonical-package coreutils)
277 #+(canonical-package diffutils)
278 #+(canonical-package findutils)
279 #+(canonical-package patch)
280 #+(canonical-package xz)
281 #+(canonical-package sed)
282 #+(canonical-package grep)
283 #+(canonical-package bzip2)
284 #+(canonical-package gzip)
285 #+(canonical-package tar)
286 ;; The comments in the 'deblob-check' script
287 ;; claim that it supports Python 2 and 3, but
288 ;; in fact it fails when run in Python 3 as
292 (with-directory-excursion "/tmp/bin"
294 (copy-file #+deblob "deblob")
295 (chmod "deblob" #o755)
296 (substitute* "deblob"
297 (("/bin/sh") (which "sh")))
299 (copy-file #+deblob-check "deblob-check")
300 (chmod "deblob-check" #o755)
301 (substitute* "deblob-check"
302 (("/bin/sh") (which "sh"))
303 (("/bin/sed") (which "sed"))
304 (("/usr/bin/python") (which "python"))))
306 (if (file-is-directory? #+upstream-source)
308 (format #t "Copying upstream linux source...~%")
310 (invoke "cp" "--archive" #+upstream-source dir)
311 (invoke "chmod" "--recursive" "u+w" dir))
313 (format #t "Unpacking upstream linux tarball...~%")
315 (invoke "tar" "xf" #$upstream-source)
318 (and (not (member name '("." "..")))
319 (file-is-directory? name))))
321 (unless (string=? dir unpacked-dir)
322 (rename-file unpacked-dir dir)))
324 (error "multiple directories found" dirs)))))
326 (with-directory-excursion dir
327 (setenv "PYTHON" (which "python"))
328 (format #t "Running deblob script...~%")
330 (invoke "/tmp/bin/deblob"))
332 (format #t "~%Packing new Linux-libre tarball...~%")
334 (invoke "tar" "cvfa" #$output
335 ;; Avoid non-determinism in the archive.
348 (define (linux-libre-urls version)
349 "Return a list of URLs for Linux-Libre VERSION."
351 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
352 version "-gnu/linux-libre-" version "-gnu.tar.xz")
354 ;; XXX: Work around <http://bugs.gnu.org/14851>.
356 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
357 version "-gnu.tar.xz")
359 ;; Maybe this URL will become valid eventually.
361 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
362 version "-gnu.tar.xz")))
364 (define (%upstream-linux-source version hash)
367 (uri (string-append "mirror://kernel.org"
368 "/linux/kernel/v" (version-major version) ".x/"
369 "linux-" version ".tar.xz"))
373 (define-public linux-libre-5.6-version "5.6.17")
374 (define-public linux-libre-5.6-pristine-source
375 (let ((version linux-libre-5.6-version)
376 (hash (base32 "17kzalz8z6svv6nwa3dbmf7nyvpb2wwwyabj19vdwf6v05a28fn3")))
377 (make-linux-libre-source version
378 (%upstream-linux-source version hash)
379 deblob-scripts-5.6)))
381 (define-public linux-libre-5.4-version "5.4.45")
382 (define-public linux-libre-5.4-pristine-source
383 (let ((version linux-libre-5.4-version)
384 (hash (base32 "0bpy2lb3bqmkaqxzdmssgmhbjsys7d3lyfv4x919q0596jgh6gqh")))
385 (make-linux-libre-source version
386 (%upstream-linux-source version hash)
387 deblob-scripts-5.4)))
389 (define-public linux-libre-4.19-version "4.19.127")
390 (define-public linux-libre-4.19-pristine-source
391 (let ((version linux-libre-4.19-version)
392 (hash (base32 "0vsq5vjyh6n8acjnldfs0zny63l12fn2pssb8zbwidc8qmmqibw2")))
393 (make-linux-libre-source version
394 (%upstream-linux-source version hash)
395 deblob-scripts-4.19)))
397 (define-public linux-libre-4.14-version "4.14.183")
398 (define-public linux-libre-4.14-pristine-source
399 (let ((version linux-libre-4.14-version)
400 (hash (base32 "11c0vd2pwplm8wafich4zg2mnp10vvnap987c5jh96w1avpsyra2")))
401 (make-linux-libre-source version
402 (%upstream-linux-source version hash)
403 deblob-scripts-4.14)))
405 (define-public linux-libre-4.9-version "4.9.226")
406 (define-public linux-libre-4.9-pristine-source
407 (let ((version linux-libre-4.9-version)
408 (hash (base32 "1jj5ydz5cy87z7hrv54bkyl9739lpzja8580ngjhrip5iwb8q2j6")))
409 (make-linux-libre-source version
410 (%upstream-linux-source version hash)
411 deblob-scripts-4.9)))
413 (define-public linux-libre-4.4-version "4.4.226")
414 (define-public linux-libre-4.4-pristine-source
415 (let ((version linux-libre-4.4-version)
416 (hash (base32 "1dwvm81i62b06jsl38spfn719zrsbwq5z8viwckrpw4ma4w9k0j1")))
417 (make-linux-libre-source version
418 (%upstream-linux-source version hash)
419 deblob-scripts-4.4)))
421 (define %boot-logo-patch
422 ;; Linux-Libre boot logo featuring Freedo and a gnu.
425 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
426 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
429 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
431 (define %linux-libre-arm-export-__sync_icache_dcache-patch
435 "https://salsa.debian.org/kernel-team/linux"
436 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
437 "/debian/patches/bugfix/arm/"
438 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
439 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
441 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
443 (define (source-with-patches source patches)
446 (patches (append (origin-patches source)
449 (define-public linux-libre-5.6-source
450 (source-with-patches linux-libre-5.6-pristine-source
451 (list %boot-logo-patch
452 %linux-libre-arm-export-__sync_icache_dcache-patch
453 ;; Pinebook Pro patch from linux-next,
454 ;; can be dropped for linux-libre 5.7
456 "linux-libre-support-for-Pinebook-Pro.patch"))))
458 (define-public linux-libre-5.4-source
459 (source-with-patches linux-libre-5.4-pristine-source
460 (list %boot-logo-patch
461 %linux-libre-arm-export-__sync_icache_dcache-patch
462 ;; Pinebook Pro patch from linux-next,
463 ;; can be dropped for linux-libre 5.7
465 "linux-libre-support-for-Pinebook-Pro.patch"))))
467 (define-public linux-libre-4.19-source
468 (source-with-patches linux-libre-4.19-pristine-source
469 (list %boot-logo-patch
470 %linux-libre-arm-export-__sync_icache_dcache-patch)))
472 (define-public linux-libre-4.14-source
473 (source-with-patches linux-libre-4.14-pristine-source
474 (list %boot-logo-patch)))
476 (define-public linux-libre-4.9-source
477 (source-with-patches linux-libre-4.9-pristine-source
478 (list %boot-logo-patch)))
480 (define-public linux-libre-4.4-source
481 (source-with-patches linux-libre-4.4-pristine-source
482 (list %boot-logo-patch)))
489 (define (make-linux-libre-headers version hash-string)
490 (make-linux-libre-headers* version
493 (uri (linux-libre-urls version))
494 (sha256 (base32 hash-string)))))
496 (define (make-linux-libre-headers* version source)
498 (name "linux-libre-headers")
501 (build-system gnu-build-system)
502 (native-inputs `(("perl" ,perl)
503 ,@(if (version>=? version "4.16")
507 ,@(if (version>=? version "5.3")
511 `(#:modules ((guix build gnu-build-system)
515 (modify-phases %standard-phases
519 (let ((arch ,(system->linux-architecture
520 (or (%current-target-system)
522 (defconfig ,(system->defconfig
523 (or (%current-target-system)
524 (%current-system)))))
526 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
527 (invoke "make" defconfig)
528 (invoke "make" "mrproper" "headers_check"))))
530 (lambda* (#:key outputs #:allow-other-keys)
531 (let ((out (assoc-ref outputs "out")))
533 (string-append "INSTALL_HDR_PATH=" out)
536 (mkdir (string-append out "/include/config"))
537 (call-with-output-file
539 "/include/config/kernel.release")
541 (format p "~a-default~%" ,version)))
543 ;; Remove the '.install' and '..install.cmd' files; the
544 ;; latter contains store paths, which pulls in bootstrap
545 ;; binaries in the build environment, and prevents bit
546 ;; reproducibility for the bootstrap binaries.
547 (for-each delete-file (find-files out "\\.install"))
550 #:allowed-references ()
552 (home-page "https://www.gnu.org/software/linux-libre/")
553 (synopsis "GNU Linux-Libre kernel headers")
554 (description "Headers of the Linux-Libre kernel.")
555 (license license:gpl2)))
557 (define-public linux-libre-headers-5.6
558 (make-linux-libre-headers* linux-libre-5.6-version
559 linux-libre-5.6-source))
561 (define-public linux-libre-headers-5.4
562 (make-linux-libre-headers* linux-libre-5.4-version
563 linux-libre-5.4-source))
565 (define-public linux-libre-headers-4.19
566 (make-linux-libre-headers* linux-libre-4.19-version
567 linux-libre-4.19-source))
569 (define-public linux-libre-headers-4.14
570 (make-linux-libre-headers* linux-libre-4.14-version
571 linux-libre-4.14-source))
573 (define-public linux-libre-headers-4.9
574 (make-linux-libre-headers* linux-libre-4.9-version
575 linux-libre-4.9-source))
577 (define-public linux-libre-headers-4.4
578 (make-linux-libre-headers* linux-libre-4.4-version
579 linux-libre-4.4-source))
581 ;; The following package is used in the early bootstrap, and thus must be kept
582 ;; stable and with minimal build requirements.
583 (define-public linux-libre-headers-5.4.20
584 (make-linux-libre-headers "5.4.20"
585 "1qxhf6dmcwjblzx8fgn6vr10p38xw10iwh6d1y1v1mxb25y30b47"))
587 (define-public linux-libre-headers linux-libre-headers-5.4.20)
591 ;;; Kernel configurations.
594 (define* (kernel-config arch #:key variant)
595 "Return the absolute file name of the Linux-Libre build configuration file
596 for ARCH and optionally VARIANT, or #f if there is no such configuration."
597 (let* ((name (string-append (if variant (string-append variant "-") "")
598 (if (string=? "i386" arch) "i686" arch) ".conf"))
599 (file (string-append "linux-libre/" name)))
600 (search-auxiliary-file file)))
602 (define %default-extra-linux-options
603 `(;; Some very mild hardening.
604 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
605 ;; All kernels should have NAMESPACES options enabled
606 ("CONFIG_NAMESPACES" . #t)
607 ("CONFIG_UTS_NS" . #t)
608 ("CONFIG_IPC_NS" . #t)
609 ("CONFIG_USER_NS" . #t)
610 ("CONFIG_PID_NS" . #t)
611 ("CONFIG_NET_NS" . #t)
612 ;; Modules required for initrd:
613 ("CONFIG_NET_9P" . m)
614 ("CONFIG_NET_9P_VIRTIO" . m)
615 ("CONFIG_VIRTIO_BLK" . m)
616 ("CONFIG_VIRTIO_NET" . m)
617 ("CONFIG_VIRTIO_PCI" . m)
618 ("CONFIG_VIRTIO_BALLOON" . m)
619 ("CONFIG_VIRTIO_MMIO" . m)
620 ("CONFIG_FUSE_FS" . m)
622 ("CONFIG_9P_FS" . m)))
624 (define (config->string options)
625 (string-join (map (match-lambda
627 (string-append option "=m"))
629 (string-append option "=y"))
631 (string-append option "=n")))
637 ;;; Kernel package utilities.
640 (define* (make-linux-libre version hash-string supported-systems
642 ;; A function that takes an arch and a variant.
643 ;; See kernel-config for an example.
645 (configuration-file #f)
646 (defconfig "defconfig")
647 (extra-options %default-extra-linux-options)
648 (patches (list %boot-logo-patch)))
649 (make-linux-libre* version
652 (uri (linux-libre-urls version))
653 (sha256 (base32 hash-string))
656 #:extra-version extra-version
657 #:configuration-file configuration-file
658 #:defconfig defconfig
659 #:extra-options extra-options))
661 (define* (make-linux-libre* version source supported-systems
663 ;; A function that takes an arch and a variant.
664 ;; See kernel-config for an example.
666 (configuration-file #f)
667 (defconfig "defconfig")
668 (extra-options %default-extra-linux-options))
670 (name (if extra-version
671 (string-append "linux-libre-" extra-version)
675 (supported-systems supported-systems)
676 (build-system gnu-build-system)
681 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
685 ;; These are needed to compile the GCC plugins.
690 ,@(match (and configuration-file
692 (system->linux-architecture
693 (or (%current-target-system) (%current-system)))
694 #:variant (version-major+minor version)))
695 (#f ;no config for this platform
698 `(("kconfig" ,config))))))
700 `(#:modules ((guix build gnu-build-system)
707 (modify-phases %standard-phases
708 (add-after 'unpack 'patch-/bin/pwd
710 (substitute* (find-files "." "^Makefile(\\.include)?$")
711 (("/bin/pwd") "pwd"))
714 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
715 ;; Avoid introducing timestamps
716 (setenv "KCONFIG_NOTIMESTAMP" "1")
717 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
719 ;; Set ARCH and CROSS_COMPILE
720 (let ((arch ,(system->linux-architecture
721 (or (%current-target-system)
722 (%current-system)))))
724 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
727 (setenv "CROSS_COMPILE" (string-append target "-"))
728 (format #t "`CROSS_COMPILE' set to `~a'~%"
729 (getenv "CROSS_COMPILE"))))
731 (setenv "EXTRA_VERSION" ,extra-version)
733 (let ((build (assoc-ref %standard-phases 'build))
734 (config (assoc-ref (or native-inputs inputs) "kconfig")))
736 ;; Use a custom kernel configuration file or a default
737 ;; configuration file.
740 (copy-file config ".config")
741 (chmod ".config" #o666))
742 (invoke "make" ,defconfig))
744 ;; Appending works even when the option wasn't in the
745 ;; file. The last one prevails if duplicated.
746 (let ((port (open-file ".config" "a"))
747 (extra-configuration ,(config->string extra-options)))
748 (display extra-configuration port)
751 (invoke "make" "oldconfig"))))
753 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
754 (let* ((out (assoc-ref outputs "out"))
755 (moddir (string-append out "/lib/modules"))
756 (dtbdir (string-append out "/lib/dtbs")))
757 ;; Install kernel image, kernel configuration and link map.
758 (for-each (lambda (file) (install-file file out))
759 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
760 ;; Install device tree files
761 (unless (null? (find-files "." "\\.dtb$"))
763 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
765 ;; Install kernel modules
768 ;; Disable depmod because the Guix system's module directory
769 ;; is an union of potentially multiple packages. It is not
770 ;; possible to use depmod to usefully calculate a dependency
771 ;; graph while building only one of those packages.
773 (string-append "MODULE_DIR=" moddir)
774 (string-append "INSTALL_PATH=" out)
775 (string-append "INSTALL_MOD_PATH=" out)
776 "INSTALL_MOD_STRIP=1"
778 (let* ((versions (filter (lambda (name)
779 (not (string-prefix? "." name)))
781 (version (match versions
783 ;; There are symlinks to the build and source directory,
784 ;; both of which will point to target /tmp/guix-build*
785 ;; and thus not be useful in a profile. Delete the symlinks.
786 (false-if-file-not-found
787 (delete-file (string-append moddir "/" version "/build")))
788 (false-if-file-not-found
789 (delete-file (string-append moddir "/" version "/source"))))
792 (home-page "https://www.gnu.org/software/linux-libre/")
793 (synopsis "100% free redistribution of a cleaned Linux kernel")
795 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
796 It has been modified to remove all non-free binary blobs.")
797 (license license:gpl2)))
801 ;;; Generic kernel packages.
804 (define-public linux-libre-5.4
805 (make-linux-libre* linux-libre-5.4-version
806 linux-libre-5.4-source
807 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
808 #:configuration-file kernel-config))
810 (define-public linux-libre-version linux-libre-5.4-version)
811 (define-public linux-libre-pristine-source linux-libre-5.4-pristine-source)
812 (define-public linux-libre-source linux-libre-5.4-source)
813 (define-public linux-libre linux-libre-5.4)
815 (define-public linux-libre-4.19
816 (make-linux-libre* linux-libre-4.19-version
817 linux-libre-4.19-source
818 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
819 #:configuration-file kernel-config))
821 (define-public linux-libre-4.14
822 (make-linux-libre* linux-libre-4.14-version
823 linux-libre-4.14-source
824 '("x86_64-linux" "i686-linux" "armhf-linux")
825 #:configuration-file kernel-config))
827 (define-public linux-libre-4.9
828 (make-linux-libre* linux-libre-4.9-version
829 linux-libre-4.9-source
830 '("x86_64-linux" "i686-linux")
831 #:configuration-file kernel-config))
833 (define-public linux-libre-4.4
834 (make-linux-libre* linux-libre-4.4-version
835 linux-libre-4.4-source
836 '("x86_64-linux" "i686-linux")
837 #:configuration-file kernel-config
840 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
841 ;; This option was removed upstream in version 4.7.
842 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
843 %default-extra-linux-options)))
847 ;;; Specialized kernel variants.
850 (define-public linux-libre-arm-generic
851 (make-linux-libre* linux-libre-version
854 #:defconfig "multi_v7_defconfig"
855 #:extra-version "arm-generic"
858 `(;; needed to fix the RTC on rockchip platforms
859 ("CONFIG_RTC_DRV_RK808" . #t))
860 %default-extra-linux-options)))
862 (define-public linux-libre-arm-generic-5.6
863 (make-linux-libre* linux-libre-5.6-version
864 linux-libre-5.6-source
866 #:defconfig "multi_v7_defconfig"
867 #:extra-version "arm-generic"
870 `(;; needed to fix the RTC on rockchip platforms
871 ("CONFIG_RTC_DRV_RK808" . #t))
872 %default-extra-linux-options)))
874 (define-public linux-libre-arm-veyron
875 (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic))
877 (define-public linux-libre-arm-generic-4.19
878 (make-linux-libre* linux-libre-4.19-version
879 linux-libre-4.19-source
881 #:defconfig "multi_v7_defconfig"
882 #:extra-version "arm-generic"))
884 (define-public linux-libre-arm-generic-4.14
885 (make-linux-libre* linux-libre-4.14-version
886 linux-libre-4.14-source
888 #:defconfig "multi_v7_defconfig"
889 #:extra-version "arm-generic"))
891 (define-public linux-libre-arm-omap2plus
892 (make-linux-libre* linux-libre-version
895 #:defconfig "omap2plus_defconfig"
896 #:extra-version "arm-omap2plus"))
898 (define-public linux-libre-arm-omap2plus-4.19
899 (make-linux-libre* linux-libre-4.19-version
900 linux-libre-4.19-source
902 #:defconfig "omap2plus_defconfig"
903 #:extra-version "arm-omap2plus"))
905 (define-public linux-libre-arm-omap2plus-4.14
906 (make-linux-libre* linux-libre-4.14-version
907 linux-libre-4.14-source
909 #:defconfig "omap2plus_defconfig"
910 #:extra-version "arm-omap2plus"))
912 (define-public linux-libre-arm64-generic
913 (make-linux-libre* linux-libre-version
916 #:defconfig "defconfig"
917 #:extra-version "arm64-generic"
920 `(;; needed to fix the RTC on rockchip platforms
921 ("CONFIG_RTC_DRV_RK808" . #t))
922 %default-extra-linux-options)))
924 (define-public linux-libre-arm64-generic-5.6
925 (make-linux-libre* linux-libre-5.6-version
926 linux-libre-5.6-source
928 #:defconfig "defconfig"
929 #:extra-version "arm64-generic"
932 `(;; needed to fix the RTC on rockchip platforms
933 ("CONFIG_RTC_DRV_RK808" . #t))
934 %default-extra-linux-options)))
936 (define-public linux-libre-riscv64-generic
937 (make-linux-libre* linux-libre-version
940 #:extra-version "riscv64-generic"))
944 ;;; Linux kernel modules.
947 (define-public acpi-call-linux-module
948 (let ((commit "70b9c80bd700e6a4d10797eaac9fd34b7e8cbd4a")
951 (name "acpi-call-linux-module")
952 (version (git-version "3.17" revision commit))
957 (url "https://github.com/teleshoes/acpi_call.git")
959 (file-name (git-file-name name version))
961 (base32 "09c1vw6vcrkqxbwhpgfgpj4d1grzn4qq6ka8pwwzm7cvm405xj7x"))))
962 (build-system linux-module-build-system)
964 `(#:tests? #f ; no tests
966 (modify-phases %standard-phases
967 (add-after 'install 'install-documentation
968 (lambda* (#:key outputs #:allow-other-keys)
969 (let* ((out (assoc-ref outputs "out"))
970 (doc (string-append out "/share/doc/" ,name "-" ,version)))
971 (for-each (lambda (file)
972 (let ((target (string-append doc "/" file)))
973 (mkdir-p (dirname target))
974 (copy-recursively file target)))
975 (list "README.md" "examples"))
977 (home-page "https://github.com/teleshoes/acpi_call")
978 (synopsis "Linux kernel module to perform ACPI method calls")
980 "This simple Linux kernel module allows calls from user space to any
981 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
982 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
983 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
984 and @code{ACPI_BUFFER}.
986 It grants direct and undocumented access to your hardware that may cause damage
987 and should be used with caution, especially on untested models.")
988 (license license:gpl3+)))) ; see README.md (no licence headers)
990 (define-public rtl8812au-aircrack-ng-linux-module
991 (let ((commit "945d6ed6505c32f0993b1dba576388e92e78101b")
994 (name "rtl8812au-aircrack-ng-linux-module")
995 (version (git-version "5.6.4.2" revision commit))
1000 (url "https://github.com/aircrack-ng/rtl8812au.git")
1002 (file-name (git-file-name name version))
1004 (base32 "1pjws7qb5l4z9k80vgz4zdxmqhbwxjjrmkpf0hijf821byyddvi7"))
1005 (modules '((guix build utils)))
1008 ;; Remove bundled tarballs, APKs, word lists, speadsheets,
1009 ;; and other unnecessary unlicenced things.
1010 (for-each delete-file-recursively (list "android"
1014 (build-system linux-module-build-system)
1017 (modify-phases %standard-phases
1019 (lambda* (#:key inputs make-flags #:allow-other-keys)
1020 (apply invoke "make"
1021 (string-append "KSRC="
1022 (assoc-ref inputs "linux-module-builder")
1023 "/lib/modules/build")
1024 (or make-flags '())))))
1025 #:tests? #f)) ; no test suite
1026 (supported-systems '("x86_64-linux" "i686-linux"))
1027 (home-page "https://github.com/aircrack-ng/rtl8812au")
1028 (synopsis "Linux driver for Realtek USB wireless network adapters")
1030 "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
1031 network adapters, modified by the aircrack-ng project to support monitor mode
1032 and frame injection. It provides a @code{88XXau} kernel module that supports
1033 RTL8812AU, RTL8821AU, and RTL8814AU chips.")
1034 (license license:gpl2+))))
1036 (define-public rtl8821ce-linux-module
1037 (let ((commit "69765eb288a8dfad3b055b906760b53e02ab1dea")
1040 (name "rtl8821ce-linux-module")
1041 (version (git-version "0.0.0" revision commit))
1046 (url "https://github.com/tomaspinho/rtl8821ce.git")
1048 (file-name (git-file-name name version))
1051 "17jiw25k74kv5lnvgycvj2g1n06hbrpjz6p4znk4a62g136rhn4s"))))
1052 (build-system linux-module-build-system)
1055 (modify-phases %standard-phases
1057 (lambda* (#:key (make-flags '()) inputs #:allow-other-keys)
1060 (string-append "KSRC="
1061 (assoc-ref inputs "linux-module-builder")
1062 "/lib/modules/build")))))
1064 (home-page "https://github.com/tomaspinho/rtl8821ce")
1065 (synopsis "Linux driver for Realtek RTL8821CE wireless network adapters")
1066 (description "This is Realtek's RTL8821CE Linux driver for wireless
1068 (license license:gpl2))))
1070 (define-public vhba-module
1072 (name "vhba-module")
1073 (version "20200106")
1077 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
1078 version ".tar.bz2"))
1081 "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr"))))
1082 (build-system linux-module-build-system)
1086 (home-page "https://cdemu.sourceforge.io/")
1087 (synopsis "Kernel module that emulates SCSI devices")
1088 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
1089 between the CDemu userspace daemon and linux kernel.")
1090 (license license:gpl2+)))
1092 (define-public ddcci-driver-linux
1094 (name "ddcci-driver-linux")
1101 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
1102 (commit (string-append "v" version))))
1103 (file-name (git-file-name name version))
1106 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
1107 (build-system linux-module-build-system)
1109 `(#:tests? #f ; no tests
1111 (modify-phases %standard-phases
1116 (with-directory-excursion module
1117 (apply (assoc-ref %standard-phases 'build) args)))
1118 '("ddcci" "ddcci-backlight"))
1124 (with-directory-excursion module
1125 (apply (assoc-ref %standard-phases 'install) args)))
1126 '("ddcci" "ddcci-backlight"))
1128 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
1129 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
1130 (description "This package provides two Linux kernel drivers, ddcci and
1131 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
1132 interface. The ddcci module creates a character device for each DDC/CI
1133 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
1134 module allows the control of the backlight level or luminance property when
1135 supported under @file{/sys/class/backlight/}.")
1136 (license license:gpl2+)))
1138 (define-public v4l2loopback-linux-module
1140 (name "v4l2loopback-linux-module")
1145 (url "https://github.com/umlaeute/v4l2loopback.git")
1146 (commit (string-append "v" version))))
1147 (file-name (git-file-name name version))
1150 "1qi4l6yam8nrlmc3zwkrz9vph0xsj1cgmkqci4652mbpbzigg7vn"))))
1151 (build-system linux-module-build-system)
1154 (modify-phases %standard-phases
1158 "--directory=./tests"
1159 (string-append "CC=" ,(cc-for-target))))))))
1160 (home-page "https://github.com/umlaeute/v4l2loopback")
1161 (synopsis "Linux kernel module that allows you to create \"virtual video devices\"")
1162 (description "This module allows you to create \"virtual video devices\"
1163 normal (v4l2) applications will read these devices as if they were ordinary
1164 video devices, but the video will not be read from e.g. a capture card but
1165 instead it is generated by another application. this allows you for instance
1166 to apply some nifty video effects on your Jitsi video... it also allows some
1167 more serious things (e.g. using it to add streaming capabilities to an
1168 application by the means of hooking GStreamer into the loopback devices).")
1169 (license license:gpl2+)))
1173 ;;; Pluggable authentication modules (PAM).
1176 (define-public linux-pam
1184 "https://github.com/linux-pam/linux-pam/releases/download/v"
1185 version "/Linux-PAM-" version ".tar.xz"))
1188 "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
1189 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1191 (build-system gnu-build-system)
1195 ;; TODO: optional dependencies
1196 ;; ("libxcrypt" ,libxcrypt)
1197 ;; ("cracklib" ,cracklib)
1200 `(;; Most users, such as `shadow', expect the headers to be under
1202 #:configure-flags (list (string-append "--includedir="
1203 (assoc-ref %outputs "out")
1204 "/include/security")
1206 ;; XXX: <rpc/rpc.h> is missing from glibc when
1207 ;; cross-compiling, so we have to disable NIS
1208 ;; support altogether.
1209 ,@(if (%current-target-system)
1213 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1216 (home-page "http://www.linux-pam.org/")
1217 (synopsis "Pluggable authentication modules for Linux")
1219 "A *Free* project to implement OSF's RFC 86.0.
1220 Pluggable authentication modules are small shared object files that can
1221 be used through the PAM API to perform tasks, like authenticating a user
1222 at login. Local and dynamic reconfiguration are its key features.")
1223 (license license:bsd-3)))
1225 (define-public linux-pam-1.2
1233 "http://www.linux-pam.org/library/"
1234 "Linux-PAM-" version ".tar.bz2"))
1237 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1238 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1245 (define-public powerstat
1252 (uri (string-append "https://kernel.ubuntu.com/~cking/tarballs/"
1253 "powerstat/powerstat-" version ".tar.gz"))
1255 (base32 "0r355b9syqa2nhfy8ksvxyy5d58v0isf983842js091s6liy0x7g"))))
1256 (build-system gnu-build-system)
1259 (list (string-append "CC=" ,(cc-for-target))
1260 (string-append "prefix=" (assoc-ref %outputs "out")))
1261 #:tests? #f ; no test suite
1263 (modify-phases %standard-phases
1264 (add-after 'unpack 'respect-$prefix
1265 ;; https://bugs.launchpad.net/ubuntu/+source/powerstat/+bug/1877744
1267 (substitute* "Makefile"
1268 (("DIR=/usr/") "DIR=$(prefix)/"))
1270 (delete 'configure)))) ; no configure script
1271 (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
1272 (synopsis "Measure system power consumption")
1274 "Powerstat measures and reports your computer's power consumption in real
1275 time. On mobile PCs, it uses ACPI battery information to measure the power
1276 drain of the entire system.
1278 Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
1279 domain measurements. These are available only on some hardware such as Intel
1280 Sandybridge and newer, and cover only part of the machine's components such as
1281 CPU, DRAM, and graphics. However, they provide accurate and immediate readings
1282 and don't require a battery at all.
1284 The output is like @command{vmstat} but also shows power consumption statistics:
1285 at the end of a run, @command{powerstat} will calculate the average, standard
1286 deviation, and minimum and maximum values. It can show a nice histogram too.")
1287 (license license:gpl2)))
1289 (define-public psmisc
1296 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1299 (base32 "16i7qzjmm6g0lzha8yzpfrlcxnvkgh95hkq9gdjd4zmzb8d0wxa1"))))
1300 (build-system gnu-build-system)
1302 `(,@(if (%current-target-system)
1305 "ac_cv_func_malloc_0_nonnull=yes"
1306 "ac_cv_func_realloc_0_nonnull=yes"))
1308 (inputs `(("ncurses" ,ncurses)))
1309 (home-page "https://gitlab.com/psmisc/psmisc")
1310 (synopsis "Small utilities that use the proc file system")
1312 "This PSmisc package is a set of some small useful utilities that
1313 use the proc file system. We're not about changing the world, but
1314 providing the system administrator with some help in common tasks.")
1315 (license license:gpl2+)))
1317 (define-public util-linux
1323 (uri (string-append "mirror://kernel.org/linux/utils/"
1324 "util-linux/v" (version-major+minor version) "/"
1325 "util-linux-" version ".tar.xz"))
1328 "1yfpy6bkab4jw61mpx48gfy24yrqp4a7arvpis8csrkk53fkxpnr"))
1329 (patches (search-patches "util-linux-tests.patch"))
1330 (modules '((guix build utils)))
1332 ;; We take 'nologin' from Shadow, the 'logger' program from
1333 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1335 (substitute* "configure"
1336 (("build_nologin=yes") "build_nologin=no")
1337 (("build_logger=yes") "build_logger=no")
1338 (("build_kill=yes") "build_kill=no"))
1340 (build-system gnu-build-system)
1341 (outputs '("out" ;6.4 MiB executables and documentation
1342 "lib" ;8.8 MiB shared libraries, headers and locales
1343 "static")) ;2.9 MiB static .a libraries
1345 `(#:configure-flags (list "--disable-use-tty-group"
1346 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1347 ;; Don't try to chown root:root mount and umount
1348 "--disable-makeinstall-chown"
1349 "--localstatedir=/var"
1350 (string-append "--localedir="
1351 (assoc-ref %outputs "lib")
1353 ;; Install completions where our
1354 ;; bash-completion package expects them.
1355 (string-append "--with-bashcompletiondir="
1356 (assoc-ref %outputs "out")
1357 "/etc/bash_completion.d"))
1358 #:phases (modify-phases %standard-phases
1359 (add-before 'configure 'patch-build-scripts
1360 (lambda* (#:key outputs #:allow-other-keys)
1361 (substitute* "configure"
1362 ;; The build system assumes that we want to install
1363 ;; libraries below $exec_prefix when $libdir does not
1364 ;; match any of the "usual" locations. Fix that.
1365 (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
1366 "usrlib_execdir=$libdir"))
1368 (add-before 'build 'set-umount-file-name
1369 (lambda* (#:key outputs #:allow-other-keys)
1370 ;; Tell 'eject' the right file name of 'umount'.
1371 (let ((out (assoc-ref outputs "out")))
1372 (substitute* "sys-utils/eject.c"
1373 (("\"/bin/umount\"")
1374 (string-append "\"" out "/bin/umount\"")))
1376 (add-before 'check 'pre-check
1377 (lambda* (#:key inputs outputs #:allow-other-keys)
1378 (let ((out (assoc-ref outputs "out"))
1379 (net (assoc-ref inputs "net-base")))
1380 ;; Change the test to refer to the right file.
1381 (substitute* "tests/ts/misc/mcookie"
1383 (string-append net "/etc/services")))
1385 ;; The C.UTF-8 locale does not exist in our libc.
1386 (substitute* "tests/ts/column/invalid-multibyte"
1387 (("C\\.UTF-8") "en_US.utf8"))
1389 ;; TODO: Remove the conditional on the next rebuild cycle.
1390 ,@(if (string-prefix? "arm" (%current-system))
1391 '((add-before 'check 'disable-setarch-test
1393 ;; The setarch tests are unreliable in QEMU's
1394 ;; user-mode emulation, which is our primary
1395 ;; method of building ARMv7 packages.
1396 ;; <https://github.com/karelzak/util-linux/issues/601>
1397 (substitute* "tests/ts/misc/setarch"
1398 (("ts_init_subtest.*" all)
1401 "ts_skip \"setarch tests are unreliable under QEMU\"")))
1404 (add-after 'install 'move-static-libraries
1405 (lambda* (#:key outputs #:allow-other-keys)
1406 (let ((lib (assoc-ref outputs "lib"))
1407 (static (assoc-ref outputs "static")))
1409 ;; Move static libraries to the "static" output.
1410 (mkdir-p (string-append static "/lib"))
1411 (with-directory-excursion lib
1412 (for-each (lambda (file)
1414 (string-append static "/"
1416 (find-files "lib" "\\.a$"))
1418 ;; Remove references to the static library from the '.la'
1419 ;; files so that Libtool does the right thing when both
1420 ;; the shared and static library is available.
1421 (substitute* (find-files "lib" "\\.la$")
1422 (("old_library=.*") "old_library=''\n")))
1425 (add-after 'install 'adjust-pkg-config-files
1426 (lambda* (#:key outputs #:allow-other-keys)
1427 (let ((lib (assoc-ref outputs "lib")))
1428 ;; Drop the unused "prefix=" and "exec_prefix=" variables from
1429 ;; the pkg-config files to avoid a cyclic reference on "out".
1430 (substitute* (find-files (string-append lib "/lib/pkgconfig")
1432 (("^(exec_)?prefix=.*") "")))
1434 (inputs `(("zlib" ,zlib)
1435 ("ncurses" ,ncurses)
1437 ;; XXX: This is so that the 'pre-check' phase can find it.
1438 ,@(if (%current-target-system)
1439 `(("net-base" ,net-base))
1443 ("net-base" ,net-base))) ;for tests
1444 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1445 (synopsis "Collection of utilities for the Linux kernel")
1446 (description "Util-linux is a diverse collection of Linux kernel
1447 utilities. It provides dmesg and includes tools for working with file systems,
1448 block devices, UUIDs, TTYs, and many other tools.")
1450 ;; Note that util-linux doesn't use the same license for all the
1451 ;; code. GPLv2+ is the default license for a code without an
1452 ;; explicitly defined license.
1453 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1454 license:bsd-4 license:public-domain))))
1456 ;; util-linux optionally supports udev, which allows lsblk to read file system
1457 ;; metadata without special privileges. Add it as a separate package to avoid
1458 ;; a circular dependency, and to keep the size small.
1459 (define-public util-linux+udev
1462 (name "util-linux-with-udev")
1465 ,@(package-inputs util-linux)))))
1467 (define-public ddate
1473 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
1475 (file-name (string-append name "-" version ".tar.gz"))
1477 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
1478 (build-system cmake-build-system)
1479 (arguments '(#:tests? #f))
1480 (home-page "https://github.com/bo0ts/ddate")
1481 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1483 "ddate displays the Discordian date and holidays of a given date.
1484 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1485 by Robert Shea and Robert Anton Wilson.")
1486 (license license:public-domain)))
1488 (define-public fbset
1495 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
1498 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
1499 (build-system gnu-build-system)
1501 '(#:modules ((guix build gnu-build-system)
1505 (modify-phases %standard-phases
1506 (delete 'configure) ; no configure script
1507 (add-before 'install 'pre-install
1508 (lambda* (#:key outputs #:allow-other-keys)
1509 (let ((out (assoc-ref outputs "out")))
1510 (substitute* "Makefile"
1511 (("mknod ") "true ")
1512 ;; The Makefile doesn't honour PREFIX or similar.
1515 (with-directory-excursion out
1516 (for-each mkdir-p (list "sbin"
1520 (add-after 'install 'install-fb.modes
1521 (lambda* (#:key outputs #:allow-other-keys)
1522 (let* ((out (assoc-ref outputs "out"))
1523 (etc (string-append out "/etc")))
1524 (for-each (cut install-file <> etc)
1525 (find-files "etc" "^fb\\.modes"))
1526 (symlink "fb.modes.ATI"
1527 (string-append etc "/fb.modes"))
1529 ;; Parallel building races to create modes.tab.c.
1530 #:parallel-build? #f
1531 #:tests? #f)) ; no test suite
1535 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
1536 (synopsis "Show and modify Linux frame buffer settings")
1538 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
1539 different kinds of graphic displays. The @command{fbset} utility can query and
1540 change various device settings such as depth, virtual resolution, and timing
1542 (license license:gpl2)))
1544 (define-public procps
1550 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1551 "procps-ng-" version ".tar.xz"))
1554 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
1555 (build-system gnu-build-system)
1557 `(#:modules ((guix build utils)
1558 (guix build gnu-build-system)
1561 ,@(if (%current-target-system)
1564 "ac_cv_func_malloc_0_nonnull=yes"
1565 "ac_cv_func_realloc_0_nonnull=yes"))
1568 (modify-phases %standard-phases
1570 'install 'post-install
1571 ;; Remove commands and man pages redudant with
1573 (lambda* (#:key outputs #:allow-other-keys)
1574 (let* ((out (assoc-ref outputs "out"))
1575 (dup (append-map (cut find-files out <>)
1576 '("^kill" "^uptime"))))
1577 (for-each delete-file dup)
1579 (inputs `(("ncurses" ,ncurses)))
1580 (home-page "https://gitlab.com/procps-ng/procps/")
1581 (synopsis "Utilities that give information about processes")
1583 "Procps is the package that has a bunch of small useful utilities
1584 that give information about processes using the Linux /proc file system.
1585 The package includes the programs ps, top, vmstat, w, kill, free,
1586 slabtop, and skill.")
1587 (license license:gpl2)))
1589 (define-public usbutils
1596 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1597 "usbutils-" version ".tar.xz"))
1599 (base32 "0iiy0q7fzikavmdsjsb0sl9kp3gfh701qwyjjccvqh0qz4jlcqw8"))))
1600 (build-system gnu-build-system)
1601 (outputs (list "out" "python"))
1604 (modify-phases %standard-phases
1605 (add-before 'bootstrap 'patch-bootstrap-scripts
1607 (substitute* "usbhid-dump/bootstrap"
1608 (("/bin/bash") (which "bash")))
1610 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1611 (substitute* "autogen.sh"
1612 (("^\\./configure.*") ""))
1614 (add-after 'install 'separate-python-output
1615 ;; Separating one Python script shaves more than 106 MiB from :out.
1616 (lambda* (#:key outputs #:allow-other-keys)
1617 (let ((out (assoc-ref outputs "out"))
1618 (out:python (assoc-ref outputs "python")))
1619 (for-each (lambda (file)
1620 (let ((old (string-append out "/" file))
1621 (new (string-append out:python "/" file)))
1622 (mkdir-p (dirname new))
1623 (rename-file old new)))
1624 (list "bin/lsusb.py"))
1629 ("python" ,python)))
1631 `(("autoconf" ,autoconf)
1632 ("automake" ,automake)
1633 ("libtool" ,libtool)
1634 ("pkg-config" ,pkg-config)))
1635 (home-page "http://www.linux-usb.org/")
1637 "Tools for working with USB devices, such as lsusb")
1639 "Tools for working with USB devices, such as lsusb.")
1640 (license license:gpl2+)))
1642 (define-public e2fsprogs
1649 "mirror://kernel.org/linux/kernel/people/tytso/"
1650 "e2fsprogs/v" version "/"
1651 "e2fsprogs-" version ".tar.xz"))
1654 "0mj2yizwygs7xww8jfy5mxjn8ww4pvc0b1hg1p2vsnirailsx9zz"))))
1655 (build-system gnu-build-system)
1656 (inputs `(("util-linux" ,util-linux "lib")))
1657 (native-inputs `(("pkg-config" ,pkg-config)
1658 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1662 ("procps" ,procps)))
1664 '(;; util-linux is the preferred source for some of the libraries and
1665 ;; commands, so disable them (see, e.g.,
1666 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1667 #:configure-flags (list "--disable-libblkid"
1668 "--disable-libuuid" "--disable-uuidd"
1671 ;; Use symlinks instead of hard links for
1672 ;; 'fsck.extN' etc. This makes the resulting nar
1673 ;; smaller and is preserved across copies.
1674 "--enable-symlink-install"
1676 (string-append "LDFLAGS=-Wl,-rpath="
1677 (assoc-ref %outputs "out")
1680 ;; Install libext2fs et al.
1681 "--enable-elf-shlibs")
1684 (modify-phases %standard-phases
1685 (add-before 'configure 'patch-shells
1687 (substitute* "configure"
1688 (("/bin/sh (.*)parse-types.sh" _ dir)
1689 (string-append (which "sh") " " dir
1691 (substitute* "MCONFIG.in"
1692 (("INSTALL_SYMLINK = /bin/sh")
1693 "INSTALL_SYMLINK = sh"))
1694 (substitute* (find-files "." "^Makefile.in$")
1696 (string-append "#!" (which "sh"))))
1698 (add-after 'install 'install-libs
1699 (lambda* (#:key outputs #:allow-other-keys)
1700 (let* ((out (assoc-ref outputs "out"))
1701 (lib (string-append out "/lib")))
1702 (invoke "make" "install-libs")
1704 ;; Make the .a writable so that 'strip' works.
1705 ;; Failing to do that, due to debug symbols, we
1706 ;; retain a reference to the final
1707 ;; linux-libre-headers, which refer to the
1708 ;; bootstrap binaries.
1709 (let ((archives (find-files lib "\\.a$")))
1710 (for-each (lambda (file)
1714 (home-page "http://e2fsprogs.sourceforge.net/")
1715 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
1717 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
1718 (license (list license:gpl2 ;programs
1719 license:lgpl2.0 ;libext2fs
1720 license:x11)))) ;libuuid
1722 (define e2fsprogs/static
1724 (package (inherit e2fsprogs)
1726 ;; Do not build shared libraries.
1727 (substitute-keyword-arguments (package-arguments e2fsprogs)
1728 ((#:configure-flags _)
1729 '(list "--disable-blkid"))
1733 (define-public e2fsck/static
1735 (name "e2fsck-static")
1736 (version (package-version e2fsprogs))
1737 (build-system trivial-build-system)
1740 `(("e2fsprogs" ,e2fsprogs/static)))
1742 `(#:modules ((guix build utils))
1745 (use-modules (guix build utils)
1749 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
1751 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
1753 (with-directory-excursion bin
1754 (copy-file e2fsck "e2fsck")
1755 (remove-store-references "e2fsck")
1756 (chmod "e2fsck" #o555))
1758 (home-page (package-home-page e2fsprogs))
1759 (synopsis "Statically-linked e2fsck command from e2fsprogs")
1760 (description "This package provides statically-linked e2fsck command taken
1761 from the e2fsprogs package. It is meant to be used in initrds.")
1762 (license (package-license e2fsprogs))))
1764 (define-public extundelete
1766 (name "extundelete")
1771 (uri (string-append "mirror://sourceforge/extundelete/"
1772 "extundelete/" version "/extundelete-"
1773 version ".tar.bz2"))
1776 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
1777 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
1778 (build-system gnu-build-system)
1779 (inputs `(("e2fsprogs" ,e2fsprogs)))
1780 (home-page "http://extundelete.sourceforge.net/")
1781 (synopsis "Recover deleted files from ext2/3/4 partitions")
1783 "Extundelete is a set of tools that can recover deleted files from an
1784 ext3 or ext4 partition.")
1785 (license license:gpl2)))
1787 (define-public zerofree
1791 (home-page "https://frippery.org/uml/")
1794 (uri (string-append home-page name "-" version
1798 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1799 (build-system gnu-build-system)
1802 (modify-phases %standard-phases
1803 (delete 'configure) ; no configure script
1805 ;; The Makefile lacks an ‘install’ target.
1806 (lambda* (#:key outputs #:allow-other-keys)
1807 (let* ((out (assoc-ref outputs "out"))
1808 (bin (string-append out "/bin")))
1809 (chmod "zerofree" #o555)
1810 (install-file "zerofree" bin)
1812 #:tests? #f)) ; no tests
1813 (inputs `(("libext2fs" ,e2fsprogs)))
1814 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
1816 "Zerofree finds the unallocated blocks with non-zero value content in an
1817 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
1818 This is a simple way to make disk images more compressible.
1819 Zerofree requires the file system to be unmounted or mounted read-only.")
1820 (license license:gpl2)))
1822 (define-public strace
1826 (home-page "https://strace.io")
1829 (uri (string-append home-page "/files/" version
1830 "/strace-" version ".tar.xz"))
1833 "1n6cfz3i2krkyvxpdp3kmxhf7sy5xp0danzaiirbk5fdkfgvb15j"))))
1834 (build-system gnu-build-system)
1837 (modify-phases %standard-phases
1838 (add-after 'unpack 'patch-/bin/sh
1840 (substitute* "strace.c"
1841 (("/bin/sh") (which "sh")))
1843 (add-after 'unpack 'disable-failing-tests
1845 ;; XXX These hang forever even if the test time-out is extended.
1846 (substitute* "tests/Makefile.in"
1847 (("^\tstrace-DD?D?\\.test \\\\.*") ""))
1849 ;; Don't fail if the architecture doesn't support different personalities.
1850 #:configure-flags '("--enable-mpers=check")
1851 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
1852 #:parallel-tests? #f)) ; undeterministic failures
1853 (native-inputs `(("perl" ,perl)))
1854 (synopsis "System call tracer for Linux")
1856 "strace is a system call tracer, i.e. a debugging tool which prints out a
1857 trace of all the system calls made by a another process/program.")
1858 (license license:lgpl2.1+)))
1860 (define-public ltrace
1866 (uri (string-append "http://www.ltrace.org/ltrace_" version
1870 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
1871 (build-system gnu-build-system)
1872 (inputs `(("libelf" ,libelf)))
1874 ;; Compilation uses -Werror by default, but it fails.
1875 '(#:configure-flags '("--disable-werror")))
1876 (home-page "https://www.ltrace.org/")
1877 (synopsis "Library call tracer for Linux")
1879 "ltrace intercepts and records dynamic library calls which are called by
1880 an executed process and the signals received by that process. It can also
1881 intercept and print the system calls executed by the program.")
1882 (license license:gpl2+)))
1884 (define-public alsa-lib
1891 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
1892 version ".tar.bz2"))
1895 "1v5kb8jyvrpkvvq7dq8hfbmcj68lml97i4s0prxpfx2mh3c57s6q"))))
1896 (build-system gnu-build-system)
1898 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
1899 (assoc-ref %outputs "out")
1901 (home-page "https://www.alsa-project.org/")
1902 (synopsis "The Advanced Linux Sound Architecture libraries")
1904 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1905 MIDI functionality to the Linux-based operating system.")
1906 (license license:lgpl2.1+)))
1908 (define-public alsa-utils
1914 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
1915 name "-" version ".tar.bz2"))
1918 "1wz460by17rmxrcydn583rd4lhj6wlvqs6x1j5pdzxn5g3app024"))))
1919 (build-system gnu-build-system)
1921 ;; XXX: Disable man page creation until we have DocBook.
1922 '(#:configure-flags (list "--disable-xmlto"
1924 ;; The udev rule is responsible for restoring
1926 (string-append "--with-udev-rules-dir="
1927 (assoc-ref %outputs "out")
1928 "/lib/udev/rules.d"))
1930 (modify-phases %standard-phases
1931 (add-before 'check 'disable-broken-test
1933 ;; XXX: The 1.1.8 release tarball is missing a header that's
1934 ;; required for this test to work. Fixed in 1.1.9.
1935 (substitute* "axfer/test/Makefile"
1936 ((".*container-test.*") ""))
1939 'install 'pre-install
1941 ;; Don't try to mkdir /var/lib/alsa.
1942 (substitute* "Makefile"
1943 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
1947 `(("gettext" ,gettext-minimal)))
1949 `(("libsamplerate" ,libsamplerate)
1950 ("ncurses" ,ncurses)
1951 ("alsa-lib" ,alsa-lib)
1953 (home-page "http://www.alsa-project.org/")
1954 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
1956 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1957 MIDI functionality to the Linux-based operating system.")
1959 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
1961 (license license:gpl2)))
1963 (define-public alsa-plugins
1965 (name "alsa-plugins")
1969 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1970 name "-" version ".tar.bz2"))
1973 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
1974 (build-system gnu-build-system)
1975 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1976 ;; be split, there are references to both in files.
1977 ;; TODO: Remove OSS related plugins, they add support to run native
1978 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1980 (outputs '("out" "pulseaudio" "jack"))
1982 `(#:configure-flags '(;; Do not install a "local" configuration targeted
1983 ;; for /etc/alsa. On Guix System plugins are loaded from
1984 ;; the ALSA service, and other distributions likely
1985 ;; won't use these files.
1986 "--with-alsalconfdir=/tmp/noop")
1988 (modify-phases %standard-phases
1989 (add-after 'install 'split
1990 (lambda* (#:key inputs outputs #:allow-other-keys)
1991 ;; Distribute the binaries to the various outputs.
1992 (let* ((out (assoc-ref outputs "out"))
1993 (jack (assoc-ref outputs "jack"))
1994 (jacklib (string-append jack "/lib/alsa-lib"))
1995 (pua (assoc-ref outputs "pulseaudio"))
1996 (pualib (string-append pua "/lib/alsa-lib")))
1999 (for-each (lambda (file)
2000 (rename-file file (string-append jacklib "/" (basename file))))
2001 (find-files out ".*jack\\.(la|so)"))
2004 (for-each (lambda (file)
2005 (rename-file file (string-append pualib "/" (basename file))))
2006 (find-files out ".*pulse\\.(la|so)"))
2009 `(("alsa-lib" ,alsa-lib)
2011 ("speex" ,speex) ; libspeexdsp resampling plugin
2012 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
2013 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
2014 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
2016 `(("pkg-config" ,pkg-config)))
2017 (home-page "http://www.alsa-project.org/")
2018 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
2020 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2021 MIDI functionality to the Linux-based operating system. This package enhances ALSA
2022 by providing additional plugins which include: upmixing, downmixing, jackd and
2023 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
2024 external rate conversion.")
2025 (license (list license:gpl2+
2026 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
2027 license:lgpl2.1+))))
2029 (define-public iptables
2036 "mirror://netfilter.org/iptables/iptables-"
2037 version ".tar.bz2"))
2040 "0z0mgs1ghvn3slc868mgbf2g26njgrzcy5ggyb5w4i55j1a3lflr"))))
2041 (build-system gnu-build-system)
2043 `(("pkg-config" ,pkg-config)
2047 `(("libmnl" ,libmnl)
2048 ("libnftnl" ,libnftnl)))
2050 '(#:tests? #f ; no test suite
2051 #:configure-flags ; add $libdir to the RUNPATH of executables
2052 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
2053 (home-page "https://www.netfilter.org/projects/iptables/index.html")
2054 (synopsis "Programs to configure Linux IP packet filtering rules")
2056 "@command{iptables} is the user-space command line program used to
2057 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
2058 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
2060 This package also includes @command{ip6tables}, which is used to configure the
2063 Both commands are targeted at system administrators.")
2064 (license license:gpl2+)))
2066 (define-public lsscsi
2073 "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
2076 "1ry2y34xmpgxdbfbyvs8cjmbx0fn222yjdab87wj21q60nab5p75"))))
2077 (build-system gnu-build-system)
2078 (synopsis "Lists information about SCSI or NVMe devices in Linux")
2079 (home-page "http://sg.danny.cz/scsi/lsscsi.html")
2081 "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
2082 also list NVMe namespaces or controllers and show the relationship between a
2083 device's primary node name, its SCSI generic (sg) node name and its kernel
2085 (license license:gpl2)))
2087 (define-public ebtables
2094 "mirror://netfilter.org/ebtables/ebtables-"
2098 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
2099 (build-system gnu-build-system)
2102 ("iptables" ,iptables)))
2103 (synopsis "Ethernet bridge frame table administration")
2104 (home-page "https://ebtables.netfilter.org/")
2106 "ebtables is an application program used to set up and maintain the
2107 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
2108 analogous to the iptables application, but less complicated, due to the fact
2109 that the Ethernet protocol is much simpler than the IP protocol.")
2110 (license license:gpl2+)))
2112 (define-public iproute
2119 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
2123 "088gs56iqhdlpw1iqjwrss4zxd4zbl2wl8s2implrrdajjxcfpbj"))))
2124 (build-system gnu-build-system)
2126 `( ;; There is a test suite, but it wants network namespaces and sudo.
2128 #:make-flags (let ((out (assoc-ref %outputs "out")))
2130 (string-append "BASH_COMPDIR=" out
2131 "/etc/bash_completion.d")
2132 (string-append "LIBDIR=" out "/lib")
2133 (string-append "HDRDIR=" out "/include")
2134 (string-append "SBINDIR=" out "/sbin")
2135 (string-append "CONFDIR=" out "/etc")
2136 (string-append "DOCDIR=" out "/share/doc/"
2138 (string-append "MANDIR=" out "/share/man")))
2139 #:phases (modify-phases %standard-phases
2140 (add-before 'install 'pre-install
2142 ;; Don't attempt to create /var/lib/arpd.
2143 (substitute* "Makefile"
2144 (("^.*ARPDDIR.*$") ""))
2148 ("iptables" ,iptables)
2149 ("libmnl" ,libmnl)))
2153 ("pkg-config" ,pkg-config)))
2155 ;; ("libmnl" ,libmnl)
2156 ;; ("util-linux" ,util-linux)
2158 "https://wiki.linuxfoundation.org/networking/iproute2")
2160 "Utilities for controlling TCP/IP networking and traffic in Linux")
2162 "Iproute2 is a collection of utilities for controlling TCP/IP networking
2163 and traffic with the Linux kernel. The most important of these are
2164 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
2167 Most network configuration manuals still refer to ifconfig and route as the
2168 primary network configuration tools, but ifconfig is known to behave
2169 inadequately in modern network environments, and both should be deprecated.")
2170 (license license:gpl2+)))
2172 (define-public net-tools
2173 ;; XXX: This package is basically unmaintained, but it provides a few
2174 ;; commands not yet provided by Inetutils, such as 'route', so we have to
2176 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
2180 (version (string-append "1.60-" revision "." (string-take commit 7)))
2183 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
2184 "n/ne/net-tools/code.git/net-tools-code-"
2186 (file-name (string-append name "-" version ".zip"))
2189 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
2190 (home-page "http://net-tools.sourceforge.net/")
2191 (build-system gnu-build-system)
2193 `(#:modules ((guix build gnu-build-system)
2198 (modify-phases %standard-phases
2200 (lambda* (#:key outputs #:allow-other-keys)
2201 (let ((out (assoc-ref outputs "out")))
2202 (mkdir-p (string-append out "/bin"))
2203 (mkdir-p (string-append out "/sbin"))
2205 ;; Pretend we have everything...
2206 (system "yes | make config")
2208 ;; ... except for the things we don't have.
2209 ;; HAVE_AFDECnet requires libdnet, which we don't have.
2210 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
2211 ;; that have been removed.
2212 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
2213 ;; think about adding them later.
2214 (substitute* '("config.make" "config.h")
2215 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
2218 (add-after 'install 'remove-redundant-commands
2219 (lambda* (#:key outputs #:allow-other-keys)
2220 ;; Remove commands and man pages redundant with Inetutils.
2221 (let* ((out (assoc-ref outputs "out"))
2222 (dup (append-map (cut find-files out <>)
2224 "^(yp|nis|dns)?domainname"))))
2225 (for-each delete-file dup)
2227 ;; Binaries that depend on libnet-tools.a don't declare that
2228 ;; dependency, making it parallel-unsafe.
2229 #:parallel-build? #f
2231 #:tests? #f ; no test suite
2232 #:make-flags (let ((out (assoc-ref %outputs "out")))
2233 (list ,(string-append "CC=" (cc-for-target))
2234 (string-append "BASEDIR=" out)
2235 (string-append "INSTALLNLSDIR=" out "/share/locale")
2236 (string-append "mandir=/share/man")))))
2237 (native-inputs `(("gettext" ,gettext-minimal)
2239 (supported-systems (delete "i586-gnu" %supported-systems))
2240 (synopsis "Tools for controlling the network subsystem in Linux")
2242 "This package includes the important tools for controlling the network
2243 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
2244 route. Additionally, this package contains utilities relating to particular
2245 network hardware types (plipconfig, slattach) and advanced aspects of IP
2246 configuration (iptunnel, ipmaddr).")
2247 (license license:gpl2+))))
2249 (define-public libcap
2256 "mirror://kernel.org/linux/libs/security/linux-privs/"
2257 "libcap2/libcap-" version ".tar.xz"))
2260 "0ikwm0kngrqa4ci80lqnrkk17kg09q7dxrz28y0gm5qw3vj8s266"))))
2261 (build-system gnu-build-system)
2262 (arguments '(#:phases
2263 (modify-phases %standard-phases
2265 ;; Add $libdir to the RUNPATH of executables.
2267 (substitute* "Make.Rules"
2269 (string-append "LDFLAGS := -Wl,-rpath="
2272 #:test-target "test"
2273 #:make-flags (list "lib=lib"
2274 (string-append "prefix="
2275 (assoc-ref %outputs "out"))
2276 "RAISE_SETFCAP=no")))
2277 (native-inputs `(("perl" ,perl)))
2278 (supported-systems (delete "i586-gnu" %supported-systems))
2279 (home-page "https://sites.google.com/site/fullycapable/")
2280 (synopsis "Library for working with POSIX capabilities")
2282 "Libcap2 provides a programming interface to POSIX capabilities on
2283 Linux-based operating systems.")
2285 ;; License is BSD-3 or GPLv2, at the user's choice.
2286 (license license:gpl2)))
2288 ;; libcap 2.31 causes problems for 'fakeroot', so provide this newer variant.
2289 ;; To be merged with libcap on the next rebuild cycle.
2290 (define-public libcap/next
2297 "mirror://kernel.org/linux/libs/security/linux-privs/"
2298 "libcap2/libcap-" version ".tar.xz"))
2301 "048n1gy2p48vl9hkrr9wymfxxcpwj2aslz2bv79nhl4m2lhd9kdf"))))))
2303 (define-public bridge-utils
2305 (name "bridge-utils")
2310 (uri (string-append "mirror://kernel.org/linux/utils/net/bridge-utils/"
2311 "bridge-utils-" version ".tar.xz"))
2313 (base32 "1j16kr44csyr4yqxly26l1yw2bh4nkiasgwvask2i2gvsnsyyryc"))))
2314 (build-system gnu-build-system)
2316 ;; The tarball lacks all the generated files.
2317 (native-inputs `(("autoconf" ,autoconf)
2318 ("automake" ,automake)))
2321 (modify-phases %standard-phases
2322 (add-before 'bootstrap 'patch-stuff
2324 ;; Fix "field ‘ip6’ has incomplete type" errors.
2325 (substitute* "libbridge/libbridge.h"
2326 (("#include <linux/if_bridge.h>")
2327 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
2329 ;; Ensure that the entire build fails if one of the
2330 ;; sub-Makefiles fails.
2331 (substitute* "Makefile.in"
2332 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
2333 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
2336 #:tests? #f)) ; no 'check' target
2338 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
2339 (synopsis "Manipulate Ethernet bridges")
2341 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2342 to connect two Ethernet segments together in a protocol independent way.
2343 Packets are forwarded based on Ethernet address, rather than IP address (like
2344 a router). Since forwarding is done at Layer 2, all protocols can go
2345 transparently through a bridge.")
2346 (license license:gpl2+)))
2348 (define-public libnl
2355 "https://github.com/thom311/libnl/releases/download/"
2356 "libnl" (string-join (string-split version #\.) "_")
2357 "/libnl-" version ".tar.gz"))
2360 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2361 (build-system gnu-build-system)
2365 ("pkg-config" ,pkg-config)
2371 "https://github.com/thom311/libnl/releases/download/libnl"
2372 (string-join (string-split version #\.) "_")
2373 "/libnl-doc-" version ".tar.gz"))
2375 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2376 (outputs `("out" "doc"))
2379 (modify-phases %standard-phases
2380 (add-after 'install 'install-doc
2381 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
2382 (let ((dest (string-append (assoc-ref outputs "doc")
2383 "/share/doc/libnl")))
2385 (invoke "tar" "xf" (assoc-ref
2386 (or native-inputs inputs)
2388 "--strip-components=1" "-C" dest)))))))
2389 (home-page "https://www.infradead.org/~tgr/libnl/")
2390 (synopsis "NetLink protocol library suite")
2392 "The libnl suite is a collection of libraries providing APIs to netlink
2393 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
2394 between the kernel and user space processes. It was designed to be a more
2395 flexible successor to ioctl to provide mainly networking related kernel
2396 configuration and monitoring interfaces.")
2398 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2399 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2400 (license license:gpl2)))
2402 ;; libnl python extensions used to be outputs of libnl. However, as
2403 ;; cross-compiling python extensions is currently broken, create separate
2404 ;; packages for libnl python extensions.
2405 (define (libnl-python-package python)
2406 (let ((name (string-append "libnl-" python)))
2411 ((string=? python "python2")
2412 `(("python-2" ,python-2)))
2413 ((string=? python "python3")
2414 `(("python-3" ,python-3))))))
2415 (propagated-inputs `(("libnl" ,libnl)))
2418 `(#:modules ((guix build gnu-build-system)
2422 (modify-phases %standard-phases
2424 (lambda* (#:key inputs outputs #:allow-other-keys)
2425 (define (python-inst python)
2426 (invoke python "setup.py" "build")
2427 (invoke python "setup.py" "install"
2428 (string-append "--prefix="
2429 (assoc-ref %outputs "out")))
2430 (invoke python "setup.py" "clean"))
2431 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2432 (assoc-ref inputs "libnl")))
2433 (with-directory-excursion "./python" (python-inst ,python))
2436 (define-public libnl-python2 (libnl-python-package "python2"))
2437 (define-public libnl-python3 (libnl-python-package "python3"))
2446 "mirror://kernel.org/software/network/iw/iw-"
2450 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2451 (build-system gnu-build-system)
2452 (native-inputs `(("pkg-config" ,pkg-config)))
2453 (inputs `(("libnl" ,libnl)))
2456 (let* ((target ,(%current-target-system))
2457 (pkg-config (if target
2458 (string-append target "-pkg-config")
2461 ,(string-append "CC=" (cc-for-target))
2462 (string-append "PKG_CONFIG="
2463 (assoc-ref %build-inputs "pkg-config")
2465 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
2466 #:phases (modify-phases %standard-phases (delete 'configure))))
2467 (home-page "https://wireless.wiki.kernel.org/")
2468 (synopsis "Tool for configuring wireless devices")
2470 "iw is a new nl80211 based CLI configuration utility for wireless
2471 devices. It replaces @code{iwconfig}, which is deprecated.")
2472 (license license:isc)))
2474 (define-public powertop
2481 (uri (string-append "https://01.org/sites/default/files/downloads/"
2482 "powertop-" version ".tar.gz"))
2484 (base32 "1kiiwa5p2r7h1lzcf53xq61ckaa4wk565s9fs6vw4bfk84y3mfsw"))))
2485 (build-system gnu-build-system)
2488 (modify-phases %standard-phases
2489 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2490 ;; allow calibrating the network interface in Guix System.
2491 (add-after 'unpack 'patch-absolute-file-names
2492 (lambda* (#:key inputs #:allow-other-keys)
2493 (let ((kmod (assoc-ref inputs "kmod")))
2494 (substitute* (find-files "src" "\\.cpp$")
2495 ;; Give the right 'modprobe' file name so that essential
2496 ;; modules such as msr.ko can be loaded.
2497 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2498 ;; These programs are only needed to calibrate, so using
2499 ;; relative file names avoids adding extra inputs. When they
2500 ;; are missing powertop gracefully handles it.
2501 (("/usr/bin/hcitool") "hcitool")
2502 (("/usr/bin/xset") "xset")
2503 (("/usr/sbin/hciconfig") "hciconfig"))
2508 ("ncurses" ,ncurses)
2509 ("pciutils" ,pciutils)
2512 `(("pkg-config" ,pkg-config)))
2513 (home-page "https://01.org/powertop/")
2514 (synopsis "Analyze power consumption on Intel-based laptops")
2516 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2517 power management. In addition to being a diagnostic tool, PowerTOP also has
2518 an interactive mode where the user can experiment various power management
2519 settings for cases where the operating system has not enabled these
2521 (license license:gpl2)))
2523 (define-public aumix
2530 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2531 version ".tar.bz2"))
2534 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2535 (build-system gnu-build-system)
2536 (inputs `(("ncurses" ,ncurses)))
2537 (home-page "http://www.jpj.net/~trevor/aumix.html")
2538 (synopsis "Audio mixer for X and the console")
2540 "Aumix adjusts an audio mixer from X, the console, a terminal,
2541 the command line or a script.")
2542 (license license:gpl2+)))
2544 (define-public iotop
2551 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2554 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2555 (build-system python-build-system)
2558 (modify-phases %standard-phases
2559 (add-after 'unpack 'fix-build-with-python3
2561 (substitute* "setup.py"
2562 (("itervalues") "values"))
2564 ;; There are currently no checks in the package.
2566 (native-inputs `(("python" ,python)))
2567 (home-page "http://guichaz.free.fr/iotop/")
2569 "Displays the IO activity of running processes")
2571 "Iotop is a Python program with a top like user interface to show the
2572 processes currently causing I/O.")
2573 (license license:gpl2+)))
2581 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2582 "download/fuse-" version
2583 "/fuse-" version ".tar.gz"))
2586 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
2587 (patches (search-patches "fuse-overlapping-headers.patch"))))
2588 (build-system gnu-build-system)
2589 (inputs `(("util-linux" ,util-linux)))
2591 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2592 (assoc-ref %outputs "out")
2594 (string-append "INIT_D_PATH="
2595 (assoc-ref %outputs "out")
2598 ;; The rule makes /dev/fuse 666.
2599 (string-append "UDEV_RULES_PATH="
2600 (assoc-ref %outputs "out")
2601 "/lib/udev/rules.d"))
2603 (modify-phases %standard-phases
2604 (add-before 'build 'set-file-names
2605 (lambda* (#:key inputs #:allow-other-keys)
2606 ;; libfuse calls out to mount(8) and umount(8). Make sure
2607 ;; it refers to the right ones.
2608 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2609 (("/bin/(u?)mount" _ maybe-u)
2610 (string-append (assoc-ref inputs "util-linux")
2611 "/bin/" maybe-u "mount")))
2612 (substitute* '("util/mount.fuse.c")
2616 ;; This hack leads libfuse to search for 'fusermount' in
2617 ;; $PATH, where it may find a setuid-root binary, instead of
2618 ;; trying solely $out/sbin/fusermount and failing because
2620 (substitute* "lib/Makefile"
2621 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2622 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2624 (supported-systems (delete "i586-gnu" %supported-systems))
2625 (home-page "https://github.com/libfuse/libfuse")
2626 (synopsis "Support file systems implemented in user space")
2628 "As a consequence of its monolithic design, file system code for Linux
2629 normally goes into the kernel itself---which is not only a robustness issue,
2630 but also an impediment to system extensibility. FUSE, for \"file systems in
2631 user space\", is a kernel module and user-space library that tries to address
2632 part of this problem by allowing users to run file system implementations as
2633 user-space processes.")
2634 (license (list license:lgpl2.1 ;library
2635 license:gpl2+)))) ;command-line utilities
2637 (define-public unionfs-fuse
2639 (name "unionfs-fuse")
2644 (url "https://github.com/rpodgorny/unionfs-fuse")
2645 (commit (string-append "v" version))))
2646 (file-name (git-file-name name version))
2649 "0lb8zgdxnjy2fjr2284hvdfn7inc1in44ynzgcr66x54bxzvynj6"))))
2650 (build-system cmake-build-system)
2652 `(("python" ,python)))
2653 (inputs `(("fuse" ,fuse)))
2655 ;; The tests were never actually run ("collected 0 items"), but in recent
2656 ;; versions of pytest that causes an error.
2658 (home-page "https://github.com/rpodgorny/unionfs-fuse")
2659 (synopsis "User-space union file system")
2661 "UnionFS-FUSE is a flexible union file system implementation in user
2662 space, using the FUSE library. Mounting a union file system allows you to
2663 \"aggregate\" the contents of several directories into a single mount point.
2664 UnionFS-FUSE additionally supports copy-on-write.")
2665 (license license:bsd-3)))
2668 (package (inherit fuse)
2669 (name "fuse-static")
2670 (source (origin (inherit (package-source fuse))
2671 (modules '((guix build utils)))
2674 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
2675 ;; updated. Change calls to 'mtab_needs_update' to 0 so
2676 ;; that it doesn't do that, allowing us to remove the
2677 ;; dependency on util-linux (something that is useful in
2679 (substitute* '("lib/mount_util.c"
2680 "util/mount_util.c")
2681 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
2687 (define-public unionfs-fuse/static
2688 (package (inherit unionfs-fuse)
2689 (synopsis "User-space union file system (statically linked)")
2690 (name (string-append (package-name unionfs-fuse) "-static"))
2691 (source (origin (inherit (package-source unionfs-fuse))
2692 (modules '((guix build utils)))
2695 ;; Add -ldl to the libraries, because libfuse.a needs that.
2696 (substitute* "src/CMakeLists.txt"
2697 (("target_link_libraries(.*)\\)" _ libs)
2698 (string-append "target_link_libraries"
2703 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
2705 (modify-phases %standard-phases
2706 (add-after 'install 'post-install
2707 (lambda* (#:key outputs #:allow-other-keys)
2708 (let* ((out (assoc-ref outputs "out"))
2709 (exe (string-append out "/bin/unionfs")))
2710 ;; By default, 'unionfs' keeps references to
2711 ;; $glibc/share/locale and similar stuff. Remove them.
2712 (remove-store-references exe)
2714 ;; 'unionfsctl' has references to glibc as well. Since
2715 ;; we don't need it, remove it.
2716 (delete-file (string-append out "/bin/unionfsctl"))
2718 (inputs `(("fuse" ,fuse-static)))))
2720 (define-public sshfs
2726 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
2727 "download/sshfs-" version "/sshfs-" version
2731 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
2732 (build-system gnu-build-system)
2737 `(("pkg-config" ,pkg-config)))
2738 (home-page "https://github.com/libfuse/sshfs")
2739 (synopsis "Mount remote file systems over SSH")
2741 "This is a file system client based on the SSH File Transfer Protocol.
2742 Since most SSH servers already support this protocol it is very easy to set
2743 up: on the server side there's nothing to do; on the client side mounting the
2744 file system is as easy as logging into the server with an SSH client.")
2745 (license license:gpl2+)))
2747 (define-public sshfs-fuse
2748 (package (inherit sshfs)
2750 (properties `((superseded . ,sshfs)))))
2752 (define-public archivemount
2754 (name "archivemount")
2759 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
2760 "archivemount-" version ".tar.gz"))
2762 (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
2763 (build-system gnu-build-system)
2764 (inputs `(("fuse" ,fuse)
2765 ("libarchive" ,libarchive)))
2766 (native-inputs `(("pkg-config" ,pkg-config)))
2767 (home-page "https://www.cybernoia.de/software/archivemount.html")
2768 (synopsis "Tool for mounting archive files with FUSE")
2769 (description "archivemount is a FUSE-based file system for Unix variants,
2770 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
2771 mount point where it can be read from or written to as with any other file
2772 system. This makes accessing the contents of the archive, which may be
2773 compressed, transparent to other programs, without decompressing them.")
2774 (license license:lgpl2.0+)))
2776 (define-public numactl
2783 "https://github.com/numactl/numactl/releases/download/v"
2784 version "/numactl-" version ".tar.gz"))
2787 "16lcypvcmx1ydkpi2s82kqhg13kak7qhpbnj8hd9bdbyhr5ja7lr"))))
2788 (build-system gnu-build-system)
2790 '(;; There's a 'test' target, but it requires NUMA support in the kernel
2791 ;; to run, which we can't assume to have.
2794 ;; NUMA is apparently not supported on armhf, see
2795 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
2796 (supported-systems (delete "armhf-linux" %supported-systems))
2797 (home-page "https://github.com/numactl/numactl")
2798 (synopsis "Tools for non-uniform memory access (NUMA) machines")
2800 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
2801 memory is not all in one place. The @command{numactl} program allows you to
2802 run your application program on specific CPUs and memory nodes. It does this
2803 by supplying a NUMA memory policy to the operating system before running your
2806 The package contains other commands, such as @command{numastat},
2807 @command{memhog}, and @command{numademo} which provides a quick overview of
2808 NUMA performance on your system.")
2809 (license (list license:gpl2 ;programs
2810 license:lgpl2.1)))) ;library
2812 (define-public kbd-neo
2819 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
2820 version "/linux/console/neo.map"))
2821 (file-name (string-append name "-" version ".map"))
2824 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
2825 (build-system trivial-build-system)
2827 `(#:modules ((guix build utils))
2829 (use-modules (guix build utils))
2830 (let ((out (string-append %output "/share/keymaps"))
2831 (source (assoc-ref %build-inputs "source")))
2833 (copy-file source (string-append out "/neo.map"))
2835 (home-page "https://neo-layout.org")
2836 (synopsis "Neo2 console layout")
2838 "Kbd-neo provides the Neo2 keyboard layout for use with
2839 @command{loadkeys(1)} from @code{kbd(4)}.")
2840 ;; The file is located in an svn directory, the entire content of
2841 ;; the directory is licensed as GPL3.
2842 (license license:gpl3+)))
2850 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
2854 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
2855 (modules '((guix build utils)))
2858 (substitute* "tests/Makefile.in"
2859 ;; The '%: %.in' rule incorrectly uses @VERSION@.
2862 (substitute* '("src/unicode_start" "src/unicode_stop")
2863 ;; Assume the Coreutils are in $PATH.
2867 (build-system gnu-build-system)
2870 (modify-phases %standard-phases
2871 (add-before 'build 'pre-build
2872 (lambda* (#:key inputs #:allow-other-keys)
2873 (let ((gzip (assoc-ref %build-inputs "gzip"))
2874 (bzip2 (assoc-ref %build-inputs "bzip2")))
2875 (substitute* "src/libkeymap/findfile.c"
2877 (string-append gzip "/bin/gzip"))
2879 (string-append bzip2 "/bin/bzip2")))
2881 (add-after 'install 'post-install
2882 (lambda* (#:key outputs #:allow-other-keys)
2883 ;; Make sure these programs find their comrades.
2884 (let* ((out (assoc-ref outputs "out"))
2885 (bin (string-append out "/bin")))
2886 (for-each (lambda (prog)
2887 (wrap-program (string-append bin "/" prog)
2888 `("PATH" ":" prefix (,bin))))
2889 '("unicode_start" "unicode_stop"))
2891 (inputs `(("check" ,check)
2894 ("pam" ,linux-pam)))
2895 (native-search-paths
2896 (list (search-path-specification
2897 (variable "LOADKEYS_KEYMAP_PATH")
2898 ;; Append ‘/**’ to recursively search all directories. One can then
2899 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
2900 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
2901 (files (list "share/keymaps/**")))))
2902 (native-inputs `(("pkg-config" ,pkg-config)))
2903 (home-page "http://kbd-project.org/")
2904 (synopsis "Linux keyboard utilities and keyboard maps")
2906 "This package contains keytable files and keyboard utilities compatible
2907 for systems using the Linux kernel. This includes commands such as
2908 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
2909 (license license:gpl2+)))
2911 (define-public loadkeys-static
2914 (name "loadkeys-static")
2916 (substitute-keyword-arguments (package-arguments kbd)
2917 ((#:configure-flags flags ''())
2918 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
2919 "--disable-vlock" ;so we don't need libpam
2920 "--disable-libkeymap")
2922 ((#:make-flags flags ''())
2923 `(cons "LDFLAGS=-all-static" ,flags))
2924 ((#:phases phases '%standard-phases)
2925 `(modify-phases ,phases
2927 (lambda* (#:key outputs #:allow-other-keys)
2928 (let ((out (assoc-ref outputs "out")))
2929 ;; The binary keeps references to gzip, among other things,
2930 ;; which we don't need in the initrd, so strip references.
2931 (remove-store-references "src/loadkeys")
2933 (install-file "src/loadkeys"
2934 (string-append out "/bin"))
2936 (delete 'post-install)))
2937 ((#:strip-flags _ '())
2939 ((#:allowed-references _ '())
2942 (synopsis "Statically-linked @command{loadkeys} program")
2944 ;; This package is meant to be used internally in the initrd so don't
2946 (properties '((hidden? . #t)))))
2948 (define-public inotify-tools
2950 (name "inotify-tools")
2955 (url "https://github.com/rvoicilas/inotify-tools.git")
2957 (file-name (git-file-name name version))
2960 "14dci1i4mhsd5sa33k8h3ayphk19kizynh5ql9ryibdpmcanfiyq"))))
2961 (build-system gnu-build-system)
2963 `(("autoconf" ,autoconf)
2964 ("automake" ,automake)
2965 ("libtool" ,libtool)))
2966 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
2967 (synopsis "Monitor file accesses")
2969 "The inotify-tools packages provides a C library and command-line tools
2970 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
2971 (license license:gpl2+)))
2980 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
2981 "kmod-" version ".tar.xz"))
2984 "17dvrls70nr3b3x1wm8pwbqy4r8a5c20m0dhys8mjhsnpg425fsp"))
2985 (patches (search-patches "kmod-module-directory.patch"))))
2986 (build-system gnu-build-system)
2988 `(("pkg-config" ,pkg-config)))
2993 `(#:tests? #f ; FIXME: Investigate test failures
2994 #:configure-flags '("--with-xz" "--with-zlib")
2996 (modify-phases %standard-phases
2997 (add-after 'install 'install-modprobe&co
2998 (lambda* (#:key outputs #:allow-other-keys)
2999 (let* ((out (assoc-ref outputs "out"))
3000 (bin (string-append out "/bin")))
3001 (for-each (lambda (tool)
3003 (string-append bin "/" tool)))
3004 '("insmod" "rmmod" "lsmod" "modprobe"
3005 "modinfo" "depmod"))
3007 (supported-systems (delete "i586-gnu" %supported-systems))
3008 (home-page "https://www.kernel.org/")
3009 (synopsis "Kernel module tools")
3010 (description "Kmod is a set of tools to handle common tasks with Linux
3011 kernel modules like insert, remove, list, check properties, resolve
3012 dependencies and aliases.
3014 These tools are designed on top of libkmod, a library that is shipped with
3015 kmod. The aim is to be compatible with tools, configurations and indices
3016 from the module-init-tools project.")
3017 (license license:gpl2+))) ; library under lgpl2.1+
3019 (define-public earlyoom
3026 (url "https://github.com/rfjakob/earlyoom.git")
3027 (commit (string-append "v" version))))
3028 (file-name (git-file-name name version))
3031 "06sd3jpkdrwqbphsf8jrgs5rxfi7j3xjmygjjvj4xjk4gncz7r2i"))))
3032 (build-system gnu-build-system)
3034 `(#:phases (modify-phases %standard-phases
3036 (add-before 'check 'set-home
3038 (setenv "HOME" (getcwd))
3040 (add-after 'build 'install-contribs
3041 ;; Install what seems useful from the contrib directory.
3042 (lambda* (#:key outputs #:allow-other-keys)
3043 (let* ((out (assoc-ref outputs "out"))
3044 (contrib (string-append
3045 out "/share/earlyoom/contrib")))
3046 (install-file "contrib/notify_all_users.py" contrib)
3048 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
3049 (list ,(string-append "CC=" (cc-for-target))
3050 (string-append "VERSION=v" ,version)
3051 (string-append "PREFIX=" prefix)
3052 (string-append "SYSCONFDIR=" prefix "/etc")))
3053 #:test-target "test"))
3054 (native-inputs `(("go" ,go) ;for the test suite
3055 ("pandoc" ,ghc-pandoc))) ;to generate the manpage
3056 (home-page "https://github.com/rfjakob/earlyoom")
3057 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
3058 (description "Early OOM is a minimalist out of memory (OOM) daemon that
3059 runs in user space and provides a more responsive and configurable alternative
3060 to the in-kernel OOM killer.")
3061 (license license:expat)))
3063 (define-public eudev
3064 ;; The post-systemd fork, maintained by Gentoo.
3070 (uri (git-reference (url "https://github.com/gentoo/eudev")
3071 (commit (string-append "v" version))))
3072 (file-name (git-file-name name version))
3075 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
3076 (patches (search-patches "eudev-rules-directory.patch"))))
3077 (build-system gnu-build-system)
3080 (modify-phases %standard-phases
3081 (add-after 'unpack 'make-source-writable
3083 ;; XXX: Git checkouts are read-only, but this package needs to
3084 ;; modify some of its files.
3085 (for-each make-file-writable (find-files "."))
3087 (add-before 'bootstrap 'patch-file-names
3088 (lambda* (#:key inputs native-inputs #:allow-other-keys)
3089 (substitute* "man/make.sh"
3090 (("/usr/bin/xsltproc")
3091 (string-append (assoc-ref
3092 (or native-inputs inputs) "xsltproc")
3095 (add-before 'configure 'patch-bindir-in-btrfs-rules
3096 (lambda* (#:key outputs #:allow-other-keys)
3097 ;; The "@bindir@" substitution incorrectly expands to a literal
3098 ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work
3100 (let ((out (assoc-ref outputs "out")))
3101 (substitute* "rules/64-btrfs.rules.in"
3103 (string-append out "/bin")))
3105 (add-after 'install 'move-static-library
3106 (lambda* (#:key outputs #:allow-other-keys)
3107 (let* ((out (assoc-ref outputs "out"))
3108 (static (assoc-ref outputs "static"))
3109 (source (string-append out "/lib/libudev.a"))
3110 (target (string-append static "/lib/libudev.a")))
3111 (mkdir-p (dirname target))
3112 (link source target)
3113 (delete-file source)
3114 ;; Remove reference to the static library from the .la file
3115 ;; such that Libtool looks for it in the usual places.
3116 (substitute* (string-append out "/lib/libudev.la")
3118 "old_library=''\n"))
3120 (add-after 'install 'build-hwdb
3121 (lambda* (#:key outputs #:allow-other-keys)
3122 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
3123 ;; similar tools to display product names.
3125 ;; XXX: This can't be done when cross-compiling. Find another way
3126 ;; to generate hwdb.bin for cross-built systems.
3127 (let ((out (assoc-ref outputs "out")))
3128 ,@(if (%current-target-system)
3130 '((invoke (string-append out "/bin/udevadm")
3131 "hwdb" "--update")))))))
3132 #:configure-flags (list "--enable-manpages")))
3134 `(("autoconf" ,autoconf)
3135 ("automake" ,automake)
3137 ("libtool" ,libtool)
3138 ("pkg-config" ,pkg-config)
3141 ("python" ,python-wrapper)
3142 ;; For documentation.
3143 ("docbook-xml" ,docbook-xml-4.2)
3144 ("docbook-xsl" ,docbook-xsl)
3145 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3146 ("xsltproc" ,libxslt)))
3148 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
3149 ;; and similar; it also installs the '60-persistent-storage.rules' file,
3150 ;; which contains the rules to do that.
3151 `(("util-linux" ,util-linux "lib") ;for blkid
3153 (outputs '("out" "static"))
3154 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
3155 (synopsis "Userspace device management")
3156 (description "Udev is a daemon which dynamically creates and removes
3157 device nodes from /dev/, handles hotplug events and loads drivers at boot
3159 (license license:gpl2+)))
3161 (define-public python-evdev
3163 (name "python-evdev")
3168 (uri (pypi-uri "evdev" version))
3170 (base32 "0kb3636yaw9l8xi8s184w0r0n9ic5dw3b8hx048jf9fpzss4kimi"))))
3171 (build-system python-build-system)
3173 `(("kernel-headers" ,linux-libre-headers)))
3175 `(#:tests? #f ;no rule for tests
3177 (modify-phases %standard-phases
3178 (add-before 'build 'fix-hard-coded-directory
3179 (lambda* (#:key inputs #:allow-other-keys)
3180 (substitute* "setup.py"
3181 (("/usr/include/linux")
3183 (assoc-ref inputs "kernel-headers") "/include/linux")))
3185 (home-page "https://github.com/gvalkov/python-evdev")
3186 (synopsis "Bindings to the Linux input handling subsystem")
3188 "Python-evdev provides bindings to the generic input event interface in
3189 Linux. The @code{evdev} interface serves the purpose of passing events
3190 generated in the kernel directly to userspace through character devices that
3191 are typically located in @file{/dev/input/}.
3193 This package also comes with bindings to @code{uinput}, the userspace input
3194 subsystem. @code{uinput} allows userspace programs to create and handle input
3195 devices that can inject events directly into the input subsystem.")
3196 (license license:bsd-3)))
3204 (uri (list (string-append "ftp://sourceware.org/pub/lvm2/LVM2."
3206 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
3210 "0xdr9qbqw6kja267wmx6ajnfv1nhw056gpxx9v2qmfh3bj6qnfn0"))
3211 (modules '((guix build utils)))
3214 (use-modules (guix build utils))
3216 ;; Honor sysconfdir.
3217 (substitute* "make.tmpl.in"
3219 "confdir = @sysconfdir@\n")
3220 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
3221 "DEFAULT_SYS_DIR = @sysconfdir@"))
3223 (patches (search-patches "lvm2-static-link.patch"))))
3224 (build-system gnu-build-system)
3226 `(("pkg-config" ,pkg-config)
3227 ("procps" ,procps))) ;tests use 'pgrep'
3229 `(("libaio" ,libaio)
3233 (modify-phases %standard-phases
3234 (add-after 'configure 'set-makefile-shell
3236 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
3238 (setenv "SHELL" (which "sh"))
3240 ;; Replace /bin/sh with the right file name.
3241 (patch-makefile-SHELL "make.tmpl")
3244 #:configure-flags (list (string-append "--sysconfdir="
3245 (assoc-ref %outputs "out")
3247 "--enable-udev_sync"
3248 "--enable-udev_rules"
3249 "--enable-pkgconfig"
3251 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
3253 ;; Make sure programs such as 'dmsetup' can
3254 ;; find libdevmapper.so.
3255 (string-append "LDFLAGS=-Wl,-rpath="
3256 (assoc-ref %outputs "out")
3258 (assoc-ref %outputs "out")
3259 "/lib/device-mapper")
3260 ;; This is needed when cross-compiling.
3261 ,@(if (%current-target-system)
3262 '("ac_cv_func_malloc_0_nonnull=yes"
3263 "ac_cv_func_realloc_0_nonnull=yes")
3266 ;; The tests use 'mknod', which requires root access.
3268 (supported-systems (delete "i586-gnu" %supported-systems))
3269 (home-page "https://sourceware.org/lvm2/")
3270 (synopsis "Logical volume management for Linux")
3272 "LVM2 is the logical volume management tool set for Linux-based systems.
3273 This package includes the user-space libraries and tools, including the device
3274 mapper. Kernel components are part of Linux-libre.")
3276 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
3277 ;; Command-line tools are GPLv2.
3278 (license (list license:gpl2 license:lgpl2.1))))
3280 (define-public lvm2-static
3283 (name "lvm2-static")
3285 ;; Propagate udev because libdevmapper.a depends on libudev.
3286 (propagated-inputs `(("udev:static" ,eudev "static")))
3289 (substitute-keyword-arguments (package-arguments lvm2)
3290 ((#:configure-flags flags '())
3291 ;; LVM2 doesn't use Libtool, hence the custom option.
3292 `(append '("--enable-static_link")
3293 ;; Building dmeventd statically is complicated due to a
3294 ;; requirement on libdevmapper.a, which is being phased out
3295 ;; in favor of libdevice-mapper.a, which in turn is is not
3296 ;; easily made available at dmeventd build time. Just ignore
3297 ;; it until the situation improves.
3298 (delete "--enable-dmeventd" ,flags)))
3300 `(modify-phases ,phases
3301 (add-before 'configure 'adjust-Makefile
3303 ;; These fixes are related to the upstream libdm->device_mapper
3304 ;; migration and will hopefully be fixed upstream in due time.
3305 (substitute* "tools/Makefile.in"
3306 ;; This variable is empty in a static configuration and causes
3307 ;; an erroneous GCC command line.
3308 (("-L\\$\\(interfacebuilddir\\)") "")
3309 ;; Remove obsolete reference to libdevmapper.a.
3310 (("-ldevmapper") ""))
3312 (synopsis "Logical volume management for Linux (statically linked)")))
3314 (define-public wireless-tools
3316 (name "wireless-tools")
3320 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
3324 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
3327 ;; Remove the older header files that are not free software.
3328 (for-each (lambda (n)
3329 (delete-file (format #f "wireless.~a.h" n)))
3330 '(10 11 12 13 14 15 16 17 18 19 20))
3332 (build-system gnu-build-system)
3335 (list (string-append "PREFIX=" %output)
3336 (string-append "INSTALL_MAN=" %output "/share/man")
3337 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
3340 (modify-phases %standard-phases
3342 (lambda* (#:key target #:allow-other-keys)
3343 (when ,(%current-target-system)
3344 ;; Cross-compilation: use the cross tools.
3345 (substitute* (find-files "." "Makefile")
3347 (string-append "CC = " target "-gcc\n"))
3349 (string-append "AR = " target "-ar\n"))
3351 (string-append "RANLIB = " target "-ranlib\n"))))
3354 (synopsis "Tools for manipulating Linux Wireless Extensions")
3355 (description "Wireless Tools are used to manipulate the now-deprecated
3356 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
3357 Extension was an interface allowing you to set Wireless LAN specific
3358 parameters and get the specific stats. It is deprecated in favor the nl80211
3360 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
3361 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
3362 ;; other files are distributed under gpl2.
3363 (license (list license:gpl2 license:lgpl2.1+))))
3371 (uri (string-append "mirror://kernel.org/software/network/crda/"
3372 "crda-" version ".tar.xz"))
3375 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
3376 (patches (search-patches "crda-optional-gcrypt.patch"))))
3377 (build-system gnu-build-system)
3379 `(#:phases (modify-phases %standard-phases
3381 (add-after 'unpack 'gzip-determinism
3383 (substitute* "Makefile"
3384 (("gzip") "gzip --no-name"))
3386 ,@(if (%current-target-system)
3388 'unpack 'fix-pkg-config
3389 (lambda* (#:key target #:allow-other-keys)
3393 (string-append target "-pkg-config")))
3397 'build 'no-werror-no-ldconfig
3399 (substitute* "Makefile"
3401 (("ldconfig") "true"))
3404 'build 'set-regulator-db-file-name
3405 (lambda* (#:key native-inputs inputs #:allow-other-keys)
3406 ;; Tell CRDA where to find our database.
3407 (let ((regdb (assoc-ref (or native-inputs inputs)
3409 (substitute* "crda.c"
3410 (("\"/lib/crda/regulatory.bin\"")
3411 (string-append "\"" regdb
3412 "/lib/crda/regulatory.bin\"")))
3414 #:test-target "verify"
3415 #:make-flags (let ((out (assoc-ref %outputs "out"))
3416 (regdb (assoc-ref %build-inputs "wireless-regdb")))
3418 (string-append "CC=" ,(cc-for-target))
3421 ;; Disable signature-checking on 'regulatory.bin'.
3422 ;; The reason is that this simplifies maintenance
3423 ;; on our side (no need to manage a distro key
3424 ;; pair), and we can guarantee integrity of
3425 ;; 'regulatory.bin' by other means anyway, such as
3426 ;; 'guix gc --verify'. See
3427 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
3431 (string-append "PREFIX=" out)
3432 (string-append "SBINDIR=" out "/sbin/")
3433 (string-append "UDEV_RULE_DIR="
3434 out "/lib/udev/rules.d")
3435 (string-append "LDFLAGS=-Wl,-rpath="
3437 (string-append "REG_BIN=" regdb
3438 "/lib/crda/regulatory.bin")
3440 (native-inputs `(("pkg-config" ,pkg-config)
3441 ("wireless-regdb" ,wireless-regdb)))
3442 (inputs `(("libnl" ,libnl)))
3444 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
3445 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
3447 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
3448 communication between the kernel Linux and user space for regulatory
3450 (license license:copyleft-next)))
3452 (define-public wireless-regdb
3454 (name "wireless-regdb")
3455 (version "2019.06.03")
3459 "mirror://kernel.org/software/network/wireless-regdb/"
3460 "wireless-regdb-" version ".tar.xz"))
3463 "1gslvh0aqdkv48jyr2ddq153mw28i7qz2ybrjj9qvkk3dgc7x4fd"))
3465 ;; We're building 'regulatory.bin' by ourselves.
3467 (delete-file "regulatory.bin")
3469 (build-system gnu-build-system)
3472 (modify-phases %standard-phases
3473 (add-after 'unpack 'gzip-determinism
3475 (substitute* "Makefile"
3476 (("gzip") "gzip --no-name"))
3478 (add-after 'unpack 'omit-signature
3480 (substitute* "Makefile"
3481 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
3482 ;; don't provide (see below). Disable it.
3483 ((" regulatory\\.db\\.p7s") "")
3484 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
3485 ;; but ‘make install’ depends only on the latter while installing
3486 ;; both (and failing). Depend on it explicitly.
3487 (("^install: " all) (string-append all "regulatory.db ")))
3489 (delete 'configure)) ; no configure script
3491 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
3492 ;; is computed and can be equal to 'maintainer-clean'; when that
3493 ;; happens, we can end up deleting the 'regulatory.bin' file that we
3494 ;; just built. Thus, build things sequentially.
3495 #:parallel-build? #f
3497 #:tests? #f ; no tests
3499 (let ((out (assoc-ref %outputs "out")))
3500 (list (string-append "PREFIX=" out)
3501 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
3503 ;; Leave this empty so that db2bin.py doesn't try to sign
3504 ;; ‘regulatory.bin’. This allows us to avoid managing a key
3505 ;; pair for the whole distribution.
3506 (string-append "REGDB_PRIVKEY=")
3507 ;; Don't generate a public key for the same reason. These are
3508 ;; used as Makefile targets and can't be the empty string.
3509 (string-append "REGDB_PUBCERT=/dev/null")
3510 (string-append "REGDB_PUBKEY=/dev/null")))))
3512 `(("python" ,python-wrapper)))
3514 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
3515 (synopsis "Wireless regulatory database")
3517 "This package contains the wireless regulatory database Central
3518 Regulatory Database Agent (CRDA) daemon. The database contains information on
3519 country-specific regulations for the wireless spectrum.")
3520 (license license:isc)))
3522 (define-public lm-sensors
3530 (url "https://github.com/groeck/lm-sensors.git")
3531 (commit (string-append "V" (string-join
3532 (string-split version #\.) "-")))))
3533 (file-name (git-file-name name version))
3535 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
3536 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
3537 (build-system gnu-build-system)
3538 (inputs `(("rrdtool" ,rrdtool)
3541 ("gnuplot" ,gnuplot)))
3542 (native-inputs `(("pkg-config" ,pkg-config)
3546 (outputs '("lib" ; avoid perl in closure
3549 `(#:tests? #f ; no 'check' target
3550 #:make-flags (list (string-append "PREFIX=" %output)
3551 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
3552 (string-append "INCLUDEDIR="
3553 (assoc-ref %outputs "lib") "/include")
3554 (string-append "MANDIR=" %output "/share/man")
3555 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
3557 (modify-phases %standard-phases
3559 (add-before 'build 'patch-exec-paths
3560 (lambda* (#:key inputs outputs #:allow-other-keys)
3561 (substitute* "prog/detect/sensors-detect"
3563 (string-append "`" (assoc-ref inputs "coreutils")
3565 (("(`|\")modprobe" all open-quote)
3566 (string-append open-quote
3567 (assoc-ref inputs "kmod")
3569 (substitute* '("prog/pwm/pwmconfig"
3570 "prog/pwm/fancontrol")
3572 (string-append (assoc-ref inputs "gnuplot")
3575 (string-append (assoc-ref inputs "coreutils")
3578 (string-append (assoc-ref inputs "grep")
3581 (string-append (assoc-ref inputs "sed")
3584 (string-append (assoc-ref inputs "coreutils")
3587 (string-append (assoc-ref inputs "coreutils")
3590 (string-append (assoc-ref inputs "coreutils")
3591 "/bin/readlink -f")))
3593 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
3594 (synopsis "Utilities to read temperature/voltage/fan sensors")
3596 "Lm-sensors is a hardware health monitoring package for Linux. It allows
3597 you to access information from temperature, voltage, and fan speed sensors.
3598 It works with most newer systems.")
3599 (license license:gpl2+)))
3601 (define-public iucode-tool
3603 (name "iucode-tool")
3607 (uri (string-append "https://gitlab.com/iucode-tool/releases"
3608 "/raw/latest/iucode-tool_" version ".tar.xz"))
3611 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
3612 (build-system gnu-build-system)
3613 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
3614 (synopsis "Manipulate Intel microcode bundles")
3616 "@command{iucode_tool} is a utility to work with microcode packages for
3617 Intel processors. It can convert between formats, extract specific versions,
3618 create a firmware image suitable for the Linux kernel, and more.")
3619 ;; cpuid.h is available for i686, x86_64, and ia64.
3620 (supported-systems '("i686-linux" "x86_64-linux"))
3621 (license license:gpl2+)))
3623 (define-public i2c-tools
3630 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
3631 version ".tar.bz2"))
3634 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
3635 (build-system gnu-build-system)
3637 `(#:tests? #f ; no 'check' target
3638 #:make-flags (list (string-append "prefix=" %output)
3639 ,(string-append "CC=" (cc-for-target)))
3640 ;; No configure script.
3641 #:phases (modify-phases %standard-phases (delete 'configure))))
3644 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
3645 (synopsis "I2C tools for Linux")
3647 "The i2c-tools package contains a heterogeneous set of I2C tools for
3648 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
3649 EEPROM decoding scripts, EEPROM programming tools, and a python module for
3651 (license license:gpl2+)))
3653 (define-public xsensors
3660 "http://www.linuxhardware.org/xsensors/xsensors-"
3664 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
3665 (build-system gnu-build-system)
3666 (inputs `(("lm-sensors" ,lm-sensors "lib")
3668 (native-inputs `(("pkg-config" ,pkg-config)))
3671 (modify-phases %standard-phases
3672 (add-before 'configure 'enable-deprecated
3674 (substitute* "src/Makefile.in"
3675 (("-DGDK_DISABLE_DEPRECATED") "")
3676 (("-DGTK_DISABLE_DEPRECATED") ""))
3678 (add-before 'configure 'remove-Werror
3680 (substitute* '("configure" "src/Makefile.in")
3683 (home-page "http://www.linuxhardware.org/xsensors/")
3684 (synopsis "Hardware health information viewer")
3686 "Xsensors reads data from the libsensors library regarding hardware
3687 health such as temperature, voltage and fan speed and displays the information
3688 in a digital read-out.")
3689 (license license:gpl2+)))
3694 (version (package-version linux-libre))
3695 (source (package-source linux-libre))
3696 (build-system gnu-build-system)
3699 (modify-phases %standard-phases
3701 (lambda* (#:key inputs #:allow-other-keys)
3702 (setenv "SHELL_PATH" (which "bash"))
3703 (chdir "tools/perf")
3705 #:make-flags (list (string-append "prefix="
3706 (assoc-ref %outputs "out"))
3707 ;; Make sure the kernel headers are treated as system
3708 ;; headers to suppress warnings from those.
3709 (string-append "C_INCLUDE_PATH="
3710 (assoc-ref %build-inputs "kernel-headers")
3714 ;; By default, 'config/Makefile' uses lib64 on
3715 ;; x86_64. Work around that.
3717 #:tests? #f)) ;no tests
3719 `(("pkg-config" ,pkg-config)
3723 ;; There are build scripts written in these languages.
3725 ("python" ,python-2)))
3727 `(("slang" ,slang) ;for the interactive TUI
3729 ("python" ,python-2) ;'perf' links against libpython
3730 ("elfutils" ,elfutils)
3731 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
3732 ("libunwind" ,libunwind) ;better stack walking
3733 ("numactl" ,numactl) ;for 'perf bench numa mem'
3736 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3737 ("docbook-xsl" ,docbook-xsl)
3739 ("asciidoc" ,asciidoc)))
3740 (home-page "https://perf.wiki.kernel.org/")
3741 (synopsis "Linux profiling with performance counters")
3743 "perf is a tool suite for profiling using hardware performance counters,
3744 with support in the Linux kernel. perf can instrument CPU performance
3745 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3746 of lightweight profiling. This package contains the user-land tools and in
3747 particular the @code{perf} command.")
3748 (license (package-license linux-libre))))
3750 (define-public pflask
3756 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
3758 (file-name (string-append name "-" version ".tar.gz"))
3761 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
3762 (build-system cmake-build-system)
3764 '(#:tests? #f)) ; no tests
3765 (home-page "https://ghedo.github.io/pflask/")
3766 (synopsis "Simple tool for creating Linux namespace containers")
3767 (description "pflask is a simple tool for creating Linux namespace
3768 containers. It can be used for running a command or even booting an OS inside
3769 an isolated container, created with the help of Linux namespaces. It is
3770 similar in functionality to chroot, although pflask provides better isolation
3771 thanks to the use of namespaces.")
3772 (license license:bsd-2)))
3774 (define-public singularity
3776 (name "singularity")
3780 (uri (string-append "https://github.com/singularityware/singularity/"
3781 "releases/download/" version
3782 "/singularity-" version ".tar.gz"))
3785 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
3786 (modules '((guix build utils)))
3789 ;; Do not create directories in /var.
3790 (substitute* "Makefile.in"
3791 (("\\$\\(MAKE\\) .*install-data-hook") ""))
3793 ;; The original source overrides PATH so that it points to
3794 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
3795 ;; on Guix System. Leave PATH unchanged so we refer to the
3796 ;; installed Coreutils, grep, etc.
3797 (substitute* "bin/singularity.in"
3799 (string-append "#" all "\n")))
3801 (substitute* (find-files "libexec/cli" "\\.exec$")
3802 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
3804 (string-append "/run/setuid-programs/singularity-"
3805 program "-helper")))
3807 ;; These squashfs mount options are apparently no longer
3808 ;; supported since Linux-libre 5.4.5.
3809 (substitute* "src/lib/image/squashfs/mount.c"
3810 (("\"errors=remount-ro\"")
3813 (build-system gnu-build-system)
3815 `(#:configure-flags '("--localstatedir=/var")
3817 (modify-phases %standard-phases
3818 (add-after 'unpack 'patch-reference-to-squashfs-tools
3820 (substitute* "libexec/cli/build.exec"
3821 (("if ! singularity_which mksquashfs") "if 0")
3822 (("if ! mksquashfs")
3823 (string-append "if ! " (which "mksquashfs"))))
3825 (add-after 'install 'set-PATH
3826 (lambda* (#:key inputs outputs #:allow-other-keys)
3827 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
3828 (let ((out (assoc-ref outputs "out"))
3829 (coreutils (assoc-ref inputs "coreutils")))
3830 (wrap-program (string-append out "/bin/singularity")
3831 `("PATH" ":" = (,(string-append coreutils "/bin"))))
3832 (substitute* (string-append out "/bin/run-singularity")
3833 (("/usr/bin/env singularity")
3834 (string-append (which "env") " "
3835 out "/bin/singularity")))
3838 `(("libarchive" ,libarchive)
3839 ("python" ,python-wrapper)
3841 ("squashfs-tools" ,squashfs-tools)))
3842 (home-page "https://singularity.lbl.gov/")
3843 (synopsis "Container platform")
3844 (description "Singularity is a container platform supporting a number of
3845 container image formats. It can build SquashFS container images or import
3846 existing Docker images. Singularity requires kernel support for container
3847 isolation or root privileges.")
3848 (license license:bsd-3)))
3850 (define-public hdparm
3856 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
3857 "hdparm-" version ".tar.gz"))
3860 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
3861 (build-system gnu-build-system)
3864 (let ((out (assoc-ref %outputs "out")))
3865 (list (string-append "binprefix=" out)
3866 (string-append "manprefix=" out)
3867 ,(string-append "CC=" (cc-for-target))
3868 ;; Let Guix strip the binaries and not break cross-compilation.
3871 (modify-phases %standard-phases
3872 (delete 'configure)) ; no configure script
3873 #:tests? #f)) ; no test suite
3874 (home-page "https://sourceforge.net/projects/hdparm/")
3875 (synopsis "View and tune ATA disk drive parameters")
3877 "@command{hdparm} is a command-line utility to control ATA controllers and
3878 disk drives. It can increase performance and/or reliability by careful tuning
3879 of hardware settings like power and acoustic management, DMA modes, and caching.
3880 It can also display detailed device information, or be used as a simple
3881 performance benchmarking tool.
3883 @command{hdparm} provides a command line interface to various Linux kernel
3884 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
3885 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
3886 Translation (@dfn{SAT}) are also supported.")
3887 (license (license:non-copyleft "file://LICENSE.TXT"))))
3889 (define-public nvme-cli
3893 (home-page "https://github.com/linux-nvme/nvme-cli")
3898 (commit (string-append "v" version))))
3900 (base32 "12wp2wxmsw2v8m9bhvwvdbhdgx1md8iilhbl19sfzz2araiwi2x8"))
3901 (file-name (git-file-name name version))))
3902 (build-system gnu-build-system)
3905 (list ,(string-append "CC=" (cc-for-target)))
3906 #:phases (modify-phases %standard-phases
3907 (delete 'configure) ; no ./configure script
3910 (invoke "make" "install-spec" "PREFIX="
3911 (string-append "DESTDIR=" %output)))))
3912 ;; The tests require sysfs, which is not accessible from from the build
3915 (synopsis "NVM-Express user space tooling for Linux")
3916 (description "Nvme-cli is a utility to provide standards compliant tooling
3917 for NVM-Express drives. It was made specifically for Linux as it relies on the
3918 IOCTLs defined by the mainline kernel driver.")
3919 (license license:gpl2+)))
3921 (define-public rfkill
3927 (uri (string-append "mirror://kernel.org/software/network/"
3928 name "/" name "-" version ".tar.xz"))
3931 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
3932 (build-system gnu-build-system)
3934 `(#:make-flags (list "CC=gcc"
3935 (string-append "PREFIX=" %output))
3936 #:phases (modify-phases %standard-phases
3937 (delete 'configure))
3939 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
3940 (synopsis "Tool for enabling and disabling wireless devices")
3942 "rfkill is a simple tool for accessing the rfkill device interface,
3943 which is used to enable and disable wireless networking devices, typically
3944 WLAN, Bluetooth and mobile broadband.")
3945 (license (license:non-copyleft "file://COPYING"
3946 "See COPYING in the distribution."))
3947 ;; rfkill is part of util-linux as of 2.31.
3948 (properties `((superseded . ,util-linux)))))
3956 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
3957 version "/" name "-" version ".tar.gz"))
3960 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
3961 (build-system gnu-build-system)
3962 (home-page "http://acpiclient.sourceforge.net")
3963 (synopsis "Display information on ACPI devices")
3964 (description "@code{acpi} attempts to replicate the functionality of the
3965 \"old\" @code{apm} command on ACPI systems, including battery and thermal
3966 information. It does not support ACPI suspending, only displays information
3967 about ACPI devices.")
3968 (license license:gpl2+)))
3970 (define-public acpid
3976 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
3980 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
3981 (build-system gnu-build-system)
3982 (home-page "https://sourceforge.net/projects/acpid2/")
3983 (synopsis "Daemon for delivering ACPI events to user-space programs")
3985 "acpid is designed to notify user-space programs of Advanced
3986 Configuration and Power Interface (ACPI) events. acpid should be started
3987 during the system boot, and will run as a background process. When an ACPI
3988 event is received from the kernel, acpid will examine the list of rules
3989 specified in /etc/acpi/events and execute the rules that match the event.")
3990 (license license:gpl2+)))
3992 (define-public sysfsutils
4001 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
4004 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
4005 (build-system gnu-build-system)
4006 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
4007 (synopsis "System utilities based on Linux sysfs")
4009 "These are a set of utilities built upon sysfs, a virtual file system in
4010 Linux kernel versions 2.5+ that exposes a system's device tree. The package
4011 also contains the libsysfs library.")
4012 ;; The library is under lgpl2.1+ (all files say "or any later version").
4013 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
4014 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
4016 (define-public sysfsutils-1
4018 (inherit sysfsutils)
4025 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
4026 "/sysfsutils-" version ".tar.gz"))
4028 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
4029 (modules '((guix build utils)))
4032 (substitute* "Makefile.in"
4033 (("includedir = /usr/include/sysfs")
4034 "includedir = @includedir@"))
4035 (substitute* "configure"
4036 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
4037 (string-append "includedir='" orig "/sysfs'")))
4039 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
4041 (define-public cpufrequtils
4043 (name "cpufrequtils")
4048 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
4049 "cpufrequtils-" version ".tar.gz"))
4051 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
4052 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
4053 (build-system gnu-build-system)
4055 `(("sysfsutils" ,sysfsutils-1)))
4057 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4058 (assoc-ref %outputs "out") "/lib"))))
4059 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
4060 (synopsis "Utilities to get and set CPU frequency on Linux")
4062 "The cpufrequtils suite contains utilities to retrieve CPU frequency
4063 information, and set the CPU frequency if supported, using the cpufreq
4064 capabilities of the Linux kernel.")
4065 (license license:gpl2)))
4067 (define-public libraw1394
4074 "mirror://kernel.org/linux/libs/ieee1394/"
4075 name "-" version ".tar.xz"))
4078 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
4079 (build-system gnu-build-system)
4080 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4081 (synopsis "Interface library for the Linux IEEE1394 drivers")
4083 "Libraw1394 is the only supported interface to the kernel side raw1394 of
4084 the Linux IEEE-1394 subsystem, which provides direct access to the connected
4085 1394 buses to user space. Through libraw1394/raw1394, applications can directly
4086 send to and receive from other nodes without requiring a kernel driver for the
4087 protocol in question.")
4088 (license license:lgpl2.1+)))
4090 (define-public libavc1394
4096 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
4097 name "-" version ".tar.gz"))
4100 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
4101 (build-system gnu-build-system)
4103 `(("pkg-config" ,pkg-config)))
4105 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
4106 (home-page "https://sourceforge.net/projects/libavc1394/")
4107 (synopsis "AV/C protocol library for IEEE 1394")
4109 "Libavc1394 is a programming interface to the AV/C specification from
4110 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
4111 (license license:lgpl2.1+)))
4113 (define-public libiec61883
4115 (name "libiec61883")
4120 "mirror://kernel.org/linux/libs/ieee1394/"
4121 name "-" version ".tar.xz"))
4124 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
4125 (build-system gnu-build-system)
4127 `(("pkg-config" ,pkg-config)))
4129 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
4130 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4131 (synopsis "Isochronous streaming media library for IEEE 1394")
4133 "The libiec61883 library provides a higher level API for streaming DV,
4134 MPEG-2 and audio over Linux IEEE 1394.")
4135 (license license:lgpl2.1+)))
4137 (define-public mdadm
4144 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
4148 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
4149 (build-system gnu-build-system)
4153 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
4154 (list ,(string-append "CC=" (cc-for-target))
4157 ;; TODO: tell it where to find 'sendmail'
4158 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
4159 (string-append "BINDIR=" out "/sbin")
4160 (string-append "MANDIR=" out "/share/man")
4161 (string-append "UDEVDIR=" out "/lib/udev")))
4163 (modify-phases %standard-phases
4164 (add-before 'build 'patch-program-paths
4165 (lambda* (#:key native-inputs inputs #:allow-other-keys)
4166 (let ((coreutils (assoc-ref (or native-inputs inputs)
4168 (substitute* "udev-md-raid-arrays.rules"
4169 (("/usr/bin/(readlink|basename)" all program)
4170 (string-append coreutils "/bin/" program))))
4172 (add-before 'build 'remove-W-error
4174 ;; We cannot build with -Werror on i686 due to a
4175 ;; 'sign-compare' warning in util.c.
4176 (substitute* "Makefile"
4179 (delete 'configure))
4180 ;;tests must be done as root
4182 (supported-systems (delete "i586-gnu" %supported-systems))
4183 (home-page "http://neil.brown.name/blog/mdadm")
4184 (synopsis "Tool for managing Linux Software RAID arrays")
4186 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
4187 assemble, report on, and monitor arrays. It can also move spares between raid
4188 arrays when needed.")
4189 (license license:gpl2+)))
4191 (define-public mdadm-static
4194 (name "mdadm-static")
4196 (substitute-keyword-arguments (package-arguments mdadm)
4197 ((#:make-flags flags)
4198 `(cons "LDFLAGS = -static" ,flags))
4200 `(modify-phases ,phases
4201 (add-after 'install 'remove-cruft
4202 (lambda* (#:key outputs #:allow-other-keys)
4203 (let* ((out (assoc-ref outputs "out"))
4204 (precious? (lambda (file)
4205 (member file '("." ".." "sbin"))))
4206 (directories (scandir out (negate precious?))))
4207 (with-directory-excursion out
4208 (for-each delete-file-recursively directories)
4209 (remove-store-references "sbin/mdadm")
4210 (delete-file "sbin/mdmon")
4212 ((#:modules modules %gnu-build-system-modules)
4213 `((ice-9 ftw) ,@modules))
4214 ((#:strip-flags _ '())
4215 ''("--strip-all")) ;strip a few extra KiB
4216 ((#:allowed-references _ '("out"))
4217 '("out")))) ;refer only self
4218 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
4220 (define-public multipath-tools
4222 (name "multipath-tools")
4227 (url "https://git.opensvc.com/multipath-tools/.git")
4229 (file-name (git-file-name name version))
4232 "14n8pcgnliicqxzc40xvjxk4cafm4qx7a3rsx5qva74r3ydzx8rn"))
4233 (patches (search-patches "multipath-tools-sans-systemd.patch"))
4234 (modules '((guix build utils)))
4237 ;; Drop bundled valgrind headers.
4238 (delete-file-recursively "third-party")
4239 (substitute* '("multipathd/main.c"
4240 "libmultipath/debug.c")
4241 (("#include \"../third-party/")
4244 (build-system gnu-build-system)
4246 '(#:test-target "test"
4247 #:parallel-build? #f ;XXX: broken in 0.8.4
4248 #:make-flags (list "CC=gcc"
4249 (string-append "DESTDIR="
4250 (assoc-ref %outputs "out"))
4251 ;; Install Udev rules below this directory, relative
4254 (string-append "LDFLAGS=-Wl,-rpath="
4255 (assoc-ref %outputs "out")
4258 (modify-phases %standard-phases
4259 (add-after 'unpack 'patch-source
4260 (lambda* (#:key inputs #:allow-other-keys)
4261 (let ((lvm2 (assoc-ref inputs "lvm2"))
4262 (udev (assoc-ref inputs "udev")))
4263 (substitute* "Makefile.inc"
4264 (("\\$\\(prefix\\)/usr") "$(prefix)")
4265 ;; Do not save timestamp to avoid gzip "timestamp
4266 ;; out-of-range" warnings.
4267 (("gzip -9") "gzip -9n"))
4268 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
4269 (("/usr/include/libdevmapper.h")
4270 (string-append lvm2 "/include/libdevmapper.h"))
4271 (("/usr/include/libudev.h")
4272 (string-append udev "/include/libudev.h")))
4274 (add-after 'unpack 'fix-maybe-uninitialized-variable
4276 ;; This variable gets initialized later if needed, but GCC 7
4277 ;; fails to notice. Should be fixed for > 0.8.4.
4278 ;; https://www.redhat.com/archives/dm-devel/2020-March/msg00137.html
4279 (substitute* "libmultipath/structs_vec.c"
4280 (("bool is_queueing;")
4281 "bool is_queueing = false;"))
4283 (add-after 'unpack 'fix-linking-tests
4285 ;; Add missing linker flag for -lmpathcmd. This should be fixed
4286 ;; for versions > 0.8.4.
4287 (substitute* "tests/Makefile"
4288 (("-lmultipath -lcmocka")
4289 "-lmultipath -L$(mpathcmddir) -lmpathcmd -lcmocka"))
4291 (delete 'configure)))) ; no configure script
4294 ("pkg-config" ,pkg-config)
4295 ("valgrind" ,valgrind)
4298 ("cmocka" ,cmocka)))
4300 `(("json-c" ,json-c)
4302 ("liburcu" ,liburcu)
4304 ("readline" ,readline)
4306 (home-page "http://christophe.varoqui.free.fr/")
4307 (synopsis "Access block devices through multiple paths")
4309 "This package provides the following binaries to drive the
4310 Linux Device Mapper multipathing driver:
4312 @item @command{multipath} - Device mapper target autoconfig.
4313 @item @command{multipathd} - Multipath daemon.
4314 @item @command{mpathpersist} - Manages SCSI persistent reservations on
4315 @code{dm} multipath devices.
4316 @item @command{kpartx} - Create device maps from partition tables.
4318 (license (list license:gpl2+ ; main distribution
4319 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
4321 (define-public libaio
4328 (string-append "https://releases.pagure.org/libaio/"
4329 name "-" version ".tar.gz")))
4332 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
4333 (build-system gnu-build-system)
4336 (let ((target ,(%current-target-system)))
4337 (list (string-append "prefix=" %output)
4340 (string-append (assoc-ref %build-inputs "cross-gcc")
4341 "/bin/" target "-gcc")
4343 #:test-target "partcheck" ; need root for a full 'check'
4345 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
4346 (home-page "https://pagure.io/libaio")
4347 (synopsis "Linux-native asynchronous I/O access library")
4349 "This library enables userspace to use Linux kernel asynchronous I/O
4350 system calls, important for the performance of databases and other advanced
4352 (license license:lgpl2.1+)))
4354 (define-public blktrace
4355 ;; Take a newer commit to get the fix for CVE-2018-10689.
4356 (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
4360 (version (git-version "1.2.0" revision commit))
4362 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
4369 (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
4370 (file-name (git-file-name name version))))
4371 (build-system gnu-build-system)
4374 (list ,(string-append "CC=" (cc-for-target))
4375 (string-append "prefix=" %output))
4376 #:tests? #f ; no tests
4378 (modify-phases %standard-phases
4379 (delete 'configure) ; no configure script
4380 (add-after 'unpack 'fix-gnuplot-path
4381 (lambda* (#:key inputs #:allow-other-keys)
4382 (let ((gnuplot (assoc-ref inputs "gnuplot")))
4383 (substitute* "btt/bno_plot.py"
4385 (string-append gnuplot "/bin/gnuplot %s")))
4388 `(("libaio" ,libaio)
4389 ("gnuplot" ,gnuplot)
4390 ("python" ,python-wrapper))) ;for 'bno_plot.py'
4391 (synopsis "Block layer IO tracing mechanism")
4392 (description "Blktrace is a block layer IO tracing mechanism which provides
4393 detailed information about request queue operations to user space. It extracts
4394 event traces from the kernel (via the relaying through the debug file system).")
4395 (license license:gpl2))))
4403 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
4407 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
4408 (build-system gnu-build-system)
4410 `(("libsndfile" ,libsndfile)))
4412 `(("pkg-config" ,pkg-config)))
4413 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
4414 (synopsis "Bluetooth subband audio codec")
4416 "The SBC is a digital audio encoder and decoder used to transfer data to
4417 Bluetooth audio output devices like headphones or loudspeakers.")
4418 (license license:gpl2+)))
4420 (define-public bluez
4427 "mirror://kernel.org/linux/bluetooth/bluez-"
4429 (patches (search-patches "bluez-CVE-2020-0556.patch"))
4432 "1g1qg6dz6hl3csrmz75ixr12lwv836hq3ckb259svvrg62l2vaiq"))))
4433 (build-system gnu-build-system)
4436 (let ((out (assoc-ref %outputs "out")))
4437 (list "--sysconfdir=/etc"
4438 "--localstatedir=/var"
4441 ;; Install dbus/udev files to the correct location.
4442 (string-append "--with-dbusconfdir=" out "/etc")
4443 (string-append "--with-udevdir=" out "/lib/udev")))
4445 (modify-phases %standard-phases
4446 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
4447 ;; issue (discussion on upstream mailing list:
4448 ;; https://marc.info/?t=149578476300002&r=1&w=2)
4449 (add-before 'check 'skip-wonky-test
4451 (substitute* "unit/test-gatt.c"
4452 (("tester_init\\(&argc, &argv\\);") "return 77;"))
4454 (add-after 'install 'post-install
4455 (lambda* (#:key inputs outputs #:allow-other-keys)
4456 (let* ((out (assoc-ref outputs "out"))
4457 (servicedir (string-append out "/share/dbus-1/services"))
4458 (service "obexd/src/org.bluez.obex.service")
4459 (rule (string-append
4460 out "/lib/udev/rules.d/97-hid2hci.rules")))
4461 ;; Install the obex dbus service file.
4462 (substitute* service
4464 (string-append out "/libexec/bluetooth/obexd")))
4465 (install-file service servicedir)
4466 ;; Fix paths in the udev rule.
4468 (("hid2hci --method")
4469 (string-append out "/lib/udev/hid2hci --method"))
4471 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
4474 `(("pkg-config" ,pkg-config)
4475 ("gettext" ,gettext-minimal)))
4480 ("libical" ,libical)
4481 ("readline" ,readline)))
4482 (home-page "http://www.bluez.org/")
4483 (synopsis "Linux Bluetooth protocol stack")
4485 "BlueZ provides support for the core Bluetooth layers and protocols. It
4486 is flexible, efficient and uses a modular implementation.")
4487 (license license:gpl2+)))
4489 (define-public fuse-exfat
4496 "https://github.com/relan/exfat/releases/download/v"
4497 version "/" name "-" version ".tar.gz"))
4500 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
4501 (build-system gnu-build-system)
4503 `(("pkg-config" ,pkg-config)))
4506 (home-page "https://github.com/relan/exfat")
4507 (synopsis "Mount exFAT file systems")
4509 "This package provides a FUSE-based file system that provides read and
4510 write access to exFAT devices.")
4511 (license license:gpl2+)))
4513 (define-public fuseiso
4516 (version "20070708")
4519 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
4520 version "/fuseiso-" version ".tar.bz2"))
4523 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
4524 (build-system gnu-build-system)
4526 `(("pkg-config" ,pkg-config)))
4531 (home-page "https://sourceforge.net/projects/fuseiso/")
4532 (synopsis "Mount ISO file system images")
4534 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
4535 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
4536 Ridge, Joliet, and zisofs.")
4537 (license license:gpl2)))
4546 "https://www.nico.schottelius.org/software/gpm/archives/"
4547 "gpm-" version ".tar.bz2"))
4548 (patches (search-patches "gpm-glibc-2.26.patch"))
4551 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
4552 (build-system gnu-build-system)
4554 '(#:phases (modify-phases %standard-phases
4557 ;; The tarball was not generated with 'make dist' so we
4558 ;; need to bootstrap things ourselves.
4559 (substitute* "autogen.sh"
4560 (("/bin/sh") (which "sh")))
4561 (invoke "./autogen.sh")
4562 (patch-makefile-SHELL "Makefile.include.in")
4565 ;; Make sure programs find libgpm.so.
4566 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4567 (assoc-ref %outputs "out")
4570 `(("texinfo" ,texinfo)
4573 ("autoconf" ,autoconf)
4574 ("automake" ,automake)
4575 ("libtool" ,libtool)))
4576 (home-page "https://www.nico.schottelius.org/software/gpm/")
4577 (synopsis "Mouse support for the Linux console")
4579 "The GPM (general-purpose mouse) daemon is a mouse server for
4580 applications running on the Linux console. It allows users to select items
4581 and copy/paste text in the console and in xterm.")
4582 (license license:gpl2+)))
4584 (define-public btrfs-progs
4586 (name "btrfs-progs")
4590 (uri (string-append "mirror://kernel.org/linux/kernel/"
4591 "people/kdave/btrfs-progs/"
4592 "btrfs-progs-v" version ".tar.xz"))
4595 "0srg276yccfmqz0skmmga3vbqx4wiqsk1l6h86n6ryhxa9viqcm1"))))
4596 (build-system gnu-build-system)
4598 "static")) ; static versions of the binaries in "out"
4600 '(#:phases (modify-phases %standard-phases
4601 (add-after 'unpack 'patch-makefile
4602 (lambda* (#:key outputs #:allow-other-keys)
4603 (substitute* "Makefile"
4604 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
4605 (string-append (assoc-ref outputs "out")
4606 "/lib/udev/rules.d")))
4608 (add-after 'build 'build-static
4609 (lambda _ (invoke "make" "static")))
4610 (add-after 'install 'install-bash-completion
4611 (lambda* (#:key outputs #:allow-other-keys)
4612 (let* ((out (assoc-ref outputs "out"))
4613 (bashcomp (string-append out "/etc/bash_completion.d")))
4615 (copy-file "btrfs-completion"
4616 (string-append bashcomp "/btrfs"))
4618 (add-after 'install 'install-static
4619 (let ((staticbin (string-append (assoc-ref %outputs "static")
4623 (string-append "bindir=" staticbin)
4624 "install-static")))))
4625 #:tests? #f ; XXX: require the 'btrfs' kernel module.
4626 #:test-target "test"
4627 #:parallel-tests? #f)) ; tests fail when run in parallel
4628 (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
4630 ("util-linux:lib" ,util-linux "lib") ;for libblkid and libuuid
4631 ("util-linux:static" ,util-linux "static") ;ditto
4633 ("zlib:static" ,zlib "static")
4634 ("zstd" ,zstd "lib")
4635 ("zstd:static" ,zstd "static")))
4636 (native-inputs `(("pkg-config" ,pkg-config)
4637 ("asciidoc" ,asciidoc)
4640 ;; For building documentation.
4641 ("libxml2" ,libxml2)
4642 ("docbook-xsl" ,docbook-xsl)
4648 ;; The tests need 'grep' with perl regexp support.
4650 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
4651 (synopsis "Create and manage btrfs copy-on-write file systems")
4652 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
4653 aimed at implementing advanced features while focusing on fault tolerance,
4654 repair and easy administration.")
4655 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
4656 ;; GPL2: Everything else.
4657 (license (list license:gpl2 license:gpl2+))))
4659 (define-public btrfs-progs/static
4661 (name "btrfs-progs-static")
4662 (version (package-version btrfs-progs))
4664 (build-system trivial-build-system)
4666 `(("btrfs-progs:static" ,btrfs-progs "static")))
4668 `(#:modules ((guix build utils))
4671 (use-modules (guix build utils)
4675 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
4676 (out (assoc-ref %outputs "out"))
4677 (source (string-append btrfs "/bin/btrfs.static"))
4678 (target (string-append out "/bin/btrfs")))
4679 (mkdir-p (dirname target))
4680 (copy-file source target)
4681 (remove-store-references target)
4682 (chmod target #o555)
4684 (home-page (package-home-page btrfs-progs))
4685 (synopsis "Statically-linked btrfs command from btrfs-progs")
4686 (description "This package provides the statically-linked @command{btrfs}
4687 from the btrfs-progs package. It is meant to be used in initrds.")
4688 (license (package-license btrfs-progs))))
4690 (define-public cramfs-tools
4692 (name "cramfs-tools")
4693 (home-page "https://github.com/npitre/cramfs-tools")
4699 (commit (string-append "v" version))))
4701 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
4702 (file-name (git-file-name name version))))
4703 (build-system gnu-build-system)
4705 '(#:tests? #f ; No tests.
4707 (modify-phases %standard-phases
4710 (lambda* (#:key outputs #:allow-other-keys)
4711 (let ((out (assoc-ref outputs "out")))
4712 (install-file "mkcramfs" (string-append out "/sbin"))
4713 (install-file "cramfsck" (string-append out "/sbin")))
4717 (synopsis "Tools to manage Cramfs file systems")
4718 (description "Cramfs is a Linux file system designed to be simple, small,
4719 and to compress things well. It is used on a number of embedded systems and
4720 small devices. This version has additional features such as uncompressed
4721 blocks and random block placement.")
4722 (license license:gpl2+)))
4724 (define-public compsize
4728 (home-page "https://github.com/kilobyte/compsize")
4733 (commit (string-append "v" version))))
4735 (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43"))
4736 (file-name (git-file-name name version))))
4737 (build-system gnu-build-system)
4739 `(("btrfs-progs" ,btrfs-progs)))
4741 `(#:tests? #f ; No tests.
4742 #:make-flags (list "CC=gcc")
4744 (modify-phases %standard-phases
4747 (lambda* (#:key outputs #:allow-other-keys)
4748 (let ((out (assoc-ref outputs "out")))
4749 (install-file "compsize" (string-append out "/bin"))
4750 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
4751 (synopsis "Find compression type/ratio on Btrfs files")
4752 (description "@command{compsize} takes a list of files (given as
4753 arguments) on a Btrfs file system and measures used compression types and
4754 effective compression ratio, producing a report.
4756 A directory has no extents but has a (recursive) list of files. A non-regular
4757 file is silently ignored.
4759 As it makes no sense to talk about compression ratio of a partial extent,
4760 every referenced extent is counted whole, exactly once -- no matter if you use
4761 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
4762 uncompressed size will not match the number given by @command{tar} or
4763 @command{du}. On the other hand, the space used should be accurate (although
4764 obviously it can be shared with files outside our set).")
4765 (license license:gpl2+)))
4767 (define-public f2fs-tools-1.7
4774 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4775 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4778 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
4780 (build-system gnu-build-system)
4783 (modify-phases %standard-phases
4784 (add-after 'install 'install-headers
4785 (lambda* (#:key outputs #:allow-other-keys)
4786 (let* ((out (assoc-ref outputs "out"))
4787 (out-include (string-append out "/include")))
4788 (install-file "include/f2fs_fs.h" out-include)
4789 (install-file "mkfs/f2fs_format_utils.h" out-include)
4792 `(("autoconf" ,autoconf)
4793 ("automake" ,automake)
4794 ("libtool" ,libtool)
4795 ("pkg-config" ,pkg-config)))
4797 `(("libuuid" ,util-linux "lib")
4798 ("libselinux" ,libselinux)))
4799 (home-page "https://f2fs.wiki.kernel.org/")
4800 (synopsis "Userland tools for f2fs")
4802 "F2FS, the Flash-Friendly File System, is a modern file system
4803 designed to be fast and durable on flash devices such as solid-state
4804 disks and SD cards. This package provides the userland utilities.")
4805 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
4806 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
4807 (license (list license:gpl2 license:lgpl2.1))))
4809 (define-public f2fs-tools
4811 (inherit f2fs-tools-1.7)
4817 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4818 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4821 "0z9c0y3qq75iyqknl5k0v7v46l8c3pcifpqb0yqalrs24blkm7dk"))))
4823 `(("libuuid" ,util-linux "lib")))))
4825 (define-public f2fs-tools/static
4828 (inherit f2fs-tools)
4829 (name "f2fs-tools-static")
4832 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
4833 (libuuid (assoc-ref %build-inputs "libuuid")))
4835 (string-append "libuuid_CFLAGS=-I" libuuid "/include")
4836 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
4837 (string-append "libblkid_CFLAGS=-I" libuuid "/include")
4838 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
4839 #:disallowed-references (,util-linux)
4841 (modify-phases %standard-phases ; TODO: f2fs phases.
4842 (add-after 'unpack 'make-static
4844 (define (append-to-file name body)
4845 (let ((file (open-file name "a")))
4848 (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n")
4849 (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n")
4850 (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n")
4852 (add-after 'install 'remove-store-references
4853 (lambda* (#:key outputs #:allow-other-keys)
4854 ;; Work around bug in our util-linux.
4855 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
4856 (remove-store-references (string-append (assoc-ref outputs "out")
4860 `(("libuuid:static" ,util-linux "static")
4861 ("libuuid" ,util-linux "lib")))))) ; for include files
4863 (define-public f2fs-fsck/static
4865 (name "f2fs-fsck-static")
4866 (version (package-version f2fs-tools/static))
4868 (build-system trivial-build-system)
4870 `(#:modules ((guix build utils))
4873 (use-modules (guix build utils)
4876 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
4878 (out (assoc-ref %outputs "out"))
4879 (sbin (string-append out "/sbin")))
4881 (with-directory-excursion sbin
4882 (install-file (string-append f2fs-tools "/sbin/" fsck)
4884 (remove-store-references fsck)
4888 `(("f2fs-tools-static" ,f2fs-tools/static)))
4889 (home-page (package-home-page f2fs-tools/static))
4890 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
4891 (description "This package provides statically-linked fsck.f2fs command taken
4892 from the f2fs-tools package. It is meant to be used in initrds.")
4893 (license (package-license f2fs-tools/static))))
4895 (define-public freefall
4898 (version (package-version linux-libre))
4899 (source (package-source linux-libre))
4900 (build-system gnu-build-system)
4902 '(#:phases (modify-phases %standard-phases
4903 (add-after 'unpack 'enter-subdirectory
4905 (chdir "tools/laptop/freefall")
4908 (add-before 'build 'increase-timeout
4910 ;; The default of 2 seconds is too low: it assumes an
4911 ;; open lid and AC power without actually checking.
4912 (substitute* "freefall.c"
4913 (("alarm\\(2\\)") "alarm(5)"))
4915 #:make-flags (list (string-append "PREFIX="
4916 (assoc-ref %outputs "out"))
4918 #:tests? #f)) ;no tests
4919 (home-page (package-home-page linux-libre))
4920 (synopsis "Free-fall protection for spinning laptop hard drives")
4922 "Prevents shock damage to the internal spinning hard drive(s) of some
4923 HP and Dell laptops. When sudden movement is detected, all input/output
4924 operations on the drive are suspended and its heads are parked on the ramp,
4925 where they are less likely to cause damage to the spinning disc. Requires a
4926 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
4927 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
4928 (license license:gpl2)))
4930 (define-public thinkfan
4938 (url "https://github.com/vmatare/thinkfan.git")
4940 (file-name (git-file-name name version))
4942 (base32 "1fxd1w3z65glw6y04myn7ihgswkx6sqnkky159mik4n96pfrsvr5"))))
4943 (build-system cmake-build-system)
4945 `(#:modules ((guix build cmake-build-system)
4948 #:tests? #f ; no test target
4950 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
4951 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
4953 `("-DUSE_ATASMART:BOOL=ON")
4955 (modify-phases %standard-phases
4956 (add-after 'unpack 'create-init-scripts
4957 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
4958 ;; systemd to patch and install their service files. Fake their
4959 ;; presence rather than duplicating the build system below. Leave
4960 ;; things like ‘/bin/kill’ because they're not worth a dependency.
4961 ;; The sysvinit needs manual patching, but since upstream doesn't
4962 ;; even provide the option to install it: don't.
4963 (lambda* (#:key outputs #:allow-other-keys)
4964 (let* ((out (assoc-ref outputs "out"))
4965 (share (string-append out "/share/" ,name)))
4966 (substitute* "CMakeLists.txt"
4967 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
4968 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
4969 ;; That was easy! Now we just need to fix the destinations.
4971 (string-append out directory)))
4974 `(("pkg-config" ,pkg-config)))
4976 `(("libatasmart" ,libatasmart)
4977 ("yaml-cpp" ,yaml-cpp)))
4978 (home-page "http://thinkfan.sourceforge.net/")
4979 (synopsis "Simple fan control program")
4981 "Thinkfan is a simple fan control program. It reads temperatures,
4982 checks them against configured limits and switches to appropriate (also
4983 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
4984 other @code{hwmon} driver that enables temperature reading and fan control
4986 (license license:gpl3+)))
4988 (define-public tpacpi-bat
4996 (url "https://github.com/teleshoes/tpacpi-bat.git")
4997 (commit (string-append "v" version))))
4998 (file-name (git-file-name name version))
5000 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
5001 (build-system gnu-build-system)
5003 `(#:tests? #f ; no test target
5005 (modify-phases %standard-phases
5006 (add-after 'unpack 'refer-to-inputs
5008 (substitute* "tpacpi-bat"
5010 (format #f "~a " (which "cat")))
5011 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
5012 ;; loaded. That's the administrator's prerogative; disable it.
5013 (("system \"(modprobe .*)\"" _ match)
5014 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))
5016 (delete 'configure) ; nothing to configure
5017 (delete 'build) ; nothing to build
5019 (lambda* (#:key outputs #:allow-other-keys)
5020 (let* ((out (assoc-ref outputs "out"))
5021 (bin (string-append out "/bin"))
5022 (doc (string-append out "/share/doc/" ,name "-" ,version)))
5023 (install-file "tpacpi-bat" bin)
5025 ;; There's no man page. Install other forms of documentation.
5026 (for-each (lambda (file)
5027 (let ((target (string-append doc "/" file)))
5028 (mkdir-p (dirname target))
5029 (copy-recursively file target)))
5030 (list "battery_asl" "examples" "README.md"))
5034 (home-page "https://github.com/teleshoes/tpacpi-bat")
5035 (synopsis "ThinkPad battery charge controller")
5037 "Tpacpi-bat is a command-line interface to control battery charging on
5038 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
5039 ThinkPad models released after 2011}, starting with the xx20 series. It can
5040 query and set the thresholds at which one or both batteries will start and stop
5041 charging, inhibit charging batteries for a set period of time, or force them to
5042 discharge when they otherwise would not.
5044 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
5045 kernel module provided by the @code{acpi-call-linux-module} package, which must
5046 be installed and loaded separately. Only the original vendor firmware is
5048 (license license:gpl3+)))
5050 (define-public ntfs-3g
5053 (version "2017.3.23")
5056 (uri (string-append "https://tuxera.com/opensource/"
5057 "ntfs-3g_ntfsprogs-" version ".tgz"))
5058 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
5061 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
5062 (modules '((guix build utils)))
5064 ;; Install under $prefix.
5065 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
5069 (build-system gnu-build-system)
5070 (inputs `(("util-linux" ,util-linux)
5071 ("fuse" ,fuse))) ;libuuid
5072 (native-inputs `(("pkg-config" ,pkg-config)))
5074 '(#:configure-flags (list "--exec-prefix=${prefix}"
5075 "--with-fuse=external" ;use our own FUSE
5076 "--enable-mount-helper"
5077 "--enable-posix-acls"
5078 "--enable-xattr-mappings")
5080 (modify-phases %standard-phases
5081 ;; If users install ntfs-3g, they probably want to make it the
5082 ;; default driver as well, so we opt for sensible defaults and link
5083 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
5084 ;; mount NTFS file systems.)
5085 (add-after 'install 'install-link
5086 (lambda* (#:key outputs #:allow-other-keys)
5087 (let* ((out (assoc-ref outputs "out"))
5088 (sbin (string-append out "/sbin")))
5089 (symlink "mount.ntfs-3g"
5090 (string-append sbin "/mount.ntfs")))
5092 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
5093 (synopsis "Read-write access to NTFS file systems")
5095 "NTFS-3G provides read-write access to NTFS file systems, which are
5096 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
5097 The package provides additional NTFS tools.")
5098 (license license:gpl2+)))
5100 (define-public rdma-core
5106 (uri (string-append "https://github.com/linux-rdma/rdma-core"
5107 "/releases/download/v" version "/rdma-core-"
5111 "14raqwx4pkzghiwkx1v0dq338f7xqqx8rnsxlpdnngvjy1p5l79j"))))
5112 (build-system cmake-build-system)
5114 `(#:tests? #f ; no tests
5115 ;; Upstream uses the "ninja" build system and encourage distros
5116 ;; to do the same for consistency. They also recommend using the
5117 ;; "Release" build type.
5118 #:build-type "Release"
5119 #:configure-flags (list "-GNinja"
5121 (string-append "-DRST2MAN_EXECUTABLE="
5122 (assoc-ref %build-inputs
5126 ;; On some configurations, the
5127 ;; IB_USER_MAD_REGISTER_AGENT ioctl, which is
5128 ;; used by default, would return ENODEV. To
5129 ;; avoid that, use 'write' instead of ioctls,
5130 ;; as suggested in 'CMakeList.txt'.
5131 "-DIOCTL_MODE=write")
5133 (modify-phases %standard-phases
5137 "-j" (number->string (parallel-job-count)))))
5140 (invoke "ninja" "install"))))))
5143 ("pkg-config" ,pkg-config)
5144 ("python" ,python-wrapper)
5145 ("python-docutils" ,python-docutils))) ;for 'rst2man'
5149 (home-page "https://github.com/linux-rdma/rdma-core")
5150 (synopsis "Utilities and libraries for working with RDMA devices")
5152 "This package provides userspace components for the InfiniBand
5153 subsystem of the Linux kernel. Specifically it contains userspace
5154 libraries for the following device nodes:
5157 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
5158 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
5159 @item @file{/dev/infiniband/umadX} (@code{libibumad})
5162 The following service daemons are also provided:
5164 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
5165 @item @code{iwpmd} (for iWARP kernel providers)
5166 @item @code{ibacm} (for InfiniBand communication management assistant)
5168 ;; All library code is dual licensed under GPL2 and a custom MIT
5169 ;; variant. The package also includes some components covered by
5170 ;; other licenses. Consult COPYING.md for full details.
5173 (license:x11-style "See COPYING.BSD_MIT in the distribution")
5174 license:bsd-2 ; Files referring to COPYING.BSD_FB
5175 license:cc0 ; most files in ccan/
5176 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
5178 (define-public perftest
5185 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
5186 version "/perftest-" version ".g0927198.tar.gz"))
5188 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
5189 (build-system gnu-build-system)
5192 (modify-phases %standard-phases
5193 (add-after 'unpack 'patch-header-paths
5195 (substitute* '("src/raw_ethernet_fs_rate.c"
5196 "src/raw_ethernet_resources.c"
5197 "src/raw_ethernet_resources.h"
5198 "src/raw_ethernet_send_burst_lat.c"
5199 "src/raw_ethernet_send_bw.c"
5200 "src/raw_ethernet_send_lat.c")
5201 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
5203 (inputs `(("rdma-core" ,rdma-core)))
5204 (home-page "https://github.com/linux-rdma/perftest/")
5205 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
5206 (description "This is a collection of tests written over uverbs intended for
5207 use as a performance micro-benchmark. The tests may be used for hardware or
5208 software tuning as well as for functional testing.
5210 The collection contains a set of bandwidth and latency benchmark such as:
5212 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
5213 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
5214 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
5215 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
5216 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
5218 (license license:gpl2)))
5220 (define-public rng-tools
5223 (home-page "https://github.com/nhorman/rng-tools")
5227 (uri (git-reference (url home-page)
5228 (commit (string-append "v" version))))
5229 (file-name (git-file-name name version))
5232 "0hbml37yxs0fs69g7f2x4ixq61z0029swy99rn7ykma9mi6b7ni9"))))
5233 (build-system gnu-build-system)
5235 `(;; Disable support for various hardware entropy sources as they need
5236 ;; dependencies that are not yet in Guix, and would significantly
5237 ;; increase closure size.
5238 #:configure-flags '("--without-nistbeacon"
5240 "--without-rtlsdr")))
5242 `(("autoconf" ,autoconf)
5243 ("automake" ,automake)
5244 ("pkg-config" ,pkg-config)))
5246 `(("libsysfs" ,sysfsutils)
5247 ("openssl" ,openssl)))
5248 (synopsis "Random number generator daemon")
5250 "Monitor a hardware random number generator, and supply entropy
5251 from that to the system kernel's @file{/dev/random} machinery.")
5252 ;; The source package is offered under the GPL2+, but the files
5253 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
5254 (license (list license:gpl2 license:gpl2+))))
5256 (define-public cpupower
5259 (version (package-version linux-libre))
5260 (source (package-source linux-libre))
5261 (build-system gnu-build-system)
5263 '(#:phases (modify-phases %standard-phases
5264 (add-after 'unpack 'enter-subdirectory
5266 (chdir "tools/power/cpupower")
5269 (add-before 'build 'fix-makefiles
5271 (substitute* "Makefile"
5273 (("/bin/(install|pwd)" _ command) command))
5274 (substitute* "bench/Makefile"
5275 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
5277 #:make-flags (let ((out (assoc-ref %outputs "out")))
5278 (list (string-append "DESTDIR=" out)
5279 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
5281 "docdir=/share/doc/cpupower"
5282 "confdir=$(docdir)/examples"
5283 ;; The Makefile recommends the following changes
5285 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
5286 #:tests? #f)) ;no tests
5287 (native-inputs `(("gettext" ,gettext-minimal)))
5288 (inputs `(("pciutils" ,pciutils)))
5289 (home-page (package-home-page linux-libre))
5290 (synopsis "CPU frequency and voltage scaling tools for Linux")
5292 "cpupower is a set of user-space tools that use the cpufreq feature of the
5293 Linux kernel to retrieve and control processor features related to power saving,
5294 such as frequency and voltage scaling.")
5295 (license license:gpl2)))
5297 (define-public x86-energy-perf-policy
5299 (name "x86-energy-perf-policy")
5300 (version (package-version linux-libre))
5301 (source (package-source linux-libre))
5302 (build-system gnu-build-system)
5306 (modify-phases %standard-phases
5307 (add-after 'unpack 'enter-subdirectory
5309 (chdir "tools/power/x86/x86_energy_perf_policy")
5312 (add-before 'build 'fix-makefile
5314 (substitute* "Makefile" (("/usr") ""))
5317 (let ((out (assoc-ref %outputs "out")))
5318 (list (string-append "DESTDIR=" out)
5319 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
5320 (supported-systems '("i686-linux" "x86_64-linux"))
5321 (home-page (package-home-page linux-libre))
5322 (synopsis "Display and update Intel-CPU energy-performance policy")
5324 "@command{x86_energy_perf_policy} displays and updates energy-performance
5325 policy settings specific to Intel Architecture Processors. Settings are
5326 accessed via Model Specific Register (MSR) updates, no matter if the Linux
5327 cpufreq sub-system is enabled or not.")
5328 (license license:gpl2)))
5330 (define-public haveged
5338 (url "https://github.com/jirka-h/haveged.git")
5339 (commit (string-append "v" version))))
5340 (file-name (git-file-name name version))
5342 (base32 "1znr58fb3faq4nmrvc3c5whkc1f3chivm4vhicdwr9pdsyqqsd51"))))
5343 (build-system gnu-build-system)
5344 (home-page "https://www.issihosts.com/haveged")
5345 (synopsis "Entropy source for the Linux random number generator")
5347 "haveged generates an unpredictable stream of random numbers for use by
5348 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
5349 standard mechanisms for filling the entropy pool may not be sufficient for
5350 systems with high needs or limited user interaction, such as headless servers.
5352 @command{haveged} runs as a privileged daemon, harvesting randomness from the
5353 indirect effects of hardware events on hidden processor state using the
5354 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
5355 It tunes itself to its environment and provides the same built-in test suite
5356 for the output stream as used on certified hardware security devices.
5358 The quality of the randomness produced by this algorithm has not been proven.
5359 It is recommended to run it together with another entropy source like rngd, and
5360 not as a replacement for it.")
5361 (license (list (license:non-copyleft "file://nist/mconf.h")
5362 (license:non-copyleft "file://nist/packtest.c")
5363 license:public-domain ; nist/dfft.c
5364 license:gpl3+)))) ; everything else
5366 (define-public ecryptfs-utils
5368 (name "ecryptfs-utils")
5373 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
5374 version "/+download/ecryptfs-utils_"
5375 version ".orig.tar.gz"))
5378 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
5379 (build-system gnu-build-system)
5381 `(#:configure-flags (list "--disable-pywrap")
5383 (modify-phases %standard-phases
5384 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
5385 (lambda* (#:key inputs outputs #:allow-other-keys)
5386 (let ((out (assoc-ref outputs "out"))
5387 (utils-linux (assoc-ref inputs "utils-linux"))
5388 (cryptsetup (assoc-ref inputs "cryptsetup"))
5389 (linux-pam (assoc-ref inputs "linux-pam"))
5390 (lvm2 (assoc-ref inputs "lvm2")))
5391 (substitute* '("src/utils/ecryptfs-mount-private"
5392 "src/utils/ecryptfs-umount-private"
5393 "src/utils/ecryptfs-setup-private"
5394 "src/utils/ecryptfs-setup-swap"
5395 "src/utils/mount.ecryptfs.c"
5396 "src/utils/umount.ecryptfs.c"
5397 "src/pam_ecryptfs/pam_ecryptfs.c"
5398 "src/desktop/ecryptfs-mount-private.desktop.in"
5399 "src/desktop/ecryptfs-setup-private.desktop.in")
5401 (string-append utils-linux "/bin/mount"))
5403 (string-append utils-linux "/bin/umount"))
5404 (("/sbin/mount.ecryptfs_private")
5405 (string-append out "/sbin/mount.ecryptfs_private"))
5406 (("/sbin/umount.ecryptfs_private")
5407 (string-append out "/sbin/umount.ecryptfs_private"))
5408 (("/usr/bin/ecryptfs-mount-private")
5409 (string-append out "/bin/ecryptfs-mount-private"))
5410 (("/usr/bin/ecryptfs-rewrite-file")
5411 (string-append out "/bin/ecryptfs-rewrite-file"))
5412 (("/usr/bin/ecryptfs-setup-private")
5413 (string-append out "/bin/ecryptfs-setup-private"))
5414 (("/sbin/cryptsetup")
5415 (string-append cryptsetup "/sbin/cryptsetup"))
5416 (("/sbin/unix_chkpwd")
5417 (string-append linux-pam "/sbin/unix_chkpwd"))
5419 (string-append lvm2 "/sbin/dmsetup")))))))))
5421 `(("intltool" ,intltool)
5422 ("perl" ,perl) ; for pod2man
5423 ("pkg-config" ,pkg-config)))
5425 `(("keyutils" ,keyutils)
5426 ("linux-pam" ,linux-pam)
5427 ("utils-linux" ,util-linux)
5428 ("cryptsetup" ,cryptsetup)
5431 (home-page "https://ecryptfs.org/")
5432 (synopsis "eCryptfs cryptographic file system utilities")
5434 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
5435 Each file's cryptographic meta-data is stored inside the file itself, along
5436 with the encrypted contents. This allows individual encrypted files to be
5437 copied between hosts and still be decrypted with the proper key. eCryptfs is a
5438 native Linux file system, and has been part of the Linux kernel since version
5439 2.6.19. This package contains the userland utilities to manage it.")
5440 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
5441 ;; grant additional permission to link with OpenSSL.
5442 (license license:gpl2+)))
5444 (define-public libnfsidmap
5446 (name "libnfsidmap")
5451 (uri (string-append "https://fedorapeople.org/~steved/"
5452 name "/" version "/" name "-" version ".tar.bz2"))
5454 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
5455 (build-system gnu-build-system)
5457 `(#:configure-flags (list
5458 (string-append "--with-pluginpath="
5459 (assoc-ref %outputs "out")
5460 "/lib/libnfsidmap"))))
5462 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
5464 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
5465 (synopsis "NFSv4 support library for name/ID mapping")
5466 (description "Libnfsidmap is a library holding mulitiple methods of
5467 mapping names to ids and visa versa, mainly for NFSv4. It provides an
5468 extensible array of mapping functions, currently consisting of two choices:
5469 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
5470 (license (license:non-copyleft "file://COPYING"
5471 "See COPYING in the distribution."))))
5473 (define-public module-init-tools
5475 (name "module-init-tools")
5480 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
5481 "module-init-tools-" version ".tar.bz2"))
5484 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
5485 (patches (search-patches "module-init-tools-moduledir.patch"))))
5486 (build-system gnu-build-system)
5488 ;; FIXME: The upstream tarball lacks man pages, and building them would
5489 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
5490 ;; but they vanished. In the meantime, fake it.
5492 (modify-phases %standard-phases
5493 (add-before 'configure 'fake-docbook
5495 (substitute* "Makefile.in"
5496 (("^DOCBOOKTOMAN.*$")
5497 "DOCBOOKTOMAN = true\n"))
5499 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
5500 (synopsis "Tools for loading and managing Linux kernel modules")
5502 "Tools for loading and managing Linux kernel modules, such as
5503 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
5504 (license license:gpl2+)))
5506 (define-public mcelog
5512 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
5513 "mcelog.git/snapshot/v" version ".tar.gz"))
5516 "1m11v1y7cvpm7hwsghj23z77ps1w5jzn8000iwiyxpb939h2km5l"))
5517 (file-name (string-append name "-" version ".tar.gz"))
5518 (modules '((guix build utils)))
5521 ;; The snapshots lack a .git directory,
5522 ;; breaking ‘git describe’.
5523 (substitute* "Makefile"
5524 (("\"unknown\"") (string-append "\"v" ,version "\"")))
5526 (build-system gnu-build-system)
5528 `(#:phases (modify-phases %standard-phases
5529 (delete 'configure)) ; no configure script
5530 #:make-flags (let ((out (assoc-ref %outputs "out")))
5532 (string-append "prefix=" out)
5533 (string-append "DOCDIR=" out "/share/doc/"
5535 "etcprefix=$(DOCDIR)/examples"))
5536 ;; The tests will only run as root on certain supported CPU models.
5538 (supported-systems (list "i686-linux" "x86_64-linux"))
5539 (home-page "https://mcelog.org/")
5540 (synopsis "Machine check monitor for x86 Linux systems")
5542 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
5543 systems running the kernel Linux. It can also perform user-defined tasks, such
5544 as bringing bad pages off-line, when configurable error thresholds are
5546 (license license:gpl2)))
5548 (define-public mtd-utils
5555 "ftp://ftp.infradead.org/pub/mtd-utils/"
5556 "mtd-utils-" version ".tar.bz2"))
5559 "1lijl89l7hljx8xx70vrz9srd3h41v5gh4b0lvqnlv831yvyh5cd"))))
5561 '(#:configure-flags '("--enable-unit-tests")))
5563 `(("cmocka" ,cmocka)
5564 ("pkg-config" ,pkg-config)))
5566 `(("acl" ,acl) ; extended attributes (xattr)
5567 ("libuuid" ,util-linux "lib")
5569 ("openssl" ,openssl) ; optional crypto support
5571 ("zstd" ,zstd "lib")))
5572 (build-system gnu-build-system)
5573 (synopsis "MTD Flash Storage Utilities")
5574 (description "This package provides utilities for testing, partitioning, etc
5576 (home-page "http://www.linux-mtd.infradead.org/")
5578 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
5579 license:mpl1.1 ; All ftl* files
5580 license:expat)))) ; libiniparser
5582 (define-public libseccomp
5588 (uri (string-append "https://github.com/seccomp/libseccomp/"
5589 "releases/download/v" version
5590 "/libseccomp-" version ".tar.gz"))
5593 "07crwxqzvl5k2b90a47ii9wgvi09s9hsy5b5jddw9ylp351d25fg"))))
5594 (build-system gnu-build-system)
5596 `(("which" ,which)))
5597 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
5598 (description "The libseccomp library provides an easy to use, platform
5599 independent, interface to the Linux Kernel's syscall filtering mechanism. The
5600 libseccomp API is designed to abstract away the underlying BPF based syscall
5601 filter language and present a more conventional function-call based filtering
5602 interface that should be familiar to, and easily adopted by, application
5604 (home-page "https://github.com/seccomp/libseccomp")
5605 (license license:lgpl2.1)))
5607 (define-public radeontop
5615 (url "https://github.com/clbr/radeontop.git")
5616 (commit (string-append "v" version))))
5617 (file-name (git-file-name name version))
5619 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
5620 (build-system gnu-build-system)
5622 `(#:phases (modify-phases %standard-phases
5623 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
5624 ;; dependency, and doesn't even work on release(!) tarballs.
5625 (add-after 'unpack 'report-correct-version
5627 (substitute* "getver.sh"
5629 (string-append "ver=" ,version)))
5631 (delete 'configure)) ; no configure script
5632 #:make-flags (list "CC=gcc"
5633 (string-append "PREFIX=" %output))
5634 #:tests? #f)) ; no tests
5636 `(("gettext" ,gettext-minimal)
5637 ("pkg-config" ,pkg-config)))
5639 `(("libdrm" ,libdrm)
5640 ("libpciaccess" ,libpciaccess)
5642 ("ncurses" ,ncurses)))
5643 (home-page "https://github.com/clbr/radeontop/")
5644 (synopsis "Usage monitor for AMD Radeon graphics")
5645 (description "RadeonTop monitors resource consumption on supported AMD
5646 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
5647 a terminal or saved to a file for further processing. It measures both the
5648 activity of the GPU as a whole, which is also accurate during OpenCL
5649 computations, as well as separate component statistics that are only meaningful
5650 under OpenGL graphics workloads.")
5651 (license license:gpl3)))
5653 (define-public efivar
5659 (uri (string-append "https://github.com/rhboot/" name
5660 "/releases/download/" version "/" name
5661 "-" version ".tar.bz2"))
5664 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
5665 (build-system gnu-build-system)
5667 `(;; Tests require a UEFI system and is not detected in the chroot.
5669 #:make-flags (list (string-append "prefix=" %output)
5670 (string-append "libdir=" %output "/lib")
5672 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5674 (modify-phases %standard-phases
5675 (delete 'configure))))
5677 `(("pkg-config" ,pkg-config)))
5680 (home-page "https://github.com/rhboot/efivar")
5681 (synopsis "Tool and library to manipulate EFI variables")
5682 (description "This package provides a library and a command line
5683 interface to the variable facility of UEFI boot firmware.")
5684 (license license:lgpl2.1+)))
5686 (define-public efibootmgr
5692 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
5693 "/releases/download/" version "/efibootmgr"
5694 "-" version ".tar.bz2"))
5697 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
5698 (build-system gnu-build-system)
5700 `(#:tests? #f ;no tests
5701 #:make-flags (list (string-append "prefix=" %output)
5702 (string-append "libdir=" %output "/lib")
5703 ;; EFIDIR denotes a subdirectory relative to the
5704 ;; EFI System Partition where the loader will be
5705 ;; installed (known as OS_VENDOR in the code).
5706 ;; GRUB overrides this, as such it's only used if
5707 ;; nothing else is specified on the command line.
5709 #:phases (modify-phases %standard-phases (delete 'configure))))
5711 `(("pkg-config" ,pkg-config)))
5713 `(("efivar" ,efivar)
5715 (home-page "https://github.com/rhinstaller/efibootmgr")
5716 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
5718 "@code{efibootmgr} is a user-space application to modify the Intel
5719 Extensible Firmware Interface (EFI) Boot Manager. This application can
5720 create and destroy boot entries, change the boot order, change the next
5721 running boot option, and more.")
5722 (license license:gpl2+)))
5724 (define-public sysstat
5730 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
5731 "sysstat-" version ".tar.xz"))
5734 "1hf1sy7akribmgavadqccxpy49yv0zfb3m81d2bj6jf8pyzwcrbq"))))
5735 (build-system gnu-build-system)
5737 `(#:tests? #f ; No test suite.
5738 ;; Without this flag, it tries to install the man pages with group 'root'
5739 ;; and fails because /etc/passwd lacks an entry for the root user.
5741 (list "--disable-file-attr"
5742 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
5744 (modify-phases %standard-phases
5745 ;; The build process tries to create '/var/lib/sa', so we skip that
5747 (add-after 'build 'skip-touching-var
5749 (substitute* "Makefile"
5750 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
5753 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
5754 (synopsis "Performance monitoring tools for Linux")
5755 (description "The sysstat utilities are a collection of performance
5756 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
5757 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
5758 @code{sadf} and @code{sa}.")
5759 (license license:gpl2+)))
5761 (define-public light
5769 (url "https://github.com/haikarainen/light.git")
5770 (commit (string-append "v" version))))
5772 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
5773 (file-name (git-file-name name version))))
5774 (build-system gnu-build-system)
5777 (modify-phases %standard-phases
5778 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
5779 (lambda* (#:key inputs #:allow-other-keys)
5780 (substitute* "90-backlight.rules"
5781 (("/bin/chgrp") (which "chgrp"))
5782 (("/bin/chmod") (which "chmod")))
5784 (add-after 'install 'install-udev-rules
5785 (lambda* (#:key outputs #:allow-other-keys)
5786 (let ((out (assoc-ref outputs "out")))
5788 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
5791 `(("autoconf" ,autoconf)
5792 ("automake" ,automake)))
5793 (home-page "https://haikarainen.github.io/light/")
5794 (synopsis "GNU/Linux application to control backlights")
5796 "Light is a program to send commands to screen backlight controllers
5797 under GNU/Linux. Features include:
5800 @item It does not rely on X.
5801 @item Light can automatically figure out the best controller to use, making
5802 full use of underlying hardware.
5803 @item It is possible to set a minimum brightness value, as some controllers
5804 set the screen to be pitch black at a vaĺue of 0 (or higher).
5807 Light is the successor of lightscript.")
5808 (license license:gpl3+)))
5810 (define-public brightnessctl
5811 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
5813 (name "brightnessctl")
5814 (version (git-version "0.4" "0" commit))
5818 (url "https://github.com/Hummer12007/brightnessctl/")
5820 (file-name (git-file-name name version))
5823 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
5824 (build-system gnu-build-system)
5826 '(#:tests? #f ; no tests
5827 #:make-flags (list "CC=gcc"
5828 (string-append "PREFIX=" %output)
5829 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
5831 (modify-phases %standard-phases
5833 (add-after 'unpack 'adjust-udev-rules
5835 (substitute* "90-brightnessctl.rules"
5836 (("/bin/") "/run/current-system/profile/bin/"))
5838 (home-page "https://github.com/Hummer12007/brightnessctl")
5839 (synopsis "Backlight and LED brightness control")
5841 "This program allows you read and control device brightness. Devices
5842 include backlight and LEDs. It can also preserve current brightness before
5843 applying the operation, such as on lid close.
5845 The appropriate permissions must be set on the backlight or LED control
5846 interface in sysfs, which can be accomplished with the included udev rules.")
5847 (license license:expat))))
5857 (url "https://github.com/linrunner/TLP.git")
5859 (file-name (git-file-name name version))
5861 (base32 "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5"))))
5863 `(("shellcheck" ,shellcheck)))
5867 ("ethtool" ,ethtool)
5871 ("inetutils" ,inetutils)
5874 ("pciutils" ,pciutils)
5878 ("usbutils" ,usbutils)
5879 ("util-linux" ,util-linux)
5880 ("wireless-tools" ,wireless-tools)
5881 ,@(if (let ((system (or (%current-target-system)
5882 (%current-system))))
5883 (or (string-prefix? "i686-" system)
5884 (string-prefix? "x86_64-" system)))
5885 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
5887 (build-system gnu-build-system)
5889 ;; XXX: The full test suite is run with "checkall" but it requires
5890 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
5891 `(#:test-target "shellcheck"
5892 #:modules ((guix build gnu-build-system)
5896 (modify-phases %standard-phases
5897 (delete 'configure) ; no configure script
5898 (add-before 'build 'setenv
5899 (lambda* (#:key outputs #:allow-other-keys)
5900 (let ((out (assoc-ref outputs "out")))
5901 (setenv "TLP_WITH_SYSTEMD" "0")
5902 (setenv "TLP_NO_INIT" "1")
5903 (setenv "TLP_NO_PMUTILS" "1")
5904 (setenv "TLP_SBIN" (string-append out "/bin"))
5905 (setenv "TLP_BIN" (string-append out "/bin"))
5906 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
5907 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
5908 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
5909 (setenv "TLP_CONFDEF"
5910 (string-append out "/share/tlp/defaults.conf"))
5911 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
5913 (string-append out "/lib/elogind/system-sleep"))
5915 (string-append out "/share/bash-completion/completions"))
5916 (setenv "TLP_MAN" (string-append out "/share/man"))
5917 (setenv "TLP_META" (string-append out "/share/metainfo"))
5919 (add-before 'install 'fix-installation
5921 ;; Stop the Makefile from trying to create system directories.
5922 (substitute* "Makefile"
5923 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
5924 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
5927 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
5928 (add-after 'install 'wrap
5929 (lambda* (#:key inputs outputs #:allow-other-keys)
5930 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
5931 (bin-files (find-files bin ".*")))
5932 (define (bin-directory input-name)
5933 (let ((p (assoc-ref inputs input-name)))
5934 (and p (string-append p "/bin"))))
5935 (define (sbin-directory input-name)
5936 (string-append (assoc-ref inputs input-name) "/sbin"))
5937 (for-each (lambda (program)
5938 (wrap-program program
5941 (filter-map bin-directory
5953 "x86-energy-perf-policy"))
5954 (filter-map sbin-directory
5960 "wireless-tools"))))))
5963 (home-page "https://linrunner.de/en/tlp/tlp.html")
5964 (synopsis "Power management tool for Linux")
5965 (description "TLP is a power management tool for Linux. It comes with
5966 a default configuration already optimized for battery life. Nevertheless,
5967 TLP is customizable to fulfil system requirements. TLP settings are applied
5968 every time the power supply source is changed.")
5969 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
5971 (license (list license:gpl2+ license:gpl3+))))
5979 (uri (string-append "https://www.ezix.org/software/"
5980 "files/lshw-" version
5984 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
5985 (build-system gnu-build-system)
5987 `(#:phases (modify-phases %standard-phases (delete 'configure))
5988 #:tests? #f ; no tests
5990 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
5991 (synopsis "List hardware information")
5993 "@command{lshw} (Hardware Lister) is a small tool to provide
5994 detailed information on the hardware configuration of the machine.
5995 It can report exact memory configuration, firmware version, mainboard
5996 configuration, CPU version and speed, cache configuration, bus speed,
5997 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
5998 machines (PowerMac G4 is known to work).")
5999 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
6000 (license license:gpl2+)))
6002 (define-public libmnl
6009 (uri (string-append "mirror://netfilter.org/libmnl/"
6010 "libmnl-" version ".tar.bz2"))
6013 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
6014 (build-system gnu-build-system)
6015 (home-page "https://www.netfilter.org/projects/libmnl/")
6016 (synopsis "Netlink utility library")
6017 (description "Libmnl is a minimalistic user-space library oriented to
6018 Netlink developers. There are a lot of common tasks in parsing, validating,
6019 constructing of both the Netlink header and TLVs that are repetitive and easy to
6020 get wrong. This library aims to provide simple helpers that allows you to
6021 re-use code and to avoid re-inventing the wheel.")
6022 (license license:lgpl2.1+)))
6024 (define-public libnftnl
6031 (uri (string-append "mirror://netfilter.org/libnftnl/"
6032 "libnftnl-" version ".tar.bz2"))
6034 (base32 "1jhyxsfrfqjascrm5lnxlcyzj6n0gc0qc1bp2asb7m61dxlmmsy1"))))
6035 (build-system gnu-build-system)
6037 `(("pkg-config" ,pkg-config)))
6039 `(("libmnl" ,libmnl)))
6040 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
6041 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
6042 (description "Libnftnl is a userspace library providing a low-level netlink
6043 programming interface to the in-kernel nf_tables subsystem. The library
6044 libnftnl has been previously known as libnftables. This library is currently
6046 (license license:gpl2+)))
6048 (define-public nftables
6055 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
6057 (string-append "https://www.nftables.org/projects/nftables"
6058 "/files/nftables-" version ".tar.bz2")))
6060 (base32 "0y6vbqp6x8w165q65h4n9sba1406gaz0d4744gqszbm7w9f92swm"))))
6061 (build-system gnu-build-system)
6062 (arguments `(#:configure-flags
6063 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
6064 (inputs `(("gmp" ,gmp)
6066 ("libnftnl" ,libnftnl)
6067 ("readline" ,readline)))
6068 (native-inputs `(("pkg-config" ,pkg-config)
6071 (home-page "https://www.nftables.org")
6072 (synopsis "Userspace utility for Linux packet filtering")
6073 (description "nftables is the project that aims to replace the existing
6074 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
6075 filtering framework, a new userspace utility and also a compatibility layer for
6076 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
6077 infrastructure such as the existing hooks, the connection tracking system, the
6078 userspace queueing component and the logging subsystem.")
6079 (license license:gpl2)))
6081 (define-public proot
6089 (url "https://github.com/proot-me/PRoot.git")
6090 (commit (string-append "v" version))))
6091 (file-name (git-file-name name version))
6093 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
6094 (patches (search-patches "proot-test-fhs.patch"))))
6095 (build-system gnu-build-system)
6097 '(#:make-flags '("-C" "src")
6099 #:phases (modify-phases %standard-phases
6101 (add-before 'build 'set-shell-file-name
6102 (lambda* (#:key inputs #:allow-other-keys)
6103 (substitute* (find-files "src" "\\.[ch]$")
6106 (assoc-ref inputs "bash")
6109 (add-before 'check 'fix-fhs-assumptions-in-tests
6111 (substitute* "tests/test-c6b77b77.mk"
6112 (("/bin/bash") (which "bash"))
6113 (("/usr/bin/test") (which "test")))
6114 (substitute* '("tests/test-16573e73.c")
6115 (("/bin/([a-z-]+)" _ program)
6118 (substitute* (find-files "tests" "\\.sh$")
6119 ;; Some of the tests try to "bind-mount" /bin/true.
6121 (string-append "-b " (which "true") ":"))
6122 ;; Likewise for /bin.
6123 (("-b /bin:") "-b /gnu:")
6124 ;; Others try to run /bin/sh.
6125 (("/bin/sh") (which "sh"))
6126 ;; Others assume /etc/fstab exists.
6127 (("/etc/fstab") "/etc/passwd"))
6129 (substitute* "tests/GNUmakefile"
6130 (("-b /bin:") "-b /gnu:"))
6132 ;; XXX: This test fails in an obscure corner case, just
6134 (delete-file "tests/test-kkkkkkkk.c")
6139 (let ((n (parallel-job-count)))
6140 ;; For some reason we get lots of segfaults with
6141 ;; seccomp support (x86_64, Linux-libre 4.11.0).
6142 (setenv "PROOT_NO_SECCOMP" "1")
6144 ;; Most of the tests expect "/bin" to be in $PATH so
6145 ;; they can run things that live in $ROOTFS/bin.
6147 (string-append (getenv "PATH") ":/bin"))
6149 (invoke "make" "check" "-C" "tests"
6151 "-j" (number->string n)))))
6153 (lambda* (#:key outputs #:allow-other-keys)
6154 ;; The 'install' rule does nearly nothing.
6155 (let* ((out (assoc-ref outputs "out"))
6156 (man1 (string-append out "/share/man/man1")))
6157 ;; TODO: 'make install-care' (does not even
6158 ;; build currently.)
6159 (invoke "make" "-C" "src" "install"
6160 (string-append "PREFIX=" out))
6163 (copy-file "doc/proot/man.1"
6164 (string-append man1 "/proot.1"))
6166 (native-inputs `(("which" ,which)
6168 ;; For 'mcookie', used by some of the tests.
6169 ("util-linux" ,util-linux)
6171 ;; XXX: Choose the old coreutils because its 'stat'
6172 ;; program does not use statx(2) when running 'stat -c
6173 ;; %a' or similar, which PRoot doesn't properly support.
6174 ("coreutils-old" ,coreutils-8.30)
6176 ;; XXX: 'test-c6b77b77.sh' runs 'make' and that leads
6177 ;; make 4.3 to segfault.
6178 ("make-old" ,gnu-make-4.2)))
6179 (inputs `(("talloc" ,talloc)))
6180 (home-page "https://github.com/proot-me/PRoot")
6181 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
6183 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
6184 and @code{binfmt_misc}. This means that users don't need any privileges or
6185 setup to do things like using an arbitrary directory as the new root
6186 file system, making files accessible somewhere else in the file system
6187 hierarchy, or executing programs built for another CPU architecture
6188 transparently through QEMU user-mode. Also, developers can use PRoot as a
6189 generic process instrumentation engine thanks to its extension mechanism.
6190 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
6191 available in the kernel Linux.")
6192 (license license:gpl2+)))
6194 (define-public proot-static
6197 (name "proot-static")
6199 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
6200 (inputs `(("talloc" ,talloc/static)))
6202 (substitute-keyword-arguments (package-arguments proot)
6203 ((#:make-flags flags)
6204 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
6206 `(modify-phases ,phases
6207 (add-after 'strip 'remove-store-references
6208 (lambda* (#:key outputs #:allow-other-keys)
6209 (let* ((out (assoc-ref outputs "out")))
6210 (with-directory-excursion out
6211 (remove-store-references "bin/proot")
6213 ((#:allowed-references _ '("out"))
6216 (define-public cpuid
6219 (version "20200211")
6222 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
6223 version ".src.tar.gz"))
6226 "06sjbqqp80l7nhsp6khglkzdp9qy4vhbvjxbfilznhsmrqiwlw55"))))
6227 (build-system gnu-build-system)
6229 '(#:make-flags '("CC=gcc")
6230 #:tests? #f ; no tests
6231 #:phases (modify-phases %standard-phases
6232 (delete 'configure) ; no configure script
6233 (add-before 'install 'fix-makefile
6234 (lambda* (#:key outputs #:allow-other-keys)
6235 (substitute* "Makefile"
6236 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
6237 ;; Make the compressed manpages writable so that the
6238 ;; reset-gzip-timestamps phase does not error out.
6239 (substitute* "Makefile"
6240 (("-m 444") "-m 644"))
6242 (inputs `(("perl" ,perl)))
6243 (supported-systems '("i686-linux" "x86_64-linux"))
6244 (home-page "http://www.etallen.com/cpuid.html")
6245 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
6246 (description "cpuid dumps detailed information about the CPU(s) gathered
6247 from the CPUID instruction, and also determines the exact model of CPU(s). It
6248 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
6249 NexGen, Rise, and SiS CPUs.")
6250 (license license:gpl2+)))
6252 (define-public jmtpfs
6259 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
6261 (file-name (string-append name "-" version ".tar.gz"))
6264 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
6265 (build-system gnu-build-system)
6269 ("libmtp" ,libmtp)))
6271 `(("pkg-config" ,pkg-config)))
6272 (home-page "https://github.com/JasonFerrara/jmtpfs")
6273 (synopsis "Use a FUSE file system to access data over MTP")
6274 (description "jmtpfs uses FUSE (file system in userspace) to provide access
6275 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
6276 the MTP device as a file system.")
6277 (license license:gpl3)))
6279 (define-public procenv
6286 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
6288 (file-name (string-append name "-" version ".tar.gz"))
6290 (base32 "1javw97yw0qvjmj14js8vw6nsfyf2xc0kfiyq5f2hsp0553w2cdq"))))
6291 (build-system gnu-build-system)
6292 (arguments `(#:configure-flags '("--disable-silent-rules")))
6293 (native-inputs `(("groff" ,groff) ; for tests
6294 ("pkg-config" ,pkg-config)))
6295 (inputs `(("check" ,check)
6298 ("libselinux" ,libselinux)))
6299 (synopsis "Utility to show process environment")
6300 (description "Procenv is a command-line tool that displays as much detail about
6301 itself and its environment as possible. It can be used as a test
6302 tool, to understand the type of environment a process runs in, and for
6303 comparing system environments.")
6304 (home-page "http://github.com/jamesodhunt/procenv/")
6305 (license license:gpl3+)))
6307 (define-public libfabric
6315 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
6316 version "/libfabric-" version ".tar.bz2"))
6318 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
6319 (build-system gnu-build-system)
6320 (inputs `(("rdma-core" ,rdma-core)
6321 ,@(match (%current-system)
6322 ((member (package-supported-systems psm))
6326 (home-page "https://ofiwg.github.io/libfabric/")
6327 (synopsis "Open Fabric Interfaces")
6329 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
6330 communication services to applications. OFI is best described as a collection
6331 of libraries and applications used to export fabric services. The key
6332 components of OFI are: application interfaces, provider libraries, kernel
6333 services, daemons, and test applications.
6335 Libfabric is a core component of OFI. It is the library that defines and
6336 exports the user-space API of OFI, and is typically the only software that
6337 applications deal with directly. It works in conjunction with provider
6338 libraries, which are often integrated directly into libfabric.")
6339 (license (list license:bsd-2 license:gpl2)))) ;dual
6344 (version "3.3.20170428")
6345 (home-page "https://github.com/intel/psm")
6349 (uri (git-reference (url home-page)
6350 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
6351 (file-name (string-append "psm-" version ".tar.gz"))
6353 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
6354 (patches (search-patches
6355 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
6356 "psm-ldflags.patch" ; build shared lib with LDFLAGS
6357 "psm-repro.patch" ; reproducibility
6358 "psm-disable-memory-stats.patch"))))
6359 (build-system gnu-build-system)
6360 (outputs '("out" "debug"))
6361 (inputs `(("libuuid" ,util-linux "lib")))
6363 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
6364 ,(string-append "INSTALL_PREFIX=" %output)
6365 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6367 #:phases (modify-phases %standard-phases
6369 (add-after 'unpack 'patch-/usr/include
6371 (substitute* "Makefile"
6372 (("\\$\\{DESTDIR}/usr/include")
6373 (string-append %output "/include")))
6374 (substitute* "Makefile"
6375 (("/lib64") "/lib"))
6377 (add-after 'unpack 'patch-sysmacros
6379 (substitute* "ipath/ipath_proto.c"
6380 (("#include <sys/poll.h>" m)
6381 (string-append m "\n"
6382 "#include <sys/sysmacros.h>")))
6384 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
6386 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
6387 communications interface for the True Scale family of products. PSM users are
6388 enabled with mechanisms necessary to implement higher level communications
6389 interfaces in parallel environments.")
6390 ;; Only Intel-compatable processors are supported.
6391 (supported-systems '("i686-linux" "x86_64-linux"))
6392 (license (list license:bsd-2 license:gpl2)))) ;dual
6394 (define-public snapscreenshot
6396 (name "snapscreenshot")
6397 (version "1.0.14.3")
6401 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
6402 name "-" version ".tar.bz2"))
6404 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
6405 (build-system gnu-build-system)
6408 (let ((out (assoc-ref %outputs "out")))
6409 (list (string-append "BINDIR=" out "/bin")
6410 (string-append "MANDIR=" out "/share/man")))
6411 #:tests? #f ; no test suite
6413 (modify-phases %standard-phases
6414 (delete 'configure) ; ./configure is a snarky no-op
6415 (add-before 'install 'fix-ownership
6416 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
6418 (substitute* "depfun.mak"
6419 ((" -o bin -g bin ") " "))
6421 (add-before 'install 'create-output-directories
6422 (lambda* (#:key outputs #:allow-other-keys)
6423 (let ((out (assoc-ref outputs "out")))
6424 (mkdir-p (string-append out "/share/man/man1"))
6426 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
6427 (synopsis "Take screenshots of one or more Linux text consoles")
6429 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
6430 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
6431 relevant @file{/dev/vcs*} file(s).")
6432 (license license:gpl2)))
6434 (define-public fbcat
6441 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
6442 version "/" name "-" version ".tar.gz"))
6444 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
6445 (build-system gnu-build-system)
6447 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
6448 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
6449 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
6450 `(("pnmtopng" ,netpbm)))
6451 (outputs (list "out" "fbgrab"))
6455 (string-append "PREFIX=" (assoc-ref %outputs "out")))
6456 #:tests? #f ; no tests
6458 (modify-phases %standard-phases
6459 (delete 'configure) ; no configure script
6460 (add-after 'build 'qualify-references
6461 (lambda* (#:key inputs outputs #:allow-other-keys)
6462 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
6463 (out (assoc-ref outputs "out")))
6464 (substitute* "fbgrab"
6466 (string-append out "/bin/" all))
6468 (string-append pnmtopng "/bin/" all)))
6470 (add-after 'install 'split-fbgrab-output
6471 (lambda* (#:key outputs #:allow-other-keys)
6472 (let* ((out (assoc-ref outputs "out"))
6473 (out:fbgrab (assoc-ref outputs "fbgrab")))
6474 (for-each (lambda (file)
6475 (let ((old (string-append out "/" file))
6476 (new (string-append out:fbgrab "/" file)))
6477 (mkdir-p (dirname new))
6478 (rename-file old new)))
6480 "share/man/man1/fbgrab.1"))
6482 (home-page "https://jwilk.net/software/fbcat")
6483 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
6485 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
6486 a dump therof. It supports a wide range of drivers and pixel formats.
6487 @command{fbcat} can take screenshots of virtually any application that can be
6488 made to write its output to the framebuffer, including (but not limited to)
6489 text-mode or graphical applications that don't use a display server.
6491 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
6492 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
6493 (license license:gpl2)))
6495 (define-public libcgroup
6503 "mirror://sourceforge/libcg/" name "/"
6504 version "/" name "-" version ".tar.bz2"))
6506 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
6507 (build-system gnu-build-system)
6514 `(("linux-pam" ,linux-pam)))
6515 (home-page "https://sourceforge.net/projects/libcg/")
6516 (synopsis "Control groups management tools")
6517 (description "Control groups is Linux kernel method for process resource
6518 restriction, permission handling and more. This package provides userspace
6519 interface to this kernel feature.")
6520 (license license:lgpl2.1)))
6522 (define-public mbpfan
6530 (url "https://github.com/dgraziotin/mbpfan.git")
6531 (commit (string-append "v" version))))
6532 (file-name (git-file-name name version))
6534 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
6535 (build-system gnu-build-system)
6537 `(#:tests? #f ; tests ask to be run as root
6538 #:make-flags (let ((out (assoc-ref %outputs "out")))
6539 (list (string-append "DESTDIR=" out)
6540 ,(string-append "CC=" (cc-for-target))))
6542 (modify-phases %standard-phases
6543 (add-after 'unpack 'patch-paths
6545 (substitute* "Makefile"
6548 (delete 'configure)))) ; there's no configure phase
6549 (home-page "https://github.com/dgraziotin/mbpfan")
6550 (synopsis "Control fan speed on Macbooks")
6552 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
6553 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
6554 module. It can be executed as a daemon or in the foreground with root
6556 (license license:gpl3+)))
6565 (url "https://github.com/intel/opa-psm2.git")
6566 (commit (string-append "PSM2_" version))))
6567 (file-name (git-file-name name version))
6570 "1hiqzcmc97lzhaqjva82vf8irgg038cciypsv2brw90ak09n6vwf"))))
6571 (build-system gnu-build-system)
6574 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6576 #:phases (modify-phases %standard-phases
6578 (add-after 'unpack 'patch-Makefiles
6580 (substitute* "Makefile"
6583 (substitute* "compat/Makefile"
6589 (setenv "DESTDIR" %output)
6590 (invoke "make" "install")
6593 `(("rdma-core" ,rdma-core)
6594 ("numactl" ,numactl)))
6595 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
6597 "This package is low-level user-level Intel's communications interface.
6598 The PSM2 API is a high-performance vendor-specific protocol that provides a
6599 low-level communications interface for the Intel Omni-Path family of
6600 high-speed networking devices.")
6601 (home-page "https://github.com/intel/opa-psm2")
6602 ;; Only the x86_64 architecure is supported.
6603 (supported-systems '("x86_64-linux"))
6604 (license (list license:bsd-3 license:gpl2)))) ; dual
6606 (define-public libpfm4
6612 (uri (string-append "mirror://sourceforge/perfmon2/"
6613 name "/libpfm-" version ".tar.gz"))
6616 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
6617 (build-system gnu-build-system)
6619 '(#:modules ((guix build utils)
6620 (guix build gnu-build-system))
6621 #:phases (modify-phases %standard-phases
6625 (lambda* (#:key inputs outputs #:allow-other-keys)
6626 (let* ((out (assoc-ref outputs "out")))
6631 (lambda* (#:key outputs #:allow-other-keys)
6632 (let* ((out (assoc-ref outputs "out")))
6634 (string-append "PREFIX=" out)
6637 (synopsis "Performance event monitoring library")
6639 "This package provides a library called libpfm4, which is used to develop
6640 monitoring tools exploiting the performance monitoring events such as those
6641 provided by the Performance Monitoring Unit (PMU) of modern processors.
6643 Libpfm4 helps convert from an event name, expressed as a string, to the event
6644 encoding that is either the raw event as documented by the hardware vendor or
6645 the OS-specific encoding. In the latter case, the library is able to prepare
6646 the OS-specific data structures needed by the kernel to setup the event.
6648 libpfm4 provides support for the @code{perf_events} interface, which was
6649 introduced in Linux 2.6.31.")
6650 (home-page "http://perfmon2.sourceforge.net/")
6651 (license license:expat)))
6653 (define-public libnfnetlink
6655 (name "libnfnetlink")
6660 "https://www.netfilter.org/projects/libnfnetlink/files/"
6661 "libnfnetlink-" version ".tar.bz2"))
6664 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
6665 (build-system gnu-build-system)
6666 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
6667 (synopsis "Low-level netfilter netlink communication library")
6669 "@code{libnfnetlink} is the low-level library for netfilter related
6670 kernel/userspace communication. It provides a generic messaging
6671 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
6672 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
6673 management tools in userspace.")
6674 (license license:gpl2)))
6676 (define-public go-netlink
6683 (url "https://github.com/vishvananda/netlink.git")
6684 (commit (string-append "v" version))))
6685 (file-name (git-file-name name version))
6688 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
6689 (build-system go-build-system)
6691 `(#:import-path "github.com/vishvananda/netlink"))
6693 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
6694 ("go-netns" ,go-netns)))
6695 (home-page "https://github.com/vishvananda/netlink")
6696 (synopsis "Simple netlink library for Go")
6697 (description "The netlink package provides a simple netlink library for
6698 Go. Netlink is the interface a user-space program in Linux uses to
6699 communicate with the kernel. It can be used to add and remove interfaces, set
6700 IP addresses and routes, and configure IPsec.")
6701 (license license:asl2.0)))
6703 (define-public xfsprogs
6710 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
6711 "xfsprogs-" version ".tar.gz"))
6714 "0q5xd4gb9g83h82mg68cx616ifzl8qkzzlgg5xna698117ph3wky"))))
6715 (build-system gnu-build-system)
6716 (outputs (list "out" "python"))
6718 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
6720 (modify-phases %standard-phases
6721 (add-after 'install 'separate-python-output
6722 (lambda* (#:key outputs #:allow-other-keys)
6723 (let ((out (assoc-ref outputs "out"))
6724 (python (assoc-ref outputs "python")))
6727 (mkdir-p (string-append python (dirname script)))
6728 (rename-file (string-append out script)
6729 (string-append python script)))
6730 (list "/sbin/xfs_scrub_all"))
6732 (add-after 'install 'install-headers
6734 (invoke "make" "install-dev"))))))
6736 `(("gettext" ,gettext-minimal)))
6738 `(("libuuid" ,util-linux "lib")
6739 ("python" ,python-wrapper)))
6740 (home-page "https://xfs.wiki.kernel.org/")
6741 (synopsis "XFS file system tools")
6742 (description "This package provides commands to create and check XFS
6744 ;; The library "libhandle" and the headers in "xfslibs-dev" are
6745 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
6746 (license (list license:gpl2 license:lgpl2.1))))
6748 (define-public genext2fs
6755 (url "https://github.com/jeremie-koenig/genext2fs.git")
6756 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
6757 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
6758 (file-name (git-file-name name version))
6760 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
6761 (build-system gnu-build-system)
6764 (modify-phases %standard-phases
6765 (add-after 'unpack 'apply-debian-patches
6766 ;; Debian changes (the revision after ‘-’ in VERSION) are
6767 ;; maintained as separate patches. Apply those relevant to us.
6771 (invoke "patch" "-p1" "-i"
6772 (string-append "debian/patches/" file-name)))
6773 (list "blocksize+creator.diff" ; add -B/-o options
6774 "byteswap_fix.diff"))
6777 `(("autoconf" ,autoconf)
6778 ("automake" ,automake)))
6779 (home-page "https://github.com/jeremie-koenig/genext2fs")
6780 (synopsis "Generate ext2 file system as a normal user")
6781 (description "This package provides a program to generate an ext2
6782 file system as a normal (non-root) user. It does not require you to mount
6783 the image file to copy files on it, nor does it require that you become
6784 the superuser to make device nodes.")
6785 (license license:gpl2)))
6787 (define-public fakeroot
6793 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
6794 "fakeroot/fakeroot_" version ".orig.tar.gz"))
6795 (file-name (string-append name "-" version ".tar.gz"))
6798 "1vb6f93hjyqnwx8dc8mm3dgma7axgqk8s7sdsjs8l2rpc0qmn11f"))))
6799 (build-system gnu-build-system)
6802 (modify-phases %standard-phases
6803 (add-after 'configure 'patch-Makefile
6805 ;; Note: The root of the problem is already in "Makefile.am".
6806 (substitute* "Makefile"
6807 (("/bin/sh") (which "sh")))
6809 (add-after 'unpack 'patch-getopt
6810 (lambda* (#:key inputs #:allow-other-keys)
6811 (substitute* "scripts/fakeroot.in"
6813 (string-append (assoc-ref inputs "util-linux")
6816 (add-before 'configure 'setenv
6818 (setenv "LIBS" "-lacl")
6820 (add-before 'check 'prepare-check
6822 (setenv "SHELL" (which "bash"))
6823 (setenv "VERBOSE" "1")
6824 (substitute* "test/t.touchinstall"
6825 ;; We don't have the name of the root user, so use ID=0.
6826 (("grep root") "grep \"\\<0\\>\""))
6827 (substitute* "test/tartest"
6828 ;; We don't have the name of the root group, so use ID=0.
6829 (("ROOTGROUP=root") "ROOTGROUP=0")
6830 ;; We don't have the name of the daemon user, so use IDs.
6831 (("daemon:sys") "1:3")
6833 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
6834 (substitute* "test/compare-tar"
6835 (("tar -tvf") "tar --numeric-owner -tvf"))
6837 ;; coreutils 8.32 changed 'ls' to use the statx() syscall instead
6838 ;; of lstat(). fakeroot 1.24 does not support the former, so
6839 ;; adjust these tests to use 'test -b' instead of 'ls' to test for
6840 ;; block device. See <https://bugs.gnu.org/41090>.
6841 (substitute* '("test/t.mknod" "test/t.chmod_dev")
6842 (("ls -ld? \\$tmp/hda3")
6843 "test -b $tmp/hda3 && echo block || echo fail"))
6847 ("sharutils" ,sharutils) ; for the tests
6848 ("xz" ,xz))) ; for the tests
6850 `(("libcap" ,libcap/next)
6851 ("util-linux" ,util-linux)))
6852 (synopsis "Provides a fake root environment")
6853 (description "@command{fakeroot} runs a command in an environment where
6854 it appears to have root privileges for file manipulation. This is useful
6855 for allowing users to create archives (tar, ar, .deb etc.) with files in
6856 them with root permissions/ownership. Without fakeroot one would have to
6857 have root privileges to create the constituent files of the archives with
6858 the correct permissions and ownership, and then pack them up, or one would
6859 have to construct the archives directly, without using the archiver.")
6860 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
6861 (license license:gpl3+)))
6863 (define-public fakechroot
6870 "https://github.com/dex4er/fakechroot/releases/download/"
6871 version "/fakechroot-" version ".tar.gz"))
6874 "1aijkd0b45wav25v01qhw8zxwa3pl0nnp9fabmmy1nlx7hr09gas"))))
6875 (build-system gnu-build-system)
6877 ;; XXX: The tests heavily assume they run on an FHS system so for now
6880 #:configure-flags '("--disable-static")))
6881 (synopsis "Emulate @code{chroot} by overriding file system calls")
6883 "@command{fakechroot} runs a command in an environment were is additional
6884 possibility to use @code{chroot} command without root privileges. This is
6885 useful for allowing users to create own chrooted environment with possibility
6886 to install another packages without need for root privileges.
6888 It works by providing @file{libfakechroot.so}, a shared library meant to be
6889 set as @code{LD_PRELOAD} to override the C library file system functions.")
6890 (home-page "https://github.com/dex4er/fakechroot/")
6891 (license license:lgpl2.1+)))
6893 (define-public inputattach
6895 (name "inputattach")
6900 (url "https://github.com/linuxwacom/input-wacom.git")
6901 (commit (string-append "input-wacom-" version))))
6902 (file-name (git-file-name name version))
6904 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
6905 (build-system gnu-build-system)
6908 (modify-phases %standard-phases
6912 (lambda* (#:key inputs #:allow-other-keys)
6913 (with-directory-excursion "inputattach"
6914 (invoke (string-append (assoc-ref inputs "gcc")
6916 "-O2" "-o" "inputattach" "inputattach.c"))
6920 (lambda* (#:key outputs #:allow-other-keys)
6921 (let ((target-dir (string-append
6922 (assoc-ref outputs "out")
6924 (mkdir-p target-dir)
6925 (copy-file "inputattach/inputattach"
6926 (string-append target-dir
6929 (home-page "https://linuxwacom.github.io/")
6930 (synopsis "Dispatch input peripherals events to a device file")
6931 (description "inputattach dispatches input events from several device
6932 types and interfaces and translates so that the X server can use them.")
6933 (license license:gpl2+)))
6935 (define-public pipewire
6942 (url "https://github.com/PipeWire/pipewire")
6944 (file-name (git-file-name name version))
6947 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
6948 (build-system meson-build-system)
6950 '(#:configure-flags '("-Dsystemd=false")))
6952 `(("pkg-config" ,pkg-config)))
6954 `(("alsa-lib" ,alsa-lib)
6958 ("gstreamer" ,gstreamer)
6959 ("gst-plugins-base" ,gst-plugins-base)
6963 (home-page "https://pipewire.org/")
6964 (synopsis "Server and user space API to deal with multimedia pipelines")
6966 "PipeWire is a project that aims to greatly improve handling of audio and
6967 video under Linux. It aims to support the usecases currently handled by both
6968 PulseAudio and Jack and at the same time provide same level of powerful handling
6969 of Video input and output. It also introduces a security model that makes
6970 interacting with audio and video devices from containerized applications easy,
6971 with supporting Flatpak applications being the primary goal. Alongside Wayland
6972 and Flatpak we expect PipeWire to provide a core building block for the future
6973 of Linux application development.")
6974 (license license:lgpl2.0+)))
6983 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
6985 (file-name (git-file-name name version))
6988 "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10"))))
6989 (build-system gnu-build-system)
6992 (modify-phases %standard-phases
6993 (add-after 'unpack 'fix-dbus-tests
6995 (substitute* '("unit/test-dbus-message-fds.c"
6996 "unit/test-dbus-properties.c"
6998 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
7003 `(("autoconf" ,autoconf)
7004 ("libtool" ,libtool)
7005 ("pkgconfig" ,pkg-config)
7006 ("automake" ,automake)))
7007 (home-page "https://01.org/ell")
7008 (synopsis "Embedded Linux Library")
7009 (description "The Embedded Linux* Library (ELL) provides core, low-level
7010 functionality for system daemons. It typically has no dependencies other than
7011 the Linux kernel, C standard library, and libdl (for dynamic linking). While
7012 ELL is designed to be efficient and compact enough for use on embedded Linux
7013 platforms, it is not limited to resource-constrained systems.")
7014 (license license:lgpl2.1+)))
7016 (define-public lttng-ust
7022 (uri (string-append "https://lttng.org/files/lttng-ust/"
7023 "lttng-ust-" version ".tar.bz2"))
7026 "1n646yz7882svf5a4ay3vqiiz3qjn3pgkkij9kk22871wp7q0ck8"))))
7027 (build-system gnu-build-system)
7029 `(("liburcu" ,liburcu)
7030 ("numactl" ,numactl)))
7032 `(("python" ,python-3)))
7033 (home-page "https://lttng.org/")
7034 (synopsis "LTTng userspace tracer libraries")
7035 (description "The user space tracing library, liblttng-ust, is the LTTng
7036 user space tracer. It receives commands from a session daemon, for example to
7037 enable and disable specific instrumentation points, and writes event records
7038 to ring buffers shared with a consumer daemon.")
7039 (license license:lgpl2.1+)))
7041 (define-public kexec-tools
7043 (name "kexec-tools")
7047 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
7048 "/kexec/kexec-tools-" version ".tar.xz"))
7051 "1j7qlhxk1rbv9jbj8wd6hb7zl8p2mp29ymrmccgmsi0m0dzhgn6s"))))
7052 (build-system gnu-build-system)
7054 ;; There are no automated tests.
7056 (home-page "https://projects.horms.net/projects/kexec/")
7057 (synopsis "Tools for booting directly into different kernels")
7058 (description "This package provides the @code{kexec} program and ancillary
7059 utilities. Using @code{kexec}, it is possible to boot directly into a new
7060 kernel from the context of an already-running kernel, bypassing the normal
7061 system boot process.")
7062 (license license:gpl2)))
7064 (define-public cachefilesd
7066 (name "cachefilesd")
7071 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
7072 "/cachefilesd.git/snapshot/cachefilesd-"
7076 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
7077 (build-system gnu-build-system)
7080 `(#:tests? #f ; there are no tests
7082 (let ((prefix-dir (lambda (var dir)
7083 (string-append var "=" %output "/" dir))))
7084 (list (string-append "CC=" ,(cc-for-target))
7085 (prefix-dir "SBINDIR" "sbin/")
7086 (prefix-dir "ETCDIR" "etc/")
7087 (prefix-dir "MANDIR" "share/man/")))
7088 #:phases (modify-phases %standard-phases (delete 'configure))))
7089 (home-page "https://people.redhat.com/~dhowells/cachefs/")
7090 (synopsis "CacheFiles userspace management daemon")
7091 (description "@code{cachefilesd} is a userspace daemon that manages the
7092 cache data store that is used by network file systems such as @code{AFS} and
7093 @code{NFS} to cache data locally on disk. The content of the cache is
7094 persistent over reboots.")
7095 (license license:gpl2+)))