2013-02-10 18:48:23 +01:00
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
2017-02-07 11:14:09 +01:00
|
|
|
;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
2015-08-15 07:22:06 +02:00
|
|
|
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
|
2015-12-20 00:18:43 +01:00
|
|
|
;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
|
2016-06-16 09:50:27 +02:00
|
|
|
;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
|
2017-10-26 14:52:19 +02:00
|
|
|
;;; Copyright © 2016, 2017, 2018 Marius Bakke <mbakke@fastmail.com>
|
2017-02-09 19:46:47 +01:00
|
|
|
;;; Copyright © 2016, 2017 Danny Milosavljevic <dannym@scratchpost.org>
|
|
|
|
;;; Copyright © 2016, 2017 David Craven <david@craven.ch>
|
2018-01-10 20:06:05 +01:00
|
|
|
;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
|
2013-02-10 18:48:23 +01:00
|
|
|
;;;
|
|
|
|
;;; This file is part of GNU Guix.
|
|
|
|
;;;
|
|
|
|
;;; GNU Guix is free software; you can redistribute it and/or modify it
|
|
|
|
;;; under the terms of the GNU General Public License as published by
|
|
|
|
;;; the Free Software Foundation; either version 3 of the License, or (at
|
|
|
|
;;; your option) any later version.
|
|
|
|
;;;
|
|
|
|
;;; GNU Guix is distributed in the hope that it will be useful, but
|
|
|
|
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;;; GNU General Public License for more details.
|
|
|
|
;;;
|
|
|
|
;;; You should have received a copy of the GNU General Public License
|
|
|
|
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2017-02-09 19:46:47 +01:00
|
|
|
(define-module (gnu packages bootloaders)
|
2013-02-10 18:48:23 +01:00
|
|
|
#:use-module (gnu packages)
|
2017-02-09 19:46:47 +01:00
|
|
|
#:use-module (gnu packages admin)
|
|
|
|
#:use-module ((gnu packages algebra) #:select (bc))
|
|
|
|
#:use-module (gnu packages assembly)
|
2017-10-26 14:52:19 +02:00
|
|
|
#:use-module (gnu packages base)
|
2015-12-04 18:00:32 +01:00
|
|
|
#:use-module (gnu packages disk)
|
2013-02-10 18:48:23 +01:00
|
|
|
#:use-module (gnu packages bison)
|
2017-02-09 19:46:47 +01:00
|
|
|
#:use-module (gnu packages cdrom)
|
|
|
|
#:use-module (gnu packages cross-base)
|
|
|
|
#:use-module (gnu packages disk)
|
|
|
|
#:use-module (gnu packages flex)
|
2013-02-12 13:19:26 +01:00
|
|
|
#:use-module (gnu packages fontutils)
|
2017-02-09 19:46:47 +01:00
|
|
|
#:use-module (gnu packages gettext)
|
2013-02-10 18:48:23 +01:00
|
|
|
#:use-module (gnu packages linux)
|
2017-02-09 19:46:47 +01:00
|
|
|
#:use-module (gnu packages man)
|
2017-07-21 01:06:45 +02:00
|
|
|
#:use-module (gnu packages mtools)
|
2017-02-09 19:46:47 +01:00
|
|
|
#:use-module (gnu packages ncurses)
|
2017-02-09 19:21:22 +01:00
|
|
|
#:use-module (gnu packages perl)
|
2017-10-26 14:52:19 +02:00
|
|
|
#:use-module (gnu packages pkg-config)
|
2017-02-09 19:21:22 +01:00
|
|
|
#:use-module (gnu packages python)
|
2015-08-19 19:57:30 +02:00
|
|
|
#:use-module (gnu packages texinfo)
|
2017-10-26 14:52:19 +02:00
|
|
|
#:use-module (gnu packages tls)
|
2017-11-06 19:34:31 +01:00
|
|
|
#:use-module (gnu packages swig)
|
2017-07-12 14:35:57 +02:00
|
|
|
#:use-module (gnu packages virtualization)
|
2017-10-26 14:52:19 +02:00
|
|
|
#:use-module (gnu packages web)
|
2017-02-09 19:46:47 +01:00
|
|
|
#:use-module (guix build-system gnu)
|
|
|
|
#:use-module (guix download)
|
|
|
|
#:use-module (guix git-download)
|
|
|
|
#:use-module ((guix licenses) #:prefix license:)
|
|
|
|
#:use-module (guix packages)
|
2017-11-29 19:34:15 +01:00
|
|
|
#:use-module (guix utils)
|
|
|
|
#:use-module (srfi srfi-1)
|
|
|
|
#:use-module (srfi srfi-26))
|
2013-02-10 18:48:23 +01:00
|
|
|
|
2014-11-08 00:30:52 +01:00
|
|
|
(define unifont
|
|
|
|
;; GNU Unifont, <http://gnu.org/s/unifont>.
|
|
|
|
;; GRUB needs it for its graphical terminal, gfxterm.
|
|
|
|
(origin
|
|
|
|
(method url-fetch)
|
|
|
|
(uri
|
|
|
|
"http://unifoundry.com/pub/unifont-7.0.06/font-builds/unifont-7.0.06.bdf.gz")
|
|
|
|
(sha256
|
|
|
|
(base32
|
|
|
|
"0p2vhnc18cnbmb39vq4m7hzv4mhnm2l0a2s7gx3ar277fwng3hys"))))
|
|
|
|
|
2013-02-10 18:48:23 +01:00
|
|
|
(define-public grub
|
|
|
|
(package
|
|
|
|
(name "grub")
|
2017-04-21 21:03:53 +02:00
|
|
|
(version "2.02")
|
2013-02-10 18:48:23 +01:00
|
|
|
(source (origin
|
|
|
|
(method url-fetch)
|
2017-04-21 21:03:53 +02:00
|
|
|
(uri (string-append "mirror://gnu/grub/grub-" version ".tar.xz"))
|
2013-02-10 18:48:23 +01:00
|
|
|
(sha256
|
|
|
|
(base32
|
2017-04-21 21:03:53 +02:00
|
|
|
"03vvdfhdmf16121v7xs8is2krwnv15wpkhkf16a4yf8nsfc3f2w1"))))
|
2013-02-10 18:48:23 +01:00
|
|
|
(build-system gnu-build-system)
|
|
|
|
(arguments
|
2017-11-28 10:25:00 +01:00
|
|
|
`(#:phases (modify-phases %standard-phases
|
2016-10-05 15:08:38 +02:00
|
|
|
(add-after 'unpack 'patch-stuff
|
2015-08-15 07:22:06 +02:00
|
|
|
(lambda* (#:key inputs #:allow-other-keys)
|
|
|
|
(substitute* "grub-core/Makefile.in"
|
|
|
|
(("/bin/sh") (which "sh")))
|
2013-02-10 18:48:23 +01:00
|
|
|
|
2016-10-05 15:08:38 +02:00
|
|
|
;; Give the absolute file name of 'mdadm', used to
|
|
|
|
;; determine the root file system when it's a RAID
|
|
|
|
;; device. Failing to do that, 'grub-probe' silently
|
|
|
|
;; fails if 'mdadm' is not in $PATH.
|
|
|
|
(substitute* "grub-core/osdep/linux/getroot.c"
|
|
|
|
(("argv\\[0\\] = \"mdadm\"")
|
|
|
|
(string-append "argv[0] = \""
|
|
|
|
(assoc-ref inputs "mdadm")
|
|
|
|
"/sbin/mdadm\"")))
|
|
|
|
|
2015-08-15 07:22:06 +02:00
|
|
|
;; Make the font visible.
|
|
|
|
(copy-file (assoc-ref inputs "unifont") "unifont.bdf.gz")
|
|
|
|
(system* "gunzip" "unifont.bdf.gz")
|
2017-06-24 19:17:37 +02:00
|
|
|
#t))
|
|
|
|
(add-before 'check 'disable-flaky-test
|
|
|
|
(lambda _
|
|
|
|
;; This test is unreliable. For more information, see:
|
|
|
|
;; <https://bugs.gnu.org/26936>.
|
|
|
|
(substitute* "Makefile.in"
|
|
|
|
(("grub_cmd_date grub_cmd_set_date grub_cmd_sleep")
|
|
|
|
"grub_cmd_date grub_cmd_sleep"))
|
2017-11-28 10:25:00 +01:00
|
|
|
#t)))
|
2017-11-29 19:34:15 +01:00
|
|
|
;; Disable tests on ARM and AARCH64 platforms.
|
|
|
|
#:tests? ,(not (any (cute string-prefix? <> (or (%current-target-system)
|
|
|
|
(%current-system)))
|
|
|
|
'("arm" "aarch64")))))
|
2013-02-10 18:48:23 +01:00
|
|
|
(inputs
|
2016-11-22 11:26:02 +01:00
|
|
|
`(("gettext" ,gettext-minimal)
|
|
|
|
|
|
|
|
;; Depend on LVM2 for libdevmapper, used by 'grub-probe' and
|
|
|
|
;; 'grub-install' to recognize mapped devices (LUKS, etc.)
|
|
|
|
("lvm2" ,lvm2)
|
|
|
|
|
|
|
|
;; Depend on mdadm, which is invoked by 'grub-probe' and 'grub-install'
|
|
|
|
;; to determine whether the root file system is RAID.
|
2016-10-05 15:08:38 +02:00
|
|
|
("mdadm" ,mdadm)
|
2016-11-22 11:26:02 +01:00
|
|
|
|
2013-02-10 18:48:23 +01:00
|
|
|
("freetype" ,freetype)
|
|
|
|
;; ("libusb" ,libusb)
|
2015-08-15 07:22:06 +02:00
|
|
|
;; ("fuse" ,fuse)
|
gnu: Use the 'patches' field of <origin>.
* gnu/packages/apr.scm,
gnu/packages/autotools.scm,
gnu/packages/avahi.scm,
gnu/packages/cdrom.scm,
gnu/packages/cmake.scm,
gnu/packages/cpio.scm,
gnu/packages/cross-base.scm,
gnu/packages/emacs.scm,
gnu/packages/flex.scm,
gnu/packages/fontutils.scm,
gnu/packages/glib.scm,
gnu/packages/grub.scm,
gnu/packages/guile.scm,
gnu/packages/idutils.scm,
gnu/packages/libevent.scm,
gnu/packages/linux.scm,
gnu/packages/mail.scm,
gnu/packages/make-bootstrap.scm,
gnu/packages/mp3.scm,
gnu/packages/oggvorbis.scm,
gnu/packages/pdf.scm,
gnu/packages/plotutils.scm,
gnu/packages/qemu.scm,
gnu/packages/recutils.scm,
gnu/packages/rush.scm,
gnu/packages/scheme.scm,
gnu/packages/system.scm,
gnu/packages/tcsh.scm,
gnu/packages/valgrind.scm,
gnu/packages/vpn.scm,
gnu/packages/w3m: Use the 'patches' field of <origin> instead of
adding a patch as input plus using #:patches.
2013-10-09 00:09:04 +02:00
|
|
|
("ncurses" ,ncurses)))
|
2013-02-10 18:48:23 +01:00
|
|
|
(native-inputs
|
2014-11-08 00:30:52 +01:00
|
|
|
`(("unifont" ,unifont)
|
|
|
|
("bison" ,bison)
|
2017-03-08 04:38:35 +01:00
|
|
|
;; Due to a bug in flex >= 2.6.2, GRUB must be built with an older flex:
|
|
|
|
;; <http://lists.gnu.org/archive/html/grub-devel/2017-02/msg00133.html>
|
|
|
|
;; TODO Try building with flex > 2.6.4.
|
|
|
|
("flex" ,flex-2.6.1)
|
2015-08-19 19:57:30 +02:00
|
|
|
("texinfo" ,texinfo)
|
|
|
|
("help2man" ,help2man)
|
2013-02-10 18:48:23 +01:00
|
|
|
|
|
|
|
;; Dependencies for the test suite. The "real" QEMU is needed here,
|
|
|
|
;; because several targets are used.
|
2015-12-04 18:00:32 +01:00
|
|
|
("parted" ,parted)
|
2016-12-19 23:22:07 +01:00
|
|
|
("qemu" ,qemu-minimal)
|
2013-02-10 18:48:23 +01:00
|
|
|
("xorriso" ,xorriso)))
|
2016-08-27 15:47:19 +02:00
|
|
|
(home-page "https://www.gnu.org/software/grub/")
|
2013-12-01 22:33:23 +01:00
|
|
|
(synopsis "GRand Unified Boot loader")
|
2013-02-10 18:48:23 +01:00
|
|
|
(description
|
Synchronize package descriptions with the Womb.
* gnu/packages/algebra.scm,
gnu/packages/aspell.scm,
gnu/packages/autotools.scm,
gnu/packages/base.scm,
gnu/packages/bash.scm,
gnu/packages/bison.scm,
gnu/packages/cdrom.scm,
gnu/packages/cflow.scm,
gnu/packages/compression.scm,
gnu/packages/cpio.scm,
gnu/packages/cppi.scm,
gnu/packages/ddrescue.scm,
gnu/packages/dejagnu.scm,
gnu/packages/ed.scm,
gnu/packages/emacs.scm,
gnu/packages/fdisk.scm,
gnu/packages/freeipmi.scm,
gnu/packages/gawk.scm,
gnu/packages/gcal.scm,
gnu/packages/gcc.scm,
gnu/packages/gdb.scm,
gnu/packages/gdbm.scm,
gnu/packages/gettext.scm,
gnu/packages/ghostscript.scm,
gnu/packages/global.scm,
gnu/packages/gnunet.scm,
gnu/packages/gnupg.scm,
gnu/packages/gnutls.scm,
gnu/packages/gperf.scm,
gnu/packages/gprolog.scm,
gnu/packages/groff.scm,
gnu/packages/grub.scm,
gnu/packages/gsasl.scm,
gnu/packages/guile.scm,
gnu/packages/gv.scm,
gnu/packages/help2man.scm,
gnu/packages/idutils.scm,
gnu/packages/indent.scm,
gnu/packages/less.scm,
gnu/packages/libidn.scm,
gnu/packages/libsigsegv.scm,
gnu/packages/libunistring.scm,
gnu/packages/lightning.scm,
gnu/packages/linux.scm,
gnu/packages/lsh.scm,
gnu/packages/m4.scm,
gnu/packages/mail.scm,
gnu/packages/maths.scm,
gnu/packages/multiprecision.scm,
gnu/packages/nano.scm,
gnu/packages/ncurses.scm,
gnu/packages/nettle.scm,
gnu/packages/ocrad.scm,
gnu/packages/oggvorbis.scm,
gnu/packages/parted.scm,
gnu/packages/plotutils.scm,
gnu/packages/pth.scm,
gnu/packages/readline.scm,
gnu/packages/recutils.scm,
gnu/packages/rush.scm,
gnu/packages/scheme.scm,
gnu/packages/screen.scm,
gnu/packages/shishi.scm,
gnu/packages/smalltalk.scm,
gnu/packages/system.scm,
gnu/packages/texinfo.scm,
gnu/packages/time.scm,
gnu/packages/unrtf.scm,
gnu/packages/version-control.scm,
gnu/packages/wdiff.scm,
gnu/packages/wget.scm,
gnu/packages/which.scm,
gnu/packages/xnee.scm,
gnu/packages/zile.scm: Change value of the 'description' field to that
of the Womb.
2013-10-09 16:14:23 +02:00
|
|
|
"GRUB is a multiboot bootloader. It is used for initially loading the
|
gnu: Some cleanup based on lint checkers.
* gnu/packages/admin.scm, gnu/packages/aidc.scm, gnu/packages/algebra.scm,
gnu/packages/apr.scm, gnu/packages/avahi.scm, gnu/packages/backup.scm,
gnu/packages/base.scm, gnu/packages/calcurse.scm, gnu/packages/cdrom.scm,
gnu/packages/check.scm, gnu/packages/compression.scm, gnu/packages/cook.scm,
gnu/packages/crypto.scm, gnu/packages/cryptsetup.scm, gnu/packages/curl.scm,
gnu/packages/cyrus-sasl.scm, gnu/packages/databases.scm,
gnu/packages/doxygen.scm, gnu/packages/dwm.scm, gnu/packages/elf.scm,
gnu/packages/emacs.scm, gnu/packages/feh.scm, gnu/packages/file.scm,
gnu/packages/fish.scm, gnu/packages/flex.scm, gnu/packages/fltk.scm,
gnu/packages/fontutils.scm, gnu/packages/games.scm, gnu/packages/gcal.scm,
gnu/packages/gcc.scm, gnu/packages/geeqie.scm, gnu/packages/ghostscript.scm,
gnu/packages/gimp.scm, gnu/packages/gl.scm, gnu/packages/glib.scm,
gnu/packages/gnome.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm,
gnu/packages/gperf.scm, gnu/packages/grub.scm, gnu/packages/gsasl.scm,
gnu/packages/gtk.scm, gnu/packages/guile-wm.scm, gnu/packages/guile.scm,
gnu/packages/hurd.scm, gnu/packages/icu4c.scm, gnu/packages/image.scm,
gnu/packages/imagemagick.scm, gnu/packages/irssi.scm, gnu/packages/kde.scm,
gnu/packages/libdaemon.scm, gnu/packages/libevent.scm,
gnu/packages/libidn.scm, gnu/packages/libusb.scm, gnu/packages/linux.scm,
gnu/packages/lout.scm, gnu/packages/lsh.scm, gnu/packages/lsof.scm,
gnu/packages/lua.scm, gnu/packages/maths.scm, gnu/packages/mcrypt.scm,
gnu/packages/mp3.scm, gnu/packages/netpbm.scm, gnu/packages/noweb.scm,
gnu/packages/ocaml.scm, gnu/packages/openssl.scm, gnu/packages/pcre.scm,
gnu/packages/pdf.scm, gnu/packages/pkg-config.scm,
gnu/packages/pretty-print.scm, gnu/packages/python.scm, gnu/packages/qt.scm,
gnu/packages/rsync.scm, gnu/packages/scheme.scm, gnu/packages/scrot.scm,
gnu/packages/sdl.scm, gnu/packages/skribilo.scm, gnu/packages/ssh.scm,
gnu/packages/stalonetray.scm, gnu/packages/tcl.scm, gnu/packages/tcsh.scm,
gnu/packages/telephony.scm, gnu/packages/texlive.scm, gnu/packages/tor.scm,
gnu/packages/valgrind.scm, gnu/packages/version-control.scm,
gnu/packages/vim.scm, gnu/packages/vpn.scm, gnu/packages/w3m.scm,
gnu/packages/web.scm, gnu/packages/wordnet.scm, gnu/packages/xiph.scm,
gnu/packages/xml.scm, gnu/packages/xorg.scm, gnu/packages/zile.scm,
gnu/packages/zip.scm, gnu/packages/zsh.scm [synopsis, description]: Adjust
according to lint checkers.
* gnu/packages/fltk.scm (fltk)[source]: Wrap long line in uri.
* /gnu/packages/xiph.scm (libogg, libtheora, vorbis-tools)[source]: Same.
2014-10-24 06:46:59 +02:00
|
|
|
kernel of an operating system and then transferring control to it. The kernel
|
2014-09-13 15:31:31 +02:00
|
|
|
then goes on to load the rest of the operating system. As a multiboot
|
2014-04-06 21:17:42 +02:00
|
|
|
bootloader, GRUB handles the presence of multiple operating systems installed
|
|
|
|
on the same computer; upon booting the computer, the user is presented with a
|
Synchronize package descriptions with the Womb.
* gnu/packages/algebra.scm,
gnu/packages/aspell.scm,
gnu/packages/autotools.scm,
gnu/packages/base.scm,
gnu/packages/bash.scm,
gnu/packages/bison.scm,
gnu/packages/cdrom.scm,
gnu/packages/cflow.scm,
gnu/packages/compression.scm,
gnu/packages/cpio.scm,
gnu/packages/cppi.scm,
gnu/packages/ddrescue.scm,
gnu/packages/dejagnu.scm,
gnu/packages/ed.scm,
gnu/packages/emacs.scm,
gnu/packages/fdisk.scm,
gnu/packages/freeipmi.scm,
gnu/packages/gawk.scm,
gnu/packages/gcal.scm,
gnu/packages/gcc.scm,
gnu/packages/gdb.scm,
gnu/packages/gdbm.scm,
gnu/packages/gettext.scm,
gnu/packages/ghostscript.scm,
gnu/packages/global.scm,
gnu/packages/gnunet.scm,
gnu/packages/gnupg.scm,
gnu/packages/gnutls.scm,
gnu/packages/gperf.scm,
gnu/packages/gprolog.scm,
gnu/packages/groff.scm,
gnu/packages/grub.scm,
gnu/packages/gsasl.scm,
gnu/packages/guile.scm,
gnu/packages/gv.scm,
gnu/packages/help2man.scm,
gnu/packages/idutils.scm,
gnu/packages/indent.scm,
gnu/packages/less.scm,
gnu/packages/libidn.scm,
gnu/packages/libsigsegv.scm,
gnu/packages/libunistring.scm,
gnu/packages/lightning.scm,
gnu/packages/linux.scm,
gnu/packages/lsh.scm,
gnu/packages/m4.scm,
gnu/packages/mail.scm,
gnu/packages/maths.scm,
gnu/packages/multiprecision.scm,
gnu/packages/nano.scm,
gnu/packages/ncurses.scm,
gnu/packages/nettle.scm,
gnu/packages/ocrad.scm,
gnu/packages/oggvorbis.scm,
gnu/packages/parted.scm,
gnu/packages/plotutils.scm,
gnu/packages/pth.scm,
gnu/packages/readline.scm,
gnu/packages/recutils.scm,
gnu/packages/rush.scm,
gnu/packages/scheme.scm,
gnu/packages/screen.scm,
gnu/packages/shishi.scm,
gnu/packages/smalltalk.scm,
gnu/packages/system.scm,
gnu/packages/texinfo.scm,
gnu/packages/time.scm,
gnu/packages/unrtf.scm,
gnu/packages/version-control.scm,
gnu/packages/wdiff.scm,
gnu/packages/wget.scm,
gnu/packages/which.scm,
gnu/packages/xnee.scm,
gnu/packages/zile.scm: Change value of the 'description' field to that
of the Womb.
2013-10-09 16:14:23 +02:00
|
|
|
menu to select one of the installed operating systems.")
|
2017-01-16 20:17:46 +01:00
|
|
|
(license license:gpl3+)
|
2016-05-17 18:04:13 +02:00
|
|
|
(properties '((cpe-name . "grub2")))))
|
2016-10-20 18:26:52 +02:00
|
|
|
|
|
|
|
(define-public grub-efi
|
|
|
|
(package
|
|
|
|
(inherit grub)
|
|
|
|
(name "grub-efi")
|
|
|
|
(synopsis "GRand Unified Boot loader (UEFI version)")
|
|
|
|
(inputs
|
|
|
|
`(("efibootmgr" ,efibootmgr)
|
2017-07-21 01:06:45 +02:00
|
|
|
("mtools", mtools)
|
2016-10-20 18:26:52 +02:00
|
|
|
,@(package-inputs grub)))
|
|
|
|
(arguments
|
|
|
|
`(;; TODO: Tests need a UEFI firmware for qemu. There is one at
|
|
|
|
;; https://github.com/tianocore/edk2/tree/master/OvmfPkg .
|
|
|
|
;; Search for 'OVMF' in "tests/util/grub-shell.in".
|
|
|
|
,@(substitute-keyword-arguments (package-arguments grub)
|
2017-11-30 09:17:09 +01:00
|
|
|
((#:tests? _ #f) #f)
|
2017-02-07 11:14:09 +01:00
|
|
|
((#:configure-flags flags ''())
|
|
|
|
`(cons "--with-platform=efi" ,flags))
|
2016-10-20 18:26:52 +02:00
|
|
|
((#:phases phases)
|
|
|
|
`(modify-phases ,phases
|
|
|
|
(add-after 'patch-stuff 'use-absolute-efibootmgr-path
|
|
|
|
(lambda* (#:key inputs #:allow-other-keys)
|
|
|
|
(substitute* "grub-core/osdep/unix/platform.c"
|
|
|
|
(("efibootmgr")
|
|
|
|
(string-append (assoc-ref inputs "efibootmgr")
|
|
|
|
"/sbin/efibootmgr")))
|
2017-07-21 01:06:45 +02:00
|
|
|
#t))
|
|
|
|
(add-after 'patch-stuff 'use-absolute-mtools-path
|
|
|
|
(lambda* (#:key inputs #:allow-other-keys)
|
|
|
|
(let ((mtools (assoc-ref inputs "mtools")))
|
|
|
|
(substitute* "util/grub-mkrescue.c"
|
|
|
|
(("\"mformat\"")
|
|
|
|
(string-append "\"" mtools
|
|
|
|
"/bin/mformat\"")))
|
|
|
|
(substitute* "util/grub-mkrescue.c"
|
|
|
|
(("\"mcopy\"")
|
|
|
|
(string-append "\"" mtools
|
|
|
|
"/bin/mcopy\"")))
|
|
|
|
#t))))))))))
|
2017-02-09 19:21:22 +01:00
|
|
|
|
2017-07-21 01:06:47 +02:00
|
|
|
;; Because grub searches hardcoded paths it's easiest to just build grub
|
|
|
|
;; again to make it find both grub-pc and grub-efi. There is a command
|
|
|
|
;; line argument which allows you to specify ONE platform - but
|
|
|
|
;; grub-mkrescue will use multiple platforms if they are available
|
|
|
|
;; in the installation directory (without command line argument).
|
|
|
|
(define-public grub-hybrid
|
|
|
|
(package
|
|
|
|
(inherit grub-efi)
|
|
|
|
(name "grub-hybrid")
|
|
|
|
(synopsis "GRand Unified Boot loader (hybrid version)")
|
|
|
|
(inputs
|
|
|
|
`(("grub" ,grub)
|
|
|
|
,@(package-inputs grub-efi)))
|
|
|
|
(arguments
|
|
|
|
(substitute-keyword-arguments (package-arguments grub-efi)
|
|
|
|
((#:modules modules `((guix build utils) (guix build gnu-build-system)))
|
|
|
|
`((ice-9 ftw) ,@modules))
|
|
|
|
((#:phases phases)
|
|
|
|
`(modify-phases ,phases
|
|
|
|
(add-after 'install 'install-non-efi
|
|
|
|
(lambda* (#:key inputs outputs #:allow-other-keys)
|
|
|
|
(let ((input-dir (string-append (assoc-ref inputs "grub")
|
|
|
|
"/lib/grub"))
|
|
|
|
(output-dir (string-append (assoc-ref outputs "out")
|
|
|
|
"/lib/grub")))
|
|
|
|
(for-each
|
|
|
|
(lambda (basename)
|
2018-01-10 20:06:05 +01:00
|
|
|
(if (not (or (string-prefix? "." basename)
|
|
|
|
(file-exists? (string-append output-dir "/" basename))))
|
2017-07-21 01:06:47 +02:00
|
|
|
(symlink (string-append input-dir "/" basename)
|
|
|
|
(string-append output-dir "/" basename))))
|
|
|
|
(scandir input-dir))
|
|
|
|
#t)))))))))
|
|
|
|
|
2017-02-09 19:21:22 +01:00
|
|
|
(define-public syslinux
|
|
|
|
(let ((commit "bb41e935cc83c6242de24d2271e067d76af3585c"))
|
|
|
|
(package
|
|
|
|
(name "syslinux")
|
|
|
|
(version (git-version "6.04-pre" "1" commit))
|
|
|
|
(source (origin
|
|
|
|
(method git-fetch)
|
|
|
|
(uri (git-reference
|
|
|
|
(url "https://github.com/geneC/syslinux")
|
|
|
|
(commit commit)))
|
|
|
|
(file-name (git-file-name name version))
|
|
|
|
(sha256
|
|
|
|
(base32
|
|
|
|
"0k8dvafd6410kqxf3kyr4y8jzmpmrih6wbjqg6gklak7945yflrc"))))
|
|
|
|
(build-system gnu-build-system)
|
|
|
|
(native-inputs
|
|
|
|
`(("nasm" ,nasm)
|
|
|
|
("perl" ,perl)
|
|
|
|
("python-2" ,python-2)))
|
|
|
|
(inputs
|
2017-11-16 10:41:04 +01:00
|
|
|
`(("libuuid" ,util-linux)
|
|
|
|
("mtools" ,mtools)))
|
2017-02-09 19:21:22 +01:00
|
|
|
(arguments
|
|
|
|
`(#:parallel-build? #f
|
|
|
|
#:make-flags
|
|
|
|
(list (string-append "BINDIR=" %output "/bin")
|
|
|
|
(string-append "SBINDIR=" %output "/sbin")
|
|
|
|
(string-append "LIBDIR=" %output "/lib")
|
|
|
|
(string-append "INCDIR=" %output "/include")
|
|
|
|
(string-append "DATADIR=" %output "/share")
|
|
|
|
(string-append "MANDIR=" %output "/share/man")
|
|
|
|
"PERL=perl"
|
|
|
|
"bios")
|
|
|
|
#:phases
|
|
|
|
(modify-phases %standard-phases
|
|
|
|
(add-after 'unpack 'patch-files
|
2017-11-16 10:41:04 +01:00
|
|
|
(lambda* (#:key inputs #:allow-other-keys)
|
2017-02-09 19:21:22 +01:00
|
|
|
(substitute* (find-files "." "Makefile.*|ppmtolss16")
|
|
|
|
(("/bin/pwd") (which "pwd"))
|
|
|
|
(("/bin/echo") (which "echo"))
|
|
|
|
(("/usr/bin/perl") (which "perl")))
|
2017-11-16 10:41:04 +01:00
|
|
|
(let ((mtools (assoc-ref inputs "mtools")))
|
|
|
|
(substitute* (find-files "." "\\.c$")
|
|
|
|
(("mcopy")
|
|
|
|
(string-append mtools "/bin/mcopy"))
|
|
|
|
(("mattrib")
|
|
|
|
(string-append mtools "/bin/mattrib"))))
|
2017-02-09 19:21:22 +01:00
|
|
|
#t))
|
|
|
|
(delete 'configure)
|
|
|
|
(add-before 'build 'set-permissions
|
|
|
|
(lambda _
|
|
|
|
(zero? (system* "chmod" "a+w" "utils/isohybrid.in"))))
|
|
|
|
(replace 'check
|
|
|
|
(lambda _
|
|
|
|
(setenv "CC" "gcc")
|
|
|
|
(substitute* "tests/unittest/include/unittest/unittest.h"
|
|
|
|
;; Don't look up headers under /usr.
|
|
|
|
(("/usr/include/") ""))
|
|
|
|
(zero? (system* "make" "unittest")))))))
|
|
|
|
(home-page "http://www.syslinux.org")
|
|
|
|
(synopsis "Lightweight Linux bootloader")
|
|
|
|
(description "Syslinux is a lightweight Linux bootloader.")
|
|
|
|
(license (list license:gpl2+
|
|
|
|
license:bsd-3 ; gnu-efi/*
|
|
|
|
license:bsd-4 ; gnu-efi/inc/* gnu-efi/lib/*
|
|
|
|
;; Also contains:
|
|
|
|
license:expat license:isc license:zlib)))))
|
2017-02-09 19:46:47 +01:00
|
|
|
|
|
|
|
(define-public dtc
|
|
|
|
(package
|
|
|
|
(name "dtc")
|
2017-11-06 19:25:15 +01:00
|
|
|
(version "1.4.5")
|
2017-02-09 19:46:47 +01:00
|
|
|
(source (origin
|
|
|
|
(method url-fetch)
|
|
|
|
(uri (string-append
|
2017-03-21 01:06:41 +01:00
|
|
|
"mirror://kernel.org/software/utils/dtc/"
|
2017-02-09 19:46:47 +01:00
|
|
|
"dtc-" version ".tar.xz"))
|
|
|
|
(sha256
|
|
|
|
(base32
|
2017-11-28 10:19:56 +01:00
|
|
|
"08gnl39i4xy3dm8iqwlz2ygx0ml1bgc5kpiys5ll1wvah1j72b04"))
|
|
|
|
;; Fix build and tests on 32 bits platforms.
|
|
|
|
;; Will probably be fixed in 1.4.6 release.
|
|
|
|
(patches (search-patches "dtc-format-modifier.patch"
|
|
|
|
"dtc-32-bits-check.patch"))))
|
2017-02-09 19:46:47 +01:00
|
|
|
(build-system gnu-build-system)
|
|
|
|
(native-inputs
|
|
|
|
`(("bison" ,bison)
|
2017-11-06 19:34:31 +01:00
|
|
|
("flex" ,flex)
|
|
|
|
("swig" ,swig)))
|
|
|
|
(inputs
|
|
|
|
`(("python-2" ,python-2)))
|
2017-02-09 19:46:47 +01:00
|
|
|
(arguments
|
|
|
|
`(#:make-flags
|
|
|
|
(list "CC=gcc"
|
|
|
|
(string-append "PREFIX=" (assoc-ref %outputs "out"))
|
2017-11-06 19:34:31 +01:00
|
|
|
(string-append "SETUP_PREFIX=" (assoc-ref %outputs "out"))
|
2017-02-09 19:46:47 +01:00
|
|
|
"INSTALL=install")
|
|
|
|
#:phases
|
|
|
|
(modify-phases %standard-phases
|
|
|
|
(delete 'configure))))
|
|
|
|
(home-page "https://www.devicetree.org")
|
|
|
|
(synopsis "Compiles device tree source files")
|
|
|
|
(description "@command{dtc} compiles
|
|
|
|
@uref{http://elinux.org/Device_Tree_Usage, device tree source files} to device
|
|
|
|
tree binary files. These are board description files used by Linux and BSD.")
|
|
|
|
(license license:gpl2+)))
|
|
|
|
|
|
|
|
(define u-boot
|
|
|
|
(package
|
|
|
|
(name "u-boot")
|
2017-12-03 07:46:11 +01:00
|
|
|
(version "2017.11")
|
2017-02-09 19:46:47 +01:00
|
|
|
(source (origin
|
|
|
|
(method url-fetch)
|
|
|
|
(uri (string-append
|
|
|
|
"ftp://ftp.denx.de/pub/u-boot/"
|
|
|
|
"u-boot-" version ".tar.bz2"))
|
|
|
|
(sha256
|
|
|
|
(base32
|
2017-12-03 07:46:11 +01:00
|
|
|
"01bcsah5imy6m3fbjwhqywxg0pfk5fl8ks9ylb7kv3zmrb9qy0ba"))))
|
2017-02-09 19:46:47 +01:00
|
|
|
(native-inputs
|
|
|
|
`(("bc" ,bc)
|
|
|
|
("dtc" ,dtc)
|
|
|
|
("python-2" ,python-2)))
|
|
|
|
(build-system gnu-build-system)
|
|
|
|
(home-page "http://www.denx.de/wiki/U-Boot/")
|
|
|
|
(synopsis "ARM bootloader")
|
|
|
|
(description "U-Boot is a bootloader used mostly for ARM boards. It
|
|
|
|
also initializes the boards (RAM etc).")
|
|
|
|
(license license:gpl2+)))
|
|
|
|
|
|
|
|
(define (make-u-boot-package board triplet)
|
|
|
|
"Returns a u-boot package for BOARD cross-compiled for TRIPLET."
|
2017-11-05 12:01:26 +01:00
|
|
|
(let ((same-arch? (if (string-prefix? (%current-system)
|
|
|
|
(gnu-triplet->nix-system triplet))
|
2017-08-05 23:13:06 +02:00
|
|
|
`#t
|
|
|
|
`#f)))
|
|
|
|
(package
|
|
|
|
(inherit u-boot)
|
|
|
|
(name (string-append "u-boot-" (string-downcase board)))
|
|
|
|
(native-inputs
|
|
|
|
`(,@(if (not same-arch?)
|
|
|
|
`(("cross-gcc" ,(cross-gcc triplet))
|
|
|
|
("cross-binutils" ,(cross-binutils triplet)))
|
|
|
|
'())
|
|
|
|
,@(package-native-inputs u-boot)))
|
|
|
|
(arguments
|
|
|
|
`(#:modules ((ice-9 ftw) (guix build utils) (guix build gnu-build-system))
|
|
|
|
#:test-target "test"
|
|
|
|
#:make-flags
|
|
|
|
(list "HOSTCC=gcc"
|
|
|
|
,@(if (not same-arch?)
|
|
|
|
`((string-append "CROSS_COMPILE=" ,triplet "-"))
|
|
|
|
'()))
|
|
|
|
#:phases
|
|
|
|
(modify-phases %standard-phases
|
|
|
|
(replace 'configure
|
|
|
|
(lambda* (#:key outputs make-flags #:allow-other-keys)
|
|
|
|
(let ((config-name (string-append ,board "_defconfig")))
|
|
|
|
(if (file-exists? (string-append "configs/" config-name))
|
|
|
|
(zero? (apply system* "make" `(,@make-flags ,config-name)))
|
|
|
|
(begin
|
|
|
|
(display "Invalid board name. Valid board names are:")
|
|
|
|
(let ((suffix-len (string-length "_defconfig")))
|
|
|
|
(scandir "configs"
|
|
|
|
(lambda (file-name)
|
|
|
|
(when (string-suffix? "_defconfig" file-name)
|
|
|
|
(format #t
|
|
|
|
"- ~A\n"
|
|
|
|
(string-drop-right file-name
|
|
|
|
suffix-len))))))
|
|
|
|
#f)))))
|
|
|
|
(replace 'install
|
|
|
|
(lambda* (#:key outputs make-flags #:allow-other-keys)
|
|
|
|
(let* ((out (assoc-ref outputs "out"))
|
|
|
|
(libexec (string-append out "/libexec"))
|
2017-11-03 15:17:08 +01:00
|
|
|
(uboot-files (append
|
|
|
|
(find-files "." ".*\\.(bin|efi|img|spl)$")
|
2017-11-06 21:51:22 +01:00
|
|
|
(find-files "." "^MLO$"))))
|
2017-08-05 23:13:06 +02:00
|
|
|
(mkdir-p libexec)
|
|
|
|
(for-each
|
|
|
|
(lambda (file)
|
|
|
|
(let ((target-file (string-append libexec "/" file)))
|
|
|
|
(mkdir-p (dirname target-file))
|
|
|
|
(copy-file file target-file)))
|
|
|
|
uboot-files))))))))))
|
2017-02-09 19:46:47 +01:00
|
|
|
|
|
|
|
(define-public u-boot-vexpress
|
|
|
|
(make-u-boot-package "vexpress_ca9x4" "arm-linux-gnueabihf"))
|
|
|
|
|
|
|
|
(define-public u-boot-malta
|
|
|
|
(make-u-boot-package "malta" "mips64el-linux-gnuabi64"))
|
|
|
|
|
|
|
|
(define-public u-boot-beagle-bone-black
|
|
|
|
(make-u-boot-package "am335x_boneblack" "arm-linux-gnueabihf"))
|
2017-07-21 14:42:57 +02:00
|
|
|
|
|
|
|
(define-public u-boot-odroid-c2
|
|
|
|
(make-u-boot-package "odroid-c2" "aarch64-linux-gnu"))
|
2017-08-29 20:26:28 +02:00
|
|
|
|
2017-10-26 14:52:19 +02:00
|
|
|
(define-public vboot-utils
|
|
|
|
(package
|
|
|
|
(name "vboot-utils")
|
|
|
|
(version "R63-10032.B")
|
|
|
|
(source (origin
|
|
|
|
;; XXX: Snapshots are available but changes timestamps every download.
|
|
|
|
(method git-fetch)
|
|
|
|
(uri (git-reference
|
|
|
|
(url (string-append "https://chromium.googlesource.com"
|
|
|
|
"/chromiumos/platform/vboot_reference"))
|
|
|
|
(commit (string-append "release-" version))))
|
|
|
|
(file-name (string-append name "-" version "-checkout"))
|
|
|
|
(sha256
|
|
|
|
(base32
|
|
|
|
"0h0m3l69vp9dr6xrs1p6y7ilkq3jq8jraw2z20kqfv7lvc9l1lxj"))))
|
|
|
|
(build-system gnu-build-system)
|
|
|
|
(arguments
|
|
|
|
`(#:make-flags (list "CC=gcc"
|
|
|
|
(string-append "DESTDIR=" (assoc-ref %outputs "out")))
|
|
|
|
#:phases (modify-phases %standard-phases
|
|
|
|
(add-after 'unpack 'patch-hard-coded-paths
|
|
|
|
(lambda* (#:key inputs outputs #:allow-other-keys)
|
|
|
|
(let ((coreutils (assoc-ref inputs "coreutils"))
|
|
|
|
(diffutils (assoc-ref inputs "diffutils")))
|
|
|
|
(substitute* "futility/misc.c"
|
|
|
|
(("/bin/cp") (string-append coreutils "/bin/cp")))
|
|
|
|
(substitute* "tests/bitmaps/TestBmpBlock.py"
|
|
|
|
(("/usr/bin/cmp") (string-append diffutils "/bin/cmp")))
|
|
|
|
(substitute* "vboot_host.pc.in"
|
|
|
|
(("prefix=/usr")
|
|
|
|
(string-append "prefix=" (assoc-ref outputs "out"))))
|
|
|
|
#t)))
|
|
|
|
(delete 'configure)
|
|
|
|
(add-before 'check 'patch-tests
|
|
|
|
(lambda _
|
|
|
|
;; These tests compare diffs against known-good values.
|
|
|
|
;; Patch the paths to match those in the build container.
|
|
|
|
(substitute* (find-files "tests/futility/expect_output")
|
|
|
|
(("/mnt/host/source/src/platform/vboot_reference")
|
|
|
|
(string-append "/tmp/guix-build-" ,name "-" ,version
|
|
|
|
".drv-0/source")))
|
|
|
|
;; Tests require write permissions to many of these files.
|
|
|
|
(for-each make-file-writable (find-files "tests/futility"))
|
|
|
|
#t)))
|
|
|
|
#:test-target "runtests"))
|
|
|
|
(native-inputs
|
|
|
|
`(("pkg-config" ,pkg-config)
|
|
|
|
|
|
|
|
;; For tests.
|
|
|
|
("diffutils" ,diffutils)
|
|
|
|
("python@2" ,python-2)))
|
|
|
|
(inputs
|
|
|
|
`(("coreutils" ,coreutils)
|
|
|
|
("libyaml" ,libyaml)
|
|
|
|
("openssl" ,openssl)
|
|
|
|
("openssl:static" ,openssl "static")
|
|
|
|
("util-linux" ,util-linux)))
|
|
|
|
(home-page
|
|
|
|
"https://dev.chromium.org/chromium-os/chromiumos-design-docs/verified-boot")
|
|
|
|
(synopsis "ChromiumOS verified boot utilities")
|
|
|
|
(description
|
|
|
|
"vboot-utils is a collection of tools to facilitate booting of
|
|
|
|
Chrome-branded devices. This includes the @command{cgpt} partitioning
|
|
|
|
program, the @command{futility} and @command{crossystem} firmware management
|
|
|
|
tools, and more.")
|
|
|
|
(license license:bsd-3)))
|
|
|
|
|
2017-08-29 20:26:28 +02:00
|
|
|
(define-public os-prober
|
|
|
|
(package
|
|
|
|
(name "os-prober")
|
|
|
|
(version "1.76")
|
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method url-fetch)
|
|
|
|
(uri (string-append "mirror://debian/pool/main/o/os-prober/os-prober_"
|
|
|
|
version ".tar.xz"))
|
|
|
|
(sha256
|
|
|
|
(base32
|
|
|
|
"1vb45i76bqivlghrq7m3n07qfmmq4wxrkplqx8gywj011rhq19fk"))))
|
|
|
|
(build-system gnu-build-system)
|
|
|
|
(arguments
|
|
|
|
`(#:modules ((guix build gnu-build-system)
|
|
|
|
(guix build utils)
|
|
|
|
(ice-9 regex) ; for string-match
|
|
|
|
(srfi srfi-26)) ; for cut
|
|
|
|
#:make-flags (list "CC=gcc")
|
|
|
|
#:tests? #f ; no tests
|
|
|
|
#:phases
|
|
|
|
(modify-phases %standard-phases
|
|
|
|
(replace 'configure
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
(substitute* (find-files ".")
|
|
|
|
(("/usr") (assoc-ref outputs "out")))
|
|
|
|
(substitute* (find-files "." "50mounted-tests$")
|
|
|
|
(("mkdir") "mkdir -p"))
|
|
|
|
#t))
|
|
|
|
(replace 'install
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
(define (find-files-non-recursive directory)
|
|
|
|
(find-files directory
|
|
|
|
(lambda (file stat)
|
|
|
|
(string-match (string-append "^" directory "/[^/]*$")
|
|
|
|
file))
|
|
|
|
#:directories? #t))
|
|
|
|
|
|
|
|
(let* ((out (assoc-ref outputs "out"))
|
|
|
|
(bin (string-append out "/bin"))
|
|
|
|
(lib (string-append out "/lib"))
|
|
|
|
(share (string-append out "/share")))
|
|
|
|
(for-each (cut install-file <> bin)
|
|
|
|
(list "linux-boot-prober" "os-prober"))
|
|
|
|
(install-file "newns" (string-append lib "/os-prober"))
|
|
|
|
(install-file "common.sh" (string-append share "/os-prober"))
|
|
|
|
(install-file "os-probes/mounted/powerpc/20macosx"
|
|
|
|
(string-append lib "/os-probes/mounted"))
|
|
|
|
(for-each
|
|
|
|
(lambda (directory)
|
|
|
|
(for-each
|
|
|
|
(lambda (file)
|
|
|
|
(let ((destination (string-append lib "/" directory
|
|
|
|
"/" (basename file))))
|
|
|
|
(mkdir-p (dirname destination))
|
|
|
|
(copy-recursively file destination)))
|
|
|
|
(append (find-files-non-recursive (string-append directory "/common"))
|
|
|
|
(find-files-non-recursive (string-append directory "/x86")))))
|
|
|
|
(list "os-probes" "os-probes/mounted" "os-probes/init"
|
|
|
|
"linux-boot-probes" "linux-boot-probes/mounted"))
|
|
|
|
#t))))))
|
|
|
|
(home-page "https://joeyh.name/code/os-prober")
|
|
|
|
(synopsis "Detect other operating systems")
|
|
|
|
(description "os-prober probes disks on the system for other operating
|
|
|
|
systems so that they can be added to the bootloader. It also works out how to
|
|
|
|
boot existing GNU/Linux systems and detects what distribution is installed in
|
|
|
|
order to add a suitable bootloader menu entry.")
|
|
|
|
(license license:gpl2+)))
|