|
@@ -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
|
*
|