From mboxrd@z Thu Jan 1 00:00:00 1970 From: Danny Milosavljevic Subject: bug#30311: efi-less grub install fails Date: Sun, 18 Feb 2018 17:49:22 +0100 Message-ID: <20180218174922.47f656a7@scratchpost.org> References: <87tvuel15z.fsf@netris.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/qRq7Jxya59VD8z+37o+T5hJ" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45774) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enSAB-0004gg-5w for bug-guix@gnu.org; Sun, 18 Feb 2018 11:50:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enSA7-0002iy-TK for bug-guix@gnu.org; Sun, 18 Feb 2018 11:50:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:42096) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1enSA7-0002ir-OA for bug-guix@gnu.org; Sun, 18 Feb 2018 11:50:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1enSA6-0006sO-3s for bug-guix@gnu.org; Sun, 18 Feb 2018 11:50:03 -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 Cc: Ricardo Wurmus , 30311@debbugs.gnu.org --MP_/qRq7Jxya59VD8z+37o+T5hJ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Mark, > This change breaks my mips64el-linux GuixSD system, which is supported > by GRUB, but where "--target=i386-pc" is obviously not appropriate. On > my system I need a different 'target' setting. A pretty safe workaround is to substitute /sys/firmware/efi by /sys/firmware/non-efi in ./grub-core/osdep/linux/platform.c for non-efi grub. See attachment... > In the rare cases where GRUB fails to detect the target, perhaps we > could provide a way to specify an explicit GRUB 'target' in the grub > configuration? I still think that upstream should fix this bug. It's silly that we have to massage grub to not select a target which grub wasn't compiled for - we patch/configure one part of grub so another part of grub isn't confused. It's the same package :P Bootloader configuration is complicated enough already. In this case I'd rather grub did the right thing automatically. --MP_/qRq7Jxya59VD8z+37o+T5hJ Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-gnu-grub-Make-sure-that-non-EFI-grub-doesn-t-try-to-.patch >From 263b1dc0de9643094bc41f4be47b4b2317e95d7c Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Sun, 18 Feb 2018 17:30:48 +0100 Subject: [FIXME] gnu: grub: Make sure that non-EFI grub doesn't try to use EFI. Tags: patch * gnu/packages/bootloader.scm (grub)[arguments]<:phases> [patch-/sys/firmware/efi-out]: New phase. (grub-efi)[arguments]<:phases>[patch-/sys/firmware/efi-out]: Delete phase. Fixes . --- gnu/packages/bootloaders.scm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 59eb22f24..c09829e17 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -103,6 +103,11 @@ (copy-file (assoc-ref inputs "unifont") "unifont.bdf.gz") (system* "gunzip" "unifont.bdf.gz") #t)) + (add-after 'unpack 'patch-/sys/firmware/efi-out + (lambda _ + (substitute* "grub-core/osdep/linux/platform.c" + (("/sys/firmware/efi") "/sys/firmware/non-efi")) + #t)) (add-before 'check 'disable-flaky-test (lambda _ ;; This test is unreliable. For more information, see: @@ -177,6 +182,7 @@ menu to select one of the installed operating systems.") `(cons "--with-platform=efi" ,flags)) ((#:phases phases) `(modify-phases ,phases + (delete 'patch-/sys/firmware/efi-out) (add-after 'patch-stuff 'use-absolute-efibootmgr-path (lambda* (#:key inputs #:allow-other-keys) (substitute* "grub-core/osdep/unix/platform.c" --MP_/qRq7Jxya59VD8z+37o+T5hJ--