gnu: strace: Update to 4.17.
[jackhill/guix/guix.git] / gnu / packages / linux.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
74d21291 2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 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>
75fd35b6 5;;; Copyright © 2014, 2015, 2016, 2017 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>
e77fe950 8;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
1348185a 9;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
cd7caa3e 10;;; Copyright © 2016, 2017 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>
d17ae8c0 14;;; Copyright © 2016 Nicolas Goaziou <mail@nicolasgoaziou.fr>
81b98756 15;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
9b0942c1 16;;; Copyright © 2016 David Craven <david@craven.ch>
594d740d 17;;; Copyright © 2016 John Darrington <jmd@gnu.org>
f8f44dd7 18;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
411264c2 19;;; Copyright © 2016 Rene Saavedra <rennes@openmailbox.org>
440a3143 20;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
7d2511bc 21;;; Copyright © 2016 ng0 <ng0@libertad.pw>
6d3e08d4 22;;; Copyright © 2017 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>
fd76c904 26;;;
233e7676 27;;; This file is part of GNU Guix.
fd76c904 28;;;
233e7676 29;;; GNU Guix is free software; you can redistribute it and/or modify it
fd76c904
LC
30;;; under the terms of the GNU General Public License as published by
31;;; the Free Software Foundation; either version 3 of the License, or (at
32;;; your option) any later version.
33;;;
233e7676 34;;; GNU Guix is distributed in the hope that it will be useful, but
fd76c904
LC
35;;; WITHOUT ANY WARRANTY; without even the implied warranty of
36;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37;;; GNU General Public License for more details.
38;;;
39;;; You should have received a copy of the GNU General Public License
233e7676 40;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
fd76c904 41
1ffa7090 42(define-module (gnu packages linux)
59a43334 43 #:use-module (gnu packages)
0c60cc53 44 #:use-module (gnu packages acl)
75750abb
DC
45 #:use-module (gnu packages admin)
46 #:use-module (gnu packages algebra)
47 #:use-module (gnu packages attr)
48 #:use-module (gnu packages autotools)
49 #:use-module (gnu packages base)
c7adafa7 50 #:use-module (gnu packages bash)
75750abb
DC
51 #:use-module (gnu packages bison)
52 #:use-module (gnu packages calendar)
53 #:use-module (gnu packages check)
e385e957 54 #:use-module (gnu packages crypto)
f61e0e79 55 #:use-module (gnu packages compression)
75750abb 56 #:use-module (gnu packages databases)
b3ed50e6 57 #:use-module (gnu packages datastructures)
75750abb
DC
58 #:use-module (gnu packages docbook)
59 #:use-module (gnu packages documentation)
60 #:use-module (gnu packages elf)
1ffa7090 61 #:use-module (gnu packages flex)
75750abb
DC
62 #:use-module (gnu packages freedesktop)
63 #:use-module (gnu packages gcc)
64 #:use-module (gnu packages gettext)
65 #:use-module (gnu packages glib)
e385e957 66 #:use-module (gnu packages gnuzilla)
d7d42d6b 67 #:use-module (gnu packages gperf)
75750abb 68 #:use-module (gnu packages gtk)
1ffa7090 69 #:use-module (gnu packages libusb)
01be4f93 70 #:use-module (gnu packages man)
75750abb 71 #:use-module (gnu packages maths)
1ffa7090 72 #:use-module (gnu packages ncurses)
c7adafa7 73 #:use-module (gnu packages networking)
f8f44dd7 74 #:use-module (gnu packages ninja)
1ffa7090 75 #:use-module (gnu packages perl)
75750abb 76 #:use-module (gnu packages pciutils)
1ffa7090 77 #:use-module (gnu packages pkg-config)
0d74462a 78 #:use-module (gnu packages popt)
75750abb 79 #:use-module (gnu packages pulseaudio)
7c0dbe78 80 #:use-module (gnu packages python)
75750abb
DC
81 #:use-module (gnu packages readline)
82 #:use-module (gnu packages rrdtool)
62b28c0e 83 #:use-module (gnu packages samba)
b1fb4b23 84 #:use-module (gnu packages slang)
b3ed50e6 85 #:use-module (gnu packages storage)
f57d2639 86 #:use-module (gnu packages texinfo)
75343704 87 #:use-module (gnu packages tls)
b3ed50e6 88 #:use-module (gnu packages valgrind)
7d2511bc 89 #:use-module (gnu packages video)
7f412f33 90 #:use-module (gnu packages web)
7d2511bc 91 #:use-module (gnu packages xiph)
75750abb 92 #:use-module (gnu packages xml)
58c4f11e
TGR
93 #:use-module (gnu packages xdisorg)
94 #:use-module (gnu packages xorg)
220193ad 95 #:use-module (guix build-system cmake)
75750abb 96 #:use-module (guix build-system gnu)
e102f940 97 #:use-module (guix build-system python)
a94546ec 98 #:use-module (guix build-system trivial)
75750abb
DC
99 #:use-module (guix download)
100 #:use-module ((guix licenses) #:prefix license:)
101 #:use-module (guix packages)
102 #:use-module (guix utils)
adddd5ba 103 #:use-module (srfi srfi-1)
17db0706 104 #:use-module (srfi srfi-2)
a94546ec
LC
105 #:use-module (srfi srfi-26)
106 #:use-module (ice-9 match))
fd76c904 107
aaf4cb20
LC
108(define-public (system->linux-architecture arch)
109 "Return the Linux architecture name for ARCH, a Guix system name such as
6d7ef2aa 110\"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
618cea69
NK
111 (let ((arch (car (string-split arch #\-))))
112 (cond ((string=? arch "i686") "i386")
113 ((string-prefix? "mips" arch) "mips")
aaf4cb20 114 ((string-prefix? "arm" arch) "arm")
503275e9 115 ((string-prefix? "aarch64" arch) "arm64")
605fec78 116 ((string-prefix? "alpha" arch) "alpha")
618cea69
NK
117 (else arch))))
118
440a3143
CSLL
119(define-public (system->defconfig system)
120 "Some systems (notably powerpc-linux) require a special target for kernel
121defconfig. Return the appropiate make target if applicable, otherwise return
122\"defconfig\"."
123 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
124 (else "defconfig")))
125
6023cc74
LC
126(define (linux-libre-urls version)
127 "Return a list of URLs for Linux-Libre VERSION."
128 (list (string-append
129 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
130 version "-gnu/linux-libre-" version "-gnu.tar.xz")
131
132 ;; XXX: Work around <http://bugs.gnu.org/14851>.
133 (string-append
134 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
135 version "-gnu.tar.xz")
136
137 ;; Maybe this URL will become valid eventually.
138 (string-append
139 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
140 version "-gnu.tar.xz")))
141
80fe5c60 142(define-public linux-libre-headers
b450d2b4
DC
143 (package
144 (name "linux-libre-headers")
e77fe950 145 (version "4.4.47")
b450d2b4
DC
146 (source (origin
147 (method url-fetch)
148 (uri (linux-libre-urls version))
149 (sha256
150 (base32
e77fe950 151 "00zdq7swhvzbbnnhzizq6m34q5k4fycpcp215bmkbxh1ic76v7bs"))))
b450d2b4
DC
152 (build-system gnu-build-system)
153 (native-inputs `(("perl" ,perl)))
154 (arguments
155 `(#:modules ((guix build gnu-build-system)
156 (guix build utils)
157 (srfi srfi-1))
158 #:phases
159 (modify-phases %standard-phases
160 (delete 'configure)
161 (replace 'build
162 (lambda _
163 (let ((arch ,(system->linux-architecture
164 (or (%current-target-system)
440a3143
CSLL
165 (%current-system))))
166 (defconfig ,(system->defconfig
167 (or (%current-target-system)
168 (%current-system)))))
b450d2b4 169 (setenv "ARCH" arch)
618cea69 170 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
440a3143 171 (and (zero? (system* "make" defconfig))
618cea69 172 (zero? (system* "make" "mrproper" "headers_check"))))))
b450d2b4
DC
173 (replace 'install
174 (lambda* (#:key outputs #:allow-other-keys)
80fe5c60
LC
175 (let ((out (assoc-ref outputs "out")))
176 (and (zero? (system* "make"
177 (string-append "INSTALL_HDR_PATH=" out)
178 "headers_install"))
b15389e1
LC
179 (begin
180 (mkdir (string-append out "/include/config"))
181 (call-with-output-file
182 (string-append out
183 "/include/config/kernel.release")
184 (lambda (p)
185 (format p "~a-default~%" ,version)))
186
187 ;; Remove the '.install' and '..install.cmd' files; the
188 ;; latter contains store paths, which pulls in bootstrap
189 ;; binaries in the build environment, and prevents bit
190 ;; reproducibility for the bootstrap binaries.
191 (for-each delete-file (find-files out "\\.install"))
192
193 #t))))))
b15389e1 194 #:allowed-references ()
80fe5c60 195 #:tests? #f))
6fd52309 196 (home-page "https://www.gnu.org/software/linux-libre/")
80fe5c60
LC
197 (synopsis "GNU Linux-Libre kernel headers")
198 (description "Headers of the Linux-Libre kernel.")
b450d2b4 199 (license license:gpl2)))
80fe5c60 200
ac47a7c2
LC
201(define %boot-logo-patch
202 ;; Linux-Libre boot logo featuring Freedo and a gnu.
203 (origin
204 (method url-fetch)
205 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
74dde9e9 206 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
ac47a7c2
LC
207 (sha256
208 (base32
209 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
210
c258807a 211(define* (kernel-config arch #:key variant)
a94546ec 212 "Return the absolute file name of the Linux-Libre build configuration file
c258807a 213for ARCH and optionally VARIANT, or #f if there is no such configuration."
7994250f 214 (let* ((name (string-append (if variant (string-append variant "-") "")
25847b32 215 (if (string=? "i386" arch) "i686" arch) ".conf"))
7994250f
AK
216 (file (string-append "linux-libre/" name)))
217 (search-auxiliary-file file)))
a94546ec 218
90c18c32 219(define %default-extra-linux-options
50dbc036 220 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
b9f7895d
DC
221 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t)
222 ;; Modules required for initrd:
223 ("CONFIG_NET_9P" . m)
224 ("CONFIG_NET_9P_VIRTIO" . m)
225 ("CONFIG_VIRTIO_BLK" . m)
226 ("CONFIG_VIRTIO_NET" . m)
227 ("CONFIG_VIRTIO_PCI" . m)
228 ("CONFIG_VIRTIO_BALLOON" . m)
229 ("CONFIG_VIRTIO_MMIO" . m)
230 ("CONFIG_FUSE_FS" . m)
231 ("CONFIG_CIFS" . m)
232 ("CONFIG_9P_FS" . m)))
90c18c32
DC
233
234(define (config->string options)
235 (string-join (map (match-lambda
236 ((option . 'm)
237 (string-append option "=m"))
238 ((option . #t)
239 (string-append option "=y"))
240 ((option . #f)
241 (string-append option "=n")))
242 options)
243 "\n"))
244
3129b9c2 245(define* (make-linux-libre version hash supported-systems
c258807a
DC
246 #:key
247 ;; A function that takes an arch and a variant.
248 ;; See kernel-config for an example.
a6d01325 249 (extra-version #f)
c258807a 250 (configuration-file #f)
90c18c32 251 (defconfig "defconfig")
64de7d1c
MW
252 (extra-options %default-extra-linux-options)
253 (patches (list %boot-logo-patch)))
614d1738 254 (package
a6d01325
DC
255 (name (if extra-version
256 (string-append "linux-libre-" extra-version)
257 "linux-libre"))
c258807a 258 (version version)
614d1738
DC
259 (source (origin
260 (method url-fetch)
261 (uri (linux-libre-urls version))
c258807a 262 (sha256 (base32 hash))
64de7d1c 263 (patches patches)))
3129b9c2 264 (supported-systems supported-systems)
614d1738 265 (build-system gnu-build-system)
614d1738
DC
266 (native-inputs
267 `(("perl" ,perl)
268 ("bc" ,bc)
269 ("openssl" ,openssl)
78edcccc 270 ("kmod" ,kmod)
64b5e413
LC
271 ,@(match (and configuration-file
272 (configuration-file
273 (system->linux-architecture
274 (or (%current-target-system) (%current-system)))
275 #:variant (version-major+minor version)))
276 (#f ;no config for this platform
277 '())
278 ((? string? config)
279 `(("kconfig" ,config))))))
614d1738
DC
280 (arguments
281 `(#:modules ((guix build gnu-build-system)
282 (guix build utils)
283 (srfi srfi-1)
284 (ice-9 match))
285 #:phases
286 (modify-phases %standard-phases
9416459b 287 (replace 'configure
4b42703e 288 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
96e9f097
RN
289 ;; Avoid introducing timestamps
290 (setenv "KCONFIG_NOTIMESTAMP" "1")
291 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
292
4b42703e 293 ;; Set ARCH and CROSS_COMPILE
6d7ef2aa
DC
294 (let ((arch ,(system->linux-architecture
295 (or (%current-target-system)
296 (%current-system)))))
4b42703e
DC
297 (setenv "ARCH" arch)
298 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
6d7ef2aa 299
4b42703e
DC
300 (when target
301 (setenv "CROSS_COMPILE" (string-append target "-"))
302 (format #t "`CROSS_COMPILE' set to `~a'~%"
303 (getenv "CROSS_COMPILE"))))
beacfcab 304
a6d01325
DC
305 (setenv "EXTRA_VERSION" ,extra-version)
306
a94546ec
LC
307 (let ((build (assoc-ref %standard-phases 'build))
308 (config (assoc-ref inputs "kconfig")))
1650dd8a 309
e4e9c0a0
DC
310 ;; Use a custom kernel configuration file or a default
311 ;; configuration file.
1650dd8a
LC
312 (if config
313 (begin
314 (copy-file config ".config")
315 (chmod ".config" #o666))
c258807a 316 (system* "make" ,defconfig))
a94546ec
LC
317
318 ;; Appending works even when the option wasn't in the
319 ;; file. The last one prevails if duplicated.
90c18c32
DC
320 (let ((port (open-file ".config" "a"))
321 (extra-configuration ,(config->string extra-options)))
322 (display extra-configuration port)
a94546ec
LC
323 (close-port port))
324
9416459b 325 (zero? (system* "make" "oldconfig")))))
614d1738 326 (replace 'install
4b42703e 327 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
beacfcab
LC
328 (let* ((out (assoc-ref outputs "out"))
329 (moddir (string-append out "/lib/modules"))
e4e9c0a0
DC
330 (dtbdir (string-append out "/lib/dtbs"))
331 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
332 ;; Install kernel image, kernel configuration and link map.
333 (for-each (lambda (file) (install-file file out))
334 (find-files "." "^(\\.config|bzImage|zImage|vmlinuz|System\\.map)$"))
335 ;; Install device tree files
336 (for-each (lambda (file) (install-file file dtbdir))
337 (find-files "." "\\.dtb$"))
338 ;; Install kernel modules
beacfcab 339 (mkdir-p moddir)
beacfcab 340 (zero? (system* "make"
78edcccc 341 (string-append "DEPMOD=" kmod "/bin/depmod")
beacfcab
LC
342 (string-append "MODULE_DIR=" moddir)
343 (string-append "INSTALL_PATH=" out)
344 (string-append "INSTALL_MOD_PATH=" out)
cda3d81e 345 "INSTALL_MOD_STRIP=1"
beacfcab 346 "modules_install"))))))
beacfcab 347 #:tests? #f))
6fd52309 348 (home-page "https://www.gnu.org/software/linux-libre//")
f50d2669 349 (synopsis "100% free redistribution of a cleaned Linux kernel")
a22dc0c4 350 (description
79c311b8
LC
351 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
352It has been modified to remove all non-free binary blobs.")
614d1738 353 (license license:gpl2)))
beacfcab 354
3129b9c2
DC
355(define %intel-compatible-systems '("x86_64-linux" "i686-linux"))
356
718448e1
MW
357(define %linux-libre-version "4.11.2")
358(define %linux-libre-hash "0vp6hjc7cb6q6bhbg6jcf08r27xbf293cdib2vfng15ygvxpyfij")
76e62ef7 359
c258807a 360(define-public linux-libre
76e62ef7
MW
361 (make-linux-libre %linux-libre-version
362 %linux-libre-hash
3129b9c2 363 %intel-compatible-systems
81d6fd24 364 #:configuration-file kernel-config))
c258807a 365
52d901da 366(define-public linux-libre-4.9
519fd6c3
MW
367 (make-linux-libre "4.9.29"
368 "0yj4gajdzilxnh9lhb2zl0hs654lagdfx8cp7bv2w4q41bnmc3l9"
52d901da 369 %intel-compatible-systems
f11a48c0 370 #:configuration-file kernel-config))
52d901da 371
75b314a6 372(define-public linux-libre-4.4
ec8d69eb
MW
373 (make-linux-libre "4.4.69"
374 "14q5lqsfmwyiilbhffr3bwsm6i3z1jv6y09rg8x3faibcg766wny"
3129b9c2 375 %intel-compatible-systems
c46d8e92 376 #:configuration-file kernel-config))
75b314a6 377
adddd5ba 378(define-public linux-libre-4.1
9b05ccfe
LF
379 (make-linux-libre "4.1.39"
380 "06pb3zpkfkc7pb7yh537vvzn8i9nhqyx58kqxv0wq23b4hhpza7d"
3129b9c2 381 %intel-compatible-systems
89234419
LF
382 #:configuration-file kernel-config
383 #:patches
384 (list %boot-logo-patch
385 (origin
386 (method url-fetch)
387 (uri "\
388https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/patch/?id=5edabca9d4cff7f1f2b68f0bac55ef99d9798ba4")
389 (file-name "linux-libre-CVE-2017-6074.patch")
390 (sha256
391 (base32
392 "1x40slfz1qxgiaznyy13bwlh34450pkyyrkljpyjlx6c4mrzb1jj"))))))
adddd5ba 393
cde7c23f
DC
394(define-public linux-libre-arm-generic
395 (make-linux-libre %linux-libre-version
396 %linux-libre-hash
397 '("armhf-linux")
398 #:defconfig "multi_v7_defconfig"
81d6fd24 399 #:extra-version "arm-generic"))
cde7c23f 400
97121c2a 401\f
c84d0eca
LC
402;;;
403;;; Pluggable authentication modules (PAM).
404;;;
405
fd76c904
LC
406(define-public linux-pam
407 (package
408 (name "linux-pam")
7483230f 409 (version "1.3.0")
fd76c904
LC
410 (source
411 (origin
412 (method url-fetch)
7483230f
DC
413 (uri (string-append
414 "http://www.linux-pam.org/library/"
415 "Linux-PAM-" version ".tar.bz2"))
fd76c904
LC
416 (sha256
417 (base32
411264c2
RS
418 "1fyi04d5nsh8ivd0rn2y0z83ylgc0licz7kifbb6xxi2ylgfs6i4"))
419 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
420
fd76c904 421 (build-system gnu-build-system)
c4c4cc05 422 (native-inputs
fd76c904
LC
423 `(("flex" ,flex)
424
425 ;; TODO: optional dependencies
426 ;; ("libxcrypt" ,libxcrypt)
427 ;; ("cracklib" ,cracklib)
428 ))
429 (arguments
c134056a
LC
430 '(;; Most users, such as `shadow', expect the headers to be under
431 ;; `security'.
432 #:configure-flags (list (string-append "--includedir="
433 (assoc-ref %outputs "out")
434 "/include/security"))
435
436 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
437 ;; isn't available.
438 #:tests? #f))
fd76c904
LC
439 (home-page "http://www.linux-pam.org/")
440 (synopsis "Pluggable authentication modules for Linux")
441 (description
442 "A *Free* project to implement OSF's RFC 86.0.
443Pluggable authentication modules are small shared object files that can
444be used through the PAM API to perform tasks, like authenticating a user
e881752c 445at login. Local and dynamic reconfiguration are its key features.")
3ac73271 446 (license license:bsd-3)))
686f14e8 447
4c93ce42
EF
448(define-public linux-pam-1.2
449 (package
450 (inherit linux-pam)
4c93ce42
EF
451 (version "1.2.1")
452 (source
453 (origin
454 (method url-fetch)
455 (uri (string-append
456 "http://www.linux-pam.org/library/"
457 "Linux-PAM-" version ".tar.bz2"))
458 (sha256
459 (base32
411264c2
RS
460 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
461 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
4c93ce42 462
53142109 463
c84d0eca
LC
464;;;
465;;; Miscellaneous.
466;;;
467
686f14e8
LC
468(define-public psmisc
469 (package
470 (name "psmisc")
aa9c221f 471 (version "22.21")
686f14e8
LC
472 (source
473 (origin
474 (method url-fetch)
475 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
476 version ".tar.gz"))
477 (sha256
478 (base32
aa9c221f 479 "0nhlm1vrrwn4a845p6y4nnnb4liq70n74zbdd5dq844jc6nkqclp"))))
686f14e8
LC
480 (build-system gnu-build-system)
481 (inputs `(("ncurses" ,ncurses)))
aa9c221f 482 (home-page "https://gitlab.com/psmisc/psmisc")
686f14e8 483 (synopsis
8f65585b 484 "Small utilities that use the proc file system")
686f14e8
LC
485 (description
486 "This PSmisc package is a set of some small useful utilities that
8f65585b 487use the proc file system. We're not about changing the world, but
686f14e8 488providing the system administrator with some help in common tasks.")
3ac73271 489 (license license:gpl2+)))
02b80c3f
NK
490
491(define-public util-linux
492 (package
493 (name "util-linux")
83090f6a 494 (version "2.29.2")
5a6a3ba4
LC
495 (source (origin
496 (method url-fetch)
497 (uri (string-append "mirror://kernel.org/linux/utils/"
9f533d60
LC
498 name "/v" (version-major+minor version) "/"
499 name "-" version ".tar.xz"))
5a6a3ba4
LC
500 (sha256
501 (base32
83090f6a 502 "1qz81w8vzrmy8xn9yx7ls4amkbgwx6vr62pl6kv9g7r0g3ba9kmc"))
fc1adab1 503 (patches (search-patches "util-linux-tests.patch"))
9d77da2a
LC
504 (modules '((guix build utils)))
505 (snippet
ec2da92c
LC
506 ;; We take the 'logger' program from GNU Inetutils and 'kill'
507 ;; from GNU Coreutils.
8338c241
MW
508 '(begin
509 (substitute* "configure"
510 (("build_logger=yes") "build_logger=no")
511 (("build_kill=yes") "build_kill=no"))
512 #t))))
02b80c3f 513 (build-system gnu-build-system)
dd581e9a
TGR
514 (outputs '("out"
515 "static")) ; >2 MiB of static .a libraries
02b80c3f 516 (arguments
29ec55ee 517 `(#:configure-flags (list "--disable-use-tty-group"
d9804e50 518 "--enable-fs-paths-default=/run/current-system/profile/sbin"
29ec55ee
LC
519 ;; Install completions where our
520 ;; bash-completion package expects them.
521 (string-append "--with-bashcompletiondir="
522 (assoc-ref %outputs "out")
523 "/etc/bash_completion.d"))
1b9cf4ad 524 #:phases (modify-phases %standard-phases
7e512497
LC
525 (add-before
526 'build 'set-umount-file-name
527 (lambda* (#:key outputs #:allow-other-keys)
528 ;; Tell 'eject' the right file name of 'umount'.
529 (let ((out (assoc-ref outputs "out")))
530 (substitute* "sys-utils/eject.c"
531 (("\"/bin/umount\"")
532 (string-append "\"" out "/bin/umount\"")))
533 #t)))
1b9cf4ad
LC
534 (add-before
535 'check 'pre-check
536 (lambda* (#:key inputs outputs #:allow-other-keys)
537 (let ((out (assoc-ref outputs "out"))
538 (net (assoc-ref inputs "net-base")))
539 ;; Change the test to refer to the right file.
540 (substitute* "tests/ts/misc/mcookie"
541 (("/etc/services")
542 (string-append net "/etc/services")))
dd581e9a
TGR
543 #t)))
544 (add-after
545 'install 'move-static-libraries
546 (lambda* (#:key outputs #:allow-other-keys)
547 (let ((out (assoc-ref outputs "out"))
548 (static (assoc-ref outputs "static")))
549 (mkdir-p (string-append static "/lib"))
550 (with-directory-excursion out
551 (for-each (lambda (file)
552 (rename-file file
553 (string-append static "/"
554 file)))
555 (find-files "lib" "\\.a$")))
1b9cf4ad 556 #t))))))
f61e0e79 557 (inputs `(("zlib" ,zlib)
c4c4cc05
JD
558 ("ncurses" ,ncurses)))
559 (native-inputs
9f533d60
LC
560 `(("perl" ,perl)
561 ("net-base" ,net-base))) ;for tests
02b80c3f 562 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
35ec07c7 563 (synopsis "Collection of utilities for the Linux kernel")
437d7286 564 (description "Util-linux is a diverse collection of Linux kernel
8f65585b 565utilities. It provides dmesg and includes tools for working with file systems,
437d7286 566block devices, UUIDs, TTYs, and many other tools.")
fe8ccfcc 567
02b80c3f 568 ;; Note that util-linux doesn't use the same license for all the
fe8ccfcc 569 ;; code. GPLv2+ is the default license for a code without an
02b80c3f 570 ;; explicitly defined license.
3ac73271
LC
571 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
572 license:bsd-4 license:public-domain))))
5d5c4278 573
e47e3eff
LC
574(define-public procps
575 (package
576 (name "procps")
74a3c4bb 577 (version "3.3.12")
e47e3eff 578 (source (origin
0cc22848
SB
579 (method url-fetch)
580 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
581 "procps-ng-" version ".tar.xz"))
582 (sha256
583 (base32
74a3c4bb 584 "1m57w6jmry84njd5sgk5afycbglql0al80grx027kwqqcfw5mmkf"))))
e47e3eff 585 (build-system gnu-build-system)
e47e3eff 586 (arguments
80393eed
LC
587 '(#:modules ((guix build utils)
588 (guix build gnu-build-system)
589 (srfi srfi-1)
590 (srfi srfi-26))
0cc22848
SB
591 #:phases
592 (modify-phases %standard-phases
241826b5
LC
593 (add-before 'check 'disable-strtod-test
594 (lambda _
595 ;; Disable the 'strtod' test, which fails on 32-bit systems.
596 ;; This is what upstream does:
597 ;; <https://gitlab.com/procps-ng/procps/commit/100afbc1491be388f1429021ff65d969f4b1e08f>.
598 (substitute* "Makefile"
599 (("^(TESTS|check_PROGRAMS) = .*$" all)
600 (string-append "# " all "\n")))
601 #t))
0cc22848
SB
602 (add-after
603 'install 'post-install
604 ;; Remove commands and man pages redudant with
605 ;; Coreutils.
606 (lambda* (#:key outputs #:allow-other-keys)
607 (let* ((out (assoc-ref outputs "out"))
608 (dup (append-map (cut find-files out <>)
609 '("^kill" "^uptime"))))
610 (for-each delete-file dup)
611 #t))))))
612 (inputs `(("ncurses" ,ncurses)))
613 (home-page "https://gitlab.com/procps-ng/procps/")
35ec07c7 614 (synopsis "Utilities that give information about processes")
e47e3eff 615 (description
35b9e423 616 "Procps is the package that has a bunch of small useful utilities
e47e3eff
LC
617that give information about processes using the Linux /proc file system.
618The package includes the programs ps, top, vmstat, w, kill, free,
619slabtop, and skill.")
3ac73271 620 (license license:gpl2)))
e47e3eff 621
5d5c4278
NK
622(define-public usbutils
623 (package
624 (name "usbutils")
e8a463e6 625 (version "008")
5d5c4278
NK
626 (source
627 (origin
628 (method url-fetch)
629 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
630 "usbutils-" version ".tar.xz"))
631 (sha256
632 (base32
e8a463e6 633 "132clk14j4nm8crln2jymdbbc2vhzar2j2hnxyh05m79pbq1lx24"))))
5d5c4278
NK
634 (build-system gnu-build-system)
635 (inputs
e8a463e6 636 `(("libusb" ,libusb)
e5d861f3 637 ("eudev" ,eudev-with-hwdb)))
c4c4cc05
JD
638 (native-inputs
639 `(("pkg-config" ,pkg-config)))
5d5c4278
NK
640 (home-page "http://www.linux-usb.org/")
641 (synopsis
642 "Tools for working with USB devices, such as lsusb")
643 (description
644 "Tools for working with USB devices, such as lsusb.")
3ac73271 645 (license license:gpl2+)))
0750452a
LC
646
647(define-public e2fsprogs
648 (package
649 (name "e2fsprogs")
b047a86b 650 (version "1.43.4")
0750452a
LC
651 (source (origin
652 (method url-fetch)
7409c8d4
MW
653 (uri (string-append
654 "mirror://kernel.org/linux/kernel/people/tytso/"
655 name "/v" version "/"
656 name "-" version ".tar.xz"))
0750452a
LC
657 (sha256
658 (base32
b047a86b 659 "092absr4vrlqrkdf9nwh4ykj40ab6hhwrkdr6sjsccd54c8z5csl"))))
0750452a 660 (build-system gnu-build-system)
c4c4cc05 661 (inputs `(("util-linux" ,util-linux)))
f57d2639 662 (native-inputs `(("pkg-config" ,pkg-config)
75f796bb
MB
663 ("texinfo" ,texinfo) ;for the libext2fs Info manual
664
665 ;; For tests.
666 ("perl" ,perl)
667 ("procps" ,procps)))
0750452a 668 (arguments
b047a86b 669 '(;; util-linux is the preferred source for some of the libraries and
c44ed26c 670 ;; commands, so disable them (see, e.g.,
a124bbd2 671 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
b047a86b
MB
672 #:configure-flags (list "--disable-libblkid"
673 "--disable-libuuid" "--disable-uuidd"
674 "--disable-fsck"
7c594a2c 675
b047a86b
MB
676 ;; Use symlinks instead of hard links for
677 ;; 'fsck.extN' etc. This makes the resulting nar
678 ;; smaller and is preserved across copies.
679 "--enable-symlink-install"
74d21291 680
b047a86b
MB
681 (string-append "LDFLAGS=-Wl,-rpath="
682 (assoc-ref %outputs "out")
683 "/lib")
7c594a2c 684
b047a86b
MB
685 ;; Install libext2fs et al.
686 "--enable-elf-shlibs")
ddfc2fd8 687
55acb372
MB
688 #:phases
689 (modify-phases %standard-phases
690 (add-before 'configure 'patch-shells
691 (lambda _
692 (substitute* "configure"
693 (("/bin/sh (.*)parse-types.sh" _ dir)
694 (string-append (which "sh") " " dir
695 "parse-types.sh")))
b047a86b
MB
696 (substitute* "MCONFIG.in"
697 (("INSTALL_SYMLINK = /bin/sh")
698 "INSTALL_SYMLINK = sh"))
55acb372
MB
699 (substitute* (find-files "." "^Makefile.in$")
700 (("#!/bin/sh")
701 (string-append "#!" (which "sh"))))
702 #t))
703 (add-after 'install 'install-libs
704 (lambda* (#:key outputs #:allow-other-keys)
705 (let* ((out (assoc-ref outputs "out"))
706 (lib (string-append out "/lib")))
707 (and (zero? (system* "make" "install-libs"))
708
709 ;; Make the .a writable so that 'strip' works.
710 ;; Failing to do that, due to debug symbols, we
711 ;; retain a reference to the final
712 ;; linux-libre-headers, which refer to the
713 ;; bootstrap binaries.
714 (let ((archives (find-files lib "\\.a$")))
715 (for-each (lambda (file)
716 (chmod file #o666))
717 archives)
75f796bb 718 #t))))))))
0750452a 719 (home-page "http://e2fsprogs.sourceforge.net/")
35ec07c7 720 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
0750452a
LC
721 (description
722 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
3ac73271
LC
723 (license (list license:gpl2 ;programs
724 license:lgpl2.0 ;libext2fs
725 license:x11)))) ;libuuid
d8482ad0 726
e48977e7
LC
727(define e2fsprogs/static
728 (static-package
729 (package (inherit e2fsprogs)
730 (arguments
731 ;; Do not build shared libraries.
732 (substitute-keyword-arguments (package-arguments e2fsprogs)
733 ((#:configure-flags _)
734 '(list "--disable-blkid"))
735 ((#:make-flags _)
736 '(list)))))))
737
e102f940
LC
738(define-public e2fsck/static
739 (package
740 (name "e2fsck-static")
0997771a 741 (version (package-version e2fsprogs))
e102f940
LC
742 (build-system trivial-build-system)
743 (source #f)
313880c7
DC
744 (inputs
745 `(("e2fsprogs" ,e2fsprogs/static)))
e102f940
LC
746 (arguments
747 `(#:modules ((guix build utils))
748 #:builder
749 (begin
750 (use-modules (guix build utils)
751 (ice-9 ftw)
752 (srfi srfi-26))
753
313880c7
DC
754 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
755 "/sbin/e2fsck"))
e102f940
LC
756 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
757 (mkdir-p bin)
758 (with-directory-excursion bin
313880c7
DC
759 (copy-file e2fsck "e2fsck")
760 (remove-store-references "e2fsck")
761 (chmod "e2fsck" #o555))))))
0997771a 762 (home-page (package-home-page e2fsprogs))
313880c7
DC
763 (synopsis "Statically-linked e2fsck command from e2fsprogs")
764 (description "This package provides statically-linked e2fsck command taken
765from the e2fsprogs package. It is meant to be used in initrds.")
0997771a 766 (license (package-license e2fsprogs))))
e102f940 767
7c0a9104
LC
768(define-public extundelete
769 (package
770 (name "extundelete")
771 (version "0.2.4")
772 (source (origin
773 (method url-fetch)
774 (uri (string-append "mirror://sourceforge/extundelete/"
de67e922
LF
775 "extundelete/" version "/extundelete-"
776 version ".tar.bz2"))
7c0a9104
LC
777 (sha256
778 (base32
779 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
780 (build-system gnu-build-system)
781 (inputs `(("e2fsprogs" ,e2fsprogs)))
782 (home-page "http://extundelete.sourceforge.net/")
783 (synopsis "Recover deleted files from ext2/3/4 partitions")
784 (description
785 "Extundelete is a set of tools that can recover deleted files from an
786ext3 or ext4 partition.")
3ac73271 787 (license license:gpl2)))
7c0a9104 788
1c975f60
LC
789(define-public zerofree
790 (package
791 (name "zerofree")
792 (version "1.0.3")
793 (home-page "http://intgat.tigress.co.uk/rmy/uml/")
794 (source (origin
795 (method url-fetch)
796 (uri (string-append home-page name "-" version
797 ".tgz"))
798 (sha256
799 (base32
800 "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs"))))
801 (build-system gnu-build-system)
802 (arguments
803 '(#:phases (alist-replace
804 'install
805 (lambda* (#:key outputs #:allow-other-keys)
806 (let* ((out (assoc-ref outputs "out"))
807 (bin (string-append out "/bin")))
808 (mkdir-p bin)
809 (copy-file "zerofree"
810 (string-append bin "/zerofree"))
811 (chmod (string-append bin "/zerofree")
812 #o555)
813 #t))
814 (alist-delete 'configure %standard-phases))
815 #:tests? #f)) ;no tests
816 (inputs `(("libext2fs" ,e2fsprogs)))
817 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
818 (description
819 "The zerofree command scans the free blocks in an ext2 file system and
820fills any non-zero blocks with zeroes. This is a useful way to make disk
821images more compressible.")
3ac73271 822 (license license:gpl2)))
1c975f60 823
d8482ad0
LC
824(define-public strace
825 (package
826 (name "strace")
2af3743b 827 (version "4.17")
d8482ad0
LC
828 (source (origin
829 (method url-fetch)
de67e922
LF
830 (uri (string-append "mirror://sourceforge/strace/strace/" version
831 "/strace-" version ".tar.xz"))
d8482ad0
LC
832 (sha256
833 (base32
2af3743b 834 "06bl4dld5fk4a3iiq4pyrkm6sh63599ah8dmds0glg5vbw45pww1"))))
d8482ad0 835 (build-system gnu-build-system)
6983b8a8
MB
836 (arguments
837 '(#:phases
838 (modify-phases %standard-phases
839 (add-after 'unpack 'patch-/bin/sh
840 (lambda _
841 (substitute* "strace.c"
842 (("/bin/sh") (which "sh")))
843 #t)))))
c4c4cc05 844 (native-inputs `(("perl" ,perl)))
6983b8a8 845 (home-page "https://strace.io/")
d8482ad0
LC
846 (synopsis "System call tracer for Linux")
847 (description
848 "strace is a system call tracer, i.e. a debugging tool which prints out a
849trace of all the system calls made by a another process/program.")
3ac73271 850 (license license:bsd-3)))
ba04571a 851
e1e27737
TUBK
852(define-public ltrace
853 (package
854 (name "ltrace")
855 (version "0.7.3")
856 (source (origin
857 (method url-fetch)
858 (uri (string-append "http://www.ltrace.org/ltrace_" version
859 ".orig.tar.bz2"))
860 (sha256
861 (base32
862 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
863 (build-system gnu-build-system)
864 (inputs `(("libelf" ,libelf)))
865 (arguments
866 ;; Compilation uses -Werror by default, but it fails.
867 '(#:configure-flags '("--disable-werror")))
868 (home-page "http://www.ltrace.org/")
869 (synopsis "Library call tracer for Linux")
870 (description
871 "ltrace intercepts and records dynamic library calls which are called by
872an executed process and the signals received by that process. It can also
873intercept and print the system calls executed by the program.")
3ac73271 874 (license license:gpl2+)))
e1e27737 875
ba04571a
LC
876(define-public alsa-lib
877 (package
878 (name "alsa-lib")
5f3070a5 879 (version "1.1.3")
ba04571a
LC
880 (source (origin
881 (method url-fetch)
882 (uri (string-append
883 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
884 version ".tar.bz2"))
885 (sha256
886 (base32
5f3070a5 887 "174n2psp0328xcy2f1ayls67598bxli6q9cf00d2qnac3012aa3i"))))
ba04571a 888 (build-system gnu-build-system)
5f3070a5 889 (home-page "https://www.alsa-project.org/")
ba04571a
LC
890 (synopsis "The Advanced Linux Sound Architecture libraries")
891 (description
892 "The Advanced Linux Sound Architecture (ALSA) provides audio and
893MIDI functionality to the Linux-based operating system.")
3ac73271 894 (license license:lgpl2.1+)))
10afdf50 895
17b293a0
LC
896(define-public alsa-utils
897 (package
898 (name "alsa-utils")
457d154f 899 (version "1.1.3")
17b293a0
LC
900 (source (origin
901 (method url-fetch)
992b527d
EF
902 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
903 name "-" version ".tar.bz2"))
17b293a0
LC
904 (sha256
905 (base32
457d154f 906 "0z0nnqp1707bm02dys2d16m88lsg5nd26bqaf14rl3za9sjifwhj"))))
17b293a0
LC
907 (build-system gnu-build-system)
908 (arguments
909 ;; XXX: Disable man page creation until we have DocBook.
910 '(#:configure-flags (list "--disable-xmlto"
f2817d43
LC
911
912 ;; The udev rule is responsible for restoring
913 ;; the volume.
17b293a0
LC
914 (string-append "--with-udev-rules-dir="
915 (assoc-ref %outputs "out")
916 "/lib/udev/rules.d"))
49165145
EF
917 #:phases
918 (modify-phases %standard-phases
919 (add-before
920 'install 'pre-install
921 (lambda _
922 ;; Don't try to mkdir /var/lib/alsa.
923 (substitute* "Makefile"
924 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
457d154f
EF
925 "true\n"))
926 #t)))))
17b293a0
LC
927 (inputs
928 `(("libsamplerate" ,libsamplerate)
929 ("ncurses" ,ncurses)
930 ("alsa-lib" ,alsa-lib)
931 ("xmlto" ,xmlto)
b94a6ca0 932 ("gettext" ,gettext-minimal)))
17b293a0
LC
933 (home-page "http://www.alsa-project.org/")
934 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
935 (description
936 "The Advanced Linux Sound Architecture (ALSA) provides audio and
937MIDI functionality to the Linux-based operating system.")
938
939 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
940 ;; GPLv2-only.
3ac73271 941 (license license:gpl2)))
17b293a0 942
7d2511bc 943(define-public alsa-plugins
944 (package
945 (name "alsa-plugins")
946 (version "1.1.1")
947 (source (origin
948 (method url-fetch)
949 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
950 name "-" version ".tar.bz2"))
951 (sha256
952 (base32
953 "1w81z5jlwqhd1l2m7qrq69lc4k9dnrg1wn52jsl2hrf3hbhd394f"))))
954 (build-system gnu-build-system)
955 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
956 ;; be split, there are references to both in files.
957 ;; TODO: Remove OSS related plugins, they add support to run native
958 ;; ALSA applications on OSS however we do not offer OSS and OSS is
959 ;; obsolete.
960 (outputs '("out" "pulseaudio"))
961 (arguments
962 `(#:phases
963 (modify-phases %standard-phases
964 (add-after 'install 'split
965 (lambda* (#:key inputs outputs #:allow-other-keys)
966 ;; Distribute the binaries to the various outputs.
967 (let* ((out (assoc-ref outputs "out"))
968 (pua (assoc-ref outputs "pulseaudio"))
969 (pualib (string-append pua "/lib/alsa-lib"))
970 (puaconf (string-append pua "/share/alsa/alsa.conf.d")))
971 (mkdir-p puaconf)
972 (mkdir-p pualib)
973 (chdir (string-append out "/share"))
974 (for-each (lambda (file)
975 (rename-file file (string-append puaconf "/" (basename file))))
976 (find-files out "\\.(conf|example)"))
977 (for-each (lambda (file)
978 (rename-file file (string-append pualib "/" (basename file))))
979 (find-files out ".*pulse\\.(la|so)"))
980 (chdir "..")
981 ;; We have moved the files to output pulsaudio, the
982 ;; directory is now empty.
983 (delete-file-recursively (string-append out "/share"))
984 #t))))))
985 (inputs
986 `(("alsa-lib" ,alsa-lib)
987 ("speex" ,speex) ; libspeexdsp resampling plugin
988 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
989 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
990 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
991 (native-inputs
992 `(("pkg-config" ,pkg-config)))
993 (home-page "http://www.alsa-project.org/")
994 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
995 (description
996 "The Advanced Linux Sound Architecture (ALSA) provides audio and
997MIDI functionality to the Linux-based operating system. This package enhances ALSA
998by providing additional plugins which include: upmixing, downmixing, jackd and
999pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1000external rate conversion.")
1001 (license (list license:gpl2+
1002 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1003 license:lgpl2.1+))))
1004
10afdf50
LC
1005(define-public iptables
1006 (package
1007 (name "iptables")
13223c8e 1008 (version "1.6.1")
10afdf50
LC
1009 (source (origin
1010 (method url-fetch)
1011 (uri (string-append
f11ae44f 1012 "mirror://netfilter.org/iptables/iptables-"
10afdf50
LC
1013 version ".tar.bz2"))
1014 (sha256
1015 (base32
13223c8e 1016 "1x8c9y340x79djsq54bc1674ryv59jfphrk4f88i7qbvbnyxghhg"))))
10afdf50 1017 (build-system gnu-build-system)
13223c8e
LF
1018 (native-inputs
1019 `(("pkg-config" ,pkg-config)
1020 ("flex" ,flex)
1021 ("bison" ,bison)))
1022 (inputs
1023 `(("libmnl" ,libmnl)
1024 ("libnftnl" ,libnftnl)))
50c26d9e
SB
1025 (arguments
1026 '(#:tests? #f ; no test suite
1027 #:configure-flags ; add $libdir to the RUNPATH of executables
1028 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
13223c8e 1029 (home-page "https://www.netfilter.org/projects/iptables/index.html")
10afdf50
LC
1030 (synopsis "Program to configure the Linux IP packet filtering rules")
1031 (description
1032 "iptables is the userspace command line program used to configure the
35e4b3d5 1033Linux 2.4.x and later IPv4 packet filtering ruleset (firewall). It is targeted at
10afdf50
LC
1034system administrators. Since Network Address Translation is also configured
1035from the packet filter ruleset, iptables is used for this, too. The iptables
1036package also includes ip6tables. ip6tables is used for configuring the IPv6
1037packet filter.")
3ac73271 1038 (license license:gpl2+)))
90a0048f
LC
1039
1040(define-public iproute
1041 (package
1042 (name "iproute2")
61f78e72 1043 (version "4.10.0")
90a0048f 1044 (source (origin
75cd4b05
AK
1045 (method url-fetch)
1046 (uri (string-append
1047 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1048 version ".tar.xz"))
1049 (sha256
1050 (base32
61f78e72 1051 "1a59y1zkddvr7z0lh2y9iasbh9wpfc1n39p56xcd6jkhzk0y3c92"))))
90a0048f
LC
1052 (build-system gnu-build-system)
1053 (arguments
1054 `(#:tests? #f ; no test suite
1055 #:make-flags (let ((out (assoc-ref %outputs "out")))
1056 (list "DESTDIR="
e777d07d
LF
1057 (string-append "BASH_COMPDIR=" out
1058 "/etc/bash_completion.d")
90a0048f 1059 (string-append "LIBDIR=" out "/lib")
61f78e72 1060 (string-append "HDRDIR=" out "/include")
90a0048f
LC
1061 (string-append "SBINDIR=" out "/sbin")
1062 (string-append "CONFDIR=" out "/etc")
1063 (string-append "DOCDIR=" out "/share/doc/"
1064 ,name "-" ,version)
1065 (string-append "MANDIR=" out "/share/man")))
b53e44fb
AK
1066 #:phases (modify-phases %standard-phases
1067 (add-before 'install 'pre-install
1068 (lambda _
1069 ;; Don't attempt to create /var/lib/arpd.
1070 (substitute* "Makefile"
1071 (("^.*ARPDDIR.*$") "")))))))
90a0048f
LC
1072 (inputs
1073 `(("iptables" ,iptables)
c4c4cc05
JD
1074 ("db4" ,bdb)))
1075 (native-inputs
1076 `(("pkg-config" ,pkg-config)
90a0048f
LC
1077 ("flex" ,flex)
1078 ("bison" ,bison)))
1079 (home-page
d7f84eab 1080 "https://wiki.linuxfoundation.org/networking/iproute2")
90a0048f 1081 (synopsis
9e771e3b 1082 "Utilities for controlling TCP/IP networking and traffic in Linux")
90a0048f
LC
1083 (description
1084 "Iproute2 is a collection of utilities for controlling TCP/IP
1085networking and traffic with the Linux kernel.
1086
1087Most network configuration manuals still refer to ifconfig and route as the
1088primary network configuration tools, but ifconfig is known to behave
1089inadequately in modern network environments. They should be deprecated, but
1090most distros still include them. Most network configuration systems make use
1091of ifconfig and thus provide a limited feature set. The /etc/net project aims
1092to support most modern network technologies, as it doesn't use ifconfig and
1093allows a system administrator to make use of all iproute2 features, including
1094traffic control.
1095
1096iproute2 is usually shipped in a package called iproute or iproute2 and
02041872
TGR
1097consists of several tools, of which the most important are @command{ip} and
1098@command{tc}. @command{ip} controls IPv4 and IPv6 configuration and
1099@command{tc} stands for traffic control. Both tools print detailed usage
1100messages and are accompanied by a set of manpages.")
3ac73271 1101 (license license:gpl2+)))
85e0dc6a
LC
1102
1103(define-public net-tools
1104 ;; XXX: This package is basically unmaintained, but it provides a few
1105 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1106 ;; live with it.
1107 (package
1108 (name "net-tools")
1109 (version "1.60")
6b55ee88 1110 (home-page "http://net-tools.sourceforge.net/")
85e0dc6a
LC
1111 (source (origin
1112 (method url-fetch)
6b55ee88
LC
1113 (uri (list (string-append
1114 "mirror://sourceforge/net-tools/net-tools-"
1115 version ".tar.bz2")
1116 (string-append
1117 "http://distro.ibiblio.org/rootlinux/rootlinux-ports"
1118 "/base/net-tools/net-tools-1.60.tar.bz2")))
85e0dc6a
LC
1119 (sha256
1120 (base32
177088a3 1121 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
fc1adab1 1122 (patches (search-patches "net-tools-bitrot.patch"))))
85e0dc6a
LC
1123 (build-system gnu-build-system)
1124 (arguments
c9e0a44e
LC
1125 '(#:modules ((guix build gnu-build-system)
1126 (guix build utils)
1127 (srfi srfi-1)
1128 (srfi srfi-26))
1129 #:phases (alist-cons-after
cd143df0 1130 'unpack 'patch
85e0dc6a
LC
1131 (lambda* (#:key inputs #:allow-other-keys)
1132 (define (apply-patch file)
9a224ac2 1133 (zero? (system* "patch" "-p1" "--force"
85e0dc6a
LC
1134 "--input" file)))
1135
1136 (let ((patch.gz (assoc-ref inputs "patch")))
1137 (format #t "applying Debian patch set '~a'...~%"
1138 patch.gz)
1139 (system (string-append "gunzip < " patch.gz " > the-patch"))
85e0dc6a
LC
1140 (and (apply-patch "the-patch")
1141 (for-each apply-patch
1142 (find-files "debian/patches"
1143 "\\.patch")))))
1144 (alist-replace
1145 'configure
1146 (lambda* (#:key outputs #:allow-other-keys)
1147 (let ((out (assoc-ref outputs "out")))
1148 (mkdir-p (string-append out "/bin"))
1149 (mkdir-p (string-append out "/sbin"))
1150
1151 ;; Pretend we have everything...
1152 (system "yes | make config")
1153
a153ff80
MW
1154 ;; ... except for the things we don't have.
1155 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1156 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1157 ;; that have been removed.
85e0dc6a 1158 (substitute* '("config.make" "config.h")
a153ff80 1159 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
c9e0a44e
LC
1160 (alist-cons-after
1161 'install 'remove-redundant-commands
1162 (lambda* (#:key outputs #:allow-other-keys)
1163 ;; Remove commands and man pages redundant with
1164 ;; Inetutils.
1165 (let* ((out (assoc-ref outputs "out"))
1166 (dup (append-map (cut find-files out <>)
1167 '("^hostname"
1168 "^(yp|nis|dns)?domainname"))))
1169 (for-each delete-file dup)
1170 #t))
1171 %standard-phases)))
85e0dc6a
LC
1172
1173 ;; Binaries that depend on libnet-tools.a don't declare that
1174 ;; dependency, making it parallel-unsafe.
1175 #:parallel-build? #f
1176
1177 #:tests? #f ; no test suite
0d55c356
MW
1178 #:make-flags (let ((out (assoc-ref %outputs "out")))
1179 (list "CC=gcc"
1180 (string-append "BASEDIR=" out)
1181 (string-append "INSTALLNLSDIR=" out "/share/locale")
1182 (string-append "mandir=/share/man")))))
85e0dc6a
LC
1183
1184 ;; Use the big Debian patch set (the thing does not even compile out of
1185 ;; the box.)
1186 (inputs `(("patch" ,(origin
1187 (method url-fetch)
1188 (uri
1189 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
1190 (sha256
1191 (base32
1192 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
b94a6ca0 1193 (native-inputs `(("gettext" ,gettext-minimal)))
85e0dc6a
LC
1194
1195 (synopsis "Tools for controlling the network subsystem in Linux")
1196 (description
1197 "This package includes the important tools for controlling the network
1198subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
1199netstat, rarp and route. Additionally, this package contains utilities
1200relating to particular network hardware types (plipconfig, slattach) and
1201advanced aspects of IP configuration (iptunnel, ipmaddr).")
3ac73271 1202 (license license:gpl2+)))
c762e82e
LC
1203
1204(define-public libcap
1205 (package
1206 (name "libcap")
68ea090b 1207 (version "2.25")
c762e82e
LC
1208 (source (origin
1209 (method url-fetch)
c762e82e 1210 (uri (string-append
f6c2d05c
LC
1211 "mirror://kernel.org/linux/libs/security/linux-privs/"
1212 "libcap2/libcap-" version ".tar.xz"))
c762e82e
LC
1213 (sha256
1214 (base32
68ea090b 1215 "0qjiqc5pknaal57453nxcbz3mn1r4hkyywam41wfcglq3v2qlg39"))))
c762e82e 1216 (build-system gnu-build-system)
6d889daf
SB
1217 (arguments '(#:phases
1218 (modify-phases %standard-phases
1219 (replace 'configure
1220 ;; Add $libdir to the RUNPATH of executables.
1221 (lambda _
1222 (substitute* "Make.Rules"
1223 (("LDFLAGS := #-g")
1224 (string-append "LDFLAGS := -Wl,-rpath="
1225 %output "/lib"))))))
c762e82e
LC
1226 #:tests? #f ; no 'check' target
1227 #:make-flags (list "lib=lib"
1228 (string-append "prefix="
1229 (assoc-ref %outputs "out"))
1230 "RAISE_SETFCAP=no")))
1231 (native-inputs `(("perl" ,perl)))
1232 (inputs `(("attr" ,attr)))
1233 (home-page "https://sites.google.com/site/fullycapable/")
1234 (synopsis "Library for working with POSIX capabilities")
1235 (description
35b9e423 1236 "Libcap2 provides a programming interface to POSIX capabilities on
c762e82e
LC
1237Linux-based operating systems.")
1238
1239 ;; License is BSD-3 or GPLv2, at the user's choice.
3ac73271 1240 (license license:gpl2)))
215b6431
LC
1241
1242(define-public bridge-utils
1243 (package
1244 (name "bridge-utils")
1245 (version "1.5")
1246 (source (origin
1247 (method url-fetch)
de67e922
LF
1248 (uri (string-append "mirror://sourceforge/bridge/bridge/"
1249 "bridge-utils-" version ".tar.gz"))
215b6431
LC
1250 (sha256
1251 (base32
1252 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1253 (build-system gnu-build-system)
1254
1255 ;; The tarball lacks all the generated files.
1256 (native-inputs `(("autoconf" ,autoconf)
1257 ("automake" ,automake)))
1258 (arguments
722ec722
MW
1259 '(#:phases (alist-cons-after
1260 'unpack 'bootstrap
215b6431 1261 (lambda _
e5c8e4f3
DT
1262 ;; Fix "field ‘ip6’ has incomplete type" errors.
1263 (substitute* "libbridge/libbridge.h"
1264 (("#include <linux/if_bridge.h>")
1265 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1266
1267 ;; Ensure that the entire build fails if one of the
1268 ;; sub-Makefiles fails.
1269 (substitute* "Makefile.in"
1270 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1271 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1272
215b6431
LC
1273 (zero? (system* "autoreconf" "-vf")))
1274 %standard-phases)
1275 #:tests? #f)) ; no 'check' target
1276
1277 (home-page
1278 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1279 (synopsis "Manipulate Ethernet bridges")
1280 (description
1281 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1282to connect two Ethernet segments together in a protocol independent way.
1283Packets are forwarded based on Ethernet address, rather than IP address (like
1284a router). Since forwarding is done at Layer 2, all protocols can go
1285transparently through a bridge.")
3ac73271 1286 (license license:gpl2+)))
3cc20675
LC
1287
1288(define-public libnl
1289 (package
1290 (name "libnl")
bdac3d4b 1291 (version "3.2.25")
3cc20675
LC
1292 (source (origin
1293 (method url-fetch)
1294 (uri (string-append
1295 "http://www.infradead.org/~tgr/libnl/files/libnl-"
1296 version ".tar.gz"))
1297 (sha256
1298 (base32
bdac3d4b 1299 "1icfrv8yihcb74as1gcgmp0wfpdq632q2zvbvqqvjms9cy87bswb"))))
3cc20675
LC
1300 (build-system gnu-build-system)
1301 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
1302 (home-page "http://www.infradead.org/~tgr/libnl/")
1303 (synopsis "NetLink protocol library suite")
1304 (description
1305 "The libnl suite is a collection of libraries providing APIs to netlink
69b4ffcf 1306protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
3cc20675
LC
1307between the kernel and user space processes. It was designed to be a more
1308flexible successor to ioctl to provide mainly networking related kernel
1309configuration and monitoring interfaces.")
1310
1311 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1312 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
3ac73271 1313 (license license:gpl2)))
023fef7d 1314
65cd77db
MW
1315(define-public iw
1316 (package
1317 (name "iw")
72f0c5ea 1318 (version "4.9")
65cd77db
MW
1319 (source (origin
1320 (method url-fetch)
1321 (uri (string-append
2f9e312a 1322 "mirror://kernel.org/software/network/iw/iw-"
65cd77db
MW
1323 version ".tar.xz"))
1324 (sha256
1325 (base32
72f0c5ea 1326 "1klpvv98bnx1zm6aqalnri2vd7w80scmdaxr2qnblb6mz82whk1j"))))
65cd77db
MW
1327 (build-system gnu-build-system)
1328 (native-inputs `(("pkg-config" ,pkg-config)))
1329 (inputs `(("libnl" ,libnl)))
1330 (arguments
1331 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1332 "CC=gcc")
1333 #:phases (alist-delete 'configure %standard-phases)))
2f9e312a 1334 (home-page "https://wireless.wiki.kernel.org/")
65cd77db
MW
1335 (synopsis "Tool for configuring wireless devices")
1336 (description
1337 "iw is a new nl80211 based CLI configuration utility for wireless
2f9e312a 1338devices. It replaces @code{iwconfig}, which is deprecated.")
3ac73271 1339 (license license:isc)))
65cd77db 1340
023fef7d
LC
1341(define-public powertop
1342 (package
1343 (name "powertop")
ebacb0de 1344 (version "2.8")
023fef7d
LC
1345 (source
1346 (origin
1347 (method url-fetch)
1348 (uri (string-append
bd60e4e2 1349 "https://01.org/sites/default/files/downloads/powertop/powertop-"
023fef7d
LC
1350 version ".tar.gz"))
1351 (sha256
1352 (base32
ebacb0de 1353 "0nlwazxbnn0k6q5f5b09wdhw0f194lpzkp3l7vxansqhfczmcyx8"))))
023fef7d 1354 (build-system gnu-build-system)
4c48bf55
ML
1355 (arguments
1356 '(#:phases
1357 (modify-phases %standard-phases
1358 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1359 ;; allow calibrating the network interface in GuixSD.
1360 (add-after 'unpack 'patch-absolute-file-names
1361 (lambda* (#:key inputs #:allow-other-keys)
1362 (let ((kmod (assoc-ref inputs "kmod")))
1363 (substitute* (find-files "src" "\\.cpp$")
1364 ;; Give the right 'modprobe' file name so that essential
1365 ;; modules such as msr.ko can be loaded.
1366 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1367 ;; These programs are only needed to calibrate, so using
1368 ;; relative file names avoids adding extra inputs. When they
1369 ;; are missing powertop gracefully handles it.
1370 (("/usr/bin/hcitool") "hcitool")
1371 (("/usr/bin/xset") "xset")
1372 (("/usr/sbin/hciconfig") "hciconfig"))
1373 #t))))))
023fef7d 1374 (inputs
4c48bf55
ML
1375 `(("kmod" ,kmod)
1376 ("libnl" ,libnl)
023fef7d 1377 ("ncurses" ,ncurses)
4c48bf55
ML
1378 ("pciutils" ,pciutils)
1379 ("zlib" ,zlib)))
c4c4cc05 1380 (native-inputs
ebacb0de 1381 `(("pkg-config" ,pkg-config)))
023fef7d
LC
1382 (home-page "https://01.org/powertop/")
1383 (synopsis "Analyze power consumption on Intel-based laptops")
1384 (description
1385 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1386power management. In addition to being a diagnostic tool, PowerTOP also has
1387an interactive mode where the user can experiment various power management
1388settings for cases where the operating system has not enabled these
1389settings.")
3ac73271 1390 (license license:gpl2)))
6869e5c9
LC
1391
1392(define-public aumix
1393 (package
1394 (name "aumix")
1395 (version "2.9.1")
1396 (source (origin
1397 (method url-fetch)
1398 (uri (string-append
1399 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1400 version ".tar.bz2"))
1401 (sha256
1402 (base32
1403 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1404 (build-system gnu-build-system)
1405 (inputs `(("ncurses" ,ncurses)))
1406 (home-page "http://www.jpj.net/~trevor/aumix.html")
1407 (synopsis "Audio mixer for X and the console")
1408 (description
1409 "Aumix adjusts an audio mixer from X, the console, a terminal,
1410the command line or a script.")
3ac73271 1411 (license license:gpl2+)))
7c0dbe78
SHT
1412
1413(define-public iotop
1414 (package
1415 (name "iotop")
1416 (version "0.6")
1417 (source
1418 (origin
1419 (method url-fetch)
1420 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1421 version ".tar.gz"))
1422 (sha256 (base32
1423 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1424 (build-system python-build-system)
1425 (arguments
35cebf01 1426 ;; The setup.py script expects python-2.
7c0dbe78 1427 `(#:python ,python-2
35cebf01 1428 ;; There are currently no checks in the package.
7c0dbe78
SHT
1429 #:tests? #f))
1430 (native-inputs `(("python" ,python-2)))
1431 (home-page "http://guichaz.free.fr/iotop/")
1432 (synopsis
1433 "Displays the IO activity of running processes")
1434 (description
1435 "Iotop is a Python program with a top like user interface to show the
1436processes currently causing I/O.")
3ac73271 1437 (license license:gpl2+)))
e30835e2
LC
1438
1439(define-public fuse
1440 (package
1441 (name "fuse")
436c0558 1442 (version "2.9.7")
e30835e2
LC
1443 (source (origin
1444 (method url-fetch)
0e9bc883
LF
1445 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1446 "download/fuse-" version
1447 "/fuse-" version ".tar.gz"))
e30835e2
LC
1448 (sha256
1449 (base32
436c0558 1450 "0x486nri30f7cgy0acj87v9sjxsjrr0cymrvw4h3r0sgmp8k4943"))
cd48a549 1451 (patches (search-patches "fuse-overlapping-headers.patch"))))
e30835e2 1452 (build-system gnu-build-system)
b148bd71 1453 (inputs `(("util-linux" ,util-linux)))
e30835e2
LC
1454 (arguments
1455 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1456 (assoc-ref %outputs "out")
1457 "/sbin")
1458 (string-append "INIT_D_PATH="
1459 (assoc-ref %outputs "out")
1460 "/etc/init.d")
9a4efac9
LC
1461
1462 ;; The rule makes /dev/fuse 666.
e30835e2
LC
1463 (string-append "UDEV_RULES_PATH="
1464 (assoc-ref %outputs "out")
9a4efac9 1465 "/lib/udev/rules.d"))
b148bd71
LC
1466 #:phases (alist-cons-before
1467 'build 'set-file-names
1468 (lambda* (#:key inputs #:allow-other-keys)
1469 ;; libfuse calls out to mount(8) and umount(8). Make sure
1470 ;; it refers to the right ones.
1471 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1472 (("/bin/(u?)mount" _ maybe-u)
1473 (string-append (assoc-ref inputs "util-linux")
1474 "/bin/" maybe-u "mount")))
1475 (substitute* '("util/mount.fuse.c")
1476 (("/bin/sh")
bd663902
LC
1477 (which "sh")))
1478
1479 ;; This hack leads libfuse to search for 'fusermount' in
1480 ;; $PATH, where it may find a setuid-root binary, instead of
1481 ;; trying solely $out/sbin/fusermount and failing because
1482 ;; it's not setuid.
1483 (substitute* "lib/Makefile"
1484 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1485 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
b148bd71 1486 %standard-phases)))
0e9bc883 1487 (home-page "https://github.com/libfuse/libfuse")
e30835e2
LC
1488 (synopsis "Support file systems implemented in user space")
1489 (description
1490 "As a consequence of its monolithic design, file system code for Linux
1491normally goes into the kernel itself---which is not only a robustness issue,
1492but also an impediment to system extensibility. FUSE, for \"file systems in
1493user space\", is a kernel module and user-space library that tries to address
1494part of this problem by allowing users to run file system implementations as
1495user-space processes.")
3ac73271
LC
1496 (license (list license:lgpl2.1 ;library
1497 license:gpl2+)))) ;command-line utilities
220193ad
LC
1498
1499(define-public unionfs-fuse
1500 (package
1501 (name "unionfs-fuse")
2f861edf 1502 (version "2.0")
220193ad
LC
1503 (source (origin
1504 (method url-fetch)
1505 (uri (string-append
2f861edf
EF
1506 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
1507 version ".tar.gz"))
1508 (file-name (string-append name "-" version ".tar.gz"))
220193ad
LC
1509 (sha256
1510 (base32
2f861edf 1511 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
220193ad 1512 (build-system cmake-build-system)
094f4b53
EF
1513 (native-inputs
1514 `(("python" ,python)
1515 ("python-pytest" ,python-pytest)))
220193ad 1516 (inputs `(("fuse" ,fuse)))
094f4b53
EF
1517 (arguments
1518 '(#:phases
1519 (modify-phases %standard-phases
1520 (replace 'check
1521 ;; Borrowed from the Makefile
1522 (lambda _ (zero? (system* "python3" "-m" "pytest")))))))
2f861edf 1523 (home-page "https://github.com/rpodgorny/unionfs-fuse")
220193ad
LC
1524 (synopsis "User-space union file system")
1525 (description
1526 "UnionFS-FUSE is a flexible union file system implementation in user
1527space, using the FUSE library. Mounting a union file system allows you to
1528\"aggregate\" the contents of several directories into a single mount point.
1529UnionFS-FUSE additionally supports copy-on-write.")
3ac73271 1530 (license license:bsd-3)))
ed748588 1531
0b7a0c20
LC
1532(define fuse-static
1533 (package (inherit fuse)
1534 (name "fuse-static")
1535 (source (origin (inherit (package-source fuse))
1536 (modules '((guix build utils)))
1537 (snippet
1538 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1539 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1540 ;; it doesn't do that, allowing us to remove the dependency on
1541 ;; util-linux (something that is useful in initrds.)
1542 '(substitute* '("lib/mount_util.c"
1543 "util/mount_util.c")
1544 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1545 "0")
1546 (("/bin/")
1547 "")))))))
1548
ed748588
LC
1549(define-public unionfs-fuse/static
1550 (package (inherit unionfs-fuse)
1551 (synopsis "User-space union file system (statically linked)")
1552 (name (string-append (package-name unionfs-fuse) "-static"))
1553 (source (origin (inherit (package-source unionfs-fuse))
1554 (modules '((guix build utils)))
1555 (snippet
1556 ;; Add -ldl to the libraries, because libfuse.a needs that.
1557 '(substitute* "src/CMakeLists.txt"
1558 (("target_link_libraries(.*)\\)" _ libs)
1559 (string-append "target_link_libraries"
1560 libs " dl)"))))))
1561 (arguments
1562 '(#:tests? #f
1456cff1
LC
1563 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1564 #:phases (alist-cons-after
1565 'install 'post-install
1566 (lambda* (#:key outputs #:allow-other-keys)
1567 (let* ((out (assoc-ref outputs "out"))
1568 (exe (string-append out "/bin/unionfs")))
1569 ;; By default, 'unionfs' keeps references to
1570 ;; $glibc/share/locale and similar stuff. Remove them.
9f8d6eb2
LC
1571 (remove-store-references exe)
1572
1573 ;; 'unionfsctl' has references to glibc as well. Since
1574 ;; we don't need it, remove it.
1575 (delete-file (string-append out "/bin/unionfsctl"))
1576 #t))
1456cff1 1577 %standard-phases)))
0b7a0c20 1578 (inputs `(("fuse" ,fuse-static)))))
67b66003 1579
db288efa
LC
1580(define-public sshfs-fuse
1581 (package
1582 (name "sshfs-fuse")
f5c6edd6 1583 (version "2.9")
db288efa
LC
1584 (source (origin
1585 (method url-fetch)
b58c1b2d 1586 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
f5c6edd6
TGR
1587 "download/sshfs-" version "/sshfs-" version
1588 ".tar.gz"))
db288efa
LC
1589 (sha256
1590 (base32
f5c6edd6 1591 "1pp5wsl1jx11apkv2fpp559miifqhi8ka400npy5awp9ghlf3la6"))))
db288efa
LC
1592 (build-system gnu-build-system)
1593 (inputs
1594 `(("fuse" ,fuse)
1595 ("glib" ,glib)))
1596 (native-inputs
1597 `(("pkg-config" ,pkg-config)))
f5c6edd6 1598 (home-page "https://github.com/libfuse/sshfs")
db288efa
LC
1599 (synopsis "Mount remote file systems over SSH")
1600 (description
1601 "This is a file system client based on the SSH File Transfer Protocol.
1602Since most SSH servers already support this protocol it is very easy to set
1603up: on the server side there's nothing to do; on the client side mounting the
1604file system is as easy as logging into the server with an SSH client.")
3ac73271 1605 (license license:gpl2+)))
db288efa 1606
67b66003
LC
1607(define-public numactl
1608 (package
1609 (name "numactl")
e35dff97 1610 (version "2.0.11")
67b66003
LC
1611 (source (origin
1612 (method url-fetch)
1613 (uri (string-append
1614 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1615 version
1616 ".tar.gz"))
1617 (sha256
1618 (base32
e35dff97 1619 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
67b66003
LC
1620 (build-system gnu-build-system)
1621 (arguments
e35dff97 1622 '(;; There's a 'test' target, but it requires NUMA support in the kernel
67b66003
LC
1623 ;; to run, which we can't assume to have.
1624 #:tests? #f))
b0015064 1625
35dfcdd7
AE
1626 ;; NUMA is apparently not supported on armhf, see
1627 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1628 (supported-systems (delete "armhf-linux" %supported-systems))
67b66003
LC
1629 (home-page "http://oss.sgi.com/projects/libnuma/")
1630 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1631 (description
1632 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1633memory is not all in one place. The numactl program allows you to run your
1634application program on specific CPU's and memory nodes. It does this by
1635supplying a NUMA memory policy to the operating system before running your
1636program.
1637
1638The package contains other commands, such as numademo, numastat and memhog.
1639The numademo command provides a quick overview of NUMA performance on your
1640system.")
3ac73271
LC
1641 (license (list license:gpl2 ;programs
1642 license:lgpl2.1)))) ;library
b10e9ff6
LC
1643
1644(define-public kbd
1645 (package
1646 (name "kbd")
8555a609 1647 (version "2.0.4")
b10e9ff6
LC
1648 (source (origin
1649 (method url-fetch)
1650 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
710b4928 1651 version ".tar.xz"))
b10e9ff6
LC
1652 (sha256
1653 (base32
8555a609 1654 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
c8f60748
LC
1655 (modules '((guix build utils)))
1656 (snippet
f2cdcafb
LC
1657 '(begin
1658 (substitute* "tests/Makefile.in"
1659 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1660 (("@VERSION@")
1661 "[@]VERSION[@]"))
1662 (substitute* '("src/unicode_start" "src/unicode_stop")
1663 ;; Assume the Coreutils are in $PATH.
1664 (("/usr/bin/tty")
1665 "tty"))))))
b10e9ff6
LC
1666 (build-system gnu-build-system)
1667 (arguments
5953d2b7
AK
1668 '(#:phases
1669 (modify-phases %standard-phases
1670 (add-before 'build 'pre-build
1671 (lambda* (#:key inputs #:allow-other-keys)
1672 (let ((gzip (assoc-ref %build-inputs "gzip"))
1673 (bzip2 (assoc-ref %build-inputs "bzip2")))
1674 (substitute* "src/libkeymap/findfile.c"
1675 (("gzip")
1676 (string-append gzip "/bin/gzip"))
1677 (("bzip2")
1678 (string-append bzip2 "/bin/bzip2"))))))
1679 (add-after 'install 'post-install
1680 (lambda* (#:key outputs #:allow-other-keys)
1681 ;; Make sure these programs find their comrades.
1682 (let* ((out (assoc-ref outputs "out"))
1683 (bin (string-append out "/bin")))
1684 (for-each (lambda (prog)
1685 (wrap-program (string-append bin "/" prog)
1686 `("PATH" ":" prefix (,bin))))
1687 '("unicode_start" "unicode_stop"))))))))
b10e9ff6 1688 (inputs `(("check" ,check)
f61e0e79
LC
1689 ("gzip" ,gzip)
1690 ("bzip2" ,bzip2)
b10e9ff6
LC
1691 ("pam" ,linux-pam)))
1692 (native-inputs `(("pkg-config" ,pkg-config)))
0ed81d04 1693 (home-page "http://kbd-project.org/")
b10e9ff6
LC
1694 (synopsis "Linux keyboard utilities and keyboard maps")
1695 (description
1696 "This package contains keytable files and keyboard utilities compatible
1697for systems using the Linux kernel. This includes commands such as
1698'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
3ac73271 1699 (license license:gpl2+)))
de0b620e
LC
1700
1701(define-public inotify-tools
1702 (package
1703 (name "inotify-tools")
1704 (version "3.13")
1705 (source (origin
1706 (method url-fetch)
1707 (uri (string-append
1708 "mirror://sourceforge/inotify-tools/inotify-tools/"
1709 version "/inotify-tools-" version ".tar.gz"))
1710 (sha256
1711 (base32
1712 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1713 (build-system gnu-build-system)
1714 (home-page "http://inotify-tools.sourceforge.net/")
1715 (synopsis "Monitor file accesses")
1716 (description
1717 "The inotify-tools packages provides a C library and command-line tools
1718to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3ac73271 1719 (license license:gpl2+)))
e062d542
AE
1720
1721(define-public kmod
1722 (package
1723 (name "kmod")
b9375d89 1724 (version "24")
e062d542
AE
1725 (source (origin
1726 (method url-fetch)
1727 (uri
1728 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1729 "kmod-" version ".tar.xz"))
1730 (sha256
1731 (base32
b9375d89 1732 "15xkkkzvca9flvkm48gkh8y8f13vlm3sl7nz9ydc7b3jy4fqs2v1"))
fc1adab1 1733 (patches (search-patches "kmod-module-directory.patch"))))
e062d542
AE
1734 (build-system gnu-build-system)
1735 (native-inputs
1736 `(("pkg-config" ,pkg-config)))
1737 (inputs
f61e0e79
LC
1738 `(("xz" ,xz)
1739 ("zlib" ,zlib)))
e062d542
AE
1740 (arguments
1741 `(#:tests? #f ; FIXME: Investigate test failures
4a8b4c25
LC
1742 #:configure-flags '("--with-xz" "--with-zlib")
1743 #:phases (alist-cons-after
1744 'install 'install-modprobe&co
1745 (lambda* (#:key outputs #:allow-other-keys)
1746 (let* ((out (assoc-ref outputs "out"))
1747 (bin (string-append out "/bin")))
1748 (for-each (lambda (tool)
1749 (symlink "kmod"
1750 (string-append bin "/" tool)))
1751 '("insmod" "rmmod" "lsmod" "modprobe"
1752 "modinfo" "depmod"))))
1753 %standard-phases)))
e062d542
AE
1754 (home-page "https://www.kernel.org/")
1755 (synopsis "Kernel module tools")
35b9e423 1756 (description "Kmod is a set of tools to handle common tasks with Linux
e062d542
AE
1757kernel modules like insert, remove, list, check properties, resolve
1758dependencies and aliases.
1759
1760These tools are designed on top of libkmod, a library that is shipped with
1761kmod. The aim is to be compatible with tools, configurations and indices
1762from the module-init-tools project.")
3ac73271 1763 (license license:gpl2+))) ; library under lgpl2.1+
d7d42d6b 1764
7fa715e7
LC
1765(define-public eudev
1766 ;; The post-systemd fork, maintained by Gentoo.
fe32c7f7 1767 (package
7fa715e7 1768 (name "eudev")
37861864 1769 (version "3.2.1")
7fa715e7
LC
1770 (source (origin
1771 (method url-fetch)
1772 (uri (string-append
1773 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1774 version ".tar.gz"))
1775 (sha256
1776 (base32
37861864 1777 "06gyyl90n85x8i7lfhns514y1kg1ians13l467admyzy3kjxkqsp"))
f0a01af5
LF
1778 (patches (search-patches "eudev-rules-directory.patch"
1779 "eudev-conflicting-declaration.patch"))))
fe32c7f7
MW
1780 (build-system gnu-build-system)
1781 (native-inputs
1782 `(("pkg-config" ,pkg-config)
e75230c1
SB
1783 ("perl" ,perl)
1784 ("gperf" ,gperf)))
fe32c7f7 1785 (inputs
255f7308
LC
1786 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
1787 ;; and similar; it also installs the '60-persistent-storage.rules' file,
1788 ;; which contains the rules to do that.
1789 `(("util-linux" ,util-linux) ;for blkid
1790 ("kmod" ,kmod)))
e1921a38 1791 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
fe32c7f7
MW
1792 (synopsis "Userspace device management")
1793 (description "Udev is a daemon which dynamically creates and removes
1794device nodes from /dev/, handles hotplug events and loads drivers at boot
1795time.")
3ac73271 1796 (license license:gpl2+)))
7fa715e7 1797
e5d861f3
LC
1798(define-public eudev-with-hwdb
1799 ;; TODO: Merge with 'eudev'.
1800 (package
1801 (inherit eudev)
1802 (name "eudev-with-hwdb")
1803 (arguments
1804 '(#:phases (modify-phases %standard-phases
1805 (add-after 'install 'build-hwdb
1806 (lambda* (#:key outputs #:allow-other-keys)
1807 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
1808 ;; similar tools to display product names.
1809 (let ((out (assoc-ref outputs "out")))
1810 (zero? (system* (string-append out "/bin/udevadm")
1811 "hwdb" "--update"))))))))))
1812
66269d47
LC
1813(define-public lvm2
1814 (package
1815 (name "lvm2")
62ec02bf 1816 (version "2.02.171")
66269d47
LC
1817 (source (origin
1818 (method url-fetch)
1819 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1820 version ".tgz"))
1821 (sha256
1822 (base32
62ec02bf 1823 "0r4r9fsvpj9hjmf0zz7h4prz12r6y16jhjhsvk1sbfpsl88sf5dq"))
66269d47
LC
1824 (modules '((guix build utils)))
1825 (snippet
1826 '(begin
1827 (use-modules (guix build utils))
1828
1829 ;; Honor sysconfdir.
1830 (substitute* "make.tmpl.in"
1831 (("confdir = .*$")
1832 "confdir = @sysconfdir@\n")
1833 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
01f94cca
LC
1834 "DEFAULT_SYS_DIR = @sysconfdir@"))))
1835 (patches (search-patches "lvm2-static-link.patch"))))
66269d47
LC
1836 (build-system gnu-build-system)
1837 (native-inputs
1838 `(("pkg-config" ,pkg-config)
1839 ("procps" ,procps))) ;tests use 'pgrep'
1840 (inputs
8fcaf8b1 1841 `(("udev" ,eudev)))
66269d47 1842 (arguments
3afbc6b3
LF
1843 '(#:phases
1844 (modify-phases %standard-phases
1845 (add-after 'configure 'set-makefile-shell
1846 (lambda _
1847 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1848 ;; expected.
1849 (setenv "SHELL" (which "sh"))
66269d47 1850
3afbc6b3
LF
1851 ;; Replace /bin/sh with the right file name.
1852 (patch-makefile-SHELL "make.tmpl")
7ca97fae
LF
1853 #t))
1854 (add-before 'strip 'make-objects-writable
1855 (lambda* (#:key outputs #:allow-other-keys)
1856 ;; Make compiled objects writable so they can be stripped.
1857 (let ((out (assoc-ref outputs "out")))
1858 (for-each (lambda (file)
1859 (chmod file #o755))
1860 (append
1861 (find-files (string-append out "/lib"))
1862 (find-files (string-append out "/sbin"))))
1863 #t))))
66269d47
LC
1864
1865 #:configure-flags (list (string-append "--sysconfdir="
1866 (assoc-ref %outputs "out")
1867 "/etc/lvm")
1868 "--enable-udev_sync"
f2817d43
LC
1869 "--enable-udev_rules"
1870
1871 ;; Make sure programs such as 'dmsetup' can
1872 ;; find libdevmapper.so.
1873 (string-append "LDFLAGS=-Wl,-rpath="
1874 (assoc-ref %outputs "out")
1875 "/lib"))
66269d47
LC
1876
1877 ;; The tests use 'mknod', which requires root access.
1878 #:tests? #f))
62ec02bf 1879 (home-page "https://sourceware.org/lvm2/")
66269d47
LC
1880 (synopsis "Logical volume management for Linux")
1881 (description
1882 "LVM2 is the logical volume management tool set for Linux-based systems.
1883This package includes the user-space libraries and tools, including the device
1884mapper. Kernel components are part of Linux-libre.")
1885
1886 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
1887 ;; Command-line tools are GPLv2.
3ac73271 1888 (license (list license:gpl2 license:lgpl2.1))))
66269d47 1889
01f94cca
LC
1890(define-public lvm2-static
1891 (package
1892 (inherit lvm2)
1893 (name "lvm2-static")
1894
1895 ;; Propagate udev because libdevmapper.a depends on libudev.
1896 (inputs (alist-delete "udev" (package-inputs lvm2)))
1897 (propagated-inputs `(("udev" ,eudev)))
1898
1899 (arguments
1900 (substitute-keyword-arguments (package-arguments lvm2)
1901 ((#:configure-flags flags '())
1902 ;; LVM2 doesn't use Libtool, hence the custom option.
1903 `(cons "--enable-static_link" ,flags))))
1904 (synopsis "Logical volume management for Linux (statically linked)")))
1905
000f7559
DT
1906(define-public wireless-tools
1907 (package
1908 (name "wireless-tools")
1909 (version "30.pre9")
1910 (source (origin
1911 (method url-fetch)
1912 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
1913 version ".tar.gz"))
1914 (sha256
1915 (base32
ec01f22d 1916 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
ec01f22d 1917 (snippet
c2099a4c
MW
1918 '(begin
1919 ;; Remove the older header files that are not free software.
1920 (for-each (lambda (n)
1921 (delete-file (format #f "wireless.~a.h" n)))
1922 '(10 11 12 13 14 15 16 17 18 19 20))
1923 #t))))
000f7559
DT
1924 (build-system gnu-build-system)
1925 (arguments
c2099a4c
MW
1926 `(#:make-flags
1927 (list (string-append "PREFIX=" %output)
1928 (string-append "INSTALL_MAN=" %output "/share/man")
1929 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
1930 "BUILD_STATIC=")
1931 #:phases (modify-phases %standard-phases
1932 (delete 'configure))
000f7559
DT
1933 #:tests? #f))
1934 (synopsis "Tools for manipulating Linux Wireless Extensions")
fb9b7ce2
LC
1935 (description "Wireless Tools are used to manipulate the now-deprecated
1936Linux Wireless Extensions; consider using 'iw' instead. The Wireless
1937Extension was an interface allowing you to set Wireless LAN specific
1938parameters and get the specific stats. It is deprecated in favor the nl80211
1939interface.")
000f7559 1940 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
c2099a4c
MW
1941 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
1942 ;; other files are distributed under gpl2.
3ac73271 1943 (license (list license:gpl2 license:lgpl2.1+))))
30016044 1944
cc205dac
LC
1945(define-public crda
1946 (package
1947 (name "crda")
1948 (version "3.18")
1949 (source (origin
1950 (method url-fetch)
1951 (uri (string-append "mirror://kernel.org/software/network/crda/"
1952 "crda-" version ".tar.xz"))
1953 (sha256
1954 (base32
1955 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
fc1adab1 1956 (patches (search-patches "crda-optional-gcrypt.patch"))))
cc205dac
LC
1957 (build-system gnu-build-system)
1958 (arguments
1959 '(#:phases (modify-phases %standard-phases
1960 (delete 'configure)
1961 (add-before
1962 'build 'no-werror-no-ldconfig
1963 (lambda _
1964 (substitute* "Makefile"
1965 (("-Werror") "")
1966 (("ldconfig") "true"))
1967 #t))
1968 (add-before
1969 'build 'set-regulator-db-file-name
1970 (lambda* (#:key inputs #:allow-other-keys)
1971 ;; Tell CRDA where to find our database.
1972 (let ((regdb (assoc-ref inputs "wireless-regdb")))
1973 (substitute* "crda.c"
1974 (("\"/lib/crda/regulatory.bin\"")
1975 (string-append "\"" regdb
1976 "/lib/crda/regulatory.bin\"")))
1977 #t))))
1978 #:test-target "verify"
1979 #:make-flags (let ((out (assoc-ref %outputs "out"))
1980 (regdb (assoc-ref %build-inputs "wireless-regdb")))
1981 (list "CC=gcc" "V=1"
1982
1983 ;; Disable signature-checking on 'regulatory.bin'.
1984 ;; The reason is that this simplifies maintenance
1985 ;; on our side (no need to manage a distro key
1986 ;; pair), and we can guarantee integrity of
1987 ;; 'regulatory.bin' by other means anyway, such as
1988 ;; 'guix gc --verify'. See
1989 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
1990 ;; for a discssion.
1991 "USE_OPENSSL=0"
1992
1993 (string-append "PREFIX=" out)
1994 (string-append "SBINDIR=" out "/sbin/")
1995 (string-append "UDEV_RULE_DIR="
1996 out "/lib/udev/rules.d")
1997 (string-append "LDFLAGS=-Wl,-rpath="
1998 out "/lib -L.")
1999 (string-append "REG_BIN=" regdb
2000 "/lib/crda/regulatory.bin")))))
2001 (native-inputs `(("pkg-config" ,pkg-config)
2002 ("python" ,python-2)
2003 ("wireless-regdb" ,wireless-regdb)))
2004 (inputs `(("libnl" ,libnl)))
2005 (home-page
2006 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2007 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2008 (description
2009 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2010communication between the kernel Linux and user space for regulatory
2011compliance.")
3ac73271 2012 (license license:copyleft-next)))
cc205dac 2013
c80b4a3e
LC
2014(define-public wireless-regdb
2015 (package
2016 (name "wireless-regdb")
a70782d3 2017 (version "2017.03.07")
c80b4a3e
LC
2018 (source (origin
2019 (method url-fetch)
2020 (uri (string-append
2021 "mirror://kernel.org/software/network/wireless-regdb/"
2022 "wireless-regdb-" version ".tar.xz"))
2023 (sha256
2024 (base32
a70782d3 2025 "1f9mcp78sdd4sci6v32vxfcl1rfjpv205jisz1p93kkfnaisy7ip"))
5568151f
LC
2026
2027 ;; We're building 'regulatory.bin' by ourselves.
2028 (snippet '(delete-file "regulatory.bin"))))
c80b4a3e
LC
2029 (build-system gnu-build-system)
2030 (arguments
2031 '(#:phases (modify-phases %standard-phases
2032 (delete 'configure))
5568151f
LC
2033
2034 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2035 ;; is computed and can be equal to 'maintainer-clean'; when that
2036 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2037 ;; just built. Thus, build things sequentially.
2038 #:parallel-build? #f
2039
c80b4a3e
LC
2040 #:tests? #f ;no tests
2041 #:make-flags (let ((out (assoc-ref %outputs "out")))
2042 (list (string-append "PREFIX=" out)
2043 (string-append "LSB_ID=GuixSD")
2044 (string-append "DISTRO_PUBKEY=/dev/null")
2045 (string-append "DISTRO_PRIVKEY=/dev/null")
2046 (string-append "REGDB_PUBKEY=/dev/null")
2047
2048 ;; Leave that empty so that db2bin.py doesn't try
2049 ;; to sign 'regulatory.bin'. This allows us to
2050 ;; avoid managing a key pair for the whole distro.
2051 (string-append "REGDB_PRIVKEY=")))))
2052 (native-inputs `(("python" ,python-2)))
2053 (home-page
2054 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2055 (synopsis "Wireless regulatory database")
2056 (description
2057 "This package contains the wireless regulatory database Central
2058Regulatory Database Agent (CRDA) daemon. The database contains information on
2059country-specific regulations for the wireless spectrum.")
3ac73271 2060 (license license:isc)))
c80b4a3e 2061
30016044
MW
2062(define-public lm-sensors
2063 (package
2064 (name "lm-sensors")
171091a8 2065 (version "3.4.0")
30016044
MW
2066 (source (origin
2067 (method url-fetch)
ee6a5d0e 2068 (uri (list (string-append
171091a8
AE
2069 "https://github.com/groeck/lm-sensors/archive/V"
2070 (string-join (string-split version #\.) "-")
2071 ".tar.gz")))
bc4a2b85 2072 (file-name (string-append name "-" version ".tar.gz"))
30016044
MW
2073 (sha256
2074 (base32
171091a8 2075 "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
fc1adab1 2076 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
30016044
MW
2077 (build-system gnu-build-system)
2078 (inputs `(("rrdtool" ,rrdtool)
2079 ("perl" ,perl)
2080 ("kmod" ,kmod)
2081 ("gnuplot" ,gnuplot)))
2082 (native-inputs `(("pkg-config" ,pkg-config)
2083 ("flex" ,flex)
2084 ("bison" ,bison)
2085 ("which" ,which)))
2086 (arguments
2087 `(#:tests? #f ; no 'check' target
2088 #:make-flags (list (string-append "PREFIX=" %output)
2089 (string-append "ETCDIR=" %output "/etc")
2090 (string-append "MANDIR=" %output "/share/man"))
2091 #:phases
2092 (alist-delete
2093 'configure
2094 (alist-cons-before
2095 'build 'patch-exec-paths
2096 (lambda* (#:key inputs outputs #:allow-other-keys)
2097 (substitute* "prog/detect/sensors-detect"
2098 (("`uname")
2099 (string-append "`" (assoc-ref inputs "coreutils")
2100 "/bin/uname"))
2101 (("(`|\")modprobe" all open-quote)
2102 (string-append open-quote
2103 (assoc-ref inputs "kmod")
2104 "/bin/modprobe")))
2105 (substitute* '("prog/pwm/pwmconfig"
2106 "prog/pwm/fancontrol")
2107 (("gnuplot")
2108 (string-append (assoc-ref inputs "gnuplot")
2109 "/bin/gnuplot"))
2110 (("cat ")
2111 (string-append (assoc-ref inputs "coreutils")
2112 "/bin/cat "))
2113 (("egrep ")
2114 (string-append (assoc-ref inputs "grep")
2115 "/bin/egrep "))
2116 (("sed -e")
2117 (string-append (assoc-ref inputs "sed")
2118 "/bin/sed -e"))
2119 (("cut -d")
2120 (string-append (assoc-ref inputs "coreutils")
2121 "/bin/cut -d"))
2122 (("sleep ")
2123 (string-append (assoc-ref inputs "coreutils")
2124 "/bin/sleep "))
2125 (("readlink -f")
2126 (string-append (assoc-ref inputs "coreutils")
2127 "/bin/readlink -f"))))
2128 %standard-phases))))
3a04d5d4 2129 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
30016044
MW
2130 (synopsis "Utilities to read temperature/voltage/fan sensors")
2131 (description
35b9e423 2132 "Lm-sensors is a hardware health monitoring package for Linux. It allows
30016044
MW
2133you to access information from temperature, voltage, and fan speed sensors.
2134It works with most newer systems.")
3ac73271 2135 (license license:gpl2+)))
b087d413 2136
f5b2a53d
RW
2137(define-public i2c-tools
2138 (package
2139 (name "i2c-tools")
2140 (version "3.1.1")
2141 (source (origin
2142 (method url-fetch)
2143 (uri (string-append
f32274a7 2144 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
f5b2a53d
RW
2145 version ".tar.bz2"))
2146 (sha256
2147 (base32
2148 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2149 (build-system gnu-build-system)
2150 (arguments
2151 `(#:tests? #f ; no 'check' target
2152 #:make-flags (list (string-append "prefix=" %output)
2153 "CC=gcc")
2154 ;; no configure script
2155 #:phases (alist-delete 'configure %standard-phases)))
bccf27cb
RW
2156 (inputs
2157 `(("perl" ,perl)))
f32274a7 2158 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
f5b2a53d
RW
2159 (synopsis "I2C tools for Linux")
2160 (description
2161 "The i2c-tools package contains a heterogeneous set of I2C tools for
2162Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2163EEPROM decoding scripts, EEPROM programming tools, and a python module for
2164SMBus access.")
3ac73271 2165 (license license:gpl2+)))
f5b2a53d 2166
b087d413
MW
2167(define-public xsensors
2168 (package
2169 (name "xsensors")
2170 (version "0.70")
2171 (source (origin
2172 (method url-fetch)
2173 (uri (string-append
2174 "http://www.linuxhardware.org/xsensors/xsensors-"
2175 version ".tar.gz"))
2176 (sha256
2177 (base32
2178 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2179 (build-system gnu-build-system)
2180 (inputs `(("lm-sensors" ,lm-sensors)
2181 ("gtk" ,gtk+-2)))
2182 (native-inputs `(("pkg-config" ,pkg-config)))
2183 (arguments
2184 `(#:phases (alist-cons-before
2185 'configure 'enable-deprecated
2186 (lambda _
2187 (substitute* "src/Makefile.in"
2188 (("-DGDK_DISABLE_DEPRECATED") "")
2189 (("-DGTK_DISABLE_DEPRECATED") "")))
2190 (alist-cons-before
2191 'configure 'remove-Werror
2192 (lambda _
2193 (substitute* '("configure" "src/Makefile.in")
2194 (("-Werror") "")))
2195 %standard-phases))))
2196 (home-page "http://www.linuxhardware.org/xsensors/")
2197 (synopsis "Hardware health information viewer")
2198 (description
35b9e423 2199 "Xsensors reads data from the libsensors library regarding hardware
b087d413
MW
2200health such as temperature, voltage and fan speed and displays the information
2201in a digital read-out.")
3ac73271 2202 (license license:gpl2+)))
b62fe07f
LC
2203
2204(define-public perf
2205 (package
2206 (name "perf")
2207 (version (package-version linux-libre))
2208 (source (package-source linux-libre))
2209 (build-system gnu-build-system)
2210 (arguments
2211 '(#:phases (alist-replace
2212 'configure
2213 (lambda* (#:key inputs #:allow-other-keys)
2214 (setenv "SHELL_PATH" (which "bash"))
2215 (chdir "tools/perf"))
2216 %standard-phases)
2217 #:make-flags (list (string-append "DESTDIR="
2218 (assoc-ref %outputs "out"))
2af29d23
LC
2219 "WERROR=0"
2220
2221 ;; By default, 'config/Makefile' uses lib64 on
2222 ;; x86_64. Work around that.
2223 "lib=lib")
b62fe07f
LC
2224 #:tests? #f)) ;no tests
2225 (native-inputs
2226 `(("pkg-config" ,pkg-config)
2227 ("bison" ,bison)
2228 ("flex" ,flex)
2229
2230 ;; There are build scripts written in these languages.
2231 ("perl" ,perl)
2232 ("python" ,python-2)))
2233 (inputs
b1fb4b23 2234 `(("slang" ,slang) ;for the interactive TUI
b62fe07f 2235 ;; ("newt" ,newt)
6c030d10 2236 ("python" ,python-2) ;'perf' links against libpython
b62fe07f 2237 ("elfutils" ,elfutils)
b25d3bd9 2238 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
b62fe07f 2239
d7ece67a
LC
2240 ;; Documentation.
2241 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
d7ece67a
LC
2242 ("docbook-xsl" ,docbook-xsl)
2243 ("xmlto" ,xmlto)
2244 ("asciidoc" ,asciidoc)))
b62fe07f
LC
2245 (home-page "https://perf.wiki.kernel.org/")
2246 (synopsis "Linux profiling with performance counters")
2247 (description
2248 "perf is a tool suite for profiling using hardware performance counters,
2249with support in the Linux kernel. perf can instrument CPU performance
2250counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2251of lightweight profiling. This package contains the user-land tools and in
2252particular the 'perf' command.")
2253 (license (package-license linux-libre))))
c09e60e4
DT
2254
2255(define-public pflask
2256 (package
2257 (name "pflask")
2258 (version "0.2")
2259 (source (origin
2260 (method url-fetch)
2261 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2262 version ".tar.gz"))
f586c877 2263 (file-name (string-append name "-" version ".tar.gz"))
c09e60e4
DT
2264 (sha256
2265 (base32
2266 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2267 (build-system cmake-build-system)
2268 (arguments
2269 '(#:tests? #f)) ; no tests
2270 (home-page "http://ghedo.github.io/pflask/")
2271 (synopsis "Simple tool for creating Linux namespace containers")
2272 (description "pflask is a simple tool for creating Linux namespace
2273containers. It can be used for running a command or even booting an OS inside
2274an isolated container, created with the help of Linux namespaces. It is
2275similar in functionality to chroot, although pflask provides better isolation
2276thanks to the use of namespaces.")
3ac73271 2277 (license license:bsd-2)))
288084d5
MW
2278
2279(define-public hdparm
2280 (package
2281 (name "hdparm")
8a1bb378 2282 (version "9.52")
288084d5
MW
2283 (source (origin
2284 (method url-fetch)
de67e922 2285 (uri (string-append "mirror://sourceforge/" name "/" name "/"
288084d5
MW
2286 name "-" version ".tar.gz"))
2287 (sha256
2288 (base32
8a1bb378 2289 "1djgxhfadd865dcrl6dp7dvjxpaisy7mk17mbdbglwg24ga9qhn3"))))
288084d5
MW
2290 (build-system gnu-build-system)
2291 (arguments
2292 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2293 (list (string-append "binprefix=" out)
2294 (string-append "manprefix=" out)
2295 "CC=gcc"))
ec238332
TGR
2296 #:phases
2297 (modify-phases %standard-phases
2298 (delete 'configure)) ; no configure script
2299 #:tests? #f)) ; no test suite
3b3b60d0 2300 (home-page "https://sourceforge.net/projects/hdparm/")
02052b2c 2301 (synopsis "View and tune ATA disk drive parameters")
288084d5 2302 (description
02052b2c
TGR
2303 "@command{hdparm} is a command-line utility to control ATA controllers and
2304disk drives. It can increase performance and/or reliability by careful tuning
2305of hardware settings like power and acoustic management, DMA modes, and caching.
2306It can also display detailed device information, or be used as a simple
2307performance benchmarking tool.
2308
2309@command{hdparm} provides a command line interface to various Linux kernel
2310interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
2311IDE driver subsystem. Many external USB drive enclosures with @dfn{SCSI-ATA
2312Command Translation} (SAT) are also supported.")
3ac73271 2313 (license (license:non-copyleft "file://LICENSE.TXT"))))
288084d5 2314
c755c854
MW
2315(define-public rfkill
2316 (package
2317 (name "rfkill")
2318 (version "0.5")
2319 (source (origin
2320 (method url-fetch)
2321 (uri (string-append "mirror://kernel.org/software/network/"
2322 name "/" name "-" version ".tar.xz"))
2323 (sha256
2324 (base32
2325 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2326 (build-system gnu-build-system)
2327 (arguments
2328 `(#:make-flags (list "CC=gcc"
2329 (string-append "PREFIX=" %output))
2330 #:phases (modify-phases %standard-phases
2331 (delete 'configure))
2332 #:tests? #f))
2333 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2334 (synopsis "Tool for enabling and disabling wireless devices")
2335 (description
2336 "rfkill is a simple tool for accessing the rfkill device interface,
2337which is used to enable and disable wireless networking devices, typically
2338WLAN, Bluetooth and mobile broadband.")
3ac73271
LC
2339 (license (license:non-copyleft "file://COPYING"
2340 "See COPYING in the distribution."))))
c755c854 2341
dc9bdb1e
ML
2342(define-public acpi
2343 (package
2344 (name "acpi")
2345 (version "1.7")
2346 (source (origin
2347 (method url-fetch)
de67e922
LF
2348 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2349 version "/" name "-" version ".tar.gz"))
dc9bdb1e
ML
2350 (sha256
2351 (base32
2352 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2353 (build-system gnu-build-system)
2354 (home-page "http://acpiclient.sourceforge.net")
2355 (synopsis "Display information on ACPI devices")
2356 (description "@code{acpi} attempts to replicate the functionality of the
2357\"old\" @code{apm} command on ACPI systems, including battery and thermal
2358information. It does not support ACPI suspending, only displays information
2359about ACPI devices.")
2360 (license license:gpl2+)))
2361
57a516d3
LC
2362(define-public acpid
2363 (package
2364 (name "acpid")
169a438c 2365 (version "2.0.28")
57a516d3
LC
2366 (source (origin
2367 (method url-fetch)
2368 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2369 version ".tar.xz"))
2370 (sha256
2371 (base32
169a438c 2372 "043igasvp1l6nv5rzh4sksmymay2qn20anl4zm4zvwnkn1a3l34q"))))
57a516d3 2373 (build-system gnu-build-system)
3b3b60d0 2374 (home-page "https://sourceforge.net/projects/acpid2/")
57a516d3
LC
2375 (synopsis "Daemon for delivering ACPI events to user-space programs")
2376 (description
2377 "acpid is designed to notify user-space programs of Advanced
2378Configuration and Power Interface (ACPI) events. acpid should be started
2379during the system boot, and will run as a background process. When an ACPI
2380event is received from the kernel, acpid will examine the list of rules
2381specified in /etc/acpi/events and execute the rules that match the event.")
3ac73271 2382 (license license:gpl2+)))
37f5caec
TUBK
2383
2384(define-public sysfsutils
2385 (package
2386 (name "sysfsutils")
2387 (version "2.1.0")
2388 (source
2389 (origin
2390 (method url-fetch)
2391 (uri
2392 (string-append
2393 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2394 version ".tar.gz"))
2395 (sha256
2396 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2397 (build-system gnu-build-system)
2398 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2399 (synopsis "System utilities based on Linux sysfs")
2400 (description
8f65585b 2401 "These are a set of utilities built upon sysfs, a virtual file system in
37f5caec
TUBK
2402Linux kernel versions 2.5+ that exposes a system's device tree. The package
2403also contains the libsysfs library.")
2404 ;; The library is under lgpl2.1+ (all files say "or any later version").
2405 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3ac73271 2406 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
a9a1a40b
TUBK
2407
2408(define-public sysfsutils-1
2409 (package
2410 (inherit sysfsutils)
2411 (version "1.3.0")
2412 (source
2413 (origin
2414 (method url-fetch)
2415 (uri
2416 (string-append
2417 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2418 "/sysfsutils-" version ".tar.gz"))
2419 (sha256
2420 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2421 (modules '((guix build utils)))
2422 (snippet
2423 '(begin
2424 (substitute* "Makefile.in"
2425 (("includedir = /usr/include/sysfs")
2426 "includedir = @includedir@"))
2427 (substitute* "configure"
2428 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2429 (string-append "includedir='" orig "/sysfs'")))))))
2430 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
e6caa52d
TUBK
2431
2432(define-public cpufrequtils
2433 (package
2434 (name "cpufrequtils")
2435 (version "0.3")
2436 (source
2437 (origin
2438 (method url-fetch)
2439 (uri
2440 (string-append
2441 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2442 version ".tar.gz"))
2443 (sha256
2444 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
fc1adab1 2445 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
e6caa52d
TUBK
2446 (build-system gnu-build-system)
2447 (native-inputs
2448 `(("sysfsutils" ,sysfsutils-1)))
2449 (arguments
2450 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2451 (assoc-ref %outputs "out") "/lib"))))
2452 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2453 (synopsis "Utilities to get and set CPU frequency on Linux")
2454 (description
e881752c 2455 "The cpufrequtils suite contains utilities to retrieve CPU frequency
e6caa52d
TUBK
2456information, and set the CPU frequency if supported, using the cpufreq
2457capabilities of the Linux kernel.")
3ac73271 2458 (license license:gpl2)))
0a588bf9
SB
2459
2460(define-public libraw1394
2461 (package
2462 (name "libraw1394")
7c58c852 2463 (version "2.1.2")
0a588bf9
SB
2464 (source (origin
2465 (method url-fetch)
2466 (uri (string-append
2467 "mirror://kernel.org/linux/libs/ieee1394/"
2468 name "-" version ".tar.xz"))
2469 (sha256
2470 (base32
7c58c852 2471 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
0a588bf9
SB
2472 (build-system gnu-build-system)
2473 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2474 (synopsis "Interface library for the Linux IEEE1394 drivers")
2475 (description
2476 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2477the Linux IEEE-1394 subsystem, which provides direct access to the connected
24781394 buses to user space. Through libraw1394/raw1394, applications can directly
2479send to and receive from other nodes without requiring a kernel driver for the
2480protocol in question.")
3ac73271 2481 (license license:lgpl2.1+)))
68e3c29d
SB
2482
2483(define-public libavc1394
2484 (package
2485 (name "libavc1394")
2486 (version "0.5.4")
2487 (source (origin
2488 (method url-fetch)
de67e922 2489 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
68e3c29d
SB
2490 name "-" version ".tar.gz"))
2491 (sha256
2492 (base32
2493 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2494 (build-system gnu-build-system)
2495 (native-inputs
2496 `(("pkg-config" ,pkg-config)))
2497 (propagated-inputs
2498 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3b3b60d0 2499 (home-page "https://sourceforge.net/projects/libavc1394/")
68e3c29d
SB
2500 (synopsis "AV/C protocol library for IEEE 1394")
2501 (description
2502 "Libavc1394 is a programming interface to the AV/C specification from
69b4ffcf 2503the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3ac73271 2504 (license license:lgpl2.1+)))
3f7bf86a
SB
2505
2506(define-public libiec61883
2507 (package
2508 (name "libiec61883")
2509 (version "1.2.0")
2510 (source (origin
2511 (method url-fetch)
2512 (uri (string-append
2513 "mirror://kernel.org/linux/libs/ieee1394/"
2514 name "-" version ".tar.xz"))
2515 (sha256
2516 (base32
2517 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2518 (build-system gnu-build-system)
2519 (native-inputs
2520 `(("pkg-config" ,pkg-config)))
2521 (propagated-inputs
2522 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2523 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2524 (synopsis "Isochronous streaming media library for IEEE 1394")
2525 (description
2526 "The libiec61883 library provides a higher level API for streaming DV,
2527MPEG-2 and audio over Linux IEEE 1394.")
3ac73271 2528 (license license:lgpl2.1+)))
69159125
MW
2529
2530(define-public mdadm
2531 (package
2532 (name "mdadm")
fae88ae8 2533 (version "4.0")
69159125
MW
2534 (source (origin
2535 (method url-fetch)
2536 (uri (string-append
2537 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2538 version ".tar.xz"))
2539 (sha256
2540 (base32
fae88ae8 2541 "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx"))))
69159125
MW
2542 (build-system gnu-build-system)
2543 (inputs
2544 `(("udev" ,eudev)))
2545 (arguments
2546 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
fae88ae8
LC
2547 (list "CC=gcc"
2548 "INSTALL=install"
69159125
MW
2549 "CHECK_RUN_DIR=0"
2550 ;; TODO: tell it where to find 'sendmail'
2551 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2552 (string-append "BINDIR=" out "/sbin")
2553 (string-append "MANDIR=" out "/share/man")
2554 (string-append "UDEVDIR=" out "/lib/udev")))
2555 #:phases (alist-cons-before
2556 'build 'patch-program-paths
2557 (lambda* (#:key inputs #:allow-other-keys)
2558 (let ((coreutils (assoc-ref inputs "coreutils")))
2559 (substitute* "udev-md-raid-arrays.rules"
2560 (("/usr/bin/(readlink|basename)" all program)
2561 (string-append coreutils "/bin/" program)))))
d76f44e8
LC
2562 (alist-cons-before
2563 'build 'remove-W-error
2564 (lambda _
2565 ;; We cannot build with -Werror on i686 due to a
2566 ;; 'sign-compare' warning in util.c.
2567 (substitute* "Makefile"
2568 (("-Werror") ""))
2569 #t)
2570 (alist-delete 'configure %standard-phases)))
69159125
MW
2571 ;;tests must be done as root
2572 #:tests? #f))
2573 (home-page "http://neil.brown.name/blog/mdadm")
2574 (synopsis "Tool for managing Linux Software RAID arrays")
2575 (description
2576 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2577assemble, report on, and monitor arrays. It can also move spares between raid
2578arrays when needed.")
3ac73271 2579 (license license:gpl2+)))
01ccdfb6 2580
631fda7e
LC
2581(define-public mdadm-static
2582 (package
2583 (inherit mdadm)
2584 (name "mdadm-static")
2585 (arguments
2586 (substitute-keyword-arguments (package-arguments mdadm)
2587 ((#:make-flags flags)
2588 `(cons "LDFLAGS = -static" ,flags))
2589 ((#:phases phases)
2590 `(modify-phases ,phases
2591 (add-after 'install 'remove-cruft
2592 (lambda* (#:key outputs #:allow-other-keys)
2593 (let* ((out (assoc-ref outputs "out"))
2594 (precious? (lambda (file)
2595 (member file '("." ".." "sbin"))))
2596 (directories (scandir out (negate precious?))))
2597 (with-directory-excursion out
2598 (for-each delete-file-recursively directories)
2599 (remove-store-references "sbin/mdadm")
2600 (delete-file "sbin/mdmon")
2601 #t))))))
2602 ((#:modules modules %gnu-build-system-modules)
2603 `((ice-9 ftw) ,@modules))
2604 ((#:strip-flags _ '())
2605 ''("--strip-all")) ;strip a few extra KiB
2606 ((#:allowed-references _ '("out"))
2607 '("out")))) ;refer only self
2608 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2609
b3ed50e6
MB
2610(define-public multipath-tools
2611 (package
2612 (name "multipath-tools")
7f412f33 2613 (version "0.7.1")
b3ed50e6
MB
2614 (source (origin
2615 (method url-fetch)
2616 (uri (string-append "http://git.opensvc.com/?p=multipath-tools/"
2617 ".git;a=snapshot;h=" version ";sf=tgz"))
2618 (file-name (string-append name "-" version ".tar.gz"))
2619 (sha256
2620 (base32
7f412f33 2621 "0w0rgi3lqksaki30yvd4l5rgjqb0d7js1sh7masl8aw6xbrsm26p"))
b3ed50e6
MB
2622 (modules '((guix build utils)))
2623 (snippet
2624 '(begin
2625 ;; Drop bundled valgrind headers.
2626 (delete-file-recursively "third-party")
2627 (substitute* '("multipathd/main.c"
2628 "libmultipath/debug.c")
2629 (("#include \"../third-party/")
2630 "#include \""))
2631 #t))))
2632 (build-system gnu-build-system)
2633 (arguments
2634 '(#:tests? #f ; No tests.
2635 #:make-flags (list (string-append "DESTDIR="
2636 (assoc-ref %outputs "out"))
b5fb9430 2637 "SYSTEMDPATH=lib"
b3ed50e6
MB
2638 (string-append "LDFLAGS=-Wl,-rpath="
2639 (assoc-ref %outputs "out")
2640 "/lib"))
2641 #:phases
2642 (modify-phases %standard-phases
b5fb9430 2643 (add-after 'unpack 'patch-source
7f412f33
MB
2644 (lambda* (#:key inputs #:allow-other-keys)
2645 (let ((lvm2 (assoc-ref inputs "lvm2"))
2646 (udev (assoc-ref inputs "udev")))
2647 (substitute* "Makefile.inc"
2648 (("\\$\\(prefix\\)/usr") "$(prefix)"))
2649 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
2650 (("/usr/include/libdevmapper.h")
2651 (string-append lvm2 "/include/libdevmapper.h"))
2652 (("/usr/include/libudev.h")
2653 (string-append udev "/include/libudev.h")))
2654 #t)))
b3ed50e6
MB
2655 (delete 'configure)
2656 (add-before 'build 'set-CC
2657 (lambda _
2658 (setenv "CC" "gcc")
2659 #t)))))
2660 (native-inputs
7f412f33
MB
2661 `(("perl" ,perl)
2662 ("pkg-config" ,pkg-config)
2663 ("valgrind" ,valgrind)))
b3ed50e6
MB
2664 (inputs
2665 `(("ceph:lib" ,ceph "lib")
7f412f33 2666 ("json-c" ,json-c)
b3ed50e6
MB
2667 ("libaio" ,libaio)
2668 ("liburcu" ,liburcu)
2669 ("lvm2" ,lvm2)
2670 ("readline" ,readline)
2671 ("udev" ,eudev)))
2672 (home-page "http://christophe.varoqui.free.fr/")
2673 (synopsis "Access block devices through multiple paths")
2674 (description
2675 "This package provides the following binaries to drive the
2676Linux Device Mapper multipathing driver:
2677@enumerate
2678@item @command{multipath} - Device mapper target autoconfig.
2679@item @command{multipathd} - Multipath daemon.
2680@item @command{mpathpersist} - Manages SCSI persistent reservations on
2681@code{dm} multipath devices.
2682@item @command{kpartx} - Create device maps from partition tables.
2683@end enumerate")
2684 (license (list license:gpl2+ ; Main distribution.
2685 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
2686
01ccdfb6
SB
2687(define-public libaio
2688 (package
2689 (name "libaio")
2690 (version "0.3.110")
2691 (source (origin
2692 (method url-fetch)
2693 (uri (list
2694 (string-append "mirror://debian/pool/main/liba/libaio/"
4929a061 2695 name "_" version ".orig.tar.gz")))
01ccdfb6
SB
2696 (sha256
2697 (base32
2698 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2699 (build-system gnu-build-system)
2700 (arguments
2701 '(#:make-flags
2702 (list "CC=gcc" (string-append "prefix=" %output))
2703 #:test-target "partcheck" ; need root for a full 'check'
2704 #:phases
2705 (alist-delete 'configure %standard-phases))) ; no configure script
2706 (home-page "http://lse.sourceforge.net/io/aio.html")
2707 (synopsis "Linux-native asynchronous I/O access library")
2708 (description
2709 "This library enables userspace to use Linux kernel asynchronous I/O
2710system calls, important for the performance of databases and other advanced
2711applications.")
3ac73271 2712 (license license:lgpl2.1+)))
eb7c43c3 2713
81b98756
RW
2714(define-public sbc
2715 (package
2716 (name "sbc")
2717 (version "1.3")
2718 (source (origin
2719 (method url-fetch)
2720 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
2721 name "-" version ".tar.xz"))
2722 (sha256
2723 (base32
2724 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
2725 (build-system gnu-build-system)
2726 (inputs
2727 `(("libsndfile" ,libsndfile)))
2728 (native-inputs
2729 `(("pkg-config" ,pkg-config)))
2730 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
2731 (synopsis "Bluetooth subband audio codec")
2732 (description
2733 "The SBC is a digital audio encoder and decoder used to transfer data to
2734Bluetooth audio output devices like headphones or loudspeakers.")
2735 (license license:gpl2+)))
2736
eb7c43c3
DT
2737(define-public bluez
2738 (package
2739 (name "bluez")
212c775c 2740 (version "5.44")
eb7c43c3
DT
2741 (source (origin
2742 (method url-fetch)
2743 (uri (string-append
e9eb24b1 2744 "mirror://kernel.org/linux/bluetooth/bluez-"
eb7c43c3
DT
2745 version ".tar.xz"))
2746 (sha256
2747 (base32
212c775c 2748 "11bc6pndivd0rkqr3c8a1xd9ar9bb60gx79piskycicb3wliwchc"))))
eb7c43c3
DT
2749 (build-system gnu-build-system)
2750 (arguments
2751 '(#:configure-flags
2752 (let ((out (assoc-ref %outputs "out")))
f3dbc626
SB
2753 (list "--sysconfdir=/etc"
2754 "--localstatedir=/var"
2755 "--enable-library"
53142109 2756 "--disable-systemd"
eb7c43c3
DT
2757 ;; Install dbus/udev files to the correct location.
2758 (string-append "--with-dbusconfdir=" out "/etc")
87a16de7
SB
2759 (string-append "--with-udevdir=" out "/lib/udev")))
2760 #:phases
2761 (modify-phases %standard-phases
2762 (add-after 'install 'post-install
2763 (lambda* (#:key inputs outputs #:allow-other-keys)
2764 (let* ((out (assoc-ref outputs "out"))
2765 (servicedir (string-append out "/share/dbus-1/services"))
2766 (service "obexd/src/org.bluez.obex.service")
2767 (rule (string-append
2768 out "/lib/udev/rules.d/97-hid2hci.rules")))
2769 ;; Install the obex dbus service file.
2770 (substitute* service
2771 (("/bin/false")
2772 (string-append out "/libexec/bluetooth/obexd")))
2773 (install-file service servicedir)
2774 ;; Fix paths in the udev rule.
2775 (substitute* rule
2776 (("hid2hci --method")
2777 (string-append out "/lib/udev/hid2hci --method"))
2778 (("/sbin/udevadm")
2779 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
2780 #t))))))
eb7c43c3
DT
2781 (native-inputs
2782 `(("pkg-config" ,pkg-config)
b94a6ca0 2783 ("gettext" ,gettext-minimal)))
eb7c43c3
DT
2784 (inputs
2785 `(("glib" ,glib)
2786 ("dbus" ,dbus)
2787 ("eudev" ,eudev)
2788 ("libical" ,libical)
2789 ("readline" ,readline)))
2790 (home-page "http://www.bluez.org/")
2791 (synopsis "Linux Bluetooth protocol stack")
2792 (description
2793 "BlueZ provides support for the core Bluetooth layers and protocols. It
2794is flexible, efficient and uses a modular implementation.")
3ac73271 2795 (license license:gpl2+)))
3d890318
LC
2796
2797(define-public fuse-exfat
2798 (package
2799 (name "fuse-exfat")
9ff04ff7 2800 (version "1.2.6")
3d890318
LC
2801 (source (origin
2802 (method url-fetch)
c0cc805e
TGR
2803 (uri (string-append
2804 "https://github.com/relan/exfat/releases/download/v"
2805 version "/" name "-" version ".tar.gz"))
3d890318
LC
2806 (sha256
2807 (base32
9ff04ff7 2808 "1rvq4hapy2anal1vg1yidv4x8rg4iw5sxfwqixkw0q2qsxb54471"))))
3d890318
LC
2809 (build-system gnu-build-system)
2810 (native-inputs
c0cc805e 2811 `(("pkg-config" ,pkg-config)))
3d890318
LC
2812 (inputs
2813 `(("fuse" ,fuse)))
c0cc805e 2814 (home-page "https://github.com/relan/exfat")
3d890318
LC
2815 (synopsis "Mount exFAT file systems")
2816 (description
2817 "This package provides a FUSE-based file system that provides read and
2818write access to exFAT devices.")
3ac73271 2819 (license license:gpl2+)))
53ec8d48
LC
2820
2821(define-public gpm
2822 (package
2823 (name "gpm")
2824 (version "1.20.7")
2825 (source (origin
2826 (method url-fetch)
2827 (uri (string-append
2828 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
2829 version ".tar.bz2"))
2830 (sha256
2831 (base32
2832 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
2833 (build-system gnu-build-system)
2834 (arguments
2835 '(#:phases (modify-phases %standard-phases
2836 (add-before 'configure 'bootstrap
2837 (lambda _
2838 ;; The tarball was not generated with 'make dist' so we
2839 ;; need to bootstrap things ourselves.
2840 (and (zero? (system* "./autogen.sh"))
2841 (begin
2842 (patch-makefile-SHELL "Makefile.include.in")
2843 #t)))))
2844
2845 ;; Make sure programs find libgpm.so.
2846 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2847 (assoc-ref %outputs "out")
2848 "/lib"))))
2849 (native-inputs
2850 `(("texinfo" ,texinfo)
2851 ("bison" ,bison)
2852 ("flex" ,flex)
2853 ("autoconf" ,autoconf)
2854 ("automake" ,automake)
2855 ("libtool" ,libtool)))
2856 (home-page "http://www.nico.schottelius.org/software/gpm/")
2857 (synopsis "Mouse support for the Linux console")
2858 (description
2859 "The GPM (general-purpose mouse) daemon is a mouse server for
2860applications running on the Linux console. It allows users to select items
2861and copy/paste text in the console and in xterm.")
3ac73271 2862 (license license:gpl2+)))
fc686f9a
TGR
2863
2864(define-public btrfs-progs
2865 (package
2866 (name "btrfs-progs")
acf82a11 2867 (version "4.11")
fc686f9a
TGR
2868 (source (origin
2869 (method url-fetch)
2870 (uri (string-append "mirror://kernel.org/linux/kernel/"
2871 "people/kdave/btrfs-progs/"
2872 "btrfs-progs-v" version ".tar.xz"))
2873 (sha256
2874 (base32
acf82a11 2875 "03mzv89f08gdsqv4ima793g44kdavcfyjialf5dr0zd2ab66hyp1"))))
fc686f9a 2876 (build-system gnu-build-system)
7cad981d
TGR
2877 (outputs '("out"
2878 "static")) ; static versions of binaries in "out" (~16MiB!)
fc686f9a 2879 (arguments
7cad981d
TGR
2880 '(#:phases (modify-phases %standard-phases
2881 (add-after 'build 'build-static
2882 (lambda _ (zero? (system* "make" "static"))))
2883 (add-after 'install 'install-static
2884 (let ((staticbin (string-append (assoc-ref %outputs "static")
2885 "/bin")))
2886 (lambda _
2887 (zero? (system* "make"
2888 (string-append "bindir=" staticbin)
2889 "install-static"))))))
2890 #:test-target "test"
fc686f9a
TGR
2891 #:parallel-tests? #f)) ; tests fail when run in parallel
2892 (inputs `(("e2fsprogs" ,e2fsprogs)
2893 ("libblkid" ,util-linux)
7cad981d 2894 ("libblkid:static" ,util-linux "static")
fc686f9a 2895 ("libuuid" ,util-linux)
7cad981d 2896 ("libuuid:static" ,util-linux "static")
fc686f9a
TGR
2897 ("zlib" ,zlib)
2898 ("lzo" ,lzo)))
2899 (native-inputs `(("pkg-config" ,pkg-config)
2900 ("asciidoc" ,asciidoc)
2901 ("xmlto" ,xmlto)
41d23dd1 2902 ;; For building documentation.
fc686f9a 2903 ("libxml2" ,libxml2)
48b7e4a6 2904 ("docbook-xsl" ,docbook-xsl)
41d23dd1 2905 ;; For tests.
48b7e4a6 2906 ("which" ,which)))
fc686f9a
TGR
2907 (home-page "https://btrfs.wiki.kernel.org/")
2908 (synopsis "Create and manage btrfs copy-on-write file systems")
039601e0
TGR
2909 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
2910aimed at implementing advanced features while focusing on fault tolerance,
2911repair and easy administration.")
68bcac6b
LF
2912 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
2913 ;; GPL2: Everything else.
2914 (license (list license:gpl2 license:gpl2+))))
08e9daf5 2915
f3e44f5c
DC
2916(define-public btrfs-progs/static
2917 (package
2918 (name "btrfs-progs-static")
2919 (version (package-version btrfs-progs))
2920 (source #f)
2921 (build-system trivial-build-system)
2922 (inputs
2923 `(("btrfs-progs:static" ,btrfs-progs "static")))
2924 (arguments
2925 `(#:modules ((guix build utils))
2926 #:builder
2927 (begin
2928 (use-modules (guix build utils)
2929 (ice-9 ftw)
2930 (srfi srfi-26))
2931
2932 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
2933 (out (assoc-ref %outputs "out"))
2934 (source (string-append btrfs "/bin/btrfs.static"))
2935 (target (string-append out "/bin/btrfs")))
2936 (mkdir-p (dirname target))
2937 (copy-file source target)
2938 (remove-store-references target)
2939 (chmod target #o555)))))
2940 (home-page (package-home-page btrfs-progs))
ff797172
TGR
2941 (synopsis "Statically-linked btrfs command from btrfs-progs")
2942 (description "This package provides the statically-linked @command{btrfs}
2943from the btrfs-progs package. It is meant to be used in initrds.")
f3e44f5c
DC
2944 (license (package-license btrfs-progs))))
2945
08e9daf5
TGR
2946(define-public freefall
2947 (package
2948 (name "freefall")
2949 (version (package-version linux-libre))
2950 (source (package-source linux-libre))
2951 (build-system gnu-build-system)
2952 (arguments
2953 '(#:phases (modify-phases %standard-phases
2954 (add-after 'unpack 'enter-subdirectory
2955 (lambda _
2956 (chdir "tools/laptop/freefall")))
2957 (delete 'configure)
2958 (add-before 'build 'increase-timeout
2959 (lambda _
2960 ;; The default of 2 seconds is too low: it assumes an
2961 ;; open lid and AC power without actually checking.
2962 (substitute* "freefall.c"
2963 (("alarm\\(2\\)") "alarm(5)")))))
2964 #:make-flags (list (string-append "PREFIX="
2965 (assoc-ref %outputs "out")))
2966 #:tests? #f)) ;no tests
2967 (home-page (package-home-page linux-libre))
2968 (synopsis "Free-fall protection for spinning laptop hard drives")
2969 (description
2970 "Prevents shock damage to the internal spinning hard drive(s) of some
2971HP and Dell laptops. When sudden movement is detected, all input/output
2972operations on the drive are suspended and its heads are parked on the ramp,
2973where they are less likely to cause damage to the spinning disc. Requires a
2974drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
2975feature, and a laptop with an accelerometer. It has no effect on SSDs.")
2976 (license license:gpl2)))
d17ae8c0
NG
2977
2978(define-public thinkfan
2979 (package
2980 (name "thinkfan")
2981 (version "0.9.3")
2982 (source (origin
2983 (method url-fetch)
2984 (uri (string-append "mirror://sourceforge/thinkfan/"
de67e922 2985 "/thinkfan-" version ".tar.gz"))
d17ae8c0
NG
2986 (sha256
2987 (base32
2988 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
2989 (modules '((guix build utils)))
2990 ;; Fix erroneous man page location in Makefile leading to
2991 ;; a compilation failure.
2992 (snippet
2993 '(substitute* "CMakeLists.txt"
2994 (("thinkfan\\.1") "src/thinkfan.1")))))
2995 (build-system cmake-build-system)
2996 (arguments
2997 `(#:modules ((guix build cmake-build-system)
2998 (guix build utils)
2999 (srfi srfi-26))
3000 #:tests? #f ;no test target
3001 #:configure-flags
3002 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
3003 `("-DUSE_ATASMART:BOOL=ON")
3004 #:phases
3005 (modify-phases %standard-phases
75e56aed
NG
3006 ;; Install scripts for various foreign init systems. Also fix
3007 ;; hard-coded path for daemon.
d17ae8c0
NG
3008 (add-after 'install 'install-rc-scripts
3009 (lambda* (#:key outputs #:allow-other-keys)
75e56aed
NG
3010 (let ((out (assoc-ref outputs "out"))
3011 (files (find-files
3012 (string-append "../thinkfan-" ,version "/rcscripts")
3013 ".*")))
3014 (substitute* files
3015 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
3016 (string-append out "/sbin/" name)))
3017 (for-each (cute install-file <>
3018 (string-append out "/share/thinkfan"))
3019 files))
d17ae8c0
NG
3020 #t)))))
3021 (inputs
3022 `(("libatasmart" ,libatasmart)))
3023 (home-page "http://thinkfan.sourceforge.net/")
3024 (synopsis "Simple fan control program")
3025 (description
3026 "Thinkfan is a simple fan control program. It reads temperatures,
3027checks them against configured limits and switches to appropriate (also
3028pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
3029other @code{hwmon} driver that enables temperature reading and fan control
3030from userspace.")
3031 (license license:gpl3+)))
91231156
LC
3032
3033(define-public ntfs-3g
3034 (package
3035 (name "ntfs-3g")
3036 (version "2016.2.22")
3037 (source (origin
3038 (method url-fetch)
3039 (uri (string-append "https://tuxera.com/opensource/"
3040 "ntfs-3g_ntfsprogs-" version ".tgz"))
3041 (sha256
3042 (base32
3043 "180y5y09h30ryf2vim8j30a2npwz1iv9ly5yjmh3wjdkwh2jrdyp"))
3044 (modules '((guix build utils)))
1a82ba66 3045 (patches (search-patches "ntfs-3g-CVE-2017-0358.patch"))
91231156
LC
3046 (snippet
3047 ;; Install under $prefix.
3048 '(substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
3049 (("/sbin")
3050 "@sbindir@")))))
3051 (build-system gnu-build-system)
3052 (inputs `(("util-linux" ,util-linux)
3053 ("fuse" ,fuse))) ;libuuid
3054 (native-inputs `(("pkg-config" ,pkg-config)))
3055 (arguments
3056 '(#:configure-flags (list "--exec-prefix=${prefix}"
3057 "--with-fuse=external" ;use our own FUSE
3058 "--enable-mount-helper"
3059 "--enable-posix-acls"
3060 "--enable-xattr-mappings")))
3061 (home-page "http://www.tuxera.com/community/open-source-ntfs-3g/")
3062 (synopsis "Read-write access to NTFS file systems")
3063 (description
3064 "NTFS-3G provides read-write access to NTFS file systems, which are
3065commonly found on Microsoft Windows. It is implemented as a FUSE file system.
3066The package provides additional NTFS tools.")
3067 (license license:gpl2+)))
9b0942c1 3068
f8f44dd7
MB
3069(define-public rdma-core
3070 (package
3071 (name "rdma-core")
3072 (version "13")
3073 (source (origin
3074 (method url-fetch)
3075 (uri (string-append "https://github.com/linux-rdma/rdma-core"
3076 "/releases/download/v" version "/rdma-core-"
3077 version ".tar.gz"))
3078 (sha256
3079 (base32
3080 "15qdfqkia22vab1dh41s88vgi70yifi40ar5s4x7a456rpbhy8z5"))))
3081 (build-system cmake-build-system)
3082 (arguments
3083 '(#:tests? #f ; no tests
3084 ;; Upstream uses the "ninja" build system and encourage distros
3085 ;; to do the same for consistency. They also recommend using the
3086 ;; "Release" build type.
3087 #:configure-flags (list "-GNinja"
3088 ;; Defaults to "lib64" on 64-bit archs.
3089 (string-append "-DCMAKE_INSTALL_LIBDIR="
3090 (assoc-ref %outputs "out") "/lib")
3091 "-DCMAKE_BUILD_TYPE=Release")
3092 #:phases
3093 (modify-phases %standard-phases
3094 (replace 'build
3095 (lambda _
3096 (zero? (system* "ninja"
3097 "-j" (number->string (parallel-job-count))))))
3098 (replace 'install
3099 (lambda _
3100 (zero? (system* "ninja" "install")))))))
3101 (native-inputs
3102 `(("ninja" ,ninja)
3103 ("pkg-config" ,pkg-config)
3104 ("python" ,python-wrapper)))
3105 (inputs
3106 `(("libnl" ,libnl)
3107 ("udev" ,eudev)))
3108 (home-page "https://github.com/linux-rdma/rdma-core")
3109 (synopsis "Utilities and libraries for working with RDMA devices")
3110 (description
3111 "This package provides userspace components for the InfiniBand
3112subsystem of the Linux kernel. Specifically it contains userspace
3113libraries for the following device nodes:
3114
3115@enumerate
3116@item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
3117@item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
3118@item @file{/dev/infiniband/umadX} (@code{libibumad})
3119@end enumerate
3120
3121The following service daemons are also provided:
3122@enumerate
3123@item @code{srp_daemon} (for the @code{ib_srp} kernel module)
3124@item @code{iwpmd} (for iWARP kernel providers)
3125@item @code{ibacm} (for InfiniBand communication management assistant)
3126@end enumerate")
3127 ;; All library code is dual licensed under GPL2 and a custom MIT
3128 ;; variant. The package also includes some components covered by
3129 ;; other licenses. Consult COPYING.md for full details.
3130 (license
3131 (list license:gpl2
3132 (license:x11-style "See COPYING.BSD_MIT in the distribution")
3133 license:bsd-2 ; Files referring to COPYING.BSD_FB
3134 license:cc0 ; most files in ccan/
3135 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
3136
9b0942c1
DC
3137(define-public rng-tools
3138 (package
3139 (name "rng-tools")
3140 (version "5")
3141 (source (origin
3142 (method url-fetch)
3143 (uri (string-append
3144 "http://downloads.sourceforge.net/sourceforge/gkernel/"
3145 "rng-tools-" version ".tar.gz"))
3146 (sha256
3147 (base32
3148 "13h7lc8wl9khhvkr0i3bl5j9bapf8anhqis1lcnwxg1vc2v058b0"))))
3149 (build-system gnu-build-system)
3150 (synopsis "Random number generator daemon")
3151 (description
3152 "Monitor a hardware random number generator, and supply entropy
3153from that to the system kernel's @file{/dev/random} machinery.")
3b3b60d0 3154 (home-page "https://sourceforge.net/projects/gkernel")
9b0942c1
DC
3155 ;; The source package is offered under the GPL2+, but the files
3156 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
3157 (license (list license:gpl2 license:gpl2+))))
58d6a1f2
TGR
3158
3159(define-public cpupower
3160 (package
3161 (name "cpupower")
3162 (version (package-version linux-libre))
3163 (source (package-source linux-libre))
3164 (build-system gnu-build-system)
3165 (arguments
3166 '(#:phases (modify-phases %standard-phases
3167 (add-after 'unpack 'enter-subdirectory
3168 (lambda _
3169 (chdir "tools/power/cpupower")))
3170 (delete 'configure)
3171 (add-before 'build 'fix-makefiles
3172 (lambda _
3173 (substitute* "Makefile"
3174 (("/usr/") "/")
3175 (("/bin/(install|pwd)" _ command) command))
3176 (substitute* "bench/Makefile"
3177 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
3178 #:make-flags (let ((out (assoc-ref %outputs "out")))
3179 (list (string-append "DESTDIR=" out)
3180 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
3181 "docdir=/share/doc/cpupower"
3182 "confdir=$(docdir)/examples"
3183 ;; The Makefile recommends the following changes
3184 "DEBUG=false"
3185 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
3186 #:tests? #f)) ;no tests
b94a6ca0 3187 (native-inputs `(("gettext" ,gettext-minimal)))
58d6a1f2
TGR
3188 (inputs `(("pciutils" ,pciutils)))
3189 (home-page (package-home-page linux-libre))
3190 (synopsis "CPU frequency and voltage scaling tools for Linux")
3191 (description
3192 "cpupower is a set of user-space tools that use the cpufreq feature of the
3193Linux kernel to retrieve and control processor features related to power saving,
3194such as frequency and voltage scaling.")
3195 (license license:gpl2)))
2b76f135
TGR
3196
3197(define-public haveged
3198 (package
3199 (name "haveged")
3200 (version "1.9.1")
3201 (source
3202 (origin
3203 (method url-fetch)
3204 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
3205 version ".tar.gz"))
3206 (sha256
3207 (base32
3208 "059pxlfd4l5dqhd6r3lynzfz4wby2f17294fy17pi9j2jpnn68ww"))))
3209 (build-system gnu-build-system)
3210 (home-page "http://www.issihosts.com/haveged")
3211 (synopsis "Entropy source for the Linux random number generator")
3212 (description
3213 "haveged generates an unpredictable stream of random numbers for use by
3214Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3215standard mechanisms for filling the entropy pool may not be sufficient for
3216systems with high needs or limited user interaction, such as headless servers.
3217@command{haveged} runs as a privileged daemon, harvesting randomness from the
3218indirect effects of hardware events on hidden processor state using the HArdware
3219Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
3220its environment and provides the same built-in test suite for the output stream
3221as used on certified hardware security devices.")
3222 (license (list (license:non-copyleft "file://nist/mconf.h")
3223 (license:non-copyleft "file://nist/packtest.c")
3224 license:public-domain ; nist/dfft.c
3225 license:gpl3+)))) ; everything else
e385e957
TGR
3226
3227(define-public ecryptfs-utils
3228 (package
3229 (name "ecryptfs-utils")
3230 (version "111")
3231 (source
3232 (origin
3233 (method url-fetch)
3234 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3235 version "/+download/ecryptfs-utils_"
3236 version ".orig.tar.gz"))
3237 (sha256
3238 (base32
3239 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3240 (build-system gnu-build-system)
3241 (arguments
3242 `(#:configure-flags (list "--disable-pywrap")))
3243 (native-inputs
3244 `(("intltool" ,intltool)
3245 ("perl" ,perl) ; for pod2man
3246 ("pkg-config" ,pkg-config)))
3247 (inputs
3248 `(("keyutils" ,keyutils)
3249 ("linux-pam" ,linux-pam)
3250 ("nss" ,nss)))
3251 (home-page "http://ecryptfs.org/")
3252 (synopsis "eCryptfs cryptographic file system utilities")
3253 (description
3254 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3255Each file's cryptographic meta-data is stored inside the file itself, along
3256with the encrypted contents. This allows individual encrypted files to be
3257copied between hosts and still be decrypted with the proper key. eCryptfs is a
3258native Linux file system, and has been part of the Linux kernel since version
32592.6.19. This package contains the userland utilities to manage it.")
3260 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3261 ;; grant additional permission to link with OpenSSL.
3262 (license license:gpl2+)))
cff0adec
DC
3263
3264(define-public libnfsidmap
3265 (package
3266 (name "libnfsidmap")
3267 (version "0.25")
3268 (source (origin
3269 (method url-fetch)
3270 (uri (string-append
3271 "http://www.citi.umich.edu/projects/nfsv4/linux/"
3272 name "/" name "-" version ".tar.gz"))
3273 (sha256
3274 (base32
3275 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
3276 (build-system gnu-build-system)
3277 (arguments
3278 `(#:configure-flags (list
3279 (string-append "--with-pluginpath="
3280 (assoc-ref %outputs "out")
3281 "/lib/libnfsidmap"))))
3282 (home-page
3283 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3284 (synopsis
3285 "NFSv4 support library for name/ID mapping")
3286 (description "Libnfsidmap is a library holding mulitiple methods of
3287mapping names to ids and visa versa, mainly for NFSv4. It provides an
3288extensible array of mapping functions, currently consisting of two choices:
3289the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3290 (license (license:non-copyleft "file://COPYING"
3291 "See COPYING in the distribution."))))
035d3593
DC
3292
3293(define-public module-init-tools
3294 (package
3295 (name "module-init-tools")
3296 (version "3.16")
3297 (source (origin
3298 (method url-fetch)
3299 (uri (string-append
3300 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3301 "module-init-tools-" version ".tar.bz2"))
3302 (sha256
3303 (base32
3304 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3305 (patches (search-patches "module-init-tools-moduledir.patch"))))
3306 (build-system gnu-build-system)
3307 (arguments
3308 ;; FIXME: The upstream tarball lacks man pages, and building them would
3309 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3310 ;; but they vanished. In the meantime, fake it.
3311 '(#:phases (alist-cons-before
3312 'configure 'fake-docbook
3313 (lambda _
3314 (substitute* "Makefile.in"
3315 (("^DOCBOOKTOMAN.*$")
3316 "DOCBOOKTOMAN = true\n")))
3317 %standard-phases)))
3318 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
3319 (synopsis "Tools for loading and managing Linux kernel modules")
3320 (description
3321 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3322`insmod', `lsmod', and more.")
3323 (license license:gpl2+)))
dd65f3b7
TGR
3324
3325(define-public mcelog
3326 (package
3327 (name "mcelog")
8675ae15 3328 (version "151")
dd65f3b7
TGR
3329 (source (origin
3330 (method url-fetch)
3331 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3332 "mcelog.git/snapshot/v" version ".tar.gz"))
3333 (sha256
3334 (base32
8675ae15 3335 "1cgfdlz51hv2zbph00ylzm8z94gv8wakx7dva1pa4jcl3hnq0dh5"))
dd65f3b7
TGR
3336 (file-name (string-append name "-" version ".tar.gz"))
3337 (modules '((guix build utils)))
3338 (snippet
3339 ;; The snapshots lack a .git directory, breaking ‘git describe’.
3340 `(substitute* "Makefile"
3341 (("\"unknown\"") (string-append "\"v" ,version "\""))))))
3342 (build-system gnu-build-system)
3343 (arguments
3344 `(#:phases (modify-phases %standard-phases
3345 (delete 'configure)) ; no configure script
3346 #:make-flags (let ((out (assoc-ref %outputs "out")))
3347 (list "CC=gcc"
3348 (string-append "prefix=" out)
3349 (string-append "DOCDIR=" out "/share/doc/mcelog")
3350 "etcprefix=$(DOCDIR)/examples"))
3351 ;; The tests will only run as root on certain supported CPU models.
3352 #:tests? #f))
3353 (supported-systems (list "i686-linux" "x86_64-linux"))
3354 (home-page "http://mcelog.org/")
3355 (synopsis "Machine check monitor for x86 Linux systems")
3356 (description
3357 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3358and other hardware errors on x86 systems. It can also perform user-defined
3359tasks, such as bringing bad pages off-line, when configurable error thresholds
3360are exceeded.")
3361 (license license:gpl2)))
0c60cc53
DM
3362
3363(define-public mtd-utils
3364 (package
3365 (name "mtd-utils")
3366 (version "1.5.2")
3367 (source (origin
3368 (method url-fetch)
3369 (uri (string-append
3370 "ftp://ftp.infradead.org/pub/mtd-utils/"
3371 "mtd-utils-" version ".tar.bz2"))
3372 (sha256
3373 (base32
3374 "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax"))))
3375 (inputs
3376 `(("acl" ,acl)
3377 ("libuuid" ,util-linux)
3378 ("lzo", lzo)
3379 ("zlib" ,zlib)))
3380 (build-system gnu-build-system)
3381 (arguments
3382 `(#:test-target "tests"
3383 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3384 #:phases (modify-phases %standard-phases
3385 (delete 'configure))))
3386 (synopsis "MTD Flash Storage Utilities")
3387 (description "This package provides utilities for testing, partitioning, etc
3388of flash storage.")
3389 (home-page "http://www.linux-mtd.infradead.org/")
3390 (license
3391 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3392 license:mpl1.1 ; All ftl* files
3393 license:expat)))) ; libiniparser
def6213f
LF
3394
3395(define-public libseccomp
3396 (package
3397 (name "libseccomp")
488a3734 3398 (version "2.3.2")
def6213f
LF
3399 (source (origin
3400 (method url-fetch)
3401 (uri (string-append "https://github.com/seccomp/libseccomp/"
3402 "releases/download/v" version
3403 "/libseccomp-" version ".tar.gz"))
3404 (sha256
3405 (base32
488a3734 3406 "18dwfxzsw3agiy2dxbflrkhmjgvlji0wwkk636nabh2ng41qrp1x"))))
def6213f
LF
3407 (build-system gnu-build-system)
3408 (native-inputs
3409 `(("which" ,which)))
3410 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3411 (description "The libseccomp library provides an easy to use, platform
3412independent, interface to the Linux Kernel's syscall filtering mechanism. The
3413libseccomp API is designed to abstract away the underlying BPF based syscall
3414filter language and present a more conventional function-call based filtering
3415interface that should be familiar to, and easily adopted by, application
3416developers.")
3417 (home-page "https://github.com/seccomp/libseccomp")
3418 (license license:lgpl2.1)))
58c4f11e
TGR
3419
3420(define-public radeontop
3421 (package
3422 (name "radeontop")
a7c61512 3423 (version "1.0")
58c4f11e
TGR
3424 (home-page "https://github.com/clbr/radeontop/")
3425 (source (origin
3426 (method url-fetch)
a7c61512 3427 (uri (string-append home-page "archive/v" version ".tar.gz"))
58c4f11e
TGR
3428 (file-name (string-append name "-" version ".tar.gz"))
3429 (sha256
3430 (base32
a7c61512 3431 "1z38nibirqxrbsfyhfcrnzlcw16cqjp4ds6qnjfxalwayf9fm5x9"))))
58c4f11e
TGR
3432 (build-system gnu-build-system)
3433 (arguments
3434 `(#:phases (modify-phases %standard-phases
3435 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
3436 ;; dependency, and doesn't even work on release(!) tarballs.
3437 (add-after 'unpack 'report-correct-version
3438 (lambda _ (substitute* "getver.sh"
3439 (("ver=unknown")
3440 (string-append "ver=" ,version)))))
3441 (delete 'configure)) ; no configure script
3442 #:make-flags (list "CC=gcc"
3443 (string-append "PREFIX=" %output))
3444 #:tests? #f)) ; no tests
3445 (native-inputs
7c90d0f4 3446 `(("gettext" ,gettext-minimal)
58c4f11e
TGR
3447 ("pkg-config" ,pkg-config)))
3448 (inputs
3449 `(("libdrm" ,libdrm)
3450 ("libpciaccess" ,libpciaccess)
a7c61512 3451 ("libxcb" ,libxcb)
58c4f11e
TGR
3452 ("ncurses" ,ncurses)))
3453 (synopsis "Usage monitor for AMD Radeon graphics")
3454 (description "RadeonTop monitors resource consumption on supported AMD
3455Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
3456a terminal or saved to a file for further processing. It measures both the
3457activity of the GPU as a whole, which is also accurate during OpenCL
3458computations, as well as separate component statistics that are only meaningful
3459under OpenGL graphics workloads.")
3460 (license license:gpl3)))
0d74462a
MB
3461
3462(define-public efivar
3463 (package
3464 (name "efivar")
3465 (version "30")
3466 (source (origin
3467 (method url-fetch)
3468 (uri (string-append "https://github.com/rhinstaller/" name
3469 "/releases/download/" version "/" name
3470 "-" version ".tar.bz2"))
3471 (sha256
3472 (base32
3473 "12qjnm44yi55ffqxjpgrxy82s89yjziy84w2rfjjknsd8flj0mqz"))))
3474 (build-system gnu-build-system)
3475 (arguments
3476 `(;; Tests require a UEFI system and is not detected in the chroot.
3477 #:tests? #f
3478 #:make-flags (list (string-append "prefix=" %output)
3479 (string-append "libdir=" %output "/lib")
3480 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
3481 #:phases
3482 (modify-phases %standard-phases
3483 (delete 'configure))))
3484 (native-inputs
3485 `(("pkg-config" ,pkg-config)))
3486 (inputs
3487 `(("popt" ,popt)))
3488 (home-page "https://github.com/rhinstaller/efivar")
3489 (synopsis "Tool and library to manipulate EFI variables")
3490 (description "This package provides a library and a command line
3491interface to the variable facility of UEFI boot firmware.")
3492 (license license:lgpl2.1+)))
1581406e
MB
3493
3494(define-public efibootmgr
3495 (package
3496 (name "efibootmgr")
3497 (version "14")
3498 (source (origin
3499 (method url-fetch)
3500 (uri (string-append "https://github.com/rhinstaller/" name
3501 "/releases/download/" version "/" name
3502 "-" version ".tar.bz2"))
3503 (sha256
3504 (base32
3505 "1n3sydvpr6yl040hhf460k7mrxby7laqd9dqs6pq0js1hijc2zip"))))
3506 (build-system gnu-build-system)
3507 (arguments
3508 `(#:tests? #f ; No tests.
3509 #:make-flags (list (string-append "prefix=" %output)
3510 (string-append "libdir=" %output "/lib")
3511 ;; Override CFLAGS to add efivar include directory.
3512 (string-append "CFLAGS=-O2 -g -flto -I"
3513 (assoc-ref %build-inputs "efivar")
3514 "/include/efivar"))
3515 #:phases
3516 (modify-phases %standard-phases
3517 (add-after 'unpack 'branding
3518 ;; Replace default loader path with something more familiar.
3519 (lambda _
3520 (substitute* "src/efibootmgr.c"
3521 (("EFI\\\\\\\\redhat") ; Matches 'EFI\\redhat'.
3522 "EFI\\\\gnu"))
3523 #t))
3524 (delete 'configure))))
3525 (native-inputs
3526 `(("pkg-config" ,pkg-config)))
3527 (inputs
3528 `(("efivar" ,efivar)
3529 ("popt" ,popt)))
3530 (home-page "https://github.com/rhinstaller/efibootmgr")
3531 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
3532 (description
3533 "@code{efibootmgr} is a user-space application to modify the Intel
3534Extensible Firmware Interface (EFI) Boot Manager. This application can
3535create and destroy boot entries, change the boot order, change the next
3536running boot option, and more.")
3537 (license license:gpl2+)))
6d3e08d4
LF
3538
3539(define-public sysstat
3540 (package
3541 (name "sysstat")
70443013 3542 (version "11.4.3")
6d3e08d4
LF
3543 (source (origin
3544 (method url-fetch)
3545 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
3546 "sysstat-" version ".tar.xz"))
3547 (sha256
3548 (base32
70443013 3549 "1ryf9myjzpa2279i3rvsh6fr5psm6qvr5r9kbm1sxyspapxcms82"))))
6d3e08d4
LF
3550 (build-system gnu-build-system)
3551 (arguments
3552 `(#:tests? #f ; No test suite.
3553 ;; Without this flag, it tries to install the man pages with group 'root'
3554 ;; and fails because /etc/passwd lacks an entry for the root user.
3555 #:configure-flags
3556 (list "--disable-file-attr"
3557 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
3558 #:phases
3559 (modify-phases %standard-phases
3560 ;; The build process tries to create '/var/lib/sa', so we skip that
3561 ;; instruction.
3562 (add-after 'build 'skip-touching-var
3563 (lambda _
3564 (substitute* "Makefile"
3565 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
3566 ""))
3567 #t)))))
3568 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
3569 (synopsis "Performance monitoring tools for Linux")
3570 (description "The sysstat utilities are a collection of performance
3571monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
3572@code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
3573@code{sadf} and @code{sa}.")
3574 (license license:gpl2+)))
01be4f93
JMSG
3575
3576(define-public light
3577 (package
3578 (name "light")
3579 (version "1.0")
3580 (source (origin
3581 (method url-fetch)
3582 (uri (string-append "https://github.com/haikarainen/" name
3583 "/archive/v" version ".tar.gz"))
3584 (sha256
3585 (base32
3586 "0r5gn6c0jcxknzybl6059dplxv46dpahchqq4gymrs7z8bp0hilp"))
3587 (file-name (string-append name "-" version ".tar.gz"))))
3588 (build-system gnu-build-system)
3589 (arguments
3590 '(#:tests? #f ; no tests
3591 #:make-flags (list "CC=gcc"
3592 (string-append "PREFIX=" %output))
3593 #:phases
3594 (modify-phases %standard-phases
3595 (delete 'configure)
3596 (add-after 'unpack 'patch-makefile
3597 (lambda _
3598 (substitute* "Makefile" (("chown") "#")))))))
3599 (native-inputs
3600 `(("help2man" ,help2man)))
3601 (home-page "https://haikarainen.github.io/light")
3602 (synopsis "GNU/Linux application to control backlights")
3603 (description
3604 "Light is a program to send commands to screen backlight controllers
3605under GNU/Linux. Features include:
3606
3607@itemize
3608@item It does not rely on X.
3609@item Light can automatically figure out the best controller to use, making
3610full use of underlying hardware.
3611@item It is possible to set a minimum brightness value, as some controllers
3612set the screen to be pitch black at a vaĺue of 0 (or higher).
3613@end itemize
3614
3615Light is the successor of lightscript.")
3616 (license license:gpl3+)))
189d8422 3617
c7adafa7
MO
3618(define-public tlp
3619 (package
3620 (name "tlp")
3621 (version "0.9")
3622 (source (origin
3623 (method url-fetch)
3624 (uri (string-append
3625 "https://github.com/linrunner/"
3626 (string-upcase name)
3627 "/archive/" version ".tar.gz"))
3628 (file-name (string-append name "-" version ".tar.gz"))
3629 (sha256
3630 (base32
3631 "0xksm8ar6dbq0azbfz8qs9yyzqg1j333lyd5znc074rz8inj4yw8"))))
3632 (inputs `(("bash" ,bash)
3633 ("dbus" ,dbus)
3634 ("ethtool" ,ethtool)
3635 ("eudev" ,eudev)
3636 ("grep" ,grep)
3637 ("hdparm" ,hdparm)
3638 ("inetutils" ,inetutils)
3639 ("iw" ,iw)
3640 ("kmod" ,kmod)
3641 ("pciutils" ,pciutils)
3642 ("perl" ,perl)
3643 ("rfkill" ,rfkill)
3644 ("sed" ,sed)
3645 ("usbutils" ,usbutils)
3646 ("util-linux" ,util-linux)
3647 ("wireless-tools" ,wireless-tools)))
3648 (build-system gnu-build-system)
3649 (arguments
3650 `(#:phases
3651 (modify-phases %standard-phases
cef3f146 3652 (delete 'configure) ; no configure script
c7adafa7
MO
3653 (add-before 'build 'setenv
3654 (lambda* (#:key outputs #:allow-other-keys)
3655 (let ((out (assoc-ref outputs "out")))
3656 (setenv "TLP_WITH_SYSTEMD" "0")
3657 (setenv "TLP_NO_INIT" "1")
3658 (setenv "TLP_NO_PMUTILS" "1")
3659 (setenv "TLP_SBIN" (string-append out "/bin"))
3660 (setenv "TLP_BIN" (string-append out "/bin"))
3661 (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
3662 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
32e75b48 3663 (setenv "TLP_CONF" "/etc/tlp")
c7adafa7
MO
3664 (setenv "TLP_SHCPL"
3665 (string-append out "/share/bash-completion/completions"))
3666 (setenv "TLP_MAN" (string-append out "/share/man")))))
cef3f146
TGR
3667 (delete 'check) ; no tests
3668 (add-before 'install 'fix-installation
3669 (lambda _
3670 ;; Stop the Makefile from trying to create system directories.
3671 (substitute* "Makefile" (("\\[ -f \\$\\(_CONF\\) \\]") "#"))))
c7adafa7
MO
3672 (replace 'install
3673 (lambda _
cef3f146 3674 (zero? (system* "make" "install-tlp" "install-man"))))
c7adafa7
MO
3675 (add-after 'install 'wrap
3676 (lambda* (#:key inputs outputs #:allow-other-keys)
3677 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
3678 (bin-files (find-files bin ".*")))
3679 (define (bin-directory input-name)
3680 (string-append (assoc-ref inputs input-name) "/bin"))
3681 (define (sbin-directory input-name)
3682 (string-append (assoc-ref inputs input-name) "/sbin"))
3683 (for-each (lambda (program)
3684 (wrap-program program
3685 `("PATH" ":" prefix
3686 ,(append
3687 (map bin-directory '("bash"
3688 "coreutils"
3689 "dbus"
3690 "eudev"
3691 "grep"
3692 "inetutils"
3693 "kmod"
3694 "perl"
3695 "sed"
3696 "usbutils"
3697 "util-linux"))
3698 (map sbin-directory '("ethtool"
3699 "hdparm"
3700 "iw"
3701 "pciutils"
3702 "rfkill"
3703 "wireless-tools"))))))
3704 bin-files)))))))
3705 (home-page "http://linrunner.de/en/tlp/tlp.html")
3706 (synopsis "Power management tool for Linux")
3707 (description "TLP is a power management tool for Linux. It comes with
3708a default configuration already optimized for battery life. Nevertheless,
3709TLP is customizable to fulfil system requirements. TLP settings are applied
3710every time the power supply source is changed.")
3711
3712 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
3713 ;; rest is GPLv2+.
3714 (license (list license:gpl2+ license:gpl3+))))
3715
189d8422
BG
3716(define-public lshw
3717 (package
3718 (name "lshw")
3719 (version "B.02.18")
3720 (source (origin
3721 (method url-fetch)
3722 (uri (string-append "https://www.ezix.org/software/"
3723 "files/lshw-" version
3724 ".tar.gz"))
3725 (sha256
3726 (base32
3727 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
3728 (build-system gnu-build-system)
3729 (arguments
3730 `(#:phases (modify-phases %standard-phases (delete 'configure))
3731 #:tests? #f ; no tests
3732 #:make-flags
3733 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
3734 (synopsis "List hardware information")
3735 (description
3736 "@command{lshw} (Hardware Lister) is a small tool to provide
3737detailed information on the hardware configuration of the machine.
3738It can report exact memory configuration, firmware version, mainboard
3739configuration, CPU version and speed, cache configuration, bus speed,
3740and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
3741machines (PowerMac G4 is known to work).")
3742 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
3743 (license license:gpl2+)))
2f4a58b5
LF
3744
3745(define-public libmnl
3746 (package
3747 (name "libmnl")
3748 (version "1.0.4")
3749 (source
3750 (origin
3751 (method url-fetch)
f11ae44f 3752 (uri (string-append "mirror://netfilter.org/libmnl/"
2f4a58b5
LF
3753 "libmnl-" version ".tar.bz2"))
3754 (sha256
3755 (base32
3756 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
3757 (build-system gnu-build-system)
3758 (home-page "https://www.netfilter.org/projects/libmnl/")
3759 (synopsis "Netlink utility library")
3760 (description "Libmnl is a minimalistic user-space library oriented to
3761Netlink developers. There are a lot of common tasks in parsing, validating,
3762constructing of both the Netlink header and TLVs that are repetitive and easy to
3763get wrong. This library aims to provide simple helpers that allows you to
3764re-use code and to avoid re-inventing the wheel.")
3765 (license license:lgpl2.1+)))
b754c612
LF
3766
3767(define-public libnftnl
3768 (package
3769 (name "libnftnl")
3770 (version "1.0.7")
3771 (source
3772 (origin
3773 (method url-fetch)
f11ae44f 3774 (uri (string-append "mirror://netfilter.org/libnftnl/"
b754c612
LF
3775 "libnftnl-" version ".tar.bz2"))
3776 (sha256
3777 (base32
3778 "10irjrylcfkbp11617yr19vpfhgl54w0kw02jhj0i1abqv5nxdlv"))))
3779 (build-system gnu-build-system)
3780 (native-inputs
3781 `(("pkg-config" ,pkg-config)))
3782 (inputs
3783 `(("libmnl" ,libmnl)))
3784 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
3785 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
3786 (description "Libnftnl is a userspace library providing a low-level netlink
3787programming interface to the in-kernel nf_tables subsystem. The library
3788libnftnl has been previously known as libnftables. This library is currently
3789used by nftables.")
3790 (license license:gpl2+)))
62b28c0e
LC
3791
3792(define-public proot
3793 (package
3794 (name "proot")
3795 (version "5.1.0")
3796 (home-page "https://github.com/proot-me/PRoot")
3797 (source (origin
3798 (method url-fetch)
3799 (uri (string-append home-page "/archive/v" version ".tar.gz"))
3800 (file-name (string-append name "-" version ".tar.gz"))
3801 (sha256
3802 (base32
3803 "11h30i83vdhc3khlj6hrh3a21sbmmz8nhfv09vkf6b9bcs1biz2h"))
3804 (patches (search-patches "proot-test-fhs.patch"))))
3805 (build-system gnu-build-system)
3806 (arguments
3807 '(#:make-flags '("-C" "src")
3808
3809 #:phases (modify-phases %standard-phases
3810 (delete 'configure)
3811 (add-before 'build 'set-shell-file-name
3812 (lambda* (#:key inputs #:allow-other-keys)
3813 (substitute* (find-files "src" "\\.[ch]$")
3814 (("\"/bin/sh\"")
3815 (string-append "\""
3816 (assoc-ref inputs "bash")
3817 "/bin/sh\"")))
3818 #t))
3819 (add-before 'check 'fix-fhs-assumptions-in-tests
3820 (lambda _
3821 (substitute* "tests/test-c6b77b77.mk"
3822 (("/bin/bash") (which "bash"))
3823 (("/usr/bin/test") (which "test")))
3824 (substitute* '("tests/test-16573e73.c")
3825 (("/bin/([a-z-]+)" _ program)
3826 (which program)))
3827
3828 (substitute* (find-files "tests" "\\.sh$")
3829 ;; Some of the tests try to "bind-mount" /bin/true.
3830 (("-b /bin/true:")
3831 (string-append "-b " (which "true") ":"))
3832 ;; Likewise for /bin.
3833 (("-b /bin:") "-b /gnu:")
3834 ;; Others try to run /bin/sh.
3835 (("/bin/sh") (which "sh"))
3836 ;; Others assume /etc/fstab exists.
3837 (("/etc/fstab") "/etc/passwd"))
3838
3839 (substitute* "tests/GNUmakefile"
3840 (("-b /bin:") "-b /gnu:"))
3841
3842 ;; XXX: This test fails in an obscure corner case, just
3843 ;; skip it.
3844 (delete-file "tests/test-kkkkkkkk.c")
3845
3846 #t))
3847 (replace 'check
3848 (lambda _
3849 (let ((n (parallel-job-count)))
3850 ;; For some reason we get lots of segfaults with
3851 ;; seccomp support (x86_64, Linux-libre 4.11.0).
3852 (setenv "PROOT_NO_SECCOMP" "1")
3853
3854 ;; Most of the tests expect "/bin" to be in $PATH so
3855 ;; they can run things that live in $ROOTFS/bin.
3856 (setenv "PATH"
3857 (string-append (getenv "PATH") ":/bin"))
3858
3859 (zero? (system* "make" "check" "-C" "tests"
3860 ;;"V=1"
3861 "-j" (number->string n))))))
3862 (replace 'install
3863 (lambda* (#:key outputs #:allow-other-keys)
3864 ;; The 'install' rule does nearly nothing.
3865 (let ((out (assoc-ref outputs "out")))
3866 (and (zero?
3867 ;; TODO: 'make install-care' (does not even
3868 ;; build currently.)
3869 (system* "make" "-C" "src" "install"
3870 (string-append "PREFIX=" out)))
3871 (begin
3872 (install-file "doc/proot/man.1"
3873 (string-append out "/share"
3874 "/man/man1"))
3875 #t))))))))
3876 (native-inputs `(("which" ,which)
3877
3878 ;; For 'mcookie', used by some of the tests.
3879 ("util-linux" ,util-linux)))
3880 (inputs `(("talloc" ,talloc)))
3881 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
3882 (description
3883 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
3884and @code{binfmt_misc}. This means that users don't need any privileges or
3885setup to do things like using an arbitrary directory as the new root
3886filesystem, making files accessible somewhere else in the file system
3887hierarchy, or executing programs built for another CPU architecture
3888transparently through QEMU user-mode. Also, developers can use PRoot as a
3889generic process instrumentation engine thanks to its extension mechanism.
3890Technically PRoot relies on @code{ptrace}, an unprivileged system-call
3891available in the kernel Linux.")
3892 (license license:gpl2+)))
b9048a14
LC
3893
3894(define-public proot-static
3895 (package
3896 (inherit proot)
3897 (name "proot-static")
3898 (synopsis
3899 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
3900 (inputs `(("talloc" ,talloc/static)))
3901 (arguments
3902 (substitute-keyword-arguments (package-arguments proot)
3903 ((#:make-flags flags)
3904 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
3905 ((#:phases phases)
3906 `(modify-phases ,phases
3907 (add-after 'strip 'remove-store-references
3908 (lambda* (#:key outputs #:allow-other-keys)
3909 (let* ((out (assoc-ref outputs "out")))
3910 (with-directory-excursion out
3911 (remove-store-references "bin/proot")
3912 #t))))))
3913 ((#:allowed-references _ '("out"))
3914 '("out"))))))