summaryrefslogtreecommitdiffstats
path: root/src/interface/efi/efi_snp.c
diff options
context:
space:
mode:
authorMichael Brown2015-07-22 21:25:17 +0200
committerMichael Brown2015-07-22 21:40:01 +0200
commita15c0d7e868a881d4416ad20eddad1854ff95005 (patch)
tree67b695d5382e66abe3c54ff34dd7a3a6ec753d97 /src/interface/efi/efi_snp.c
parent[efi] Fix receive and transmit completion reporting (diff)
downloadipxe-a15c0d7e868a881d4416ad20eddad1854ff95005.tar.gz
ipxe-a15c0d7e868a881d4416ad20eddad1854ff95005.tar.xz
ipxe-a15c0d7e868a881d4416ad20eddad1854ff95005.zip
[efi] Allow user experience to be downgraded
iPXE does not currently provide EFI_PXE_BASE_CODE_PROTOCOL: this causes failures when chainloading bootloaders such as shim.efi which assume that this protocol will be present. Provide the ability to work around these problems via the build configuration option EFI_DOWNGRADE_UX. If this option is enabled, then we will not install our usual EFI_LOAD_FILE_PROTOCOL implementation, thereby allowing the platform firmware to install its own EFI_PXE_BASE_CODE_PROTOCOL implementation on top of our EFI_SIMPLE_NETWORK_PROTOCOL handle. A somewhat major side-effect of this workaround is that almost all iPXE features will be disabled. This configuration option will be removed in future when support for EFI_PXE_BASE_CODE_PROTOCOL is added. Requested-by: Laszlo Ersek <lersek@redhat.com> Requested-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/interface/efi/efi_snp.c')
-rw-r--r--src/interface/efi/efi_snp.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/interface/efi/efi_snp.c b/src/interface/efi/efi_snp.c
index 7ec980e8..f3c45a95 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 );
@@ -41,6 +42,39 @@ static LIST_HEAD ( efi_snp_devices );
/** Network devices are currently claimed for use by iPXE */
static int efi_snp_claimed;
+/* Downgrade user experience if configured to do so
+ *
+ * The default UEFI user experience for network boot is somewhat
+ * excremental: only TFTP is available as a download protocol, and if
+ * anything goes wrong the user will be shown just a dot on an
+ * otherwise blank screen. (Some programmer was clearly determined to
+ * win a bet that they could outshine Apple at producing uninformative
+ * error messages.)
+ *
+ * For comparison, the default iPXE user experience provides the
+ * option to use protocols designed more recently than 1980 (such as
+ * HTTP and iSCSI), and if anything goes wrong the the user will be
+ * shown one of over 1200 different error messages, complete with a
+ * link to a wiki page describing that specific error.
+ *
+ * We default to upgrading the user experience to match that available
+ * in a "legacy" BIOS environment, by installing our own instance of
+ * EFI_LOAD_FILE_PROTOCOL.
+ *
+ * Note that unfortunately we can't sensibly provide the choice of
+ * both options to the user in the same build, because the UEFI boot
+ * menu ignores the multitude of ways in which a network device handle
+ * can be described and opaquely labels both menu entries as just "EFI
+ * Network".
+ */
+#ifdef EFI_DOWNGRADE_UX
+static EFI_GUID dummy_load_file_protocol_guid = {
+ 0x6f6c7323, 0x2077, 0x7523,
+ { 0x6e, 0x68, 0x65, 0x6c, 0x70, 0x66, 0x75, 0x6c }
+};
+#define efi_load_file_protocol_guid dummy_load_file_protocol_guid
+#endif
+
/**
* Set EFI SNP mode state
*