ui: Fix format string in `warning'.
[jackhill/guix/guix.git] / gnu / packages / linux.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
e47e3eff 2;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
233e7676 3;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
fd76c904 4;;;
233e7676 5;;; This file is part of GNU Guix.
fd76c904 6;;;
233e7676 7;;; GNU Guix is free software; you can redistribute it and/or modify it
fd76c904
LC
8;;; under the terms of the GNU General Public License as published by
9;;; the Free Software Foundation; either version 3 of the License, or (at
10;;; your option) any later version.
11;;;
233e7676 12;;; GNU Guix is distributed in the hope that it will be useful, but
fd76c904
LC
13;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;;; GNU General Public License for more details.
16;;;
17;;; You should have received a copy of the GNU General Public License
233e7676 18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
fd76c904 19
1ffa7090 20(define-module (gnu packages linux)
4a44e743 21 #:use-module (guix licenses)
59a43334 22 #:use-module (gnu packages)
1ffa7090 23 #:use-module ((gnu packages compression)
4a44e743 24 #:renamer (symbol-prefix-proc 'guix:))
1ffa7090
LC
25 #:use-module (gnu packages flex)
26 #:use-module (gnu packages libusb)
27 #:use-module (gnu packages ncurses)
28 #:use-module (gnu packages perl)
29 #:use-module (gnu packages pkg-config)
02b80c3f
NK
30 #:use-module (guix packages)
31 #:use-module (guix download)
fd76c904
LC
32 #:use-module (guix build-system gnu))
33
80fe5c60
LC
34(define-public linux-libre-headers
35 (let* ((version* "3.3.8")
36 (build-phase
45298f8f
LC
37 '(lambda* (#:key system #:allow-other-keys)
38 (let ((arch (car (string-split system #\-))))
39 (setenv "ARCH"
40 (cond ((string=? arch "i686") "i386")
41 (else arch)))
42 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
43
80fe5c60
LC
44 (and (zero? (system* "make" "defconfig"))
45 (zero? (system* "make" "mrproper" "headers_check")))))
46 (install-phase
47 `(lambda* (#:key outputs #:allow-other-keys)
48 (let ((out (assoc-ref outputs "out")))
49 (and (zero? (system* "make"
50 (string-append "INSTALL_HDR_PATH=" out)
51 "headers_install"))
52 (mkdir (string-append out "/include/config"))
53 (call-with-output-file
54 (string-append out
55 "/include/config/kernel.release")
56 (lambda (p)
57 (format p "~a-default~%" ,version*))))))))
58 (package
59 (name "linux-libre-headers")
60 (version version*)
61 (source (origin
62 (method url-fetch)
63 (uri (string-append
64 "http://linux-libre.fsfla.org/pub/linux-libre/releases/3.3.8-gnu/linux-libre-"
65 version "-gnu.tar.xz"))
66 (sha256
67 (base32
68 "0jkfh0z1s6izvdnc3njm39dhzp1cg8i06jv06izwqz9w9qsprvnl"))))
69 (build-system gnu-build-system)
70 (native-inputs `(("perl" ,perl)))
71 (arguments
72 `(#:modules ((guix build gnu-build-system)
73 (guix build utils)
74 (srfi srfi-1))
75 #:phases (alist-replace
76 'build ,build-phase
77 (alist-replace
78 'install ,install-phase
79 (alist-delete 'configure %standard-phases)))
80 #:tests? #f))
81 (synopsis "GNU Linux-Libre kernel headers")
82 (description "Headers of the Linux-Libre kernel.")
38bbd61d 83 (license gpl2)
80fe5c60
LC
84 (home-page "http://www.gnu.org/software/linux-libre/"))))
85
b4fcb735
LC
86(define-public module-init-tools
87 (package
88 (name "module-init-tools")
89 (version "3.16")
90 (source (origin
91 (method url-fetch)
92 (uri (string-append
93 "mirror://kernel.org/linux/utils/kernel/module-init-tools/module-init-tools-"
94 version ".tar.bz2"))
95 (sha256
96 (base32
97 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))))
98 (build-system gnu-build-system)
99 (inputs
100 ;; The upstream tarball lacks man pages, and building them would require
101 ;; DocBook & co. Thus, use Gentoo's pre-built man pages.
102 `(("man-pages"
103 ,(origin
104 (method url-fetch)
105 (uri (string-append
106 "http://distfiles.gentoo.org/distfiles/module-init-tools-" version
107 "-man.tar.bz2"))
108 (sha256
109 (base32
110 "1j1nzi87kgsh4scl645fhwhjvljxj83cmdasa4n4p5krhasgw358"))))))
111 (arguments
112 '(#:phases (alist-cons-before
113 'unpack 'unpack-man-pages
114 (lambda* (#:key inputs #:allow-other-keys)
115 (let ((man-pages (assoc-ref inputs "man-pages")))
116 (zero? (system* "tar" "xvf" man-pages))))
117 %standard-phases)))
118 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
119 (synopsis "Tools for loading and managing Linux kernel modules")
120 (description
121 "Tools for loading and managing Linux kernel modules, such as `modprobe',
122`insmod', `lsmod', and more.")
123 (license gpl2+)))
124
beacfcab
LC
125(define-public linux-libre
126 (let* ((version* "3.3.8")
127 (build-phase
128 '(lambda* (#:key system #:allow-other-keys #:rest args)
129 (let ((arch (car (string-split system #\-))))
130 (setenv "ARCH"
131 (cond ((string=? arch "i686") "i386")
132 (else arch)))
133 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
134
135 (let ((build (assoc-ref %standard-phases 'build)))
1dee732b
LC
136 (and (zero? (system* "make" "defconfig"))
137 (begin
138 (format #t "enabling additional modules...~%")
139 (substitute* ".config"
140 (("^# CONFIG_CIFS.*$")
141 "CONFIG_CIFS=m\n"))
142 (zero? (system* "make" "oldconfig")))
beacfcab
LC
143
144 ;; Call the default `build' phase so `-j' is correctly
145 ;; passed.
146 (apply build #:make-flags "all" args)))))
147 (install-phase
148 `(lambda* (#:key inputs outputs #:allow-other-keys)
149 (let* ((out (assoc-ref outputs "out"))
150 (moddir (string-append out "/lib/modules"))
151 (mit (assoc-ref inputs "module-init-tools")))
152 (mkdir-p moddir)
153 (for-each (lambda (file)
154 (copy-file file
155 (string-append out "/" (basename file))))
156 (find-files "." "^(bzImage|System\\.map)$"))
157 (copy-file ".config" (string-append out "/config"))
158 (zero? (system* "make"
159 (string-append "DEPMOD=" mit "/sbin/depmod")
160 (string-append "MODULE_DIR=" moddir)
161 (string-append "INSTALL_PATH=" out)
162 (string-append "INSTALL_MOD_PATH=" out)
163 "modules_install"))))))
164 (package
165 (name "linux-libre")
166 (version version*)
167 (source (origin
168 (method url-fetch)
169 (uri (string-append
170 "http://linux-libre.fsfla.org/pub/linux-libre/releases/3.3.8-gnu/linux-libre-"
171 version "-gnu.tar.xz"))
172 (sha256
173 (base32
174 "0jkfh0z1s6izvdnc3njm39dhzp1cg8i06jv06izwqz9w9qsprvnl"))))
175 (build-system gnu-build-system)
176 (native-inputs `(("perl" ,perl)
177 ("module-init-tools" ,module-init-tools)))
178 (arguments
179 `(#:modules ((guix build gnu-build-system)
180 (guix build utils)
181 (srfi srfi-1)
182 (ice-9 match))
183 #:phases (alist-replace
184 'build ,build-phase
185 (alist-replace
186 'install ,install-phase
187 (alist-delete 'configure %standard-phases)))
188 #:tests? #f))
189 (synopsis "GNU Linux-Libre kernel")
190 (description "Linux-Libre operating system kernel.")
191 (license gpl2)
192 (home-page "http://www.gnu.org/software/linux-libre/"))))
193
fd76c904
LC
194(define-public linux-pam
195 (package
196 (name "linux-pam")
197 (version "1.1.6")
198 (source
199 (origin
200 (method url-fetch)
201 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
202 version ".tar.bz2")
203 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
204 version ".tar.bz2")))
205 (sha256
206 (base32
207 "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s"))))
208 (build-system gnu-build-system)
209 (inputs
210 `(("flex" ,flex)
211
212 ;; TODO: optional dependencies
213 ;; ("libxcrypt" ,libxcrypt)
214 ;; ("cracklib" ,cracklib)
215 ))
216 (arguments
217 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
218 ;; isn't available.
219 '(#:tests? #f))
220 (home-page "http://www.linux-pam.org/")
221 (synopsis "Pluggable authentication modules for Linux")
222 (description
223 "A *Free* project to implement OSF's RFC 86.0.
224Pluggable authentication modules are small shared object files that can
225be used through the PAM API to perform tasks, like authenticating a user
226at login. Local and dynamic reconfiguration are its key features")
4a44e743 227 (license bsd-3)))
686f14e8
LC
228
229(define-public psmisc
230 (package
231 (name "psmisc")
232 (version "22.20")
233 (source
234 (origin
235 (method url-fetch)
236 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
237 version ".tar.gz"))
238 (sha256
239 (base32
240 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
241 (build-system gnu-build-system)
242 (inputs `(("ncurses" ,ncurses)))
243 (home-page "http://psmisc.sourceforge.net/")
244 (synopsis
245 "set of utilities that use the proc filesystem, such as fuser, killall, and pstree")
246 (description
247 "This PSmisc package is a set of some small useful utilities that
248use the proc filesystem. We're not about changing the world, but
249providing the system administrator with some help in common tasks.")
4a44e743 250 (license gpl2+)))
02b80c3f
NK
251
252(define-public util-linux
253 (package
254 (name "util-linux")
255 (version "2.21")
256 (source
257 (origin
258 (method url-fetch)
259 (uri (string-append "mirror://kernel.org/linux/utils/"
260 name "/v" version "/"
261 name "-" version ".2" ".tar.xz"))
262 (sha256
263 (base32
264 "1rpgghf7n0zx0cdy8hibr41wvkm2qp1yvd8ab1rxr193l1jmgcir"))))
265 (build-system gnu-build-system)
266 (arguments
267 `(#:configure-flags '("--disable-use-tty-group")
268 #:phases (alist-cons-after
269 'install 'patch-chkdupexe
270 (lambda* (#:key outputs #:allow-other-keys)
271 (let ((out (assoc-ref outputs "out")))
272 (substitute* (string-append out "/bin/chkdupexe")
273 ;; Allow 'patch-shebang' to do its work.
274 (("@PERL@") "/bin/perl"))))
275 %standard-phases)))
4a44e743 276 (inputs `(("zlib" ,guix:zlib)
02b80c3f
NK
277 ("ncurses" ,ncurses)
278 ("perl" ,perl)))
279 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
280 (synopsis
281 "util-linux is a random collection of utilities for the Linux kernel")
282 (description
283 "util-linux is a random collection of utilities for the Linux kernel.")
fe8ccfcc 284
02b80c3f 285 ;; Note that util-linux doesn't use the same license for all the
fe8ccfcc 286 ;; code. GPLv2+ is the default license for a code without an
02b80c3f 287 ;; explicitly defined license.
fe8ccfcc
LC
288 (license (list gpl3+ gpl2+ gpl2 lgpl2.0+
289 bsd-4 public-domain))))
5d5c4278 290
e47e3eff
LC
291(define-public procps
292 (package
293 (name "procps")
294 (version "3.2.8")
295 (source (origin
296 (method url-fetch)
297 (uri (string-append "http://procps.sourceforge.net/procps-"
298 version ".tar.gz"))
299 (sha256
300 (base32
301 "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i"))))
302 (build-system gnu-build-system)
303 (inputs `(("ncurses" ,ncurses)
304 ("patch/make-3.82" ,(search-patch "procps-make-3.82.patch"))))
305 (arguments
306 '(#:patches (list (assoc-ref %build-inputs "patch/make-3.82"))
307 #:phases (alist-replace
308 'configure
309 (lambda* (#:key outputs #:allow-other-keys)
310 ;; No `configure', just a single Makefile.
311 (let ((out (assoc-ref outputs "out")))
312 (substitute* "Makefile"
313 (("/usr/") "/")
314 (("--(owner|group) 0") "")
315 (("ldconfig") "true")
316 (("^LDFLAGS[[:blank:]]*:=(.*)$" _ value)
317 ;; Add libproc to the RPATH.
318 (string-append "LDFLAGS := -Wl,-rpath="
319 out "/lib" value))))
320 (setenv "CC" "gcc"))
321 (alist-replace
322 'install
323 (lambda* (#:key outputs #:allow-other-keys)
324 (let ((out (assoc-ref outputs "out")))
325 (and (zero?
326 (system* "make" "install"
327 (string-append "DESTDIR=" out)))
328
329 ;; Sanity check.
330 (zero?
331 (system* (string-append out "/bin/ps")
332 "--version")))))
333 %standard-phases))
334
335 ;; What did you expect? Tests?
336 #:tests? #f))
337 (home-page "http://procps.sourceforge.net/")
338 (synopsis
339 "Utilities that give information about processes using the /proc filesystem")
340 (description
341 "procps is the package that has a bunch of small useful utilities
342that give information about processes using the Linux /proc file system.
343The package includes the programs ps, top, vmstat, w, kill, free,
344slabtop, and skill.")
345 (license gpl2)))
346
5d5c4278
NK
347(define-public usbutils
348 (package
349 (name "usbutils")
350 (version "006")
351 (source
352 (origin
353 (method url-fetch)
354 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
355 "usbutils-" version ".tar.xz"))
356 (sha256
357 (base32
358 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
359 (build-system gnu-build-system)
360 (inputs
361 `(("libusb" ,libusb) ("pkg-config" ,pkg-config)))
362 (home-page "http://www.linux-usb.org/")
363 (synopsis
364 "Tools for working with USB devices, such as lsusb")
365 (description
366 "Tools for working with USB devices, such as lsusb.")
4050e5d6 367 (license gpl2+)))
0750452a
LC
368
369(define-public e2fsprogs
370 (package
371 (name "e2fsprogs")
372 (version "1.42.7")
373 (source (origin
374 (method url-fetch)
375 (uri (string-append "mirror://sourceforge/e2fsprogs/e2fsprogs-"
376 version ".tar.gz"))
377 (sha256
378 (base32
379 "0ibkkvp6kan0hn0d1anq4n2md70j5gcm7mwna515w82xwyr02rfw"))))
380 (build-system gnu-build-system)
381 (inputs `(("util-linux" ,util-linux)
382 ("pkg-config" ,pkg-config)))
383 (arguments
384 '(#:phases (alist-cons-before
385 'configure 'patch-shells
386 (lambda _
387 (substitute* "configure"
388 (("/bin/sh (.*)parse-types.sh" _ dir)
389 (string-append (which "sh") " " dir
390 "parse-types.sh")))
391 (substitute* (find-files "." "^Makefile.in$")
392 (("#!/bin/sh")
393 (string-append "#!" (which "sh")))))
394 %standard-phases)
395
396 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
397 ;; they fail because we get an extra line that says "Can't check if
398 ;; filesystem is mounted due to missing mtab file".
399 #:tests? #f))
400 (home-page "http://e2fsprogs.sourceforge.net/")
401 (synopsis "Tools for creating and checking ext2/ext3/ext4 filesystems")
402 (description
403 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
404 (license (list gpl2 ; programs
405 lgpl2.0 ; libext2fs
406 x11)))) ; libuuid