[syslinux] [PATCH] EFI booting may hang indefinitely when no keyboard is present

Oliver Wagner owagner at tellerulam.com
Sat Aug 15 04:03:37 PDT 2015


EFI booting may hang indefinitely when no keyboard is present on a 
machine (or when UEFI has chosen to not init USB due to fast boot). 
Reproducible at least with "EFI v2.31 by American Megatrends" on an 
Asrock H81M-ITX board.

Reason is the input draining loop near the end in efi/main.c; it calls 
ReadKeyStroke() as long as EFI_NOT_READY is not returned. On machines 
without keyboard, EFI_DEVICE_ERROR may be returned instead, causing 
infinite looping. Positively checking for EFI_SUCCESS keeps the intent 
while avoiding this behavior.

Patch is against 6.03; the issue is still present in 6.04 as per 
e466d2498604c8eea055a8e98284d65311073b39

Best Regards,
Olli

--- syslinux-6.03/efi/main.c.orig       2015-08-15 12:31:33.987766223 +0200
+++ syslinux-6.03/efi/main.c    2015-08-15 12:31:44.427993051 +0200
@@ -1324,7 +1324,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EF
         in = ST->ConIn;
         do {
                 status = uefi_call_wrapper(in->ReadKeyStroke, 2, in, &key);
-       } while (status != EFI_NOT_READY);
+       } while (status == EFI_SUCCESS);

         if (!setjmp(load_error_buf))
                 load_env32(NULL);


More information about the Syslinux mailing list