From 5d85fe49d5f7c5bf4f0bb0485c25f945b3bd6e57 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 21 Aug 2013 15:17:22 +0200 Subject: [PATCH] fall back to SimpleTextInputProtocol if we can't read a key --- src/efi/gummiboot.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/efi/gummiboot.c b/src/efi/gummiboot.c index 6b07f97..844ce5f 100644 --- a/src/efi/gummiboot.c +++ b/src/efi/gummiboot.c @@ -379,8 +379,14 @@ static EFI_STATUS key_read(UINT64 *key, BOOLEAN wait) { if (wait) uefi_call_wrapper(BS->WaitForEvent, 3, 1, &TextInputEx->WaitForKeyEx, &index); err = uefi_call_wrapper(TextInputEx->ReadKeyStrokeEx, 2, TextInputEx, &keydata); - if (EFI_ERROR(err)) + if (EFI_ERROR(err)) { + /* hmm, we waited but we could read a key; some firmwares seem + * to provide SimpleTextInputExProtocol but it does not do the + * right thing; just fall back to SimpleTextInputProtocol. */ + if (wait) + TextInputEx = NULL; return err; + } /* do not distinguish between left and right keys */ if (keydata.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) { -- 2.7.4