aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2015-02-10 14:28:09 +0100
committerGerd Hoffmann <kraxel@redhat.com>2015-07-07 09:51:05 +0200
commit87981bb66f5f496f124469fb6c13aa13ee00061e (patch)
treeadfa2e90f25f80e8628df903b4f3f4afb4a370e3
parentca65a1ff7568ec44fe77117ea93615f786ce8d87 (diff)
downloadipxe-qemu.tar.gz
[efi] make load file protocol optionalqemu-2.4qemu
The load file implementation added by commit c7c3d839fc9120aee28de9aabe452dc85ad91502 doesn't support loading arbitrary files from the tftp server, so efi applications trying to do exactly that fail to boot: iPXE 1.0.0+ (17ace) -- Open Source Network Boot Firmware -- http://ipxe.org Features: HTTP DNS TFTP EFI Menu net0: 52:54:00:47:d3:07 using virtio-net on PCI00:09.0 (open) [Link:up, TX:0 TXE:0 RX:13 RXE:2] [RXE: 2 x "Operation not supported (http://ipxe.org/3c086083)"] Configuring (net0 52:54:00:47:d3:07)...... ok net0: 192.168.132.93/255.255.255.0 gw 192.168.132.1 Next server: 192.168.132.1 Filename: shim.efi tftp://192.168.132.1/shim.efi... ok Failed to open grubx64.efi - Not Found Failed to load image grubx64.efi: Not Found Failed to open MokManager.efi - Not Found Failed to load image MokManager.efi: Not Found Could not boot image: Error 0x7f04828e (http://ipxe.org/7f04828e) Boot Failed. EFI Network This is not acceptable for qemu. efi pxe configurations which work just fine with real hardware must work with qemu virtual machines too. This patch adds a config option for the load file protocol implementation, to allow it being disabled, so we can turn it off for the pxe roms shipped with qemu. The default for the new option maintains current behavior, i.e. load file is enabled unless you override it in config/local/general.h Suggested-by: Laszlo Ersek <lersek@redhat.com> See discussion here: http://lists.ipxe.org/pipermail/ipxe-devel/2015-February/003979.html Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--src/config/general.h6
-rw-r--r--src/interface/efi/efi_snp.c5
2 files changed, 11 insertions, 0 deletions
diff --git a/src/config/general.h b/src/config/general.h
index c8afc10a..57d3444e 100644
--- a/src/config/general.h
+++ b/src/config/general.h
@@ -144,6 +144,12 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define AUTOBOOT_ROM_FILTER /* Autoboot only devices matching our ROM */
/*
+ * EFI specific options
+ *
+ */
+#define EFI_PROTO_LOAD_FILE /* register LOAD_FILE protocol */
+
+/*
* Error message tables to include
*
*/
diff --git a/src/interface/efi/efi_snp.c b/src/interface/efi/efi_snp.c
index c21af33d..85f4fa08 100644
--- a/src/interface/efi/efi_snp.c
+++ b/src/interface/efi/efi_snp.c
@@ -34,6 +34,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/efi/efi_utils.h>
#include <ipxe/efi/efi_snp.h>
#include <usr/autoboot.h>
+#include <config/general.h>
/** List of SNP devices */
static LIST_HEAD ( efi_snp_devices );
@@ -1033,7 +1034,9 @@ static int efi_snp_probe ( struct net_device *netdev ) {
&efi_nii_protocol_guid, &snpdev->nii,
&efi_nii31_protocol_guid, &snpdev->nii,
&efi_component_name2_protocol_guid, &snpdev->name2,
+#ifdef EFI_PROTO_LOAD_FILE
&efi_load_file_protocol_guid, &snpdev->load_file,
+#endif
NULL ) ) != 0 ) {
rc = -EEFI ( efirc );
DBGC ( snpdev, "SNPDEV %p could not install protocols: "
@@ -1082,7 +1085,9 @@ static int efi_snp_probe ( struct net_device *netdev ) {
&efi_nii_protocol_guid, &snpdev->nii,
&efi_nii31_protocol_guid, &snpdev->nii,
&efi_component_name2_protocol_guid, &snpdev->name2,
+#ifdef EFI_PROTO_LOAD_FILE
&efi_load_file_protocol_guid, &snpdev->load_file,
+#endif
NULL );
err_install_protocol_interface:
free ( snpdev->path );