Received: from list by lists.gnu.org with archive (Exim 4.71) id 1g2zLg-00073v-73 for mharc-grub-devel@gnu.org; Thu, 20 Sep 2018 09:50:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2zLe-00073T-7y for grub-devel@gnu.org; Thu, 20 Sep 2018 09:50:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g2zLb-0005MF-Iv for grub-devel@gnu.org; Thu, 20 Sep 2018 09:50:26 -0400 Received: from dibed.net-space.pl ([84.10.22.86]:45392) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.71) (envelope-from ) id 1g2zLb-0005EU-6H for grub-devel@gnu.org; Thu, 20 Sep 2018 09:50:23 -0400 Received: (from localhost user: 'dkiper' uid#4000 fake: STDIN (dkiper@dibed.net-space.pl)) by router-fw-old.i.net-space.pl id S1870563AbeITNuN (ORCPT ); Thu, 20 Sep 2018 15:50:13 +0200 Date: Thu, 20 Sep 2018 15:50:13 +0200 From: Daniel Kiper To: dann frazier Cc: grub-devel@gnu.org, Leif Lindholm Subject: Re: [RFC][PATCH 2/2] arm: grub-install: Default to arm-efi target in EFI-based QEMU virt models Message-ID: <20180920135013.GC17654@router-fw-old.i.net-space.pl> References: <20180828193348.31676-1-dann.frazier@canonical.com> <20180828193348.31676-3-dann.frazier@canonical.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180828193348.31676-3-dann.frazier@canonical.com> User-Agent: Mutt/1.3.28i X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 84.10.22.86 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2018 13:50:27 -0000 On Tue, Aug 28, 2018 at 01:33:48PM -0600, dann frazier wrote: > From: dann frazier > > We currently default to the arm-uboot target in grub-install, > but arm-efi should be used for some systems with UEFI firmware, such as > Tianocore/EDK2-based QEMU models. We could change the default to arm-efi > anytime we successfully probe for an EFI runtime. However, that would > apparently do the wrong thing on U-Boot implementations that implement the > UEFI spec, such as those compliant with the upcoming Embedded Base Boot > Requirements specification, as they are not required to support > SetVariable() in runtime services. > > For now, whitelist QEMU linux/virt models with runtime EFI support, > but otherwise continue to default to the arm-uboot target. > > Signed-off-by: dann frazier > --- > grub-core/osdep/basic/platform.c | 6 +++++ > grub-core/osdep/linux/platform.c | 37 ++++++++++++++++++++++++++++++ > grub-core/osdep/windows/platform.c | 6 +++++ > include/grub/util/install.h | 3 +++ > util/grub-install.c | 2 +- > 5 files changed, 53 insertions(+), 1 deletion(-) > > diff --git a/grub-core/osdep/basic/platform.c b/grub-core/osdep/basic/platform.c > index 4b5502aeb..a7dafd85a 100644 > --- a/grub-core/osdep/basic/platform.c > +++ b/grub-core/osdep/basic/platform.c > @@ -18,6 +18,12 @@ > > #include > > +const char * > +grub_install_get_default_arm_platform (void) > +{ > + return "arm-uboot"; > +} > + > const char * > grub_install_get_default_x86_platform (void) > { > diff --git a/grub-core/osdep/linux/platform.c b/grub-core/osdep/linux/platform.c > index d278c299b..835aa4856 100644 > --- a/grub-core/osdep/linux/platform.c > +++ b/grub-core/osdep/linux/platform.c > @@ -121,6 +121,43 @@ is_efi (void) > return 0; > } > > +static int > +is_virt (void) > +{ > + FILE *fp; > + char *buf = NULL; > + int ret = 0; > + size_t len = 0; > + const char qemu_virt[] = "linux,dummy-virt"; Do we really need qemu_virt variable? It is used only in one place. Daniel