linux-initrd: Add USB kernel modules to the default initrd.
[jackhill/guix/guix.git] / gnu / packages / grub.scm
CommitLineData
65d8b777 1;;; GNU Guix --- Functional package management for GNU
9b24c768 2;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
65d8b777
LC
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (gnu packages grub)
20 #:use-module (guix download)
21 #:use-module (guix packages)
22 #:use-module ((guix licenses) #:select (gpl3+))
23 #:use-module (guix build-system gnu)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages flex)
26 #:use-module (gnu packages bison)
1dba6407 27 #:use-module (gnu packages gettext)
a86177d6 28 #:use-module (gnu packages fontutils)
65d8b777
LC
29 #:use-module (gnu packages linux)
30 #:use-module (gnu packages qemu)
31 #:use-module (gnu packages ncurses)
6facbc75 32 #:use-module (gnu packages cdrom)
0ded70f3 33 #:use-module (srfi srfi-1))
6facbc75
LC
34
35(define qemu-for-tests
36 ;; Newer QEMU versions, such as 1.5.1, no longer support the 'shutdown'
37 ;; instruction. This leads to test hangs, as reported at
38 ;; <https://bugs.launchpad.net/bugs/947597> and fixed at
39 ;; <http://bzr.savannah.gnu.org/lh/grub/trunk/grub/revision/4828>.
40 ;; Work around it by using an older QEMU.
4942d42a 41 (package (inherit qemu-headless)
6facbc75
LC
42 (version "1.3.1")
43 (source (origin
44 (method url-fetch)
45 (uri (string-append "http://wiki.qemu-project.org/download/qemu-"
46 version ".tar.bz2"))
47 (sha256
48 (base32
49 "1bqfrb5dlsxm8gxhkksz8qzi5fhj3xqhxyfwbqcphhcv1kpyfwip"))))
50
51 ;; With recent GLib versions, we get a test failure:
52 ;; ERROR:tests/rtc-test.c:176:check_time: assertion failed (ABS(t - s) <= wiggle): (382597824 <= 2)
53 ;; Simply disable the tests.
54 (arguments `(#:tests? #f
55 ,@(package-arguments qemu)))
56
57 ;; The manual fails to build with Texinfo 5.x.
58 (native-inputs (alist-delete "texinfo" (package-native-inputs qemu)))))
65d8b777 59
9b24c768
LC
60(define unifont
61 ;; GNU Unifont, <http://gnu.org/s/unifont>.
62 ;; GRUB needs it for its graphical terminal, gfxterm.
63 (origin
64 (method url-fetch)
65 (uri
66 "http://unifoundry.com/pub/unifont-7.0.06/font-builds/unifont-7.0.06.bdf.gz")
67 (sha256
68 (base32
69 "0p2vhnc18cnbmb39vq4m7hzv4mhnm2l0a2s7gx3ar277fwng3hys"))))
70
65d8b777
LC
71(define-public grub
72 (package
73 (name "grub")
74 (version "2.00")
75 (source (origin
76 (method url-fetch)
77 (uri (string-append "mirror://gnu/grub/grub-"
78 version ".tar.xz"))
79 (sha256
80 (base32
01eafd38
LC
81 "0n64hpmsccvicagvr0c6v0kgp2yw0kgnd3jvsyd26cnwgs7c6kkq"))
82 (patches (list (search-patch "grub-gets-undeclared.patch")))))
65d8b777
LC
83 (build-system gnu-build-system)
84 (arguments
01eafd38 85 '(#:configure-flags '("--disable-werror")
65d8b777
LC
86 #:phases (alist-cons-before
87 'patch-source-shebangs 'patch-stuff
9b24c768 88 (lambda* (#:key inputs #:allow-other-keys)
65d8b777
LC
89 (substitute* "grub-core/Makefile.in"
90 (("/bin/sh") (which "sh")))
91
9b24c768
LC
92 ;; Make the font visible.
93 (copy-file (assoc-ref inputs "unifont") "unifont.bdf.gz")
94 (system* "gunzip" "unifont.bdf.gz")
95
65d8b777
LC
96 ;; TODO: Re-enable this test when we have Parted.
97 (substitute* "tests/partmap_test.in"
98 (("set -e") "exit 77")))
99 %standard-phases)))
100 (inputs
101 `(;; ("lvm2" ,lvm2)
1dba6407 102 ("gettext" ,gnu-gettext)
65d8b777
LC
103 ("freetype" ,freetype)
104 ;; ("libusb" ,libusb)
01eafd38 105 ("ncurses" ,ncurses)))
65d8b777 106 (native-inputs
9b24c768
LC
107 `(("unifont" ,unifont)
108 ("bison" ,bison)
65d8b777
LC
109 ("flex" ,flex)
110
111 ;; Dependencies for the test suite. The "real" QEMU is needed here,
112 ;; because several targets are used.
6facbc75 113 ("qemu" ,qemu-for-tests)
65d8b777
LC
114 ("xorriso" ,xorriso)))
115 (home-page "http://www.gnu.org/software/grub/")
79c311b8 116 (synopsis "GRand Unified Boot loader")
65d8b777 117 (description
a22dc0c4 118 "GRUB is a multiboot bootloader. It is used for initially loading the
35b9e423 119kernel of an operating system and then transferring control to it. The kernel
c5779c93 120then goes on to load the rest of the operating system. As a multiboot
574e86f9
LC
121bootloader, GRUB handles the presence of multiple operating systems installed
122on the same computer; upon booting the computer, the user is presented with a
a22dc0c4 123menu to select one of the installed operating systems.")
65d8b777 124 (license gpl3+)))