From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 19 22:46:27 2018 Received: (at 30311) by debbugs.gnu.org; 20 Feb 2018 03:46:27 +0000 Received: from localhost ([127.0.0.1]:51977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1enyst-0007Vk-27 for submit@debbugs.gnu.org; Mon, 19 Feb 2018 22:46:27 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:43599) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1enysr-0007Vc-6A for 30311@debbugs.gnu.org; Mon, 19 Feb 2018 22:46:25 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id CD98C20FE3; Mon, 19 Feb 2018 22:46:24 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Mon, 19 Feb 2018 22:46:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=K7H+X35IabDv5g6Tgo1hHbCB4Qvx4Bhw5ODbNn1uG7g=; b=uRFOaElU Erth1Ti6v/955za+ATaImWPyFIX0+EbXLEquNzAYmAEAFJGduj/LCUrQxqyCkqyz Zeu954eoqfVXvq1pJqwEJqGXbs3Zrm8Z5/Wer9PqYcVqSlX1S3bWi7w3qB7HE97y HRpVGySfdNVsuBzDiFHlVjGpxQvnzD4F+aAjmf80gZde4Rj1fhb8JtmoUCYKvQIW WGJ7GjrmA575aCLV6s3WqFX7+nctqsinpEYxIfaXA9NiqX2fQFHyVuJ2K6U1RUrg DUWpixZpuGdfnQlwt2OBp7giyl1QXOu66BOcsKC2VxDC+XzeQAMJjCHEe80UWyjU M4PYY0rRmadUQQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=K7H+X35IabDv5g6Tgo1hHbCB4Qvx4 Bhw5ODbNn1uG7g=; b=YRkt8zfCyeDRXaZXVvYx+uuE6/7iPJ5Vhr5ZAdIhuuCEU uxZ488DBL4/KmugMVlKBOLqfdIrBj0dNEd0nUTGd2BgXhV0zBym0uxKaM2njfYuW MynmweVAFkhy8+is4EupO6gT5N+dejKbALMNhX61dnj7n1o/ZP6oHLxN9m/QpJJQ jd6ARgFcMBx/I3hi/XhNH/76T5z12aa0qcHpkisoOrHzYgMwH7Bpymbh80/u64IB ym0MtYrr5IVRxrJcuUk9C1tvYWELG+WryDYfPBDUmeIcOjXPeUfacaN7GxpKOfY2 xDoRngquUp13g9KCFu0BfjISHjKv67A7U0QIBMdtw== X-ME-Sender: Received: from localhost (cm-84.211.227.176.getinternet.no [84.211.227.176]) by mail.messagingengine.com (Postfix) with ESMTPA id 5B24A7E1D0; Mon, 19 Feb 2018 22:46:24 -0500 (EST) From: Marius Bakke To: Mark H Weaver , 30311@debbugs.gnu.org Subject: Re: bug#30311: efi-less grub install fails In-Reply-To: <878tbocpm2.fsf@fastmail.com> References: <87tvuel15z.fsf@netris.org> <878tbocpm2.fsf@fastmail.com> User-Agent: Notmuch/0.26 (https://notmuchmail.org) Emacs/25.3.1 (x86_64-pc-linux-gnu) Date: Tue, 20 Feb 2018 04:46:22 +0100 Message-ID: <87606scohd.fsf@fastmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 30311 Cc: Ricardo Wurmus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --==-=-= 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----- --==-=-=--