[PATCH] gnu: grub-efi: Add mtools input.

  • Done
  • quality assurance status badge
Details
3 participants
  • Danny Milosavljevic
  • Ludovic Courtès
  • Marius Bakke
Owner
unassigned
Submitted by
Danny Milosavljevic
Severity
normal
D
D
Danny Milosavljevic wrote on 14 Jul 2017 08:58
(address . guix-patches@gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20170714065842.5665-1-dannym@scratchpost.org
* gnu/packages/bootloaders.scm: Add (gnu packages mtools).
(grub-efi)[inputs]: Add mtools.
[arguments]: Add phase "use-absolute-mtools-path".
---
gnu/packages/bootloaders.scm | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)

Toggle diff (41 lines)
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 9ae617528..9c6927f2a 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -37,6 +37,7 @@
#:use-module (gnu packages gettext)
#:use-module (gnu packages linux)
#:use-module (gnu packages man)
+ #:use-module (gnu packages mtools)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages perl)
#:use-module (gnu packages python)
@@ -149,6 +150,7 @@ menu to select one of the installed operating systems.")
(synopsis "GRand Unified Boot loader (UEFI version)")
(inputs
`(("efibootmgr" ,efibootmgr)
+ ("mtools", mtools)
,@(package-inputs grub)))
(arguments
`(;; TODO: Tests need a UEFI firmware for qemu. There is one at
@@ -166,7 +168,19 @@ menu to select one of the installed operating systems.")
(("efibootmgr")
(string-append (assoc-ref inputs "efibootmgr")
"/sbin/efibootmgr")))
- #t)))))))))
+ #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))))))))))
(define-public syslinux
(let ((commit "bb41e935cc83c6242de24d2271e067d76af3585c"))
M
M
Marius Bakke wrote on 14 Jul 2017 18:49
878tjrj757.fsf@fastmail.com
Danny Milosavljevic <dannym@scratchpost.org> writes:

Toggle quote (4 lines)
> * gnu/packages/bootloaders.scm: Add (gnu packages mtools).
> (grub-efi)[inputs]: Add mtools.
> [arguments]: Add phase "use-absolute-mtools-path".

Why is this only necessary for grub-efi?

Toggle quote (3 lines)
> + (add-after 'patch-stuff 'use-absolute-mtools-path
> + (lambda* (#:key inputs #:allow-other-keys)
> + (let ((mtools (assoc-ref inputs"mtools")))
^^^
Missing space.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAllo9hQACgkQoqBt8qM6
VPpD6wgAzoOPchFB74LnD8AUgBe7NJ02cv2JrHn/chQFKv0g5xQb3YMSxJTx92Zl
6gIETdQ6/dUmQc7Fs742LnEqhIeB19HigOV5DB5ub28uuiP202GWuOdIv3kbKRq1
wMofSBUBIfQwka334IVCr1SElKbfLq69ReStWFdaMgt0IV6CjPgeo9L/BC0Q7pYk
nrfiBVRyeLrh+/UR3CaBsYbxhIBVo6zuDyl/C7NRjOVAVupCQwla2/KT8RpnG8Qd
JBGN16EDoqteCcH9dgkZF/HXSVHMMPZOmJfG8aJSHpBd2dXaOpQUKq4J2/T6scta
NOVkaRk/lZs4ovNlmdB+DdkTHQNPaA==
=YjWJ
-----END PGP SIGNATURE-----

D
D
Danny Milosavljevic wrote on 14 Jul 2017 20:12
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 27689@debbugs.gnu.org)
20170714201215.7f6e0dc4@scratchpost.org
Hi Marius,

On Fri, 14 Jul 2017 18:49:24 +0200
Marius Bakke <mbakke@fastmail.com> wrote:

Toggle quote (8 lines)
> Danny Milosavljevic <dannym@scratchpost.org> writes:
>
> > * gnu/packages/bootloaders.scm: Add (gnu packages mtools).
> > (grub-efi)[inputs]: Add mtools.
> > [arguments]: Add phase "use-absolute-mtools-path".
>
> Why is this only necessary for grub-efi?

I checked the grub source code and mformat and mcopy are only used in util/grub-mkrescue.c if source_dirs[GRUB_INSTALL_PLATFORM_*_EFI].

If that's too fine-grained, we can also add it to grub itself. But I'm sure it's only used for grub-mkrescue in the case of EFI.

Toggle quote (6 lines)
> > + (add-after 'patch-stuff 'use-absolute-mtools-path
> > + (lambda* (#:key inputs #:allow-other-keys)
> > + (let ((mtools (assoc-ref inputs"mtools")))
> ^^^
> Missing space.

Thanks :)
L
L
Ludovic Courtès wrote on 2 Sep 2017 00:22
control message for bug #27689
(address . control@debbugs.gnu.org)
871snqys72.fsf@gnu.org
tags 27689 fixed
close 27689
?