gnu: Add linux-libre-arm-generic-5.6.
[jackhill/guix/guix.git] / gnu / packages / linux.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
24a4a635 2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
35dfcdd7 3;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
233e7676 4;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
ec80220c 5;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org>
31aa4379 6;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
e1e27737 7;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
a428fdd4 8;;; Copyright © 2015, 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
1348185a 9;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
e0dde179 10;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
7994250f 11;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com>
96e9f097 12;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org>
dc9bdb1e 13;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
8a890f3c 14;;; Copyright © 2016, 2018, 2019, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
35faa006 15;;; Copyright © 2016, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
9b0942c1 16;;; Copyright © 2016 David Craven <david@craven.ch>
594d740d 17;;; Copyright © 2016 John Darrington <jmd@gnu.org>
71e0f1e9 18;;; Copyright © 2016, 2017, 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
5849c68a 19;;; Copyright © 2016, 2018 Rene Saavedra <pacoon@protonmail.com>
440a3143 20;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
47956fa0 21;;; Copyright © 2016, 2017 ng0 <ng0@n0.is>
af23710f 22;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
01be4f93 23;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
189d8422 24;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
c7adafa7 25;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
1113386b 26;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
9cb4bda2 27;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
3116c8b5 28;;; Copyright © 2017 nee <nee-git@hidamari.blue>
a73e7dd3 29;;; Copyright © 2017 Dave Love <fx@gnu.org>
25637b77 30;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
dcfa0acd 31;;; Copyright © 2018 Brendan Tildesley <mail@brendan.scot>
a0a273c1 32;;; Copyright © 2018 Manuel Graf <graf@init.at>
ff598353 33;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
b2a5ef2e 34;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
bf2a9969 35;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
76f5428b 36;;; Copyright © 2019, 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
71bd55cb 37;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com>
2f3c0fb3 38;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
9844848b 39;;; Copyright © 2019, 2020 Brice Waegeneire <brice@waegenei.re>
8c6c97de 40;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
baa195dd 41;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
a69bc738 42;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
dedbdacf 43;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
c06c7a3a 44;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
fd76c904 45;;;
233e7676 46;;; This file is part of GNU Guix.
fd76c904 47;;;
233e7676 48;;; GNU Guix is free software; you can redistribute it and/or modify it
fd76c904
LC
49;;; under the terms of the GNU General Public License as published by
50;;; the Free Software Foundation; either version 3 of the License, or (at
51;;; your option) any later version.
52;;;
233e7676 53;;; GNU Guix is distributed in the hope that it will be useful, but
fd76c904
LC
54;;; WITHOUT ANY WARRANTY; without even the implied warranty of
55;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
56;;; GNU General Public License for more details.
57;;;
58;;; You should have received a copy of the GNU General Public License
233e7676 59;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
fd76c904 60
1ffa7090 61(define-module (gnu packages linux)
59a43334 62 #:use-module (gnu packages)
0c60cc53 63 #:use-module (gnu packages acl)
75750abb
DC
64 #:use-module (gnu packages admin)
65 #:use-module (gnu packages algebra)
66 #:use-module (gnu packages attr)
624ee211 67 #:use-module (gnu packages audio)
75750abb 68 #:use-module (gnu packages autotools)
1eacffb9 69 #:use-module (gnu packages backup)
75750abb 70 #:use-module (gnu packages base)
c7adafa7 71 #:use-module (gnu packages bash)
75750abb
DC
72 #:use-module (gnu packages bison)
73 #:use-module (gnu packages calendar)
74 #:use-module (gnu packages check)
e385e957 75 #:use-module (gnu packages crypto)
17a21bcf 76 #:use-module (gnu packages cryptsetup)
f61e0e79 77 #:use-module (gnu packages compression)
255d1bbe 78 #:use-module (gnu packages dbm)
b3ed50e6 79 #:use-module (gnu packages datastructures)
75750abb
DC
80 #:use-module (gnu packages docbook)
81 #:use-module (gnu packages documentation)
82 #:use-module (gnu packages elf)
1ffa7090 83 #:use-module (gnu packages flex)
afc9d8ec 84 #:use-module (gnu packages file)
75750abb
DC
85 #:use-module (gnu packages freedesktop)
86 #:use-module (gnu packages gcc)
87 #:use-module (gnu packages gettext)
88 #:use-module (gnu packages glib)
626de0d1 89 #:use-module (gnu packages golang)
d7d42d6b 90 #:use-module (gnu packages gperf)
8c6c97de 91 #:use-module (gnu packages gstreamer)
75750abb 92 #:use-module (gnu packages gtk)
8a890f3c 93 #:use-module (gnu packages haskell-apps)
76f5428b 94 #:use-module (gnu packages haskell-xyz)
1d484507 95 #:use-module (gnu packages libunwind)
1ffa7090 96 #:use-module (gnu packages libusb)
01be4f93 97 #:use-module (gnu packages man)
75750abb 98 #:use-module (gnu packages maths)
dfe93c9a 99 #:use-module (gnu packages multiprecision)
1ffa7090 100 #:use-module (gnu packages ncurses)
8d8d227b 101 #:use-module (gnu packages netpbm)
c7adafa7 102 #:use-module (gnu packages networking)
f8f44dd7 103 #:use-module (gnu packages ninja)
aff0cce9 104 #:use-module (gnu packages nss)
1ffa7090 105 #:use-module (gnu packages perl)
75750abb 106 #:use-module (gnu packages pciutils)
1ffa7090 107 #:use-module (gnu packages pkg-config)
0d74462a 108 #:use-module (gnu packages popt)
75750abb 109 #:use-module (gnu packages pulseaudio)
7c0dbe78 110 #:use-module (gnu packages python)
e68f954e 111 #:use-module (gnu packages python-xyz)
75750abb
DC
112 #:use-module (gnu packages readline)
113 #:use-module (gnu packages rrdtool)
62b28c0e 114 #:use-module (gnu packages samba)
8c6c97de 115 #:use-module (gnu packages sdl)
9a3d176e 116 #:use-module (gnu packages serialization)
b1fb4b23 117 #:use-module (gnu packages slang)
f57d2639 118 #:use-module (gnu packages texinfo)
75343704 119 #:use-module (gnu packages tls)
b3ed50e6 120 #:use-module (gnu packages valgrind)
7d2511bc 121 #:use-module (gnu packages video)
7f412f33 122 #:use-module (gnu packages web)
7d2511bc 123 #:use-module (gnu packages xiph)
75750abb 124 #:use-module (gnu packages xml)
58c4f11e
TGR
125 #:use-module (gnu packages xdisorg)
126 #:use-module (gnu packages xorg)
a73e7dd3 127 #:use-module (gnu packages groff)
e8ded3ee 128 #:use-module (gnu packages rsync)
a73e7dd3 129 #:use-module (gnu packages selinux)
3eb7c000 130 #:use-module (gnu packages swig)
220193ad 131 #:use-module (guix build-system cmake)
75750abb 132 #:use-module (guix build-system gnu)
626de0d1 133 #:use-module (guix build-system go)
8c6c97de 134 #:use-module (guix build-system meson)
e102f940 135 #:use-module (guix build-system python)
a94546ec 136 #:use-module (guix build-system trivial)
6a8c4b9e 137 #:use-module (guix build-system linux-module)
75750abb 138 #:use-module (guix download)
6d31c175 139 #:use-module (guix git-download)
75750abb
DC
140 #:use-module ((guix licenses) #:prefix license:)
141 #:use-module (guix packages)
1ad9c105
MW
142 #:use-module (guix gexp)
143 #:use-module (guix store)
144 #:use-module (guix monads)
75750abb 145 #:use-module (guix utils)
adddd5ba 146 #:use-module (srfi srfi-1)
17db0706 147 #:use-module (srfi srfi-2)
a94546ec
LC
148 #:use-module (srfi srfi-26)
149 #:use-module (ice-9 match))
fd76c904 150
aaf4cb20
LC
151(define-public (system->linux-architecture arch)
152 "Return the Linux architecture name for ARCH, a Guix system name such as
6d7ef2aa 153\"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
618cea69
NK
154 (let ((arch (car (string-split arch #\-))))
155 (cond ((string=? arch "i686") "i386")
156 ((string-prefix? "mips" arch) "mips")
aaf4cb20 157 ((string-prefix? "arm" arch) "arm")
503275e9 158 ((string-prefix? "aarch64" arch) "arm64")
605fec78 159 ((string-prefix? "alpha" arch) "alpha")
c89e2107 160 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
b91004c2 161 ((string-prefix? "s390" arch) "s390")
7180dd67 162 ((string-prefix? "riscv" arch) "riscv")
618cea69
NK
163 (else arch))))
164
440a3143
CSLL
165(define-public (system->defconfig system)
166 "Some systems (notably powerpc-linux) require a special target for kernel
70c68ed5 167defconfig. Return the appropriate make target if applicable, otherwise return
440a3143
CSLL
168\"defconfig\"."
169 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
c89e2107 170 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
440a3143
CSLL
171 (else "defconfig")))
172
1ad9c105
MW
173\f
174;;;
175;;; Kernel source code deblobbing.
176;;;
177
178(define (linux-libre-deblob-scripts version
179 deblob-hash
180 deblob-check-hash)
181 (list (version-major+minor version)
182 (origin
183 (method url-fetch)
184 (uri (string-append "https://linux-libre.fsfla.org"
185 "/pub/linux-libre/releases/" version "-gnu/"
186 "deblob-" (version-major+minor version)))
187 (sha256 deblob-hash))
188 (origin
189 (method url-fetch)
190 (uri (string-append "https://linux-libre.fsfla.org"
191 "/pub/linux-libre/releases/" version "-gnu/"
192 "deblob-check"))
193 (sha256 deblob-check-hash))))
194
1b131e1f
VC
195(define deblob-scripts-5.6
196 (linux-libre-deblob-scripts
197 "5.6"
198 (base32 "09hxrr4xzllq5lmipfb6if30318lksrk9py1axc36m9ynql4w0rc")
199 (base32 "09qz5d31g5zwicsnncjnjij193hk0g6kg0ss9jyzh6lp3wilcm71")))
200
952820c5 201(define deblob-scripts-5.4
9e34a5f3 202 (linux-libre-deblob-scripts
2a57b722 203 "5.4.28"
952820c5 204 (base32 "0ckxn7k5zgcqk30dq943bnamr6a6zjbw2aqjl3x30f4kvh5f6k25")
2a57b722 205 (base32 "08ls4gx5vanyiq9rn0869nfq4piw4lx1dl8hh9w9xgkr4ypc1j4k")))
9e34a5f3 206
1ad9c105
MW
207(define deblob-scripts-4.19
208 (linux-libre-deblob-scripts
856650d9 209 "4.19.103"
1ad9c105 210 (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy")
cf5c44a3 211 (base32 "1w2wgxblpq09i33qmqgw5v3r5rm9vkkygr6m0sgv4zgczk9s29wr")))
1ad9c105
MW
212
213(define deblob-scripts-4.14
214 (linux-libre-deblob-scripts
856650d9 215 "4.14.170"
1ad9c105 216 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
cf5c44a3 217 (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky")))
1ad9c105
MW
218
219(define deblob-scripts-4.9
220 (linux-libre-deblob-scripts
856650d9 221 "4.9.213"
1ad9c105 222 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
cf5c44a3 223 (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2")))
1ad9c105
MW
224
225(define deblob-scripts-4.4
226 (linux-libre-deblob-scripts
856650d9 227 "4.4.213"
1ad9c105 228 (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw")
cf5c44a3 229 (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf")))
1ad9c105
MW
230
231(define* (computed-origin-method gexp-promise hash-algo hash
232 #:optional (name "source")
233 #:key (system (%current-system))
234 (guile (default-guile)))
235 "Return a derivation that executes the G-expression that results
236from forcing GEXP-PROMISE."
237 (mlet %store-monad ((guile (package->derivation guile system)))
238 (gexp->derivation (or name "computed-origin")
239 (force gexp-promise)
240 #:graft? #f ;nothing to graft
241 #:system system
242 #:guile-for-build guile)))
243
244(define (make-linux-libre-source version
245 upstream-source
246 deblob-scripts)
247 "Return a 'computed' origin that generates a Linux-libre tarball from the
248corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
249 (match deblob-scripts
250 ((deblob-version (? origin? deblob) (? origin? deblob-check))
251 (unless (string=? deblob-version (version-major+minor version))
252 ;; The deblob script cannot be expected to work properly on a
253 ;; different version (major+minor) of Linux, even if no errors
254 ;; are signaled during execution.
255 (error "deblob major+minor version mismatch"))
256 (origin
257 (method computed-origin-method)
258 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
259 (sha256 #f)
260 (uri
261 (delay
262 (with-imported-modules '((guix build utils))
263 #~(begin
264 (use-modules (guix build utils)
265 (srfi srfi-1)
266 (ice-9 match)
267 (ice-9 ftw))
268 (let ((dir (string-append "linux-" #$version)))
269
270 (mkdir "/tmp/bin")
271 (set-path-environment-variable
272 "PATH" '("bin")
273 (list "/tmp"
274 #+(canonical-package bash)
275 #+(canonical-package coreutils)
276 #+(canonical-package diffutils)
277 #+(canonical-package findutils)
278 #+(canonical-package patch)
279 #+(canonical-package xz)
280 #+(canonical-package sed)
281 #+(canonical-package grep)
282 #+(canonical-package bzip2)
283 #+(canonical-package gzip)
284 #+(canonical-package tar)
285 ;; The comments in the 'deblob-check' script
286 ;; claim that it supports Python 2 and 3, but
287 ;; in fact it fails when run in Python 3 as
288 ;; of version 5.1.3.
289 #+python-2))
290
291 (with-directory-excursion "/tmp/bin"
292
293 (copy-file #+deblob "deblob")
294 (chmod "deblob" #o755)
295 (substitute* "deblob"
296 (("/bin/sh") (which "sh")))
297
298 (copy-file #+deblob-check "deblob-check")
299 (chmod "deblob-check" #o755)
300 (substitute* "deblob-check"
301 (("/bin/sh") (which "sh"))
302 (("/bin/sed") (which "sed"))
303 (("/usr/bin/python") (which "python"))))
304
305 (if (file-is-directory? #+upstream-source)
306 (begin
307 (format #t "Copying upstream linux source...~%")
308 (force-output)
309 (invoke "cp" "--archive" #+upstream-source dir)
310 (invoke "chmod" "--recursive" "u+w" dir))
311 (begin
312 (format #t "Unpacking upstream linux tarball...~%")
313 (force-output)
314 (invoke "tar" "xf" #$upstream-source)
315 (match (scandir "."
316 (lambda (name)
317 (and (not (member name '("." "..")))
318 (file-is-directory? name))))
319 ((unpacked-dir)
320 (unless (string=? dir unpacked-dir)
321 (rename-file unpacked-dir dir)))
322 (dirs
323 (error "multiple directories found" dirs)))))
324
325 (with-directory-excursion dir
326 (setenv "PYTHON" (which "python"))
327 (format #t "Running deblob script...~%")
328 (force-output)
329 (invoke "/tmp/bin/deblob"))
330
331 (format #t "~%Packing new Linux-libre tarball...~%")
332 (force-output)
d0aff873 333 (invoke "tar" "cvfa" #$output
1ad9c105
MW
334 ;; Avoid non-determinism in the archive.
335 "--mtime=@0"
336 "--owner=root:0"
337 "--group=root:0"
338 "--sort=name"
339 "--hard-dereference"
340 dir))))))))))
341
342\f
343;;;
344;;; Kernel sources.
345;;;
346
6023cc74
LC
347(define (linux-libre-urls version)
348 "Return a list of URLs for Linux-Libre VERSION."
349 (list (string-append
8420c7a3 350 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
6023cc74
LC
351 version "-gnu/linux-libre-" version "-gnu.tar.xz")
352
353 ;; XXX: Work around <http://bugs.gnu.org/14851>.
354 (string-append
355 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
356 version "-gnu.tar.xz")
357
358 ;; Maybe this URL will become valid eventually.
359 (string-append
360 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
361 version "-gnu.tar.xz")))
362
1ad9c105
MW
363(define (%upstream-linux-source version hash)
364 (origin
365 (method url-fetch)
366 (uri (string-append "mirror://kernel.org"
367 "/linux/kernel/v" (version-major version) ".x/"
368 "linux-" version ".tar.xz"))
369 (sha256 hash)))
370
1b131e1f
VC
371
372(define-public linux-libre-5.6-version "5.6.2")
373(define-public linux-libre-5.6-pristine-source
374 (let ((version linux-libre-5.6-version)
375 (hash (base32 "1fdmcx5fk9wq9yx6vvnw76nvdysbvm83cik1dj1d67lw6bc92k9d")))
376 (make-linux-libre-source version
377 (%upstream-linux-source version hash)
378 deblob-scripts-5.6)))
379
41a795e7 380(define-public linux-libre-5.4-version "5.4.30")
952820c5
MW
381(define-public linux-libre-5.4-pristine-source
382 (let ((version linux-libre-5.4-version)
41a795e7 383 (hash (base32 "1vwx6j87pkfyq68chng1hy0c85hpc2byabiv1pcikrmw07vpip8i")))
9e34a5f3
TGR
384 (make-linux-libre-source version
385 (%upstream-linux-source version hash)
952820c5 386 deblob-scripts-5.4)))
9e34a5f3 387
fa015e2f 388(define-public linux-libre-4.19-version "4.19.114")
1ad9c105
MW
389(define-public linux-libre-4.19-pristine-source
390 (let ((version linux-libre-4.19-version)
fa015e2f 391 (hash (base32 "03hz6vg5bg728ilbm4z997pf52cgxzsxb03vz5cs55gwdbfa0h0y")))
1ad9c105
MW
392 (make-linux-libre-source version
393 (%upstream-linux-source version hash)
394 deblob-scripts-4.19)))
395
331c5505 396(define-public linux-libre-4.14-version "4.14.175")
1ad9c105
MW
397(define-public linux-libre-4.14-pristine-source
398 (let ((version linux-libre-4.14-version)
331c5505 399 (hash (base32 "0b12w0d21sk261jr4p1pm32v0r20a5c2j1p5hasdqw80sb2hli6b")))
1ad9c105
MW
400 (make-linux-libre-source version
401 (%upstream-linux-source version hash)
402 deblob-scripts-4.14)))
403
486ff941 404(define-public linux-libre-4.9-version "4.9.218")
1ad9c105
MW
405(define-public linux-libre-4.9-pristine-source
406 (let ((version linux-libre-4.9-version)
486ff941 407 (hash (base32 "1ka98c8sbfipzll6ss9fcsn26lh4cy60372yfw27pif4brhnwfnz")))
1ad9c105
MW
408 (make-linux-libre-source version
409 (%upstream-linux-source version hash)
410 deblob-scripts-4.9)))
411
cec3a093 412(define-public linux-libre-4.4-version "4.4.218")
1ad9c105
MW
413(define-public linux-libre-4.4-pristine-source
414 (let ((version linux-libre-4.4-version)
cec3a093 415 (hash (base32 "0qzhcy8i111jbpnkpzq7hqf9nkwq4s7smi820hfvnmd2ky7cns7a")))
1ad9c105
MW
416 (make-linux-libre-source version
417 (%upstream-linux-source version hash)
418 deblob-scripts-4.4)))
419
420(define %boot-logo-patch
421 ;; Linux-Libre boot logo featuring Freedo and a gnu.
422 (origin
423 (method url-fetch)
424 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
425 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
426 (sha256
427 (base32
428 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
429
430(define %linux-libre-arm-export-__sync_icache_dcache-patch
431 (origin
432 (method url-fetch)
433 (uri (string-append
434 "https://salsa.debian.org/kernel-team/linux"
435 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
436 "/debian/patches/bugfix/arm/"
437 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
438 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
439 (sha256
440 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
441
442(define (source-with-patches source patches)
443 (origin
444 (inherit source)
445 (patches (append (origin-patches source)
446 patches))))
447
1b131e1f
VC
448(define-public linux-libre-5.6-source
449 (source-with-patches linux-libre-5.6-pristine-source
450 (list %boot-logo-patch
451 %linux-libre-arm-export-__sync_icache_dcache-patch
452 ;; Pinebook Pro patch from linux-next,
453 ;; can be dropped for linux-libre 5.7
454 (search-patch
455 "linux-libre-support-for-Pinebook-Pro.patch"))))
456
952820c5
MW
457(define-public linux-libre-5.4-source
458 (source-with-patches linux-libre-5.4-pristine-source
459 (list %boot-logo-patch
730a4b10
VC
460 %linux-libre-arm-export-__sync_icache_dcache-patch
461 ;; Pinebook Pro patch from linux-next,
462 ;; can be dropped for linux-libre 5.7
463 (search-patch
464 "linux-libre-support-for-Pinebook-Pro.patch"))))
9e34a5f3 465
1ad9c105
MW
466(define-public linux-libre-4.19-source
467 (source-with-patches linux-libre-4.19-pristine-source
468 (list %boot-logo-patch
469 %linux-libre-arm-export-__sync_icache_dcache-patch)))
470
471(define-public linux-libre-4.14-source
472 (source-with-patches linux-libre-4.14-pristine-source
473 (list %boot-logo-patch)))
474
475(define-public linux-libre-4.9-source
476 (source-with-patches linux-libre-4.9-pristine-source
477 (list %boot-logo-patch)))
478
479(define-public linux-libre-4.4-source
480 (source-with-patches linux-libre-4.4-pristine-source
481 (list %boot-logo-patch)))
482
483\f
484;;;
485;;; Kernel headers.
486;;;
487
488(define (make-linux-libre-headers version hash-string)
489 (make-linux-libre-headers* version
490 (origin
491 (method url-fetch)
492 (uri (linux-libre-urls version))
493 (sha256 (base32 hash-string)))))
494
495(define (make-linux-libre-headers* version source)
b450d2b4
DC
496 (package
497 (name "linux-libre-headers")
a15cee50 498 (version version)
1ad9c105 499 (source source)
b450d2b4 500 (build-system gnu-build-system)
a15cee50
CD
501 (native-inputs `(("perl" ,perl)
502 ,@(if (version>=? version "4.16")
503 `(("flex" ,flex)
504 ("bison" ,bison))
e8ded3ee
TGR
505 '())
506 ,@(if (version>=? version "5.3")
507 `(("rsync" ,rsync))
a15cee50 508 '())))
b450d2b4
DC
509 (arguments
510 `(#:modules ((guix build gnu-build-system)
511 (guix build utils)
512 (srfi srfi-1))
513 #:phases
514 (modify-phases %standard-phases
515 (delete 'configure)
516 (replace 'build
517 (lambda _
518 (let ((arch ,(system->linux-architecture
519 (or (%current-target-system)
440a3143
CSLL
520 (%current-system))))
521 (defconfig ,(system->defconfig
522 (or (%current-target-system)
523 (%current-system)))))
b450d2b4 524 (setenv "ARCH" arch)
618cea69 525 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
5dc9ded1
MW
526 (invoke "make" defconfig)
527 (invoke "make" "mrproper" "headers_check"))))
b450d2b4
DC
528 (replace 'install
529 (lambda* (#:key outputs #:allow-other-keys)
80fe5c60 530 (let ((out (assoc-ref outputs "out")))
5dc9ded1
MW
531 (invoke "make"
532 (string-append "INSTALL_HDR_PATH=" out)
533 "headers_install")
b15389e1 534
5dc9ded1
MW
535 (mkdir (string-append out "/include/config"))
536 (call-with-output-file
537 (string-append out
538 "/include/config/kernel.release")
539 (lambda (p)
540 (format p "~a-default~%" ,version)))
b15389e1 541
5dc9ded1
MW
542 ;; Remove the '.install' and '..install.cmd' files; the
543 ;; latter contains store paths, which pulls in bootstrap
544 ;; binaries in the build environment, and prevents bit
545 ;; reproducibility for the bootstrap binaries.
546 (for-each delete-file (find-files out "\\.install"))
547
548 #t))))
b15389e1 549 #:allowed-references ()
80fe5c60 550 #:tests? #f))
6fd52309 551 (home-page "https://www.gnu.org/software/linux-libre/")
80fe5c60
LC
552 (synopsis "GNU Linux-Libre kernel headers")
553 (description "Headers of the Linux-Libre kernel.")
b450d2b4 554 (license license:gpl2)))
80fe5c60 555
1b131e1f
VC
556(define-public linux-libre-headers-5.6
557 (make-linux-libre-headers* linux-libre-5.6-version
558 linux-libre-5.6-source))
559
952820c5
MW
560(define-public linux-libre-headers-5.4
561 (make-linux-libre-headers* linux-libre-5.4-version
562 linux-libre-5.4-source))
9e34a5f3 563
1ad9c105
MW
564(define-public linux-libre-headers-4.19
565 (make-linux-libre-headers* linux-libre-4.19-version
566 linux-libre-4.19-source))
567
568(define-public linux-libre-headers-4.14
569 (make-linux-libre-headers* linux-libre-4.14-version
570 linux-libre-4.14-source))
571
572(define-public linux-libre-headers-4.9
573 (make-linux-libre-headers* linux-libre-4.9-version
574 linux-libre-4.9-source))
575
576(define-public linux-libre-headers-4.4
577 (make-linux-libre-headers* linux-libre-4.4-version
578 linux-libre-4.4-source))
579
580;; The following package is used in the early bootstrap, and thus must be kept
581;; stable and with minimal build requirements.
ccad0e4d
MB
582(define-public linux-libre-headers-4.19.56
583 (make-linux-libre-headers "4.19.56"
584 "1zqiic55viy065lhnkmhn33sz3bbbr2ykbm5f92yzd8lpc9zl7yx"))
1ad9c105 585
ccad0e4d 586(define-public linux-libre-headers linux-libre-headers-4.19.56)
1ad9c105
MW
587
588\f
589;;;
590;;; Kernel configurations.
591;;;
3fb7b612 592
c258807a 593(define* (kernel-config arch #:key variant)
a94546ec 594 "Return the absolute file name of the Linux-Libre build configuration file
c258807a 595for ARCH and optionally VARIANT, or #f if there is no such configuration."
7994250f 596 (let* ((name (string-append (if variant (string-append variant "-") "")
25847b32 597 (if (string=? "i386" arch) "i686" arch) ".conf"))
7994250f
AK
598 (file (string-append "linux-libre/" name)))
599 (search-auxiliary-file file)))
a94546ec 600
90c18c32 601(define %default-extra-linux-options
24446ce2
TGR
602 `(;; Some very mild hardening.
603 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
18b3ba6f
VC
604 ;; All kernels should have NAMESPACES options enabled
605 ("CONFIG_NAMESPACES" . #t)
606 ("CONFIG_UTS_NS" . #t)
607 ("CONFIG_IPC_NS" . #t)
608 ("CONFIG_USER_NS" . #t)
609 ("CONFIG_PID_NS" . #t)
610 ("CONFIG_NET_NS" . #t)
24446ce2 611 ;; Modules required for initrd:
b9f7895d
DC
612 ("CONFIG_NET_9P" . m)
613 ("CONFIG_NET_9P_VIRTIO" . m)
614 ("CONFIG_VIRTIO_BLK" . m)
615 ("CONFIG_VIRTIO_NET" . m)
616 ("CONFIG_VIRTIO_PCI" . m)
617 ("CONFIG_VIRTIO_BALLOON" . m)
618 ("CONFIG_VIRTIO_MMIO" . m)
619 ("CONFIG_FUSE_FS" . m)
620 ("CONFIG_CIFS" . m)
621 ("CONFIG_9P_FS" . m)))
90c18c32
DC
622
623(define (config->string options)
624 (string-join (map (match-lambda
625 ((option . 'm)
626 (string-append option "=m"))
627 ((option . #t)
628 (string-append option "=y"))
629 ((option . #f)
630 (string-append option "=n")))
631 options)
632 "\n"))
633
1ad9c105
MW
634\f
635;;;
636;;; Kernel package utilities.
637;;;
638
639(define* (make-linux-libre version hash-string supported-systems
c258807a
DC
640 #:key
641 ;; A function that takes an arch and a variant.
642 ;; See kernel-config for an example.
a6d01325 643 (extra-version #f)
c258807a 644 (configuration-file #f)
90c18c32 645 (defconfig "defconfig")
64de7d1c
MW
646 (extra-options %default-extra-linux-options)
647 (patches (list %boot-logo-patch)))
1ad9c105
MW
648 (make-linux-libre* version
649 (origin
650 (method url-fetch)
651 (uri (linux-libre-urls version))
652 (sha256 (base32 hash-string))
653 (patches patches))
654 supported-systems
655 #:extra-version extra-version
656 #:configuration-file configuration-file
657 #:defconfig defconfig
658 #:extra-options extra-options))
659
660(define* (make-linux-libre* version source supported-systems
661 #:key
662 ;; A function that takes an arch and a variant.
663 ;; See kernel-config for an example.
664 (extra-version #f)
665 (configuration-file #f)
666 (defconfig "defconfig")
667 (extra-options %default-extra-linux-options))
614d1738 668 (package
a6d01325
DC
669 (name (if extra-version
670 (string-append "linux-libre-" extra-version)
671 "linux-libre"))
c258807a 672 (version version)
1ad9c105 673 (source source)
3129b9c2 674 (supported-systems supported-systems)
614d1738 675 (build-system gnu-build-system)
614d1738
DC
676 (native-inputs
677 `(("perl" ,perl)
678 ("bc" ,bc)
679 ("openssl" ,openssl)
78602fad 680 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
81d98d7e
MW
681 ("flex" ,flex)
682 ("bison" ,bison)
ce899af1 683
ce899af1
MW
684 ;; These are needed to compile the GCC plugins.
685 ("gmp" ,gmp)
686 ("mpfr" ,mpfr)
687 ("mpc" ,mpc)
688
64b5e413
LC
689 ,@(match (and configuration-file
690 (configuration-file
691 (system->linux-architecture
692 (or (%current-target-system) (%current-system)))
693 #:variant (version-major+minor version)))
694 (#f ;no config for this platform
695 '())
696 ((? string? config)
697 `(("kconfig" ,config))))))
614d1738
DC
698 (arguments
699 `(#:modules ((guix build gnu-build-system)
700 (guix build utils)
701 (srfi srfi-1)
c5ceec41 702 (srfi srfi-26)
5c79f238 703 (ice-9 ftw)
614d1738
DC
704 (ice-9 match))
705 #:phases
706 (modify-phases %standard-phases
c5bd8753
MW
707 (add-after 'unpack 'patch-/bin/pwd
708 (lambda _
709 (substitute* (find-files "." "^Makefile(\\.include)?$")
710 (("/bin/pwd") "pwd"))
711 #t))
9416459b 712 (replace 'configure
4b42703e 713 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
191a9a26
MO
714 ;; On AArch64 (at least), we need to remove glibc headers from
715 ;; CPATH (they are still available as "system headers"), so that
716 ;; the kernel can override uint64_t. See
717 ;; <https://bugs.gnu.org/37593>. This is also true when
718 ;; cross-compiling, except in that case, cross-libc must be
719 ;; removed from CROSS_CPATH.
720 (let ((var ,(if (%current-target-system)
721 "CROSS_CPATH"
722 "CPATH"))
723 (libc ,(if (%current-target-system)
724 "cross-libc"
725 "libc")))
726 (setenv var
727 (string-join
728 (remove
729 (cut string-prefix? (assoc-ref inputs libc) <>)
730 (string-split (getenv var) #\:))
731 ":"))
732 (format #t "environment variable `~a' changed to `~a'~%"
733 var (getenv var)))
c5ceec41 734
96e9f097
RN
735 ;; Avoid introducing timestamps
736 (setenv "KCONFIG_NOTIMESTAMP" "1")
737 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
738
4b42703e 739 ;; Set ARCH and CROSS_COMPILE
6d7ef2aa
DC
740 (let ((arch ,(system->linux-architecture
741 (or (%current-target-system)
742 (%current-system)))))
4b42703e
DC
743 (setenv "ARCH" arch)
744 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
6d7ef2aa 745
4b42703e
DC
746 (when target
747 (setenv "CROSS_COMPILE" (string-append target "-"))
748 (format #t "`CROSS_COMPILE' set to `~a'~%"
749 (getenv "CROSS_COMPILE"))))
beacfcab 750
a6d01325
DC
751 (setenv "EXTRA_VERSION" ,extra-version)
752
a94546ec 753 (let ((build (assoc-ref %standard-phases 'build))
65416733 754 (config (assoc-ref (or native-inputs inputs) "kconfig")))
1650dd8a 755
e4e9c0a0
DC
756 ;; Use a custom kernel configuration file or a default
757 ;; configuration file.
1650dd8a
LC
758 (if config
759 (begin
760 (copy-file config ".config")
761 (chmod ".config" #o666))
fdd400d8 762 (invoke "make" ,defconfig))
a94546ec
LC
763
764 ;; Appending works even when the option wasn't in the
765 ;; file. The last one prevails if duplicated.
90c18c32
DC
766 (let ((port (open-file ".config" "a"))
767 (extra-configuration ,(config->string extra-options)))
768 (display extra-configuration port)
a94546ec
LC
769 (close-port port))
770
fdd400d8 771 (invoke "make" "oldconfig"))))
614d1738 772 (replace 'install
4b42703e 773 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
beacfcab
LC
774 (let* ((out (assoc-ref outputs "out"))
775 (moddir (string-append out "/lib/modules"))
5c79f238 776 (dtbdir (string-append out "/lib/dtbs")))
e4e9c0a0
DC
777 ;; Install kernel image, kernel configuration and link map.
778 (for-each (lambda (file) (install-file file out))
d0a39b92 779 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
e4e9c0a0 780 ;; Install device tree files
a8e3fd5f
VC
781 (unless (null? (find-files "." "\\.dtb$"))
782 (mkdir-p dtbdir)
783 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
784 "dtbs_install"))
e4e9c0a0 785 ;; Install kernel modules
beacfcab 786 (mkdir-p moddir)
fdd400d8 787 (invoke "make"
5c79f238
DM
788 ;; Disable depmod because the Guix system's module directory
789 ;; is an union of potentially multiple packages. It is not
790 ;; possible to use depmod to usefully calculate a dependency
791 ;; graph while building only one of those packages.
792 "DEPMOD=true"
fdd400d8
DM
793 (string-append "MODULE_DIR=" moddir)
794 (string-append "INSTALL_PATH=" out)
795 (string-append "INSTALL_MOD_PATH=" out)
796 "INSTALL_MOD_STRIP=1"
5c79f238
DM
797 "modules_install")
798 (let* ((versions (filter (lambda (name)
799 (not (string-prefix? "." name)))
800 (scandir moddir)))
801 (version (match versions
802 ((x) x))))
803 ;; There are symlinks to the build and source directory,
804 ;; both of which will point to target /tmp/guix-build*
805 ;; and thus not be useful in a profile. Delete the symlinks.
806 (false-if-file-not-found
807 (delete-file (string-append moddir "/" version "/build")))
808 (false-if-file-not-found
809 (delete-file (string-append moddir "/" version "/source"))))
810 #t))))
beacfcab 811 #:tests? #f))
f8aa265e 812 (home-page "https://www.gnu.org/software/linux-libre/")
f50d2669 813 (synopsis "100% free redistribution of a cleaned Linux kernel")
a22dc0c4 814 (description
79c311b8
LC
815 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
816It has been modified to remove all non-free binary blobs.")
614d1738 817 (license license:gpl2)))
beacfcab 818
1ad9c105
MW
819\f
820;;;
821;;; Generic kernel packages.
822;;;
adbe6dea 823
1b131e1f
VC
824(define-public linux-libre-5.6
825 (make-linux-libre* linux-libre-5.6-version
826 linux-libre-5.6-source
827 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
828 #:configuration-file kernel-config))
829
952820c5
MW
830(define-public linux-libre-5.4
831 (make-linux-libre* linux-libre-5.4-version
832 linux-libre-5.4-source
b3d25e21 833 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
9e34a5f3
TGR
834 #:configuration-file kernel-config))
835
952820c5
MW
836(define-public linux-libre-version linux-libre-5.4-version)
837(define-public linux-libre-pristine-source linux-libre-5.4-pristine-source)
838(define-public linux-libre-source linux-libre-5.4-source)
839(define-public linux-libre linux-libre-5.4)
9a68b89e 840
ff148ea5 841(define-public linux-libre-4.19
1ad9c105
MW
842 (make-linux-libre* linux-libre-4.19-version
843 linux-libre-4.19-source
844 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
845 #:configuration-file kernel-config))
adbe6dea
MW
846
847(define-public linux-libre-4.14
1ad9c105
MW
848 (make-linux-libre* linux-libre-4.14-version
849 linux-libre-4.14-source
850 '("x86_64-linux" "i686-linux" "armhf-linux")
851 #:configuration-file kernel-config))
a15cee50 852
52d901da 853(define-public linux-libre-4.9
1ad9c105
MW
854 (make-linux-libre* linux-libre-4.9-version
855 linux-libre-4.9-source
856 '("x86_64-linux" "i686-linux")
857 #:configuration-file kernel-config))
52d901da 858
75b314a6 859(define-public linux-libre-4.4
1ad9c105
MW
860 (make-linux-libre* linux-libre-4.4-version
861 linux-libre-4.4-source
862 '("x86_64-linux" "i686-linux")
863 #:configuration-file kernel-config
864 #:extra-options
865 (append
866 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
867 ;; This option was removed upstream in version 4.7.
868 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
869 %default-extra-linux-options)))
75b314a6 870
1ad9c105
MW
871\f
872;;;
873;;; Specialized kernel variants.
874;;;
a15cee50 875
403b3a8c 876(define-public linux-libre-arm-generic
1ad9c105
MW
877 (make-linux-libre* linux-libre-version
878 linux-libre-source
879 '("armhf-linux")
880 #:defconfig "multi_v7_defconfig"
881 #:extra-version "arm-generic"))
1dbb9302 882
3e91ca44
VC
883(define-public linux-libre-arm-generic-5.6
884 (make-linux-libre* linux-libre-5.6-version
885 linux-libre-5.6-source
886 '("armhf-linux")
887 #:defconfig "multi_v7_defconfig"
888 #:extra-version "arm-generic"))
889
1eb27d5c
LF
890(define-public linux-libre-arm-veyron
891 (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic))
892
ff148ea5 893(define-public linux-libre-arm-generic-4.19
1ad9c105
MW
894 (make-linux-libre* linux-libre-4.19-version
895 linux-libre-4.19-source
896 '("armhf-linux")
897 #:defconfig "multi_v7_defconfig"
898 #:extra-version "arm-generic"))
cde7c23f 899
adbe6dea 900(define-public linux-libre-arm-generic-4.14
1ad9c105
MW
901 (make-linux-libre* linux-libre-4.14-version
902 linux-libre-4.14-source
903 '("armhf-linux")
904 #:defconfig "multi_v7_defconfig"
905 #:extra-version "arm-generic"))
adbe6dea 906
f6948189 907(define-public linux-libre-arm-omap2plus
1ad9c105
MW
908 (make-linux-libre* linux-libre-version
909 linux-libre-source
910 '("armhf-linux")
911 #:defconfig "omap2plus_defconfig"
912 #:extra-version "arm-omap2plus"))
ff148ea5
MW
913
914(define-public linux-libre-arm-omap2plus-4.19
1ad9c105
MW
915 (make-linux-libre* linux-libre-4.19-version
916 linux-libre-4.19-source
917 '("armhf-linux")
918 #:defconfig "omap2plus_defconfig"
919 #:extra-version "arm-omap2plus"))
f6948189 920
adbe6dea 921(define-public linux-libre-arm-omap2plus-4.14
1ad9c105
MW
922 (make-linux-libre* linux-libre-4.14-version
923 linux-libre-4.14-source
924 '("armhf-linux")
925 #:defconfig "omap2plus_defconfig"
926 #:extra-version "arm-omap2plus"))
adbe6dea 927
058e96c5
VC
928(define-public linux-libre-arm64-generic
929 (make-linux-libre* linux-libre-version
930 linux-libre-source
931 '("aarch64-linux")
932 #:defconfig "defconfig"
933 #:extra-version "arm64-generic"))
934
b3d25e21
VC
935(define-public linux-libre-riscv64-generic
936 (make-linux-libre* linux-libre-version
937 linux-libre-source
938 '("riscv64-linux")
939 #:extra-version "riscv64-generic"))
940
e1f640db
TGR
941\f
942;;;
943;;; Linux kernel modules.
944;;;
945
7bf28446
TGR
946(define-public acpi-call-linux-module
947 (package
948 (name "acpi-call-linux-module")
949 (version "3.17")
950 (source
951 (origin
952 (method git-fetch)
953 (uri (git-reference
954 (url "https://github.com/teleshoes/acpi_call.git")
955 (commit version)))
956 (file-name (git-file-name name version))
957 (sha256
958 (base32 "04mbv4lasm3vv1j4ndxhnz4hvp5wg8f5fc9q6qxv0nhvwjynmsl3"))))
959 (build-system linux-module-build-system)
960 (arguments
961 `(#:tests? #f ; no tests
962 #:phases
963 (modify-phases %standard-phases
964 (add-after 'unpack 'fix-for-linux-4.12
965 (lambda _
966 (substitute* "acpi_call.c"
967 (("asm/uaccess\\.h")
968 "linux/uaccess.h"))
969 #t))
970 (add-after 'install 'install-documentation
971 (lambda* (#:key outputs #:allow-other-keys)
972 (let* ((out (assoc-ref outputs "out"))
973 (doc (string-append out "/share/doc/" ,name "-" ,version)))
974 (for-each (lambda (file)
975 (let ((target (string-append doc "/" file)))
976 (mkdir-p (dirname target))
977 (copy-recursively file target)))
978 (list "README.md" "examples"))
979 #t))))))
980 (home-page "https://github.com/teleshoes/acpi_call")
981 (synopsis "Linux kernel module to perform ACPI method calls")
982 (description
983 "This simple Linux kernel module allows calls from user space to any
984@acronym{ACPI, Advanced Configuration and Power Interface} method provided by
985your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
986any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
987and @code{ACPI_BUFFER}.
988
989It grants direct and undocumented access to your hardware that may cause damage
990and should be used with caution, especially on untested models.")
991 (license license:gpl3+))) ; see README.md (no licence headers)
992
ce5af131
TGR
993(define-public rtl8812au-aircrack-ng-linux-module
994 (let ((commit "945d6ed6505c32f0993b1dba576388e92e78101b")
995 (revision "0"))
996 (package
997 (name "rtl8812au-aircrack-ng-linux-module")
998 (version (git-version "5.6.4.2" revision commit))
999 (source
1000 (origin
1001 (method git-fetch)
1002 (uri (git-reference
1003 (url "https://github.com/aircrack-ng/rtl8812au.git")
1004 (commit commit)))
1005 (file-name (git-file-name name version))
1006 (sha256
1007 (base32 "1pjws7qb5l4z9k80vgz4zdxmqhbwxjjrmkpf0hijf821byyddvi7"))
1008 (modules '((guix build utils)))
1009 (snippet
1010 '(begin
1011 ;; Remove bundled tarballs, APKs, word lists, speadsheets,
1012 ;; and other unnecessary unlicenced things.
1013 (for-each delete-file-recursively (list "android"
1014 "docs"
1015 "tools"))
1016 #t))))
1017 (build-system linux-module-build-system)
1018 (arguments
1019 `(#:phases
1020 (modify-phases %standard-phases
1021 (replace 'build
1022 (lambda* (#:key inputs make-flags #:allow-other-keys)
1023 (apply invoke "make"
1024 (string-append "KSRC="
1025 (assoc-ref inputs "linux-module-builder")
1026 "/lib/modules/build")
1027 (or make-flags '())))))
1028 #:tests? #f)) ; no test suite
1029 (supported-systems '("x86_64-linux" "i686-linux"))
1030 (home-page "https://github.com/aircrack-ng/rtl8812au")
1031 (synopsis "Linux driver for Realtek USB wireless network adapters")
1032 (description
1033 "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
1034network adapters, modified by the aircrack-ng project to support monitor mode
1035and frame injection. It provides a @code{88XXau} kernel module that supports
1036RTL8812AU, RTL8821AU, and RTL8814AU chips.")
1037 (license license:gpl2+))))
1038
b40a36ba
MW
1039(define-public vhba-module
1040 (package
1041 (name "vhba-module")
0847e479 1042 (version "20200106")
b40a36ba
MW
1043 (source (origin
1044 (method url-fetch)
1045 (uri (string-append
1046 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
1047 version ".tar.bz2"))
1048 (sha256
1049 (base32
0847e479 1050 "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr"))))
b40a36ba
MW
1051 (build-system linux-module-build-system)
1052 (arguments
1053 ;; TODO: No tests?
1054 `(#:tests? #f))
1055 (home-page "https://cdemu.sourceforge.io/")
1056 (synopsis "Kernel module that emulates SCSI devices")
1057 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
1058between the CDemu userspace daemon and linux kernel.")
1059 (license license:gpl2+)))
1060
7eea1de7
BW
1061(define-public ddcci-driver-linux
1062 (package
1063 (name "ddcci-driver-linux")
1064 (version "0.3.3")
1065 (source
1066 (origin
1067 (method git-fetch)
1068 (uri
1069 (git-reference
1070 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
1071 (commit (string-append "v" version))))
1072 (file-name (git-file-name name version))
1073 (sha256
1074 (base32
1075 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
1076 (build-system linux-module-build-system)
1077 (arguments
1078 `(#:tests? #f ; no tests
1079 #:phases
1080 (modify-phases %standard-phases
1081 (replace 'build
1082 (lambda args
1083 (for-each
1084 (lambda (module)
1085 (with-directory-excursion module
1086 (apply (assoc-ref %standard-phases 'build) args)))
1087 '("ddcci" "ddcci-backlight"))
1088 #t))
1089 (replace 'install
1090 (lambda args
1091 (for-each
1092 (lambda (module)
1093 (with-directory-excursion module
1094 (apply (assoc-ref %standard-phases 'install) args)))
1095 '("ddcci" "ddcci-backlight"))
1096 #t)))))
1097 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
1098 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
1099 (description "This package provides two Linux kernel drivers, ddcci and
1100ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
1101interface. The ddcci module creates a character device for each DDC/CI
1102monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
1103module allows the control of the backlight level or luminance property when
1104supported under @file{/sys/class/backlight/}.")
1105 (license license:gpl2+)))
1106
97121c2a 1107\f
c84d0eca
LC
1108;;;
1109;;; Pluggable authentication modules (PAM).
1110;;;
1111
fd76c904
LC
1112(define-public linux-pam
1113 (package
1114 (name "linux-pam")
eca24b2f 1115 (version "1.3.1")
fd76c904
LC
1116 (source
1117 (origin
eca24b2f
TGR
1118 (method url-fetch)
1119 (uri (string-append
1120 "https://github.com/linux-pam/linux-pam/releases/download/v"
1121 version "/Linux-PAM-" version ".tar.xz"))
1122 (sha256
1123 (base32
1124 "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
1125 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
411264c2 1126
fd76c904 1127 (build-system gnu-build-system)
c4c4cc05 1128 (native-inputs
fd76c904
LC
1129 `(("flex" ,flex)
1130
1131 ;; TODO: optional dependencies
1132 ;; ("libxcrypt" ,libxcrypt)
1133 ;; ("cracklib" ,cracklib)
1134 ))
1135 (arguments
ed8111ea 1136 `(;; Most users, such as `shadow', expect the headers to be under
c134056a
LC
1137 ;; `security'.
1138 #:configure-flags (list (string-append "--includedir="
1139 (assoc-ref %outputs "out")
ed8111ea
LC
1140 "/include/security")
1141
1142 ;; XXX: <rpc/rpc.h> is missing from glibc when
1143 ;; cross-compiling, so we have to disable NIS
1144 ;; support altogether.
1145 ,@(if (%current-target-system)
1146 '("--disable-nis")
1147 '()))
c134056a
LC
1148
1149 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1150 ;; isn't available.
1151 #:tests? #f))
fd76c904
LC
1152 (home-page "http://www.linux-pam.org/")
1153 (synopsis "Pluggable authentication modules for Linux")
1154 (description
1155 "A *Free* project to implement OSF's RFC 86.0.
1156Pluggable authentication modules are small shared object files that can
1157be used through the PAM API to perform tasks, like authenticating a user
e881752c 1158at login. Local and dynamic reconfiguration are its key features.")
3ac73271 1159 (license license:bsd-3)))
686f14e8 1160
4c93ce42
EF
1161(define-public linux-pam-1.2
1162 (package
1163 (inherit linux-pam)
4c93ce42
EF
1164 (version "1.2.1")
1165 (source
1166 (origin
1167 (method url-fetch)
1168 (uri (string-append
1169 "http://www.linux-pam.org/library/"
1170 "Linux-PAM-" version ".tar.bz2"))
1171 (sha256
1172 (base32
411264c2
RS
1173 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1174 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
4c93ce42 1175
53142109 1176
c84d0eca
LC
1177;;;
1178;;; Miscellaneous.
1179;;;
1180
686f14e8
LC
1181(define-public psmisc
1182 (package
1183 (name "psmisc")
bd88082d 1184 (version "23.3")
686f14e8
LC
1185 (source
1186 (origin
1187 (method url-fetch)
03113e31 1188 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
f42846b2 1189 version ".tar.xz"))
686f14e8 1190 (sha256
bd88082d 1191 (base32 "16i7qzjmm6g0lzha8yzpfrlcxnvkgh95hkq9gdjd4zmzb8d0wxa1"))))
686f14e8 1192 (build-system gnu-build-system)
46429444
MO
1193 (arguments
1194 `(,@(if (%current-target-system)
1195 '(#:configure-flags
1196 (list
1197 "ac_cv_func_malloc_0_nonnull=yes"
1198 "ac_cv_func_realloc_0_nonnull=yes"))
1199 '())))
686f14e8 1200 (inputs `(("ncurses" ,ncurses)))
aa9c221f 1201 (home-page "https://gitlab.com/psmisc/psmisc")
70a4fb6f 1202 (synopsis "Small utilities that use the proc file system")
686f14e8
LC
1203 (description
1204 "This PSmisc package is a set of some small useful utilities that
8f65585b 1205use the proc file system. We're not about changing the world, but
686f14e8 1206providing the system administrator with some help in common tasks.")
3ac73271 1207 (license license:gpl2+)))
02b80c3f
NK
1208
1209(define-public util-linux
1210 (package
1211 (name "util-linux")
ac3842ef 1212 (version "2.34")
5a6a3ba4
LC
1213 (source (origin
1214 (method url-fetch)
1215 (uri (string-append "mirror://kernel.org/linux/utils/"
80095bd3
TGR
1216 "util-linux/v" (version-major+minor version) "/"
1217 "util-linux-" version ".tar.xz"))
5a6a3ba4
LC
1218 (sha256
1219 (base32
ac3842ef 1220 "1db2kydkwjmvgd1glkcba3adhidxw0f1x735dcjdpdjjf869sgvl"))
ab0bdd54 1221 (patches (search-patches "util-linux-tests.patch"))
9d77da2a
LC
1222 (modules '((guix build utils)))
1223 (snippet
0223db58
MB
1224 ;; We take 'nologin' from Shadow, the 'logger' program from
1225 ;; GNU Inetutils and 'kill' from GNU Coreutils.
8338c241
MW
1226 '(begin
1227 (substitute* "configure"
0223db58 1228 (("build_nologin=yes") "build_nologin=no")
8338c241
MW
1229 (("build_logger=yes") "build_logger=no")
1230 (("build_kill=yes") "build_kill=no"))
1231 #t))))
02b80c3f 1232 (build-system gnu-build-system)
dd581e9a 1233 (outputs '("out"
a4a70cc4 1234 "static")) ;>2 MiB of static .a libraries
02b80c3f 1235 (arguments
29ec55ee 1236 `(#:configure-flags (list "--disable-use-tty-group"
d9804e50 1237 "--enable-fs-paths-default=/run/current-system/profile/sbin"
db9107b9
EF
1238 ;; Don't try to chown root:root mount and umount
1239 "--disable-makeinstall-chown"
29ec55ee
LC
1240 ;; Install completions where our
1241 ;; bash-completion package expects them.
1242 (string-append "--with-bashcompletiondir="
1243 (assoc-ref %outputs "out")
1244 "/etc/bash_completion.d"))
1b9cf4ad 1245 #:phases (modify-phases %standard-phases
a4a70cc4
MB
1246 (add-before 'build 'set-umount-file-name
1247 (lambda* (#:key outputs #:allow-other-keys)
1248 ;; Tell 'eject' the right file name of 'umount'.
1249 (let ((out (assoc-ref outputs "out")))
1250 (substitute* "sys-utils/eject.c"
1251 (("\"/bin/umount\"")
1252 (string-append "\"" out "/bin/umount\"")))
1253 #t)))
1254 (add-before 'check 'pre-check
1255 (lambda* (#:key inputs outputs #:allow-other-keys)
1256 (let ((out (assoc-ref outputs "out"))
1257 (net (assoc-ref inputs "net-base")))
1258 ;; Change the test to refer to the right file.
1259 (substitute* "tests/ts/misc/mcookie"
1260 (("/etc/services")
1261 (string-append net "/etc/services")))
1262 #t)))
1263 (add-after 'install 'move-static-libraries
1264 (lambda* (#:key outputs #:allow-other-keys)
1265 (let ((out (assoc-ref outputs "out"))
1266 (static (assoc-ref outputs "static")))
1267 (mkdir-p (string-append static "/lib"))
1268 (with-directory-excursion out
1269 (for-each (lambda (file)
1270 (rename-file file
1271 (string-append static "/"
1272 file)))
1273 (find-files "lib" "\\.a$"))
1274
1275 ;; Remove references to the static library from the '.la'
1276 ;; files so that Libtool does the right thing when both
1277 ;; the shared and static library is available.
1278 (substitute* (find-files "lib" "\\.la$")
1279 (("old_library=.*") "old_library=''\n")))
1280
1281 #t))))))
f61e0e79 1282 (inputs `(("zlib" ,zlib)
ba4aca3a
LC
1283 ("ncurses" ,ncurses)
1284
1285 ;; XXX: This is so that the 'pre-check' phase can find it.
1286 ,@(if (%current-target-system)
1287 `(("net-base" ,net-base))
1288 '())))
c4c4cc05 1289 (native-inputs
9f533d60 1290 `(("perl" ,perl)
a4a70cc4 1291 ("net-base" ,net-base))) ;for tests
02b80c3f 1292 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
35ec07c7 1293 (synopsis "Collection of utilities for the Linux kernel")
437d7286 1294 (description "Util-linux is a diverse collection of Linux kernel
8f65585b 1295utilities. It provides dmesg and includes tools for working with file systems,
437d7286 1296block devices, UUIDs, TTYs, and many other tools.")
fe8ccfcc 1297
02b80c3f 1298 ;; Note that util-linux doesn't use the same license for all the
fe8ccfcc 1299 ;; code. GPLv2+ is the default license for a code without an
02b80c3f 1300 ;; explicitly defined license.
3ac73271
LC
1301 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1302 license:bsd-4 license:public-domain))))
5d5c4278 1303
71e0f1e9
MB
1304;; util-linux optionally supports udev, which allows lsblk to read file system
1305;; metadata without special privileges. Add it as a separate package to avoid
1306;; a circular dependency, and to keep the size small.
1307(define-public util-linux+udev
1308 (package/inherit
1309 util-linux
60a366ec 1310 (name "util-linux-with-udev")
71e0f1e9
MB
1311 (inputs
1312 `(("udev" ,eudev)
60a366ec 1313 ,@(package-inputs util-linux)))))
71e0f1e9 1314
3116c8b5 1315(define-public ddate
1316 (package
1317 (name "ddate")
1318 (version "0.2.2")
1319 (source (origin
1320 (method url-fetch)
1321 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
1322 version ".tar.gz"))
1323 (file-name (string-append name "-" version ".tar.gz"))
1324 (sha256
1325 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
1326 (build-system cmake-build-system)
1327 (arguments '(#:tests? #f))
1328 (home-page "https://github.com/bo0ts/ddate")
1329 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1330 (description
1331 "ddate displays the Discordian date and holidays of a given date.
1332The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1333by Robert Shea and Robert Anton Wilson.")
1334 (license license:public-domain)))
1335
96636e49
TGR
1336(define-public fbset
1337 (package
1338 (name "fbset")
1339 (version "2.1")
1340 (source
1341 (origin
1342 (method url-fetch)
1343 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
1344 version ".tar.gz"))
1345 (sha256
1346 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
1347 (build-system gnu-build-system)
1348 (arguments
1349 '(#:modules ((guix build gnu-build-system)
1350 (guix build utils)
1351 (srfi srfi-26))
1352 #:phases
1353 (modify-phases %standard-phases
1354 (delete 'configure) ; no configure script
1355 (add-before 'install 'pre-install
1356 (lambda* (#:key outputs #:allow-other-keys)
1357 (let ((out (assoc-ref outputs "out")))
1358 (substitute* "Makefile"
1359 (("mknod ") "true ")
1360 ;; The Makefile doesn't honour PREFIX or similar.
1361 (("/usr") out))
1362 (mkdir out)
1363 (with-directory-excursion out
1364 (for-each mkdir-p (list "sbin"
1365 "man/man5"
1366 "man/man8")))
1367 #t)))
1368 (add-after 'install 'install-fb.modes
1369 (lambda* (#:key outputs #:allow-other-keys)
1370 (let* ((out (assoc-ref outputs "out"))
1371 (etc (string-append out "/etc")))
1372 (for-each (cut install-file <> etc)
1373 (find-files "etc" "^fb\\.modes"))
1374 (symlink "fb.modes.ATI"
1375 (string-append etc "/fb.modes"))
1376 #t))))
1377 ;; Parallel building races to create modes.tab.c.
1378 #:parallel-build? #f
1379 #:tests? #f)) ; no test suite
1380 (native-inputs
1381 `(("bison" ,bison)
1382 ("flex" ,flex)))
1383 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
1384 (synopsis "Show and modify Linux frame buffer settings")
1385 (description
1386 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
1387different kinds of graphic displays. The @command{fbset} utility can query and
1388change various device settings such as depth, virtual resolution, and timing
1389parameters.")
1390 (license license:gpl2)))
1391
e47e3eff
LC
1392(define-public procps
1393 (package
1394 (name "procps")
89a6d2d1 1395 (version "3.3.16")
e47e3eff 1396 (source (origin
0cc22848
SB
1397 (method url-fetch)
1398 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1399 "procps-ng-" version ".tar.xz"))
1400 (sha256
1401 (base32
89a6d2d1 1402 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
e47e3eff 1403 (build-system gnu-build-system)
e47e3eff 1404 (arguments
80393eed
LC
1405 '(#:modules ((guix build utils)
1406 (guix build gnu-build-system)
1407 (srfi srfi-1)
1408 (srfi srfi-26))
0cc22848
SB
1409 #:phases
1410 (modify-phases %standard-phases
1411 (add-after
1412 'install 'post-install
1413 ;; Remove commands and man pages redudant with
1414 ;; Coreutils.
1415 (lambda* (#:key outputs #:allow-other-keys)
1416 (let* ((out (assoc-ref outputs "out"))
1417 (dup (append-map (cut find-files out <>)
1418 '("^kill" "^uptime"))))
1419 (for-each delete-file dup)
1420 #t))))))
1421 (inputs `(("ncurses" ,ncurses)))
1422 (home-page "https://gitlab.com/procps-ng/procps/")
35ec07c7 1423 (synopsis "Utilities that give information about processes")
e47e3eff 1424 (description
35b9e423 1425 "Procps is the package that has a bunch of small useful utilities
e47e3eff
LC
1426that give information about processes using the Linux /proc file system.
1427The package includes the programs ps, top, vmstat, w, kill, free,
1428slabtop, and skill.")
3ac73271 1429 (license license:gpl2)))
e47e3eff 1430
5d5c4278
NK
1431(define-public usbutils
1432 (package
1433 (name "usbutils")
5b266358 1434 (version "012")
5d5c4278
NK
1435 (source
1436 (origin
1437 (method url-fetch)
1438 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1439 "usbutils-" version ".tar.xz"))
1440 (sha256
5b266358 1441 (base32 "0iiy0q7fzikavmdsjsb0sl9kp3gfh701qwyjjccvqh0qz4jlcqw8"))))
5d5c4278 1442 (build-system gnu-build-system)
429a38a0 1443 (outputs (list "out" "python"))
5b266358
TGR
1444 (arguments
1445 `(#:phases
1446 (modify-phases %standard-phases
1447 (add-before 'bootstrap 'patch-bootstrap-scripts
1448 (lambda _
1449 (substitute* "usbhid-dump/bootstrap"
1450 (("/bin/bash") (which "bash")))
1451
1452 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1453 (substitute* "autogen.sh"
1454 (("^\\./configure.*") ""))
429a38a0
TGR
1455 #t))
1456 (add-after 'install 'separate-python-output
1457 ;; Separating one Python script shaves more than 106 MiB from :out.
1458 (lambda* (#:key outputs #:allow-other-keys)
1459 (let ((out (assoc-ref outputs "out"))
1460 (out:python (assoc-ref outputs "python")))
1461 (for-each (lambda (file)
1462 (let ((old (string-append out "/" file))
1463 (new (string-append out:python "/" file)))
1464 (mkdir-p (dirname new))
1465 (rename-file old new)))
1466 (list "bin/lsusb.py"))
1467 #t))))))
5d5c4278 1468 (inputs
a6592732
TGR
1469 `(("eudev" ,eudev)
1470 ("libusb" ,libusb)
1471 ("python" ,python)))
c4c4cc05 1472 (native-inputs
5b266358
TGR
1473 `(("autoconf" ,autoconf)
1474 ("automake" ,automake)
1475 ("libtool" ,libtool)
1476 ("pkg-config" ,pkg-config)))
5d5c4278
NK
1477 (home-page "http://www.linux-usb.org/")
1478 (synopsis
1479 "Tools for working with USB devices, such as lsusb")
1480 (description
1481 "Tools for working with USB devices, such as lsusb.")
3ac73271 1482 (license license:gpl2+)))
0750452a
LC
1483
1484(define-public e2fsprogs
1485 (package
1486 (name "e2fsprogs")
07b1d408 1487 (version "1.45.5")
0750452a
LC
1488 (source (origin
1489 (method url-fetch)
7409c8d4
MW
1490 (uri (string-append
1491 "mirror://kernel.org/linux/kernel/people/tytso/"
1492 name "/v" version "/"
1493 name "-" version ".tar.xz"))
0750452a
LC
1494 (sha256
1495 (base32
07b1d408 1496 "1pmf8inp736l587rqq7qsd8bv0mmg5cwrivxg5p5awqgv70crypr"))))
0750452a 1497 (build-system gnu-build-system)
c4c4cc05 1498 (inputs `(("util-linux" ,util-linux)))
f57d2639 1499 (native-inputs `(("pkg-config" ,pkg-config)
75f796bb
MB
1500 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1501
1502 ;; For tests.
1503 ("perl" ,perl)
1504 ("procps" ,procps)))
0750452a 1505 (arguments
b047a86b 1506 '(;; util-linux is the preferred source for some of the libraries and
c44ed26c 1507 ;; commands, so disable them (see, e.g.,
a124bbd2 1508 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
b047a86b
MB
1509 #:configure-flags (list "--disable-libblkid"
1510 "--disable-libuuid" "--disable-uuidd"
1511 "--disable-fsck"
7c594a2c 1512
b047a86b
MB
1513 ;; Use symlinks instead of hard links for
1514 ;; 'fsck.extN' etc. This makes the resulting nar
1515 ;; smaller and is preserved across copies.
1516 "--enable-symlink-install"
74d21291 1517
b047a86b
MB
1518 (string-append "LDFLAGS=-Wl,-rpath="
1519 (assoc-ref %outputs "out")
1520 "/lib")
7c594a2c 1521
b047a86b
MB
1522 ;; Install libext2fs et al.
1523 "--enable-elf-shlibs")
ddfc2fd8 1524
55acb372
MB
1525 #:phases
1526 (modify-phases %standard-phases
1527 (add-before 'configure 'patch-shells
1528 (lambda _
1529 (substitute* "configure"
1530 (("/bin/sh (.*)parse-types.sh" _ dir)
1531 (string-append (which "sh") " " dir
1532 "parse-types.sh")))
b047a86b
MB
1533 (substitute* "MCONFIG.in"
1534 (("INSTALL_SYMLINK = /bin/sh")
1535 "INSTALL_SYMLINK = sh"))
55acb372
MB
1536 (substitute* (find-files "." "^Makefile.in$")
1537 (("#!/bin/sh")
1538 (string-append "#!" (which "sh"))))
1539 #t))
1540 (add-after 'install 'install-libs
1541 (lambda* (#:key outputs #:allow-other-keys)
1542 (let* ((out (assoc-ref outputs "out"))
1543 (lib (string-append out "/lib")))
b132ad3a
MW
1544 (invoke "make" "install-libs")
1545
1546 ;; Make the .a writable so that 'strip' works.
1547 ;; Failing to do that, due to debug symbols, we
1548 ;; retain a reference to the final
1549 ;; linux-libre-headers, which refer to the
1550 ;; bootstrap binaries.
1551 (let ((archives (find-files lib "\\.a$")))
1552 (for-each (lambda (file)
1553 (chmod file #o666))
1554 archives))
1555 #t))))))
0750452a 1556 (home-page "http://e2fsprogs.sourceforge.net/")
35ec07c7 1557 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
0750452a
LC
1558 (description
1559 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
3ac73271
LC
1560 (license (list license:gpl2 ;programs
1561 license:lgpl2.0 ;libext2fs
1562 license:x11)))) ;libuuid
d8482ad0 1563
e48977e7
LC
1564(define e2fsprogs/static
1565 (static-package
1566 (package (inherit e2fsprogs)
1567 (arguments
1568 ;; Do not build shared libraries.
1569 (substitute-keyword-arguments (package-arguments e2fsprogs)
1570 ((#:configure-flags _)
1571 '(list "--disable-blkid"))
1572 ((#:make-flags _)
1573 '(list)))))))
1574
e102f940
LC
1575(define-public e2fsck/static
1576 (package
1577 (name "e2fsck-static")
0997771a 1578 (version (package-version e2fsprogs))
e102f940
LC
1579 (build-system trivial-build-system)
1580 (source #f)
313880c7
DC
1581 (inputs
1582 `(("e2fsprogs" ,e2fsprogs/static)))
e102f940
LC
1583 (arguments
1584 `(#:modules ((guix build utils))
1585 #:builder
1586 (begin
1587 (use-modules (guix build utils)
1588 (ice-9 ftw)
1589 (srfi srfi-26))
1590
313880c7
DC
1591 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
1592 "/sbin/e2fsck"))
e102f940
LC
1593 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
1594 (mkdir-p bin)
1595 (with-directory-excursion bin
313880c7
DC
1596 (copy-file e2fsck "e2fsck")
1597 (remove-store-references "e2fsck")
e3cfef22
MW
1598 (chmod "e2fsck" #o555))
1599 #t))))
0997771a 1600 (home-page (package-home-page e2fsprogs))
313880c7
DC
1601 (synopsis "Statically-linked e2fsck command from e2fsprogs")
1602 (description "This package provides statically-linked e2fsck command taken
1603from the e2fsprogs package. It is meant to be used in initrds.")
0997771a 1604 (license (package-license e2fsprogs))))
e102f940 1605
7c0a9104
LC
1606(define-public extundelete
1607 (package
1608 (name "extundelete")
1609 (version "0.2.4")
76c888cb
TGR
1610 (source
1611 (origin
1612 (method url-fetch)
1613 (uri (string-append "mirror://sourceforge/extundelete/"
1614 "extundelete/" version "/extundelete-"
1615 version ".tar.bz2"))
1616 (sha256
1617 (base32
1618 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
1619 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
7c0a9104
LC
1620 (build-system gnu-build-system)
1621 (inputs `(("e2fsprogs" ,e2fsprogs)))
1622 (home-page "http://extundelete.sourceforge.net/")
1623 (synopsis "Recover deleted files from ext2/3/4 partitions")
1624 (description
1625 "Extundelete is a set of tools that can recover deleted files from an
1626ext3 or ext4 partition.")
3ac73271 1627 (license license:gpl2)))
7c0a9104 1628
1c975f60
LC
1629(define-public zerofree
1630 (package
1631 (name "zerofree")
5658b4ce 1632 (version "1.1.1")
30ac4cc7 1633 (home-page "https://frippery.org/uml/")
1c975f60
LC
1634 (source (origin
1635 (method url-fetch)
1636 (uri (string-append home-page name "-" version
1637 ".tgz"))
1638 (sha256
1639 (base32
5658b4ce 1640 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1c975f60
LC
1641 (build-system gnu-build-system)
1642 (arguments
0f08917d
TGR
1643 '(#:phases
1644 (modify-phases %standard-phases
1645 (delete 'configure) ; no configure script
1646 (replace 'install
1647 ;; The Makefile lacks an ‘install’ target.
1648 (lambda* (#:key outputs #:allow-other-keys)
1649 (let* ((out (assoc-ref outputs "out"))
1650 (bin (string-append out "/bin")))
7a068459
TGR
1651 (chmod "zerofree" #o555)
1652 (install-file "zerofree" bin)
0f08917d
TGR
1653 #t))))
1654 #:tests? #f)) ; no tests
1c975f60
LC
1655 (inputs `(("libext2fs" ,e2fsprogs)))
1656 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
1657 (description
4de4a1cf
TGR
1658 "Zerofree finds the unallocated blocks with non-zero value content in an
1659ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
1660This is a simple way to make disk images more compressible.
1661Zerofree requires the file system to be unmounted or mounted read-only.")
3ac73271 1662 (license license:gpl2)))
1c975f60 1663
d8482ad0
LC
1664(define-public strace
1665 (package
1666 (name "strace")
922fc9cb 1667 (version "5.5")
426284d8 1668 (home-page "https://strace.io")
d8482ad0
LC
1669 (source (origin
1670 (method url-fetch)
426284d8
MB
1671 (uri (string-append home-page "/files/" version
1672 "/strace-" version ".tar.xz"))
d8482ad0
LC
1673 (sha256
1674 (base32
922fc9cb 1675 "1zrhpzjlgfwfl8dd53llswmmharm5rbi0zch7lln5sjris69an4z"))))
d8482ad0 1676 (build-system gnu-build-system)
6983b8a8
MB
1677 (arguments
1678 '(#:phases
1679 (modify-phases %standard-phases
1680 (add-after 'unpack 'patch-/bin/sh
1681 (lambda _
1682 (substitute* "strace.c"
1683 (("/bin/sh") (which "sh")))
d1eb4234 1684 #t)))
1d437561
EF
1685 ;; Don't fail if the architecture doesn't support different personalities.
1686 #:configure-flags '("--enable-mpers=check")
72e782b2
TGR
1687 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
1688 #:parallel-tests? #f)) ; undeterministic failures
c4c4cc05 1689 (native-inputs `(("perl" ,perl)))
d8482ad0
LC
1690 (synopsis "System call tracer for Linux")
1691 (description
1692 "strace is a system call tracer, i.e. a debugging tool which prints out a
1693trace of all the system calls made by a another process/program.")
035f9161 1694 (license license:lgpl2.1+)))
ba04571a 1695
e1e27737
TUBK
1696(define-public ltrace
1697 (package
1698 (name "ltrace")
1699 (version "0.7.3")
1700 (source (origin
1701 (method url-fetch)
1702 (uri (string-append "http://www.ltrace.org/ltrace_" version
1703 ".orig.tar.bz2"))
1704 (sha256
1705 (base32
1706 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
1707 (build-system gnu-build-system)
1708 (inputs `(("libelf" ,libelf)))
1709 (arguments
1710 ;; Compilation uses -Werror by default, but it fails.
1711 '(#:configure-flags '("--disable-werror")))
81e59e41 1712 (home-page "https://www.ltrace.org/")
e1e27737
TUBK
1713 (synopsis "Library call tracer for Linux")
1714 (description
1715 "ltrace intercepts and records dynamic library calls which are called by
1716an executed process and the signals received by that process. It can also
1717intercept and print the system calls executed by the program.")
3ac73271 1718 (license license:gpl2+)))
e1e27737 1719
ba04571a
LC
1720(define-public alsa-lib
1721 (package
1722 (name "alsa-lib")
c494e899 1723 (version "1.2.2")
ba04571a
LC
1724 (source (origin
1725 (method url-fetch)
1726 (uri (string-append
1727 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
1728 version ".tar.bz2"))
1729 (sha256
1730 (base32
c494e899 1731 "1v5kb8jyvrpkvvq7dq8hfbmcj68lml97i4s0prxpfx2mh3c57s6q"))))
ba04571a 1732 (build-system gnu-build-system)
ddf31e9a
MB
1733 (arguments
1734 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
1735 (assoc-ref %outputs "out")
1736 "/lib"))))
5f3070a5 1737 (home-page "https://www.alsa-project.org/")
ba04571a
LC
1738 (synopsis "The Advanced Linux Sound Architecture libraries")
1739 (description
1740 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1741MIDI functionality to the Linux-based operating system.")
3ac73271 1742 (license license:lgpl2.1+)))
10afdf50 1743
17b293a0
LC
1744(define-public alsa-utils
1745 (package
1746 (name "alsa-utils")
c494e899 1747 (version "1.2.2")
17b293a0
LC
1748 (source (origin
1749 (method url-fetch)
992b527d
EF
1750 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
1751 name "-" version ".tar.bz2"))
17b293a0
LC
1752 (sha256
1753 (base32
c494e899 1754 "1wz460by17rmxrcydn583rd4lhj6wlvqs6x1j5pdzxn5g3app024"))))
17b293a0
LC
1755 (build-system gnu-build-system)
1756 (arguments
1757 ;; XXX: Disable man page creation until we have DocBook.
1758 '(#:configure-flags (list "--disable-xmlto"
f2817d43
LC
1759
1760 ;; The udev rule is responsible for restoring
1761 ;; the volume.
17b293a0
LC
1762 (string-append "--with-udev-rules-dir="
1763 (assoc-ref %outputs "out")
1764 "/lib/udev/rules.d"))
49165145
EF
1765 #:phases
1766 (modify-phases %standard-phases
46bf8b2b
MB
1767 (add-before 'check 'disable-broken-test
1768 (lambda _
1769 ;; XXX: The 1.1.8 release tarball is missing a header that's
1770 ;; required for this test to work. Fixed in 1.1.9.
1771 (substitute* "axfer/test/Makefile"
1772 ((".*container-test.*") ""))
1773 #t))
49165145
EF
1774 (add-before
1775 'install 'pre-install
1776 (lambda _
1777 ;; Don't try to mkdir /var/lib/alsa.
1778 (substitute* "Makefile"
1779 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
457d154f
EF
1780 "true\n"))
1781 #t)))))
17b293a0
LC
1782 (inputs
1783 `(("libsamplerate" ,libsamplerate)
1784 ("ncurses" ,ncurses)
1785 ("alsa-lib" ,alsa-lib)
1786 ("xmlto" ,xmlto)
b94a6ca0 1787 ("gettext" ,gettext-minimal)))
17b293a0
LC
1788 (home-page "http://www.alsa-project.org/")
1789 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
1790 (description
1791 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1792MIDI functionality to the Linux-based operating system.")
1793
1794 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
1795 ;; GPLv2-only.
3ac73271 1796 (license license:gpl2)))
17b293a0 1797
7d2511bc 1798(define-public alsa-plugins
1799 (package
1800 (name "alsa-plugins")
c494e899 1801 (version "1.2.2")
7d2511bc 1802 (source (origin
1803 (method url-fetch)
1804 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1805 name "-" version ".tar.bz2"))
1806 (sha256
1807 (base32
c494e899 1808 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
7d2511bc 1809 (build-system gnu-build-system)
1810 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1811 ;; be split, there are references to both in files.
1812 ;; TODO: Remove OSS related plugins, they add support to run native
1813 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1814 ;; obsolete.
624ee211 1815 (outputs '("out" "pulseaudio" "jack"))
7d2511bc 1816 (arguments
10b96d29 1817 `(#:configure-flags '(;; Do not install a "local" configuration targeted
59e80445 1818 ;; for /etc/alsa. On Guix System plugins are loaded from
10b96d29
MB
1819 ;; the ALSA service, and other distributions likely
1820 ;; won't use these files.
1821 "--with-alsalconfdir=/tmp/noop")
1822 #:phases
7d2511bc 1823 (modify-phases %standard-phases
1824 (add-after 'install 'split
1825 (lambda* (#:key inputs outputs #:allow-other-keys)
1826 ;; Distribute the binaries to the various outputs.
1827 (let* ((out (assoc-ref outputs "out"))
624ee211
SB
1828 (jack (assoc-ref outputs "jack"))
1829 (jacklib (string-append jack "/lib/alsa-lib"))
7d2511bc 1830 (pua (assoc-ref outputs "pulseaudio"))
10b96d29 1831 (pualib (string-append pua "/lib/alsa-lib")))
624ee211
SB
1832 ;; For jack.
1833 (mkdir-p jacklib)
1834 (for-each (lambda (file)
1835 (rename-file file (string-append jacklib "/" (basename file))))
1836 (find-files out ".*jack\\.(la|so)"))
10b96d29 1837 ;; For pulseaudio.
7d2511bc 1838 (mkdir-p pualib)
7d2511bc 1839 (for-each (lambda (file)
1840 (rename-file file (string-append pualib "/" (basename file))))
1841 (find-files out ".*pulse\\.(la|so)"))
7d2511bc 1842 #t))))))
1843 (inputs
1844 `(("alsa-lib" ,alsa-lib)
624ee211 1845 ("jack" ,jack-1)
7d2511bc 1846 ("speex" ,speex) ; libspeexdsp resampling plugin
1847 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1848 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1849 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1850 (native-inputs
1851 `(("pkg-config" ,pkg-config)))
1852 (home-page "http://www.alsa-project.org/")
1853 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1854 (description
1855 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1856MIDI functionality to the Linux-based operating system. This package enhances ALSA
1857by providing additional plugins which include: upmixing, downmixing, jackd and
1858pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1859external rate conversion.")
1860 (license (list license:gpl2+
1861 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1862 license:lgpl2.1+))))
1863
10afdf50
LC
1864(define-public iptables
1865 (package
1866 (name "iptables")
968dd994 1867 (version "1.8.4")
10afdf50
LC
1868 (source (origin
1869 (method url-fetch)
1870 (uri (string-append
f11ae44f 1871 "mirror://netfilter.org/iptables/iptables-"
10afdf50
LC
1872 version ".tar.bz2"))
1873 (sha256
1874 (base32
968dd994 1875 "0z0mgs1ghvn3slc868mgbf2g26njgrzcy5ggyb5w4i55j1a3lflr"))))
10afdf50 1876 (build-system gnu-build-system)
13223c8e
LF
1877 (native-inputs
1878 `(("pkg-config" ,pkg-config)
1879 ("flex" ,flex)
1880 ("bison" ,bison)))
1881 (inputs
1882 `(("libmnl" ,libmnl)
1883 ("libnftnl" ,libnftnl)))
50c26d9e
SB
1884 (arguments
1885 '(#:tests? #f ; no test suite
1886 #:configure-flags ; add $libdir to the RUNPATH of executables
1887 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
13223c8e 1888 (home-page "https://www.netfilter.org/projects/iptables/index.html")
be5dc5fb 1889 (synopsis "Programs to configure Linux IP packet filtering rules")
10afdf50 1890 (description
be5dc5fb
TGR
1891 "@command{iptables} is the user-space command line program used to
1892configure the Linux 2.4.x and later IPv4 packet filtering ruleset
1893(@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
1894
1895This package also includes @command{ip6tables}, which is used to configure the
1896IPv6 packet filter.
1897
fadc5533 1898Both commands are targeted at system administrators.")
3ac73271 1899 (license license:gpl2+)))
90a0048f 1900
c06c7a3a
VL
1901(define-public lsscsi
1902 (package
1903 (name "lsscsi")
1904 (version "0.31")
1905 (source (origin
1906 (method url-fetch)
1907 (uri (string-append
1908 "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
1909 (sha256
1910 (base32
1911 "1ry2y34xmpgxdbfbyvs8cjmbx0fn222yjdab87wj21q60nab5p75"))))
1912 (build-system gnu-build-system)
1913 (synopsis "Lists information about SCSI or NVMe devices in Linux")
1914 (home-page "http://sg.danny.cz/scsi/lsscsi.html")
1915 (description
1916 "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
1917also list NVMe namespaces or controllers and show the relationship between a
1918device's primary node name, its SCSI generic (sg) node name and its kernel
1919name.")
1920 (license license:gpl2)))
1921
6876a6fe
SB
1922(define-public ebtables
1923 (package
1924 (name "ebtables")
b614a223 1925 (version "2.0.11")
6876a6fe
SB
1926 (source (origin
1927 (method url-fetch)
1928 (uri (string-append
b614a223 1929 "mirror://netfilter.org/ebtables/ebtables-"
6876a6fe
SB
1930 version ".tar.gz"))
1931 (sha256
1932 (base32
b614a223 1933 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
6876a6fe 1934 (build-system gnu-build-system)
6876a6fe
SB
1935 (inputs
1936 `(("perl" ,perl)
1937 ("iptables" ,iptables)))
1938 (synopsis "Ethernet bridge frame table administration")
82c89ead 1939 (home-page "https://ebtables.netfilter.org/")
6876a6fe
SB
1940 (description
1941 "ebtables is an application program used to set up and maintain the
1942tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1943analogous to the iptables application, but less complicated, due to the fact
1944that the Ethernet protocol is much simpler than the IP protocol.")
1945 (license license:gpl2+)))
1946
90a0048f
LC
1947(define-public iproute
1948 (package
1949 (name "iproute2")
e572ec3c 1950 (version "5.5.0")
90a0048f 1951 (source (origin
75cd4b05
AK
1952 (method url-fetch)
1953 (uri (string-append
1954 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1955 version ".tar.xz"))
1956 (sha256
1957 (base32
e572ec3c 1958 "0ywg70f98wgfai35jl47xzpjp45a6n7crja4vc8ql85cbi1l7ids"))))
90a0048f
LC
1959 (build-system gnu-build-system)
1960 (arguments
54933202
TGR
1961 `( ;; There is a test suite, but it wants network namespaces and sudo.
1962 #:tests? #f
90a0048f
LC
1963 #:make-flags (let ((out (assoc-ref %outputs "out")))
1964 (list "DESTDIR="
e777d07d
LF
1965 (string-append "BASH_COMPDIR=" out
1966 "/etc/bash_completion.d")
90a0048f 1967 (string-append "LIBDIR=" out "/lib")
61f78e72 1968 (string-append "HDRDIR=" out "/include")
90a0048f
LC
1969 (string-append "SBINDIR=" out "/sbin")
1970 (string-append "CONFDIR=" out "/etc")
1971 (string-append "DOCDIR=" out "/share/doc/"
1972 ,name "-" ,version)
1973 (string-append "MANDIR=" out "/share/man")))
b53e44fb
AK
1974 #:phases (modify-phases %standard-phases
1975 (add-before 'install 'pre-install
1976 (lambda _
1977 ;; Don't attempt to create /var/lib/arpd.
1978 (substitute* "Makefile"
9922278b
MW
1979 (("^.*ARPDDIR.*$") ""))
1980 #t)))))
90a0048f 1981 (inputs
54933202 1982 `(("db4" ,bdb)
3b636296
TGR
1983 ("iptables" ,iptables)
1984 ("libmnl" ,libmnl)))
c4c4cc05 1985 (native-inputs
54933202 1986 `(("bison" ,bison)
90a0048f 1987 ("flex" ,flex)
54933202
TGR
1988 ("pkg-config" ,pkg-config)))
1989 ;; For tests.
1990 ;; ("libmnl" ,libmnl)
1991 ;; ("util-linux" ,util-linux)
90a0048f 1992 (home-page
d7f84eab 1993 "https://wiki.linuxfoundation.org/networking/iproute2")
90a0048f 1994 (synopsis
9e771e3b 1995 "Utilities for controlling TCP/IP networking and traffic in Linux")
90a0048f 1996 (description
35a4fefc
TGR
1997 "Iproute2 is a collection of utilities for controlling TCP/IP networking
1998and traffic with the Linux kernel. The most important of these are
1999@command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
2000control.
90a0048f
LC
2001
2002Most network configuration manuals still refer to ifconfig and route as the
2003primary network configuration tools, but ifconfig is known to behave
35a4fefc 2004inadequately in modern network environments, and both should be deprecated.")
3ac73271 2005 (license license:gpl2+)))
85e0dc6a
LC
2006
2007(define-public net-tools
2008 ;; XXX: This package is basically unmaintained, but it provides a few
2009 ;; commands not yet provided by Inetutils, such as 'route', so we have to
2010 ;; live with it.
6d31c175
LF
2011 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
2012 (revision "0"))
2013 (package
2014 (name "net-tools")
2015 (version (string-append "1.60-" revision "." (string-take commit 7)))
2016 (source (origin
631c9f74
LF
2017 (method url-fetch)
2018 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
2019 "n/ne/net-tools/code.git/net-tools-code-"
2020 commit ".zip"))
2021 (file-name (string-append name "-" version ".zip"))
6d31c175
LF
2022 (sha256
2023 (base32
631c9f74 2024 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
6d31c175
LF
2025 (home-page "http://net-tools.sourceforge.net/")
2026 (build-system gnu-build-system)
2027 (arguments
2028 '(#:modules ((guix build gnu-build-system)
2029 (guix build utils)
2030 (srfi srfi-1)
2031 (srfi srfi-26))
2032 #:phases
2033 (modify-phases %standard-phases
2034 (replace 'configure
2035 (lambda* (#:key outputs #:allow-other-keys)
2036 (let ((out (assoc-ref outputs "out")))
2037 (mkdir-p (string-append out "/bin"))
2038 (mkdir-p (string-append out "/sbin"))
2039
2040 ;; Pretend we have everything...
2041 (system "yes | make config")
2042
2043 ;; ... except for the things we don't have.
2044 ;; HAVE_AFDECnet requires libdnet, which we don't have.
2045 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
2046 ;; that have been removed.
2047 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
2048 ;; think about adding them later.
2049 (substitute* '("config.make" "config.h")
2050 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
8ea5d868
MW
2051 ""))
2052 #t)))
6d31c175
LF
2053 (add-after 'install 'remove-redundant-commands
2054 (lambda* (#:key outputs #:allow-other-keys)
2055 ;; Remove commands and man pages redundant with Inetutils.
2056 (let* ((out (assoc-ref outputs "out"))
2057 (dup (append-map (cut find-files out <>)
2058 '("^hostname"
2059 "^(yp|nis|dns)?domainname"))))
2060 (for-each delete-file dup)
2061 #t))))
2062 ;; Binaries that depend on libnet-tools.a don't declare that
2063 ;; dependency, making it parallel-unsafe.
2064 #:parallel-build? #f
2065
2066 #:tests? #f ; no test suite
2067 #:make-flags (let ((out (assoc-ref %outputs "out")))
2068 (list "CC=gcc"
2069 (string-append "BASEDIR=" out)
2070 (string-append "INSTALLNLSDIR=" out "/share/locale")
2071 (string-append "mandir=/share/man")))))
631c9f74
LF
2072 (native-inputs `(("gettext" ,gettext-minimal)
2073 ("unzip" ,unzip)))
6d31c175
LF
2074 (synopsis "Tools for controlling the network subsystem in Linux")
2075 (description
2076 "This package includes the important tools for controlling the network
2077subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
2078route. Additionally, this package contains utilities relating to particular
2079network hardware types (plipconfig, slattach) and advanced aspects of IP
2080configuration (iptunnel, ipmaddr).")
2081 (license license:gpl2+))))
2082
c762e82e
LC
2083(define-public libcap
2084 (package
2085 (name "libcap")
4bf85003 2086 (version "2.27")
c762e82e
LC
2087 (source (origin
2088 (method url-fetch)
c762e82e 2089 (uri (string-append
f6c2d05c
LC
2090 "mirror://kernel.org/linux/libs/security/linux-privs/"
2091 "libcap2/libcap-" version ".tar.xz"))
c762e82e
LC
2092 (sha256
2093 (base32
4bf85003 2094 "0sj8kidl7qgf2qwxcbw1vadnlb30y4zvjzxswsmfdghq04npkhfs"))))
c762e82e 2095 (build-system gnu-build-system)
6d889daf
SB
2096 (arguments '(#:phases
2097 (modify-phases %standard-phases
2098 (replace 'configure
2099 ;; Add $libdir to the RUNPATH of executables.
2100 (lambda _
2101 (substitute* "Make.Rules"
2102 (("LDFLAGS := #-g")
2103 (string-append "LDFLAGS := -Wl,-rpath="
d70d59d6
MW
2104 %output "/lib")))
2105 #t)))
c762e82e
LC
2106 #:tests? #f ; no 'check' target
2107 #:make-flags (list "lib=lib"
2108 (string-append "prefix="
2109 (assoc-ref %outputs "out"))
2110 "RAISE_SETFCAP=no")))
2111 (native-inputs `(("perl" ,perl)))
2112 (inputs `(("attr" ,attr)))
2113 (home-page "https://sites.google.com/site/fullycapable/")
2114 (synopsis "Library for working with POSIX capabilities")
2115 (description
35b9e423 2116 "Libcap2 provides a programming interface to POSIX capabilities on
c762e82e
LC
2117Linux-based operating systems.")
2118
2119 ;; License is BSD-3 or GPLv2, at the user's choice.
3ac73271 2120 (license license:gpl2)))
215b6431
LC
2121
2122(define-public bridge-utils
2123 (package
2124 (name "bridge-utils")
4863773e
TGR
2125 (version "1.6")
2126 (source
2127 (origin
2128 (method url-fetch)
18160c34
MB
2129 (uri (string-append "mirror://kernel.org/linux/utils/net/bridge-utils/"
2130 "bridge-utils-" version ".tar.xz"))
4863773e
TGR
2131 (sha256
2132 (base32 "1j16kr44csyr4yqxly26l1yw2bh4nkiasgwvask2i2gvsnsyyryc"))))
215b6431
LC
2133 (build-system gnu-build-system)
2134
2135 ;; The tarball lacks all the generated files.
2136 (native-inputs `(("autoconf" ,autoconf)
2137 ("automake" ,automake)))
2138 (arguments
dc1d3cde
KK
2139 '(#:phases
2140 (modify-phases %standard-phases
189be331 2141 (add-before 'bootstrap 'patch-stuff
dc1d3cde
KK
2142 (lambda _
2143 ;; Fix "field ‘ip6’ has incomplete type" errors.
2144 (substitute* "libbridge/libbridge.h"
2145 (("#include <linux/if_bridge.h>")
2146 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
2147
2148 ;; Ensure that the entire build fails if one of the
2149 ;; sub-Makefiles fails.
2150 (substitute* "Makefile.in"
2151 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
2152 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
2153
189be331 2154 #t)))
215b6431
LC
2155 #:tests? #f)) ; no 'check' target
2156
e496ee67 2157 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
215b6431
LC
2158 (synopsis "Manipulate Ethernet bridges")
2159 (description
2160 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2161to connect two Ethernet segments together in a protocol independent way.
2162Packets are forwarded based on Ethernet address, rather than IP address (like
2163a router). Since forwarding is done at Layer 2, all protocols can go
2164transparently through a bridge.")
3ac73271 2165 (license license:gpl2+)))
3cc20675
LC
2166
2167(define-public libnl
2168 (package
2169 (name "libnl")
276e7739 2170 (version "3.5.0")
3cc20675
LC
2171 (source (origin
2172 (method url-fetch)
2173 (uri (string-append
a2265ea3
MB
2174 "https://github.com/thom311/libnl/releases/download/"
2175 "libnl" (string-join (string-split version #\.) "_")
2176 "/libnl-" version ".tar.gz"))
3cc20675
LC
2177 (sha256
2178 (base32
276e7739 2179 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
3cc20675 2180 (build-system gnu-build-system)
d80a47f2
DL
2181 (native-inputs
2182 `(("bison" ,bison)
2183 ("flex" ,flex)
3eb7c000
DL
2184 ("pkg-config" ,pkg-config)
2185 ("swig" ,swig)
d80a47f2
DL
2186 ("libnl3-doc"
2187 ,(origin
2188 (method url-fetch)
2189 (uri (string-append
2190 "https://github.com/thom311/libnl/releases/download/libnl"
2191 (string-join (string-split version #\.) "_")
2192 "/libnl-doc-" version ".tar.gz"))
2193 (sha256
276e7739 2194 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
3eb7c000
DL
2195 (inputs
2196 `(("python-2" ,python-2)
2197 ("python-3" ,python-3)))
2198 (outputs '("out" "doc" "python2" "python3"))
d80a47f2 2199 (arguments
3eb7c000
DL
2200 `(#:modules ((guix build gnu-build-system)
2201 (guix build utils)
2202 (srfi srfi-1))
2203 #:phases
d80a47f2 2204 (modify-phases %standard-phases
3eb7c000
DL
2205 (add-after 'install 'install-python
2206 (lambda* (#:key outputs #:allow-other-keys)
2207 (define (python-inst python)
35faa006
RW
2208 (invoke python "setup.py" "build")
2209 (invoke python "setup.py" "install"
2210 (string-append "--prefix="
2211 (assoc-ref %outputs python)))
2212 (invoke python "setup.py" "clean"))
2213 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2214 (assoc-ref %outputs "out")))
3eb7c000 2215 (with-directory-excursion "./python"
35faa006
RW
2216 (for-each python-inst '("python2" "python3")))
2217 #t))
d80a47f2
DL
2218 (add-after 'install 'install-doc
2219 (lambda* (#:key inputs outputs #:allow-other-keys)
2220 (let ((dest (string-append (assoc-ref outputs "doc")
2221 "/share/doc/libnl")))
2222 (mkdir-p dest)
35faa006
RW
2223 (invoke "tar" "xf" (assoc-ref inputs "libnl3-doc")
2224 "--strip-components=1" "-C" dest)))))))
81e59e41 2225 (home-page "https://www.infradead.org/~tgr/libnl/")
3cc20675
LC
2226 (synopsis "NetLink protocol library suite")
2227 (description
2228 "The libnl suite is a collection of libraries providing APIs to netlink
69b4ffcf 2229protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
3cc20675
LC
2230between the kernel and user space processes. It was designed to be a more
2231flexible successor to ioctl to provide mainly networking related kernel
2232configuration and monitoring interfaces.")
2233
2234 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2235 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
3ac73271 2236 (license license:gpl2)))
023fef7d 2237
65cd77db
MW
2238(define-public iw
2239 (package
2240 (name "iw")
4b0111a4 2241 (version "4.14")
65cd77db
MW
2242 (source (origin
2243 (method url-fetch)
2244 (uri (string-append
2f9e312a 2245 "mirror://kernel.org/software/network/iw/iw-"
65cd77db
MW
2246 version ".tar.xz"))
2247 (sha256
2248 (base32
4b0111a4 2249 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
65cd77db
MW
2250 (build-system gnu-build-system)
2251 (native-inputs `(("pkg-config" ,pkg-config)))
2252 (inputs `(("libnl" ,libnl)))
2253 (arguments
88ca4029
MO
2254 `(#:make-flags
2255 (let* ((target ,(%current-target-system))
2256 (gcc (if target (string-append target "-gcc") "gcc"))
2257 (pkg-config (if target
2258 (string-append target "-pkg-config")
2259 "pkg-config")))
2260 (list
2261 (string-append "CC=" gcc)
2262 (string-append "PKG_CONFIG="
2263 (assoc-ref %build-inputs "pkg-config")
2264 "/bin/" pkg-config)
2265 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
dc1d3cde 2266 #:phases (modify-phases %standard-phases (delete 'configure))))
2f9e312a 2267 (home-page "https://wireless.wiki.kernel.org/")
65cd77db
MW
2268 (synopsis "Tool for configuring wireless devices")
2269 (description
2270 "iw is a new nl80211 based CLI configuration utility for wireless
2f9e312a 2271devices. It replaces @code{iwconfig}, which is deprecated.")
3ac73271 2272 (license license:isc)))
65cd77db 2273
023fef7d
LC
2274(define-public powertop
2275 (package
2276 (name "powertop")
3216577d 2277 (version "2.11")
023fef7d
LC
2278 (source
2279 (origin
2280 (method url-fetch)
8118a086 2281 (uri (string-append "https://01.org/sites/default/files/downloads/"
3216577d 2282 "powertop-v" version "-1-g7ef7f79.tar_0.gz"))
023fef7d 2283 (sha256
3216577d 2284 (base32 "0kynypj5cydfbma0ssblq1k4m1arixc1s2vf0ybv8y2gg09wjs5f"))))
023fef7d 2285 (build-system gnu-build-system)
4c48bf55
ML
2286 (arguments
2287 '(#:phases
2288 (modify-phases %standard-phases
2289 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
59e80445 2290 ;; allow calibrating the network interface in Guix System.
4c48bf55
ML
2291 (add-after 'unpack 'patch-absolute-file-names
2292 (lambda* (#:key inputs #:allow-other-keys)
2293 (let ((kmod (assoc-ref inputs "kmod")))
2294 (substitute* (find-files "src" "\\.cpp$")
2295 ;; Give the right 'modprobe' file name so that essential
2296 ;; modules such as msr.ko can be loaded.
2297 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2298 ;; These programs are only needed to calibrate, so using
2299 ;; relative file names avoids adding extra inputs. When they
2300 ;; are missing powertop gracefully handles it.
2301 (("/usr/bin/hcitool") "hcitool")
2302 (("/usr/bin/xset") "xset")
2303 (("/usr/sbin/hciconfig") "hciconfig"))
2304 #t))))))
023fef7d 2305 (inputs
4c48bf55
ML
2306 `(("kmod" ,kmod)
2307 ("libnl" ,libnl)
023fef7d 2308 ("ncurses" ,ncurses)
4c48bf55
ML
2309 ("pciutils" ,pciutils)
2310 ("zlib" ,zlib)))
c4c4cc05 2311 (native-inputs
ebacb0de 2312 `(("pkg-config" ,pkg-config)))
023fef7d
LC
2313 (home-page "https://01.org/powertop/")
2314 (synopsis "Analyze power consumption on Intel-based laptops")
2315 (description
2316 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2317power management. In addition to being a diagnostic tool, PowerTOP also has
2318an interactive mode where the user can experiment various power management
2319settings for cases where the operating system has not enabled these
2320settings.")
3ac73271 2321 (license license:gpl2)))
6869e5c9
LC
2322
2323(define-public aumix
2324 (package
2325 (name "aumix")
2326 (version "2.9.1")
2327 (source (origin
2328 (method url-fetch)
2329 (uri (string-append
2330 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2331 version ".tar.bz2"))
2332 (sha256
2333 (base32
2334 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2335 (build-system gnu-build-system)
2336 (inputs `(("ncurses" ,ncurses)))
2337 (home-page "http://www.jpj.net/~trevor/aumix.html")
2338 (synopsis "Audio mixer for X and the console")
2339 (description
2340 "Aumix adjusts an audio mixer from X, the console, a terminal,
2341the command line or a script.")
3ac73271 2342 (license license:gpl2+)))
7c0dbe78
SHT
2343
2344(define-public iotop
2345 (package
2346 (name "iotop")
2347 (version "0.6")
2348 (source
2349 (origin
2350 (method url-fetch)
2351 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2352 version ".tar.gz"))
2353 (sha256 (base32
2354 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2355 (build-system python-build-system)
2356 (arguments
d79db39d
EF
2357 '(#:phases
2358 (modify-phases %standard-phases
2359 (add-after 'unpack 'fix-build-with-python3
2360 (lambda _
2361 (substitute* "setup.py"
2362 (("itervalues") "values"))
2363 #t)))
35cebf01 2364 ;; There are currently no checks in the package.
7c0dbe78 2365 #:tests? #f))
d79db39d 2366 (native-inputs `(("python" ,python)))
7c0dbe78
SHT
2367 (home-page "http://guichaz.free.fr/iotop/")
2368 (synopsis
2369 "Displays the IO activity of running processes")
2370 (description
2371 "Iotop is a Python program with a top like user interface to show the
2372processes currently causing I/O.")
3ac73271 2373 (license license:gpl2+)))
e30835e2
LC
2374
2375(define-public fuse
2376 (package
2377 (name "fuse")
e905c8d6 2378 (version "2.9.9")
e30835e2
LC
2379 (source (origin
2380 (method url-fetch)
0e9bc883
LF
2381 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2382 "download/fuse-" version
2383 "/fuse-" version ".tar.gz"))
e30835e2
LC
2384 (sha256
2385 (base32
e905c8d6 2386 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
cd48a549 2387 (patches (search-patches "fuse-overlapping-headers.patch"))))
e30835e2 2388 (build-system gnu-build-system)
b148bd71 2389 (inputs `(("util-linux" ,util-linux)))
e30835e2
LC
2390 (arguments
2391 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2392 (assoc-ref %outputs "out")
2393 "/sbin")
2394 (string-append "INIT_D_PATH="
2395 (assoc-ref %outputs "out")
2396 "/etc/init.d")
9a4efac9
LC
2397
2398 ;; The rule makes /dev/fuse 666.
e30835e2
LC
2399 (string-append "UDEV_RULES_PATH="
2400 (assoc-ref %outputs "out")
9a4efac9 2401 "/lib/udev/rules.d"))
dc1d3cde
KK
2402 #:phases
2403 (modify-phases %standard-phases
2404 (add-before 'build 'set-file-names
2405 (lambda* (#:key inputs #:allow-other-keys)
2406 ;; libfuse calls out to mount(8) and umount(8). Make sure
2407 ;; it refers to the right ones.
2408 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2409 (("/bin/(u?)mount" _ maybe-u)
2410 (string-append (assoc-ref inputs "util-linux")
2411 "/bin/" maybe-u "mount")))
2412 (substitute* '("util/mount.fuse.c")
2413 (("/bin/sh")
2414 (which "sh")))
2415
2416 ;; This hack leads libfuse to search for 'fusermount' in
2417 ;; $PATH, where it may find a setuid-root binary, instead of
2418 ;; trying solely $out/sbin/fusermount and failing because
2419 ;; it's not setuid.
2420 (substitute* "lib/Makefile"
2421 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2422 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2423 #t)))))
0e9bc883 2424 (home-page "https://github.com/libfuse/libfuse")
e30835e2
LC
2425 (synopsis "Support file systems implemented in user space")
2426 (description
2427 "As a consequence of its monolithic design, file system code for Linux
2428normally goes into the kernel itself---which is not only a robustness issue,
2429but also an impediment to system extensibility. FUSE, for \"file systems in
2430user space\", is a kernel module and user-space library that tries to address
2431part of this problem by allowing users to run file system implementations as
2432user-space processes.")
3ac73271
LC
2433 (license (list license:lgpl2.1 ;library
2434 license:gpl2+)))) ;command-line utilities
220193ad
LC
2435
2436(define-public unionfs-fuse
2437 (package
2438 (name "unionfs-fuse")
2f861edf 2439 (version "2.0")
220193ad 2440 (source (origin
a428fdd4
EF
2441 (method git-fetch)
2442 (uri (git-reference
2443 (url "https://github.com/rpodgorny/unionfs-fuse")
2444 (commit (string-append "v" version))))
2445 (file-name (git-file-name name version))
220193ad
LC
2446 (sha256
2447 (base32
a428fdd4 2448 "0lb8zgdxnjy2fjr2284hvdfn7inc1in44ynzgcr66x54bxzvynj6"))))
220193ad 2449 (build-system cmake-build-system)
094f4b53 2450 (native-inputs
3ef27337 2451 `(("python" ,python)))
220193ad 2452 (inputs `(("fuse" ,fuse)))
094f4b53 2453 (arguments
3ef27337
LF
2454 ;; The tests were never actually run ("collected 0 items"), but in recent
2455 ;; versions of pytest that causes an error.
2456 '(#:tests? #f))
2f861edf 2457 (home-page "https://github.com/rpodgorny/unionfs-fuse")
220193ad
LC
2458 (synopsis "User-space union file system")
2459 (description
2460 "UnionFS-FUSE is a flexible union file system implementation in user
2461space, using the FUSE library. Mounting a union file system allows you to
2462\"aggregate\" the contents of several directories into a single mount point.
2463UnionFS-FUSE additionally supports copy-on-write.")
3ac73271 2464 (license license:bsd-3)))
ed748588 2465
0b7a0c20
LC
2466(define fuse-static
2467 (package (inherit fuse)
2468 (name "fuse-static")
2469 (source (origin (inherit (package-source fuse))
2470 (modules '((guix build utils)))
2471 (snippet
6cbee49d
MW
2472 '(begin
2473 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
2474 ;; updated. Change calls to 'mtab_needs_update' to 0 so
2475 ;; that it doesn't do that, allowing us to remove the
2476 ;; dependency on util-linux (something that is useful in
2477 ;; initrds.)
2478 (substitute* '("lib/mount_util.c"
2479 "util/mount_util.c")
2480 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
2481 "0")
2482 (("/bin/")
2483 ""))
2484 #t))))))
0b7a0c20 2485
ed748588
LC
2486(define-public unionfs-fuse/static
2487 (package (inherit unionfs-fuse)
2488 (synopsis "User-space union file system (statically linked)")
2489 (name (string-append (package-name unionfs-fuse) "-static"))
2490 (source (origin (inherit (package-source unionfs-fuse))
2491 (modules '((guix build utils)))
2492 (snippet
6cbee49d
MW
2493 '(begin
2494 ;; Add -ldl to the libraries, because libfuse.a needs that.
2495 (substitute* "src/CMakeLists.txt"
2496 (("target_link_libraries(.*)\\)" _ libs)
2497 (string-append "target_link_libraries"
2498 libs " dl)")))
2499 #t))))
ed748588
LC
2500 (arguments
2501 '(#:tests? #f
1456cff1 2502 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
dc1d3cde
KK
2503 #:phases
2504 (modify-phases %standard-phases
2505 (add-after 'install 'post-install
2506 (lambda* (#:key outputs #:allow-other-keys)
2507 (let* ((out (assoc-ref outputs "out"))
2508 (exe (string-append out "/bin/unionfs")))
2509 ;; By default, 'unionfs' keeps references to
2510 ;; $glibc/share/locale and similar stuff. Remove them.
2511 (remove-store-references exe)
2512
2513 ;; 'unionfsctl' has references to glibc as well. Since
2514 ;; we don't need it, remove it.
2515 (delete-file (string-append out "/bin/unionfsctl"))
2516 #t))))))
0b7a0c20 2517 (inputs `(("fuse" ,fuse-static)))))
67b66003 2518
357b9f9d 2519(define-public sshfs
db288efa 2520 (package
357b9f9d 2521 (name "sshfs")
20f8d1dd 2522 (version "2.10")
db288efa
LC
2523 (source (origin
2524 (method url-fetch)
b58c1b2d 2525 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
f5c6edd6
TGR
2526 "download/sshfs-" version "/sshfs-" version
2527 ".tar.gz"))
db288efa
LC
2528 (sha256
2529 (base32
20f8d1dd 2530 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
db288efa
LC
2531 (build-system gnu-build-system)
2532 (inputs
2533 `(("fuse" ,fuse)
2534 ("glib" ,glib)))
2535 (native-inputs
2536 `(("pkg-config" ,pkg-config)))
f5c6edd6 2537 (home-page "https://github.com/libfuse/sshfs")
db288efa
LC
2538 (synopsis "Mount remote file systems over SSH")
2539 (description
2540 "This is a file system client based on the SSH File Transfer Protocol.
2541Since most SSH servers already support this protocol it is very easy to set
2542up: on the server side there's nothing to do; on the client side mounting the
2543file system is as easy as logging into the server with an SSH client.")
3ac73271 2544 (license license:gpl2+)))
db288efa 2545
357b9f9d 2546(define-public sshfs-fuse
2547 (package (inherit sshfs)
2548 (name "sshfs-fuse")
2549 (properties `((superseded . ,sshfs)))))
2550
1eacffb9
RH
2551(define-public archivemount
2552 (package
2553 (name "archivemount")
903deeea 2554 (version "0.8.12")
1eacffb9
RH
2555 (source
2556 (origin
2557 (method url-fetch)
c6d8817e 2558 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
1eacffb9
RH
2559 "archivemount-" version ".tar.gz"))
2560 (sha256
903deeea 2561 (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
1eacffb9 2562 (build-system gnu-build-system)
c695fb76
TGR
2563 (inputs `(("fuse" ,fuse)
2564 ("libarchive" ,libarchive)))
2565 (native-inputs `(("pkg-config" ,pkg-config)))
c6d8817e 2566 (home-page "https://www.cybernoia.de/software/archivemount.html")
1eacffb9
RH
2567 (synopsis "Tool for mounting archive files with FUSE")
2568 (description "archivemount is a FUSE-based file system for Unix variants,
2569including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
2570mount point where it can be read from or written to as with any other file
2571system. This makes accessing the contents of the archive, which may be
2572compressed, transparent to other programs, without decompressing them.")
2573 (license license:lgpl2.0+)))
2574
67b66003
LC
2575(define-public numactl
2576 (package
2577 (name "numactl")
93a16e4d 2578 (version "2.0.13")
67b66003
LC
2579 (source (origin
2580 (method url-fetch)
2581 (uri (string-append
0b4f8767 2582 "https://github.com/numactl/numactl/releases/download/v"
1ec29dff 2583 version "/numactl-" version ".tar.gz"))
67b66003
LC
2584 (sha256
2585 (base32
93a16e4d 2586 "16lcypvcmx1ydkpi2s82kqhg13kak7qhpbnj8hd9bdbyhr5ja7lr"))))
67b66003
LC
2587 (build-system gnu-build-system)
2588 (arguments
e35dff97 2589 '(;; There's a 'test' target, but it requires NUMA support in the kernel
67b66003
LC
2590 ;; to run, which we can't assume to have.
2591 #:tests? #f))
b0015064 2592
35dfcdd7
AE
2593 ;; NUMA is apparently not supported on armhf, see
2594 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
2595 (supported-systems (delete "armhf-linux" %supported-systems))
0b4f8767 2596 (home-page "https://github.com/numactl/numactl")
67b66003
LC
2597 (synopsis "Tools for non-uniform memory access (NUMA) machines")
2598 (description
2599 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
79d5ac59
TGR
2600memory is not all in one place. The @command{numactl} program allows you to
2601run your application program on specific CPUs and memory nodes. It does this
2602by supplying a NUMA memory policy to the operating system before running your
67b66003
LC
2603program.
2604
79d5ac59
TGR
2605The package contains other commands, such as @command{numastat},
2606@command{memhog}, and @command{numademo} which provides a quick overview of
2607NUMA performance on your system.")
3ac73271
LC
2608 (license (list license:gpl2 ;programs
2609 license:lgpl2.1)))) ;library
b10e9ff6 2610
103b7e79 2611(define-public kbd-neo
2612 (package
2613 (name "kbd-neo")
2614 (version "2486")
2615 (source
2616 (origin
2617 (method url-fetch)
2618 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
2619 version "/linux/console/neo.map"))
2620 (file-name (string-append name "-" version ".map"))
2621 (sha256
2622 (base32
2623 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
2624 (build-system trivial-build-system)
2625 (arguments
2626 `(#:modules ((guix build utils))
2627 #:builder (begin
2628 (use-modules (guix build utils))
2629 (let ((out (string-append %output "/share/keymaps"))
2630 (source (assoc-ref %build-inputs "source")))
2631 (mkdir-p out)
2632 (copy-file source (string-append out "/neo.map"))
2633 #t))))
2634 (home-page "https://neo-layout.org")
2635 (synopsis "Neo2 console layout")
2636 (description
2637 "Kbd-neo provides the Neo2 keyboard layout for use with
2638@command{loadkeys(1)} from @code{kbd(4)}.")
2639 ;; The file is located in an svn directory, the entire content of
2640 ;; the directory is licensed as GPL3.
2641 (license license:gpl3+)))
2642
b10e9ff6
LC
2643(define-public kbd
2644 (package
2645 (name "kbd")
8555a609 2646 (version "2.0.4")
b10e9ff6
LC
2647 (source (origin
2648 (method url-fetch)
2649 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
710b4928 2650 version ".tar.xz"))
b10e9ff6
LC
2651 (sha256
2652 (base32
8555a609 2653 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
c8f60748
LC
2654 (modules '((guix build utils)))
2655 (snippet
f2cdcafb
LC
2656 '(begin
2657 (substitute* "tests/Makefile.in"
2658 ;; The '%: %.in' rule incorrectly uses @VERSION@.
2659 (("@VERSION@")
2660 "[@]VERSION[@]"))
2661 (substitute* '("src/unicode_start" "src/unicode_stop")
2662 ;; Assume the Coreutils are in $PATH.
2663 (("/usr/bin/tty")
6cbee49d
MW
2664 "tty"))
2665 #t))))
b10e9ff6
LC
2666 (build-system gnu-build-system)
2667 (arguments
5953d2b7
AK
2668 '(#:phases
2669 (modify-phases %standard-phases
2670 (add-before 'build 'pre-build
2671 (lambda* (#:key inputs #:allow-other-keys)
2672 (let ((gzip (assoc-ref %build-inputs "gzip"))
2673 (bzip2 (assoc-ref %build-inputs "bzip2")))
2674 (substitute* "src/libkeymap/findfile.c"
2675 (("gzip")
2676 (string-append gzip "/bin/gzip"))
2677 (("bzip2")
0d47fdf8
MW
2678 (string-append bzip2 "/bin/bzip2")))
2679 #t)))
5953d2b7
AK
2680 (add-after 'install 'post-install
2681 (lambda* (#:key outputs #:allow-other-keys)
2682 ;; Make sure these programs find their comrades.
2683 (let* ((out (assoc-ref outputs "out"))
2684 (bin (string-append out "/bin")))
2685 (for-each (lambda (prog)
2686 (wrap-program (string-append bin "/" prog)
2687 `("PATH" ":" prefix (,bin))))
0d47fdf8
MW
2688 '("unicode_start" "unicode_stop"))
2689 #t))))))
b10e9ff6 2690 (inputs `(("check" ,check)
f61e0e79
LC
2691 ("gzip" ,gzip)
2692 ("bzip2" ,bzip2)
b10e9ff6 2693 ("pam" ,linux-pam)))
fd7000fe 2694 (native-search-paths
2695 (list (search-path-specification
2696 (variable "LOADKEYS_KEYMAP_PATH")
674d4e13
TGR
2697 ;; Append ‘/**’ to recursively search all directories. One can then
2698 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
2699 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
2700 (files (list "share/keymaps/**")))))
b10e9ff6 2701 (native-inputs `(("pkg-config" ,pkg-config)))
0ed81d04 2702 (home-page "http://kbd-project.org/")
b10e9ff6
LC
2703 (synopsis "Linux keyboard utilities and keyboard maps")
2704 (description
2705 "This package contains keytable files and keyboard utilities compatible
2706for systems using the Linux kernel. This includes commands such as
36a4366d 2707@code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
3ac73271 2708 (license license:gpl2+)))
de0b620e 2709
48e595b7
LC
2710(define-public loadkeys-static
2711 (package
2712 (inherit kbd)
2713 (name "loadkeys-static")
2714 (arguments
2715 (substitute-keyword-arguments (package-arguments kbd)
2716 ((#:configure-flags flags ''())
2717 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
2718 "--disable-vlock" ;so we don't need libpam
2719 "--disable-libkeymap")
2720 ,flags))
2721 ((#:make-flags flags ''())
2722 `(cons "LDFLAGS=-all-static" ,flags))
2723 ((#:phases phases '%standard-phases)
2724 `(modify-phases ,phases
2725 (replace 'install
2726 (lambda* (#:key outputs #:allow-other-keys)
2727 (let ((out (assoc-ref outputs "out")))
2728 ;; The binary keeps references to gzip, among other things,
2729 ;; which we don't need in the initrd, so strip references.
2730 (remove-store-references "src/loadkeys")
2731
2732 (install-file "src/loadkeys"
2733 (string-append out "/bin"))
2734 #t)))
2735 (delete 'post-install)))
2736 ((#:strip-flags _ '())
2737 ''("--strip-all"))
2738 ((#:allowed-references _ '())
2739 '())))
2740
2741 (synopsis "Statically-linked @command{loadkeys} program")
2742
2743 ;; This package is meant to be used internally in the initrd so don't
2744 ;; expose it.
2745 (properties '((hidden? . #t)))))
2746
de0b620e
LC
2747(define-public inotify-tools
2748 (package
2749 (name "inotify-tools")
fb5b359d 2750 (version "3.20.1")
de0b620e 2751 (source (origin
88f9fea7
RW
2752 (method git-fetch)
2753 (uri (git-reference
2754 (url "https://github.com/rvoicilas/inotify-tools.git")
2755 (commit version)))
2756 (file-name (git-file-name name version))
de0b620e
LC
2757 (sha256
2758 (base32
88f9fea7 2759 "14dci1i4mhsd5sa33k8h3ayphk19kizynh5ql9ryibdpmcanfiyq"))))
de0b620e 2760 (build-system gnu-build-system)
fb5b359d
MB
2761 (native-inputs
2762 `(("autoconf" ,autoconf)
2763 ("automake" ,automake)
2764 ("libtool" ,libtool)))
2765 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
de0b620e
LC
2766 (synopsis "Monitor file accesses")
2767 (description
2768 "The inotify-tools packages provides a C library and command-line tools
2769to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3ac73271 2770 (license license:gpl2+)))
e062d542
AE
2771
2772(define-public kmod
2773 (package
2774 (name "kmod")
3c258998 2775 (version "26")
e062d542
AE
2776 (source (origin
2777 (method url-fetch)
2778 (uri
2779 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
2780 "kmod-" version ".tar.xz"))
2781 (sha256
2782 (base32
3c258998 2783 "17dvrls70nr3b3x1wm8pwbqy4r8a5c20m0dhys8mjhsnpg425fsp"))
fc1adab1 2784 (patches (search-patches "kmod-module-directory.patch"))))
e062d542
AE
2785 (build-system gnu-build-system)
2786 (native-inputs
2787 `(("pkg-config" ,pkg-config)))
2788 (inputs
f61e0e79
LC
2789 `(("xz" ,xz)
2790 ("zlib" ,zlib)))
e062d542 2791 (arguments
9f2eb4ff 2792 `(#:tests? #f ; FIXME: Investigate test failures
4a8b4c25 2793 #:configure-flags '("--with-xz" "--with-zlib")
9f2eb4ff
TGR
2794 #:phases
2795 (modify-phases %standard-phases
2796 (add-after 'install 'install-modprobe&co
2797 (lambda* (#:key outputs #:allow-other-keys)
2798 (let* ((out (assoc-ref outputs "out"))
2799 (bin (string-append out "/bin")))
2800 (for-each (lambda (tool)
2801 (symlink "kmod"
2802 (string-append bin "/" tool)))
2803 '("insmod" "rmmod" "lsmod" "modprobe"
2804 "modinfo" "depmod"))
2805 #t))))))
e062d542
AE
2806 (home-page "https://www.kernel.org/")
2807 (synopsis "Kernel module tools")
35b9e423 2808 (description "Kmod is a set of tools to handle common tasks with Linux
e062d542
AE
2809kernel modules like insert, remove, list, check properties, resolve
2810dependencies and aliases.
2811
2812These tools are designed on top of libkmod, a library that is shipped with
2813kmod. The aim is to be compatible with tools, configurations and indices
2814from the module-init-tools project.")
3ac73271 2815 (license license:gpl2+))) ; library under lgpl2.1+
d7d42d6b 2816
76f5428b
MC
2817(define-public earlyoom
2818 (package
2819 (name "earlyoom")
9f7a441d 2820 (version "1.3.1")
76f5428b
MC
2821 (source (origin
2822 (method git-fetch)
2823 (uri (git-reference
2824 (url "https://github.com/rfjakob/earlyoom.git")
2825 (commit (string-append "v" version))))
2826 (file-name (git-file-name name version))
2827 (sha256
2828 (base32
9f7a441d 2829 "06sd3jpkdrwqbphsf8jrgs5rxfi7j3xjmygjjvj4xjk4gncz7r2i"))))
76f5428b
MC
2830 (build-system gnu-build-system)
2831 (arguments
2832 `(#:phases (modify-phases %standard-phases
2833 (delete 'configure)
2834 (add-before 'check 'set-home
2835 (lambda _
2836 (setenv "HOME" (getcwd))
2837 #t))
2838 (add-after 'build 'install-contribs
2839 ;; Install what seems useful from the contrib directory.
2840 (lambda* (#:key outputs #:allow-other-keys)
2841 (let* ((out (assoc-ref outputs "out"))
2842 (contrib (string-append
2843 out "/share/earlyoom/contrib")))
2844 (install-file "contrib/notify_all_users.py" contrib)
2845 #t))))
2846 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
2847 (list "CC=gcc"
2848 (string-append "VERSION=v" ,version)
2849 (string-append "PREFIX=" prefix)
2850 (string-append "SYSCONFDIR=" prefix "/etc")))
2851 #:test-target "test"))
2852 (native-inputs `(("go" ,go) ;for the test suite
2853 ("pandoc" ,ghc-pandoc))) ;to generate the manpage
2854 (home-page "https://github.com/rfjakob/earlyoom")
2855 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
2856 (description "Early OOM is a minimalist out of memory (OOM) daemon that
2857runs in user space and provides a more responsive and configurable alternative
2858to the in-kernel OOM killer.")
2859 (license license:expat)))
2860
7fa715e7
LC
2861(define-public eudev
2862 ;; The post-systemd fork, maintained by Gentoo.
fe32c7f7 2863 (package
7fa715e7 2864 (name "eudev")
ed05d6b2 2865 (version "3.2.9")
7fa715e7 2866 (source (origin
ee2d63db
MB
2867 (method git-fetch)
2868 (uri (git-reference (url "https://github.com/gentoo/eudev")
2869 (commit (string-append "v" version))))
2870 (file-name (git-file-name name version))
7fa715e7
LC
2871 (sha256
2872 (base32
ed05d6b2 2873 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
202342fd 2874 (patches (search-patches "eudev-rules-directory.patch"))))
fe32c7f7 2875 (build-system gnu-build-system)
4e859e92 2876 (arguments
172a9b44
MC
2877 '(#:phases
2878 (modify-phases %standard-phases
ee2d63db
MB
2879 (add-after 'unpack 'make-source-writable
2880 (lambda _
2881 ;; XXX: Git checkouts are read-only, but this package needs to
2882 ;; modify some of its files.
2883 (for-each make-file-writable (find-files "."))
2884 #t))
189be331 2885 (add-before 'bootstrap 'patch-file-names
172a9b44
MC
2886 (lambda* (#:key inputs #:allow-other-keys)
2887 (substitute* "man/make.sh"
2888 (("/usr/bin/xsltproc")
2889 (string-append (assoc-ref inputs "xsltproc")
2890 "/bin/xsltproc")))
189be331 2891 #t))
d85f8e46
MB
2892 (add-after 'install 'move-static-library
2893 (lambda* (#:key outputs #:allow-other-keys)
2894 (let* ((out (assoc-ref outputs "out"))
2895 (static (assoc-ref outputs "static"))
2896 (source (string-append out "/lib/libudev.a"))
2897 (target (string-append static "/lib/libudev.a")))
2898 (mkdir-p (dirname target))
2899 (link source target)
2900 (delete-file source)
2901 ;; Remove reference to the static library from the .la file
2902 ;; such that Libtool looks for it in the usual places.
2903 (substitute* (string-append out "/lib/libudev.la")
2904 (("old_library=.*")
2905 "old_library=''\n"))
2906 #t)))
172a9b44
MC
2907 (add-after 'install 'build-hwdb
2908 (lambda* (#:key outputs #:allow-other-keys)
2909 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2910 ;; similar tools to display product names.
2911 (let ((out (assoc-ref outputs "out")))
957a99ab
MW
2912 (invoke (string-append out "/bin/udevadm")
2913 "hwdb" "--update")))))
d85f8e46 2914 #:configure-flags (list "--enable-manpages")))
fe32c7f7 2915 (native-inputs
172a9b44
MC
2916 `(("autoconf" ,autoconf)
2917 ("automake" ,automake)
2918 ("gperf" ,gperf)
2919 ("libtool" ,libtool)
2920 ("pkg-config" ,pkg-config)
2921 ;; For tests.
e75230c1 2922 ("perl" ,perl)
172a9b44
MC
2923 ("python" ,python-wrapper)
2924 ;; For documentation.
2925 ("docbook-xml" ,docbook-xml-4.2)
2926 ("docbook-xsl" ,docbook-xsl)
2927 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
c695fb76 2928 ("xsltproc" ,libxslt)))
fe32c7f7 2929 (inputs
255f7308
LC
2930 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2931 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2932 ;; which contains the rules to do that.
2933 `(("util-linux" ,util-linux) ;for blkid
2934 ("kmod" ,kmod)))
d85f8e46 2935 (outputs '("out" "static"))
e1921a38 2936 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
fe32c7f7
MW
2937 (synopsis "Userspace device management")
2938 (description "Udev is a daemon which dynamically creates and removes
2939device nodes from /dev/, handles hotplug events and loads drivers at boot
2940time.")
3ac73271 2941 (license license:gpl2+)))
7fa715e7 2942
24a4a635
LC
2943;; TODO: Merge with eudev on the next rebuild cycle.
2944(define-public eudev/btrfs-fix
2945 (package/inherit
2946 eudev
2947 (version (string-append (package-version eudev) "-1"))
2948 (arguments
2949 (substitute-keyword-arguments (package-arguments eudev)
2950 ((#:phases phases '%standard-phases)
2951 `(modify-phases ,phases
2952 (add-before 'configure 'patch-bindir-in-btrfs-rules
2953 (lambda* (#:key outputs #:allow-other-keys)
2954 ;; The "@bindir@" substitution incorrectly expands to a literal
2955 ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work
2956 ;; around it.
2957 (let ((out (assoc-ref outputs "out")))
2958 (substitute* "rules/64-btrfs.rules.in"
2959 (("@bindir@")
2960 (string-append out "/bin")))
2961 #t)))))))))
2962
66269d47
LC
2963(define-public lvm2
2964 (package
2965 (name "lvm2")
e20e069b 2966 (version "2.03.08")
66269d47
LC
2967 (source (origin
2968 (method url-fetch)
57bd483f
MB
2969 (uri (list (string-append "ftp://sourceware.org/pub/lvm2/LVM2."
2970 version ".tgz")
2971 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
2972 version ".tgz")))
66269d47
LC
2973 (sha256
2974 (base32
e20e069b 2975 "1j0yis658564rk1ddabkl8vbavp0fdd10gd6qhgyzc3akzf620kf"))
66269d47
LC
2976 (modules '((guix build utils)))
2977 (snippet
2978 '(begin
2979 (use-modules (guix build utils))
2980
2981 ;; Honor sysconfdir.
2982 (substitute* "make.tmpl.in"
57bd483f 2983 (("^confdir = .*$")
66269d47
LC
2984 "confdir = @sysconfdir@\n")
2985 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
6cbee49d
MW
2986 "DEFAULT_SYS_DIR = @sysconfdir@"))
2987 #t))
01f94cca 2988 (patches (search-patches "lvm2-static-link.patch"))))
66269d47
LC
2989 (build-system gnu-build-system)
2990 (native-inputs
2991 `(("pkg-config" ,pkg-config)
2992 ("procps" ,procps))) ;tests use 'pgrep'
2993 (inputs
57bd483f
MB
2994 `(("libaio" ,libaio)
2995 ("udev" ,eudev)))
66269d47 2996 (arguments
3afbc6b3
LF
2997 '(#:phases
2998 (modify-phases %standard-phases
2999 (add-after 'configure 'set-makefile-shell
3000 (lambda _
3001 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
3002 ;; expected.
3003 (setenv "SHELL" (which "sh"))
66269d47 3004
3afbc6b3
LF
3005 ;; Replace /bin/sh with the right file name.
3006 (patch-makefile-SHELL "make.tmpl")
1ac18721 3007 #t)))
66269d47
LC
3008
3009 #:configure-flags (list (string-append "--sysconfdir="
3010 (assoc-ref %outputs "out")
3011 "/etc/lvm")
3012 "--enable-udev_sync"
f2817d43 3013 "--enable-udev_rules"
9324d92e 3014 "--enable-pkgconfig"
a3ed69b6
PN
3015 "--enable-cmdlib"
3016 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
f2817d43
LC
3017
3018 ;; Make sure programs such as 'dmsetup' can
3019 ;; find libdevmapper.so.
3020 (string-append "LDFLAGS=-Wl,-rpath="
a3ed69b6
PN
3021 (assoc-ref %outputs "out")
3022 "/lib,-rpath="
3023 (assoc-ref %outputs "out")
3024 "/lib/device-mapper"))
66269d47
LC
3025
3026 ;; The tests use 'mknod', which requires root access.
3027 #:tests? #f))
62ec02bf 3028 (home-page "https://sourceware.org/lvm2/")
66269d47
LC
3029 (synopsis "Logical volume management for Linux")
3030 (description
3031 "LVM2 is the logical volume management tool set for Linux-based systems.
3032This package includes the user-space libraries and tools, including the device
3033mapper. Kernel components are part of Linux-libre.")
3034
3035 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
3036 ;; Command-line tools are GPLv2.
3ac73271 3037 (license (list license:gpl2 license:lgpl2.1))))
66269d47 3038
01f94cca
LC
3039(define-public lvm2-static
3040 (package
3041 (inherit lvm2)
3042 (name "lvm2-static")
3043
3044 ;; Propagate udev because libdevmapper.a depends on libudev.
d85f8e46 3045 (propagated-inputs `(("udev:static" ,eudev "static")))
01f94cca
LC
3046
3047 (arguments
3048 (substitute-keyword-arguments (package-arguments lvm2)
3049 ((#:configure-flags flags '())
3050 ;; LVM2 doesn't use Libtool, hence the custom option.
57bd483f
MB
3051 `(append '("--enable-static_link")
3052 ;; Building dmeventd statically is complicated due to a
3053 ;; requirement on libdevmapper.a, which is being phased out
3054 ;; in favor of libdevice-mapper.a, which in turn is is not
3055 ;; easily made available at dmeventd build time. Just ignore
3056 ;; it until the situation improves.
3057 (delete "--enable-dmeventd" ,flags)))
3058 ((#:phases phases)
3059 `(modify-phases ,phases
3060 (add-before 'configure 'adjust-Makefile
3061 (lambda _
3062 ;; These fixes are related to the upstream libdm->device_mapper
3063 ;; migration and will hopefully be fixed upstream in due time.
3064 (substitute* "tools/Makefile.in"
3065 ;; This variable is empty in a static configuration and causes
3066 ;; an erroneous GCC command line.
3067 (("-L\\$\\(interfacebuilddir\\)") "")
3068 ;; Remove obsolete reference to libdevmapper.a.
3069 (("-ldevmapper") ""))
3070 #t))))))
01f94cca
LC
3071 (synopsis "Logical volume management for Linux (statically linked)")))
3072
000f7559
DT
3073(define-public wireless-tools
3074 (package
3075 (name "wireless-tools")
3076 (version "30.pre9")
3077 (source (origin
3078 (method url-fetch)
3079 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
3080 version ".tar.gz"))
3081 (sha256
3082 (base32
ec01f22d 3083 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
ec01f22d 3084 (snippet
c2099a4c
MW
3085 '(begin
3086 ;; Remove the older header files that are not free software.
3087 (for-each (lambda (n)
3088 (delete-file (format #f "wireless.~a.h" n)))
3089 '(10 11 12 13 14 15 16 17 18 19 20))
3090 #t))))
000f7559
DT
3091 (build-system gnu-build-system)
3092 (arguments
c2099a4c
MW
3093 `(#:make-flags
3094 (list (string-append "PREFIX=" %output)
3095 (string-append "INSTALL_MAN=" %output "/share/man")
3096 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
3097 "BUILD_STATIC=")
a21b88f1
MO
3098 #:phases
3099 (modify-phases %standard-phases
3100 (replace 'configure
3101 (lambda* (#:key target #:allow-other-keys)
3102 (when ,(%current-target-system)
3103 ;; Cross-compilation: use the cross tools.
3104 (substitute* (find-files "." "Makefile")
3105 (("CC = .*$")
3106 (string-append "CC = " target "-gcc\n"))
3107 (("AR = .*$")
3108 (string-append "AR = " target "-ar\n"))
3109 (("RANLIB = .*$")
3110 (string-append "RANLIB = " target "-ranlib\n"))))
3111 #t)))
000f7559
DT
3112 #:tests? #f))
3113 (synopsis "Tools for manipulating Linux Wireless Extensions")
fb9b7ce2 3114 (description "Wireless Tools are used to manipulate the now-deprecated
36a4366d 3115Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
fb9b7ce2
LC
3116Extension was an interface allowing you to set Wireless LAN specific
3117parameters and get the specific stats. It is deprecated in favor the nl80211
3118interface.")
fe5ed0bb 3119 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
c2099a4c
MW
3120 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
3121 ;; other files are distributed under gpl2.
3ac73271 3122 (license (list license:gpl2 license:lgpl2.1+))))
30016044 3123
cc205dac
LC
3124(define-public crda
3125 (package
3126 (name "crda")
3127 (version "3.18")
3128 (source (origin
3129 (method url-fetch)
3130 (uri (string-append "mirror://kernel.org/software/network/crda/"
3131 "crda-" version ".tar.xz"))
3132 (sha256
3133 (base32
3134 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
fc1adab1 3135 (patches (search-patches "crda-optional-gcrypt.patch"))))
cc205dac
LC
3136 (build-system gnu-build-system)
3137 (arguments
3138 '(#:phases (modify-phases %standard-phases
3139 (delete 'configure)
0bc7c2e4
MW
3140 (add-after 'unpack 'gzip-determinism
3141 (lambda _
3142 (substitute* "Makefile"
3143 (("gzip") "gzip --no-name"))
3144 #t))
cc205dac
LC
3145 (add-before
3146 'build 'no-werror-no-ldconfig
3147 (lambda _
3148 (substitute* "Makefile"
3149 (("-Werror") "")
3150 (("ldconfig") "true"))
3151 #t))
3152 (add-before
3153 'build 'set-regulator-db-file-name
3154 (lambda* (#:key inputs #:allow-other-keys)
3155 ;; Tell CRDA where to find our database.
3156 (let ((regdb (assoc-ref inputs "wireless-regdb")))
3157 (substitute* "crda.c"
3158 (("\"/lib/crda/regulatory.bin\"")
3159 (string-append "\"" regdb
3160 "/lib/crda/regulatory.bin\"")))
3161 #t))))
3162 #:test-target "verify"
3163 #:make-flags (let ((out (assoc-ref %outputs "out"))
3164 (regdb (assoc-ref %build-inputs "wireless-regdb")))
3165 (list "CC=gcc" "V=1"
3166
3167 ;; Disable signature-checking on 'regulatory.bin'.
3168 ;; The reason is that this simplifies maintenance
3169 ;; on our side (no need to manage a distro key
3170 ;; pair), and we can guarantee integrity of
3171 ;; 'regulatory.bin' by other means anyway, such as
3172 ;; 'guix gc --verify'. See
3173 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
3174 ;; for a discssion.
3175 "USE_OPENSSL=0"
3176
3177 (string-append "PREFIX=" out)
3178 (string-append "SBINDIR=" out "/sbin/")
3179 (string-append "UDEV_RULE_DIR="
3180 out "/lib/udev/rules.d")
3181 (string-append "LDFLAGS=-Wl,-rpath="
3182 out "/lib -L.")
3183 (string-append "REG_BIN=" regdb
3184 "/lib/crda/regulatory.bin")))))
3185 (native-inputs `(("pkg-config" ,pkg-config)
cc205dac
LC
3186 ("wireless-regdb" ,wireless-regdb)))
3187 (inputs `(("libnl" ,libnl)))
3188 (home-page
3189 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
3190 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
3191 (description
3192 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
3193communication between the kernel Linux and user space for regulatory
3194compliance.")
3ac73271 3195 (license license:copyleft-next)))
cc205dac 3196
c80b4a3e
LC
3197(define-public wireless-regdb
3198 (package
3199 (name "wireless-regdb")
321292e1 3200 (version "2019.06.03")
c80b4a3e
LC
3201 (source (origin
3202 (method url-fetch)
3203 (uri (string-append
3204 "mirror://kernel.org/software/network/wireless-regdb/"
3205 "wireless-regdb-" version ".tar.xz"))
3206 (sha256
3207 (base32
321292e1 3208 "1gslvh0aqdkv48jyr2ddq153mw28i7qz2ybrjj9qvkk3dgc7x4fd"))
5568151f
LC
3209
3210 ;; We're building 'regulatory.bin' by ourselves.
6cbee49d
MW
3211 (snippet '(begin
3212 (delete-file "regulatory.bin")
3213 #t))))
c80b4a3e
LC
3214 (build-system gnu-build-system)
3215 (arguments
321292e1
TGR
3216 '(#:phases
3217 (modify-phases %standard-phases
3218 (add-after 'unpack 'gzip-determinism
3219 (lambda _
3220 (substitute* "Makefile"
3221 (("gzip") "gzip --no-name"))
3222 #t))
3223 (add-after 'unpack 'omit-signature
3224 (lambda _
3225 (substitute* "Makefile"
3226 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
3227 ;; don't provide (see below). Disable it.
3228 ((" regulatory\\.db\\.p7s") "")
3229 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
3230 ;; but ‘make install’ depends only on the latter while installing
3231 ;; both (and failing). Depend on it explicitly.
3232 (("^install: " all) (string-append all "regulatory.db ")))
3233 #t))
3234 (delete 'configure)) ; no configure script
5568151f
LC
3235
3236 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
3237 ;; is computed and can be equal to 'maintainer-clean'; when that
3238 ;; happens, we can end up deleting the 'regulatory.bin' file that we
3239 ;; just built. Thus, build things sequentially.
3240 #:parallel-build? #f
3241
321292e1
TGR
3242 #:tests? #f ; no tests
3243 #:make-flags
3244 (let ((out (assoc-ref %outputs "out")))
3245 (list (string-append "PREFIX=" out)
3246 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
3247
3248 ;; Leave this empty so that db2bin.py doesn't try to sign
3249 ;; ‘regulatory.bin’. This allows us to avoid managing a key
3250 ;; pair for the whole distribution.
3251 (string-append "REGDB_PRIVKEY=")
3252 ;; Don't generate a public key for the same reason. These are
3253 ;; used as Makefile targets and can't be the empty string.
3254 (string-append "REGDB_PUBCERT=/dev/null")
3255 (string-append "REGDB_PUBKEY=/dev/null")))))
3256 (native-inputs
3257 `(("python" ,python-wrapper)))
c80b4a3e
LC
3258 (home-page
3259 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
3260 (synopsis "Wireless regulatory database")
3261 (description
3262 "This package contains the wireless regulatory database Central
3263Regulatory Database Agent (CRDA) daemon. The database contains information on
3264country-specific regulations for the wireless spectrum.")
3ac73271 3265 (license license:isc)))
c80b4a3e 3266
30016044
MW
3267(define-public lm-sensors
3268 (package
3269 (name "lm-sensors")
3feae386 3270 (version "3.6.0")
b7448627
TGR
3271 (source
3272 (origin
3273 (method git-fetch)
3274 (uri (git-reference
3275 (url "https://github.com/groeck/lm-sensors.git")
3276 (commit (string-append "V" (string-join
3277 (string-split version #\.) "-")))))
3278 (file-name (git-file-name name version))
3279 (sha256
3feae386 3280 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
b7448627 3281 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
30016044
MW
3282 (build-system gnu-build-system)
3283 (inputs `(("rrdtool" ,rrdtool)
3284 ("perl" ,perl)
3285 ("kmod" ,kmod)
3286 ("gnuplot" ,gnuplot)))
3287 (native-inputs `(("pkg-config" ,pkg-config)
3288 ("flex" ,flex)
3289 ("bison" ,bison)
3290 ("which" ,which)))
3feae386 3291 (outputs '("lib" ; avoid perl in closure
8ddf20b2 3292 "out"))
30016044 3293 (arguments
3feae386 3294 `(#:tests? #f ; no 'check' target
30016044 3295 #:make-flags (list (string-append "PREFIX=" %output)
8ddf20b2
DL
3296 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
3297 (string-append "INCLUDEDIR="
3298 (assoc-ref %outputs "lib") "/include")
3299 (string-append "MANDIR=" %output "/share/man")
3300 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
30016044 3301 #:phases
dc1d3cde
KK
3302 (modify-phases %standard-phases
3303 (delete 'configure)
3304 (add-before 'build 'patch-exec-paths
3305 (lambda* (#:key inputs outputs #:allow-other-keys)
3306 (substitute* "prog/detect/sensors-detect"
3307 (("`uname")
3308 (string-append "`" (assoc-ref inputs "coreutils")
3309 "/bin/uname"))
3310 (("(`|\")modprobe" all open-quote)
3311 (string-append open-quote
3312 (assoc-ref inputs "kmod")
3313 "/bin/modprobe")))
3314 (substitute* '("prog/pwm/pwmconfig"
3315 "prog/pwm/fancontrol")
3316 (("gnuplot")
3317 (string-append (assoc-ref inputs "gnuplot")
3318 "/bin/gnuplot"))
3319 (("cat ")
3320 (string-append (assoc-ref inputs "coreutils")
3321 "/bin/cat "))
0bfa8744 3322 (("grep ")
dc1d3cde 3323 (string-append (assoc-ref inputs "grep")
0bfa8744 3324 "/bin/grep "))
dc1d3cde
KK
3325 (("sed -e")
3326 (string-append (assoc-ref inputs "sed")
3327 "/bin/sed -e"))
3328 (("cut -d")
3329 (string-append (assoc-ref inputs "coreutils")
3330 "/bin/cut -d"))
3331 (("sleep ")
3332 (string-append (assoc-ref inputs "coreutils")
3333 "/bin/sleep "))
3334 (("readlink -f")
3335 (string-append (assoc-ref inputs "coreutils")
3336 "/bin/readlink -f")))
3337 #t)))))
afab450c 3338 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
30016044
MW
3339 (synopsis "Utilities to read temperature/voltage/fan sensors")
3340 (description
35b9e423 3341 "Lm-sensors is a hardware health monitoring package for Linux. It allows
30016044
MW
3342you to access information from temperature, voltage, and fan speed sensors.
3343It works with most newer systems.")
3ac73271 3344 (license license:gpl2+)))
b087d413 3345
55e1d39b
MB
3346(define-public iucode-tool
3347 (package
3348 (name "iucode-tool")
9eb7cde0 3349 (version "2.3.1")
55e1d39b
MB
3350 (source (origin
3351 (method url-fetch)
3352 (uri (string-append "https://gitlab.com/iucode-tool/releases"
3353 "/raw/latest/iucode-tool_" version ".tar.xz"))
3354 (sha256
3355 (base32
9eb7cde0 3356 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
55e1d39b
MB
3357 (build-system gnu-build-system)
3358 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
3359 (synopsis "Manipulate Intel microcode bundles")
3360 (description
3361 "@command{iucode_tool} is a utility to work with microcode packages for
3362Intel processors. It can convert between formats, extract specific versions,
3363create a firmware image suitable for the Linux kernel, and more.")
513dc568
EF
3364 ;; cpuid.h is available for i686, x86_64, and ia64.
3365 (supported-systems '("i686-linux" "x86_64-linux"))
55e1d39b
MB
3366 (license license:gpl2+)))
3367
f5b2a53d
RW
3368(define-public i2c-tools
3369 (package
3370 (name "i2c-tools")
3371 (version "3.1.1")
3372 (source (origin
3373 (method url-fetch)
3374 (uri (string-append
f32274a7 3375 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
f5b2a53d
RW
3376 version ".tar.bz2"))
3377 (sha256
3378 (base32
3379 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
3380 (build-system gnu-build-system)
3381 (arguments
3382 `(#:tests? #f ; no 'check' target
3383 #:make-flags (list (string-append "prefix=" %output)
3384 "CC=gcc")
3385 ;; no configure script
dc1d3cde 3386 #:phases (modify-phases %standard-phases (delete 'configure))))
bccf27cb
RW
3387 (inputs
3388 `(("perl" ,perl)))
f32274a7 3389 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
f5b2a53d
RW
3390 (synopsis "I2C tools for Linux")
3391 (description
3392 "The i2c-tools package contains a heterogeneous set of I2C tools for
3393Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
3394EEPROM decoding scripts, EEPROM programming tools, and a python module for
3395SMBus access.")
3ac73271 3396 (license license:gpl2+)))
f5b2a53d 3397
b087d413
MW
3398(define-public xsensors
3399 (package
3400 (name "xsensors")
3401 (version "0.70")
3402 (source (origin
3403 (method url-fetch)
3404 (uri (string-append
3405 "http://www.linuxhardware.org/xsensors/xsensors-"
3406 version ".tar.gz"))
3407 (sha256
3408 (base32
3409 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
3410 (build-system gnu-build-system)
8ddf20b2 3411 (inputs `(("lm-sensors" ,lm-sensors "lib")
b087d413
MW
3412 ("gtk" ,gtk+-2)))
3413 (native-inputs `(("pkg-config" ,pkg-config)))
3414 (arguments
dc1d3cde
KK
3415 `(#:phases
3416 (modify-phases %standard-phases
3417 (add-before 'configure 'enable-deprecated
3418 (lambda _
3419 (substitute* "src/Makefile.in"
3420 (("-DGDK_DISABLE_DEPRECATED") "")
3421 (("-DGTK_DISABLE_DEPRECATED") ""))
3422 #t))
3423 (add-before 'configure 'remove-Werror
3424 (lambda _
3425 (substitute* '("configure" "src/Makefile.in")
3426 (("-Werror") ""))
3427 #t)))))
b087d413
MW
3428 (home-page "http://www.linuxhardware.org/xsensors/")
3429 (synopsis "Hardware health information viewer")
3430 (description
35b9e423 3431 "Xsensors reads data from the libsensors library regarding hardware
b087d413
MW
3432health such as temperature, voltage and fan speed and displays the information
3433in a digital read-out.")
3ac73271 3434 (license license:gpl2+)))
b62fe07f
LC
3435
3436(define-public perf
3437 (package
3438 (name "perf")
3439 (version (package-version linux-libre))
fb76ef84 3440 (source (package-source linux-libre))
b62fe07f
LC
3441 (build-system gnu-build-system)
3442 (arguments
dc1d3cde
KK
3443 '(#:phases
3444 (modify-phases %standard-phases
3445 (replace 'configure
3446 (lambda* (#:key inputs #:allow-other-keys)
3447 (setenv "SHELL_PATH" (which "bash"))
3448 (chdir "tools/perf")
3449 #t)))
65dabe4e 3450 #:make-flags (list (string-append "prefix="
b62fe07f 3451 (assoc-ref %outputs "out"))
5157edd8
MB
3452 ;; Make sure the kernel headers are treated as system
3453 ;; headers to suppress warnings from those.
3454 (string-append "C_INCLUDE_PATH="
3455 (assoc-ref %build-inputs "kernel-headers")
3456 "/include")
2af29d23
LC
3457 "WERROR=0"
3458
3459 ;; By default, 'config/Makefile' uses lib64 on
3460 ;; x86_64. Work around that.
3461 "lib=lib")
b62fe07f
LC
3462 #:tests? #f)) ;no tests
3463 (native-inputs
3464 `(("pkg-config" ,pkg-config)
3465 ("bison" ,bison)
3466 ("flex" ,flex)
3467
3468 ;; There are build scripts written in these languages.
3469 ("perl" ,perl)
3470 ("python" ,python-2)))
3471 (inputs
b1fb4b23 3472 `(("slang" ,slang) ;for the interactive TUI
b62fe07f 3473 ;; ("newt" ,newt)
6c030d10 3474 ("python" ,python-2) ;'perf' links against libpython
b62fe07f 3475 ("elfutils" ,elfutils)
b25d3bd9 3476 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
1d484507
LC
3477 ("libunwind" ,libunwind) ;better stack walking
3478 ("numactl" ,numactl) ;for 'perf bench numa mem'
b62fe07f 3479
d7ece67a
LC
3480 ;; Documentation.
3481 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
d7ece67a
LC
3482 ("docbook-xsl" ,docbook-xsl)
3483 ("xmlto" ,xmlto)
3484 ("asciidoc" ,asciidoc)))
b62fe07f
LC
3485 (home-page "https://perf.wiki.kernel.org/")
3486 (synopsis "Linux profiling with performance counters")
3487 (description
3488 "perf is a tool suite for profiling using hardware performance counters,
3489with support in the Linux kernel. perf can instrument CPU performance
3490counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3491of lightweight profiling. This package contains the user-land tools and in
36a4366d 3492particular the @code{perf} command.")
b62fe07f 3493 (license (package-license linux-libre))))
c09e60e4
DT
3494
3495(define-public pflask
3496 (package
3497 (name "pflask")
3498 (version "0.2")
3499 (source (origin
3500 (method url-fetch)
3501 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
3502 version ".tar.gz"))
f586c877 3503 (file-name (string-append name "-" version ".tar.gz"))
c09e60e4
DT
3504 (sha256
3505 (base32
3506 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
3507 (build-system cmake-build-system)
3508 (arguments
3509 '(#:tests? #f)) ; no tests
81e59e41 3510 (home-page "https://ghedo.github.io/pflask/")
c09e60e4
DT
3511 (synopsis "Simple tool for creating Linux namespace containers")
3512 (description "pflask is a simple tool for creating Linux namespace
3513containers. It can be used for running a command or even booting an OS inside
3514an isolated container, created with the help of Linux namespaces. It is
3515similar in functionality to chroot, although pflask provides better isolation
3516thanks to the use of namespaces.")
3ac73271 3517 (license license:bsd-2)))
288084d5 3518
3ec07ced
RW
3519(define-public singularity
3520 (package
3521 (name "singularity")
edc6dd03 3522 (version "2.6.1")
3ec07ced
RW
3523 (source (origin
3524 (method url-fetch)
3525 (uri (string-append "https://github.com/singularityware/singularity/"
3526 "releases/download/" version
3527 "/singularity-" version ".tar.gz"))
3528 (sha256
3529 (base32
fbf26cbc
LC
3530 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
3531 (modules '((guix build utils)))
3532 (snippet
3533 '(begin
3534 ;; Do not create directories in /var.
3535 (substitute* "Makefile.in"
3536 (("\\$\\(MAKE\\) .*install-data-hook") ""))
af857579
LC
3537
3538 ;; The original source overrides PATH so that it points to
3539 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
3540 ;; on Guix System. Leave PATH unchanged so we refer to the
3541 ;; installed Coreutils, grep, etc.
3542 (substitute* "bin/singularity.in"
3543 (("^PATH=.*" all)
3544 (string-append "#" all "\n")))
08814aec
LC
3545
3546 (substitute* (find-files "libexec/cli" "\\.exec$")
3547 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
3548 _ program)
3549 (string-append "/run/setuid-programs/singularity-"
3550 program "-helper")))
e0dbed64
LC
3551
3552 ;; These squashfs mount options are apparently no longer
3553 ;; supported since Linux-libre 5.4.5.
3554 (substitute* "src/lib/image/squashfs/mount.c"
3555 (("\"errors=remount-ro\"")
3556 "NULL"))
fbf26cbc 3557 #t))))
3ec07ced
RW
3558 (build-system gnu-build-system)
3559 (arguments
08814aec 3560 `(#:configure-flags '("--localstatedir=/var")
3ec07ced
RW
3561 #:phases
3562 (modify-phases %standard-phases
3ec07ced
RW
3563 (add-after 'unpack 'patch-reference-to-squashfs-tools
3564 (lambda _
3565 (substitute* "libexec/cli/build.exec"
3566 (("if ! singularity_which mksquashfs") "if 0")
3567 (("if ! mksquashfs")
3568 (string-append "if ! " (which "mksquashfs"))))
22464cf3
LC
3569 #t))
3570 (add-after 'install 'set-PATH
3571 (lambda* (#:key inputs outputs #:allow-other-keys)
3572 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
3573 (let ((out (assoc-ref outputs "out"))
3574 (coreutils (assoc-ref inputs "coreutils")))
3575 (wrap-program (string-append out "/bin/singularity")
3576 `("PATH" ":" = (,(string-append coreutils "/bin"))))
3577 (substitute* (string-append out "/bin/run-singularity")
3578 (("/usr/bin/env singularity")
3579 (string-append (which "env") " "
3580 out "/bin/singularity")))
3581 #t))))))
3ec07ced
RW
3582 (inputs
3583 `(("libarchive" ,libarchive)
3584 ("python" ,python-wrapper)
3ec07ced
RW
3585 ("zlib" ,zlib)
3586 ("squashfs-tools" ,squashfs-tools)))
3587 (home-page "https://singularity.lbl.gov/")
3588 (synopsis "Container platform")
3589 (description "Singularity is a container platform supporting a number of
3590container image formats. It can build SquashFS container images or import
3591existing Docker images. Singularity requires kernel support for container
3592isolation or root privileges.")
3593 (license license:bsd-3)))
3594
288084d5
MW
3595(define-public hdparm
3596 (package
3597 (name "hdparm")
abb90ff9 3598 (version "9.58")
288084d5
MW
3599 (source (origin
3600 (method url-fetch)
1b1ef87e
TGR
3601 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
3602 "hdparm-" version ".tar.gz"))
288084d5
MW
3603 (sha256
3604 (base32
abb90ff9 3605 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
288084d5
MW
3606 (build-system gnu-build-system)
3607 (arguments
3608 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3609 (list (string-append "binprefix=" out)
3610 (string-append "manprefix=" out)
3611 "CC=gcc"))
ec238332
TGR
3612 #:phases
3613 (modify-phases %standard-phases
3614 (delete 'configure)) ; no configure script
3615 #:tests? #f)) ; no test suite
3b3b60d0 3616 (home-page "https://sourceforge.net/projects/hdparm/")
02052b2c 3617 (synopsis "View and tune ATA disk drive parameters")
288084d5 3618 (description
02052b2c
TGR
3619 "@command{hdparm} is a command-line utility to control ATA controllers and
3620disk drives. It can increase performance and/or reliability by careful tuning
3621of hardware settings like power and acoustic management, DMA modes, and caching.
3622It can also display detailed device information, or be used as a simple
3623performance benchmarking tool.
3624
3625@command{hdparm} provides a command line interface to various Linux kernel
3626interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
d08be77a
TGR
3627IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
3628Translation (@dfn{SAT}) are also supported.")
3ac73271 3629 (license (license:non-copyleft "file://LICENSE.TXT"))))
288084d5 3630
323841bd
VL
3631(define-public nvme-cli
3632 (package
3633 (name "nvme-cli")
3634 (version "1.10.1")
3635 (home-page "https://github.com/linux-nvme/nvme-cli")
3636 (source (origin
3637 (method git-fetch)
3638 (uri (git-reference
3639 (url home-page)
3640 (commit (string-append "v" version))))
3641 (sha256
3642 (base32 "12wp2wxmsw2v8m9bhvwvdbhdgx1md8iilhbl19sfzz2araiwi2x8"))
3643 (file-name (git-file-name name version))))
3644 (build-system gnu-build-system)
3645 (arguments
3646 `(#:make-flags (list "CC=gcc")
3647 #:phases (modify-phases %standard-phases
3648 (delete 'configure) ; No ./configure script
3649 (replace 'install
3650 (lambda _
3651 (invoke "make" "install-spec" "PREFIX="
3652 (string-append "DESTDIR=" %output)))))
3653 #:tests? #f)) ; The tests require sysfs, which is not accessible from
3654 ; the build environment
3655 (synopsis "NVM-Express user space tooling for Linux")
3656 (description "Nvme-cli is a utility to provide standards compliant tooling
3657for NVM-Express drives. It was made specifically for Linux as it relies on the
3658IOCTLs defined by the mainline kernel driver.")
3659 (license license:gpl2+)))
3660
c755c854
MW
3661(define-public rfkill
3662 (package
3663 (name "rfkill")
3664 (version "0.5")
3665 (source (origin
3666 (method url-fetch)
3667 (uri (string-append "mirror://kernel.org/software/network/"
3668 name "/" name "-" version ".tar.xz"))
3669 (sha256
3670 (base32
3671 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
3672 (build-system gnu-build-system)
3673 (arguments
3674 `(#:make-flags (list "CC=gcc"
3675 (string-append "PREFIX=" %output))
3676 #:phases (modify-phases %standard-phases
3677 (delete 'configure))
3678 #:tests? #f))
3679 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
3680 (synopsis "Tool for enabling and disabling wireless devices")
3681 (description
3682 "rfkill is a simple tool for accessing the rfkill device interface,
3683which is used to enable and disable wireless networking devices, typically
3684WLAN, Bluetooth and mobile broadband.")
3ac73271 3685 (license (license:non-copyleft "file://COPYING"
5146f22b
EF
3686 "See COPYING in the distribution."))
3687 ;; rfkill is part of util-linux as of 2.31.
3688 (properties `((superseded . ,util-linux)))))
c755c854 3689
dc9bdb1e
ML
3690(define-public acpi
3691 (package
3692 (name "acpi")
3693 (version "1.7")
3694 (source (origin
3695 (method url-fetch)
81e59e41 3696 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
de67e922 3697 version "/" name "-" version ".tar.gz"))
dc9bdb1e
ML
3698 (sha256
3699 (base32
3700 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
3701 (build-system gnu-build-system)
3702 (home-page "http://acpiclient.sourceforge.net")
3703 (synopsis "Display information on ACPI devices")
3704 (description "@code{acpi} attempts to replicate the functionality of the
3705\"old\" @code{apm} command on ACPI systems, including battery and thermal
3706information. It does not support ACPI suspending, only displays information
3707about ACPI devices.")
3708 (license license:gpl2+)))
3709
57a516d3
LC
3710(define-public acpid
3711 (package
3712 (name "acpid")
b928c587 3713 (version "2.0.32")
57a516d3
LC
3714 (source (origin
3715 (method url-fetch)
3716 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
3717 version ".tar.xz"))
3718 (sha256
3719 (base32
b928c587 3720 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
57a516d3 3721 (build-system gnu-build-system)
3b3b60d0 3722 (home-page "https://sourceforge.net/projects/acpid2/")
57a516d3
LC
3723 (synopsis "Daemon for delivering ACPI events to user-space programs")
3724 (description
3725 "acpid is designed to notify user-space programs of Advanced
3726Configuration and Power Interface (ACPI) events. acpid should be started
3727during the system boot, and will run as a background process. When an ACPI
3728event is received from the kernel, acpid will examine the list of rules
3729specified in /etc/acpi/events and execute the rules that match the event.")
3ac73271 3730 (license license:gpl2+)))
37f5caec
TUBK
3731
3732(define-public sysfsutils
3733 (package
3734 (name "sysfsutils")
3735 (version "2.1.0")
3736 (source
3737 (origin
3738 (method url-fetch)
3739 (uri
3740 (string-append
3741 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
3742 version ".tar.gz"))
3743 (sha256
3744 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
3745 (build-system gnu-build-system)
3746 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
3747 (synopsis "System utilities based on Linux sysfs")
3748 (description
8f65585b 3749 "These are a set of utilities built upon sysfs, a virtual file system in
37f5caec
TUBK
3750Linux kernel versions 2.5+ that exposes a system's device tree. The package
3751also contains the libsysfs library.")
3752 ;; The library is under lgpl2.1+ (all files say "or any later version").
3753 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3ac73271 3754 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
a9a1a40b
TUBK
3755
3756(define-public sysfsutils-1
3757 (package
3758 (inherit sysfsutils)
3759 (version "1.3.0")
3760 (source
3761 (origin
3762 (method url-fetch)
3763 (uri
3764 (string-append
3765 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
3766 "/sysfsutils-" version ".tar.gz"))
3767 (sha256
3768 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
3769 (modules '((guix build utils)))
3770 (snippet
3771 '(begin
3772 (substitute* "Makefile.in"
3773 (("includedir = /usr/include/sysfs")
3774 "includedir = @includedir@"))
3775 (substitute* "configure"
3776 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
6cbee49d
MW
3777 (string-append "includedir='" orig "/sysfs'")))
3778 #t))))
a9a1a40b 3779 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
e6caa52d
TUBK
3780
3781(define-public cpufrequtils
3782 (package
3783 (name "cpufrequtils")
3784 (version "0.3")
3785 (source
3786 (origin
3787 (method url-fetch)
18160c34
MB
3788 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
3789 "cpufrequtils-" version ".tar.gz"))
e6caa52d
TUBK
3790 (sha256
3791 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
fc1adab1 3792 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
e6caa52d
TUBK
3793 (build-system gnu-build-system)
3794 (native-inputs
3795 `(("sysfsutils" ,sysfsutils-1)))
3796 (arguments
3797 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3798 (assoc-ref %outputs "out") "/lib"))))
3799 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
3800 (synopsis "Utilities to get and set CPU frequency on Linux")
3801 (description
e881752c 3802 "The cpufrequtils suite contains utilities to retrieve CPU frequency
e6caa52d
TUBK
3803information, and set the CPU frequency if supported, using the cpufreq
3804capabilities of the Linux kernel.")
3ac73271 3805 (license license:gpl2)))
0a588bf9
SB
3806
3807(define-public libraw1394
3808 (package
3809 (name "libraw1394")
7c58c852 3810 (version "2.1.2")
0a588bf9
SB
3811 (source (origin
3812 (method url-fetch)
3813 (uri (string-append
3814 "mirror://kernel.org/linux/libs/ieee1394/"
3815 name "-" version ".tar.xz"))
3816 (sha256
3817 (base32
7c58c852 3818 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
0a588bf9
SB
3819 (build-system gnu-build-system)
3820 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3821 (synopsis "Interface library for the Linux IEEE1394 drivers")
3822 (description
3823 "Libraw1394 is the only supported interface to the kernel side raw1394 of
3824the Linux IEEE-1394 subsystem, which provides direct access to the connected
38251394 buses to user space. Through libraw1394/raw1394, applications can directly
3826send to and receive from other nodes without requiring a kernel driver for the
3827protocol in question.")
3ac73271 3828 (license license:lgpl2.1+)))
68e3c29d
SB
3829
3830(define-public libavc1394
3831 (package
3832 (name "libavc1394")
3833 (version "0.5.4")
3834 (source (origin
3835 (method url-fetch)
de67e922 3836 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
68e3c29d
SB
3837 name "-" version ".tar.gz"))
3838 (sha256
3839 (base32
3840 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
3841 (build-system gnu-build-system)
3842 (native-inputs
3843 `(("pkg-config" ,pkg-config)))
3844 (propagated-inputs
3845 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3b3b60d0 3846 (home-page "https://sourceforge.net/projects/libavc1394/")
68e3c29d
SB
3847 (synopsis "AV/C protocol library for IEEE 1394")
3848 (description
3849 "Libavc1394 is a programming interface to the AV/C specification from
69b4ffcf 3850the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3ac73271 3851 (license license:lgpl2.1+)))
3f7bf86a
SB
3852
3853(define-public libiec61883
3854 (package
3855 (name "libiec61883")
3856 (version "1.2.0")
3857 (source (origin
3858 (method url-fetch)
3859 (uri (string-append
3860 "mirror://kernel.org/linux/libs/ieee1394/"
3861 name "-" version ".tar.xz"))
3862 (sha256
3863 (base32
3864 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
3865 (build-system gnu-build-system)
3866 (native-inputs
3867 `(("pkg-config" ,pkg-config)))
3868 (propagated-inputs
3869 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
3870 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3871 (synopsis "Isochronous streaming media library for IEEE 1394")
3872 (description
3873 "The libiec61883 library provides a higher level API for streaming DV,
3874MPEG-2 and audio over Linux IEEE 1394.")
3ac73271 3875 (license license:lgpl2.1+)))
69159125
MW
3876
3877(define-public mdadm
3878 (package
3879 (name "mdadm")
30288ae5 3880 (version "4.1")
69159125
MW
3881 (source (origin
3882 (method url-fetch)
3883 (uri (string-append
3884 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
3885 version ".tar.xz"))
3886 (sha256
3887 (base32
30288ae5 3888 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
69159125
MW
3889 (build-system gnu-build-system)
3890 (inputs
3891 `(("udev" ,eudev)))
3892 (arguments
3893 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
fae88ae8
LC
3894 (list "CC=gcc"
3895 "INSTALL=install"
69159125
MW
3896 "CHECK_RUN_DIR=0"
3897 ;; TODO: tell it where to find 'sendmail'
3898 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
3899 (string-append "BINDIR=" out "/sbin")
3900 (string-append "MANDIR=" out "/share/man")
3901 (string-append "UDEVDIR=" out "/lib/udev")))
dc1d3cde
KK
3902 #:phases
3903 (modify-phases %standard-phases
3904 (add-before 'build 'patch-program-paths
3905 (lambda* (#:key inputs #:allow-other-keys)
3906 (let ((coreutils (assoc-ref inputs "coreutils")))
3907 (substitute* "udev-md-raid-arrays.rules"
3908 (("/usr/bin/(readlink|basename)" all program)
3909 (string-append coreutils "/bin/" program))))
3910 #t))
3911 (add-before 'build 'remove-W-error
3912 (lambda _
3913 ;; We cannot build with -Werror on i686 due to a
3914 ;; 'sign-compare' warning in util.c.
3915 (substitute* "Makefile"
3916 (("-Werror") ""))
3917 #t))
3918 (delete 'configure))
69159125
MW
3919 ;;tests must be done as root
3920 #:tests? #f))
3921 (home-page "http://neil.brown.name/blog/mdadm")
3922 (synopsis "Tool for managing Linux Software RAID arrays")
3923 (description
3924 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
3925assemble, report on, and monitor arrays. It can also move spares between raid
3926arrays when needed.")
3ac73271 3927 (license license:gpl2+)))
01ccdfb6 3928
631fda7e
LC
3929(define-public mdadm-static
3930 (package
3931 (inherit mdadm)
3932 (name "mdadm-static")
3933 (arguments
3934 (substitute-keyword-arguments (package-arguments mdadm)
3935 ((#:make-flags flags)
3936 `(cons "LDFLAGS = -static" ,flags))
3937 ((#:phases phases)
3938 `(modify-phases ,phases
3939 (add-after 'install 'remove-cruft
3940 (lambda* (#:key outputs #:allow-other-keys)
3941 (let* ((out (assoc-ref outputs "out"))
3942 (precious? (lambda (file)
3943 (member file '("." ".." "sbin"))))
3944 (directories (scandir out (negate precious?))))
3945 (with-directory-excursion out
3946 (for-each delete-file-recursively directories)
3947 (remove-store-references "sbin/mdadm")
3948 (delete-file "sbin/mdmon")
3949 #t))))))
3950 ((#:modules modules %gnu-build-system-modules)
3951 `((ice-9 ftw) ,@modules))
3952 ((#:strip-flags _ '())
3953 ''("--strip-all")) ;strip a few extra KiB
3954 ((#:allowed-references _ '("out"))
3955 '("out")))) ;refer only self
3956 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
3957
b3ed50e6
MB
3958(define-public multipath-tools
3959 (package
3960 (name "multipath-tools")
a82b6003 3961 (version "0.8.3")
b3ed50e6
MB
3962 (source (origin
3963 (method url-fetch)
3e57b7d9 3964 (uri (string-append "https://git.opensvc.com/?p=multipath-tools/"
b3ed50e6
MB
3965 ".git;a=snapshot;h=" version ";sf=tgz"))
3966 (file-name (string-append name "-" version ".tar.gz"))
3967 (sha256
3968 (base32
a82b6003 3969 "1c6ay97wlfv1fl0y8hcfpxhkps14hlnw9gzmj7884micsp7pa9yv"))
b3ed50e6
MB
3970 (modules '((guix build utils)))
3971 (snippet
3972 '(begin
3973 ;; Drop bundled valgrind headers.
3974 (delete-file-recursively "third-party")
3975 (substitute* '("multipathd/main.c"
3976 "libmultipath/debug.c")
3977 (("#include \"../third-party/")
3978 "#include \""))
3979 #t))))
3980 (build-system gnu-build-system)
3981 (arguments
bd835ff2
TGR
3982 '(#:tests? #f ; no tests
3983 #:make-flags (list "CC=gcc"
3984 (string-append "DESTDIR="
b3ed50e6 3985 (assoc-ref %outputs "out"))
b5fb9430 3986 "SYSTEMDPATH=lib"
5247aab8
MB
3987 ;; Add the libaio headers to GCCs system header
3988 ;; search path to suppress -Werror=cast-qual on
3989 ;; the included headers.
3990 (string-append "C_INCLUDE_PATH="
3991 (assoc-ref %build-inputs "libaio")
3992 "/include")
b3ed50e6
MB
3993 (string-append "LDFLAGS=-Wl,-rpath="
3994 (assoc-ref %outputs "out")
3995 "/lib"))
3996 #:phases
3997 (modify-phases %standard-phases
b5fb9430 3998 (add-after 'unpack 'patch-source
7f412f33
MB
3999 (lambda* (#:key inputs #:allow-other-keys)
4000 (let ((lvm2 (assoc-ref inputs "lvm2"))
4001 (udev (assoc-ref inputs "udev")))
4002 (substitute* "Makefile.inc"
a9e7d656
MO
4003 (("\\$\\(prefix\\)/usr") "$(prefix)")
4004 ;; Do not save timestamp to avoid gzip "timestamp
4005 ;; out-of-range" warnings.
4006 (("gzip -9") "gzip -9n"))
7f412f33
MB
4007 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
4008 (("/usr/include/libdevmapper.h")
4009 (string-append lvm2 "/include/libdevmapper.h"))
4010 (("/usr/include/libudev.h")
4011 (string-append udev "/include/libudev.h")))
4012 #t)))
57e3f06b 4013 (delete 'configure)))) ; no configure script
b3ed50e6 4014 (native-inputs
7f412f33
MB
4015 `(("perl" ,perl)
4016 ("pkg-config" ,pkg-config)
4017 ("valgrind" ,valgrind)))
b3ed50e6 4018 (inputs
6f850a19 4019 `(("json-c" ,json-c)
b3ed50e6
MB
4020 ("libaio" ,libaio)
4021 ("liburcu" ,liburcu)
4022 ("lvm2" ,lvm2)
4023 ("readline" ,readline)
4024 ("udev" ,eudev)))
4025 (home-page "http://christophe.varoqui.free.fr/")
4026 (synopsis "Access block devices through multiple paths")
4027 (description
4028 "This package provides the following binaries to drive the
4029Linux Device Mapper multipathing driver:
4030@enumerate
4031@item @command{multipath} - Device mapper target autoconfig.
4032@item @command{multipathd} - Multipath daemon.
4033@item @command{mpathpersist} - Manages SCSI persistent reservations on
4034@code{dm} multipath devices.
4035@item @command{kpartx} - Create device maps from partition tables.
4036@end enumerate")
57e3f06b 4037 (license (list license:gpl2+ ; main distribution
b3ed50e6
MB
4038 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
4039
01ccdfb6
SB
4040(define-public libaio
4041 (package
4042 (name "libaio")
2fabf398 4043 (version "0.3.112")
01ccdfb6
SB
4044 (source (origin
4045 (method url-fetch)
87dc306b
MB
4046 (uri (list
4047 (string-append "https://releases.pagure.org/libaio/"
4048 name "-" version ".tar.gz")))
4049 (sha256
4050 (base32
2fabf398 4051 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
01ccdfb6
SB
4052 (build-system gnu-build-system)
4053 (arguments
4054 '(#:make-flags
4055 (list "CC=gcc" (string-append "prefix=" %output))
4056 #:test-target "partcheck" ; need root for a full 'check'
4057 #:phases
21bdf383 4058 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
87dc306b 4059 (home-page "https://pagure.io/libaio")
01ccdfb6
SB
4060 (synopsis "Linux-native asynchronous I/O access library")
4061 (description
4062 "This library enables userspace to use Linux kernel asynchronous I/O
4063system calls, important for the performance of databases and other advanced
4064applications.")
3ac73271 4065 (license license:lgpl2.1+)))
eb7c43c3 4066
12eb7bb8
VL
4067(define-public blktrace
4068 ;; Take a newer commit to get the fix for CVE-2018-10689.
93a267b7
VL
4069 (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
4070 (revision "1"))
12eb7bb8
VL
4071 (package
4072 (name "blktrace")
4073 (version (git-version "1.2.0" revision commit))
4074 (home-page
4075 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
4076 (source (origin
4077 (method git-fetch)
4078 (uri (git-reference
4079 (url home-page)
4080 (commit commit)))
4081 (sha256
93a267b7
VL
4082 (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
4083 (file-name (git-file-name name version))))
12eb7bb8
VL
4084 (build-system gnu-build-system)
4085 (arguments
4086 '(#:make-flags
4087 (list "CC=gcc" (string-append "prefix=" %output))
4088 #:tests? #f ; no tests
4089 #:phases
4090 (modify-phases %standard-phases
4091 (delete 'configure) ; no configure script
4092 (add-after 'unpack 'fix-gnuplot-path
4093 (lambda* (#:key inputs #:allow-other-keys)
4094 (let ((gnuplot (assoc-ref inputs "gnuplot")))
4095 (substitute* "btt/bno_plot.py"
4096 (("gnuplot %s")
4097 (string-append gnuplot "/bin/gnuplot %s")))
4098 #t))))))
4099 (inputs
4100 `(("libaio" ,libaio)
4101 ("gnuplot" ,gnuplot)
4102 ("python" ,python-wrapper))) ;for 'bno_plot.py'
4103 (synopsis "Block layer IO tracing mechanism")
4104 (description "Blktrace is a block layer IO tracing mechanism which provides
4105detailed information about request queue operations to user space. It extracts
4106event traces from the kernel (via the relaying through the debug file system).")
4107 (license license:gpl2))))
4108
81b98756
RW
4109(define-public sbc
4110 (package
4111 (name "sbc")
2a11a029 4112 (version "1.4")
81b98756
RW
4113 (source (origin
4114 (method url-fetch)
18160c34
MB
4115 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
4116 version ".tar.xz"))
81b98756
RW
4117 (sha256
4118 (base32
2a11a029 4119 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
81b98756
RW
4120 (build-system gnu-build-system)
4121 (inputs
4122 `(("libsndfile" ,libsndfile)))
4123 (native-inputs
4124 `(("pkg-config" ,pkg-config)))
4125 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
4126 (synopsis "Bluetooth subband audio codec")
4127 (description
4128 "The SBC is a digital audio encoder and decoder used to transfer data to
4129Bluetooth audio output devices like headphones or loudspeakers.")
4130 (license license:gpl2+)))
4131
eb7c43c3
DT
4132(define-public bluez
4133 (package
4134 (name "bluez")
8bbbbb39
LF
4135 (replacement bluez/fixed)
4136 (version "5.53")
eb7c43c3
DT
4137 (source (origin
4138 (method url-fetch)
4139 (uri (string-append
e9eb24b1 4140 "mirror://kernel.org/linux/bluetooth/bluez-"
eb7c43c3
DT
4141 version ".tar.xz"))
4142 (sha256
4143 (base32
8bbbbb39 4144 "1g1qg6dz6hl3csrmz75ixr12lwv836hq3ckb259svvrg62l2vaiq"))))
eb7c43c3
DT
4145 (build-system gnu-build-system)
4146 (arguments
90ea83ee 4147 `(#:configure-flags
eb7c43c3 4148 (let ((out (assoc-ref %outputs "out")))
f3dbc626
SB
4149 (list "--sysconfdir=/etc"
4150 "--localstatedir=/var"
4151 "--enable-library"
53142109 4152 "--disable-systemd"
eb7c43c3
DT
4153 ;; Install dbus/udev files to the correct location.
4154 (string-append "--with-dbusconfdir=" out "/etc")
87a16de7
SB
4155 (string-append "--with-udevdir=" out "/lib/udev")))
4156 #:phases
4157 (modify-phases %standard-phases
fbea821a
TD
4158 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
4159 ;; issue (discussion on upstream mailing list:
4160 ;; https://marc.info/?t=149578476300002&r=1&w=2)
4161 (add-before 'check 'skip-wonky-test
4162 (lambda _
4163 (substitute* "unit/test-gatt.c"
4164 (("tester_init\\(&argc, &argv\\);") "return 77;"))
4165 #t))
87a16de7
SB
4166 (add-after 'install 'post-install
4167 (lambda* (#:key inputs outputs #:allow-other-keys)
4168 (let* ((out (assoc-ref outputs "out"))
4169 (servicedir (string-append out "/share/dbus-1/services"))
4170 (service "obexd/src/org.bluez.obex.service")
4171 (rule (string-append
4172 out "/lib/udev/rules.d/97-hid2hci.rules")))
4173 ;; Install the obex dbus service file.
4174 (substitute* service
4175 (("/bin/false")
4176 (string-append out "/libexec/bluetooth/obexd")))
4177 (install-file service servicedir)
4178 ;; Fix paths in the udev rule.
4179 (substitute* rule
4180 (("hid2hci --method")
4181 (string-append out "/lib/udev/hid2hci --method"))
4182 (("/sbin/udevadm")
4183 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
de47cfed 4184 #t))))))
eb7c43c3
DT
4185 (native-inputs
4186 `(("pkg-config" ,pkg-config)
b94a6ca0 4187 ("gettext" ,gettext-minimal)))
eb7c43c3
DT
4188 (inputs
4189 `(("glib" ,glib)
4190 ("dbus" ,dbus)
4191 ("eudev" ,eudev)
4192 ("libical" ,libical)
4193 ("readline" ,readline)))
4194 (home-page "http://www.bluez.org/")
4195 (synopsis "Linux Bluetooth protocol stack")
4196 (description
4197 "BlueZ provides support for the core Bluetooth layers and protocols. It
4198is flexible, efficient and uses a modular implementation.")
3ac73271 4199 (license license:gpl2+)))
3d890318 4200
8bbbbb39
LF
4201(define bluez/fixed
4202 (package
4203 (inherit bluez)
4204 (source (origin
4205 (inherit (package-source bluez))
4206 (patches (append (origin-patches (package-source bluez))
4207 (search-patches "bluez-CVE-2020-0556.patch")))))))
4208
3d890318
LC
4209(define-public fuse-exfat
4210 (package
4211 (name "fuse-exfat")
1372754d 4212 (version "1.3.0")
3d890318
LC
4213 (source (origin
4214 (method url-fetch)
c0cc805e
TGR
4215 (uri (string-append
4216 "https://github.com/relan/exfat/releases/download/v"
4217 version "/" name "-" version ".tar.gz"))
3d890318
LC
4218 (sha256
4219 (base32
1372754d 4220 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
3d890318
LC
4221 (build-system gnu-build-system)
4222 (native-inputs
c0cc805e 4223 `(("pkg-config" ,pkg-config)))
3d890318
LC
4224 (inputs
4225 `(("fuse" ,fuse)))
c0cc805e 4226 (home-page "https://github.com/relan/exfat")
3d890318
LC
4227 (synopsis "Mount exFAT file systems")
4228 (description
4229 "This package provides a FUSE-based file system that provides read and
4230write access to exFAT devices.")
3ac73271 4231 (license license:gpl2+)))
53ec8d48 4232
1564e0fe
PN
4233(define-public fuseiso
4234 (package
4235 (name "fuseiso")
4236 (version "20070708")
4237 (source (origin
4238 (method url-fetch)
4239 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
4240 version "/fuseiso-" version ".tar.bz2"))
4241 (sha256
4242 (base32
4243 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
4244 (build-system gnu-build-system)
4245 (native-inputs
4246 `(("pkg-config" ,pkg-config)))
4247 (inputs
4248 `(("fuse" ,fuse)
4249 ("glib" ,glib)
4250 ("zlib" ,zlib)))
4251 (home-page "https://sourceforge.net/projects/fuseiso/")
dff79364 4252 (synopsis "Mount ISO file system images")
1564e0fe 4253 (description
52beae7b 4254 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
b60e9fb8
PN
4255.bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
4256Ridge, Joliet, and zisofs.")
1564e0fe
PN
4257 (license license:gpl2)))
4258
53ec8d48
LC
4259(define-public gpm
4260 (package
4261 (name "gpm")
4262 (version "1.20.7")
4263 (source (origin
4264 (method url-fetch)
4265 (uri (string-append
4266 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
4267 version ".tar.bz2"))
fddb22ac 4268 (patches (search-patches "gpm-glibc-2.26.patch"))
53ec8d48
LC
4269 (sha256
4270 (base32
4271 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
4272 (build-system gnu-build-system)
4273 (arguments
4274 '(#:phases (modify-phases %standard-phases
189be331 4275 (replace 'bootstrap
53ec8d48
LC
4276 (lambda _
4277 ;; The tarball was not generated with 'make dist' so we
4278 ;; need to bootstrap things ourselves.
77bb6c22
EF
4279 (substitute* "autogen.sh"
4280 (("/bin/sh") (which "sh")))
90a54e36
MW
4281 (invoke "./autogen.sh")
4282 (patch-makefile-SHELL "Makefile.include.in")
4283 #t)))
53ec8d48
LC
4284
4285 ;; Make sure programs find libgpm.so.
4286 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4287 (assoc-ref %outputs "out")
4288 "/lib"))))
4289 (native-inputs
4290 `(("texinfo" ,texinfo)
4291 ("bison" ,bison)
4292 ("flex" ,flex)
4293 ("autoconf" ,autoconf)
4294 ("automake" ,automake)
4295 ("libtool" ,libtool)))
4296 (home-page "http://www.nico.schottelius.org/software/gpm/")
4297 (synopsis "Mouse support for the Linux console")
4298 (description
4299 "The GPM (general-purpose mouse) daemon is a mouse server for
4300applications running on the Linux console. It allows users to select items
4301and copy/paste text in the console and in xterm.")
3ac73271 4302 (license license:gpl2+)))
fc686f9a
TGR
4303
4304(define-public btrfs-progs
4305 (package
4306 (name "btrfs-progs")
0724b73d 4307 (version "5.4.1")
fc686f9a
TGR
4308 (source (origin
4309 (method url-fetch)
4310 (uri (string-append "mirror://kernel.org/linux/kernel/"
4311 "people/kdave/btrfs-progs/"
4312 "btrfs-progs-v" version ".tar.xz"))
4313 (sha256
4314 (base32
0724b73d 4315 "0scxg9p6z0wss92gmv5a8yxdmr8x449kb5v3bfnvs26n92r7zq7k"))))
fc686f9a 4316 (build-system gnu-build-system)
7cad981d 4317 (outputs '("out"
c4b006ba 4318 "static")) ; static versions of the binaries in "out"
fc686f9a 4319 (arguments
7cad981d 4320 '(#:phases (modify-phases %standard-phases
0c26e43e
BW
4321 (add-after 'unpack 'patch-makefile
4322 (lambda* (#:key outputs #:allow-other-keys)
4323 (substitute* "Makefile"
4324 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
4325 (string-append (assoc-ref outputs "out")
4326 "/lib/udev/rules.d")))
4327 #t))
7cad981d 4328 (add-after 'build 'build-static
caf4c7c8 4329 (lambda _ (invoke "make" "static")))
9a1c4a98
MB
4330 (add-after 'install 'install-bash-completion
4331 (lambda* (#:key outputs #:allow-other-keys)
3ce4e265
MB
4332 (let* ((out (assoc-ref outputs "out"))
4333 (bashcomp (string-append out "/etc/bash_completion.d")))
4334 (mkdir-p bashcomp)
4335 (copy-file "btrfs-completion"
4336 (string-append bashcomp "/btrfs"))
4337 #t)))
7cad981d
TGR
4338 (add-after 'install 'install-static
4339 (let ((staticbin (string-append (assoc-ref %outputs "static")
4340 "/bin")))
4341 (lambda _
caf4c7c8
MW
4342 (invoke "make"
4343 (string-append "bindir=" staticbin)
4344 "install-static")))))
d6fb0985 4345 #:tests? #f ; XXX: require the 'btrfs' kernel module.
7cad981d 4346 #:test-target "test"
fc686f9a 4347 #:parallel-tests? #f)) ; tests fail when run in parallel
0c26e43e 4348 (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
fc686f9a 4349 ("libblkid" ,util-linux)
7cad981d 4350 ("libblkid:static" ,util-linux "static")
fc686f9a 4351 ("libuuid" ,util-linux)
7cad981d 4352 ("libuuid:static" ,util-linux "static")
e2937a55 4353 ("lzo" ,lzo)
fc686f9a 4354 ("zlib" ,zlib)
029c2ba0 4355 ("zlib:static" ,zlib "static")
ec0de9d8
MB
4356 ("zstd" ,zstd "lib")
4357 ("zstd:static" ,zstd "static")))
fc686f9a
TGR
4358 (native-inputs `(("pkg-config" ,pkg-config)
4359 ("asciidoc" ,asciidoc)
1dfb14d2 4360 ("python" ,python)
fc686f9a 4361 ("xmlto" ,xmlto)
41d23dd1 4362 ;; For building documentation.
fc686f9a 4363 ("libxml2" ,libxml2)
48b7e4a6 4364 ("docbook-xsl" ,docbook-xsl)
41d23dd1 4365 ;; For tests.
bc64676c 4366 ("acl" ,acl)
caf4c7c8 4367 ("which" ,which)
0c26e43e
BW
4368 ("dmsetup" ,lvm2)
4369 ("udevadm" ,eudev)
caf4c7c8
MW
4370 ;; The tests need 'grep' with perl regexp support.
4371 ("grep" ,grep)))
fc83ca2b 4372 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
fc686f9a 4373 (synopsis "Create and manage btrfs copy-on-write file systems")
039601e0
TGR
4374 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
4375aimed at implementing advanced features while focusing on fault tolerance,
4376repair and easy administration.")
68bcac6b
LF
4377 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
4378 ;; GPL2: Everything else.
4379 (license (list license:gpl2 license:gpl2+))))
08e9daf5 4380
f3e44f5c
DC
4381(define-public btrfs-progs/static
4382 (package
4383 (name "btrfs-progs-static")
4384 (version (package-version btrfs-progs))
4385 (source #f)
4386 (build-system trivial-build-system)
4387 (inputs
4388 `(("btrfs-progs:static" ,btrfs-progs "static")))
4389 (arguments
4390 `(#:modules ((guix build utils))
4391 #:builder
4392 (begin
4393 (use-modules (guix build utils)
4394 (ice-9 ftw)
4395 (srfi srfi-26))
4396
4397 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
4398 (out (assoc-ref %outputs "out"))
4399 (source (string-append btrfs "/bin/btrfs.static"))
4400 (target (string-append out "/bin/btrfs")))
4401 (mkdir-p (dirname target))
4402 (copy-file source target)
4403 (remove-store-references target)
e3cfef22
MW
4404 (chmod target #o555)
4405 #t))))
f3e44f5c 4406 (home-page (package-home-page btrfs-progs))
ff797172
TGR
4407 (synopsis "Statically-linked btrfs command from btrfs-progs")
4408 (description "This package provides the statically-linked @command{btrfs}
4409from the btrfs-progs package. It is meant to be used in initrds.")
f3e44f5c
DC
4410 (license (package-license btrfs-progs))))
4411
0f4be78f
VL
4412(define-public cramfs-tools
4413 (package
4414 (name "cramfs-tools")
4415 (home-page "https://github.com/npitre/cramfs-tools")
4416 (version "2.1")
4417 (source (origin
4418 (method git-fetch)
4419 (uri (git-reference
4420 (url home-page)
4421 (commit (string-append "v" version))))
4422 (sha256
4423 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
4424 (file-name (git-file-name name version))))
4425 (build-system gnu-build-system)
4426 (arguments
4427 '(#:tests? #f ; No tests.
4428 #:phases
4429 (modify-phases %standard-phases
4430 (delete 'configure)
4431 (replace 'install
4432 (lambda* (#:key outputs #:allow-other-keys)
4433 (let ((out (assoc-ref outputs "out")))
4434 (install-file "mkcramfs" (string-append out "/sbin"))
4435 (install-file "cramfsck" (string-append out "/sbin")))
4436 #t)))))
4437 (inputs
4438 `(("zlib" ,zlib)))
4439 (synopsis "Tools to manage Cramfs file systems")
4440 (description "Cramfs is a Linux file system designed to be simple, small,
4441and to compress things well. It is used on a number of embedded systems and
4442small devices. This version has additional features such as uncompressed
4443blocks and random block placement.")
4444 (license license:gpl2+)))
4445
49b28a74
PN
4446(define-public compsize
4447 (package
4448 (name "compsize")
4449 (version "1.3")
4450 (home-page "https://github.com/kilobyte/compsize")
4451 (source (origin
4452 (method git-fetch)
4453 (uri (git-reference
4454 (url home-page)
4455 (commit (string-append "v" version))))
4456 (sha256
4457 (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43"))
4458 (file-name (git-file-name name version))))
4459 (build-system gnu-build-system)
4460 (inputs
4461 `(("btrfs-progs" ,btrfs-progs)))
4462 (arguments
4463 `(#:tests? #f ; No tests.
4464 #:make-flags (list "CC=gcc")
4465 #:phases
4466 (modify-phases %standard-phases
4467 (delete 'configure)
4468 (replace 'install
4469 (lambda* (#:key outputs #:allow-other-keys)
4470 (let ((out (assoc-ref outputs "out")))
4471 (install-file "compsize" (string-append out "/bin"))
4472 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
4473 (synopsis "Find compression type/ratio on Btrfs files")
4474 (description "@command{compsize} takes a list of files (given as
4475arguments) on a Btrfs file system and measures used compression types and
4476effective compression ratio, producing a report.
4477
4478A directory has no extents but has a (recursive) list of files. A non-regular
4479file is silently ignored.
4480
4481As it makes no sense to talk about compression ratio of a partial extent,
4482every referenced extent is counted whole, exactly once -- no matter if you use
4483only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
4484uncompressed size will not match the number given by @command{tar} or
4485@command{du}. On the other hand, the space used should be accurate (although
4486obviously it can be shared with files outside our set).")
4487 (license license:gpl2+)))
4488
72aa295e 4489(define-public f2fs-tools-1.7
2e456982
MB
4490 (package
4491 (name "f2fs-tools")
72aa295e 4492 (version "1.7.0")
2e456982
MB
4493 (source (origin
4494 (method url-fetch)
4495 (uri (string-append
4496 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
2d588f3c 4497 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
2e456982
MB
4498 (sha256
4499 (base32
72aa295e
DM
4500 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
4501
2e456982
MB
4502 (build-system gnu-build-system)
4503 (arguments
4504 `(#:phases
4505 (modify-phases %standard-phases
72aa295e
DM
4506 (add-after 'install 'install-headers
4507 (lambda* (#:key outputs #:allow-other-keys)
4508 (let* ((out (assoc-ref outputs "out"))
4509 (out-include (string-append out "/include")))
4510 (install-file "include/f2fs_fs.h" out-include)
4511 (install-file "mkfs/f2fs_format_utils.h" out-include)
4512 #t))))))
2e456982
MB
4513 (native-inputs
4514 `(("autoconf" ,autoconf)
4515 ("automake" ,automake)
4516 ("libtool" ,libtool)
4517 ("pkg-config" ,pkg-config)))
4518 (inputs
72aa295e
DM
4519 `(("libuuid" ,util-linux)
4520 ("libselinux" ,libselinux)))
2e456982
MB
4521 (home-page "https://f2fs.wiki.kernel.org/")
4522 (synopsis "Userland tools for f2fs")
4523 (description
4524 "F2FS, the Flash-Friendly File System, is a modern file system
4525designed to be fast and durable on flash devices such as solid-state
4526disks and SD cards. This package provides the userland utilities.")
4527 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
4528 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
4529 (license (list license:gpl2 license:lgpl2.1))))
4530
72aa295e
DM
4531(define-public f2fs-tools
4532 (package
4533 (inherit f2fs-tools-1.7)
4534 (name "f2fs-tools")
d2119ddf 4535 (version "1.13.0")
72aa295e
DM
4536 (source (origin
4537 (method url-fetch)
4538 (uri (string-append
4539 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
2d588f3c 4540 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
72aa295e
DM
4541 (sha256
4542 (base32
d2119ddf 4543 "0z9c0y3qq75iyqknl5k0v7v46l8c3pcifpqb0yqalrs24blkm7dk"))))
72aa295e
DM
4544 (inputs
4545 `(("libuuid" ,util-linux)))))
4546
08e9daf5
TGR
4547(define-public freefall
4548 (package
4549 (name "freefall")
4550 (version (package-version linux-libre))
4551 (source (package-source linux-libre))
4552 (build-system gnu-build-system)
4553 (arguments
4554 '(#:phases (modify-phases %standard-phases
4555 (add-after 'unpack 'enter-subdirectory
4556 (lambda _
2ee42f7e
MW
4557 (chdir "tools/laptop/freefall")
4558 #t))
08e9daf5
TGR
4559 (delete 'configure)
4560 (add-before 'build 'increase-timeout
4561 (lambda _
4562 ;; The default of 2 seconds is too low: it assumes an
4563 ;; open lid and AC power without actually checking.
4564 (substitute* "freefall.c"
2ee42f7e
MW
4565 (("alarm\\(2\\)") "alarm(5)"))
4566 #t)))
08e9daf5 4567 #:make-flags (list (string-append "PREFIX="
c80629e7
EF
4568 (assoc-ref %outputs "out"))
4569 "CC=gcc")
08e9daf5
TGR
4570 #:tests? #f)) ;no tests
4571 (home-page (package-home-page linux-libre))
4572 (synopsis "Free-fall protection for spinning laptop hard drives")
4573 (description
4574 "Prevents shock damage to the internal spinning hard drive(s) of some
4575HP and Dell laptops. When sudden movement is detected, all input/output
4576operations on the drive are suspended and its heads are parked on the ramp,
4577where they are less likely to cause damage to the spinning disc. Requires a
4578drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
4579feature, and a laptop with an accelerometer. It has no effect on SSDs.")
4580 (license license:gpl2)))
d17ae8c0
NG
4581
4582(define-public thinkfan
4583 (package
4584 (name "thinkfan")
9a3d176e
TGR
4585 (version "1.0.2")
4586 (source
4587 (origin
4588 (method git-fetch)
4589 (uri (git-reference
4590 (url "https://github.com/vmatare/thinkfan.git")
4591 (commit version)))
4592 (file-name (git-file-name name version))
4593 (sha256
4594 (base32 "107vw0962hrwva3wra9n3hxlbfzg82ldc10qssv3dspja88g8psr"))))
d17ae8c0
NG
4595 (build-system cmake-build-system)
4596 (arguments
4597 `(#:modules ((guix build cmake-build-system)
4598 (guix build utils)
4599 (srfi srfi-26))
9a3d176e 4600 #:tests? #f ; no test target
d17ae8c0
NG
4601 #:configure-flags
4602 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
9a3d176e
TGR
4603 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
4604 ;; inefficient’.
d17ae8c0
NG
4605 `("-DUSE_ATASMART:BOOL=ON")
4606 #:phases
4607 (modify-phases %standard-phases
908a3f36
TGR
4608 (add-after 'unpack 'create-init-scripts
4609 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
4610 ;; systemd to patch and install their service files. Fake their
4611 ;; presence rather than duplicating the build system below. Leave
4612 ;; things like ‘/bin/kill’ because they're not worth a dependency.
4613 ;; The sysvinit needs manual patching, but since upstream doesn't
4614 ;; even provide the option to install it: don't.
d17ae8c0 4615 (lambda* (#:key outputs #:allow-other-keys)
908a3f36
TGR
4616 (let* ((out (assoc-ref outputs "out"))
4617 (share (string-append out "/share/" ,name)))
4618 (substitute* "CMakeLists.txt"
4619 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
4620 (format "option(~a_FOUND \"Faked\" ON)\n" package))
4621 ;; That was easy! Now we just need to fix the destinations.
4622 (("/etc" directory)
4623 (string-append out directory)))
4624 #t))))))
9a3d176e
TGR
4625 (native-inputs
4626 `(("pkg-config" ,pkg-config)))
d17ae8c0 4627 (inputs
9a3d176e
TGR
4628 `(("libatasmart" ,libatasmart)
4629 ("yaml-cpp" ,yaml-cpp)))
d17ae8c0
NG
4630 (home-page "http://thinkfan.sourceforge.net/")
4631 (synopsis "Simple fan control program")
4632 (description
4633 "Thinkfan is a simple fan control program. It reads temperatures,
4634checks them against configured limits and switches to appropriate (also
4635pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
4636other @code{hwmon} driver that enables temperature reading and fan control
4637from userspace.")
4638 (license license:gpl3+)))
91231156 4639
b313665f
TGR
4640(define-public tpacpi-bat
4641 (package
4642 (name "tpacpi-bat")
4643 (version "3.1")
4644 (source
4645 (origin
4646 (method git-fetch)
4647 (uri (git-reference
4648 (url "https://github.com/teleshoes/tpacpi-bat.git")
4649 (commit (string-append "v" version))))
4650 (file-name (git-file-name name version))
4651 (sha256
4652 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
4653 (build-system gnu-build-system)
4654 (arguments
4655 `(#:tests? #f ; no test target
4656 #:phases
4657 (modify-phases %standard-phases
4658 (add-after 'unpack 'refer-to-inputs
4659 (lambda _
4660 (substitute* "tpacpi-bat"
4661 (("cat ")
4662 (format "~a " (which "cat")))
4663 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
4664 ;; loaded. That's the administrator's prerogative; disable it.
4665 (("system \"(modprobe .*)\"" _ match)
4666 (format "die \"Please run ‘~a’ first.\\n\"" match)))
4667 #t))
4668 (delete 'configure) ; nothing to configure
4669 (delete 'build) ; nothing to build
4670 (replace 'install
4671 (lambda* (#:key outputs #:allow-other-keys)
4672 (let* ((out (assoc-ref outputs "out"))
4673 (bin (string-append out "/bin"))
4674 (doc (string-append out "/share/doc/" ,name "-" ,version)))
4675 (install-file "tpacpi-bat" bin)
4676
4677 ;; There's no man page. Install other forms of documentation.
4678 (for-each (lambda (file)
4679 (let ((target (string-append doc "/" file)))
4680 (mkdir-p (dirname target))
4681 (copy-recursively file target)))
4682 (list "battery_asl" "examples" "README.md"))
4683 #t))))))
4684 (inputs
4685 `(("perl" ,perl)))
4686 (home-page "https://github.com/teleshoes/tpacpi-bat")
4687 (synopsis "ThinkPad battery charge controller")
4688 (description
4689 "Tpacpi-bat is a command-line interface to control battery charging on
4690@uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
4691ThinkPad models released after 2011}, starting with the xx20 series. It can
4692query and set the thresholds at which one or both batteries will start and stop
4693charging, inhibit charging batteries for a set period of time, or force them to
4694discharge when they otherwise would not.
4695
4696This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
4697kernel module provided by the @code{acpi-call-linux-module} package, which must
4698be installed and loaded separately. Only the original vendor firmware is
4699supported.")
4700 (license license:gpl3+)))
4701
91231156
LC
4702(define-public ntfs-3g
4703 (package
4704 (name "ntfs-3g")
d8af4f6d 4705 (version "2017.3.23")
91231156
LC
4706 (source (origin
4707 (method url-fetch)
4708 (uri (string-append "https://tuxera.com/opensource/"
4709 "ntfs-3g_ntfsprogs-" version ".tgz"))
6d01a7f4 4710 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
91231156
LC
4711 (sha256
4712 (base32
d8af4f6d 4713 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
91231156 4714 (modules '((guix build utils)))
6cbee49d
MW
4715 (snippet '(begin
4716 ;; Install under $prefix.
4717 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
4718 (("/sbin")
4719 "@sbindir@"))
4720 #t))))
91231156
LC
4721 (build-system gnu-build-system)
4722 (inputs `(("util-linux" ,util-linux)
4723 ("fuse" ,fuse))) ;libuuid
4724 (native-inputs `(("pkg-config" ,pkg-config)))
4725 (arguments
4726 '(#:configure-flags (list "--exec-prefix=${prefix}"
4727 "--with-fuse=external" ;use our own FUSE
4728 "--enable-mount-helper"
4729 "--enable-posix-acls"
91420521
PN
4730 "--enable-xattr-mappings")
4731 #:phases
4732 (modify-phases %standard-phases
4733 ;; If users install ntfs-3g, they probably want to make it the
4734 ;; default driver as well, so we opt for sensible defaults and link
4735 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
52beae7b 4736 ;; mount NTFS file systems.)
91420521
PN
4737 (add-after 'install 'install-link
4738 (lambda* (#:key outputs #:allow-other-keys)
4739 (let* ((out (assoc-ref outputs "out"))
4740 (sbin (string-append out "/sbin")))
4741 (symlink "mount.ntfs-3g"
9922278b
MW
4742 (string-append sbin "/mount.ntfs")))
4743 #t)))))
8bad0c0b 4744 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
91231156
LC
4745 (synopsis "Read-write access to NTFS file systems")
4746 (description
4747 "NTFS-3G provides read-write access to NTFS file systems, which are
4748commonly found on Microsoft Windows. It is implemented as a FUSE file system.
4749The package provides additional NTFS tools.")
4750 (license license:gpl2+)))
9b0942c1 4751
f8f44dd7
MB
4752(define-public rdma-core
4753 (package
4754 (name "rdma-core")
e68f954e 4755 (version "26.0")
f8f44dd7
MB
4756 (source (origin
4757 (method url-fetch)
4758 (uri (string-append "https://github.com/linux-rdma/rdma-core"
4759 "/releases/download/v" version "/rdma-core-"
4760 version ".tar.gz"))
4761 (sha256
4762 (base32
e68f954e 4763 "14raqwx4pkzghiwkx1v0dq338f7xqqx8rnsxlpdnngvjy1p5l79j"))))
f8f44dd7
MB
4764 (build-system cmake-build-system)
4765 (arguments
e68f954e 4766 `(#:tests? #f ; no tests
f8f44dd7
MB
4767 ;; Upstream uses the "ninja" build system and encourage distros
4768 ;; to do the same for consistency. They also recommend using the
4769 ;; "Release" build type.
3def739d 4770 #:build-type "Release"
2b14c60d
LC
4771 #:configure-flags (list "-GNinja"
4772
e68f954e
LC
4773 (string-append "-DRST2MAN_EXECUTABLE="
4774 (assoc-ref %build-inputs
4775 "python-docutils")
4776 "/bin/rst2man.py")
4777
2b14c60d
LC
4778 ;; On some configurations, the
4779 ;; IB_USER_MAD_REGISTER_AGENT ioctl, which is
4780 ;; used by default, would return ENODEV. To
4781 ;; avoid that, use 'write' instead of ioctls,
4782 ;; as suggested in 'CMakeList.txt'.
4783 "-DIOCTL_MODE=write")
f8f44dd7
MB
4784 #:phases
4785 (modify-phases %standard-phases
4786 (replace 'build
4787 (lambda _
8c3101b8
MW
4788 (invoke "ninja"
4789 "-j" (number->string (parallel-job-count)))))
f8f44dd7
MB
4790 (replace 'install
4791 (lambda _
8c3101b8 4792 (invoke "ninja" "install"))))))
f8f44dd7
MB
4793 (native-inputs
4794 `(("ninja" ,ninja)
4795 ("pkg-config" ,pkg-config)
e68f954e
LC
4796 ("python" ,python-wrapper)
4797 ("python-docutils" ,python-docutils))) ;for 'rst2man'
f8f44dd7
MB
4798 (inputs
4799 `(("libnl" ,libnl)
4800 ("udev" ,eudev)))
4801 (home-page "https://github.com/linux-rdma/rdma-core")
4802 (synopsis "Utilities and libraries for working with RDMA devices")
4803 (description
4804 "This package provides userspace components for the InfiniBand
4805subsystem of the Linux kernel. Specifically it contains userspace
4806libraries for the following device nodes:
4807
4808@enumerate
4809@item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
4810@item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
4811@item @file{/dev/infiniband/umadX} (@code{libibumad})
4812@end enumerate
4813
4814The following service daemons are also provided:
4815@enumerate
4816@item @code{srp_daemon} (for the @code{ib_srp} kernel module)
4817@item @code{iwpmd} (for iWARP kernel providers)
4818@item @code{ibacm} (for InfiniBand communication management assistant)
4819@end enumerate")
4820 ;; All library code is dual licensed under GPL2 and a custom MIT
4821 ;; variant. The package also includes some components covered by
4822 ;; other licenses. Consult COPYING.md for full details.
4823 (license
4824 (list license:gpl2
4825 (license:x11-style "See COPYING.BSD_MIT in the distribution")
4826 license:bsd-2 ; Files referring to COPYING.BSD_FB
4827 license:cc0 ; most files in ccan/
4828 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
4829
a0a273c1
MG
4830(define-public perftest
4831 (package
4832 (name "perftest")
50298d4a 4833 (version "4.4-0.4")
a0a273c1
MG
4834 (source
4835 (origin
4836 (method url-fetch)
50298d4a
TGR
4837 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
4838 version "/perftest-" version ".g0927198.tar.gz"))
a0a273c1 4839 (sha256
50298d4a 4840 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
a0a273c1
MG
4841 (build-system gnu-build-system)
4842 (arguments
4843 `(#:phases
4844 (modify-phases %standard-phases
4845 (add-after 'unpack 'patch-header-paths
4846 (lambda _
4847 (substitute* '("src/raw_ethernet_fs_rate.c"
4848 "src/raw_ethernet_resources.c"
4849 "src/raw_ethernet_resources.h"
4850 "src/raw_ethernet_send_burst_lat.c"
4851 "src/raw_ethernet_send_bw.c"
4852 "src/raw_ethernet_send_lat.c")
4853 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
4854 #t)))))
4855 (inputs `(("rdma-core" ,rdma-core)))
4856 (home-page "https://github.com/linux-rdma/perftest/")
4857 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
4858 (description "This is a collection of tests written over uverbs intended for
4859use as a performance micro-benchmark. The tests may be used for hardware or
4860software tuning as well as for functional testing.
4861
4862The collection contains a set of bandwidth and latency benchmark such as:
4863@enumerate
4864@item Send - @code{ib_send_bw} and @code{ib_send_lat}
4865@item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
4866@item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
4867@item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
4868@item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
4869@end enumerate")
4870 (license license:gpl2)))
4871
9b0942c1
DC
4872(define-public rng-tools
4873 (package
4874 (name "rng-tools")
c6b772a0 4875 (home-page "https://github.com/nhorman/rng-tools")
e0dde179 4876 (version "6.9")
9b0942c1 4877 (source (origin
f289820c
MB
4878 (method git-fetch)
4879 (uri (git-reference (url home-page)
4880 (commit (string-append "v" version))))
4881 (file-name (git-file-name name version))
9b0942c1
DC
4882 (sha256
4883 (base32
e0dde179 4884 "065jf26s8zkicb95zc9ilksjdq9gqrh5vcx3mhi6mypbnamn6w98"))))
9b0942c1 4885 (build-system gnu-build-system)
8bc6956b
LF
4886 (arguments
4887 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
ae67d70d
TGR
4888 #:configure-flags '("--without-nistbeacon"
4889 "--without-pkcs11")))
8bc6956b
LF
4890 (native-inputs
4891 `(("autoconf" ,autoconf)
4892 ("automake" ,automake)
4893 ("pkg-config" ,pkg-config)))
4894 (inputs
4895 `(("libsysfs" ,sysfsutils)))
9b0942c1
DC
4896 (synopsis "Random number generator daemon")
4897 (description
4898 "Monitor a hardware random number generator, and supply entropy
4899from that to the system kernel's @file{/dev/random} machinery.")
9b0942c1
DC
4900 ;; The source package is offered under the GPL2+, but the files
4901 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
4902 (license (list license:gpl2 license:gpl2+))))
58d6a1f2
TGR
4903
4904(define-public cpupower
4905 (package
4906 (name "cpupower")
4907 (version (package-version linux-libre))
4908 (source (package-source linux-libre))
4909 (build-system gnu-build-system)
4910 (arguments
4911 '(#:phases (modify-phases %standard-phases
4912 (add-after 'unpack 'enter-subdirectory
4913 (lambda _
9922278b
MW
4914 (chdir "tools/power/cpupower")
4915 #t))
58d6a1f2
TGR
4916 (delete 'configure)
4917 (add-before 'build 'fix-makefiles
4918 (lambda _
4919 (substitute* "Makefile"
4920 (("/usr/") "/")
4921 (("/bin/(install|pwd)" _ command) command))
4922 (substitute* "bench/Makefile"
9922278b
MW
4923 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
4924 #t)))
58d6a1f2
TGR
4925 #:make-flags (let ((out (assoc-ref %outputs "out")))
4926 (list (string-append "DESTDIR=" out)
4927 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
cd7e6885 4928 "libdir=/lib"
58d6a1f2
TGR
4929 "docdir=/share/doc/cpupower"
4930 "confdir=$(docdir)/examples"
4931 ;; The Makefile recommends the following changes
4932 "DEBUG=false"
4933 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
4934 #:tests? #f)) ;no tests
b94a6ca0 4935 (native-inputs `(("gettext" ,gettext-minimal)))
58d6a1f2
TGR
4936 (inputs `(("pciutils" ,pciutils)))
4937 (home-page (package-home-page linux-libre))
4938 (synopsis "CPU frequency and voltage scaling tools for Linux")
4939 (description
4940 "cpupower is a set of user-space tools that use the cpufreq feature of the
4941Linux kernel to retrieve and control processor features related to power saving,
4942such as frequency and voltage scaling.")
4943 (license license:gpl2)))
2b76f135 4944
71bd55cb
SS
4945(define-public x86-energy-perf-policy
4946 (package
4947 (name "x86-energy-perf-policy")
4948 (version (package-version linux-libre))
4949 (source (package-source linux-libre))
4950 (build-system gnu-build-system)
4951 (arguments
4952 '(#:tests? #f
4953 #:phases
4954 (modify-phases %standard-phases
4955 (add-after 'unpack 'enter-subdirectory
4956 (lambda _
4957 (chdir "tools/power/x86/x86_energy_perf_policy")
4958 #t))
4959 (delete 'configure)
4960 (add-before 'build 'fix-makefile
4961 (lambda _
4962 (substitute* "Makefile" (("/usr") ""))
4963 #t)))
4964 #:make-flags
4965 (let ((out (assoc-ref %outputs "out")))
4966 (list (string-append "DESTDIR=" out)
4967 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
4968 (supported-systems '("i686-linux" "x86_64-linux"))
4969 (home-page (package-home-page linux-libre))
4970 (synopsis "Display and update Intel-CPU energy-performance policy")
4971 (description
4972 "@command{x86_energy_perf_policy} displays and updates energy-performance
4973policy settings specific to Intel Architecture Processors. Settings are
4974accessed via Model Specific Register (MSR) updates, no matter if the Linux
4975cpufreq sub-system is enabled or not.")
4976 (license license:gpl2)))
4977
2b76f135
TGR
4978(define-public haveged
4979 (package
4980 (name "haveged")
5bcf4d4c 4981 (version "1.9.8")
2b76f135
TGR
4982 (source
4983 (origin
893c340c
TGR
4984 (method git-fetch)
4985 (uri (git-reference
4986 (url "https://github.com/jirka-h/haveged.git")
389cae8b 4987 (commit (string-append "v" version))))
893c340c 4988 (file-name (git-file-name name version))
2b76f135 4989 (sha256
5bcf4d4c 4990 (base32 "1znr58fb3faq4nmrvc3c5whkc1f3chivm4vhicdwr9pdsyqqsd51"))))
2b76f135 4991 (build-system gnu-build-system)
6664ec0c 4992 (home-page "https://www.issihosts.com/haveged")
2b76f135
TGR
4993 (synopsis "Entropy source for the Linux random number generator")
4994 (description
4995 "haveged generates an unpredictable stream of random numbers for use by
4996Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
4997standard mechanisms for filling the entropy pool may not be sufficient for
4998systems with high needs or limited user interaction, such as headless servers.
b71a3488 4999
2b76f135 5000@command{haveged} runs as a privileged daemon, harvesting randomness from the
8e42b087
TGR
5001indirect effects of hardware events on hidden processor state using the
5002@acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
5003It tunes itself to its environment and provides the same built-in test suite
5004for the output stream as used on certified hardware security devices.
4a147986
TGR
5005
5006The quality of the randomness produced by this algorithm has not been proven.
5007It is recommended to run it together with another entropy source like rngd, and
5008not as a replacement for it.")
2b76f135
TGR
5009 (license (list (license:non-copyleft "file://nist/mconf.h")
5010 (license:non-copyleft "file://nist/packtest.c")
5011 license:public-domain ; nist/dfft.c
5012 license:gpl3+)))) ; everything else
e385e957
TGR
5013
5014(define-public ecryptfs-utils
5015 (package
5016 (name "ecryptfs-utils")
5017 (version "111")
5018 (source
5019 (origin
5020 (method url-fetch)
5021 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
5022 version "/+download/ecryptfs-utils_"
5023 version ".orig.tar.gz"))
5024 (sha256
5025 (base32
5026 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
5027 (build-system gnu-build-system)
5028 (arguments
17a21bcf
BT
5029 `(#:configure-flags (list "--disable-pywrap")
5030 #:phases
5031 (modify-phases %standard-phases
5032 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
5033 (lambda* (#:key inputs outputs #:allow-other-keys)
5034 (let ((out (assoc-ref outputs "out"))
5035 (utils-linux (assoc-ref inputs "utils-linux"))
5036 (cryptsetup (assoc-ref inputs "cryptsetup"))
5037 (linux-pam (assoc-ref inputs "linux-pam"))
5038 (lvm2 (assoc-ref inputs "lvm2")))
5039 (substitute* '("src/utils/ecryptfs-mount-private"
5040 "src/utils/ecryptfs-umount-private"
5041 "src/utils/ecryptfs-setup-private"
e8ec2dda 5042 "src/utils/ecryptfs-setup-swap"
17a21bcf 5043 "src/utils/mount.ecryptfs.c"
e8ec2dda 5044 "src/utils/umount.ecryptfs.c"
17a21bcf
BT
5045 "src/pam_ecryptfs/pam_ecryptfs.c"
5046 "src/desktop/ecryptfs-mount-private.desktop.in"
e8ec2dda 5047 "src/desktop/ecryptfs-setup-private.desktop.in")
17a21bcf
BT
5048 (("/bin/mount")
5049 (string-append utils-linux "/bin/mount"))
5050 (("/bin/umount")
5051 (string-append utils-linux "/bin/umount"))
5052 (("/sbin/mount.ecryptfs_private")
5053 (string-append out "/sbin/mount.ecryptfs_private"))
5054 (("/sbin/umount.ecryptfs_private")
5055 (string-append out "/sbin/umount.ecryptfs_private"))
5056 (("/usr/bin/ecryptfs-mount-private")
5057 (string-append out "/bin/ecryptfs-mount-private"))
5058 (("/usr/bin/ecryptfs-rewrite-file")
5059 (string-append out "/bin/ecryptfs-rewrite-file"))
5060 (("/usr/bin/ecryptfs-setup-private")
5061 (string-append out "/bin/ecryptfs-setup-private"))
5062 (("/sbin/cryptsetup")
5063 (string-append cryptsetup "/sbin/cryptsetup"))
5064 (("/sbin/unix_chkpwd")
5065 (string-append linux-pam "/sbin/unix_chkpwd"))
5066 (("/sbin/dmsetup")
5067 (string-append lvm2 "/sbin/dmsetup")))))))))
e385e957
TGR
5068 (native-inputs
5069 `(("intltool" ,intltool)
5070 ("perl" ,perl) ; for pod2man
5071 ("pkg-config" ,pkg-config)))
5072 (inputs
5073 `(("keyutils" ,keyutils)
5074 ("linux-pam" ,linux-pam)
17a21bcf
BT
5075 ("utils-linux" ,util-linux)
5076 ("cryptsetup" ,cryptsetup)
5077 ("lvm2" ,lvm2)
e385e957 5078 ("nss" ,nss)))
c04cbcf7 5079 (home-page "https://ecryptfs.org/")
e385e957
TGR
5080 (synopsis "eCryptfs cryptographic file system utilities")
5081 (description
5082 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
5083Each file's cryptographic meta-data is stored inside the file itself, along
5084with the encrypted contents. This allows individual encrypted files to be
5085copied between hosts and still be decrypted with the proper key. eCryptfs is a
5086native Linux file system, and has been part of the Linux kernel since version
50872.6.19. This package contains the userland utilities to manage it.")
5088 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
5089 ;; grant additional permission to link with OpenSSL.
5090 (license license:gpl2+)))
cff0adec
DC
5091
5092(define-public libnfsidmap
5093 (package
5094 (name "libnfsidmap")
4505369c
TGR
5095 (version "0.27")
5096 (source
5097 (origin
5098 (method url-fetch)
5099 (uri (string-append "https://fedorapeople.org/~steved/"
5100 name "/" version "/" name "-" version ".tar.bz2"))
5101 (sha256
5102 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
cff0adec
DC
5103 (build-system gnu-build-system)
5104 (arguments
5105 `(#:configure-flags (list
5106 (string-append "--with-pluginpath="
5107 (assoc-ref %outputs "out")
5108 "/lib/libnfsidmap"))))
4505369c
TGR
5109 (native-inputs
5110 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
cff0adec
DC
5111 (home-page
5112 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
4505369c 5113 (synopsis "NFSv4 support library for name/ID mapping")
cff0adec
DC
5114 (description "Libnfsidmap is a library holding mulitiple methods of
5115mapping names to ids and visa versa, mainly for NFSv4. It provides an
5116extensible array of mapping functions, currently consisting of two choices:
5117the default @code{nsswitch} and the experimental @code{umich_ldap}.")
5118 (license (license:non-copyleft "file://COPYING"
5119 "See COPYING in the distribution."))))
035d3593
DC
5120
5121(define-public module-init-tools
5122 (package
5123 (name "module-init-tools")
5124 (version "3.16")
5125 (source (origin
5126 (method url-fetch)
5127 (uri (string-append
5128 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
5129 "module-init-tools-" version ".tar.bz2"))
5130 (sha256
5131 (base32
5132 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
5133 (patches (search-patches "module-init-tools-moduledir.patch"))))
5134 (build-system gnu-build-system)
5135 (arguments
5136 ;; FIXME: The upstream tarball lacks man pages, and building them would
5137 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
5138 ;; but they vanished. In the meantime, fake it.
dc1d3cde
KK
5139 '(#:phases
5140 (modify-phases %standard-phases
5141 (add-before 'configure 'fake-docbook
5142 (lambda _
5143 (substitute* "Makefile.in"
5144 (("^DOCBOOKTOMAN.*$")
5145 "DOCBOOKTOMAN = true\n"))
5146 #t)))))
81e59e41 5147 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
035d3593
DC
5148 (synopsis "Tools for loading and managing Linux kernel modules")
5149 (description
36a4366d
EF
5150 "Tools for loading and managing Linux kernel modules, such as
5151@code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
035d3593 5152 (license license:gpl2+)))
dd65f3b7
TGR
5153
5154(define-public mcelog
5155 (package
5156 (name "mcelog")
6cfbb7cb 5157 (version "168")
dd65f3b7
TGR
5158 (source (origin
5159 (method url-fetch)
5160 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
5161 "mcelog.git/snapshot/v" version ".tar.gz"))
5162 (sha256
5163 (base32
6cfbb7cb 5164 "1c4faayg1gcm3002b2fdrfnv76z92mvfzccvx8w9crjp0d17sp24"))
dd65f3b7
TGR
5165 (file-name (string-append name "-" version ".tar.gz"))
5166 (modules '((guix build utils)))
5167 (snippet
6cbee49d
MW
5168 `(begin
5169 ;; The snapshots lack a .git directory,
5170 ;; breaking ‘git describe’.
5171 (substitute* "Makefile"
5172 (("\"unknown\"") (string-append "\"v" ,version "\"")))
5173 #t))))
dd65f3b7
TGR
5174 (build-system gnu-build-system)
5175 (arguments
5176 `(#:phases (modify-phases %standard-phases
5177 (delete 'configure)) ; no configure script
5178 #:make-flags (let ((out (assoc-ref %outputs "out")))
5179 (list "CC=gcc"
5180 (string-append "prefix=" out)
5181 (string-append "DOCDIR=" out "/share/doc/mcelog")
5182 "etcprefix=$(DOCDIR)/examples"))
5183 ;; The tests will only run as root on certain supported CPU models.
5184 #:tests? #f))
5185 (supported-systems (list "i686-linux" "x86_64-linux"))
71d60b96 5186 (home-page "https://mcelog.org/")
dd65f3b7
TGR
5187 (synopsis "Machine check monitor for x86 Linux systems")
5188 (description
5189 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
5190and other hardware errors on x86 systems. It can also perform user-defined
5191tasks, such as bringing bad pages off-line, when configurable error thresholds
5192are exceeded.")
5193 (license license:gpl2)))
0c60cc53
DM
5194
5195(define-public mtd-utils
5196 (package
5197 (name "mtd-utils")
9ea820a5 5198 (version "2.1.1")
0c60cc53
DM
5199 (source (origin
5200 (method url-fetch)
5201 (uri (string-append
5202 "ftp://ftp.infradead.org/pub/mtd-utils/"
5203 "mtd-utils-" version ".tar.bz2"))
5204 (sha256
5205 (base32
9ea820a5 5206 "1lijl89l7hljx8xx70vrz9srd3h41v5gh4b0lvqnlv831yvyh5cd"))))
e8b9aaf0
EF
5207 (arguments
5208 '(#:configure-flags '("--enable-unit-tests")))
5209 (native-inputs
5210 `(("cmocka" ,cmocka)
5211 ("pkg-config" ,pkg-config)))
0c60cc53 5212 (inputs
f8f2b048 5213 `(("acl" ,acl) ; extended attributes (xattr)
0c60cc53 5214 ("libuuid" ,util-linux)
c695fb76 5215 ("lzo" ,lzo)
f8f2b048 5216 ("openssl" ,openssl) ; optional crypto support
9ea820a5
TGR
5217 ("zlib" ,zlib)
5218 ("zstd" ,zstd "lib")))
0c60cc53 5219 (build-system gnu-build-system)
0c60cc53
DM
5220 (synopsis "MTD Flash Storage Utilities")
5221 (description "This package provides utilities for testing, partitioning, etc
5222of flash storage.")
5223 (home-page "http://www.linux-mtd.infradead.org/")
5224 (license
5225 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
5226 license:mpl1.1 ; All ftl* files
5227 license:expat)))) ; libiniparser
def6213f
LF
5228
5229(define-public libseccomp
5230 (package
5231 (name "libseccomp")
c3bde0b7 5232 (version "2.4.3")
def6213f
LF
5233 (source (origin
5234 (method url-fetch)
5235 (uri (string-append "https://github.com/seccomp/libseccomp/"
5236 "releases/download/v" version
5237 "/libseccomp-" version ".tar.gz"))
5238 (sha256
5239 (base32
c3bde0b7 5240 "07crwxqzvl5k2b90a47ii9wgvi09s9hsy5b5jddw9ylp351d25fg"))))
def6213f
LF
5241 (build-system gnu-build-system)
5242 (native-inputs
5243 `(("which" ,which)))
5244 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
5245 (description "The libseccomp library provides an easy to use, platform
5246independent, interface to the Linux Kernel's syscall filtering mechanism. The
5247libseccomp API is designed to abstract away the underlying BPF based syscall
5248filter language and present a more conventional function-call based filtering
5249interface that should be familiar to, and easily adopted by, application
5250developers.")
5251 (home-page "https://github.com/seccomp/libseccomp")
5252 (license license:lgpl2.1)))
58c4f11e
TGR
5253
5254(define-public radeontop
5255 (package
5256 (name "radeontop")
88e1bce5 5257 (version "1.2")
ee861a54
TGR
5258 (source
5259 (origin
5260 (method git-fetch)
5261 (uri (git-reference
5262 (url "https://github.com/clbr/radeontop.git")
5263 (commit (string-append "v" version))))
5264 (file-name (git-file-name name version))
5265 (sha256
5266 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
58c4f11e
TGR
5267 (build-system gnu-build-system)
5268 (arguments
5269 `(#:phases (modify-phases %standard-phases
5270 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
5271 ;; dependency, and doesn't even work on release(!) tarballs.
5272 (add-after 'unpack 'report-correct-version
9922278b
MW
5273 (lambda _
5274 (substitute* "getver.sh"
5275 (("ver=unknown")
5276 (string-append "ver=" ,version)))
5277 #t))
58c4f11e
TGR
5278 (delete 'configure)) ; no configure script
5279 #:make-flags (list "CC=gcc"
5280 (string-append "PREFIX=" %output))
5281 #:tests? #f)) ; no tests
5282 (native-inputs
7c90d0f4 5283 `(("gettext" ,gettext-minimal)
58c4f11e
TGR
5284 ("pkg-config" ,pkg-config)))
5285 (inputs
5286 `(("libdrm" ,libdrm)
5287 ("libpciaccess" ,libpciaccess)
a7c61512 5288 ("libxcb" ,libxcb)
58c4f11e 5289 ("ncurses" ,ncurses)))
ee861a54 5290 (home-page "https://github.com/clbr/radeontop/")
58c4f11e
TGR
5291 (synopsis "Usage monitor for AMD Radeon graphics")
5292 (description "RadeonTop monitors resource consumption on supported AMD
5293Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
5294a terminal or saved to a file for further processing. It measures both the
5295activity of the GPU as a whole, which is also accurate during OpenCL
5296computations, as well as separate component statistics that are only meaningful
5297under OpenGL graphics workloads.")
5298 (license license:gpl3)))
0d74462a
MB
5299
5300(define-public efivar
5301 (package
5302 (name "efivar")
f19dfeeb 5303 (version "37")
0d74462a
MB
5304 (source (origin
5305 (method url-fetch)
c6dd2790 5306 (uri (string-append "https://github.com/rhboot/" name
0d74462a
MB
5307 "/releases/download/" version "/" name
5308 "-" version ".tar.bz2"))
5309 (sha256
5310 (base32
f19dfeeb 5311 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
0d74462a
MB
5312 (build-system gnu-build-system)
5313 (arguments
5314 `(;; Tests require a UEFI system and is not detected in the chroot.
5315 #:tests? #f
5316 #:make-flags (list (string-append "prefix=" %output)
5317 (string-append "libdir=" %output "/lib")
b2b2ba40 5318 "CC_FOR_BUILD=gcc"
0d74462a
MB
5319 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5320 #:phases
5321 (modify-phases %standard-phases
f90d6c3f
MB
5322 (delete 'configure)
5323 (add-before 'build 'kernel-headers-are-system-headers
5324 (lambda* (#:key inputs #:allow-other-keys)
5325 (let ((kernel-headers (assoc-ref inputs "kernel-headers")))
5326 ;; Make sure the kernel headers are treated as system headers
5327 ;; to suppress a conflict between "util.h" and <linux/fs.h>.
5328 (setenv "C_INCLUDE_PATH" (string-append kernel-headers "/include"))
5329 #t))))))
0d74462a
MB
5330 (native-inputs
5331 `(("pkg-config" ,pkg-config)))
5332 (inputs
5333 `(("popt" ,popt)))
c6dd2790 5334 (home-page "https://github.com/rhboot/efivar")
0d74462a
MB
5335 (synopsis "Tool and library to manipulate EFI variables")
5336 (description "This package provides a library and a command line
5337interface to the variable facility of UEFI boot firmware.")
5338 (license license:lgpl2.1+)))
1581406e
MB
5339
5340(define-public efibootmgr
5341 (package
5342 (name "efibootmgr")
732825f3 5343 (version "16")
1581406e
MB
5344 (source (origin
5345 (method url-fetch)
30559d8f
MB
5346 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
5347 "/releases/download/" version "/efibootmgr"
1581406e
MB
5348 "-" version ".tar.bz2"))
5349 (sha256
5350 (base32
732825f3 5351 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
1581406e
MB
5352 (build-system gnu-build-system)
5353 (arguments
82e7a51c 5354 `(#:tests? #f ;no tests
1581406e
MB
5355 #:make-flags (list (string-append "prefix=" %output)
5356 (string-append "libdir=" %output "/lib")
732825f3
MB
5357 ;; EFIDIR denotes a subdirectory relative to the
5358 ;; EFI System Partition where the loader will be
5359 ;; installed (known as OS_VENDOR in the code).
5360 ;; GRUB overrides this, as such it's only used if
5361 ;; nothing else is specified on the command line.
b9a30e0d
MB
5362 "EFIDIR=gnu"
5363 ;; Treat kernel headers as system headers to prevent
5364 ;; warnings about conflicting types.
5365 (string-append "C_INCLUDE_PATH="
5366 (assoc-ref %build-inputs "kernel-headers")
5367 "/include"))
732825f3 5368 #:phases (modify-phases %standard-phases (delete 'configure))))
1581406e
MB
5369 (native-inputs
5370 `(("pkg-config" ,pkg-config)))
5371 (inputs
5372 `(("efivar" ,efivar)
5373 ("popt" ,popt)))
5374 (home-page "https://github.com/rhinstaller/efibootmgr")
5375 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
5376 (description
5377 "@code{efibootmgr} is a user-space application to modify the Intel
5378Extensible Firmware Interface (EFI) Boot Manager. This application can
5379create and destroy boot entries, change the boot order, change the next
5380running boot option, and more.")
5381 (license license:gpl2+)))
6d3e08d4
LF
5382
5383(define-public sysstat
5384 (package
5385 (name "sysstat")
baa195dd 5386 (version "12.3.1")
6d3e08d4
LF
5387 (source (origin
5388 (method url-fetch)
36ac9520 5389 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
6d3e08d4
LF
5390 "sysstat-" version ".tar.xz"))
5391 (sha256
5392 (base32
baa195dd 5393 "1hf1sy7akribmgavadqccxpy49yv0zfb3m81d2bj6jf8pyzwcrbq"))))
6d3e08d4
LF
5394 (build-system gnu-build-system)
5395 (arguments
5396 `(#:tests? #f ; No test suite.
5397 ;; Without this flag, it tries to install the man pages with group 'root'
5398 ;; and fails because /etc/passwd lacks an entry for the root user.
5399 #:configure-flags
5400 (list "--disable-file-attr"
5401 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
5402 #:phases
5403 (modify-phases %standard-phases
5404 ;; The build process tries to create '/var/lib/sa', so we skip that
5405 ;; instruction.
5406 (add-after 'build 'skip-touching-var
5407 (lambda _
5408 (substitute* "Makefile"
5409 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
5410 ""))
5411 #t)))))
5412 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
5413 (synopsis "Performance monitoring tools for Linux")
5414 (description "The sysstat utilities are a collection of performance
5415monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
5416@code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
5417@code{sadf} and @code{sa}.")
5418 (license license:gpl2+)))
01be4f93
JMSG
5419
5420(define-public light
5421 (package
5422 (name "light")
e3fdc019 5423 (version "1.2.2")
664cb939
TGR
5424 (source
5425 (origin
5426 (method git-fetch)
5427 (uri (git-reference
5428 (url "https://github.com/haikarainen/light.git")
5429 (commit (string-append "v" version))))
5430 (sha256
e3fdc019 5431 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
664cb939 5432 (file-name (git-file-name name version))))
01be4f93 5433 (build-system gnu-build-system)
fcb510c5
AB
5434 (arguments
5435 `(#:phases
5436 (modify-phases %standard-phases
5437 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
5438 (lambda* (#:key inputs #:allow-other-keys)
5439 (substitute* "90-backlight.rules"
5440 (("/bin/chgrp") (which "chgrp"))
5441 (("/bin/chmod") (which "chmod")))
5442 #t))
5443 (add-after 'install 'install-udev-rules
5444 (lambda* (#:key outputs #:allow-other-keys)
5445 (let ((out (assoc-ref outputs "out")))
5446 (install-file
5447 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
5448 #t))))))
01be4f93 5449 (native-inputs
ff598353
PL
5450 `(("autoconf" ,autoconf)
5451 ("automake" ,automake)))
5452 (home-page "https://haikarainen.github.io/light/")
01be4f93
JMSG
5453 (synopsis "GNU/Linux application to control backlights")
5454 (description
5455 "Light is a program to send commands to screen backlight controllers
5456under GNU/Linux. Features include:
5457
5458@itemize
5459@item It does not rely on X.
5460@item Light can automatically figure out the best controller to use, making
5461full use of underlying hardware.
5462@item It is possible to set a minimum brightness value, as some controllers
5463set the screen to be pitch black at a vaĺue of 0 (or higher).
5464@end itemize
5465
5466Light is the successor of lightscript.")
5467 (license license:gpl3+)))
189d8422 5468
ab7f1eb9
VC
5469(define-public brightnessctl
5470 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
5471 (package
5472 (name "brightnessctl")
5473 (version (git-version "0.4" "0" commit))
5474 (source (origin
5475 (method git-fetch)
5476 (uri (git-reference
5477 (url "https://github.com/Hummer12007/brightnessctl/")
5478 (commit commit)))
5479 (file-name (git-file-name name version))
5480 (sha256
5481 (base32
5482 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
5483 (build-system gnu-build-system)
5484 (arguments
5485 '(#:tests? #f ; no tests
5486 #:make-flags (list "CC=gcc"
5487 (string-append "PREFIX=" %output)
5488 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
5489 #:phases
5490 (modify-phases %standard-phases
5491 (delete 'configure)
5492 (add-after 'unpack 'adjust-udev-rules
5493 (lambda _
5494 (substitute* "90-brightnessctl.rules"
5495 (("/bin/") "/run/current-system/profile/bin/"))
5496 #t)))))
5497 (home-page "https://github.com/Hummer12007/brightnessctl")
5498 (synopsis "Backlight and LED brightness control")
5499 (description
5500 "This program allows you read and control device brightness. Devices
5501include backlight and LEDs. It can also preserve current brightness before
5502applying the operation, such as on lid close.
5503
5504The appropriate permissions must be set on the backlight or LED control
5505interface in sysfs, which can be accomplished with the included udev rules.")
5506 (license license:expat))))
5507
c7adafa7
MO
5508(define-public tlp
5509 (package
5510 (name "tlp")
0d4e780e 5511 (version "1.3.1")
8a890f3c
NG
5512 (source
5513 (origin
0d4e780e
NG
5514 (method git-fetch)
5515 (uri (git-reference
5516 (url "https://github.com/linrunner/TLP.git")
5517 (commit version)))
5518 (file-name (git-file-name name version))
8a890f3c 5519 (sha256
0d4e780e 5520 (base32 "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5"))))
8a890f3c
NG
5521 (native-inputs
5522 `(("shellcheck" ,shellcheck)))
5523 (inputs
5524 `(("bash" ,bash)
5525 ("dbus" ,dbus)
5526 ("ethtool" ,ethtool)
5527 ("eudev" ,eudev)
5528 ("grep" ,grep)
5529 ("hdparm" ,hdparm)
5530 ("inetutils" ,inetutils)
5531 ("iw" ,iw)
5532 ("kmod" ,kmod)
5533 ("pciutils" ,pciutils)
5534 ("perl" ,perl)
5535 ("rfkill" ,rfkill)
5536 ("sed" ,sed)
5537 ("usbutils" ,usbutils)
5538 ("util-linux" ,util-linux)
5539 ("wireless-tools" ,wireless-tools)
5540 ,@(if (let ((system (or (%current-target-system)
5541 (%current-system))))
5542 (or (string-prefix? "i686-" system)
5543 (string-prefix? "x86_64-" system)))
5544 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
5545 '())))
c7adafa7
MO
5546 (build-system gnu-build-system)
5547 (arguments
8a890f3c
NG
5548 ;; XXX: The full test suite is run with "checkall" but it requires
5549 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
5550 `(#:test-target "shellcheck"
5551 #:modules ((guix build gnu-build-system)
cf342a85
SS
5552 (guix build utils)
5553 (srfi srfi-1))
5554 #:phases
c7adafa7 5555 (modify-phases %standard-phases
cef3f146 5556 (delete 'configure) ; no configure script
c7adafa7
MO
5557 (add-before 'build 'setenv
5558 (lambda* (#:key outputs #:allow-other-keys)
5559 (let ((out (assoc-ref outputs "out")))
5560 (setenv "TLP_WITH_SYSTEMD" "0")
5561 (setenv "TLP_NO_INIT" "1")
5562 (setenv "TLP_NO_PMUTILS" "1")
5563 (setenv "TLP_SBIN" (string-append out "/bin"))
5564 (setenv "TLP_BIN" (string-append out "/bin"))
c6e775a8
NG
5565 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
5566 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
c7adafa7 5567 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
8a890f3c
NG
5568 (setenv "TLP_CONFDEF"
5569 (string-append out "/share/tlp/defaults.conf"))
5570 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
5d51a977
NG
5571 (setenv "TLP_ELOD"
5572 (string-append out "/lib/elogind/system-sleep"))
c7adafa7
MO
5573 (setenv "TLP_SHCPL"
5574 (string-append out "/share/bash-completion/completions"))
6db6c3a9 5575 (setenv "TLP_MAN" (string-append out "/share/man"))
272fc9dc
TGR
5576 (setenv "TLP_META" (string-append out "/share/metainfo"))
5577 #t)))
cef3f146
TGR
5578 (add-before 'install 'fix-installation
5579 (lambda _
5580 ;; Stop the Makefile from trying to create system directories.
5d51a977 5581 (substitute* "Makefile"
8a890f3c 5582 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
5d51a977 5583 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
272fc9dc 5584 #t))
c7adafa7 5585 (replace 'install
8a890f3c 5586 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
c7adafa7
MO
5587 (add-after 'install 'wrap
5588 (lambda* (#:key inputs outputs #:allow-other-keys)
5589 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
5590 (bin-files (find-files bin ".*")))
5591 (define (bin-directory input-name)
cf342a85
SS
5592 (let ((p (assoc-ref inputs input-name)))
5593 (and p (string-append p "/bin"))))
c7adafa7
MO
5594 (define (sbin-directory input-name)
5595 (string-append (assoc-ref inputs input-name) "/sbin"))
5596 (for-each (lambda (program)
5597 (wrap-program program
5598 `("PATH" ":" prefix
5599 ,(append
cf342a85
SS
5600 (filter-map bin-directory
5601 '("bash"
5602 "coreutils"
5603 "dbus"
5604 "eudev"
5605 "grep"
5606 "inetutils"
5607 "kmod"
5608 "perl"
5609 "sed"
5610 "usbutils"
5611 "util-linux"
5612 "x86-energy-perf-policy"))
5613 (filter-map sbin-directory
5614 '("ethtool"
5615 "hdparm"
5616 "iw"
5617 "pciutils"
5618 "rfkill"
5619 "wireless-tools"))))))
272fc9dc
TGR
5620 bin-files)
5621 #t))))))
e4c60dcf 5622 (home-page "https://linrunner.de/en/tlp/tlp.html")
c7adafa7
MO
5623 (synopsis "Power management tool for Linux")
5624 (description "TLP is a power management tool for Linux. It comes with
5625a default configuration already optimized for battery life. Nevertheless,
5626TLP is customizable to fulfil system requirements. TLP settings are applied
5627every time the power supply source is changed.")
c7adafa7
MO
5628 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
5629 ;; rest is GPLv2+.
5630 (license (list license:gpl2+ license:gpl3+))))
5631
189d8422
BG
5632(define-public lshw
5633 (package
5634 (name "lshw")
5635 (version "B.02.18")
5636 (source (origin
5637 (method url-fetch)
5638 (uri (string-append "https://www.ezix.org/software/"
5639 "files/lshw-" version
5640 ".tar.gz"))
5641 (sha256
5642 (base32
5643 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
5644 (build-system gnu-build-system)
5645 (arguments
5646 `(#:phases (modify-phases %standard-phases (delete 'configure))
5647 #:tests? #f ; no tests
5648 #:make-flags
5649 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
5650 (synopsis "List hardware information")
5651 (description
5652 "@command{lshw} (Hardware Lister) is a small tool to provide
5653detailed information on the hardware configuration of the machine.
5654It can report exact memory configuration, firmware version, mainboard
5655configuration, CPU version and speed, cache configuration, bus speed,
5656and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
5657machines (PowerMac G4 is known to work).")
5658 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
5659 (license license:gpl2+)))
2f4a58b5
LF
5660
5661(define-public libmnl
5662 (package
5663 (name "libmnl")
5664 (version "1.0.4")
5665 (source
5666 (origin
5667 (method url-fetch)
f11ae44f 5668 (uri (string-append "mirror://netfilter.org/libmnl/"
2f4a58b5
LF
5669 "libmnl-" version ".tar.bz2"))
5670 (sha256
5671 (base32
5672 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
5673 (build-system gnu-build-system)
5674 (home-page "https://www.netfilter.org/projects/libmnl/")
5675 (synopsis "Netlink utility library")
5676 (description "Libmnl is a minimalistic user-space library oriented to
5677Netlink developers. There are a lot of common tasks in parsing, validating,
5678constructing of both the Netlink header and TLVs that are repetitive and easy to
5679get wrong. This library aims to provide simple helpers that allows you to
5680re-use code and to avoid re-inventing the wheel.")
5681 (license license:lgpl2.1+)))
b754c612
LF
5682
5683(define-public libnftnl
5684 (package
5685 (name "libnftnl")
79a39253 5686 (version "1.1.5")
b754c612 5687 (source
e569c772
TGR
5688 (origin
5689 (method url-fetch)
5690 (uri (string-append "mirror://netfilter.org/libnftnl/"
5691 "libnftnl-" version ".tar.bz2"))
5692 (sha256
79a39253
TGR
5693 (base32 "1wqlxf76bkqf3qhka9sw32qhb2ni20q1k6rn3iril2kw482lvpk6"))
5694 (patches
5695 (search-patches "libnftnl-dont-check-NFTNL_FLOWTABLE_SIZE.patch"))))
b754c612
LF
5696 (build-system gnu-build-system)
5697 (native-inputs
5698 `(("pkg-config" ,pkg-config)))
5699 (inputs
5700 `(("libmnl" ,libmnl)))
5701 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
5702 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
5703 (description "Libnftnl is a userspace library providing a low-level netlink
5704programming interface to the in-kernel nf_tables subsystem. The library
5705libnftnl has been previously known as libnftables. This library is currently
5706used by nftables.")
5707 (license license:gpl2+)))
62b28c0e 5708
dfe93c9a
RH
5709(define-public nftables
5710 (package
5711 (name "nftables")
31e6ef05 5712 (version "0.9.3")
dfe93c9a
RH
5713 (source
5714 (origin
5715 (method url-fetch)
e221e9a7
TGR
5716 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
5717 version ".tar.bz2")
5718 (string-append "https://www.nftables.org/projects/nftables"
5719 "/files/nftables-" version ".tar.bz2")))
dfe93c9a 5720 (sha256
31e6ef05 5721 (base32 "0y6vbqp6x8w165q65h4n9sba1406gaz0d4744gqszbm7w9f92swm"))))
dfe93c9a 5722 (build-system gnu-build-system)
9cb4bda2
RH
5723 (arguments `(#:configure-flags
5724 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
5450e301 5725 (inputs `(("gmp" ,gmp)
c695fb76
TGR
5726 ("libmnl" ,libmnl)
5727 ("libnftnl" ,libnftnl)
5728 ("readline" ,readline)))
5450e301
VL
5729 (native-inputs `(("pkg-config" ,pkg-config)
5730 ("bison" ,bison)
5731 ("flex" ,flex)))
4a27b0f1 5732 (home-page "https://www.nftables.org")
dfe93c9a
RH
5733 (synopsis "Userspace utility for Linux packet filtering")
5734 (description "nftables is the project that aims to replace the existing
5735{ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
5736filtering framework, a new userspace utility and also a compatibility layer for
5737{ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
5738infrastructure such as the existing hooks, the connection tracking system, the
5739userspace queueing component and the logging subsystem.")
5740 (license license:gpl2)))
5741
62b28c0e
LC
5742(define-public proot
5743 (package
5744 (name "proot")
5745 (version "5.1.0")
674495b7
TGR
5746 (source
5747 (origin
5748 (method git-fetch)
5749 (uri (git-reference
5750 (url "https://github.com/proot-me/PRoot.git")
5751 (commit (string-append "v" version))))
5752 (file-name (git-file-name name version))
5753 (sha256
5754 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
5755 (patches (search-patches "proot-test-fhs.patch"))))
62b28c0e
LC
5756 (build-system gnu-build-system)
5757 (arguments
5758 '(#:make-flags '("-C" "src")
5759
5760 #:phases (modify-phases %standard-phases
5761 (delete 'configure)
5762 (add-before 'build 'set-shell-file-name
5763 (lambda* (#:key inputs #:allow-other-keys)
5764 (substitute* (find-files "src" "\\.[ch]$")
5765 (("\"/bin/sh\"")
5766 (string-append "\""
5767 (assoc-ref inputs "bash")
5768 "/bin/sh\"")))
5769 #t))
5770 (add-before 'check 'fix-fhs-assumptions-in-tests
5771 (lambda _
5772 (substitute* "tests/test-c6b77b77.mk"
5773 (("/bin/bash") (which "bash"))
5774 (("/usr/bin/test") (which "test")))
5775 (substitute* '("tests/test-16573e73.c")
5776 (("/bin/([a-z-]+)" _ program)
5777 (which program)))
5778
5779 (substitute* (find-files "tests" "\\.sh$")
5780 ;; Some of the tests try to "bind-mount" /bin/true.
5781 (("-b /bin/true:")
5782 (string-append "-b " (which "true") ":"))
5783 ;; Likewise for /bin.
5784 (("-b /bin:") "-b /gnu:")
5785 ;; Others try to run /bin/sh.
5786 (("/bin/sh") (which "sh"))
5787 ;; Others assume /etc/fstab exists.
5788 (("/etc/fstab") "/etc/passwd"))
5789
5790 (substitute* "tests/GNUmakefile"
5791 (("-b /bin:") "-b /gnu:"))
5792
5793 ;; XXX: This test fails in an obscure corner case, just
5794 ;; skip it.
5795 (delete-file "tests/test-kkkkkkkk.c")
5796
5797 #t))
5798 (replace 'check
5799 (lambda _
5800 (let ((n (parallel-job-count)))
5801 ;; For some reason we get lots of segfaults with
5802 ;; seccomp support (x86_64, Linux-libre 4.11.0).
5803 (setenv "PROOT_NO_SECCOMP" "1")
5804
5805 ;; Most of the tests expect "/bin" to be in $PATH so
5806 ;; they can run things that live in $ROOTFS/bin.
5807 (setenv "PATH"
5808 (string-append (getenv "PATH") ":/bin"))
5809
06153a30
MW
5810 (invoke "make" "check" "-C" "tests"
5811 ;;"V=1"
5812 "-j" (number->string n)))))
62b28c0e
LC
5813 (replace 'install
5814 (lambda* (#:key outputs #:allow-other-keys)
5815 ;; The 'install' rule does nearly nothing.
06153a30
MW
5816 (let* ((out (assoc-ref outputs "out"))
5817 (man1 (string-append out "/share/man/man1")))
5818 ;; TODO: 'make install-care' (does not even
5819 ;; build currently.)
5820 (invoke "make" "-C" "src" "install"
5821 (string-append "PREFIX=" out))
5822
5823 (mkdir-p man1)
5824 (copy-file "doc/proot/man.1"
5825 (string-append man1 "/proot.1"))
5826 #t))))))
62b28c0e
LC
5827 (native-inputs `(("which" ,which)
5828
5829 ;; For 'mcookie', used by some of the tests.
5830 ("util-linux" ,util-linux)))
5831 (inputs `(("talloc" ,talloc)))
674495b7 5832 (home-page "https://github.com/proot-me/PRoot")
62b28c0e
LC
5833 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
5834 (description
5835 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
5836and @code{binfmt_misc}. This means that users don't need any privileges or
5837setup to do things like using an arbitrary directory as the new root
162a1374 5838file system, making files accessible somewhere else in the file system
62b28c0e
LC
5839hierarchy, or executing programs built for another CPU architecture
5840transparently through QEMU user-mode. Also, developers can use PRoot as a
5841generic process instrumentation engine thanks to its extension mechanism.
5842Technically PRoot relies on @code{ptrace}, an unprivileged system-call
5843available in the kernel Linux.")
5844 (license license:gpl2+)))
b9048a14
LC
5845
5846(define-public proot-static
5847 (package
5848 (inherit proot)
5849 (name "proot-static")
5850 (synopsis
5851 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
5852 (inputs `(("talloc" ,talloc/static)))
5853 (arguments
5854 (substitute-keyword-arguments (package-arguments proot)
5855 ((#:make-flags flags)
5856 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
5857 ((#:phases phases)
5858 `(modify-phases ,phases
5859 (add-after 'strip 'remove-store-references
5860 (lambda* (#:key outputs #:allow-other-keys)
5861 (let* ((out (assoc-ref outputs "out")))
5862 (with-directory-excursion out
5863 (remove-store-references "bin/proot")
5864 #t))))))
5865 ((#:allowed-references _ '("out"))
5866 '("out"))))))
1113386b
CL
5867
5868(define-public cpuid
5869 (package
5870 (name "cpuid")
08fee94d 5871 (version "20200211")
1113386b
CL
5872 (source (origin
5873 (method url-fetch)
5874 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
5875 version ".src.tar.gz"))
5876 (sha256
5877 (base32
08fee94d 5878 "06sjbqqp80l7nhsp6khglkzdp9qy4vhbvjxbfilznhsmrqiwlw55"))))
1113386b
CL
5879 (build-system gnu-build-system)
5880 (arguments
5881 '(#:make-flags '("CC=gcc")
fb9232d7 5882 #:tests? #f ; no tests
1113386b 5883 #:phases (modify-phases %standard-phases
fb9232d7 5884 (delete 'configure) ; no configure script
1113386b
CL
5885 (add-before 'install 'fix-makefile
5886 (lambda* (#:key outputs #:allow-other-keys)
5887 (substitute* "Makefile"
5888 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
5889 ;; Make the compressed manpages writable so that the
5890 ;; reset-gzip-timestamps phase does not error out.
5891 (substitute* "Makefile"
5892 (("-m 444") "-m 644"))
5893 #t)))))
5894 (inputs `(("perl" ,perl)))
5895 (supported-systems '("i686-linux" "x86_64-linux"))
5896 (home-page "http://www.etallen.com/cpuid.html")
5897 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
5898 (description "cpuid dumps detailed information about the CPU(s) gathered
5899from the CPUID instruction, and also determines the exact model of CPU(s). It
5900supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
5901NexGen, Rise, and SiS CPUs.")
5902 (license license:gpl2+)))
afc9d8ec
LF
5903
5904(define-public jmtpfs
5905 (package
5906 (name "jmtpfs")
5907 (version "0.5")
5908 (source
5909 (origin
5910 (method url-fetch)
5911 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
5912 version ".tar.gz"))
5913 (file-name (string-append name "-" version ".tar.gz"))
5914 (sha256
5915 (base32
5916 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
5917 (build-system gnu-build-system)
5918 (inputs
5919 `(("file" ,file)
5920 ("fuse" ,fuse)
5921 ("libmtp" ,libmtp)))
5922 (native-inputs
5923 `(("pkg-config" ,pkg-config)))
5924 (home-page "https://github.com/JasonFerrara/jmtpfs")
162a1374
TGR
5925 (synopsis "Use a FUSE file system to access data over MTP")
5926 (description "jmtpfs uses FUSE (file system in userspace) to provide access
afc9d8ec 5927to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
162a1374 5928the MTP device as a file system.")
afc9d8ec 5929 (license license:gpl3)))
a73e7dd3
DL
5930
5931(define-public procenv
5932 (package
5933 (name "procenv")
252f44ff 5934 (version "0.51")
a73e7dd3
DL
5935 (source
5936 (origin
5937 (method url-fetch)
5938 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
5939 version ".tar.gz"))
5940 (file-name (string-append name "-" version ".tar.gz"))
5941 (sha256
252f44ff 5942 (base32 "1javw97yw0qvjmj14js8vw6nsfyf2xc0kfiyq5f2hsp0553w2cdq"))))
a73e7dd3
DL
5943 (build-system gnu-build-system)
5944 (arguments `(#:configure-flags '("--disable-silent-rules")))
479e74d6
VL
5945 (native-inputs `(("groff" ,groff) ; for tests
5946 ("pkg-config" ,pkg-config)))
5947 (inputs `(("check" ,check)
5948 ("expat" ,expat)
5949 ("libcap" ,libcap)
a73e7dd3
DL
5950 ("libselinux" ,libselinux)))
5951 (synopsis "Utility to show process environment")
5952 (description "Procenv is a command-line tool that displays as much detail about
5953itself and its environment as possible. It can be used as a test
5954tool, to understand the type of environment a process runs in, and for
5955comparing system environments.")
5956 (home-page "http://github.com/jamesodhunt/procenv/")
5957 (license license:gpl3+)))
ae5947b0
DL
5958
5959(define-public libfabric
5960 (package
5961 (name "libfabric")
5962 (version "1.4.1")
5963 (source
5964 (origin
5965 (method url-fetch)
5966 (uri
5967 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
5968 version "/libfabric-" version ".tar.bz2"))
5969 (sha256
5970 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
5971 (build-system gnu-build-system)
5972 (inputs `(("rdma-core" ,rdma-core)
91298042
EF
5973 ,@(match (%current-system)
5974 ((member (package-supported-systems psm))
5975 `(("psm" ,psm)))
5976 (_ `()))
ae5947b0
DL
5977 ("libnl" ,libnl)))
5978 (home-page "https://ofiwg.github.io/libfabric/")
5979 (synopsis "Open Fabric Interfaces")
5980 (description
5981 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
5982communication services to applications. OFI is best described as a collection
5983of libraries and applications used to export fabric services. The key
5984components of OFI are: application interfaces, provider libraries, kernel
5985services, daemons, and test applications.
5986
5987Libfabric is a core component of OFI. It is the library that defines and
5988exports the user-space API of OFI, and is typically the only software that
5989applications deal with directly. It works in conjunction with provider
5990libraries, which are often integrated directly into libfabric.")
5991 (license (list license:bsd-2 license:gpl2)))) ;dual
fd23d259
DL
5992
5993(define-public psm
5994 (package
5995 (name "psm")
5996 (version "3.3.20170428")
b50a9cc0 5997 (home-page "https://github.com/intel/psm")
fd23d259
DL
5998 (source
5999 (origin
6000 (method git-fetch)
b50a9cc0 6001 (uri (git-reference (url home-page)
fd23d259
DL
6002 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
6003 (file-name (string-append "psm-" version ".tar.gz"))
6004 (sha256
6005 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
6006 (patches (search-patches
6007 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
6008 "psm-ldflags.patch" ; build shared lib with LDFLAGS
d8f8adfe
LC
6009 "psm-repro.patch" ; reproducibility
6010 "psm-disable-memory-stats.patch"))))
fd23d259 6011 (build-system gnu-build-system)
348caf3d 6012 (outputs '("out" "debug"))
fd23d259
DL
6013 (inputs `(("libuuid" ,util-linux)))
6014 (arguments
6015 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
6016 ,(string-append "INSTALL_PREFIX=" %output)
6017 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6018 #:tests? #f
6019 #:phases (modify-phases %standard-phases
6020 (delete 'configure)
6021 (add-after 'unpack 'patch-/usr/include
6022 (lambda _
6023 (substitute* "Makefile"
6024 (("\\$\\{DESTDIR}/usr/include")
6025 (string-append %output "/include")))
6026 (substitute* "Makefile"
6027 (("/lib64") "/lib"))
41313ace
EB
6028 #t))
6029 (add-after 'unpack 'patch-sysmacros
6030 (lambda _
6031 (substitute* "ipath/ipath_proto.c"
6032 (("#include <sys/poll.h>" m)
6033 (string-append m "\n"
6034 "#include <sys/sysmacros.h>")))
fd23d259 6035 #t)))))
fd23d259
DL
6036 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
6037 (description
6038 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
6039communications interface for the True Scale family of products. PSM users are
6040enabled with mechanisms necessary to implement higher level communications
6041interfaces in parallel environments.")
b516b780
EF
6042 ;; Only Intel-compatable processors are supported.
6043 (supported-systems '("i686-linux" "x86_64-linux"))
fd23d259 6044 (license (list license:bsd-2 license:gpl2)))) ;dual
c1c82584
TGR
6045
6046(define-public snapscreenshot
6047 (package
6048 (name "snapscreenshot")
6049 (version "1.0.14.3")
6050 (source
6051 (origin
6052 (method url-fetch)
6053 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
6054 name "-" version ".tar.bz2"))
6055 (sha256
6056 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
6057 (build-system gnu-build-system)
6058 (arguments
6059 `(#:make-flags
6060 (let ((out (assoc-ref %outputs "out")))
6061 (list (string-append "BINDIR=" out "/bin")
6062 (string-append "MANDIR=" out "/share/man")))
6063 #:tests? #f ; no test suite
6064 #:phases
6065 (modify-phases %standard-phases
6066 (delete 'configure) ; ./configure is a snarky no-op
6067 (add-before 'install 'fix-ownership
6068 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
6069 (lambda _
6070 (substitute* "depfun.mak"
6071 ((" -o bin -g bin ") " "))
6072 #t))
6073 (add-before 'install 'create-output-directories
6074 (lambda* (#:key outputs #:allow-other-keys)
6075 (let ((out (assoc-ref outputs "out")))
6076 (mkdir-p (string-append out "/share/man/man1"))
6077 #t))))))
81e59e41 6078 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
c1c82584
TGR
6079 (synopsis "Take screenshots of one or more Linux text consoles")
6080 (description
6081 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
6082Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
6083relevant @file{/dev/vcs*} file(s).")
6084 (license license:gpl2)))
8d8d227b
TGR
6085
6086(define-public fbcat
6087 (package
6088 (name "fbcat")
7f86e5e7 6089 (version "0.5.1")
8d8d227b
TGR
6090 (source
6091 (origin
6092 (method url-fetch)
6093 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
6094 version "/" name "-" version ".tar.gz"))
6095 (sha256
7f86e5e7 6096 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
8d8d227b 6097 (build-system gnu-build-system)
8d8d227b
TGR
6098 (inputs
6099 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
6100 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
6101 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
6102 `(("pnmtopng" ,netpbm)))
6103 (outputs (list "out" "fbgrab"))
6104 (arguments
7f86e5e7
TGR
6105 `(#:make-flags
6106 (list "CC=gcc"
6107 (string-append "PREFIX=" (assoc-ref %outputs "out")))
8d8d227b
TGR
6108 #:tests? #f ; no tests
6109 #:phases
6110 (modify-phases %standard-phases
8d8d227b 6111 (delete 'configure) ; no configure script
8d8d227b
TGR
6112 (add-after 'build 'qualify-references
6113 (lambda* (#:key inputs outputs #:allow-other-keys)
6114 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
6115 (out (assoc-ref outputs "out")))
6116 (substitute* "fbgrab"
6117 (("fbcat" all)
6118 (string-append out "/bin/" all))
6119 (("pnmtopng" all)
6120 (string-append pnmtopng "/bin/" all)))
6121 #t)))
7f86e5e7 6122 (add-after 'install 'split-fbgrab-output
8d8d227b
TGR
6123 (lambda* (#:key outputs #:allow-other-keys)
6124 (let* ((out (assoc-ref outputs "out"))
6125 (out:fbgrab (assoc-ref outputs "fbgrab")))
7f86e5e7
TGR
6126 (for-each (lambda (file)
6127 (let ((old (string-append out "/" file))
6128 (new (string-append out:fbgrab "/" file)))
6129 (mkdir-p (dirname new))
6130 (rename-file old new)))
6131 (list "bin/fbgrab"
6132 "share/man/man1/fbgrab.1"))
8d8d227b
TGR
6133 #t))))))
6134 (home-page "https://jwilk.net/software/fbcat")
6135 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
6136 (description
6137 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
6138a dump therof. It supports a wide range of drivers and pixel formats.
6139@command{fbcat} can take screenshots of virtually any application that can be
6140made to write its output to the framebuffer, including (but not limited to)
6141text-mode or graphical applications that don't use a display server.
6142
6143Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
6144emulates the behaviour of Gunnar Monell's older fbgrab utility.")
6145 (license license:gpl2)))
a69e0cf3
6146
6147(define-public libcgroup
6148 (package
6149 (name "libcgroup")
6150 (version "0.41")
6151 (source
6152 (origin
6153 (method url-fetch)
6154 (uri (string-append
6155 "mirror://sourceforge/libcg/" name "/"
6156 version "/" name "-" version ".tar.bz2"))
6157 (sha256
6158 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
6159 (build-system gnu-build-system)
6160 (arguments
6161 `(#:tests? #f))
6162 (native-inputs
6163 `(("bison" ,bison)
6164 ("flex" ,flex)))
6165 (inputs
6166 `(("linux-pam" ,linux-pam)))
6167 (home-page "https://sourceforge.net/projects/libcg/")
6168 (synopsis "Control groups management tools")
6169 (description "Control groups is Linux kernel method for process resource
6170restriction, permission handling and more. This package provides userspace
6171interface to this kernel feature.")
6172 (license license:lgpl2.1)))
5849c68a
R
6173
6174(define-public mbpfan
6175 (package
6176 (name "mbpfan")
26fad5b7 6177 (version "2.1.1")
5849c68a
R
6178 (source
6179 (origin
5478ab1e
TGR
6180 (method git-fetch)
6181 (uri (git-reference
6182 (url "https://github.com/dgraziotin/mbpfan.git")
6183 (commit (string-append "v" version))))
6184 (file-name (git-file-name name version))
5849c68a 6185 (sha256
26fad5b7 6186 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
5849c68a
R
6187 (build-system gnu-build-system)
6188 (arguments
697c5846 6189 '(#:tests? #f ; tests ask to be run as root
5849c68a
R
6190 #:make-flags (let ((out (assoc-ref %outputs "out")))
6191 (list (string-append "DESTDIR=" out)
6192 "CC=gcc"))
6193 #:phases
6194 (modify-phases %standard-phases
6195 (add-after 'unpack 'patch-paths
6196 (lambda _
6197 (substitute* "Makefile"
6198 (("/usr") ""))
6199 #t))
697c5846 6200 (delete 'configure)))) ; there's no configure phase
5849c68a
R
6201 (home-page "https://github.com/dgraziotin/mbpfan")
6202 (synopsis "Control fan speed on Macbooks")
6203 (description
6204 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
6205the @code{coretemp} module and sets the fan speed using the @code{applesmc}
6206module. It can be executed as a daemon or in the foreground with root
6207privileges.")
6208 (license license:gpl3+)))
25637b77
PAR
6209
6210(define-public psm2
6211 (package
6212 (name "psm2")
17a5cb45 6213 (version "11.2.86")
25637b77
PAR
6214 (source (origin
6215 (method git-fetch)
6216 (uri (git-reference
6217 (url "https://github.com/intel/opa-psm2.git")
6218 (commit (string-append "PSM2_" version))))
6219 (file-name (git-file-name name version))
6220 (sha256
6221 (base32
17a5cb45 6222 "1hiqzcmc97lzhaqjva82vf8irgg038cciypsv2brw90ak09n6vwf"))))
25637b77
PAR
6223 (build-system gnu-build-system)
6224 (arguments
6225 '(#:make-flags
6226 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6227 #:tests? #f
6228 #:phases (modify-phases %standard-phases
6229 (delete 'configure)
6230 (add-after 'unpack 'patch-Makefiles
6231 (lambda _
6232 (substitute* "Makefile"
6233 (("/lib64") "/lib")
6234 (("/usr") ""))
6235 (substitute* "compat/Makefile"
6236 (("/lib64") "/lib")
6237 (("/usr") ""))
6238 #t))
6239 (replace 'install
6240 (lambda _
6241 (setenv "DESTDIR" %output)
6242 (invoke "make" "install")
6243 #t)))))
6244 (inputs
6245 `(("rdma-core" ,rdma-core)
6246 ("numactl" ,numactl)))
6247 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
6248 (description
6249 "This package is low-level user-level Intel's communications interface.
6250The PSM2 API is a high-performance vendor-specific protocol that provides a
6251low-level communications interface for the Intel Omni-Path family of
6252high-speed networking devices.")
6253 (home-page "https://github.com/intel/opa-psm2")
6254 ;; Only the x86_64 architecure is supported.
6255 (supported-systems '("x86_64-linux"))
6256 (license (list license:bsd-3 license:gpl2)))) ; dual
2690b6ce
PAR
6257
6258(define-public libpfm4
6259 (package
6260 (name "libpfm4")
6261 (version "4.9.0")
6262 (source (origin
6263 (method url-fetch)
6264 (uri (string-append "mirror://sourceforge/perfmon2/"
6265 name "/libpfm-" version ".tar.gz"))
6266 (sha256
6267 (base32
6268 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
6269 (build-system gnu-build-system)
6270 (arguments
6271 '(#:modules ((guix build utils)
6272 (guix build gnu-build-system))
6273 #:phases (modify-phases %standard-phases
6274 (delete 'configure)
6275 (delete 'check)
6276 (replace 'build
6277 (lambda* (#:key inputs outputs #:allow-other-keys)
6278 (let* ((out (assoc-ref outputs "out")))
6279 (setenv "CC" "gcc")
6280 (invoke "make")
6281 #t)))
6282 (replace 'install
6283 (lambda* (#:key outputs #:allow-other-keys)
6284 (let* ((out (assoc-ref outputs "out")))
6285 (invoke "make"
6286 (string-append "PREFIX=" out)
6287 "install")
6288 #t))))))
6289 (synopsis "Performance event monitoring library")
6290 (description
6291 "This package provides a library called libpfm4, which is used to develop
6292monitoring tools exploiting the performance monitoring events such as those
6293provided by the Performance Monitoring Unit (PMU) of modern processors.
6294
6295Libpfm4 helps convert from an event name, expressed as a string, to the event
6296encoding that is either the raw event as documented by the hardware vendor or
6297the OS-specific encoding. In the latter case, the library is able to prepare
6298the OS-specific data structures needed by the kernel to setup the event.
6299
6300libpfm4 provides support for the @code{perf_events} interface, which was
6301introduced in Linux 2.6.31.")
6302 (home-page "http://perfmon2.sourceforge.net/")
6303 (license license:expat)))
4dd1fb79
SB
6304
6305(define-public libnfnetlink
6306 (package
6307 (name "libnfnetlink")
6308 (version "1.0.1")
6309 (source (origin
6310 (method url-fetch)
6311 (uri (string-append
6312 "https://www.netfilter.org/projects/libnfnetlink/files/"
6313 "libnfnetlink-" version ".tar.bz2"))
6314 (sha256
6315 (base32
6316 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
6317 (build-system gnu-build-system)
6318 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
6319 (synopsis "Low-level netfilter netlink communication library")
6320 (description
6321 "@code{libnfnetlink} is the low-level library for netfilter related
6322kernel/userspace communication. It provides a generic messaging
6323infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
6324nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
6325management tools in userspace.")
6326 (license license:gpl2)))
e4231cfe 6327
626de0d1
MC
6328(define-public go-netlink
6329 (package
6330 (name "go-netlink")
6331 (version "1.0.0")
6332 (source (origin
6333 (method git-fetch)
6334 (uri (git-reference
6335 (url "https://github.com/vishvananda/netlink.git")
6336 (commit (string-append "v" version))))
6337 (file-name (git-file-name name version))
6338 (sha256
6339 (base32
6340 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
6341 (build-system go-build-system)
6342 (arguments
6343 `(#:import-path "github.com/vishvananda/netlink"))
6344 (native-inputs
561d391b 6345 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
626de0d1
MC
6346 ("go-netns" ,go-netns)))
6347 (home-page "https://github.com/vishvananda/netlink")
6348 (synopsis "Simple netlink library for Go")
6349 (description "The netlink package provides a simple netlink library for
6350Go. Netlink is the interface a user-space program in Linux uses to
6351communicate with the kernel. It can be used to add and remove interfaces, set
6352IP addresses and routes, and configure IPsec.")
6353 (license license:asl2.0)))
6354
e4231cfe
DM
6355(define-public xfsprogs
6356 (package
6357 (name "xfsprogs")
faa78e88 6358 (version "5.2.1")
e4231cfe
DM
6359 (source (origin
6360 (method url-fetch)
6361 (uri (string-append
6362 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
6363 "xfsprogs-" version ".tar.gz"))
6364 (sha256
6365 (base32
faa78e88 6366 "0q5xd4gb9g83h82mg68cx616ifzl8qkzzlgg5xna698117ph3wky"))))
e4231cfe 6367 (build-system gnu-build-system)
c78778e7 6368 (outputs (list "out" "python"))
e4231cfe 6369 (arguments
c78778e7
TGR
6370 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
6371 #:phases
6372 (modify-phases %standard-phases
6373 (add-after 'install 'separate-python-output
6374 (lambda* (#:key outputs #:allow-other-keys)
6375 (let ((out (assoc-ref outputs "out"))
6376 (python (assoc-ref outputs "python")))
6377 (for-each
6378 (lambda (script)
6379 (mkdir-p (string-append python (dirname script)))
6380 (rename-file (string-append out script)
6381 (string-append python script)))
6382 (list "/sbin/xfs_scrub_all"))
6383 #t)))
6384 (add-after 'install 'install-headers
6385 (lambda _
6386 (invoke "make" "install-dev"))))))
e4231cfe 6387 (native-inputs
c148d2eb 6388 `(("gettext" ,gettext-minimal)))
c78778e7 6389 (inputs
c148d2eb
MB
6390 `(("libuuid" ,util-linux)
6391 ("python" ,python-wrapper)))
e4231cfe
DM
6392 (home-page "https://xfs.wiki.kernel.org/")
6393 (synopsis "XFS file system tools")
6394 (description "This package provides commands to create and check XFS
6395file systems.")
6396 ;; The library "libhandle" and the headers in "xfslibs-dev" are
6397 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
6398 (license (list license:gpl2 license:lgpl2.1))))
c63d7b79
DM
6399
6400(define-public genext2fs
6401 (package
6402 (name "genext2fs")
083639a5 6403 (version "1.4.1-4")
c63d7b79
DM
6404 (source (origin
6405 (method git-fetch)
6406 (uri (git-reference
6407 (url "https://github.com/jeremie-koenig/genext2fs.git")
083639a5
TGR
6408 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
6409 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
c63d7b79
DM
6410 (file-name (git-file-name name version))
6411 (sha256
083639a5 6412 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
c63d7b79 6413 (build-system gnu-build-system)
083639a5
TGR
6414 (arguments
6415 `(#:phases
6416 (modify-phases %standard-phases
6417 (add-after 'unpack 'apply-debian-patches
6418 ;; Debian changes (the revision after ‘-’ in VERSION) are
6419 ;; maintained as separate patches. Apply those relevant to us.
6420 (lambda _
6421 (for-each
6422 (lambda (file-name)
6423 (invoke "patch" "-p1" "-i"
6424 (string-append "debian/patches/" file-name)))
6425 (list "blocksize+creator.diff" ; add -B/-o options
6426 "byteswap_fix.diff"))
6427 #t)))))
6428 (native-inputs
6429 `(("autoconf" ,autoconf)
6430 ("automake" ,automake)))
c63d7b79 6431 (home-page "https://github.com/jeremie-koenig/genext2fs")
52beae7b
TGR
6432 (synopsis "Generate ext2 file system as a normal user")
6433 (description "This package provides a program to generate an ext2
6434file system as a normal (non-root) user. It does not require you to mount
c63d7b79
DM
6435the image file to copy files on it, nor does it require that you become
6436the superuser to make device nodes.")
6437 (license license:gpl2)))
d1dfcc7c
DM
6438
6439(define-public fakeroot
6440 (package
6441 (name "fakeroot")
ae1bab3e 6442 (version "1.24")
d1dfcc7c
DM
6443 (source (origin
6444 (method url-fetch)
ae1bab3e
TGR
6445 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
6446 "fakeroot/fakeroot_" version ".orig.tar.gz"))
d1dfcc7c
DM
6447 (file-name (string-append name "-" version ".tar.gz"))
6448 (sha256
6449 (base32
ae1bab3e 6450 "1vb6f93hjyqnwx8dc8mm3dgma7axgqk8s7sdsjs8l2rpc0qmn11f"))))
d1dfcc7c
DM
6451 (build-system gnu-build-system)
6452 (arguments
6453 `(#:phases
6454 (modify-phases %standard-phases
6455 (add-after 'configure 'patch-Makefile
6456 (lambda _
6457 ;; Note: The root of the problem is already in "Makefile.am".
6458 (substitute* "Makefile"
6459 (("/bin/sh") (which "sh")))
6460 #t))
6461 (add-after 'unpack 'patch-getopt
6462 (lambda* (#:key inputs #:allow-other-keys)
6463 (substitute* "scripts/fakeroot.in"
6464 (("getopt")
6465 (string-append (assoc-ref inputs "util-linux")
6466 "/bin/getopt")))
6467 #t))
0d5c5b1b
DM
6468 (add-before 'configure 'setenv
6469 (lambda _
6470 (setenv "LIBS" "-lacl")
6471 #t))
d1dfcc7c
DM
6472 (add-before 'check 'prepare-check
6473 (lambda _
6474 (setenv "SHELL" (which "bash"))
6475 (setenv "VERBOSE" "1")
6476 (substitute* "test/t.touchinstall"
6477 ;; We don't have the name of the root user, so use ID=0.
6478 (("grep root") "grep \"\\<0\\>\""))
6479 (substitute* "test/tartest"
6480 ;; We don't have the name of the root group, so use ID=0.
6481 (("ROOTGROUP=root") "ROOTGROUP=0")
6482 ;; We don't have the name of the daemon user, so use IDs.
6483 (("daemon:sys") "1:3")
6484 (("daemon:") "1:"))
6485 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
6486 (substitute* "test/compare-tar"
6487 (("tar -tvf") "tar --numeric-owner -tvf"))
6488 #t)))))
6489 (native-inputs
0d5c5b1b
DM
6490 `(("acl" ,acl)
6491 ("sharutils" ,sharutils) ; for the tests
d1dfcc7c
DM
6492 ("xz" ,xz))) ; for the tests
6493 (inputs
6494 `(("libcap" ,libcap)
6495 ("util-linux" ,util-linux)))
6496 (synopsis "Provides a fake root environment")
6497 (description "@command{fakeroot} runs a command in an environment where
6498it appears to have root privileges for file manipulation. This is useful
6499for allowing users to create archives (tar, ar, .deb etc.) with files in
6500them with root permissions/ownership. Without fakeroot one would have to
6501have root privileges to create the constituent files of the archives with
6502the correct permissions and ownership, and then pack them up, or one would
6503have to construct the archives directly, without using the archiver.")
6504 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
6505 (license license:gpl3+)))
bf2a9969
TG
6506
6507(define-public inputattach
6508 (package
6509 (name "inputattach")
6510 (version "0.42.0")
6511 (source (origin
6512 (method git-fetch)
6513 (uri (git-reference
6514 (url "https://github.com/linuxwacom/input-wacom.git")
6515 (commit (string-append "input-wacom-" version))))
6516 (file-name (git-file-name name version))
6517 (sha256
6518 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
6519 (build-system gnu-build-system)
6520 (arguments
6521 `(#:phases
6522 (modify-phases %standard-phases
6523 (delete 'bootstrap)
6524 (delete 'configure)
6525 (replace 'build
6526 (lambda* (#:key inputs #:allow-other-keys)
6527 (with-directory-excursion "inputattach"
6528 (invoke (string-append (assoc-ref inputs "gcc")
6529 "/bin/gcc")
5ddf98da 6530 "-O2" "-o" "inputattach" "inputattach.c"))
bf2a9969
TG
6531 #t))
6532 (delete 'check)
6533 (replace 'install
6534 (lambda* (#:key outputs #:allow-other-keys)
6535 (let ((target-dir (string-append
6536 (assoc-ref outputs "out")
6537 "/bin/")))
6538 (mkdir-p target-dir)
6539 (copy-file "inputattach/inputattach"
6540 (string-append target-dir
6541 "inputattach"))
6542 #t))))))
6543 (home-page "https://linuxwacom.github.io/")
6544 (synopsis "Dispatch input peripherals events to a device file")
6545 (description "inputattach dispatches input events from several device
6546types and interfaces and translates so that the X server can use them.")
6547 (license license:gpl2+)))
de3896fb 6548
8c6c97de
KK
6549(define-public pipewire
6550 (package
6551 (name "pipewire")
e7d710af 6552 (version "0.2.7")
8c6c97de
KK
6553 (source (origin
6554 (method git-fetch)
6555 (uri (git-reference
6556 (url "https://github.com/PipeWire/pipewire")
6557 (commit version)))
6558 (file-name (git-file-name name version))
6559 (sha256
6560 (base32
e7d710af 6561 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
8c6c97de
KK
6562 (build-system meson-build-system)
6563 (arguments
6564 '(#:configure-flags '("-Dsystemd=false")))
6565 (native-inputs
6566 `(("pkg-config" ,pkg-config)))
6567 (inputs
6568 `(("alsa-lib" ,alsa-lib)
6569 ("dbus" ,dbus)
6570 ("eudev" ,eudev)
6571 ("ffmpeg" ,ffmpeg)
6572 ("gstreamer" ,gstreamer)
6573 ("gst-plugins-base" ,gst-plugins-base)
6574 ("libva" ,libva)
6575 ("sbc" ,sbc)
6576 ("sdl2" ,sdl2)))
6577 (home-page "https://pipewire.org/")
6578 (synopsis "Server and user space API to deal with multimedia pipelines")
6579 (description
6580 "PipeWire is a project that aims to greatly improve handling of audio and
6581video under Linux. It aims to support the usecases currently handled by both
6582PulseAudio and Jack and at the same time provide same level of powerful handling
6583of Video input and output. It also introduces a security model that makes
6584interacting with audio and video devices from containerized applications easy,
6585with supporting Flatpak applications being the primary goal. Alongside Wayland
6586and Flatpak we expect PipeWire to provide a core building block for the future
6587of Linux application development.")
6588 (license license:lgpl2.0+)))
6589
de3896fb
BW
6590(define-public ell
6591 (package
6592 (name "ell")
6593 (version "0.23")
6594 (source (origin
6595 (method git-fetch)
6596 (uri (git-reference
6597 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
6598 (commit version)))
6599 (file-name (git-file-name name version))
6600 (sha256
6601 (base32
6602 "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10"))))
6603 (build-system gnu-build-system)
6604 (arguments
6605 `(#:phases
6606 (modify-phases %standard-phases
6607 (add-after 'unpack 'fix-dbus-tests
6608 (lambda _
6609 (substitute* '("unit/test-dbus-message-fds.c"
6610 "unit/test-dbus-properties.c"
6611 "unit/test-dbus.c")
6612 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
6613 #t)))))
6614 (inputs
6615 `(("dbus" ,dbus)
6616 ("libtool" ,libtool)))
6617 (native-inputs
6618 `(("autoconf" ,autoconf)
6619 ("pkgconfig" ,pkg-config)
6620 ("automake" ,automake)))
6621 (home-page "https://01.org/ell")
6622 (synopsis "Embedded Linux Library")
6623 (description "The Embedded Linux* Library (ELL) provides core, low-level
6624functionality for system daemons. It typically has no dependencies other than
6625the Linux kernel, C standard library, and libdl (for dynamic linking). While
6626ELL is designed to be efficient and compact enough for use on embedded Linux
6627platforms, it is not limited to resource-constrained systems.")
6628 (license license:lgpl2.1+)))
a69bc738
PN
6629
6630(define-public lttng-ust
6631 (package
6632 (name "lttng-ust")
6633 (version "2.11.0")
6634 (source (origin
6635 (method url-fetch)
6636 (uri (string-append "https://lttng.org/files/lttng-ust/"
6637 "lttng-ust-" version ".tar.bz2"))
6638 (sha256
6639 (base32
6640 "1n646yz7882svf5a4ay3vqiiz3qjn3pgkkij9kk22871wp7q0ck8"))))
6641 (build-system gnu-build-system)
6642 (inputs
6643 `(("liburcu" ,liburcu)
6644 ("numactl" ,numactl)))
6645 (native-inputs
6646 `(("python" ,python-3)))
6647 (home-page "https://lttng.org/")
6648 (synopsis "LTTng userspace tracer libraries")
6649 (description "The user space tracing library, liblttng-ust, is the LTTng
6650user space tracer. It receives commands from a session daemon, for example to
6651enable and disable specific instrumentation points, and writes event records
6652to ring buffers shared with a consumer daemon.")
6653 (license license:lgpl2.1+)))
dedbdacf
CM
6654
6655(define-public kexec-tools
6656 (package
6657 (name "kexec-tools")
6658 (version "2.0.20")
6659 (source (origin
6660 (method url-fetch)
6661 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
6662 "/kexec/kexec-tools-" version ".tar.xz"))
6663 (sha256
6664 (base32
6665 "1j7qlhxk1rbv9jbj8wd6hb7zl8p2mp29ymrmccgmsi0m0dzhgn6s"))))
6666 (build-system gnu-build-system)
6667 (arguments
6668 ;; There are no automated tests.
6669 '(#:tests? #f))
6670 (home-page "https://projects.horms.net/projects/kexec/")
6671 (synopsis "Tools for booting directly into different kernels")
6672 (description "This package provides the @code{kexec} program and ancillary
6673utilities. Using @code{kexec}, it is possible to boot directly into a new
6674kernel from the context of an already-running kernel, bypassing the normal
6675system boot process.")
6676 (license license:gpl2)))