Browse Source

[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>
tags/v1.20.1
Michael Brown 9 years ago
parent
commit
a15c0d7e86
2 changed files with 35 additions and 0 deletions
  1. 1
    0
      src/config/general.h
  2. 34
    0
      src/interface/efi/efi_snp.c

+ 1
- 0
src/config/general.h View File

@@ -167,6 +167,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
167 167
 #undef	GDBSERIAL		/* Remote GDB debugging over serial */
168 168
 #undef	GDBUDP			/* Remote GDB debugging over UDP
169 169
 				 * (both may be set) */
170
+//#define EFI_DOWNGRADE_UX	/* Downgrade UEFI user experience */
170 171
 
171 172
 #include <config/named.h>
172 173
 #include NAMED_CONFIG(general.h)

+ 34
- 0
src/interface/efi/efi_snp.c View File

@@ -34,6 +34,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
34 34
 #include <ipxe/efi/efi_utils.h>
35 35
 #include <ipxe/efi/efi_snp.h>
36 36
 #include <usr/autoboot.h>
37
+#include <config/general.h>
37 38
 
38 39
 /** List of SNP devices */
39 40
 static LIST_HEAD ( efi_snp_devices );
@@ -41,6 +42,39 @@ static LIST_HEAD ( efi_snp_devices );
41 42
 /** Network devices are currently claimed for use by iPXE */
42 43
 static int efi_snp_claimed;
43 44
 
45
+/* Downgrade user experience if configured to do so
46
+ *
47
+ * The default UEFI user experience for network boot is somewhat
48
+ * excremental: only TFTP is available as a download protocol, and if
49
+ * anything goes wrong the user will be shown just a dot on an
50
+ * otherwise blank screen.  (Some programmer was clearly determined to
51
+ * win a bet that they could outshine Apple at producing uninformative
52
+ * error messages.)
53
+ *
54
+ * For comparison, the default iPXE user experience provides the
55
+ * option to use protocols designed more recently than 1980 (such as
56
+ * HTTP and iSCSI), and if anything goes wrong the the user will be
57
+ * shown one of over 1200 different error messages, complete with a
58
+ * link to a wiki page describing that specific error.
59
+ *
60
+ * We default to upgrading the user experience to match that available
61
+ * in a "legacy" BIOS environment, by installing our own instance of
62
+ * EFI_LOAD_FILE_PROTOCOL.
63
+ *
64
+ * Note that unfortunately we can't sensibly provide the choice of
65
+ * both options to the user in the same build, because the UEFI boot
66
+ * menu ignores the multitude of ways in which a network device handle
67
+ * can be described and opaquely labels both menu entries as just "EFI
68
+ * Network".
69
+ */
70
+#ifdef EFI_DOWNGRADE_UX
71
+static EFI_GUID dummy_load_file_protocol_guid = {
72
+	0x6f6c7323, 0x2077, 0x7523,
73
+	{ 0x6e, 0x68, 0x65, 0x6c, 0x70, 0x66, 0x75, 0x6c }
74
+};
75
+#define efi_load_file_protocol_guid dummy_load_file_protocol_guid
76
+#endif
77
+
44 78
 /**
45 79
  * Set EFI SNP mode state
46 80
  *

Loading…
Cancel
Save