Skip to content

Commit a15c0d7

Browse files
committed
[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>
1 parent 88a5f56 commit a15c0d7

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

src/config/general.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
167167
#undef GDBSERIAL /* Remote GDB debugging over serial */
168168
#undef GDBUDP /* Remote GDB debugging over UDP
169169
* (both may be set) */
170+
//#define EFI_DOWNGRADE_UX /* Downgrade UEFI user experience */
170171

171172
#include <config/named.h>
172173
#include NAMED_CONFIG(general.h)

src/interface/efi/efi_snp.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,47 @@ FILE_LICENCE ( GPL2_OR_LATER );
3434
#include <ipxe/efi/efi_utils.h>
3535
#include <ipxe/efi/efi_snp.h>
3636
#include <usr/autoboot.h>
37+
#include <config/general.h>
3738

3839
/** List of SNP devices */
3940
static LIST_HEAD ( efi_snp_devices );
4041

4142
/** Network devices are currently claimed for use by iPXE */
4243
static int efi_snp_claimed;
4344

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+
4478
/**
4579
* Set EFI SNP mode state
4680
*

0 commit comments

Comments
 (0)