Skip to contentSkip to conversation

efi_loader: Add console handle references to in/out/err

PATCH New Alexander Graf 2 participants 2 messages Sep 4, 2018 – Sep 5, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi_loader: Add console handle references to in/out/err

We register the console in/out protocol on the loaded image handle, but never tell anyone about it in the systab.

Because of this Shell.efi can not find the input protocol. So let's add a proper reference.

---
 lib/efi_loader/efi_console.c | 6 ++++++
 1 file changed, 6 insertions(+)
lib/efi_loader/efi_console.c +6 -0
index f5f3f256dd..277eb91e52 100644
@@ -604,17 +604,23 @@ int efi_console_register(void)
 	r = efi_create_handle((efi_handle_t *)&efi_console_output_obj);
 	if (r != EFI_SUCCESS)
 		goto out_of_memory;
+
 	r = efi_add_protocol(efi_console_output_obj->handle,
 			     &efi_guid_text_output_protocol, &efi_con_out);
 	if (r != EFI_SUCCESS)
 		goto out_of_memory;
+	systab.con_out_handle = efi_console_output_obj->handle;
+	systab.stderr_handle = efi_console_output_obj->handle;
+
 	r = efi_create_handle((efi_handle_t *)&efi_console_input_obj);
 	if (r != EFI_SUCCESS)
 		goto out_of_memory;
+
 	r = efi_add_protocol(efi_console_input_obj->handle,
 			     &efi_guid_text_input_protocol, &efi_con_in);
 	if (r != EFI_SUCCESS)
 		goto out_of_memory;
+	systab.con_in_handle = efi_console_input_obj->handle;
 
 	/* Create console events */
 	r = efi_create_event(EVT_NOTIFY_WAIT, TPL_CALLBACK, efi_key_notify,
Signature · 1 line
2.12.3