1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
5 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
7 ;;; This file is part of GNU Guix.
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22 (define-module (gnu packages linux)
23 #:use-module ((guix licenses)
25 #:use-module (gnu packages)
26 #:use-module ((gnu packages compression)
27 #:renamer (symbol-prefix-proc 'guix:))
28 #:use-module (gnu packages flex)
29 #:use-module (gnu packages bison)
30 #:use-module (gnu packages gperf)
31 #:use-module (gnu packages libusb)
32 #:use-module (gnu packages ncurses)
33 #:use-module (gnu packages pciutils)
34 #:use-module (gnu packages bdb)
35 #:use-module (gnu packages perl)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages python)
38 #:use-module (gnu packages algebra)
39 #:use-module (gnu packages gettext)
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages pulseaudio)
42 #:use-module (gnu packages attr)
43 #:use-module (gnu packages xml)
44 #:use-module (gnu packages autotools)
45 #:use-module (gnu packages texinfo)
46 #:use-module (gnu packages check)
47 #:use-module (guix packages)
48 #:use-module (guix download)
49 #:use-module (guix build-system gnu)
50 #:use-module (guix build-system cmake)
51 #:use-module (guix build-system python)
52 #:use-module (guix build-system trivial)
53 #:use-module (srfi srfi-26)
54 #:use-module (ice-9 match))
56 (define-public (system->linux-architecture arch)
57 "Return the Linux architecture name for ARCH, a Guix system name such as
59 (let ((arch (car (string-split arch #\-))))
60 (cond ((string=? arch "i686") "i386")
61 ((string-prefix? "mips" arch) "mips")
62 ((string-prefix? "arm" arch) "arm")
65 (define (linux-libre-urls version)
66 "Return a list of URLs for Linux-Libre VERSION."
68 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
69 version "-gnu/linux-libre-" version "-gnu.tar.xz")
71 ;; XXX: Work around <http://bugs.gnu.org/14851>.
73 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
74 version "-gnu.tar.xz")
76 ;; Maybe this URL will become valid eventually.
78 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
79 version "-gnu.tar.xz")))
81 (define-public linux-libre-headers
82 (let* ((version "3.3.8")
86 (setenv "ARCH" ,(system->linux-architecture arch))
87 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
89 (and (zero? (system* "make" "defconfig"))
90 (zero? (system* "make" "mrproper" "headers_check"))))))
92 `(lambda* (#:key outputs #:allow-other-keys)
93 (let ((out (assoc-ref outputs "out")))
94 (and (zero? (system* "make"
95 (string-append "INSTALL_HDR_PATH=" out)
97 (mkdir (string-append out "/include/config"))
98 (call-with-output-file
100 "/include/config/kernel.release")
102 (format p "~a-default~%" ,version))))))))
104 (name "linux-libre-headers")
108 (uri (linux-libre-urls version))
111 "0jkfh0z1s6izvdnc3njm39dhzp1cg8i06jv06izwqz9w9qsprvnl"))))
112 (build-system gnu-build-system)
113 (native-inputs `(("perl" ,perl)))
115 `(#:modules ((guix build gnu-build-system)
118 #:phases (alist-replace
119 'build ,(build-phase (or (%current-target-system)
122 'install ,install-phase
123 (alist-delete 'configure %standard-phases)))
125 (synopsis "GNU Linux-Libre kernel headers")
126 (description "Headers of the Linux-Libre kernel.")
128 (home-page "http://www.gnu.org/software/linux-libre/"))))
130 (define-public module-init-tools
132 (name "module-init-tools")
137 "mirror://kernel.org/linux/utils/kernel/module-init-tools/module-init-tools-"
141 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
143 (list (search-patch "module-init-tools-moduledir.patch")))))
144 (build-system gnu-build-system)
146 ;; FIXME: The upstream tarball lacks man pages, and building them would
147 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
148 ;; but they vanished. In the meantime, fake it.
149 '(#:phases (alist-cons-before
150 'configure 'fake-docbook
152 (substitute* "Makefile.in"
153 (("^DOCBOOKTOMAN.*$")
154 "DOCBOOKTOMAN = true\n")))
156 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
157 (synopsis "Tools for loading and managing Linux kernel modules")
159 "Tools for loading and managing Linux kernel modules, such as `modprobe',
160 `insmod', `lsmod', and more.")
163 (define %boot-logo-patch
164 ;; Linux-Libre boot logo featuring Freedo and a gnu.
167 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
168 "lemote/gnewsense/branches/3.15/100gnu+freedo.patch"))
171 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
173 (define (kernel-config system)
174 "Return the absolute file name of the Linux-Libre build configuration file
175 for SYSTEM, or #f if there is no configuration for SYSTEM."
176 (define (lookup file)
177 (let ((file (string-append "gnu/packages/" file)))
178 (search-path %load-path file)))
182 (lookup "linux-libre-i686.conf"))
184 (lookup "linux-libre-x86_64.conf"))
188 (define-public linux-libre
189 (let* ((version "3.15.5")
191 '(lambda* (#:key system inputs #:allow-other-keys #:rest args)
192 ;; Apply the neat patch.
193 (system* "patch" "-p1" "--batch"
194 "-i" (assoc-ref inputs "patch/freedo+gnu"))
196 (let ((arch (car (string-split system #\-))))
198 (cond ((string=? arch "i686") "i386")
200 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
202 (let ((build (assoc-ref %standard-phases 'build))
203 (config (assoc-ref inputs "kconfig")))
205 ;; Use the architecture-specific config if available, and
206 ;; 'defconfig' otherwise.
209 (copy-file config ".config")
210 (chmod ".config" #o666))
211 (system* "make" "defconfig"))
213 ;; Appending works even when the option wasn't in the
214 ;; file. The last one prevails if duplicated.
215 (let ((port (open-file ".config" "a")))
216 (display (string-append "CONFIG_NET_9P=m\n"
217 "CONFIG_NET_9P_VIRTIO=m\n"
218 "CONFIG_VIRTIO_BLK=m\n"
219 "CONFIG_VIRTIO_NET=m\n"
220 ;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
221 "CONFIG_DEVPTS_MULTIPLE_INSTANCES=y\n"
222 "CONFIG_VIRTIO_PCI=m\n"
223 "CONFIG_VIRTIO_BALLOON=m\n"
224 "CONFIG_VIRTIO_MMIO=m\n"
231 (zero? (system* "make" "oldconfig"))
233 ;; Call the default `build' phase so `-j' is correctly
235 (apply build #:make-flags "all" args))))
237 `(lambda* (#:key inputs outputs #:allow-other-keys)
238 (let* ((out (assoc-ref outputs "out"))
239 (moddir (string-append out "/lib/modules"))
240 (mit (assoc-ref inputs "module-init-tools")))
242 (for-each (lambda (file)
244 (string-append out "/" (basename file))))
245 (find-files "." "^(bzImage|System\\.map)$"))
246 (copy-file ".config" (string-append out "/config"))
247 (zero? (system* "make"
248 (string-append "DEPMOD=" mit "/sbin/depmod")
249 (string-append "MODULE_DIR=" moddir)
250 (string-append "INSTALL_PATH=" out)
251 (string-append "INSTALL_MOD_PATH=" out)
252 "INSTALL_MOD_STRIP=1"
253 "modules_install"))))))
259 (uri (linux-libre-urls version))
262 "0kh7yz6jl0jj6z24vh5qzzdn4s3ll4i4rnk4d0l0animnm3s305v"))))
263 (build-system gnu-build-system)
264 (native-inputs `(("perl" ,perl)
266 ("module-init-tools" ,module-init-tools)
267 ("patch/freedo+gnu" ,%boot-logo-patch)
269 ,@(let ((conf (kernel-config (or (%current-target-system)
270 (%current-system)))))
275 `(#:modules ((guix build gnu-build-system)
279 #:phases (alist-replace
282 'install ,install-phase
283 (alist-delete 'configure %standard-phases)))
285 (synopsis "100% free redistribution of a cleaned Linux kernel")
287 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
288 It has been modified to remove all non-free binary blobs.")
290 (home-page "http://www.gnu.org/software/linux-libre/"))))
294 ;;; Pluggable authentication modules (PAM).
297 (define-public linux-pam
304 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
306 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
307 version ".tar.bz2")))
310 "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s"))))
311 (build-system gnu-build-system)
315 ;; TODO: optional dependencies
316 ;; ("libxcrypt" ,libxcrypt)
317 ;; ("cracklib" ,cracklib)
320 '(;; Most users, such as `shadow', expect the headers to be under
322 #:configure-flags (list (string-append "--includedir="
323 (assoc-ref %outputs "out")
324 "/include/security"))
326 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
329 (home-page "http://www.linux-pam.org/")
330 (synopsis "Pluggable authentication modules for Linux")
332 "A *Free* project to implement OSF's RFC 86.0.
333 Pluggable authentication modules are small shared object files that can
334 be used through the PAM API to perform tasks, like authenticating a user
335 at login. Local and dynamic reconfiguration are its key features")
343 (define-public psmisc
350 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
354 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
355 (build-system gnu-build-system)
356 (inputs `(("ncurses" ,ncurses)))
357 (home-page "http://psmisc.sourceforge.net/")
359 "set of utilities that use the proc filesystem, such as fuser, killall, and pstree")
361 "This PSmisc package is a set of some small useful utilities that
362 use the proc filesystem. We're not about changing the world, but
363 providing the system administrator with some help in common tasks.")
366 (define-public util-linux
372 (uri (string-append "mirror://kernel.org/linux/utils/"
373 name "/v" version "/"
374 name "-" version ".2" ".tar.xz"))
377 "1rpgghf7n0zx0cdy8hibr41wvkm2qp1yvd8ab1rxr193l1jmgcir"))
378 (patches (list (search-patch "util-linux-perl.patch")))))
379 (build-system gnu-build-system)
381 `(#:configure-flags '("--disable-use-tty-group"
383 #:phases (alist-cons-after
384 'install 'patch-chkdupexe
385 (lambda* (#:key outputs #:allow-other-keys)
386 (let ((out (assoc-ref outputs "out")))
387 (substitute* (string-append out "/bin/chkdupexe")
388 ;; Allow 'patch-shebang' to do its work.
389 (("@PERL@") "/bin/perl"))))
391 (inputs `(("zlib" ,guix:zlib)
392 ("ncurses" ,ncurses)))
395 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
396 (synopsis "Collection of utilities for the Linux kernel")
398 "util-linux is a random collection of utilities for the Linux kernel.")
400 ;; Note that util-linux doesn't use the same license for all the
401 ;; code. GPLv2+ is the default license for a code without an
402 ;; explicitly defined license.
403 (license (list gpl3+ gpl2+ gpl2 lgpl2.0+
404 bsd-4 public-domain))))
406 (define-public procps
412 (uri (string-append "http://procps.sourceforge.net/procps-"
416 "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i"))
417 (patches (list (search-patch "procps-make-3.82.patch")))))
418 (build-system gnu-build-system)
419 (inputs `(("ncurses" ,ncurses)))
421 '(#:phases (alist-replace
423 (lambda* (#:key outputs #:allow-other-keys)
424 ;; No `configure', just a single Makefile.
425 (let ((out (assoc-ref outputs "out")))
426 (substitute* "Makefile"
428 (("--(owner|group) 0") "")
429 (("ldconfig") "true")
430 (("^LDFLAGS[[:blank:]]*:=(.*)$" _ value)
431 ;; Add libproc to the RPATH.
432 (string-append "LDFLAGS := -Wl,-rpath="
437 (lambda* (#:key outputs #:allow-other-keys)
438 (let ((out (assoc-ref outputs "out")))
440 (system* "make" "install"
441 (string-append "DESTDIR=" out)))
445 (system* (string-append out "/bin/ps")
449 ;; What did you expect? Tests?
451 (home-page "http://procps.sourceforge.net/")
452 (synopsis "Utilities that give information about processes")
454 "procps is the package that has a bunch of small useful utilities
455 that give information about processes using the Linux /proc file system.
456 The package includes the programs ps, top, vmstat, w, kill, free,
457 slabtop, and skill.")
460 (define-public usbutils
467 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
468 "usbutils-" version ".tar.xz"))
471 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
472 (build-system gnu-build-system)
474 `(("libusb" ,libusb)))
476 `(("pkg-config" ,pkg-config)))
477 (home-page "http://www.linux-usb.org/")
479 "Tools for working with USB devices, such as lsusb")
481 "Tools for working with USB devices, such as lsusb.")
484 (define-public e2fsprogs
490 (uri (string-append "mirror://sourceforge/e2fsprogs/e2fsprogs-"
494 "0ibkkvp6kan0hn0d1anq4n2md70j5gcm7mwna515w82xwyr02rfw"))))
495 (build-system gnu-build-system)
496 (inputs `(("util-linux" ,util-linux)))
497 (native-inputs `(("pkg-config" ,pkg-config)
498 ("texinfo" ,texinfo))) ; for the libext2fs Info manual
500 '(#:phases (alist-cons-before
501 'configure 'patch-shells
503 (substitute* "configure"
504 (("/bin/sh (.*)parse-types.sh" _ dir)
505 (string-append (which "sh") " " dir
507 (substitute* (find-files "." "^Makefile.in$")
509 (string-append "#!" (which "sh")))))
512 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
513 ;; they fail because we get an extra line that says "Can't check if
514 ;; filesystem is mounted due to missing mtab file".
516 (home-page "http://e2fsprogs.sourceforge.net/")
517 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
519 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
520 (license (list gpl2 ; programs
524 (define-public e2fsck/static
526 (name "e2fsck-static")
527 (version (package-version e2fsprogs))
528 (build-system trivial-build-system)
531 `(#:modules ((guix build utils))
534 (use-modules (guix build utils)
538 (let ((source (string-append (assoc-ref %build-inputs "e2fsprogs")
540 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
542 (with-directory-excursion bin
543 (for-each (lambda (file)
544 (copy-file (string-append source "/" file)
546 (remove-store-references file)
548 (scandir source (cut string-prefix? "fsck." <>))))))))
549 (inputs `(("e2fsprogs" ,(static-package e2fsprogs))))
550 (synopsis "Statically-linked fsck.* commands from e2fsprogs")
552 "This package provides statically-linked command of fsck.ext[234] taken
553 from the e2fsprogs package. It is meant to be used in initrds.")
554 (home-page (package-home-page e2fsprogs))
555 (license (package-license e2fsprogs))))
557 (define-public strace
563 (uri (string-append "mirror://sourceforge/strace/strace-"
567 "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764"))))
568 (build-system gnu-build-system)
569 (native-inputs `(("perl" ,perl)))
570 (home-page "http://strace.sourceforge.net/")
571 (synopsis "System call tracer for Linux")
573 "strace is a system call tracer, i.e. a debugging tool which prints out a
574 trace of all the system calls made by a another process/program.")
577 (define-public alsa-lib
584 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
588 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
589 (patches (list (search-patch "alsa-lib-mips-atomic-fix.patch")))))
590 (build-system gnu-build-system)
591 (home-page "http://www.alsa-project.org/")
592 (synopsis "The Advanced Linux Sound Architecture libraries")
594 "The Advanced Linux Sound Architecture (ALSA) provides audio and
595 MIDI functionality to the Linux-based operating system.")
598 (define-public alsa-utils
604 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-"
608 "1sjjngnq50jv5ilwsb4zys6smifni3bd6fn28gbnhfrg14wsrgq2"))))
609 (build-system gnu-build-system)
611 ;; XXX: Disable man page creation until we have DocBook.
612 '(#:configure-flags (list "--disable-xmlto"
613 (string-append "--with-udev-rules-dir="
614 (assoc-ref %outputs "out")
615 "/lib/udev/rules.d"))
616 #:phases (alist-cons-before
617 'install 'pre-install
619 ;; Don't try to mkdir /var/lib/alsa.
620 (substitute* "Makefile"
621 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
625 `(("libsamplerate" ,libsamplerate)
627 ("alsa-lib" ,alsa-lib)
629 ("gettext" ,gnu-gettext)))
630 (home-page "http://www.alsa-project.org/")
631 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
633 "The Advanced Linux Sound Architecture (ALSA) provides audio and
634 MIDI functionality to the Linux-based operating system.")
636 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
640 (define-public iptables
647 "http://www.netfilter.org/projects/iptables/files/iptables-"
651 "0vkg5lzkn4l3i1sm6v3x96zzvnv9g7mi0qgj6279ld383mzcws24"))))
652 (build-system gnu-build-system)
653 (arguments '(#:tests? #f)) ; no test suite
654 (home-page "http://www.netfilter.org/projects/iptables/index.html")
655 (synopsis "Program to configure the Linux IP packet filtering rules")
657 "iptables is the userspace command line program used to configure the
658 Linux 2.4.x and later IPv4 packet filtering ruleset. It is targeted towards
659 system administrators. Since Network Address Translation is also configured
660 from the packet filter ruleset, iptables is used for this, too. The iptables
661 package also includes ip6tables. ip6tables is used for configuring the IPv6
665 (define-public iproute
672 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
676 "04gi11gh087bg2nlxhj0lxrk8l9qxkpr88nsiil23917bm3h1xj4"))))
677 (build-system gnu-build-system)
679 `(#:tests? #f ; no test suite
680 #:make-flags (let ((out (assoc-ref %outputs "out")))
682 (string-append "LIBDIR=" out "/lib")
683 (string-append "SBINDIR=" out "/sbin")
684 (string-append "CONFDIR=" out "/etc")
685 (string-append "DOCDIR=" out "/share/doc/"
687 (string-append "MANDIR=" out "/share/man")))
688 #:phases (alist-cons-before
689 'install 'pre-install
691 ;; Don't attempt to create /var/lib/arpd.
692 (substitute* "Makefile"
693 (("^.*ARPDDIR.*$") "")))
696 `(("iptables" ,iptables)
699 `(("pkg-config" ,pkg-config)
703 "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2")
705 "A collection of utilities for controlling TCP/IP networking and traffic control in Linux")
707 "Iproute2 is a collection of utilities for controlling TCP/IP
708 networking and traffic with the Linux kernel.
710 Most network configuration manuals still refer to ifconfig and route as the
711 primary network configuration tools, but ifconfig is known to behave
712 inadequately in modern network environments. They should be deprecated, but
713 most distros still include them. Most network configuration systems make use
714 of ifconfig and thus provide a limited feature set. The /etc/net project aims
715 to support most modern network technologies, as it doesn't use ifconfig and
716 allows a system administrator to make use of all iproute2 features, including
719 iproute2 is usually shipped in a package called iproute or iproute2 and
720 consists of several tools, of which the most important are ip and tc. ip
721 controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
722 tools print detailed usage messages and are accompanied by a set of
726 (define-public net-tools
727 ;; XXX: This package is basically unmaintained, but it provides a few
728 ;; commands not yet provided by Inetutils, such as 'route', so we have to
733 (home-page "http://www.tazenda.demon.co.uk/phil/net-tools/")
736 (uri (string-append home-page "/" name "-"
740 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))))
741 (build-system gnu-build-system)
743 '(#:phases (alist-cons-after
745 (lambda* (#:key inputs #:allow-other-keys)
746 (define (apply-patch file)
747 (zero? (system* "patch" "-p1" "--batch"
750 (let ((patch.gz (assoc-ref inputs "patch")))
751 (format #t "applying Debian patch set '~a'...~%"
753 (system (string-append "gunzip < " patch.gz " > the-patch"))
755 (and (apply-patch "the-patch")
756 (for-each apply-patch
757 (find-files "debian/patches"
761 (lambda* (#:key outputs #:allow-other-keys)
762 (let ((out (assoc-ref outputs "out")))
763 (mkdir-p (string-append out "/bin"))
764 (mkdir-p (string-append out "/sbin"))
766 ;; Pretend we have everything...
767 (system "yes | make config")
769 ;; ... except we don't have libdnet, so remove that
771 (substitute* '("config.make" "config.h")
772 (("^.*HAVE_AFDECnet.*$") ""))))
775 ;; Binaries that depend on libnet-tools.a don't declare that
776 ;; dependency, making it parallel-unsafe.
779 #:tests? #f ; no test suite
780 #:make-flags (let ((out (assoc-ref %outputs "out")))
782 (string-append "BASEDIR=" out)
783 (string-append "INSTALLNLSDIR=" out "/share/locale")
784 (string-append "mandir=/share/man")))))
786 ;; Use the big Debian patch set (the thing does not even compile out of
788 (inputs `(("patch" ,(origin
791 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
794 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
795 (native-inputs `(("gettext" ,gnu-gettext)))
797 (synopsis "Tools for controlling the network subsystem in Linux")
799 "This package includes the important tools for controlling the network
800 subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
801 netstat, rarp and route. Additionally, this package contains utilities
802 relating to particular network hardware types (plipconfig, slattach) and
803 advanced aspects of IP configuration (iptunnel, ipmaddr).")
806 (define-public libcap
813 ;; Tarballs used to be available from
814 ;; <https://www.kernel.org/pub/linux/libs/security/linux-privs/>
815 ;; but they never came back after kernel.org was compromised.
817 "mirror://debian/pool/main/libc/libcap2/libcap2_"
818 version ".orig.tar.gz"))
821 "07vjhkznm82p8dm4w6j8mmg7h5c70lp5s9bwwfdmgwpbixfydjp1"))))
822 (build-system gnu-build-system)
823 (arguments '(#:phases (alist-delete 'configure %standard-phases)
824 #:tests? #f ; no 'check' target
825 #:make-flags (list "lib=lib"
826 (string-append "prefix="
827 (assoc-ref %outputs "out"))
828 "RAISE_SETFCAP=no")))
829 (native-inputs `(("perl" ,perl)))
830 (inputs `(("attr" ,attr)))
831 (home-page "https://sites.google.com/site/fullycapable/")
832 (synopsis "Library for working with POSIX capabilities")
834 "libcap2 provides a programming interface to POSIX capabilities on
835 Linux-based operating systems.")
837 ;; License is BSD-3 or GPLv2, at the user's choice.
840 (define-public bridge-utils
842 (name "bridge-utils")
846 (uri (string-append "mirror://sourceforge/bridge/bridge-utils-"
850 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
851 (build-system gnu-build-system)
853 ;; The tarball lacks all the generated files.
854 (native-inputs `(("autoconf" ,autoconf)
855 ("automake" ,automake)))
857 '(#:phases (alist-cons-before
858 'configure 'bootstrap
860 (zero? (system* "autoreconf" "-vf")))
862 #:tests? #f)) ; no 'check' target
865 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
866 (synopsis "Manipulate Ethernet bridges")
868 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
869 to connect two Ethernet segments together in a protocol independent way.
870 Packets are forwarded based on Ethernet address, rather than IP address (like
871 a router). Since forwarding is done at Layer 2, all protocols can go
872 transparently through a bridge.")
882 "http://www.infradead.org/~tgr/libnl/files/libnl-"
886 "1ydw42lsd572qwrfgws97n76hyvjdpanwrxm03lysnhfxkna1ssd"))))
887 (build-system gnu-build-system)
888 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
889 (home-page "http://www.infradead.org/~tgr/libnl/")
890 (synopsis "NetLink protocol library suite")
892 "The libnl suite is a collection of libraries providing APIs to netlink
893 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarly
894 between the kernel and user space processes. It was designed to be a more
895 flexible successor to ioctl to provide mainly networking related kernel
896 configuration and monitoring interfaces.")
898 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
899 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
902 (define-public powertop
910 "https://01.org/powertop/sites/default/files/downloads/powertop-"
914 "02rwqbpasdayl201v0549gbp2f82rd0hqiv3i111r7npanjhhb4b"))))
915 (build-system gnu-build-system)
917 ;; TODO: Add pciutils.
918 `(("zlib" ,guix:zlib)
919 ;; ("pciutils" ,pciutils)
923 `(("pkg-config" ,pkg-config)))
924 (home-page "https://01.org/powertop/")
925 (synopsis "Analyze power consumption on Intel-based laptops")
927 "PowerTOP is a Linux tool to diagnose issues with power consumption and
928 power management. In addition to being a diagnostic tool, PowerTOP also has
929 an interactive mode where the user can experiment various power management
930 settings for cases where the operating system has not enabled these
941 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
945 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
946 (build-system gnu-build-system)
947 (inputs `(("ncurses" ,ncurses)))
948 (home-page "http://www.jpj.net/~trevor/aumix.html")
949 (synopsis "Audio mixer for X and the console")
951 "Aumix adjusts an audio mixer from X, the console, a terminal,
952 the command line or a script.")
962 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
965 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
966 (build-system python-build-system)
968 ;; The setup.py script expects python-2.
970 ;; There are currently no checks in the package.
972 (native-inputs `(("python" ,python-2)))
973 (home-page "http://guichaz.free.fr/iotop/")
975 "Displays the IO activity of running processes")
977 "Iotop is a Python program with a top like user interface to show the
978 processes currently causing I/O.")
987 (uri (string-append "mirror://sourceforge/fuse/fuse-"
991 "071r6xjgssy8vwdn6m28qq1bqxsd2bphcd2mzhq0grf5ybm87sqb"))))
992 (build-system gnu-build-system)
993 (inputs `(("util-linux" ,util-linux)))
995 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
996 (assoc-ref %outputs "out")
998 (string-append "INIT_D_PATH="
999 (assoc-ref %outputs "out")
1001 (string-append "UDEV_RULES_PATH="
1002 (assoc-ref %outputs "out")
1004 #:phases (alist-cons-before
1005 'build 'set-file-names
1006 (lambda* (#:key inputs #:allow-other-keys)
1007 ;; libfuse calls out to mount(8) and umount(8). Make sure
1008 ;; it refers to the right ones.
1009 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1010 (("/bin/(u?)mount" _ maybe-u)
1011 (string-append (assoc-ref inputs "util-linux")
1012 "/bin/" maybe-u "mount")))
1013 (substitute* '("util/mount.fuse.c")
1017 ;; This hack leads libfuse to search for 'fusermount' in
1018 ;; $PATH, where it may find a setuid-root binary, instead of
1019 ;; trying solely $out/sbin/fusermount and failing because
1021 (substitute* "lib/Makefile"
1022 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1023 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
1025 (home-page "http://fuse.sourceforge.net/")
1026 (synopsis "Support file systems implemented in user space")
1028 "As a consequence of its monolithic design, file system code for Linux
1029 normally goes into the kernel itself---which is not only a robustness issue,
1030 but also an impediment to system extensibility. FUSE, for \"file systems in
1031 user space\", is a kernel module and user-space library that tries to address
1032 part of this problem by allowing users to run file system implementations as
1033 user-space processes.")
1034 (license (list lgpl2.1 ; library
1035 gpl2+)))) ; command-line utilities
1037 (define-public unionfs-fuse
1039 (name "unionfs-fuse")
1044 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
1048 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1049 (build-system cmake-build-system)
1050 (inputs `(("fuse" ,fuse)))
1051 (arguments '(#:tests? #f)) ; no tests
1052 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1053 (synopsis "User-space union file system")
1055 "UnionFS-FUSE is a flexible union file system implementation in user
1056 space, using the FUSE library. Mounting a union file system allows you to
1057 \"aggregate\" the contents of several directories into a single mount point.
1058 UnionFS-FUSE additionally supports copy-on-write.")
1062 (package (inherit fuse)
1063 (name "fuse-static")
1064 (source (origin (inherit (package-source fuse))
1065 (modules '((guix build utils)))
1067 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1068 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1069 ;; it doesn't do that, allowing us to remove the dependency on
1070 ;; util-linux (something that is useful in initrds.)
1071 '(substitute* '("lib/mount_util.c"
1072 "util/mount_util.c")
1073 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1078 (define-public unionfs-fuse/static
1079 (package (inherit unionfs-fuse)
1080 (synopsis "User-space union file system (statically linked)")
1081 (name (string-append (package-name unionfs-fuse) "-static"))
1082 (source (origin (inherit (package-source unionfs-fuse))
1083 (modules '((guix build utils)))
1085 ;; Add -ldl to the libraries, because libfuse.a needs that.
1086 '(substitute* "src/CMakeLists.txt"
1087 (("target_link_libraries(.*)\\)" _ libs)
1088 (string-append "target_link_libraries"
1092 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")))
1093 (inputs `(("fuse" ,fuse-static)))))
1095 (define-public sshfs-fuse
1101 (uri (string-append "mirror://sourceforge/fuse/sshfs-fuse-"
1105 "0gp6qr33l2p0964j0kds0dfmvyyf5lpgsn11daf0n5fhwm9185z9"))))
1106 (build-system gnu-build-system)
1111 `(("pkg-config" ,pkg-config)))
1112 (home-page "http://fuse.sourceforge.net/sshfs.html")
1113 (synopsis "Mount remote file systems over SSH")
1115 "This is a file system client based on the SSH File Transfer Protocol.
1116 Since most SSH servers already support this protocol it is very easy to set
1117 up: on the server side there's nothing to do; on the client side mounting the
1118 file system is as easy as logging into the server with an SSH client.")
1121 (define-public numactl
1128 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1133 "073myxlyyhgxh1w3r757ajixb7s2k69czc3r0g12c3scq7k3784w"))))
1134 (build-system gnu-build-system)
1136 '(#:phases (alist-replace
1138 (lambda* (#:key outputs #:allow-other-keys)
1139 ;; There's no 'configure' script, just a raw makefile.
1140 (substitute* "Makefile"
1142 (string-append "prefix := " (assoc-ref outputs "out")
1145 ;; By default the thing tries to install under
1146 ;; $prefix/lib64 when on a 64-bit platform.
1147 (string-append "libdir := $(prefix)/lib\n"))))
1151 ;; By default the thing tries to use 'cc'.
1154 ;; Make sure programs have an RPATH so they can find
1156 (string-append "LDLIBS=-Wl,-rpath="
1157 (assoc-ref %outputs "out") "/lib"))
1159 ;; There's a 'test' target, but it requires NUMA support in the kernel
1160 ;; to run, which we can't assume to have.
1162 (home-page "http://oss.sgi.com/projects/libnuma/")
1163 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1165 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1166 memory is not all in one place. The numactl program allows you to run your
1167 application program on specific CPU's and memory nodes. It does this by
1168 supplying a NUMA memory policy to the operating system before running your
1171 The package contains other commands, such as numademo, numastat and memhog.
1172 The numademo command provides a quick overview of NUMA performance on your
1174 (license (list gpl2 ; programs
1175 lgpl2.1)))) ; library
1183 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1187 "0c34b0za2v0934acvgnva0vaqpghmmhz4zh7k0m9jd4mbc91byqm"))
1188 (modules '((guix build utils)))
1190 '(substitute* "tests/Makefile.in"
1191 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1193 "[@]VERSION[@]")))))
1194 (build-system gnu-build-system)
1196 '(#:phases (alist-cons-before
1198 (lambda* (#:key inputs #:allow-other-keys)
1199 (let ((gzip (assoc-ref %build-inputs "gzip"))
1200 (bzip2 (assoc-ref %build-inputs "bzip2")))
1201 (substitute* "src/libkeymap/findfile.c"
1203 (string-append gzip "/bin/gzip"))
1205 (string-append bzip2 "/bin/bzip2")))))
1207 (inputs `(("check" ,check)
1209 ("bzip2" ,guix:bzip2)
1210 ("pam" ,linux-pam)))
1211 (native-inputs `(("pkg-config" ,pkg-config)))
1212 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1213 (synopsis "Linux keyboard utilities and keyboard maps")
1215 "This package contains keytable files and keyboard utilities compatible
1216 for systems using the Linux kernel. This includes commands such as
1217 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1220 (define-public inotify-tools
1222 (name "inotify-tools")
1227 "mirror://sourceforge/inotify-tools/inotify-tools/"
1228 version "/inotify-tools-" version ".tar.gz"))
1231 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1232 (build-system gnu-build-system)
1233 (home-page "http://inotify-tools.sourceforge.net/")
1234 (synopsis "Monitor file accesses")
1236 "The inotify-tools packages provides a C library and command-line tools
1237 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1247 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1248 "kmod-" version ".tar.xz"))
1251 "1yid3a9b64a60ybj66fk2ysrq5klnl0ijl4g624cl16y8404g9rv"))
1252 (patches (list (search-patch "kmod-module-directory.patch")))))
1253 (build-system gnu-build-system)
1255 `(("pkg-config" ,pkg-config)))
1258 ("zlib" ,guix:zlib)))
1260 `(#:tests? #f ; FIXME: Investigate test failures
1261 #:configure-flags '("--with-xz" "--with-zlib")))
1262 (home-page "https://www.kernel.org/")
1263 (synopsis "Kernel module tools")
1264 (description "kmod is a set of tools to handle common tasks with Linux
1265 kernel modules like insert, remove, list, check properties, resolve
1266 dependencies and aliases.
1268 These tools are designed on top of libkmod, a library that is shipped with
1269 kmod. The aim is to be compatible with tools, configurations and indices
1270 from the module-init-tools project.")
1271 (license gpl2+))) ; library under lgpl2.1+
1280 "mirror://kernel.org/linux/utils/kernel/hotplug/udev-"
1284 "1awp7p07gi083w0dwqhhbbas68a7fx2sbm1yf1ip2jwf7cpqkf5d"))
1285 (patches (list (search-patch "udev-gir-libtool.patch")))))
1286 (build-system gnu-build-system)
1288 `(#:configure-flags (list (string-append
1289 "--with-pci-ids-path="
1290 (assoc-ref %build-inputs "pciutils")
1291 "/share/pci.ids.gz")
1293 "--with-firmware-path=/no/firmware"
1295 ;; Work around undefined reference to
1296 ;; 'mq_getattr' in sc-daemon.c.
1299 `(("pkg-config" ,pkg-config)
1301 ("glib" ,glib "bin") ; glib-genmarshal, etc.
1302 ("perl" ,perl) ; for the tests
1303 ("python" ,python-2))) ; ditto
1306 ("pciutils" ,pciutils)
1307 ("usbutils" ,usbutils)
1308 ("util-linux" ,util-linux)
1310 ("gobject-introspection" ,gobject-introspection)))
1311 (home-page "http://www.freedesktop.org/software/systemd/libudev/")
1312 (synopsis "Userspace device management")
1313 (description "Udev is a daemon which dynamically creates and removes
1314 device nodes from /dev/, handles hotplug events and loads drivers at boot
1316 (license gpl2+))) ; libudev is under lgpl2.1+