From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dY9w7-00021U-Ms for guix-patches@gnu.org; Thu, 20 Jul 2017 07:48:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dY9w2-0001ue-Sm for guix-patches@gnu.org; Thu, 20 Jul 2017 07:48:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:46000) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dY9w2-0001uS-Oi for guix-patches@gnu.org; Thu, 20 Jul 2017 07:48:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dY9w2-0007nX-D6 for guix-patches@gnu.org; Thu, 20 Jul 2017 07:48:02 -0400 Subject: [bug#27695] [PATCH 1/2] bootloader: Add grub-hybrid-bootloader. Resent-Message-ID: Date: Thu, 20 Jul 2017 13:47:32 +0200 From: Danny Milosavljevic Message-ID: <20170720134732.7972d5bb@scratchpost.org> In-Reply-To: <87379rzeml.fsf@gnu.org> References: <20170714185954.4381-1-dannym@scratchpost.org> <20170714190157.4529-1-dannym@scratchpost.org> <87379rzeml.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 27695@debbugs.gnu.org Hi Ludo, On Thu, 20 Jul 2017 10:39:14 +0200 ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > Is it really all it takes to make a GRUB that can do both BIOS and UEFI? > I wonder why GRUB upstream doesn=E2=80=99t do it by default. I think they do, in a sense. In many other distributions the directory is = common - so if you install both grub-pc and grub-efi on your disk then grub= will indeed use both (for grub-mkrescue). > Do you think we should discuss it with them? >=20 > If that works, we might just as well make it the new =E2=80=9Cgrub=E2=80= =9D package and > remove =E2=80=9Cgrub-efi=E2=80=9D. Or is there any downside? I only use this feature for grub-mkrescue right now. I know that it is sup= ported *there* in the sense that there's explicit "if" blocks checking for = both platforms (by literals) in the same function, but not exclusively (i.e= . "if (efi) A; if (non efi) B;" without "else"). See main() in util/grub-m= krescue.c in grub 2.02 (lines 667ff for EFI, lines 571ff for "PC"). The EFI= stuff has "_EFI" in the preprocessor definitions, so search for that. Note that main() supports a command line option for getting the source file= s for ONE SINGLE platform, but when you don't specify that option then it u= ses multiple platforms (the ones it can find). For using multiple platforms as a regular bootloader I do NOT know whether = that works or makes sense at all. Maybe it does, I just didn't test it (an= d can't usefully). That's why there's the alternative implementation that wouldn't add a Guix = bootloader for it. I hope someone else knows. I don't have EFI hardware so I'm really the wro= ng person to find out that stuff. Well I could try reading the documentati= on / asking and hoping that it's all correct, but ... you know... paper is = patient :) util/grub-install.c seems to use a case anaylsis with exclusive cases for f= inding out EFI or not *shrugs*.