Skip to content

Commit

Permalink
[efi] Allow user experience to be downgraded
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mcb30 committed Jul 22, 2015
1 parent 88a5f56 commit a15c0d7
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/config/general.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#undef GDBSERIAL /* Remote GDB debugging over serial */
#undef GDBUDP /* Remote GDB debugging over UDP
* (both may be set) */
//#define EFI_DOWNGRADE_UX /* Downgrade UEFI user experience */

#include <config/named.h>
#include NAMED_CONFIG(general.h)
Expand Down
34 changes: 34 additions & 0 deletions src/interface/efi/efi_snp.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,47 @@ 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 );

/** 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
*
Expand Down

0 comments on commit a15c0d7

Please sign in to comment.