From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marius Bakke Subject: bug#30311: efi-less grub install fails Date: Tue, 20 Feb 2018 04:46:22 +0100 Message-ID: <87606scohd.fsf@fastmail.com> References: <87tvuel15z.fsf@netris.org> <878tbocpm2.fsf@fastmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enytW-0006S7-Bo for bug-guix@gnu.org; Mon, 19 Feb 2018 22:47:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enytT-0008Ar-85 for bug-guix@gnu.org; Mon, 19 Feb 2018 22:47:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:44080) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1enytS-0008Af-Vv for bug-guix@gnu.org; Mon, 19 Feb 2018 22:47:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1enytS-0007Wa-Jc for bug-guix@gnu.org; Mon, 19 Feb 2018 22:47:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <878tbocpm2.fsf@fastmail.com> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Mark H Weaver , 30311@debbugs.gnu.org Cc: Ricardo Wurmus --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Marius Bakke writes: > Mark H Weaver writes: > >> Hi Ricardo, >> >> Ricardo Wurmus writes: >>> Okay, I=E2=80=99ve added =E2=80=9C--target=3Di386-pc=E2=80=9D to the li= st of arguments. >> >> This change breaks my mips64el-linux GuixSD system, which is supported >> by GRUB, but where "--target=3Di386-pc" is obviously not appropriate. On >> my system I need a different 'target' setting. > > Maybe we can make it conditional on EFI for now. Ricardo, are you able > to test the attached patch? I suspect we might get problems on POWER > and some ARM systems down the road, but it should at least fix this > immediate issue. > > Note: I haven't tested this patch myself. Bah, here is a fixed version that actually works (for the normal case). --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-gnu-Pass-target-to-EFI-less-GRUB-only-when-EFI-varia.patch Content-Transfer-Encoding: quoted-printable From=20968ccb27e40ce683ec469f3ac7973827a7e8ddf5 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Tue, 20 Feb 2018 04:02:23 +0100 Subject: [PATCH] gnu: Pass "--target" to EFI-less GRUB only when EFI variab= les are present. Fixes . * gnu/bootloader/grub.scm (install-grub): Make "--target" argument conditional on the presence of "/sys/firmware/efi". =2D-- gnu/bootloader/grub.scm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 3b01125c7..17ded5f6d 100644 =2D-- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -386,9 +386,15 @@ submenu \"GNU system, old configurations...\" {~%") ;; root partition. (setenv "GRUB_ENABLE_CRYPTODISK" "y") =20 =2D (unless (zero? (system* grub "--no-floppy" "--target=3Di386-pc" =2D "--boot-directory" install-dir =2D device)) + (unless (zero? (apply system* grub + (list "--no-floppy" + "--boot-directory" install-dir + ;; Explicitly pass target if the non-E= FI + ;; GRUB is requested on an EFI system. + ;; See . + #$@(if (file-exists? "/sys/firmware/ef= i") + '("--target=3Di386-pc")) + device))) (error "failed to install GRUB (BIOS)"))))) =20 (define install-grub-efi =2D-=20 2.16.2 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlqLmg4ACgkQoqBt8qM6 VPorfwf+I0dEVp0xpxREgpi5NA6BGVafqm35tu4lMfRuACa+GiNo/JkY7YsRSrfJ V0KONQlRHnq2ts9kjnA4EukAvtUvXdixNX0anHbNTRHXvCYIJzbjHM54VIe/Ws3O lI2YsshsZFcMZnNDOIYXCixLfA+1f315kwqjeOW+NG7PzIhDUeTG/CvOobVVTv+h n92gk0Ru3c7c4asL0gAKw8LZ3BWKNObOJuTqdFE5Xl186AC5pPakiXqgDpZHTExw F6OhgHQPX/3O5/qBqqUOrqBgwKQKXVS+qlMDj9l4tLNuMdCrywuFmWp+PVg9AGE/ nCeOjHXuPOQ3bLmcd4LE9cj9G47wfg== =yG6e -----END PGP SIGNATURE----- --==-=-=--