From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Za3nO-0008LL-RQ for qemu-devel@nongnu.org; Thu, 10 Sep 2015 11:29:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Za3nL-0000dK-JE for qemu-devel@nongnu.org; Thu, 10 Sep 2015 11:29:54 -0400 Received: from duck.fensystems.co.uk ([2001:ba8:0:1d4::6950:5845]:45399) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Za3nL-0000ct-AK for qemu-devel@nongnu.org; Thu, 10 Sep 2015 11:29:51 -0400 Message-ID: <55F1A1E2.2010603@ipxe.org> Date: Thu, 10 Sep 2015 16:29:38 +0100 From: Michael Brown MIME-Version: 1.0 References: <1441620856.27149.11.camel@redhat.com> <55ED98EA.4060101@ipxe.org> <1441637892.27149.34.camel@redhat.com> <55F19C96.50709@ipxe.org> <1441898426.11233.37.camel@redhat.com> In-Reply-To: <1441898426.11233.37.camel@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [ipxe-devel] EFI_PXE_BASE_CODE_PROTOCOL List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: ipxe-devel , qemu-devel On 10/09/15 16:20, Gerd Hoffmann wrote: >> Thanks. From my experiments, it seems that GRUB is using the hardcoded >> path /efi/boot/grub.cfg to locate the configuration file, regardless of >> where grub.efi was loaded from. > > Hmm, probably depends on how you are building it. There are also tools > like grub2-mknetdir and grub2-mkstandalone. Pretty confusing :( > > I'm using the binary shipped with RHEL. The centos one should show the > same behavior. > > https://ftp.fau.de/centos/7.1.1503/os/x86_64/EFI/BOOT/ That grubx64.efi binary makes no attempt to even look for an EFI_PXE_BASE_CODE_PROTOCOL. Here's the complete log of calls that it makes: OpenProtocol ( PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/grubx64.efi, LoadedImage, PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/grubx64.efi, , G ) = 0 ( 0x3f1aac00 ) -> 0x3e90349b LocateProtocol ( ConsoleControl, 0x0 ) = NOT_FOUND ( 0x0 ) -> 0x3e90344b LocateProtocol ( ConsoleControl, 0x0 ) = NOT_FOUND ( 0x0 ) -> 0x3e90344b OpenProtocol ( ConIn, SimpleTextInputEx, PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/grubx64.efi, , G ) = 0 ( 0x3ed3ffc0 ) -> 0x3e90349b LocateHandle ( ByProtocol, BlockIo, 0x0, 64 ) = 0 ( 32, { PciRoot(0x0)/Pci(0x1,0x1)/Ata(0x0), PciRoot(0x0)/Pci(0x1,0x0)/Floppy(0x0), PciRoot(0x0)/Pci(0x1,0x0)/Floppy(0x1), PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1) } ) -> 0x3e903478 OpenProtocol ( PciRoot(0x0)/Pci(0x1,0x1)/Ata(0x0), DevicePath, PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/grubx64.efi, , G ) = 0 ( 0x3f398f98 ) -> 0x3e90349b OpenProtocol ( PciRoot(0x0)/Pci(0x1,0x1)/Ata(0x0), BlockIo, PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/grubx64.efi, , G ) = 0 ( 0x3f3980a8 ) -> 0x3e90349b OpenProtocol ( PciRoot(0x0)/Pci(0x1,0x0)/Floppy(0x0), DevicePath, PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/grubx64.efi, , G ) = 0 ( 0x3f372998 ) -> 0x3e90349b OpenProtocol ( PciRoot(0x0)/Pci(0x1,0x0)/Floppy(0x0), BlockIo, PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/grubx64.efi, , G ) = 0 ( 0x3f35be68 ) -> 0x3e90349b OpenProtocol ( PciRoot(0x0)/Pci(0x1,0x0)/Floppy(0x1), DevicePath, PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/grubx64.efi, , G ) = 0 ( 0x3f3726d8 ) -> 0x3e90349b OpenProtocol ( PciRoot(0x0)/Pci(0x1,0x0)/Floppy(0x1), BlockIo, PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/grubx64.efi, , G ) = 0 ( 0x3f35c128 ) -> 0x3e90349b OpenProtocol ( PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1), DevicePath, PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/grubx64.efi, , G ) = 0 ( 0x3ea75b48 ) -> 0x3e90349b OpenProtocol ( PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1), BlockIo, PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/grubx64.efi, , G ) = 0 ( 0x3ea72e50 ) -> 0x3e90349b LocateProtocol ( UgaDraw, 0x0 ) = NOT_FOUND ( 0x0 ) -> 0x3e90344b LocateHandle ( ByProtocol, GraphicsOutput, 0x0, 64 ) = 0 ( 16, { PciRoot(0x0)/Pci(0x2,0x0)/AcpiAdr(0x80010100), ConOut } ) -> 0x3e903478 OpenProtocol ( PciRoot(0x0)/Pci(0x2,0x0)/AcpiAdr(0x80010100), GraphicsOutput, PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/grubx64.efi, , G ) = 0 ( 0x3f3750b8 ) -> 0x3e90349b LocateHandle ( ByProtocol, SimpleNetwork, 0x0, 64 ) = 0 ( 8, { PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1) } ) -> 0x3e903478 OpenProtocol ( PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1), SimpleNetwork, PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/grubx64.efi, , G ) = 0 ( 0x3ea755d0 ) -> 0x3e90349b OpenProtocol ( PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/grubx64.efi, LoadedImage, PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/grubx64.efi, , G ) = 0 ( 0x3f1aac00 ) -> 0x3e90349b OpenProtocol ( PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1), DevicePath, PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/grubx64.efi, , G ) = 0 ( 0x3ea75b48 ) -> 0x3e90349b It's looking for and successfully opening our EFI_SIMPLE_NETWORK_PROTOCOL and it is able to obtain an IP address using "net_bootp". It doesn't look anywhere for EFI_PXE_BASE_CODE_PROTOCOL. Do you have a set of instructions (starting from "git clone git://git.savannah.gnu.org/grub.git") which will allow me to rebuild that grubx64.efi binary from the source? Thanks, Michael