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:21:57 +0100 Message-ID: <878tbocpm2.fsf@fastmail.com> References: <87tvuel15z.fsf@netris.org> 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]:49648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enyWI-0000Oc-Ah for bug-guix@gnu.org; Mon, 19 Feb 2018 22:23:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enyWE-0002gq-5e for bug-guix@gnu.org; Mon, 19 Feb 2018 22:23:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:44068) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1enyWD-0002gb-V3 for bug-guix@gnu.org; Mon, 19 Feb 2018 22:23:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1enyWD-0006wt-PD for bug-guix@gnu.org; Mon, 19 Feb 2018 22:23:01 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87tvuel15z.fsf@netris.org> 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 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 lis= t 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. --=-=-= 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=20ce5d6089aff0cf6c31260ac2bbe0aeb2803eb8a0 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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 3b01125c7..2b8458161 100644 =2D-- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -386,8 +386,13 @@ submenu \"GNU system, old configurations...\" {~%") ;; root partition. (setenv "GRUB_ENABLE_CRYPTODISK" "y") =20 =2D (unless (zero? (system* grub "--no-floppy" "--target=3Di386-pc" + (unless (zero? (system* grub "--no-floppy" "--boot-directory" install-dir + ;; Explicitly pass target if the non-EFI + ;; GRUB is requested on an EFI system. + ;; See . + ,@(if (file-exists? "/sys/firmware/efi") + "--target=3Di386-pc") device)) (error "failed to install GRUB (BIOS)"))))) =20 =2D-=20 2.16.2 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlqLlFUACgkQoqBt8qM6 VPr4tgf/USpnc+DLJxUw12BYHs8BJhh3hX7I37pcNa+w8+wm1oD7WjjpJ6MGV5vB pp2J3l21xlvss9gkOraxtzw4UA15D2KvfyB76E2y4e6ez5QA3xr9/d0Ske0guqQd pu2Kdr0nEP7o5uLIU3Hyzu+G3wNUZQpipMJ8Q3UxaQU6jeFiGlJo8A+Mf9mi7/U4 oKgqFQk3rBFHQNnH53cuMNLkQ/9HTlt7Wk5liUIPWalwdgq75g9eWW6/QGCYRtoK tkVn8qy4tV6ANXTtCmLWvGG+HmVe312Uf6mB8a9m6x1DSmVK9+O4sn6pflrWgb6X Fxh5kMabo3I1EJRv08tzkBHZRg63ow== =ozrx -----END PGP SIGNATURE----- --==-=-=--