File tree 3 files changed +21
-0
lines changed
3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,12 @@ Variables you could set to customize the build:
45
45
shim has already verified the kernel when shim loaded the kernel as the
46
46
second stage loader. In such a case, and only in this case, you should
47
47
use DISABLE_EBS_PROTECTION=y to build.
48
+ - DISABLE_REMOVABLE_LOAD_OPTIONS
49
+ Do not parse load options when invoked as boot*.efi. This prevents boot
50
+ failures because of unexpected data in boot entries automatically generated
51
+ by firmware. It breaks loading non-default second-stage loaders when invoked
52
+ via that path, and requires using a binary named shim*.efi (or really anything
53
+ else).
48
54
- REQUIRE_TPM
49
55
if tpm logging or extends return an error code, treat that as a fatal error.
50
56
- ARCH
Original file line number Diff line number Diff line change @@ -153,6 +153,10 @@ ifneq ($(origin DISABLE_EBS_PROTECTION), undefined)
153
153
DEFINES += -DDISABLE_EBS_PROTECTION
154
154
endif
155
155
156
+ ifneq ($( origin DISABLE_REMOVABLE_LOAD_OPTIONS) , undefined)
157
+ DEFINES += -DDISABLE_REMOVABLE_LOAD_OPTIONS
158
+ endif
159
+
156
160
LIB_GCC = $( shell $( CC) $( ARCH_CFLAGS) -print-libgcc-file-name)
157
161
EFI_LIBS = -lefi -lgnuefi --start-group Cryptlib/libcryptlib.a Cryptlib/OpenSSL/libopenssl.a --end-group $( LIB_GCC)
158
162
FORMAT ? = --target efi-app-$( ARCH)
Original file line number Diff line number Diff line change @@ -1170,6 +1170,17 @@ EFI_STATUS set_second_stage (EFI_HANDLE image_handle)
1170
1170
return efi_status ;
1171
1171
}
1172
1172
1173
+ #if defined(DISABLE_REMOVABLE_LOAD_OPTIONS )
1174
+ /*
1175
+ * boot services build very strange load options, and we might misparse them,
1176
+ * causing boot failures on removable media.
1177
+ */
1178
+ if (is_removable_media_path (li )) {
1179
+ dprint ("Invoked from removable media path, ignoring boot options" );
1180
+ return EFI_SUCCESS ;
1181
+ }
1182
+ #endif
1183
+
1173
1184
efi_status = parse_load_options (li );
1174
1185
if (EFI_ERROR (efi_status )) {
1175
1186
perror (L"Failed to get load options: %r\n" , efi_status );
You can’t perform that action at this time.
0 commit comments