From mboxrd@z Thu Jan 1 00:00:00 1970 From: Danny Milosavljevic Subject: bug#30311: efi-less grub install fails Date: Tue, 20 Feb 2018 23:00:27 +0100 Message-ID: <20180220230027.1884531a@scratchpost.org> References: <87tvuel15z.fsf@netris.org> <20180218174922.47f656a7@scratchpost.org> <87o9kjqqzw.fsf@elephly.net> <20180220224317.36920bcb@scratchpost.org> <87lgfnqqlc.fsf@elephly.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eoFyF-0003iW-TJ for bug-guix@gnu.org; Tue, 20 Feb 2018 17:01:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eoFyA-0000wG-D4 for bug-guix@gnu.org; Tue, 20 Feb 2018 17:01:08 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:45456) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eoFyA-0000vo-9b for bug-guix@gnu.org; Tue, 20 Feb 2018 17:01:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eoFy9-0005gM-Jg for bug-guix@gnu.org; Tue, 20 Feb 2018 17:01:01 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87lgfnqqlc.fsf@elephly.net> 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: Ricardo Wurmus Cc: Ricardo Wurmus , 30311@debbugs.gnu.org Hi Ricardo, On Tue, 20 Feb 2018 22:49:19 +0100 Ricardo Wurmus wrote: > So the value =E2=80=9C/sys/firmware/non-efi=E2=80=9D might as well be > =E2=80=9C/does-not-exist=E2=80=9D? Yes. > Your patch subject says =E2=80=9CMake sure that non-EFI grub doesn't try = to use > EFI=E2=80=9D, but the problem I had was that GRUB insisted on being passe= d a > =E2=80=9C--target=E2=80=9D option. =20 > That was with a GRUB installation on a system in > legacy mode. Do you mean that this failed because GRUB erroneously > attempted an EFI installation? Yes, I think so. There's a default-platform function in grub which determines the default platform to use at runtime if you don't specify one. It one checks for the existence of /sys/firmware/efi, and if so, returns "i386-efi" or "x86_64-efi" (see ./grub-core/osdep/linux/platform.c). Grub's "configure" script has the ability to select which platform you want to compile. For the "grub" package, we choose i386, and for the "grub-efi" package, we choose i386-efi. The "grub-hybrid" package unions the "grub" and "grub-efi" packages, preferring files from the "grub-efi" package. I think this configuration is what upstream actually tests (only). In the "grub" package we then had the situation that it was compiled for i386 (not EFI) but THEIR OWN default-platform function specified to use i386-efi which is some seriously strange stuff. Do you think that this was not the cause?