From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marius Bakke Subject: Re: [PATCH 6/6] gnu: Add grub-efi. Date: Fri, 16 Dec 2016 18:33:20 +0100 Message-ID: <87y3zfrd7j.fsf@kirby.i-did-not-set--mail-host-address--so-tickle-me> References: <20161105125511.29383-1-mbakke@fastmail.com> <20161105125511.29383-7-mbakke@fastmail.com> <20161105185803.GA11667@jasmine> <87h97l67kz.fsf@kirby.i-did-not-set--mail-host-address--so-tickle-me> <878tsww9ov.fsf@gnu.org> <87vaw087kr.fsf@kirby.i-did-not-set--mail-host-address--so-tickle-me> <871syny88o.fsf@gnu.org> <87oa1r8wyv.fsf@kirby.i-did-not-set--mail-host-address--so-tickle-me> <871sx73ink.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41232) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHwNu-0006Dg-Cc for guix-devel@gnu.org; Fri, 16 Dec 2016 12:33:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cHwNp-0000Md-Bw for guix-devel@gnu.org; Fri, 16 Dec 2016 12:33:30 -0500 In-Reply-To: <871sx73ink.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --=-=-= Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --==-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Hi Marius, > > Marius Bakke skribis: > >> Ludovic Court=C3=A8s writes: >> >>>>>> From 940c03c7dcddec019e27f6eb1470aeab4db57799 Mon Sep 17 00:00:00 20= 01 >>>>>> From: Marius Bakke >>>>>> Date: Thu, 20 Oct 2016 17:26:52 +0100 >>>>>> Subject: [PATCH] gnu: Add grub-efi. >>>>>> >>>>>> * gnu/packages/grub.scm (grub-efi): New variable. >>>>> >>>>> [...] >>>>> >>>>>> + (name "grub-efi") >>>>>> + (synopsis (string-append (package-synopsis grub) " (UEFI versio= n)")) >>>>> >>>>> Please use a literal string for =E2=80=98synopsis=E2=80=99; use of = =E2=80=98string-append=E2=80=99 like >>>>> this prevents i18n. >>>>> >>>>>> + `(#:tests? #f ; FIXME: 40 failures, 24 skipped, 17 passed. >>>>> >>>>> It would be good to investigate, especially if the tests pass in the >>>>> =E2=80=98grub=E2=80=99 package. >>>>> >>>>> Also, what=E2=80=99s the rationale for making =E2=80=98grub-efi=E2=80= =99 separate instead of >>>>> incorporating the changes in =E2=80=98grub=E2=80=99 proper? Are ther= e issues around the >>>>> portability of =E2=80=98efibootmgr=E2=80=99, or an increased closure = size? >>>> >>>> This is a good point. The only difference with "--with-platform=3Defi"= is >>>> that another directory is created in place of the i386-pc directory. It >>>> is perfectly possible to build multiple platforms and copying the >>>> platform-specific stuff to $out/lib -- grub will pick the correct >>>> platform at runtime. This is what the Gentoo ebuild does. >>> >>> Are you saying that a GRUB compiled with UEFI support will no longer >>> work out-of-the-box on non-UEFI machines, unless platform-specific stuff >>> is moved like you suggest? >> >> Ha, no, it was just a long-winded and intoxicated way of saying what you >> proposed should work fine. :) > > It turns out I have an immediate need ;-), so I pushed this as commit > 3eee16130d858ae96510ec1c7d38d31290de2699. Let me know if that doesn=E2= =80=99t > seem right! I think you need to compile with '--with-platform=3Defi' as well. Check /gnu/store/...grub-.../lib/grub. I still use a custom 'grub-efi' expression (attached, needs adaption to 3eee16). Otherwise grub won't have the required install files, even if it could detect the platform. Relatedly, I think the way to build a 'multi-grub' is to have one expression for each supported grub platform, and then consolidate out/lib/grub from each. > Now there are things I didn=E2=80=99t quite get. Apparently you=E2=80=99= re supposed to > have a /boot/efi as a vfat partition, and =E2=80=98grub-install=E2=80=99 = is supposed to > detect it and install the EFI stuff, or so I thought (info "(grub) > Installing GRUB using grub-install"). > > However, =E2=80=98grub-install=E2=80=99 still seems to be installing for = =E2=80=9Ci386-pc=E2=80=9D > instead of EFI. > > What am I missing? IIRC grub-install will detect and install for the running mode (pc, efi, etc). So in a classic chicken-and-egg situation, you need to be booted with UEFI mode for grub to select the correct installation platform! I worked around this by installing grub from a UEFI live CD, copy and adapt the grub.cfg from an existing (BIOS) GuixSD installation, then coerce the GuixSD system to use EFI from that point.. --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlhUJWAACgkQoqBt8qM6 VPoFUggAi/3M7uVeZyLXC6Wj9ATk5FzSg6/blLJIgI7Gd7/CWOsE55pAJd7LDpwe 47Xh75i0zNk6osfiTSc6eqrKAKSJrrh+qjNshiR7ArUtNUtK/CMEGWG5OHI/v3SJ xlyodhjHNq86KJ5FSecKFTxOsRJ9tTzYnqgv+M8G5zRLdcpAmzKzxPZKeXOWpTTQ cwFnmPoA8Co++pH9XMlki+uTJ2dwJG2T8J0BY/SZ7bK5A5h0eDLhGC5QWbTmOnPI 2bXwTW2PfmmHjyTre5WjB4SGvU/d7VOn5GT1yUuM9OzDUK7z6SfpQYSZ5Go+jnRi 7oX8jWig3Zcx8kkZebzBh24oZiFUqA== =KxWa -----END PGP SIGNATURE----- --==-=-=-- --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gnu-Add-grub-efi.patch >From 1ca87a51f55f0b05f89eed707c1485b94f3d7d16 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Thu, 20 Oct 2016 17:26:52 +0100 Subject: [PATCH] gnu: Add grub-efi. * gnu/packages/grub.scm (grub-efi): New variable. --- gnu/packages/grub.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/grub.scm b/gnu/packages/grub.scm index ef7395e95..1cb835695 100644 --- a/gnu/packages/grub.scm +++ b/gnu/packages/grub.scm @@ -164,3 +164,26 @@ on the same computer; upon booting the computer, the user is presented with a menu to select one of the installed operating systems.") (license gpl3+) (properties '((cpe-name . "grub2"))))) + +(define-public grub-efi + (package + (inherit grub) + (name "grub-efi") + (synopsis (string-append (package-synopsis grub) " (UEFI version)")) + (inputs + `(("efibootmgr" ,efibootmgr) + ,@(package-inputs grub))) + (arguments + `(#:tests? #f ; FIXME: 40 failures, 24 skipped, 17 passed. + ,@(substitute-keyword-arguments (package-arguments grub) + ((#:configure-flags flags) `(cons* "--with-platform=efi" + ,flags)) + ((#: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"))) + #t))))))))) -- 2.11.0 --=-=-=--